From 41966e351c90edc5a02780361ec7b4c9155265f9 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 29 Sep 2019 14:16:37 +0800 Subject: [PATCH] refactor: remove fancybox outelement span --- dist/quill.bubble.css | 2 +- dist/quill.core.css | 2 +- dist/quill.core.js | 4 ++-- dist/quill.js | 6 +++--- dist/quill.min.js | 4 ++-- dist/quill.min.js.map | 2 +- dist/quill.snow.css | 2 +- dist/unit.js | 6 +++--- formats/image.js | 16 ++++++---------- package.json | 5 +++-- 10 files changed, 23 insertions(+), 26 deletions(-) diff --git a/dist/quill.bubble.css b/dist/quill.bubble.css index 08b372e0ce..3f0a4b1d81 100644 --- a/dist/quill.bubble.css +++ b/dist/quill.bubble.css @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com diff --git a/dist/quill.core.css b/dist/quill.core.css index d8901e7d3e..1e3ff93ae2 100644 --- a/dist/quill.core.css +++ b/dist/quill.core.css @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com diff --git a/dist/quill.core.js b/dist/quill.core.js index 5a86df1f1d..cad193cb06 100644 --- a/dist/quill.core.js +++ b/dist/quill.core.js @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com @@ -278,7 +278,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nclass Module {\n constructor /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


\"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.12\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


\"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.14\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); /***/ }), diff --git a/dist/quill.js b/dist/quill.js index 70308a400b..921e89be1c 100644 --- a/dist/quill.js +++ b/dist/quill.js @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com @@ -608,7 +608,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nclass Module {\n constructor /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


\"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.12\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


\"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.14\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); /***/ }), @@ -764,7 +764,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blo /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static create(value) {\n const node = super.create(value);\n const span = document.createElement('span');\n\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n span.setAttribute('href', this.sanitize(value));\n span.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n\n if (value.originUrl) {\n span.setAttribute('href', this.sanitize(value.originUrl));\n span.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n\n span.setAttribute('data-fancybox-type', 'image');\n span.setAttribute('data-fancybox-group', 'editor');\n span.classList.add('fancybox');\n span.appendChild(node);\n return span;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return Object(_link__WEBPACK_IMPORTED_MODULE_1__[\"sanitize\"])(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n}\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Image);\n\n//# sourceURL=webpack://Quill/./formats/image.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static create(value) {\n const node = super.create(value);\n\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n node.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n\n if (value.originUrl) {\n node.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n\n node.setAttribute('data-fancybox-type', 'image');\n node.setAttribute('data-fancybox-group', 'editor');\n node.classList.add('fancybox');\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return Object(_link__WEBPACK_IMPORTED_MODULE_1__[\"sanitize\"])(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n}\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Image);\n\n//# sourceURL=webpack://Quill/./formats/image.js?"); /***/ }), diff --git a/dist/quill.min.js b/dist/quill.min.js index 1aca462242..ca003ab8e1 100644 --- a/dist/quill.min.js +++ b/dist/quill.min.js @@ -1,8 +1,8 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=41)}([function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=s(i(3)),r=s(i(1)),l=s(i(38)),o=s(i(39)),a=s(i(5)),c=String.fromCharCode(0),h=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var i={};return"string"==typeof t&&0===t.length?this:(i.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var i={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i)},t.prototype.push=function(t){var e=this.ops.length,i=this.ops[e-1];if(t=r.default(!0,{},t),"object"==typeof i){if("number"==typeof t.delete&&"number"==typeof i.delete)return this.ops[e-1]={delete:i.delete+t.delete},this;if("number"==typeof i.delete&&null!=t.insert&&(e-=1,"object"!=typeof(i=this.ops[e-1])))return this.ops.unshift(t),this;if(n.default(t.attributes,i.attributes)){if("string"==typeof t.insert&&"string"==typeof i.insert)return this.ops[e-1]={insert:i.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof i.retain)return this.ops[e-1]={retain:i.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],i=[];return this.forEach(function(s){(t(s)?e:i).push(s)}),[e,i]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.default.length(e):e.delete?t-e.delete:t},0)},t.prototype.length=function(){return this.reduce(function(t,e){return t+a.default.length(e)},0)},t.prototype.slice=function(e,i){void 0===e&&(e=0),void 0===i&&(i=1/0);for(var s=[],n=a.default.iterator(this.ops),r=0;r0&&s.next(l.retain-c)}for(var h=new t(r);i.hasNext()||s.hasNext();)if("insert"===s.peekType())h.push(s.next());else if("delete"===i.peekType())h.push(i.next());else{var u=Math.min(i.peekLength(),s.peekLength()),d=i.next(u),f=s.next(u);if("number"==typeof f.retain){var p={};"number"==typeof d.retain?p.retain=u:p.insert=d.insert;var m=o.default.compose(d.attributes,f.attributes,"number"==typeof d.retain);if(m&&(p.attributes=m),h.push(p),!s.hasNext()&&n.default(h.ops[h.ops.length-1],p)){var g=new t(i.rest());return h.concat(g).chop()}}else"number"==typeof f.delete&&"number"==typeof d.retain&&h.push(f)}return h.chop()},t.prototype.concat=function(e){var i=new t(this.ops.slice());return e.ops.length>0&&(i.push(e.ops[0]),i.ops=i.ops.concat(e.ops.slice(1))),i},t.prototype.diff=function(e,i){if(this.ops===e.ops)return new t;var s=[this,e].map(function(t){return t.map(function(i){if(null!=i.insert)return"string"==typeof i.insert?i.insert:c;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),r=new t,h=l.default(s[0],s[1],i),u=a.default.iterator(this.ops),d=a.default.iterator(e.ops);return h.forEach(function(t){for(var e=t[1].length;e>0;){var i=0;switch(t[0]){case l.default.INSERT:i=Math.min(d.peekLength(),e),r.push(d.next(i));break;case l.default.DELETE:i=Math.min(e,u.peekLength()),u.next(i),r.delete(i);break;case l.default.EQUAL:i=Math.min(u.peekLength(),d.peekLength(),e);var s=u.next(i),a=d.next(i);n.default(s.insert,a.insert)?r.retain(i,o.default.diff(s.attributes,a.attributes)):r.push(a).delete(i)}e-=i}}),r.chop()},t.prototype.eachLine=function(e,i){void 0===i&&(i="\n");for(var s=a.default.iterator(this.ops),n=new t,r=0;s.hasNext();){if("insert"!==s.peekType())return;var l=s.peek(),o=a.default.length(l)-s.peekLength(),c="string"==typeof l.insert?l.insert.indexOf(i,o)-o:-1;if(c<0)n.push(s.next());else if(c>0)n.push(s.next(c));else{if(!1===e(n,s.next(1).attributes||{},r))return;r+=1,n=new t}}n.length()>0&&e(n,{},r)},t.prototype.invert=function(e){var i=new t;return this.reduce(function(t,s){if(s.insert)i.delete(a.default.length(s));else{if(s.retain&&null==s.attributes)return i.retain(s.retain),t+s.retain;if(s.delete||s.retain&&s.attributes){var n=s.delete||s.retain;return e.slice(t,t+n).forEach(function(t){s.delete?i.push(t):s.retain&&s.attributes&&i.retain(a.default.length(t),o.default.invert(s.attributes,t.attributes))}),t+n}}return t},0),i.chop()},t.prototype.transform=function(e,i){if(void 0===i&&(i=!1),i=!!i,"number"==typeof e)return this.transformPosition(e,i);for(var s=e,n=a.default.iterator(this.ops),r=a.default.iterator(s.ops),l=new t;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!i&&"insert"===r.peekType())if("insert"===r.peekType())l.push(r.next());else{var c=Math.min(n.peekLength(),r.peekLength()),h=n.next(c),u=r.next(c);if(h.delete)continue;u.delete?l.push(u):l.retain(c,o.default.transform(h.attributes,u.attributes,i))}else l.retain(a.default.length(n.next()));return l.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var i=a.default.iterator(this.ops),s=0;i.hasNext()&&s<=t;){var n=i.peekLength(),r=i.peekType();i.next(),"delete"!==r?("insert"===r&&(s=0;c--)if(u[c]!=d[c])return!1;for(c=u.length-1;c>=0;c--)if(h=u[c],!l(t[h],e[h],i))return!1;return typeof t==typeof e}(t,e,i))};function o(t){return null==t}function a(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},function(t,e){t.exports=' '},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n,r=s(i(40));!function(t){t.iterator=function(t){return new r.default(t)},t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}}(n||(n={})),e.default=n},function(t,e){"use strict";var i=Object.prototype.hasOwnProperty,s="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function l(t,e,i,n,l){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,n||t,l),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(s=!1)),a.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,l=new Array(r);n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){function i(t){var e=[];for(var i in t)e.push(i);return e}(t.exports="function"==typeof Object.keys?Object.keys:i).shim=i},function(t,e){var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function s(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function n(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=i?s:n).supported=s,e.unsupported=n},function(t,e){var i=-1,s=1,n=0;function r(t,e,c,h){if(t===e)return t?[[n,t]]:[];if(null!=c){var p=function(t,e,i){var s="number"==typeof i?{index:i,length:0}:i.oldRange,n="number"==typeof i?null:i.newRange,r=t.length,l=e.length;if(0===s.length&&(null===n||0===n.length)){var o=s.index,a=t.slice(0,o),c=t.slice(o),h=n?n.index:null,u=o+l-r;if((null===h||h===u)&&!(u<0||u>l)){var d=e.slice(0,u),p=e.slice(u);if(p===c){var m=Math.min(o,u),g=a.slice(0,m),b=d.slice(0,m);if(g===b){var y=a.slice(m),v=d.slice(m);return f(g,y,v,c)}}}if(null===h||h===o){var x=o,d=e.slice(0,x),p=e.slice(x);if(d===a){var N=Math.min(r-x,l-x),q=c.slice(c.length-N),E=p.slice(p.length-N);if(q===E){var y=c.slice(0,c.length-N),v=p.slice(0,p.length-N);return f(a,y,v,q)}}}}if(s.length>0&&n&&0===n.length){var g=t.slice(0,s.index),q=t.slice(s.index+s.length),m=g.length,N=q.length;if(!(le.length?t:e,u=t.length>e.length?e:t,d=h.indexOf(u);if(-1!==d)return c=[[s,h.substring(0,d)],[n,u],[s,h.substring(d+u.length)]],t.length>e.length&&(c[0][0]=c[2][0]=i),c;if(1===u.length)return[[i,t],[s,e]];var f=function(t,e){var i=t.length>e.length?t:e,s=t.length>e.length?e:t;if(i.length<4||2*s.length=t.length?[s,n,r,l,u]:null}var r,l,c,h,u,d=n(i,s,Math.ceil(i.length/4)),f=n(i,s,Math.ceil(i.length/2));if(!d&&!f)return null;r=f?d&&d[4].length>f[4].length?d:f:d;t.length>e.length?(l=r[0],c=r[1],h=r[2],u=r[3]):(h=r[0],u=r[1],l=r[2],c=r[3]);var p=r[4];return[l,c,h,u,p]}(t,e);if(f){var p=f[0],m=f[1],g=f[2],b=f[3],y=f[4],v=r(p,g),x=r(m,b);return v.concat([[n,y]],x)}return function(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),a=o,c=2*o,h=new Array(c),u=new Array(c),d=0;dn)g+=2;else if(q>r)m+=2;else if(p){var E=a+f-x;if(E>=0&&E=A)return l(t,e,L,q)}}}for(var w=-v+b;w<=v-y;w+=2){for(var E=a+w,k=(A=w===-v||w!==v&&u[E-1]n)y+=2;else if(k>r)b+=2;else if(!p){var N=a+f-w;if(N>=0&&N=(A=n-A))return l(t,e,L,q)}}}}return[[i,t],[s,e]]}(t,e)}(t=t.substring(0,t.length-m),e=e.substring(0,e.length-m));return g&&y.unshift([n,g]),b&&y.push([n,b]),function t(e,r){e.push([n,""]);var l=0;var c=0;var h=0;var f="";var p="";var m;for(;l=0&&d(e[g][1])){var b=e[g][1].slice(-1);if(e[g][1]=e[g][1].slice(0,-1),f=b+f,p=b+p,!e[g][1]){e.splice(g,1),l--;var y=g-1;e[y]&&e[y][0]===s&&(h++,p=e[y][1]+p,y--),e[y]&&e[y][0]===i&&(c++,f=e[y][1]+f,y--),g=y}}if(u(e[l][1])){var b=e[l][1].charAt(0);e[l][1]=e[l][1].slice(1),f+=b,p+=b}}if(l0||p.length>0){f.length>0&&p.length>0&&(0!==(m=o(p,f))&&(g>=0?e[g][1]+=p.substring(0,m):(e.splice(0,0,[n,p.substring(0,m)]),l++),p=p.substring(m),f=f.substring(m)),0!==(m=a(p,f))&&(e[l][1]=p.substring(p.length-m)+e[l][1],p=p.substring(0,p.length-m),f=f.substring(0,f.length-m)));var v=h+c;0===f.length&&0===p.length?(e.splice(l-v,v),l-=v):0===f.length?(e.splice(l-v,v,[s,p]),l=l-v+1):0===p.length?(e.splice(l-v,v,[i,f]),l=l-v+1):(e.splice(l-v,v,[i,f],[s,p]),l=l-v+2)}0!==l&&e[l-1][0]===n?(e[l-1][1]+=e[l][1],e.splice(l,1)):l++,h=0,c=0,f="",p=""}""===e[e.length-1][1]&&e.pop();var x=!1;l=1;for(;l=55296&&t<=56319}function h(t){return t>=56320&&t<=57343}function u(t){return h(t.charCodeAt(0))}function d(t){return c(t.charCodeAt(t.length-1))}function f(t,e,r,l){return d(t)||u(l)?null:function(t){for(var e=[],i=0;i0&&e.push(t[i]);return e}([[n,t],[i,e],[s,r],[n,l]])}function p(t,e,i){return r(t,e,i,!0)}p.INSERT=s,p.DELETE=i,p.EQUAL=n,t.exports=p},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n,r=s(i(3)),l=s(i(1));!function(t){t.compose=function(t,e,i){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var s=l.default(!0,{},e);for(var n in i||(s=Object.keys(s).reduce(function(t,e){return null!=s[e]&&(t[e]=s[e]),t},{})),t)void 0!==t[n]&&void 0===e[n]&&(s[n]=t[n]);return Object.keys(s).length>0?s:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var i=Object.keys(t).concat(Object.keys(e)).reduce(function(i,s){return r.default(t[s],e[s])||(i[s]=void 0===e[s]?null:e[s]),i},{});return Object.keys(i).length>0?i:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var i=Object.keys(e).reduce(function(i,s){return e[s]!==t[s]&&void 0!==t[s]&&(i[s]=e[s]),i},{});return Object.keys(t).reduce(function(i,s){return t[s]!==e[s]&&void 0===e[s]&&(i[s]=null),i},i)},t.transform=function(t,e,i){if(void 0===i&&(i=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!i)return e;var s=Object.keys(e).reduce(function(i,s){return void 0===t[s]&&(i[s]=e[s]),i},{});return Object.keys(s).length>0?s:void 0}}}(n||(n={})),e.default=n},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=s(i(5)),r=function(){function t(t){this.ops=t,this.index=0,this.offset=0}return t.prototype.hasNext=function(){return this.peekLength()<1/0},t.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var i=this.offset,s=n.default.length(e);if(t>=s-i?(t=s-i,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var r={};return e.attributes&&(r.attributes=e.attributes),"number"==typeof e.retain?r.retain=t:"string"==typeof e.insert?r.insert=e.insert.substr(i,t):r.insert=e.insert,r}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,i=this.next(),s=this.ops.slice(this.index);return this.offset=t,this.index=e,[i].concat(s)}return[]},t}();e.default=r},function(t,e,i){"use strict";i.r(e);var s={};i.r(s),i.d(s,"ParentBlot",function(){return m}),i.d(s,"ContainerBlot",function(){return b}),i.d(s,"LeafBlot",function(){return v}),i.d(s,"EmbedBlot",function(){return O}),i.d(s,"ScrollBlot",function(){return B}),i.d(s,"BlockBlot",function(){return S}),i.d(s,"InlineBlot",function(){return L}),i.d(s,"TextBlot",function(){return _}),i.d(s,"Attributor",function(){return x}),i.d(s,"ClassAttributor",function(){return q}),i.d(s,"StyleAttributor",function(){return A}),i.d(s,"AttributorStore",function(){return w}),i.d(s,"Registry",function(){return h}),i.d(s,"Scope",function(){return o});var n,r=i(0),l=i.n(r);!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(n||(n={}));var o=n;var a=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){this.insertBefore(t[0],null),t.length>1&&this.append.apply(this,t.slice(1))}at(t){const e=this.iterator();let i=e();for(;i&&t>0;)t-=1,i=e();return i}contains(t){const e=this.iterator();let i=e();for(;i;){if(i===t)return!0;i=e()}return!1}indexOf(t){const e=this.iterator();let i=e(),s=0;for(;i;){if(i===t)return s;s+=1,i=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,i=this.head;for(;null!=i;){if(i===t)return e;e+=i.length(),i=i.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const i=this.iterator();let s=i();for(;s;){const n=s.length();if(tr?i(o,t-r,Math.min(e,r+s-t)):i(o,0,Math.min(s,t+e-r)),r+=s,o=l()}}map(t){return this.reduce((e,i)=>(e.push(t(i)),e),[])}reduce(t,e){const i=this.iterator();let s=i();for(;s;)e=t(e,s),s=i();return e}};class c extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}class h{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){return null==t?null:this.blots.has(t)?this.blots.get(t)||null:e?this.find(t.parentNode,e):null}create(t,e,i){const s=this.query(e);if(null==s)throw new c(`Unable to create ${e} blot`);const n=s,r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:n.create(i),l=new n(t,r,i);return h.blots.set(l.domNode,l),l}find(t,e=!1){return h.find(t,e)}query(t,e=o.ANY){let i;if("string"==typeof t)i=this.types[t]||this.attributes[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)i=this.types.text;else if("number"==typeof t)t&o.LEVEL&o.BLOCK?i=this.types.block:t&o.LEVEL&o.INLINE&&(i=this.types.inline);else if(t instanceof HTMLElement){(t.getAttribute("class")||"").split(/\s+/).some(t=>!!(i=this.classes[t])),i=i||this.tags[t.tagName]}return null==i?null:e&o.LEVEL&i.scope&&e&o.TYPE&i.scope?i:null}register(...t){if(t.length>1)return t.map(t=>this.register(t));const e=t[0];if("string"!=typeof e.blotName&&"string"!=typeof e.attrName)throw new c("Invalid definition");if("abstract"===e.blotName)throw new c("Cannot register abstract class");if(this.types[e.blotName||e.attrName]=e,"string"==typeof e.keyName)this.attributes[e.keyName]=e;else if(null!=e.className&&(this.classes[e.className]=e),null!=e.tagName){Array.isArray(e.tagName)?e.tagName=e.tagName.map(t=>t.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{null!=this.tags[t]&&null!=e.className||(this.tags[t]=e)})}return e}}h.blots=new WeakMap;class u{constructor(t,e){this.scroll=t,this.domNode=e,h.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new c("Blot definition missing tagName");let e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t,10).toString()===t&&(t=parseInt(t,10))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),h.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,i,s){const n=this.isolate(t,e);if(null!=this.scroll.query(i,o.BLOT)&&s)n.wrap(i,s);else if(null!=this.scroll.query(i,o.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);n.wrap(t),t.format(i,s)}}insertAt(t,e,i){const s=null==i?this.scroll.create("text",e):this.scroll.create(e,i),n=this.split(t);this.parent.insertBefore(s,n||void 0)}isolate(t,e){const i=this.split(t);if(null==i)throw new Error("Attempt to isolate at end");return i.split(e),i}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(i,this.next||void 0),this.remove()),i}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(i,this.next||void 0),"function"!=typeof i.appendChild)throw new c(`Cannot wrap ${t}`);return i.appendChild(this),i}}u.blotName="abstract";var d=u;class f extends d{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,f.uiClass&&this.uiNode.classList.add(f.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new a,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=p(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof c)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,i)=>{t.deleteAt(e,i)})}descendant(t,e=0){const[i,s]=this.children.find(e);return null==t.blotName&&t(i)||null!=t.blotName&&i instanceof t?[i,s]:i instanceof f?i.descendant(t,s):[null,-1]}descendants(t,e=0,i=Number.MAX_VALUE){let s=[],n=i;return this.children.forEachAt(e,i,(e,i,r)=>{(null==t.blotName&&t(e)||null!=t.blotName&&e instanceof t)&&s.push(e),e instanceof f&&(s=s.concat(e.descendants(t,i,n))),n-=r}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{if(t)return;this.statics.allowedChildren.some(t=>e instanceof t)||(e.statics.scope===o.BLOCK_BLOT?(null!=e.next&&this.splitAfter(e),null!=e.prev&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof f?e.unwrap():e.remove())})}formatAt(t,e,i,s){this.children.forEachAt(t,e,(t,e,n)=>{t.formatAt(e,n,i,s)})}insertAt(t,e,i){const[s,n]=this.children.find(t);if(s)s.insertAt(n,e,i);else{const t=null==i?this.scroll.create("text",e):this.scroll.create(e,i);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let i=null;this.children.insertBefore(t,e||null),null!=e&&(i=e.domNode),this.domNode.parentNode===t.domNode&&this.domNode.nextSibling===i||this.domNode.insertBefore(t.domNode,i),t.parent=this,t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(i=>{t.insertBefore(i,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(t,e=!1){const[i,s]=this.children.find(t,e),n=[[this,t]];return i instanceof f?n.concat(i.path(s,e)):(null!=i&&n.push([i,s]),n)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return i instanceof f&&this.moveChildren(i),super.replaceWith(i)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.clone();return this.parent&&this.parent.insertBefore(i,this.next||void 0),this.children.forEachAt(t,this.length(),(t,s,n)=>{const r=t.split(s,e);null!=r&&i.appendChild(r)}),i}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const i=[],s=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(i.push.apply(i,t.addedNodes),s.push.apply(s,t.removedNodes))}),s.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==this.domNode||e.detach())}),i.filter(t=>t.parentNode===this.domNode||t===this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const i=p(t,this.scroll);i.next===e&&null!=i.next||(null!=i.parent&&i.parent.removeChild(this),this.insertBefore(i,e||void 0))}),this.enforceAllowedChildren()}}function p(t,e){let i=e.find(t);if(null==i)try{i=e.create(t)}catch(s){i=e.create(o.INLINE),Array.from(t.childNodes).forEach(t=>{i.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(i.domNode,t),i.attach()}return i}f.uiClass="";var m=f;class g extends m{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,i,s){super.formatAt(t,e,i,s),this.enforceAllowedChildren()}insertAt(t,e,i){super.insertAt(t,e,i),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}}g.blotName="container",g.scope=o.BLOCK_BLOT;var b=g;class y extends d{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let i=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(i+=1),[this.parent.domNode,i]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}}y.scope=o.INLINE_BLOT;var v=y;class x{static keys(t){return Array.from(t.attributes).map(t=>t.name)}constructor(t,e,i={}){this.attrName=t,this.keyName=e;const s=o.TYPE&o.ATTRIBUTE;this.scope=null!=i.scope?i.scope&o.LEVEL|s:o.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}function N(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf(`${e}-`))}var q=class extends x{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){N(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(N(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function E(t){const e=t.split("-"),i=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+i}var A=class extends x{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[E(this.keyName)]=e,!0)}remove(t){t.style[E(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[E(this.keyName)];return this.canAdd(t,e)?e:""}};var w=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=h.find(this.domNode);if(null==t)return;const e=x.keys(this.domNode),i=q.keys(this.domNode),s=A.keys(this.domNode);e.concat(i).concat(s).forEach(e=>{const i=t.scroll.query(e,o.ATTRIBUTE);i instanceof x&&(this.attributes[i.attrName]=i)})}copy(t){Object.keys(this.attributes).forEach(e=>{const i=this.attributes[e].value(this.domNode);t.format(e,i)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}};class k extends m{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const i=e.query(k.blotName);if(null==i||t.tagName!==i.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){if(t!==this.statics.blotName||e){const i=this.scroll.query(t,o.INLINE);if(null==i)return;i instanceof x?this.attributes.attribute(i,e):!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e)}else this.children.forEach(t=>{t instanceof k||(t=t.wrap(k.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,s){if(null!=this.formats()[i]||this.scroll.query(i,o.ATTRIBUTE)){this.isolate(t,e).format(i,s)}else super.formatAt(t,e,i,s)}optimize(t){super.optimize(t);const e=this.formats();if(0===Object.keys(e).length)return this.unwrap();const i=this.next;i instanceof k&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}(e,i.formats())&&(i.moveChildren(this),i.remove())}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(t,e){const i=super.wrap(t,e);return i instanceof k&&this.attributes.move(i),i}}k.allowedChildren=[k,v],k.blotName="inline",k.scope=o.INLINE_BLOT,k.tagName="SPAN";var L=k;class T extends m{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const i=e.query(T.blotName);if(null==i||t.tagName!==i.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){const i=this.scroll.query(t,o.BLOCK);null!=i&&(i instanceof x?this.attributes.attribute(i,e):t!==this.statics.blotName||e?!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e):this.replaceWith(T.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,s){null!=this.scroll.query(i,o.BLOCK)?this.format(i,s):super.formatAt(t,e,i,s)}insertAt(t,e,i){if(null==i||null!=this.scroll.query(e,o.INLINE))super.insertAt(t,e,i);else{const s=this.split(t);if(null==s)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,i);s.parent.insertBefore(t,s)}}}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}}T.blotName="block",T.scope=o.BLOCK_BLOT,T.tagName="P",T.allowedChildren=[L,T,v];var S=T;var O=class extends v{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,i,s){0===t&&e===this.length()?this.format(i,s):super.formatAt(t,e,i,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}};const C={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},R=100;class I extends m{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,C),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){return this.registry.find(t,e)}query(t,e=o.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,i,s){this.update(),super.formatAt(t,e,i,s)}insertAt(t,e,i){this.update(),super.insertAt(t,e,i)}optimize(t=[],e={}){super.optimize(e);const i=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const n=(t,e=!0)=>{null!=t&&t!==this&&null!=t.domNode.parentNode&&(i.has(t.domNode)||i.set(t.domNode,[]),e&&n(t.parent))},r=t=>{i.has(t.domNode)&&(t instanceof m&&t.children.forEach(r),i.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=R)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(n(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);n(e,!1),e instanceof m&&e.children.forEach(t=>{n(t,!1)})})):"attributes"===t.type&&n(e.prev)),n(e))}),this.children.forEach(r),s=(l=Array.from(this.observer.takeRecords())).slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const i=new WeakMap;t.map(t=>{const e=h.find(t.target,!0);return null==e?null:i.has(e.domNode)?(i.get(e.domNode).push(t),null):(i.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&i.has(t.domNode)&&t.update(i.get(t.domNode)||[],e)}),e.mutationsMap=i,i.has(this.domNode)&&super.update(i.get(this.domNode),e),this.optimize(t,e)}}I.blotName="scroll",I.defaultChild=S,I.allowedChildren=[S,b],I.scope=o.BLOCK_BLOT,I.tagName="DIV";var B=I;class M extends v{constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}static create(t){return document.createTextNode(t)}static value(t){return t.data}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,i){null==i?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,i)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof M&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(i,this.next||void 0),this.text=this.statics.value(this.domNode),i}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}}M.blotName="text",M.scope=o.INLINE_BLOT;var _=M,D=i(1),j=i.n(D),U=i(2),P=i.n(U),H=i(3),F=i.n(H),z=i(6),K=i.n(z),V=new WeakMap;const W=["error","warn","log","info"];let Z="warn";function G(t){if(W.indexOf(t)<=W.indexOf(Z)){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s(e[i]=G.bind(console,i,t),e),{})}$.level=(t=>{Z=t}),G.level=$.level;var X=$;const Y=X("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(t=>{document.addEventListener(t,function(){for(var t=arguments.length,e=new Array(t),i=0;i{const i=V.get(t);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class Q extends K.a{constructor(){super(),this.listeners={},this.on("error",Y.error)}emit(){for(var t=arguments.length,e=new Array(t),i=0;i1?e-1:0),s=1;s{let s=e.node,n=e.handler;(t.target===s||s.contains(t.target))&&n(t,...i)})}listenDOM(t,e,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:i})}}Q.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},Q.sources={API:"api",SILENT:"silent",USER:"user"};var J=Q;class tt extends O{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}tt.blotName="break",tt.tagName="BR";var et=tt;class it extends _{}function st(t){return t.replace(/[&<>"']/g,t=>{return{"&":"&","<":"<",">":">",'"':""","'":"'"}[t]})}class nt extends L{static compare(t,e){const i=nt.order.indexOf(t),s=nt.order.indexOf(e);return i>=0||s>=0?i-s:t===e?0:t0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}nt.allowedChildren=[nt,et,O,it],nt.order=["cursor","inline","underline","strike","italic","bold","script","link","code"];var rt=nt;const lt=1;class ot extends S{constructor(t,e){super(t,e),this.cache={}}delta(){return null==this.cache.delta&&(this.cache.delta=ct(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,i,s){e<=0||(this.scroll.query(i,o.BLOCK)?t+e===this.length()&&this.format(i,s):super.formatAt(t,Math.min(e,this.length()-t-1),i,s),this.cache={})}insertAt(t,e,i){if(null!=i)return super.insertAt(t,e,i),void(this.cache={});if(0===e.length)return;const s=e.split("\n"),n=s.shift();n.length>0&&(t((r=r.split(t,!0)).insertAt(0,e),e.length),t+n.length)}insertBefore(t,e){const i=this.children.head;super.insertBefore(t,e),i instanceof et&&i.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+lt),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-lt)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const i=super.split(t,e);return this.cache={},i}}ot.blotName="block",ot.tagName="P",ot.defaultChild=et,ot.allowedChildren=[et,rt,O,it];class at extends O{attach(){super.attach(),this.attributes=new w(this.domNode)}delta(){return(new l.a).insert(this.value(),j()(this.formats(),this.attributes.values()))}format(t,e){const i=this.scroll.query(t,o.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,e)}formatAt(t,e,i,s){this.format(i,s)}insertAt(t,e,i){if("string"==typeof e&&e.endsWith("\n")){const i=this.scroll.create(ot.blotName);this.parent.insertBefore(i,0===t?this:this.next),i.insertAt(0,e.slice(0,-1))}else super.insertAt(t,e,i)}}function ct(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(v).reduce((t,i)=>0===i.length()?t:t.insert(i.value(),ht(i,{},e)),new l.a).insert("\n",ht(t))}function ht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("function"==typeof t.formats&&(e=j()(e,t.formats()),i&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:ht(t.parent,e,i))}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}at.scope=o.BLOCK_BLOT;const dt=X("quill:selection");class ft{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class pt{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new ft(0,0),this.lastRange=this.savedRange,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,J.sources.USER),1)}),this.emitter.on(J.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(J.events.SCROLL_UPDATE,()=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset),this.update(J.sources.SILENT)}catch(t){}})}),this.emitter.on(J.events.SCROLL_OPTIMIZE,(t,e)=>{if(e.range){const t=e.range,i=t.startNode,s=t.startOffset,n=t.endNode,r=t.endOffset;this.setNativeRange(i,s,n,r),this.update(J.sources.SILENT)}}),this.update(J.sources.SILENT)}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t.statics.blotName===ot.blotName&&(!(t.children.length>1)&&t.children.head instanceof et)}handleComposition(){this.root.addEventListener("compositionstart",()=>{this.root.classList.toggle("ql-blank",!1),this.composing=!0,this.scroll.batchStart()}),this.root.addEventListener("compositionend",()=>{setTimeout(()=>{if(this.root.classList.toggle("ql-blank",this.isBlank()),this.scroll.batchEnd(),this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}},1)})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(J.sources.USER)})}focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!this.scroll.query(t,o.BLOCK)){if(i.start.node!==this.cursor.textNode){const t=this.scroll.find(i.start.node,!1);if(null==t)return;if(t instanceof v){const e=t.split(i.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,i.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=this.scroll.length();let s;t=Math.min(t,i-1),e=Math.min(t+e,i-1)-t;let n=ut(this.scroll.leaf(t),2),r=n[0],l=n[1];if(null==r)return null;var o=ut(r.position(l,!0),2);s=o[0],l=o[1];const a=document.createRange();if(e>0){a.setStart(s,l);var c=ut(this.scroll.leaf(t+e),2);if(r=c[0],l=c[1],null==r)return null;var h=ut(r.position(l,!0),2);return s=h[0],l=h[1],a.setEnd(s,l),a.getBoundingClientRect()}let u,d="left";return s instanceof Text?(l0&&(d="right")),{bottom:u.top+u.height,height:u.height,left:u[d],right:u[d],top:u.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const i=this.normalizeNative(e);return dt.info("getNativeRange",i),i}getRange(){const t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||mt(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const i=e.map(t=>{const e=ut(t,2),i=e[0],s=e[1],n=this.scroll.find(i,!0),r=n.offset(this.scroll);return 0===s?r:n instanceof v?r+n.index(i,s):r+n.length()}),s=Math.min(Math.max(...i),this.scroll.length()-1),n=Math.min(s,...i);return new ft(n,s-n)}normalizeNative(t){if(!mt(this.root,t.startContainer)||!t.collapsed&&!mt(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(t=>{let e=t.node,i=t.offset;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>i)e=e.childNodes[i],i=0;else{if(e.childNodes.length!==i)break;i=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=i}),e}rangeToNative(t){const e=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],s=this.scroll.length();return e.forEach((t,e)=>{t=Math.min(s-1,t);const n=ut(this.scroll.leaf(t),2),r=n[0],l=n[1],o=ut(r.position(l,0!==e),2),a=o[0],c=o[1];i.push(a,c)}),i.length<2?i.concat(i):i}scrollIntoView(t){const e=this.lastRange;if(null==e)return;const i=this.getBounds(e.index,e.length);if(null==i)return;const s=this.scroll.length()-1,n=ut(this.scroll.line(Math.min(e.index,s)),1)[0];let r=n;e.length>0&&(r=ut(this.scroll.line(Math.min(e.index+e.length,s)),1)[0]);if(null==n||null==r)return;const l=t.getBoundingClientRect();i.topl.bottom&&(t.scrollTop+=i.bottom-l.bottom)}setNativeRange(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(dt.info("setNativeRange",t,e,i,s),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==i.parentNode))return;const r=document.getSelection();if(null!=r)if(null!=t){this.hasFocus()||this.root.focus();const l=(this.getNativeRange()||{}).native;if(null==l||n||t!==l.startContainer||e!==l.startOffset||i!==l.endContainer||s!==l.endOffset){"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),"BR"===i.tagName&&(s=Array.from(i.parentNode.childNodes).indexOf(i),i=i.parentNode);const n=document.createRange();n.setStart(t,e),n.setEnd(i,s),r.removeAllRanges(),r.addRange(n)}}else r.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J.sources.API;if("string"==typeof e&&(i=e,e=!1),dt.info("setRange",t),null!=t){const i=this.rangeToNative(t);this.setNativeRange(...i,e)}else this.setNativeRange(null);this.update(i)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J.sources.USER;const e=this.lastRange,i=ut(this.getRange(),2),s=i[0],n=i[1];if(this.lastRange=s,null!=this.lastRange&&(this.savedRange=this.lastRange),!F()(e,this.lastRange)){if(!this.composing&&null!=n&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const i=[J.events.SELECTION_CHANGE,P()(this.lastRange),P()(e),t];this.emitter.emit(J.events.EDITOR_CHANGE,...i),t!==J.sources.SILENT&&this.emitter.emit(...i)}}}function mt(t,e){try{e.parentNode}catch(t){return!1}return t.contains(e)}class gt extends O{static value(){}constructor(t,e,i){super(t,e),this.selection=i,this.textNode=document.createTextNode(gt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let i=this,s=0;for(;null!=i&&i.statics.scope!==o.BLOCK_BLOT;)s+=i.offset(i.parent),i=i.parent;null!=i&&(this.savedLength=gt.CONTENTS.length,i.optimize(),i.formatAt(s,gt.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof it?this.prev:null,i=e?e.length():0,s=this.next instanceof it?this.next:null,n=s?s.text:"",r=this.textNode,l=r.data.split(gt.CONTENTS).join("");let o;if(r.data=gt.CONTENTS,e)o=e,(l||s)&&(e.insertAt(e.length(),l+n),s&&s.remove());else if(s)o=s,s.insertAt(0,l);else{const t=document.createTextNode(l);o=this.scroll.create(t),this.parent.insertBefore(o,this)}if(this.remove(),t){const n=(t,n)=>e&&t===e.domNode?n:t===r?i+n-1:s&&t===s.domNode?i+l.length+n:null,a=n(t.start.node,t.start.offset),c=n(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:o.domNode,startOffset:a,endNode:o.domNode,endOffset:c}}return null}update(t,e){if(t.some(t=>"characterData"===t.type&&t.target===this.textNode)){const t=this.restore();t&&(e.range=t)}}value(){return""}}gt.blotName="cursor",gt.className="ql-cursor",gt.tagName="span",gt.CONTENTS="\ufeff";var bt=gt;function yt(t){return Nt(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||xt()}function vt(t,e){return Nt(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||xt()}function xt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Nt(t){if(Array.isArray(t))return t}const qt=/^[ -~]*$/;function Et(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"==typeof t.html)return t.html(e,i);if(t instanceof it)return st(t.value().slice(e,e+i));if(t.children){if("list-container"===t.statics.blotName){const s=[];return t.children.forEachAt(e,i,(t,e,i)=>{const n=t.formats();s.push({child:t,offset:e,length:i,indent:n.indent||0,type:n.list})}),function t(e,i,s){if(0===e.length){const e=vt(wt(s.pop()),1)[0];return i<=0?""):"").concat(t([],i-1,s))}const n=yt(e),r=n[0],l=r.child,o=r.offset,a=r.length,c=r.indent,h=r.type,u=n.slice(1),d=vt(wt(h),2),f=d[0],p=d[1];if(c>i)return s.push(h),c===i+1?"<".concat(f,">").concat(Et(l,o,a)).concat(t(u,c,s)):"<".concat(f,">
  • ").concat(t(e,i+1,s));const m=s[s.length-1];if(c===i&&h===m)return"
  • ").concat(Et(l,o,a)).concat(t(u,c,s));const g=vt(wt(s.pop()),1)[0];return"").concat(t(e,i-1,s))}(s,-1,[])}const n=[];if(t.children.forEachAt(e,i,(t,e,i)=>{n.push(Et(t,e,i))}),s||"list"===t.statics.blotName)return n.join("");const r=t.domNode,l=r.outerHTML,o=r.innerHTML,a=vt(l.split(">".concat(o,"<")),2),c=a[0],h=a[1];return"'.concat(n.join(""),"<").concat(h):"".concat(c,">").concat(n.join(""),"<").concat(h)}return t.domNode.outerHTML}function At(t,e){return Object.keys(e).reduce((i,s)=>null==t[s]?i:(e[s]===t[s]?i[s]=e[s]:Array.isArray(e[s])?e[s].indexOf(t[s])<0&&(i[s]=e[s].concat([t[s]])):i[s]=[e[s],t[s]],i),{})}function wt(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function kt(t,e){let i=t.index,s=t.length;return new ft(i+e,s)}var Lt=class{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){let e=!1;this.scroll.update();let i=this.scroll.length();this.scroll.batchStart();const s=function(t){return t.reduce((t,e)=>{if("string"==typeof e.insert){const i=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(i,e.attributes)}return t.push(e)},new l.a)}(t);return s.reduce((t,s)=>{const n=s.retain||s.delete||s.insert.length||1;let l=s.attributes||{};if(null!=s.insert){if("string"==typeof s.insert){let n=s.insert;n.endsWith("\n")&&e&&(e=!1,n=n.slice(0,-1)),(t>=i||this.scroll.descendant(at,t)[0])&&!n.endsWith("\n")&&(e=!0),this.scroll.insertAt(t,n);const o=vt(this.scroll.line(t),2),a=o[0],c=o[1];let h=j()({},ht(a));if(a instanceof ot){const t=vt(a.descendant(v,c),1)[0];h=j()(h,ht(t))}l=r.AttributeMap.diff(h,l)||{}}else if("object"==typeof s.insert){const e=Object.keys(s.insert)[0];if(null==e)return t;this.scroll.insertAt(t,e,s.insert[e])}i+=n}return Object.keys(l).forEach(e=>{this.scroll.formatAt(t,n,e,l[e])}),t+n},0),s.reduce((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new l.a).retain(t).delete(e))}formatLine(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(i).forEach(s=>{this.scroll.lines(t,Math.max(e,1)).forEach(t=>{t.format(s,i[s])})}),this.scroll.optimize();const s=(new l.a).retain(t).retain(e,P()(i));return this.update(s)}formatText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(i).forEach(s=>{this.scroll.formatAt(t,e,s,i[s])});const s=(new l.a).retain(t).retain(e,P()(i));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new l.a)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],s=[];0===e?this.scroll.path(t).forEach(t=>{const e=vt(t,1)[0];e instanceof ot?i.push(e):e instanceof v&&s.push(e)}):(i=this.scroll.lines(t,e),s=this.scroll.descendants(v,t,e));const n=[i,s].map(t=>{if(0===t.length)return{};let e=ht(t.shift());for(;Object.keys(e).length>0;){const i=t.shift();if(null==i)return e;e=At(ht(i),e)}return e});return j.a.apply(j.a,n)}getHTML(t,e){const i=vt(this.scroll.line(t),2),s=i[0],n=i[1];return s.length()>=n+e?Et(s,n,e,!0):Et(this.scroll,t,e,!0)}getText(t,e){return this.getContents(t,e).filter(t=>"string"==typeof t.insert).map(t=>t.insert).join("")}insertEmbed(t,e,i){return this.scroll.insertAt(t,e,i),this.update((new l.a).retain(t).insert({[e]:i}))}insertText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(i).forEach(s=>{this.scroll.formatAt(t,e.length,s,i[s])}),this.update((new l.a).retain(t).insert(e,P()(i)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t.statics.blotName===ot.blotName&&!(t.children.length>1)&&t.children.head instanceof et}removeFormat(t,e){const i=this.getText(t,e),s=vt(this.scroll.line(t+e),2),n=s[0],r=s[1];let o=0,a=new l.a;null!=n&&(o=n.length()-r,a=n.delta().slice(r,r+o-1).insert("\n"));const c=this.getContents(t,e+o).diff((new l.a).insert(i).concat(a)),h=(new l.a).retain(t).concat(c);return this.applyDelta(h)}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const s=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(qt)&&this.scroll.find(e[0].target)){const n=this.scroll.find(e[0].target),r=ht(n),o=n.offset(this.scroll),a=e[0].oldValue.replace(bt.CONTENTS,""),c=(new l.a).insert(a),h=(new l.a).insert(n.value()),u=i&&{oldRange:kt(i.oldRange,-o),newRange:kt(i.newRange,-o)};t=(new l.a).retain(o).concat(c.diff(h,u)).reduce((t,e)=>e.insert?t.insert(e.insert,r):t.push(e),new l.a),this.delta=s.compose(t)}else this.delta=this.getDelta(),t&&F()(s.compose(t),this.delta)||(t=s.diff(this.delta,i));return t}};class Tt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}Tt.DEFAULTS={};var St=Tt;class Ot{constructor(t,e){this.quill=t,this.options=e,this.modules={}}init(){Object.keys(this.options.modules).forEach(t=>{null==this.modules[t]&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import("modules/".concat(t));return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}Ot.DEFAULTS={modules:{}},Ot.themes={default:Ot};var Ct=Ot;function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const It=X("quill"),Bt=new h;m.uiClass="ql-ui";class Mt{static debug(t){!0===t&&(t="log"),X.level(t)}static find(t){return V.get(t)||Bt.find(t)}static import(t){return null==this.imports[t]&&It.error("Cannot import ".concat(t,". Are you sure it was registered?")),this.imports[t]}static register(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){const i=t.attrName||t.blotName;"string"==typeof i?this.register("formats/".concat(i),t,e):Object.keys(t).forEach(i=>{this.register(i,t[i],e)})}else null==this.imports[t]||i||It.warn("Overwriting ".concat(t," with"),e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName&&Bt.register(e),"function"==typeof e.register&&e.register(Bt)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){if((e=j()(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0}},e)).theme&&e.theme!==Mt.DEFAULTS.theme){if(e.theme=Mt.import("themes/".concat(e.theme)),null==e.theme)throw new Error("Invalid theme ".concat(e.theme,". Did you register it?"))}else e.theme=Ct;const i=j()(!0,{},e.theme.DEFAULTS);[i,e].forEach(t=>{t.modules=t.modules||{},Object.keys(t.modules).forEach(e=>{!0===t.modules[e]&&(t.modules[e]={})})});const s=Object.keys(i.modules).concat(Object.keys(e.modules)).reduce((t,e)=>{const i=Mt.import("modules/".concat(e));return null==i?It.error("Cannot load ".concat(e," module. Are you sure you registered it?")):t[e]=i.DEFAULTS||{},t},{});null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar});return e=j()(!0,{},Mt.DEFAULTS,{modules:s},i,e),["bounds","container","scrollingContainer"].forEach(t=>{"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce((t,i)=>(e.modules[i]&&(t[i]=e.modules[i]),t),{}),e}(t,e),this.container=this.options.container,null==this.container)return It.error("Invalid Quill container",t);this.options.debug&&Mt.debug(this.options.debug);const i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",V.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new J;const s=this.options.registry.query(B.blotName);this.scroll=new s(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Lt(this.scroll),this.selection=new pt(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.init(),this.emitter.on(J.events.EDITOR_CHANGE,t=>{t===J.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(J.events.SCROLL_UPDATE,(t,e)=>{const i=this.selection.lastRange,s=Rt(this.selection.getRange(),1)[0],n=i&&s?{oldRange:i,newRange:s}:void 0;_t.call(this,()=>this.editor.update(null,e,n),t)});const n=this.clipboard.convert({html:"".concat(i,"


    "),text:"\n"});this.setContents(n),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,i){var s=Rt(Dt(t,e,i),4);return t=s[0],e=s[1],i=s[3],_t.call(this,()=>this.editor.deleteText(t,e),i,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){const t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}format(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J.sources.API;return _t.call(this,()=>{const i=this.getSelection(!0);let s=new l.a;if(null==i)return s;if(this.scroll.query(t,o.BLOCK))s=this.editor.formatLine(i.index,i.length,{[t]:e});else{if(0===i.length)return this.selection.format(t,e),s;s=this.editor.formatText(i.index,i.length,{[t]:e})}return this.setSelection(i,J.sources.SILENT),s},i)}formatLine(t,e,i,s,n){let r;var l=Rt(Dt(t,e,i,s,n),4);return t=l[0],e=l[1],r=l[2],n=l[3],_t.call(this,()=>this.editor.formatLine(t,e,r),n,t,0)}formatText(t,e,i,s,n){let r;var l=Rt(Dt(t,e,i,s,n),4);return t=l[0],e=l[1],r=l[2],n=l[3],_t.call(this,()=>this.editor.formatText(t,e,r),n,t,0)}getBounds(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e="number"==typeof t?this.selection.getBounds(t,i):this.selection.getBounds(t.index,t.length);const s=this.container.getBoundingClientRect();return{bottom:e.bottom-s.top,height:e.height,left:e.left-s.left,right:e.right-s.left,top:e.top-s.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mt.sources.API;return _t.call(this,()=>this.editor.insertEmbed(t,e,i),s,t)}insertText(t,e,i,s,n){let r;var l=Rt(Dt(t,0,i,s,n),4);return t=l[0],r=l[2],n=l[3],_t.call(this,()=>this.editor.insertText(t,e,r),n,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,i){var s=Rt(Dt(t,e,i),4);return t=s[0],e=s[1],i=s[3],_t.call(this,()=>this.editor.removeFormat(t,e),i,t)}scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}setContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;return _t.call(this,()=>{t=new l.a(t);const e=this.getLength(),i=this.editor.deleteText(0,e),s=this.editor.applyDelta(t),n=s.ops[s.ops.length-1];return null!=n&&"string"==typeof n.insert&&"\n"===n.insert[n.insert.length-1]&&(this.editor.deleteText(this.getLength()-1,1),s.delete(1)),i.compose(s)},e)}setSelection(t,e,i){if(null==t)this.selection.setRange(null,e||Mt.sources.API);else{var s=Rt(Dt(t,e,i),4);t=s[0],e=s[1],i=s[3],this.selection.setRange(new ft(Math.max(0,t),e),i),i!==J.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;const i=(new l.a).insert(t);return this.setContents(i,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;return _t.call(this,()=>(t=new l.a(t),this.editor.applyDelta(t,e)),e,!0)}}function _t(t,e,i,s){if(!this.isEnabled()&&e===J.sources.USER&&!this.allowReadOnlyEdits)return new l.a;let n=null==i?null:this.getSelection();const r=this.editor.delta,o=t();if(null!=n&&(!0===i&&(i=n.index),null==s?n=jt(n,o,e):0!==s&&(n=jt(n,i,s,e)),this.setSelection(n,J.sources.SILENT)),o.length()>0){const t=[J.events.TEXT_CHANGE,o,r,e];this.emitter.emit(J.events.EDITOR_CHANGE,...t),e!==J.sources.SILENT&&this.emitter.emit(...t)}return o}function Dt(t,e,i,s,n){let r={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(n=s,s=i,i=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(n=s,s=i,i=e,e=0),"object"==typeof i?(r=i,n=s):"string"==typeof i&&(null!=s?r[i]=s:n=i),[t,e,r,n=n||J.sources.API]}function jt(t,e,i,s){if(null==t)return null;let n,r;if(e instanceof l.a){var o=Rt([t.index,t.index+t.length].map(t=>e.transformPosition(t,s!==J.sources.USER)),2);n=o[0],r=o[1]}else{var a=Rt([t.index,t.index+t.length].map(t=>t=0?t+i:Math.max(e,t+i)),2);n=a[0],r=a[1]}return new ft(n,r-n)}Mt.DEFAULTS={bounds:null,modules:{},placeholder:"",readOnly:!1,registry:Bt,scrollingContainer:null,theme:"default"},Mt.events=J.events,Mt.sources=J.sources,Mt.version="2.0.12",Mt.imports={delta:l.a,parchment:s,"core/module":St,"core/theme":Ct};var Ut=class extends b{};const Pt="\ufeff";var Ht=class extends O{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable",!1),Array.from(this.domNode.childNodes).forEach(t=>{this.contentNode.appendChild(t)}),this.leftGuard=document.createTextNode(Pt),this.rightGuard=document.createTextNode(Pt),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e,i;const s=t.data.split(Pt).join("");if(t===this.leftGuard)if(this.prev instanceof it){const t=this.prev.length();this.prev.insertAt(t,s),e={startNode:this.prev.domNode,startOffset:t+s.length}}else i=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(i),this),e={startNode:i,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof it?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(i=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(i),this.next),e={startNode:i,startOffset:s.length}));return t.data=Pt,e}update(t,e){t.forEach(t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const i=this.restore(t.target);i&&(e.range=i)}})}};function Ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function zt(t){return t instanceof ot||t instanceof at}class Kt extends B{constructor(t,e,i){let s=i.emitter;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",t=>this.handleDragStart(t))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(J.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(J.events.SCROLL_BLOT_UNMOUNT,t)}deleteAt(t,e){const i=Ft(this.line(t),2),s=i[0],n=i[1],r=Ft(this.line(t+e),1)[0];if(super.deleteAt(t,e),null!=r&&s!==r&&n>0){if(s instanceof at||r instanceof at)return void this.optimize();const t=r.children.head instanceof et?null:r.children.head;s.moveChildren(r,t),s.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}formatAt(t,e,i,s){super.formatAt(t,e,i,s),this.optimize()}handleDragStart(t){t.preventDefault()}insertAt(t,e,i){if(t>=this.length())if(null==i||null==this.scroll.query(e,o.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==i&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),i):t.insertAt(0,e,i)}else{const t=this.scroll.create(e,i);this.appendChild(t)}else super.insertAt(t,e,i);this.optimize()}insertBefore(t,e){if(t.statics.scope===o.INLINE_BLOT){const i=this.scroll.create(this.statics.defaultChild.blotName);i.appendChild(t),super.insertBefore(i,e)}else super.insertBefore(t,e)}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){return this.path(t).pop()||[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(zt,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const i=(t,e,s)=>{let n=[],r=s;return t.children.forEachAt(e,s,(t,e,s)=>{zt(t)?n.push(t):t instanceof b&&(n=n.concat(i(t,e,r))),r-=s}),n};return i(this,t,e)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(J.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=J.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(J.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(J.events.SCROLL_UPDATE,e,t)}}Kt.blotName="scroll",Kt.className="ql-editor",Kt.tagName="DIV",Kt.defaultChild=ot,Kt.allowedChildren=[ot,at,Ut];var Vt=Kt;const Wt={scope:o.BLOCK,whitelist:["right","center","justify"]},Zt=new x("align","align",Wt),Gt=new q("align","ql-align",Wt),$t=new A("align","text-align",Wt);class Xt extends A{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;const i=(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(t=>"00".concat(parseInt(t,10).toString(16)).slice(-2)).join("");return"#".concat(i)}}const Yt=new q("color","ql-color",{scope:o.INLINE}),Qt=new Xt("color","color",{scope:o.INLINE}),Jt=new q("background","ql-bg",{scope:o.INLINE}),te=new Xt("background","background-color",{scope:o.INLINE});class ee extends Ut{static create(t){const e=super.create(t);return e.setAttribute("spellcheck",!1),e}html(t,e){const i=this.children.map(t=>t.domNode.innerText).join("\n").slice(t,t+e);return"
    ".concat(st(i),"
    ")}}class ie extends ot{static register(){Mt.register(ee)}}class se extends rt{}se.blotName="code",se.tagName="CODE",ie.blotName="code-block",ie.className="ql-code-block",ie.tagName="DIV",ee.blotName="code-block-container",ee.className="ql-code-block-container",ee.tagName="DIV",ee.allowedChildren=[ie],ie.allowedChildren=[it,et,bt],ie.requiredContainer=ee,ie.TAB=" ";const ne={scope:o.BLOCK,whitelist:["rtl"]},re=new x("direction","dir",ne),le=new q("direction","ql-direction",ne),oe=new A("direction","direction",ne),ae={scope:o.INLINE,whitelist:["serif","monospace"]},ce=new q("font","ql-font",ae);const he=new class extends A{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",ae),ue=new q("size","ql-size",{scope:o.INLINE,whitelist:["small","large","huge"]}),de=new A("size","font-size",{scope:o.INLINE,whitelist:["10px","18px","32px"]});function fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const me=X("quill:clipboard"),ge=[[Node.TEXT_NODE,function(t,e){let i=t.data;if("O:P"===t.parentNode.tagName)return e.insert(i.trim());if(0===i.trim().length&&i.includes("\n"))return e;if(!function t(e){if(null==e)return!1;Ee.has(e)||("PRE"===e.tagName?Ee.set(e,!0):Ee.set(e,t(e.parentNode)));return Ee.get(e)}(t)){const e=(t,e)=>{const i=e.replace(/[^\u00a0]/g,"");return i.length<1&&t?" ":i};i=(i=i.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,e.bind(e,!0)),(null==t.previousSibling&&qe(t.parentNode)||null!=t.previousSibling&&qe(t.previousSibling))&&(i=i.replace(/^\s+/,e.bind(e,!1))),(null==t.nextSibling&&qe(t.parentNode)||null!=t.nextSibling&&qe(t.nextSibling))&&(i=i.replace(/\s+$/,e.bind(e,!1)))}return e.insert(i)}],[Node.TEXT_NODE,ke],["br",function(t,e){Ne(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,ke],[Node.ELEMENT_NODE,function(t,e,i){const s=i.query(t);if(null==s)return e;if(s.prototype instanceof O){const e={},n=s.value(t);if(null!=n)return e[s.blotName]=n,(new l.a).insert(e,s.formats(t,i))}else if(s.prototype instanceof S&&!Ne(e,"\n")&&e.insert("\n"),"function"==typeof s.formats)return xe(e,s.blotName,s.formats(t,i));return e}],[Node.ELEMENT_NODE,function(t,e,i){const s=x.keys(t),n=q.keys(t),r=A.keys(t),l={};if(s.concat(n).concat(r).forEach(e=>{let s=i.query(e,o.ATTRIBUTE);null!=s&&(l[s.attrName]=s.value(t),l[s.attrName])||(null==(s=be[e])||s.attrName!==e&&s.keyName!==e||(l[s.attrName]=s.value(t)||void 0),null==(s=ye[e])||s.attrName!==e&&s.keyName!==e||(s=ye[e],l[s.attrName]=s.value(t)||void 0))}),Object.keys(l).length>0)return xe(e,l);return e}],[Node.ELEMENT_NODE,function(t,e){const i={},s=t.style||{};"italic"===s.fontStyle&&(i.italic=!0);"underline"===s.textDecoration&&(i.underline=!0);"line-through"===s.textDecoration&&(i.strike=!0);(s.fontWeight.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(i.bold=!0);Object.keys(i).length>0&&(e=xe(e,i));if(parseFloat(s.textIndent||0)>0)return(new l.a).insert("\t").concat(e);return e}],["li",function(t,e,i){const s=i.query(t);if(null==s||"list"!==s.blotName||!Ne(e,"\n"))return e;let n=-1,r=t.parentNode;for(;null!=r;)["OL","UL"].includes(r.tagName)&&(n+=1),r=r.parentNode;return n<=0?e:e.reduce((t,e)=>e.attributes&&e.attributes.list?t.push(e):t.insert(e.insert,function(t){for(var e=1;e(t[e.keyName]=e,t),{}),ye=[$t,te,Qt,oe,he,de].reduce((t,e)=>(t[e.keyName]=e,t),{});class ve extends St{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",t=>this.onCaptureCopy(t,!1)),this.quill.root.addEventListener("cut",t=>this.onCaptureCopy(t,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],ge.concat(this.options.matchers).forEach(t=>{let e=pe(t,2),i=e[0],s=e[1];this.addMatcher(i,s)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let e=t.html,i=t.text,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s[ie.blotName])return(new l.a).insert(i,{[ie.blotName]:s[ie.blotName]});if(!e)return(new l.a).insert(i||"");const n=(new DOMParser).parseFromString(e,"text/html").body,r=new WeakMap,o=pe(this.prepareMatching(n,r),2),a=o[0],c=o[1],h=Ae(this.quill.scroll,n,a,c,r);return Ne(h,"\n")&&(null==h.ops[h.ops.length-1].attributes||s.table)?h.compose((new l.a).retain(h.length()-1).delete(1)):h}dangerouslyPasteHTML(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;if("string"==typeof t){const i=this.convert({html:t,text:""});this.quill.setContents(i,e),this.quill.setSelection(0,Mt.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents((new l.a).retain(t).concat(s),i),this.quill.setSelection(t+s.length(),Mt.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const i=pe(this.quill.selection.getRange(),1)[0];if(null==i)return;const s=this.onCopy(i,e),n=s.html,r=s.text;t.clipboardData.setData("text/plain",r),t.clipboardData.setData("text/html",n),e&&this.quill.deleteText(i,Mt.sources.USER)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault(),t.stopPropagation();const e=this.quill.getSelection(!0);if(null==e)return;const i=t.clipboardData.getData("text/html"),s=t.clipboardData.getData("text/plain"),n=Array.from(t.clipboardData.files||[]);!i&&n.length>0?this.quill.uploader.upload(e,n):this.onPaste(e,{html:i,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let i=e.text,s=e.html;const n=this.quill.getFormat(t.index),r=this.convert({text:i,html:s},n);me.log("onPaste",r,{text:i,html:s});const o=(new l.a).retain(t.index).delete(t.length).concat(r);this.quill.updateContents(o,Mt.sources.USER),this.quill.setSelection(o.length()-t.length,Mt.sources.SILENT),this.quill.scrollIntoView()}prepareMatching(t,e){const i=[],s=[];return this.matchers.forEach(n=>{const r=pe(n,2),l=r[0],o=r[1];switch(l){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:i.push(o);break;default:Array.from(t.querySelectorAll(l)).forEach(t=>{if(e.has(t)){e.get(t).push(o)}else e.set(t,[o])})}}),[i,s]}}function xe(t,e,i){return"object"==typeof e?Object.keys(e).reduce((t,i)=>xe(t,i,e[i]),t):t.reduce((t,s)=>s.attributes&&s.attributes[e]?t.push(s):t.insert(s.insert,j()({},{[e]:i},s.attributes)),new l.a)}function Ne(t,e){let i="";for(let s=t.ops.length-1;s>=0&&i.lengths(e,i,t),new l.a):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((r,l)=>{let o=Ae(t,l,i,s,n);return l.nodeType===e.ELEMENT_NODE&&(o=i.reduce((e,i)=>i(l,e,t),o),o=(n.get(l)||[]).reduce((e,i)=>i(l,e,t),o)),r.concat(o)},new l.a):new l.a}function we(t,e,i){return xe(i,t,!0)}function ke(t,e,i){if(!Ne(e,"\n")){if(qe(t))return e.insert("\n");if(e.length()>0&&t.nextSibling){let s=t.nextSibling;for(;null!=s;){if(qe(s))return e.insert("\n");const t=i.query(s);if(t&&t.prototype instanceof at)return e.insert("\n");s=s.firstChild}}}return e}class Le extends St{constructor(t,e){super(t,e),this.lastRecorded=0,this.ignoreChange=!1,this.clear(),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e,i,s)=>{t!==Mt.events.TEXT_CHANGE||this.ignoreChange||(this.options.userOnly&&s!==Mt.sources.USER?this.transform(e):this.record(e,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:"z",shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this))}change(t,e){if(0===this.stack[t].length)return;const i=this.stack[t].pop(),s=this.quill.getContents(),n=i.invert(s);this.stack[e].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i,Mt.sources.USER),this.ignoreChange=!1;const r=function(t,e){const i=e.reduce((t,e)=>t+(e.delete||0),0);let s=e.length()-i;(function(t,e){const i=e.ops[e.ops.length-1];if(null==i)return!1;if(null!=i.insert)return"string"==typeof i.insert&&i.insert.endsWith("\n");if(null!=i.attributes)return Object.keys(i.attributes).some(e=>null!=t.query(e,o.BLOCK));return!1})(t,e)&&(s-=1);return s}(this.quill.scroll,i);this.quill.setSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let i=t.invert(e);const s=Date.now();if(this.lastRecorded+this.options.delay>s&&this.stack.undo.length>0){const t=this.stack.undo.pop();i=i.compose(t)}else this.lastRecorded=s;0!==i.length()&&(this.stack.undo.push(i),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Te(this.stack.undo,t),Te(this.stack.redo,t)}undo(){this.change("undo","redo")}}function Te(t,e){let i=e;for(let e=t.length-1;e>=0;e-=1){const s=t[e];t[e]=i.transform(s,!0),i=s.transform(i),0===t[e].length()&&t.splice(e,1)}}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Le.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};const Oe=X("quill:keyboard"),Ce=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Re extends St{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some(i=>!!e[i]!==t[i]&&null!==e[i])&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=P()(t,!1)}t.shortKey&&(t[Ce]=t.shortKey,delete t.shortKey);return t}(t);null!=s?("function"==typeof e&&(e={handler:e}),"function"==typeof i&&(i={handler:i}),(Array.isArray(s.key)?s.key:[s.key]).forEach(t=>{const n=j()({},s,{key:t},e,i);this.bindings[n.key]=this.bindings[n.key]||[],this.bindings[n.key].push(n)})):Oe.warn("Attempted to add invalid keyboard binding",s)}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing)return;const e=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(e=>Re.match(t,e));if(0===e.length)return;const i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;const s=Se(this.quill.getLine(i.index),2),n=s[0],r=s[1],l=Se(this.quill.getLeaf(i.index),2),o=l[0],a=l[1],c=Se(0===i.length?[o,a]:this.quill.getLeaf(i.index+i.length),2),h=c[0],u=c[1],d=o instanceof _?o.value().slice(0,a):"",f=h instanceof _?h.value().slice(u):"",p={collapsed:0===i.length,empty:0===i.length&&n.length()<=1,format:this.quill.getFormat(i),line:n,offset:r,prefix:d,suffix:f,event:t};e.some(t=>{if(null!=t.collapsed&&t.collapsed!==p.collapsed)return!1;if(null!=t.empty&&t.empty!==p.empty)return!1;if(null!=t.offset&&t.offset!==p.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(t=>null==p.format[t]))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every(e=>!0===t.format[e]?null!=p.format[e]:!1===t.format[e]?null==p.format[e]:F()(t.format[e],p.format[e])))return!1;return!(null!=t.prefix&&!t.prefix.test(p.prefix))&&(!(null!=t.suffix&&!t.suffix.test(p.suffix))&&!0!==t.handler.call(this,i,p,t))})&&t.preventDefault()})}handleBackspace(t,e){const i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let s={};const n=Se(this.quill.getLine(t.index),1)[0];let o=(new l.a).retain(t.index-i).delete(i);if(0===e.offset){if(Se(this.quill.getLine(t.index-1),1)[0]){const e=n.formats(),i=this.quill.getFormat(t.index-1,1);if(s=r.AttributeMap.diff(e,i)||{},Object.keys(s).length>0){const e=(new l.a).retain(t.index+n.length()-2).retain(1,s);o=o.compose(e)}}}this.quill.updateContents(o,Mt.sources.USER),this.quill.focus()}handleDelete(t,e){const i=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-i)return;let s={};const n=Se(this.quill.getLine(t.index),1)[0];let o=(new l.a).retain(t.index).delete(i);if(e.offset>=n.length()-1){const e=Se(this.quill.getLine(t.index+1),1)[0];if(e){const i=n.formats(),l=this.quill.getFormat(t.index,1);s=r.AttributeMap.diff(i,l)||{},Object.keys(s).length>0&&(o=o.retain(e.length()-1).retain(1,s))}}this.quill.updateContents(o,Mt.sources.USER),this.quill.focus()}handleDeleteRange(t){const e=this.quill.getLines(t);let i={};if(e.length>1){const t=e[0].formats(),s=e[e.length-1].formats();i=r.AttributeMap.diff(s,t)||{}}this.quill.deleteText(t,Mt.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index,1,i,Mt.sources.USER),this.quill.setSelection(t.index,Mt.sources.SILENT),this.quill.focus()}handleEnter(t,e){const i=Object.keys(e.format).reduce((t,i)=>(this.quill.scroll.query(i,o.BLOCK)&&!Array.isArray(e.format[i])&&(t[i]=e.format[i]),t),{}),s=(new l.a).retain(t.index).delete(t.length).insert("\n",i);this.quill.updateContents(s,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(t=>{null==i[t]&&(Array.isArray(e.format[t])||"code"!==t&&"link"!==t&&this.quill.format(t,e.format[t],Mt.sources.USER))})}}function Ie(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e){const i=this.quill.scroll.query("code-block"),s=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let n=e.index,r=e.length;s.forEach((e,s)=>{t?(e.insertAt(0,i.TAB),0===s?n+=i.TAB.length:r+=i.TAB.length):e.domNode.textContent.startsWith(i.TAB)&&(e.deleteAt(0,i.TAB.length),0===s?n-=i.TAB.length:r-=i.TAB.length)}),this.quill.update(Mt.sources.USER),this.quill.setSelection(n,r,Mt.sources.SILENT)}}}function Be(t,e){return{key:t,shiftKey:e,altKey:null,["ArrowLeft"===t?"prefix":"suffix"]:/^$/,handler(i){let s=i.index;return"ArrowRight"===t&&(s+=i.length+1),!(Se(this.quill.getLeaf(s),1)[0]instanceof O)||("ArrowLeft"===t?e?this.quill.setSelection(i.index-1,i.length+1,Mt.sources.USER):this.quill.setSelection(i.index-1,Mt.sources.USER):e?this.quill.setSelection(i.index,i.length+1,Mt.sources.USER):this.quill.setSelection(i.index+i.length+1,Mt.sources.USER),!1)}}}function Me(t){return{key:t[0],shortKey:!0,handler(e,i){this.quill.format(t,!i.format[t],Mt.sources.USER)}}}function _e(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,i){const s=t?"prev":"next",n=i.line,r=n.parent[s];if(null!=r){if("table-row"===r.statics.blotName){let t=r.children.head,e=n;for(;null!=e.prev;)e=e.prev,t=t.next;const s=t.offset(this.quill.scroll)+Math.min(i.offset,t.length()-1);this.quill.setSelection(s,0,Mt.sources.USER)}}else{const e=n.table()[s];null!=e&&(t?this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,Mt.sources.USER):this.quill.setSelection(e.offset(this.quill.scroll),0,Mt.sources.USER))}return!1}}}Re.DEFAULTS={bindings:{bold:Me("bold"),italic:Me("italic"),underline:Me("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",Mt.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",Mt.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",Mt.sources.USER):null!=e.format.list&&this.quill.format("list",!1,Mt.sources.USER)}},"indent code-block":Ie(!0),"outdent code-block":Ie(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,Mt.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const i=(new l.a).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(i,Mt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,Mt.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Mt.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const i={list:!1};e.format.indent&&(i.indent=!1),this.quill.formatLine(t.index,t.length,i,Mt.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const e=Se(this.quill.getLine(t.index),2),i=e[0],s=e[1],n=j()({},i.formats(),{list:"checked"}),r=(new l.a).retain(t.index).insert("\n",n).retain(i.length()-s-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const i=Se(this.quill.getLine(t.index),2),s=i[0],n=i[1],r=(new l.a).retain(t.index).insert("\n",e.format).retain(s.length()-n-1).retain(1,{header:null});this.quill.updateContents(r,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.scrollIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const i=Se(e.getTable(t),4),s=i[0],n=function(t,e,i,s){if(null==e.prev&&null==e.next)return null==i.prev&&null==i.next?0===s?-1:1:null==i.prev?-1:1;if(null==e.prev)return-1;if(null==e.next)return 1;return null}(0,i[1],i[2],i[3]);if(null==n)return;let r=s.offset();if(n<0){const e=(new l.a).retain(r).insert("\n");this.quill.updateContents(e,Mt.sources.USER),this.quill.setSelection(t.index+1,t.length,Mt.sources.SILENT)}else if(n>0){r+=s.length();const t=(new l.a).retain(r).insert("\n");this.quill.updateContents(t,Mt.sources.USER),this.quill.setSelection(r,Mt.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const i=e.event,s=e.line,n=s.offset(this.quill.scroll);i.shiftKey?this.quill.setSelection(n-1,Mt.sources.USER):this.quill.setSelection(n+s.length(),Mt.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{list:!1,"code-block":!1,blockquote:!1,header:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const i=e.prefix.length,s=Se(this.quill.getLine(t.index),2),n=s[0],r=s[1];if(r>i)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(t.index," ",Mt.sources.USER),this.quill.history.cutoff();const a=(new l.a).retain(t.index-r).delete(i+1).retain(n.length()-2-r).retain(1,{list:o});return this.quill.updateContents(a,Mt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-i,Mt.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const e=Se(this.quill.getLine(t.index),2),i=e[0],s=e[1];let n=2,r=i;for(;null!=r&&r.length()<=1&&r.formats()["code-block"];)if(r=r.prev,(n-=1)<=0){const e=(new l.a).retain(t.index+i.length()-s-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(e,Mt.sources.USER),this.quill.setSelection(t.index-1,Mt.sources.SILENT),!1}return!0}},"embed left":Be("ArrowLeft",!1),"embed left shift":Be("ArrowLeft",!0),"embed right":Be("ArrowRight",!1),"embed right shift":Be("ArrowRight",!0),"table down":_e(!1),"table up":_e(!0)}};class De extends St{constructor(t,e){super(t,e),t.root.addEventListener("drop",e=>{let i;if(e.preventDefault(),document.caretRangeFromPoint)i=document.caretRangeFromPoint(e.clientX,e.clientY);else{if(!document.caretPositionFromPoint)return;{const t=document.caretPositionFromPoint(e.clientX,e.clientY);(i=document.createRange()).setStart(t.offsetNode,t.offset),i.setEnd(t.offsetNode,t.offset)}}const s=t.selection.normalizeNative(i),n=t.selection.normalizedToRange(s);this.upload(n,e.dataTransfer.files)})}upload(t,e){const i=[];Array.from(e).forEach(t=>{t&&this.options.mimetypes.includes(t.type)&&i.push(t)}),i.length>0&&this.options.handler.call(this,t,i)}}De.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){const i=e.map(t=>new Promise(e=>{const i=new FileReader;i.onload=(t=>{e(t.target.result)}),i.readAsDataURL(t)}));Promise.all(i).then(e=>{const i=e.reduce((t,e)=>t.insert({image:e}),(new l.a).retain(t.index).delete(t.length));this.quill.updateContents(i,J.sources.USER),this.quill.setSelection(t.index+e.length,J.sources.SILENT)})}};var je=De;Mt.register({"blots/block":ot,"blots/block/embed":at,"blots/break":et,"blots/container":Ut,"blots/cursor":bt,"blots/embed":Ht,"blots/inline":rt,"blots/scroll":Vt,"blots/text":it,"modules/clipboard":ve,"modules/history":Le,"modules/keyboard":Re,"modules/uploader":je});var Ue=Mt;var Pe=new class extends q{add(t,e){if("+1"===e||"-1"===e){const i=this.value(t)||0;e="+1"===e?i+1:i-1}return 0===e?(this.remove(t),!0):super.add(t,e)}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}("indent","ql-indent",{scope:o.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class He extends ot{}He.blotName="blockquote",He.tagName="blockquote";var Fe=He;class ze extends ot{static formats(t){return this.tagName.indexOf(t.tagName)+1}}ze.blotName="header",ze.tagName=["H1","H2","H3","H4","H5","H6"];var Ke=ze;class Ve extends Ut{}Ve.blotName="list-container",Ve.tagName="OL";class We extends ot{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){Mt.register(Ve)}constructor(t,e){super(t,e);const i=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const s=this.statics.formats(e,t);"checked"===s?(this.format("list","unchecked"),i.preventDefault()):"unchecked"===s&&(this.format("list","checked"),i.preventDefault())};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s),this.attachUI(i)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}We.blotName="list",We.tagName="LI",Ve.allowedChildren=[We],We.requiredContainer=Ve;class Ze extends rt{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}Ze.blotName="bold",Ze.tagName=["STRONG","B"];var Ge=Ze;class $e extends Ge{}$e.blotName="italic",$e.tagName=["EM","I"];var Xe=$e;class Ye extends rt{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return Qe(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Qe(t,e){const i=document.createElement("a");i.href=t;const s=i.href.slice(0,i.href.indexOf(":"));return e.indexOf(s)>-1}Ye.blotName="link",Ye.tagName="A",Ye.SANITIZED_URL="about:blank",Ye.PROTOCOL_WHITELIST=["http","https","mailto","tel"];class Je extends rt{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}Je.blotName="script",Je.tagName=["SUB","SUP"];var ti=Je;class ei extends rt{}ei.blotName="strike",ei.tagName="S";var ii=ei;class si extends rt{}si.blotName="underline",si.tagName="U";var ni=si;class ri extends Ht{static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const t=this.value().formula;return"".concat(t,"")}}ri.blotName="formula",ri.className="ql-formula",ri.tagName="SPAN";var li=ri;const oi=["alt","height","width"];class ai extends O{static create(t){const e=super.create(t),i=document.createElement("span");return"string"==typeof t&&(e.setAttribute("src",this.sanitize(t)),i.setAttribute("href",this.sanitize(t)),i.setAttribute("data-fancybox-href",this.sanitize(t))),t.thumbUrl&&e.setAttribute("src",this.sanitize(t.thumbUrl)),t.originUrl&&(i.setAttribute("href",this.sanitize(t.originUrl)),i.setAttribute("data-fancybox-href",this.sanitize(t.originUrl))),i.setAttribute("data-fancybox-type","image"),i.setAttribute("data-fancybox-group","editor"),i.classList.add("fancybox"),i.appendChild(e),i}static formats(t){return oi.reduce((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static register(){/Firefox/i.test(navigator.userAgent)&&setTimeout(()=>{document.execCommand("enableObjectResizing",!1,!1)},1)}static sanitize(t){return Qe(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){oi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}ai.blotName="image",ai.tagName="IMG";var ci=ai;const hi=["height","width"];class ui extends at{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return hi.reduce((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e),{})}static sanitize(t){return Ye.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){hi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const t=this.value().video;return'').concat(t,"")}}ui.blotName="video",ui.className="ql-video",ui.tagName="IFRAME";var di=ui;const fi=new q("code-token","hljs",{scope:o.INLINE});class pi extends rt{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList.contains(ie.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,i){super(t,e,i),fi.add(this.domNode,i)}format(t,e){t!==pi.blotName?super.format(t,e):e?fi.add(this.domNode,e):(fi.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),fi.value(this.domNode)||this.unwrap()}}pi.blotName="code-token",pi.className="ql-token";class mi extends ie{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),pi.blotName,!1),super.replaceWith(t,e)}}class gi extends ee{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===mi.blotName&&(this.forceNext=!0,this.children.forEach(i=>{i.format(t,e)}))}formatAt(t,e,i,s){i===mi.blotName&&(this.forceNext=!0),super.formatAt(t,e,i,s)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const i=Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode),s="".concat(i.map(t=>t.textContent).join("\n"),"\n"),n=mi.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||null==this.cachedText){const e=this.children.reduce((t,e)=>t.concat(ct(e,!1)),new l.a),i=t(s,n);e.diff(i).reduce((t,e)=>{let i=e.retain,s=e.attributes;return i?(s&&Object.keys(s).forEach(e=>{[mi.blotName,pi.blotName].includes(e)&&this.formatAt(t,i,e,s[e])}),t+i):t},0)}this.cachedText=s,this.forceNext=!1}}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=mi.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}gi.allowedChildren=[mi],mi.requiredContainer=gi,mi.allowedChildren=[pi,bt,it,et];class bi extends St{static register(){Mt.register(pi,!0),Mt.register(mi,!0),Mt.register(gi,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Mt.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof gi))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(t=>{let i=t.key,s=t.label;const n=e.ownerDocument.createElement("option");n.textContent=s,n.setAttribute("value",i),e.appendChild(n)}),e.addEventListener("change",()=>{t.format(mi.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=mi.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(Mt.events.SCROLL_OPTIMIZE,()=>{clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Mt.sources.USER);const i=this.quill.getSelection();(null==t?this.quill.scroll.descendants(gi):[t]).forEach(t=>{t.highlight(this.highlightBlot,e)}),this.quill.update(Mt.sources.SILENT),null!=i&&this.quill.setSelection(i,Mt.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if("plain"===e)return st(t).split("\n").reduce((t,i,s)=>(0!==s&&t.insert("\n",{[ie.blotName]:e}),t.insert(i)),new l.a);const i=this.quill.root.ownerDocument.createElement("div");return i.classList.add(ie.className),i.innerHTML=this.options.hljs.highlight(e,t).value,Ae(this.quill.scroll,i,[(t,e)=>{const i=fi.value(t);return i?e.compose((new l.a).retain(e.length(),{[pi.blotName]:i})):e}],[(t,i)=>t.data.split("\n").reduce((t,i,s)=>(0!==s&&t.insert("\n",{[ie.blotName]:e}),t.insert(i)),i)],new WeakMap)}}function yi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}bi.DEFAULTS={hljs:(()=>window.hljs)(),interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"Javascript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class vi extends ot{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Ei()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===vi.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}vi.blotName="table",vi.tagName="TD";class xi extends Ut{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),i=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===i.table&&t.table===s.table}return!1}optimize(){super.optimize(...arguments),this.children.forEach(t=>{if(null==t.next)return;const e=t.formats(),i=t.next.formats();if(e.table!==i.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}xi.blotName="table-row",xi.tagName="TR";class Ni extends Ut{}Ni.blotName="table-body",Ni.tagName="TBODY";class qi extends Ut{balanceCells(){const t=this.descendants(xi),e=t.reduce((t,e)=>Math.max(e.children.length,t),0);t.forEach(t=>{new Array(e-t.children.length).fill(0).forEach(()=>{let e;null!=t.children.head&&(e=vi.formats(t.children.head.domNode));const i=this.scroll.create(vi.blotName,e);t.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const e=yi(this.descendant(Ni),1)[0];null!=e&&null!=e.children.head&&e.children.forEach(e=>{const i=e.children.at(t);null!=i&&i.remove()})}insertColumn(t){const e=yi(this.descendant(Ni),1)[0];null!=e&&null!=e.children.head&&e.children.forEach(e=>{const i=e.children.at(t),s=vi.formats(e.children.head.domNode),n=this.scroll.create(vi.blotName,s);e.insertBefore(n,i)})}insertRow(t){const e=yi(this.descendant(Ni),1)[0];if(null==e||null==e.children.head)return;const i=Ei(),s=this.scroll.create(xi.blotName);e.children.head.children.forEach(()=>{const t=this.scroll.create(vi.blotName,i);s.appendChild(t)});const n=e.children.at(t);e.insertBefore(s,n)}rows(){const t=this.children.head;return null==t?[]:t.children.map(t=>t)}}function Ei(){const t=Math.random().toString(36).slice(2,6);return"row-".concat(t)}function Ai(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}qi.blotName="table-container",qi.tagName="TABLE",qi.allowedChildren=[Ni],Ni.requiredContainer=qi,Ni.allowedChildren=[xi],xi.requiredContainer=Ni,xi.allowedChildren=[vi],vi.requiredContainer=xi;var wi=class extends St{static register(){Mt.register(vi),Mt.register(xi),Mt.register(Ni),Mt.register(qi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(qi).forEach(t=>{t.balanceCells()})}deleteColumn(){const t=Ai(this.getTable(),3),e=t[0],i=t[2];null!=i&&(e.deleteColumn(i.cellOffset()),this.quill.update(Mt.sources.USER))}deleteRow(){const t=Ai(this.getTable(),2)[1];null!=t&&(t.remove(),this.quill.update(Mt.sources.USER))}deleteTable(){const t=Ai(this.getTable(),1)[0];if(null==t)return;const e=t.offset();t.remove(),this.quill.update(Mt.sources.USER),this.quill.setSelection(e,Mt.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const e=Ai(this.quill.getLine(t.index),2),i=e[0],s=e[1];if(null==i||i.statics.blotName!==vi.blotName)return[null,null,null,-1];const n=i.parent;return[n.parent.parent,n,i,s]}insertColumn(t){const e=this.quill.getSelection(),i=Ai(this.getTable(e),3),s=i[0],n=i[1],r=i[2];if(null==r)return;const l=r.cellOffset();s.insertColumn(l+t),this.quill.update(Mt.sources.USER);let o=n.rowOffset();0===t&&(o+=1),this.quill.setSelection(e.index+o,e.length,Mt.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection(),i=Ai(this.getTable(e),3),s=i[0],n=i[1];if(null==i[2])return;const r=n.rowOffset();s.insertRow(r+t),this.quill.update(Mt.sources.USER),t>0?this.quill.setSelection(e,Mt.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,Mt.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const i=this.quill.getSelection();if(null==i)return;const s=new Array(t).fill(0).reduce(t=>{const i=new Array(e).fill("\n").join("");return t.insert(i,{table:Ei()})},(new l.a).retain(i.index));this.quill.updateContents(s,Mt.sources.USER),this.quill.setSelection(i.index,Mt.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Mt.events.SCROLL_OPTIMIZE,t=>{t.some(t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(Mt.events.TEXT_CHANGE,(t,e,i)=>{i===Mt.sources.USER&&this.balanceTables()}),!0))})}};function ki(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const Li=X("quill:toolbar");class Ti extends St{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const e=document.createElement("div");!function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach(e=>{const i=document.createElement("span");i.classList.add("ql-formats"),e.forEach(t=>{if("string"==typeof t)Si(i,t);else{const e=Object.keys(t)[0],s=t[e];Array.isArray(s)?function(t,e,i){const s=document.createElement("select");s.classList.add("ql-".concat(e)),i.forEach(t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),s.appendChild(e)}),t.appendChild(s)}(i,e,s):Si(i,e,s)}}),t.appendChild(i)})}(e,this.options.container),t.container.parentNode.insertBefore(e,t.container),this.container=e}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement))return Li.error("Container required for toolbar",this.options);this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},Object.keys(this.options.handlers).forEach(t=>{this.addHandler(t,this.options.handlers[t])}),Array.from(this.container.querySelectorAll("button, select")).forEach(t=>{this.attach(t)}),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e)=>{t===Mt.events.SELECTION_CHANGE&&this.update(e)}),this.quill.on(Mt.events.SCROLL_OPTIMIZE,()=>{const t=ki(this.quill.selection.getRange(),1)[0];this.update(t)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(t=>0===t.indexOf("ql-"));if(!e)return;if(e=e.slice("ql-".length),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[e]&&null==this.quill.scroll.query(e))return void Li.warn("ignoring attaching to nonexistent format",e,t);const i="SELECT"===t.tagName?"change":"click";t.addEventListener(i,i=>{let s;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];s=!e.hasAttribute("selected")&&(e.value||!1)}else s=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),i.preventDefault();this.quill.focus();const n=ki(this.quill.selection.getRange(),1)[0];if(null!=this.handlers[e])this.handlers[e].call(this,s);else if(this.quill.scroll.query(e).prototype instanceof O){if(!(s=prompt("Enter ".concat(e))))return;this.quill.updateContents((new l.a).retain(n.index).delete(n.length).insert({[e]:s}),Mt.sources.USER)}else this.quill.format(e,s,Mt.sources.USER);this.update(n)}),this.controls.push([e,t])}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(i=>{const s=ki(i,2),n=s[0],r=s[1];if("SELECT"===r.tagName){let i;if(null==t)i=null;else if(null==e[n])i=r.querySelector("option[selected]");else if(!Array.isArray(e[n])){let t=e[n];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),i=r.querySelector('option[value="'.concat(t,'"]'))}null==i?(r.value="",r.selectedIndex=-1):i.selected=!0}else if(null==t)r.classList.remove("ql-active");else if(r.hasAttribute("value")){const t=e[n]===r.getAttribute("value")||null!=e[n]&&e[n].toString()===r.getAttribute("value")||null==e[n]&&!r.getAttribute("value");r.classList.toggle("ql-active",t)}else r.classList.toggle("ql-active",null!=e[n])})}}function Si(t,e,i){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("ql-".concat(e)),null!=i&&(s.value=i),t.appendChild(s)}Ti.DEFAULTS={},Ti.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach(t=>{null!=this.quill.scroll.query(t,o.INLINE)&&this.quill.format(t,!1,Mt.sources.USER)})}else this.quill.removeFormat(t,Mt.sources.USER)},direction(t){const e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",Mt.sources.USER):t||"right"!==e||this.quill.format("align",!1,Mt.sources.USER),this.quill.format("direction",t,Mt.sources.USER)},indent(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e),s=parseInt(i.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===i.direction&&(e*=-1),this.quill.format("indent",s+e,Mt.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,Mt.sources.USER)},list(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e);"check"===t?"checked"===i.list||"unchecked"===i.list?this.quill.format("list",!1,Mt.sources.USER):this.quill.format("list","unchecked",Mt.sources.USER):this.quill.format("list",t,Mt.sources.USER)}}};var Oi=i(7),Ci=i.n(Oi),Ri=i(8),Ii=i.n(Ri),Bi=i(9),Mi=i.n(Bi),_i=i(10),Di=i.n(_i),ji=i(11),Ui=i.n(ji),Pi=i(12),Hi=i.n(Pi),Fi=i(13),zi=i.n(Fi),Ki=i(14),Vi=i.n(Ki),Wi=i(4),Zi=i.n(Wi),Gi=i(15),$i=i.n(Gi),Xi=i(16),Yi=i.n(Xi),Qi=i(17),Ji=i.n(Qi),ts=i(18),es=i.n(ts),is=i(19),ss=i.n(is),ns=i(20),rs=i.n(ns),ls=i(21),os=i.n(ls),as=i(22),cs=i.n(as),hs=i(23),us=i.n(hs),ds=i(24),fs=i.n(ds),ps=i(25),ms=i.n(ps),gs=i(26),bs=i.n(gs),ys=i(27),vs=i.n(ys),xs=i(28),Ns=i.n(xs),qs=i(29),Es=i.n(qs),As=i(30),ws=i.n(As),ks=i(31),Ls=i.n(ks),Ts=i(32),Ss=i.n(Ts),Os=i(33),Cs=i.n(Os),Rs=i(34),Is=i.n(Rs),Bs={align:{"":Ci.a,center:Ii.a,right:Mi.a,justify:Di.a},background:Ui.a,blockquote:Hi.a,bold:zi.a,clean:Vi.a,code:Zi.a,"code-block":Zi.a,color:$i.a,direction:{"":Yi.a,rtl:Ji.a},formula:es.a,header:{1:ss.a,2:rs.a},italic:os.a,image:cs.a,indent:{"+1":us.a,"-1":fs.a},link:ms.a,list:{bullet:bs.a,check:vs.a,ordered:Ns.a},script:{sub:Es.a,super:ws.a},strike:Ls.a,table:Ss.a,underline:Cs.a,video:Is.a},Ms=i(35),_s=i.n(Ms);let Ds=0;function js(t,e){t.setAttribute(e,!("true"===t.getAttribute(e)))}var Us=class{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),js(this.label,"aria-expanded"),js(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");return e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item"),t.hasAttribute("value")&&e.setAttribute("data-value",t.getAttribute("value")),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=_s.a,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-".concat(Ds),Ds+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const i=this.buildItem(e);t.appendChild(i),!0===e.selected&&this.selectItem(i)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.container.querySelector(".ql-selected");t!==i&&(null!=i&&i.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}};var Ps=class extends Us{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(t=>{t.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const i=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=s:i.style.fill=s)}};var Hs=class extends Us{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const i=t||this.defaultItem;this.label.innerHTML!==i.innerHTML&&(this.label.innerHTML=i.innerHTML)}};var Fs=class{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop="".concat(-1*this.quill.root.scrollTop,"px")}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){let e=t.left+t.width/2-this.root.offsetWidth/2;const i=this.quill.root.getBoundingClientRect(),s=this.boundsContainer.getBoundingClientRect(),n=this.root.getBoundingClientRect();e<0&&(e=8),e>i.width-n.width-8&&(e=i.width-n.width-8);const r=t.bottom+this.quill.root.scrollTop;this.root.style.left="".concat(e,"px"),this.root.style.top="".concat(r,"px"),this.root.classList.remove("ql-flip");let l=0;if(n.right>s.right&&(l=s.right-n.right,this.root.style.left="".concat(e+l,"px")),n.lefts.bottom){const e=n.bottom-n.top,i=t.bottom-t.top+e;this.root.style.top="".concat(r-i,"px"),this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const zs=[!1,"center","right","justify"],Ks=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Vs=[!1,"serif","monospace"],Ws=["1","2","3",!1],Zs=["small",!1,"large","huge"];class Gs extends Ct{constructor(t,e){super(t,e);const i=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(t=>{t.container.contains(e.target)||t.close()})):document.body.removeEventListener("click",i)};t.emitter.listenDOM("click",document.body,i)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(t=>{(t.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice("ql-".length),null!=e[i]))if("direction"===i)t.innerHTML=e[i][""]+e[i].rtl;else if("string"==typeof e[i])t.innerHTML=e[i];else{const s=t.value||"";null!=s&&e[i][s]&&(t.innerHTML=e[i][s])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(t=>{if(t.classList.contains("ql-align"))return null==t.querySelector("option")&&Xs(t,zs),new Hs(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const i=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&Xs(t,Ks,"background"===i?"#ffffff":"#000000"),new Ps(t,e[i])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?Xs(t,Vs):t.classList.contains("ql-header")?Xs(t,Ws):t.classList.contains("ql-size")&&Xs(t,Zs)),new Us(t)});this.quill.on(J.events.EDITOR_CHANGE,()=>{this.pickers.forEach(t=>{t.update()})})}}Gs.DEFAULTS=j()(!0,{},Ct.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class $s extends Fs{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())})}cancel(){this.hide()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-".concat(t))||""),this.root.setAttribute("data-mode",t)}restoreFocus(){const t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}save(){let t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{const e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,J.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,J.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return"".concat(e[1]||"https","://www.youtube.com/embed/").concat(e[2],"?showinfo=0");if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return"".concat(e[1]||"https","://player.vimeo.com/video/").concat(e[2],"/");return t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const i=e.index+e.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,J.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",J.sources.USER),this.quill.setSelection(i+2,J.sources.USER)}break}}this.textbox.value="",this.hide()}}function Xs(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(e=>{const s=document.createElement("option");e===i?s.setAttribute("selected","selected"):s.setAttribute("value",e),t.appendChild(s)})}const Ys=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Qs extends $s{constructor(t,e){super(t,e),this.quill.on(J.events.EDITOR_CHANGE,(t,e,i,s)=>{if(t===J.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&s===J.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width="".concat(this.root.offsetWidth,"px");const t=this.quill.getLines(e.index,e.length);if(1===t.length)this.position(this.quill.getBounds(e));else{const i=t[t.length-1],s=this.quill.getIndex(i),n=Math.min(i.length()-1,e.index+e.length-s),r=this.quill.getBounds(new ft(s,n));this.position(r)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(J.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();null!=t&&this.position(this.quill.getBounds(t))},1)})}cancel(){this.show()}position(t){const e=super.position(t),i=this.root.querySelector(".ql-tooltip-arrow");return i.style.marginLeft="",0!==e&&(i.style.marginLeft="".concat(-1*e-i.offsetWidth/2,"px")),e}}Qs.TEMPLATE=['','
    ','','',"
    "].join("");class Js extends Gs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=Ys),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Qs(this.quill,this.options.bounds),this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Bs),this.buildPickers(t.container.querySelectorAll("select"),Bs)}}function tn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Js.DEFAULTS=j()(!0,{},Gs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});const en=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class sn extends $s{constructor(t,e){super(t,e),this.preview=this.root.querySelector("a.ql-preview")}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,J.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(J.events.SELECTION_CHANGE,(t,e,i)=>{if(null!=t){if(0===t.length&&i===J.sources.USER){const e=tn(this.quill.scroll.descendant(Ye,t.index),2),i=e[0],s=e[1];if(null!=i){this.linkRange=new ft(t.index-s,i.length());const e=Ye.formats(i.domNode);return this.preview.textContent=e,this.preview.setAttribute("href",e),void this.quill.options.linkHover(i.domNode,this.linkRange)}}else delete this.linkRange;this.quill.options.linkHide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}sn.TEMPLATE=['','','',''].join("");class nn extends Gs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=en),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),Bs),this.buildPickers(t.container.querySelectorAll("select"),Bs),this.tooltip=new sn(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,i)=>{t.handlers.link.call(t,!i.format.link)})}}nn.DEFAULTS=j()(!0,{},Gs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e="mailto:".concat(e)),this.quill.theme.tooltip.edit("link",e)}else this.quill.format("link",!1)}}}}});var rn=nn;Ue.register({"attributors/attribute/direction":re,"attributors/class/align":Gt,"attributors/class/background":Jt,"attributors/class/color":Yt,"attributors/class/direction":le,"attributors/class/font":ce,"attributors/class/size":ue,"attributors/style/align":$t,"attributors/style/background":te,"attributors/style/color":Qt,"attributors/style/direction":oe,"attributors/style/font":he,"attributors/style/size":de},!0),Ue.register({"formats/align":Gt,"formats/direction":le,"formats/indent":Pe,"formats/background":te,"formats/color":Qt,"formats/font":ce,"formats/size":ue,"formats/blockquote":Fe,"formats/code-block":ie,"formats/header":Ke,"formats/list":We,"formats/bold":Ge,"formats/code":se,"formats/italic":Xe,"formats/link":Ye,"formats/script":ti,"formats/strike":ii,"formats/underline":ni,"formats/formula":li,"formats/image":ci,"formats/video":di,"modules/syntax":bi,"modules/table":wi,"modules/toolbar":Ti,"themes/bubble":Js,"themes/snow":rn,"ui/icons":Bs,"ui/picker":Us,"ui/icon-picker":Hs,"ui/color-picker":Ps,"ui/tooltip":Fs},!0);e.default=Ue}]).default}); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=41)}([function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=s(i(3)),r=s(i(1)),l=s(i(38)),o=s(i(39)),a=s(i(5)),c=String.fromCharCode(0),h=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var i={};return"string"==typeof t&&0===t.length?this:(i.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var i={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i)},t.prototype.push=function(t){var e=this.ops.length,i=this.ops[e-1];if(t=r.default(!0,{},t),"object"==typeof i){if("number"==typeof t.delete&&"number"==typeof i.delete)return this.ops[e-1]={delete:i.delete+t.delete},this;if("number"==typeof i.delete&&null!=t.insert&&(e-=1,"object"!=typeof(i=this.ops[e-1])))return this.ops.unshift(t),this;if(n.default(t.attributes,i.attributes)){if("string"==typeof t.insert&&"string"==typeof i.insert)return this.ops[e-1]={insert:i.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof i.retain)return this.ops[e-1]={retain:i.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],i=[];return this.forEach(function(s){(t(s)?e:i).push(s)}),[e,i]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.default.length(e):e.delete?t-e.delete:t},0)},t.prototype.length=function(){return this.reduce(function(t,e){return t+a.default.length(e)},0)},t.prototype.slice=function(e,i){void 0===e&&(e=0),void 0===i&&(i=1/0);for(var s=[],n=a.default.iterator(this.ops),r=0;r0&&s.next(l.retain-c)}for(var h=new t(r);i.hasNext()||s.hasNext();)if("insert"===s.peekType())h.push(s.next());else if("delete"===i.peekType())h.push(i.next());else{var u=Math.min(i.peekLength(),s.peekLength()),d=i.next(u),f=s.next(u);if("number"==typeof f.retain){var p={};"number"==typeof d.retain?p.retain=u:p.insert=d.insert;var m=o.default.compose(d.attributes,f.attributes,"number"==typeof d.retain);if(m&&(p.attributes=m),h.push(p),!s.hasNext()&&n.default(h.ops[h.ops.length-1],p)){var g=new t(i.rest());return h.concat(g).chop()}}else"number"==typeof f.delete&&"number"==typeof d.retain&&h.push(f)}return h.chop()},t.prototype.concat=function(e){var i=new t(this.ops.slice());return e.ops.length>0&&(i.push(e.ops[0]),i.ops=i.ops.concat(e.ops.slice(1))),i},t.prototype.diff=function(e,i){if(this.ops===e.ops)return new t;var s=[this,e].map(function(t){return t.map(function(i){if(null!=i.insert)return"string"==typeof i.insert?i.insert:c;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),r=new t,h=l.default(s[0],s[1],i),u=a.default.iterator(this.ops),d=a.default.iterator(e.ops);return h.forEach(function(t){for(var e=t[1].length;e>0;){var i=0;switch(t[0]){case l.default.INSERT:i=Math.min(d.peekLength(),e),r.push(d.next(i));break;case l.default.DELETE:i=Math.min(e,u.peekLength()),u.next(i),r.delete(i);break;case l.default.EQUAL:i=Math.min(u.peekLength(),d.peekLength(),e);var s=u.next(i),a=d.next(i);n.default(s.insert,a.insert)?r.retain(i,o.default.diff(s.attributes,a.attributes)):r.push(a).delete(i)}e-=i}}),r.chop()},t.prototype.eachLine=function(e,i){void 0===i&&(i="\n");for(var s=a.default.iterator(this.ops),n=new t,r=0;s.hasNext();){if("insert"!==s.peekType())return;var l=s.peek(),o=a.default.length(l)-s.peekLength(),c="string"==typeof l.insert?l.insert.indexOf(i,o)-o:-1;if(c<0)n.push(s.next());else if(c>0)n.push(s.next(c));else{if(!1===e(n,s.next(1).attributes||{},r))return;r+=1,n=new t}}n.length()>0&&e(n,{},r)},t.prototype.invert=function(e){var i=new t;return this.reduce(function(t,s){if(s.insert)i.delete(a.default.length(s));else{if(s.retain&&null==s.attributes)return i.retain(s.retain),t+s.retain;if(s.delete||s.retain&&s.attributes){var n=s.delete||s.retain;return e.slice(t,t+n).forEach(function(t){s.delete?i.push(t):s.retain&&s.attributes&&i.retain(a.default.length(t),o.default.invert(s.attributes,t.attributes))}),t+n}}return t},0),i.chop()},t.prototype.transform=function(e,i){if(void 0===i&&(i=!1),i=!!i,"number"==typeof e)return this.transformPosition(e,i);for(var s=e,n=a.default.iterator(this.ops),r=a.default.iterator(s.ops),l=new t;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!i&&"insert"===r.peekType())if("insert"===r.peekType())l.push(r.next());else{var c=Math.min(n.peekLength(),r.peekLength()),h=n.next(c),u=r.next(c);if(h.delete)continue;u.delete?l.push(u):l.retain(c,o.default.transform(h.attributes,u.attributes,i))}else l.retain(a.default.length(n.next()));return l.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var i=a.default.iterator(this.ops),s=0;i.hasNext()&&s<=t;){var n=i.peekLength(),r=i.peekType();i.next(),"delete"!==r?("insert"===r&&(s=0;c--)if(u[c]!=d[c])return!1;for(c=u.length-1;c>=0;c--)if(h=u[c],!l(t[h],e[h],i))return!1;return typeof t==typeof e}(t,e,i))};function o(t){return null==t}function a(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},function(t,e){t.exports=' '},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n,r=s(i(40));!function(t){t.iterator=function(t){return new r.default(t)},t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}}(n||(n={})),e.default=n},function(t,e){"use strict";var i=Object.prototype.hasOwnProperty,s="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function l(t,e,i,n,l){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,n||t,l),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(s=!1)),a.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,l=new Array(r);n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){function i(t){var e=[];for(var i in t)e.push(i);return e}(t.exports="function"==typeof Object.keys?Object.keys:i).shim=i},function(t,e){var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function s(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function n(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=i?s:n).supported=s,e.unsupported=n},function(t,e){var i=-1,s=1,n=0;function r(t,e,c,h){if(t===e)return t?[[n,t]]:[];if(null!=c){var p=function(t,e,i){var s="number"==typeof i?{index:i,length:0}:i.oldRange,n="number"==typeof i?null:i.newRange,r=t.length,l=e.length;if(0===s.length&&(null===n||0===n.length)){var o=s.index,a=t.slice(0,o),c=t.slice(o),h=n?n.index:null,u=o+l-r;if((null===h||h===u)&&!(u<0||u>l)){var d=e.slice(0,u),p=e.slice(u);if(p===c){var m=Math.min(o,u),g=a.slice(0,m),b=d.slice(0,m);if(g===b){var y=a.slice(m),v=d.slice(m);return f(g,y,v,c)}}}if(null===h||h===o){var x=o,d=e.slice(0,x),p=e.slice(x);if(d===a){var N=Math.min(r-x,l-x),q=c.slice(c.length-N),E=p.slice(p.length-N);if(q===E){var y=c.slice(0,c.length-N),v=p.slice(0,p.length-N);return f(a,y,v,q)}}}}if(s.length>0&&n&&0===n.length){var g=t.slice(0,s.index),q=t.slice(s.index+s.length),m=g.length,N=q.length;if(!(le.length?t:e,u=t.length>e.length?e:t,d=h.indexOf(u);if(-1!==d)return c=[[s,h.substring(0,d)],[n,u],[s,h.substring(d+u.length)]],t.length>e.length&&(c[0][0]=c[2][0]=i),c;if(1===u.length)return[[i,t],[s,e]];var f=function(t,e){var i=t.length>e.length?t:e,s=t.length>e.length?e:t;if(i.length<4||2*s.length=t.length?[s,n,r,l,u]:null}var r,l,c,h,u,d=n(i,s,Math.ceil(i.length/4)),f=n(i,s,Math.ceil(i.length/2));if(!d&&!f)return null;r=f?d&&d[4].length>f[4].length?d:f:d;t.length>e.length?(l=r[0],c=r[1],h=r[2],u=r[3]):(h=r[0],u=r[1],l=r[2],c=r[3]);var p=r[4];return[l,c,h,u,p]}(t,e);if(f){var p=f[0],m=f[1],g=f[2],b=f[3],y=f[4],v=r(p,g),x=r(m,b);return v.concat([[n,y]],x)}return function(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),a=o,c=2*o,h=new Array(c),u=new Array(c),d=0;dn)g+=2;else if(q>r)m+=2;else if(p){var E=a+f-x;if(E>=0&&E=A)return l(t,e,L,q)}}}for(var w=-v+b;w<=v-y;w+=2){for(var E=a+w,k=(A=w===-v||w!==v&&u[E-1]n)y+=2;else if(k>r)b+=2;else if(!p){var N=a+f-w;if(N>=0&&N=(A=n-A))return l(t,e,L,q)}}}}return[[i,t],[s,e]]}(t,e)}(t=t.substring(0,t.length-m),e=e.substring(0,e.length-m));return g&&y.unshift([n,g]),b&&y.push([n,b]),function t(e,r){e.push([n,""]);var l=0;var c=0;var h=0;var f="";var p="";var m;for(;l=0&&d(e[g][1])){var b=e[g][1].slice(-1);if(e[g][1]=e[g][1].slice(0,-1),f=b+f,p=b+p,!e[g][1]){e.splice(g,1),l--;var y=g-1;e[y]&&e[y][0]===s&&(h++,p=e[y][1]+p,y--),e[y]&&e[y][0]===i&&(c++,f=e[y][1]+f,y--),g=y}}if(u(e[l][1])){var b=e[l][1].charAt(0);e[l][1]=e[l][1].slice(1),f+=b,p+=b}}if(l0||p.length>0){f.length>0&&p.length>0&&(0!==(m=o(p,f))&&(g>=0?e[g][1]+=p.substring(0,m):(e.splice(0,0,[n,p.substring(0,m)]),l++),p=p.substring(m),f=f.substring(m)),0!==(m=a(p,f))&&(e[l][1]=p.substring(p.length-m)+e[l][1],p=p.substring(0,p.length-m),f=f.substring(0,f.length-m)));var v=h+c;0===f.length&&0===p.length?(e.splice(l-v,v),l-=v):0===f.length?(e.splice(l-v,v,[s,p]),l=l-v+1):0===p.length?(e.splice(l-v,v,[i,f]),l=l-v+1):(e.splice(l-v,v,[i,f],[s,p]),l=l-v+2)}0!==l&&e[l-1][0]===n?(e[l-1][1]+=e[l][1],e.splice(l,1)):l++,h=0,c=0,f="",p=""}""===e[e.length-1][1]&&e.pop();var x=!1;l=1;for(;l=55296&&t<=56319}function h(t){return t>=56320&&t<=57343}function u(t){return h(t.charCodeAt(0))}function d(t){return c(t.charCodeAt(t.length-1))}function f(t,e,r,l){return d(t)||u(l)?null:function(t){for(var e=[],i=0;i0&&e.push(t[i]);return e}([[n,t],[i,e],[s,r],[n,l]])}function p(t,e,i){return r(t,e,i,!0)}p.INSERT=s,p.DELETE=i,p.EQUAL=n,t.exports=p},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n,r=s(i(3)),l=s(i(1));!function(t){t.compose=function(t,e,i){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var s=l.default(!0,{},e);for(var n in i||(s=Object.keys(s).reduce(function(t,e){return null!=s[e]&&(t[e]=s[e]),t},{})),t)void 0!==t[n]&&void 0===e[n]&&(s[n]=t[n]);return Object.keys(s).length>0?s:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var i=Object.keys(t).concat(Object.keys(e)).reduce(function(i,s){return r.default(t[s],e[s])||(i[s]=void 0===e[s]?null:e[s]),i},{});return Object.keys(i).length>0?i:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var i=Object.keys(e).reduce(function(i,s){return e[s]!==t[s]&&void 0!==t[s]&&(i[s]=e[s]),i},{});return Object.keys(t).reduce(function(i,s){return t[s]!==e[s]&&void 0===e[s]&&(i[s]=null),i},i)},t.transform=function(t,e,i){if(void 0===i&&(i=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!i)return e;var s=Object.keys(e).reduce(function(i,s){return void 0===t[s]&&(i[s]=e[s]),i},{});return Object.keys(s).length>0?s:void 0}}}(n||(n={})),e.default=n},function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=s(i(5)),r=function(){function t(t){this.ops=t,this.index=0,this.offset=0}return t.prototype.hasNext=function(){return this.peekLength()<1/0},t.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var i=this.offset,s=n.default.length(e);if(t>=s-i?(t=s-i,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var r={};return e.attributes&&(r.attributes=e.attributes),"number"==typeof e.retain?r.retain=t:"string"==typeof e.insert?r.insert=e.insert.substr(i,t):r.insert=e.insert,r}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,i=this.next(),s=this.ops.slice(this.index);return this.offset=t,this.index=e,[i].concat(s)}return[]},t}();e.default=r},function(t,e,i){"use strict";i.r(e);var s={};i.r(s),i.d(s,"ParentBlot",function(){return m}),i.d(s,"ContainerBlot",function(){return b}),i.d(s,"LeafBlot",function(){return v}),i.d(s,"EmbedBlot",function(){return O}),i.d(s,"ScrollBlot",function(){return B}),i.d(s,"BlockBlot",function(){return S}),i.d(s,"InlineBlot",function(){return L}),i.d(s,"TextBlot",function(){return _}),i.d(s,"Attributor",function(){return x}),i.d(s,"ClassAttributor",function(){return q}),i.d(s,"StyleAttributor",function(){return A}),i.d(s,"AttributorStore",function(){return w}),i.d(s,"Registry",function(){return h}),i.d(s,"Scope",function(){return o});var n,r=i(0),l=i.n(r);!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(n||(n={}));var o=n;var a=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){this.insertBefore(t[0],null),t.length>1&&this.append.apply(this,t.slice(1))}at(t){const e=this.iterator();let i=e();for(;i&&t>0;)t-=1,i=e();return i}contains(t){const e=this.iterator();let i=e();for(;i;){if(i===t)return!0;i=e()}return!1}indexOf(t){const e=this.iterator();let i=e(),s=0;for(;i;){if(i===t)return s;s+=1,i=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,i=this.head;for(;null!=i;){if(i===t)return e;e+=i.length(),i=i.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const i=this.iterator();let s=i();for(;s;){const n=s.length();if(tr?i(o,t-r,Math.min(e,r+s-t)):i(o,0,Math.min(s,t+e-r)),r+=s,o=l()}}map(t){return this.reduce((e,i)=>(e.push(t(i)),e),[])}reduce(t,e){const i=this.iterator();let s=i();for(;s;)e=t(e,s),s=i();return e}};class c extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}class h{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){return null==t?null:this.blots.has(t)?this.blots.get(t)||null:e?this.find(t.parentNode,e):null}create(t,e,i){const s=this.query(e);if(null==s)throw new c(`Unable to create ${e} blot`);const n=s,r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:n.create(i),l=new n(t,r,i);return h.blots.set(l.domNode,l),l}find(t,e=!1){return h.find(t,e)}query(t,e=o.ANY){let i;if("string"==typeof t)i=this.types[t]||this.attributes[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)i=this.types.text;else if("number"==typeof t)t&o.LEVEL&o.BLOCK?i=this.types.block:t&o.LEVEL&o.INLINE&&(i=this.types.inline);else if(t instanceof HTMLElement){(t.getAttribute("class")||"").split(/\s+/).some(t=>!!(i=this.classes[t])),i=i||this.tags[t.tagName]}return null==i?null:e&o.LEVEL&i.scope&&e&o.TYPE&i.scope?i:null}register(...t){if(t.length>1)return t.map(t=>this.register(t));const e=t[0];if("string"!=typeof e.blotName&&"string"!=typeof e.attrName)throw new c("Invalid definition");if("abstract"===e.blotName)throw new c("Cannot register abstract class");if(this.types[e.blotName||e.attrName]=e,"string"==typeof e.keyName)this.attributes[e.keyName]=e;else if(null!=e.className&&(this.classes[e.className]=e),null!=e.tagName){Array.isArray(e.tagName)?e.tagName=e.tagName.map(t=>t.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{null!=this.tags[t]&&null!=e.className||(this.tags[t]=e)})}return e}}h.blots=new WeakMap;class u{constructor(t,e){this.scroll=t,this.domNode=e,h.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new c("Blot definition missing tagName");let e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t,10).toString()===t&&(t=parseInt(t,10))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),h.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,i,s){const n=this.isolate(t,e);if(null!=this.scroll.query(i,o.BLOT)&&s)n.wrap(i,s);else if(null!=this.scroll.query(i,o.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);n.wrap(t),t.format(i,s)}}insertAt(t,e,i){const s=null==i?this.scroll.create("text",e):this.scroll.create(e,i),n=this.split(t);this.parent.insertBefore(s,n||void 0)}isolate(t,e){const i=this.split(t);if(null==i)throw new Error("Attempt to isolate at end");return i.split(e),i}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(i,this.next||void 0),this.remove()),i}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(i,this.next||void 0),"function"!=typeof i.appendChild)throw new c(`Cannot wrap ${t}`);return i.appendChild(this),i}}u.blotName="abstract";var d=u;class f extends d{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,f.uiClass&&this.uiNode.classList.add(f.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new a,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=p(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof c)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,i)=>{t.deleteAt(e,i)})}descendant(t,e=0){const[i,s]=this.children.find(e);return null==t.blotName&&t(i)||null!=t.blotName&&i instanceof t?[i,s]:i instanceof f?i.descendant(t,s):[null,-1]}descendants(t,e=0,i=Number.MAX_VALUE){let s=[],n=i;return this.children.forEachAt(e,i,(e,i,r)=>{(null==t.blotName&&t(e)||null!=t.blotName&&e instanceof t)&&s.push(e),e instanceof f&&(s=s.concat(e.descendants(t,i,n))),n-=r}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{if(t)return;this.statics.allowedChildren.some(t=>e instanceof t)||(e.statics.scope===o.BLOCK_BLOT?(null!=e.next&&this.splitAfter(e),null!=e.prev&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof f?e.unwrap():e.remove())})}formatAt(t,e,i,s){this.children.forEachAt(t,e,(t,e,n)=>{t.formatAt(e,n,i,s)})}insertAt(t,e,i){const[s,n]=this.children.find(t);if(s)s.insertAt(n,e,i);else{const t=null==i?this.scroll.create("text",e):this.scroll.create(e,i);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let i=null;this.children.insertBefore(t,e||null),null!=e&&(i=e.domNode),this.domNode.parentNode===t.domNode&&this.domNode.nextSibling===i||this.domNode.insertBefore(t.domNode,i),t.parent=this,t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(i=>{t.insertBefore(i,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(t,e=!1){const[i,s]=this.children.find(t,e),n=[[this,t]];return i instanceof f?n.concat(i.path(s,e)):(null!=i&&n.push([i,s]),n)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return i instanceof f&&this.moveChildren(i),super.replaceWith(i)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.clone();return this.parent&&this.parent.insertBefore(i,this.next||void 0),this.children.forEachAt(t,this.length(),(t,s,n)=>{const r=t.split(s,e);null!=r&&i.appendChild(r)}),i}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const i=[],s=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(i.push.apply(i,t.addedNodes),s.push.apply(s,t.removedNodes))}),s.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==this.domNode||e.detach())}),i.filter(t=>t.parentNode===this.domNode||t===this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const i=p(t,this.scroll);i.next===e&&null!=i.next||(null!=i.parent&&i.parent.removeChild(this),this.insertBefore(i,e||void 0))}),this.enforceAllowedChildren()}}function p(t,e){let i=e.find(t);if(null==i)try{i=e.create(t)}catch(s){i=e.create(o.INLINE),Array.from(t.childNodes).forEach(t=>{i.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(i.domNode,t),i.attach()}return i}f.uiClass="";var m=f;class g extends m{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,i,s){super.formatAt(t,e,i,s),this.enforceAllowedChildren()}insertAt(t,e,i){super.insertAt(t,e,i),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}}g.blotName="container",g.scope=o.BLOCK_BLOT;var b=g;class y extends d{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let i=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(i+=1),[this.parent.domNode,i]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}}y.scope=o.INLINE_BLOT;var v=y;class x{static keys(t){return Array.from(t.attributes).map(t=>t.name)}constructor(t,e,i={}){this.attrName=t,this.keyName=e;const s=o.TYPE&o.ATTRIBUTE;this.scope=null!=i.scope?i.scope&o.LEVEL|s:o.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}function N(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf(`${e}-`))}var q=class extends x{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){N(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(N(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function E(t){const e=t.split("-"),i=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+i}var A=class extends x{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[E(this.keyName)]=e,!0)}remove(t){t.style[E(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[E(this.keyName)];return this.canAdd(t,e)?e:""}};var w=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=h.find(this.domNode);if(null==t)return;const e=x.keys(this.domNode),i=q.keys(this.domNode),s=A.keys(this.domNode);e.concat(i).concat(s).forEach(e=>{const i=t.scroll.query(e,o.ATTRIBUTE);i instanceof x&&(this.attributes[i.attrName]=i)})}copy(t){Object.keys(this.attributes).forEach(e=>{const i=this.attributes[e].value(this.domNode);t.format(e,i)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}};class k extends m{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const i=e.query(k.blotName);if(null==i||t.tagName!==i.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){if(t!==this.statics.blotName||e){const i=this.scroll.query(t,o.INLINE);if(null==i)return;i instanceof x?this.attributes.attribute(i,e):!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e)}else this.children.forEach(t=>{t instanceof k||(t=t.wrap(k.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,s){if(null!=this.formats()[i]||this.scroll.query(i,o.ATTRIBUTE)){this.isolate(t,e).format(i,s)}else super.formatAt(t,e,i,s)}optimize(t){super.optimize(t);const e=this.formats();if(0===Object.keys(e).length)return this.unwrap();const i=this.next;i instanceof k&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}(e,i.formats())&&(i.moveChildren(this),i.remove())}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(t,e){const i=super.wrap(t,e);return i instanceof k&&this.attributes.move(i),i}}k.allowedChildren=[k,v],k.blotName="inline",k.scope=o.INLINE_BLOT,k.tagName="SPAN";var L=k;class T extends m{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const i=e.query(T.blotName);if(null==i||t.tagName!==i.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){const i=this.scroll.query(t,o.BLOCK);null!=i&&(i instanceof x?this.attributes.attribute(i,e):t!==this.statics.blotName||e?!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e):this.replaceWith(T.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,s){null!=this.scroll.query(i,o.BLOCK)?this.format(i,s):super.formatAt(t,e,i,s)}insertAt(t,e,i){if(null==i||null!=this.scroll.query(e,o.INLINE))super.insertAt(t,e,i);else{const s=this.split(t);if(null==s)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,i);s.parent.insertBefore(t,s)}}}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}}T.blotName="block",T.scope=o.BLOCK_BLOT,T.tagName="P",T.allowedChildren=[L,T,v];var S=T;var O=class extends v{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,i,s){0===t&&e===this.length()?this.format(i,s):super.formatAt(t,e,i,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}};const C={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},R=100;class I extends m{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,C),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){return this.registry.find(t,e)}query(t,e=o.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,i,s){this.update(),super.formatAt(t,e,i,s)}insertAt(t,e,i){this.update(),super.insertAt(t,e,i)}optimize(t=[],e={}){super.optimize(e);const i=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const n=(t,e=!0)=>{null!=t&&t!==this&&null!=t.domNode.parentNode&&(i.has(t.domNode)||i.set(t.domNode,[]),e&&n(t.parent))},r=t=>{i.has(t.domNode)&&(t instanceof m&&t.children.forEach(r),i.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=R)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(n(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);n(e,!1),e instanceof m&&e.children.forEach(t=>{n(t,!1)})})):"attributes"===t.type&&n(e.prev)),n(e))}),this.children.forEach(r),s=(l=Array.from(this.observer.takeRecords())).slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const i=new WeakMap;t.map(t=>{const e=h.find(t.target,!0);return null==e?null:i.has(e.domNode)?(i.get(e.domNode).push(t),null):(i.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&i.has(t.domNode)&&t.update(i.get(t.domNode)||[],e)}),e.mutationsMap=i,i.has(this.domNode)&&super.update(i.get(this.domNode),e),this.optimize(t,e)}}I.blotName="scroll",I.defaultChild=S,I.allowedChildren=[S,b],I.scope=o.BLOCK_BLOT,I.tagName="DIV";var B=I;class M extends v{constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}static create(t){return document.createTextNode(t)}static value(t){return t.data}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,i){null==i?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,i)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof M&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(i,this.next||void 0),this.text=this.statics.value(this.domNode),i}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}}M.blotName="text",M.scope=o.INLINE_BLOT;var _=M,D=i(1),j=i.n(D),U=i(2),P=i.n(U),H=i(3),F=i.n(H),z=i(6),K=i.n(z),V=new WeakMap;const W=["error","warn","log","info"];let Z="warn";function G(t){if(W.indexOf(t)<=W.indexOf(Z)){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s(e[i]=G.bind(console,i,t),e),{})}$.level=(t=>{Z=t}),G.level=$.level;var X=$;const Y=X("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(t=>{document.addEventListener(t,function(){for(var t=arguments.length,e=new Array(t),i=0;i{const i=V.get(t);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class Q extends K.a{constructor(){super(),this.listeners={},this.on("error",Y.error)}emit(){for(var t=arguments.length,e=new Array(t),i=0;i1?e-1:0),s=1;s{let s=e.node,n=e.handler;(t.target===s||s.contains(t.target))&&n(t,...i)})}listenDOM(t,e,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:i})}}Q.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},Q.sources={API:"api",SILENT:"silent",USER:"user"};var J=Q;class tt extends O{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}tt.blotName="break",tt.tagName="BR";var et=tt;class it extends _{}function st(t){return t.replace(/[&<>"']/g,t=>{return{"&":"&","<":"<",">":">",'"':""","'":"'"}[t]})}class nt extends L{static compare(t,e){const i=nt.order.indexOf(t),s=nt.order.indexOf(e);return i>=0||s>=0?i-s:t===e?0:t0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}nt.allowedChildren=[nt,et,O,it],nt.order=["cursor","inline","underline","strike","italic","bold","script","link","code"];var rt=nt;const lt=1;class ot extends S{constructor(t,e){super(t,e),this.cache={}}delta(){return null==this.cache.delta&&(this.cache.delta=ct(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,i,s){e<=0||(this.scroll.query(i,o.BLOCK)?t+e===this.length()&&this.format(i,s):super.formatAt(t,Math.min(e,this.length()-t-1),i,s),this.cache={})}insertAt(t,e,i){if(null!=i)return super.insertAt(t,e,i),void(this.cache={});if(0===e.length)return;const s=e.split("\n"),n=s.shift();n.length>0&&(t((r=r.split(t,!0)).insertAt(0,e),e.length),t+n.length)}insertBefore(t,e){const i=this.children.head;super.insertBefore(t,e),i instanceof et&&i.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+lt),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-lt)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const i=super.split(t,e);return this.cache={},i}}ot.blotName="block",ot.tagName="P",ot.defaultChild=et,ot.allowedChildren=[et,rt,O,it];class at extends O{attach(){super.attach(),this.attributes=new w(this.domNode)}delta(){return(new l.a).insert(this.value(),j()(this.formats(),this.attributes.values()))}format(t,e){const i=this.scroll.query(t,o.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,e)}formatAt(t,e,i,s){this.format(i,s)}insertAt(t,e,i){if("string"==typeof e&&e.endsWith("\n")){const i=this.scroll.create(ot.blotName);this.parent.insertBefore(i,0===t?this:this.next),i.insertAt(0,e.slice(0,-1))}else super.insertAt(t,e,i)}}function ct(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(v).reduce((t,i)=>0===i.length()?t:t.insert(i.value(),ht(i,{},e)),new l.a).insert("\n",ht(t))}function ht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("function"==typeof t.formats&&(e=j()(e,t.formats()),i&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:ht(t.parent,e,i))}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}at.scope=o.BLOCK_BLOT;const dt=X("quill:selection");class ft{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class pt{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new ft(0,0),this.lastRange=this.savedRange,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,J.sources.USER),1)}),this.emitter.on(J.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(J.events.SCROLL_UPDATE,()=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset),this.update(J.sources.SILENT)}catch(t){}})}),this.emitter.on(J.events.SCROLL_OPTIMIZE,(t,e)=>{if(e.range){const t=e.range,i=t.startNode,s=t.startOffset,n=t.endNode,r=t.endOffset;this.setNativeRange(i,s,n,r),this.update(J.sources.SILENT)}}),this.update(J.sources.SILENT)}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t.statics.blotName===ot.blotName&&(!(t.children.length>1)&&t.children.head instanceof et)}handleComposition(){this.root.addEventListener("compositionstart",()=>{this.root.classList.toggle("ql-blank",!1),this.composing=!0,this.scroll.batchStart()}),this.root.addEventListener("compositionend",()=>{setTimeout(()=>{if(this.root.classList.toggle("ql-blank",this.isBlank()),this.scroll.batchEnd(),this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}},1)})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(J.sources.USER)})}focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!this.scroll.query(t,o.BLOCK)){if(i.start.node!==this.cursor.textNode){const t=this.scroll.find(i.start.node,!1);if(null==t)return;if(t instanceof v){const e=t.split(i.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,i.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=this.scroll.length();let s;t=Math.min(t,i-1),e=Math.min(t+e,i-1)-t;let n=ut(this.scroll.leaf(t),2),r=n[0],l=n[1];if(null==r)return null;var o=ut(r.position(l,!0),2);s=o[0],l=o[1];const a=document.createRange();if(e>0){a.setStart(s,l);var c=ut(this.scroll.leaf(t+e),2);if(r=c[0],l=c[1],null==r)return null;var h=ut(r.position(l,!0),2);return s=h[0],l=h[1],a.setEnd(s,l),a.getBoundingClientRect()}let u,d="left";return s instanceof Text?(l0&&(d="right")),{bottom:u.top+u.height,height:u.height,left:u[d],right:u[d],top:u.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const i=this.normalizeNative(e);return dt.info("getNativeRange",i),i}getRange(){const t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||mt(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const i=e.map(t=>{const e=ut(t,2),i=e[0],s=e[1],n=this.scroll.find(i,!0),r=n.offset(this.scroll);return 0===s?r:n instanceof v?r+n.index(i,s):r+n.length()}),s=Math.min(Math.max(...i),this.scroll.length()-1),n=Math.min(s,...i);return new ft(n,s-n)}normalizeNative(t){if(!mt(this.root,t.startContainer)||!t.collapsed&&!mt(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(t=>{let e=t.node,i=t.offset;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>i)e=e.childNodes[i],i=0;else{if(e.childNodes.length!==i)break;i=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=i}),e}rangeToNative(t){const e=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],s=this.scroll.length();return e.forEach((t,e)=>{t=Math.min(s-1,t);const n=ut(this.scroll.leaf(t),2),r=n[0],l=n[1],o=ut(r.position(l,0!==e),2),a=o[0],c=o[1];i.push(a,c)}),i.length<2?i.concat(i):i}scrollIntoView(t){const e=this.lastRange;if(null==e)return;const i=this.getBounds(e.index,e.length);if(null==i)return;const s=this.scroll.length()-1,n=ut(this.scroll.line(Math.min(e.index,s)),1)[0];let r=n;e.length>0&&(r=ut(this.scroll.line(Math.min(e.index+e.length,s)),1)[0]);if(null==n||null==r)return;const l=t.getBoundingClientRect();i.topl.bottom&&(t.scrollTop+=i.bottom-l.bottom)}setNativeRange(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(dt.info("setNativeRange",t,e,i,s),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==i.parentNode))return;const r=document.getSelection();if(null!=r)if(null!=t){this.hasFocus()||this.root.focus();const l=(this.getNativeRange()||{}).native;if(null==l||n||t!==l.startContainer||e!==l.startOffset||i!==l.endContainer||s!==l.endOffset){"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),"BR"===i.tagName&&(s=Array.from(i.parentNode.childNodes).indexOf(i),i=i.parentNode);const n=document.createRange();n.setStart(t,e),n.setEnd(i,s),r.removeAllRanges(),r.addRange(n)}}else r.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J.sources.API;if("string"==typeof e&&(i=e,e=!1),dt.info("setRange",t),null!=t){const i=this.rangeToNative(t);this.setNativeRange(...i,e)}else this.setNativeRange(null);this.update(i)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J.sources.USER;const e=this.lastRange,i=ut(this.getRange(),2),s=i[0],n=i[1];if(this.lastRange=s,null!=this.lastRange&&(this.savedRange=this.lastRange),!F()(e,this.lastRange)){if(!this.composing&&null!=n&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const i=[J.events.SELECTION_CHANGE,P()(this.lastRange),P()(e),t];this.emitter.emit(J.events.EDITOR_CHANGE,...i),t!==J.sources.SILENT&&this.emitter.emit(...i)}}}function mt(t,e){try{e.parentNode}catch(t){return!1}return t.contains(e)}class gt extends O{static value(){}constructor(t,e,i){super(t,e),this.selection=i,this.textNode=document.createTextNode(gt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let i=this,s=0;for(;null!=i&&i.statics.scope!==o.BLOCK_BLOT;)s+=i.offset(i.parent),i=i.parent;null!=i&&(this.savedLength=gt.CONTENTS.length,i.optimize(),i.formatAt(s,gt.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof it?this.prev:null,i=e?e.length():0,s=this.next instanceof it?this.next:null,n=s?s.text:"",r=this.textNode,l=r.data.split(gt.CONTENTS).join("");let o;if(r.data=gt.CONTENTS,e)o=e,(l||s)&&(e.insertAt(e.length(),l+n),s&&s.remove());else if(s)o=s,s.insertAt(0,l);else{const t=document.createTextNode(l);o=this.scroll.create(t),this.parent.insertBefore(o,this)}if(this.remove(),t){const n=(t,n)=>e&&t===e.domNode?n:t===r?i+n-1:s&&t===s.domNode?i+l.length+n:null,a=n(t.start.node,t.start.offset),c=n(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:o.domNode,startOffset:a,endNode:o.domNode,endOffset:c}}return null}update(t,e){if(t.some(t=>"characterData"===t.type&&t.target===this.textNode)){const t=this.restore();t&&(e.range=t)}}value(){return""}}gt.blotName="cursor",gt.className="ql-cursor",gt.tagName="span",gt.CONTENTS="\ufeff";var bt=gt;function yt(t){return Nt(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||xt()}function vt(t,e){return Nt(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||xt()}function xt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Nt(t){if(Array.isArray(t))return t}const qt=/^[ -~]*$/;function Et(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"==typeof t.html)return t.html(e,i);if(t instanceof it)return st(t.value().slice(e,e+i));if(t.children){if("list-container"===t.statics.blotName){const s=[];return t.children.forEachAt(e,i,(t,e,i)=>{const n=t.formats();s.push({child:t,offset:e,length:i,indent:n.indent||0,type:n.list})}),function t(e,i,s){if(0===e.length){const e=vt(wt(s.pop()),1)[0];return i<=0?""):"").concat(t([],i-1,s))}const n=yt(e),r=n[0],l=r.child,o=r.offset,a=r.length,c=r.indent,h=r.type,u=n.slice(1),d=vt(wt(h),2),f=d[0],p=d[1];if(c>i)return s.push(h),c===i+1?"<".concat(f,">").concat(Et(l,o,a)).concat(t(u,c,s)):"<".concat(f,">
  • ").concat(t(e,i+1,s));const m=s[s.length-1];if(c===i&&h===m)return"
  • ").concat(Et(l,o,a)).concat(t(u,c,s));const g=vt(wt(s.pop()),1)[0];return"").concat(t(e,i-1,s))}(s,-1,[])}const n=[];if(t.children.forEachAt(e,i,(t,e,i)=>{n.push(Et(t,e,i))}),s||"list"===t.statics.blotName)return n.join("");const r=t.domNode,l=r.outerHTML,o=r.innerHTML,a=vt(l.split(">".concat(o,"<")),2),c=a[0],h=a[1];return"'.concat(n.join(""),"<").concat(h):"".concat(c,">").concat(n.join(""),"<").concat(h)}return t.domNode.outerHTML}function At(t,e){return Object.keys(e).reduce((i,s)=>null==t[s]?i:(e[s]===t[s]?i[s]=e[s]:Array.isArray(e[s])?e[s].indexOf(t[s])<0&&(i[s]=e[s].concat([t[s]])):i[s]=[e[s],t[s]],i),{})}function wt(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function kt(t,e){let i=t.index,s=t.length;return new ft(i+e,s)}var Lt=class{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){let e=!1;this.scroll.update();let i=this.scroll.length();this.scroll.batchStart();const s=function(t){return t.reduce((t,e)=>{if("string"==typeof e.insert){const i=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(i,e.attributes)}return t.push(e)},new l.a)}(t);return s.reduce((t,s)=>{const n=s.retain||s.delete||s.insert.length||1;let l=s.attributes||{};if(null!=s.insert){if("string"==typeof s.insert){let n=s.insert;n.endsWith("\n")&&e&&(e=!1,n=n.slice(0,-1)),(t>=i||this.scroll.descendant(at,t)[0])&&!n.endsWith("\n")&&(e=!0),this.scroll.insertAt(t,n);const o=vt(this.scroll.line(t),2),a=o[0],c=o[1];let h=j()({},ht(a));if(a instanceof ot){const t=vt(a.descendant(v,c),1)[0];h=j()(h,ht(t))}l=r.AttributeMap.diff(h,l)||{}}else if("object"==typeof s.insert){const e=Object.keys(s.insert)[0];if(null==e)return t;this.scroll.insertAt(t,e,s.insert[e])}i+=n}return Object.keys(l).forEach(e=>{this.scroll.formatAt(t,n,e,l[e])}),t+n},0),s.reduce((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new l.a).retain(t).delete(e))}formatLine(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(i).forEach(s=>{this.scroll.lines(t,Math.max(e,1)).forEach(t=>{t.format(s,i[s])})}),this.scroll.optimize();const s=(new l.a).retain(t).retain(e,P()(i));return this.update(s)}formatText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(i).forEach(s=>{this.scroll.formatAt(t,e,s,i[s])});const s=(new l.a).retain(t).retain(e,P()(i));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new l.a)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],s=[];0===e?this.scroll.path(t).forEach(t=>{const e=vt(t,1)[0];e instanceof ot?i.push(e):e instanceof v&&s.push(e)}):(i=this.scroll.lines(t,e),s=this.scroll.descendants(v,t,e));const n=[i,s].map(t=>{if(0===t.length)return{};let e=ht(t.shift());for(;Object.keys(e).length>0;){const i=t.shift();if(null==i)return e;e=At(ht(i),e)}return e});return j.a.apply(j.a,n)}getHTML(t,e){const i=vt(this.scroll.line(t),2),s=i[0],n=i[1];return s.length()>=n+e?Et(s,n,e,!0):Et(this.scroll,t,e,!0)}getText(t,e){return this.getContents(t,e).filter(t=>"string"==typeof t.insert).map(t=>t.insert).join("")}insertEmbed(t,e,i){return this.scroll.insertAt(t,e,i),this.update((new l.a).retain(t).insert({[e]:i}))}insertText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(i).forEach(s=>{this.scroll.formatAt(t,e.length,s,i[s])}),this.update((new l.a).retain(t).insert(e,P()(i)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t.statics.blotName===ot.blotName&&!(t.children.length>1)&&t.children.head instanceof et}removeFormat(t,e){const i=this.getText(t,e),s=vt(this.scroll.line(t+e),2),n=s[0],r=s[1];let o=0,a=new l.a;null!=n&&(o=n.length()-r,a=n.delta().slice(r,r+o-1).insert("\n"));const c=this.getContents(t,e+o).diff((new l.a).insert(i).concat(a)),h=(new l.a).retain(t).concat(c);return this.applyDelta(h)}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const s=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(qt)&&this.scroll.find(e[0].target)){const n=this.scroll.find(e[0].target),r=ht(n),o=n.offset(this.scroll),a=e[0].oldValue.replace(bt.CONTENTS,""),c=(new l.a).insert(a),h=(new l.a).insert(n.value()),u=i&&{oldRange:kt(i.oldRange,-o),newRange:kt(i.newRange,-o)};t=(new l.a).retain(o).concat(c.diff(h,u)).reduce((t,e)=>e.insert?t.insert(e.insert,r):t.push(e),new l.a),this.delta=s.compose(t)}else this.delta=this.getDelta(),t&&F()(s.compose(t),this.delta)||(t=s.diff(this.delta,i));return t}};class Tt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}Tt.DEFAULTS={};var St=Tt;class Ot{constructor(t,e){this.quill=t,this.options=e,this.modules={}}init(){Object.keys(this.options.modules).forEach(t=>{null==this.modules[t]&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import("modules/".concat(t));return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}Ot.DEFAULTS={modules:{}},Ot.themes={default:Ot};var Ct=Ot;function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const It=X("quill"),Bt=new h;m.uiClass="ql-ui";class Mt{static debug(t){!0===t&&(t="log"),X.level(t)}static find(t){return V.get(t)||Bt.find(t)}static import(t){return null==this.imports[t]&&It.error("Cannot import ".concat(t,". Are you sure it was registered?")),this.imports[t]}static register(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){const i=t.attrName||t.blotName;"string"==typeof i?this.register("formats/".concat(i),t,e):Object.keys(t).forEach(i=>{this.register(i,t[i],e)})}else null==this.imports[t]||i||It.warn("Overwriting ".concat(t," with"),e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName&&Bt.register(e),"function"==typeof e.register&&e.register(Bt)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){if((e=j()(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0}},e)).theme&&e.theme!==Mt.DEFAULTS.theme){if(e.theme=Mt.import("themes/".concat(e.theme)),null==e.theme)throw new Error("Invalid theme ".concat(e.theme,". Did you register it?"))}else e.theme=Ct;const i=j()(!0,{},e.theme.DEFAULTS);[i,e].forEach(t=>{t.modules=t.modules||{},Object.keys(t.modules).forEach(e=>{!0===t.modules[e]&&(t.modules[e]={})})});const s=Object.keys(i.modules).concat(Object.keys(e.modules)).reduce((t,e)=>{const i=Mt.import("modules/".concat(e));return null==i?It.error("Cannot load ".concat(e," module. Are you sure you registered it?")):t[e]=i.DEFAULTS||{},t},{});null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar});return e=j()(!0,{},Mt.DEFAULTS,{modules:s},i,e),["bounds","container","scrollingContainer"].forEach(t=>{"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce((t,i)=>(e.modules[i]&&(t[i]=e.modules[i]),t),{}),e}(t,e),this.container=this.options.container,null==this.container)return It.error("Invalid Quill container",t);this.options.debug&&Mt.debug(this.options.debug);const i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",V.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new J;const s=this.options.registry.query(B.blotName);this.scroll=new s(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Lt(this.scroll),this.selection=new pt(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.init(),this.emitter.on(J.events.EDITOR_CHANGE,t=>{t===J.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(J.events.SCROLL_UPDATE,(t,e)=>{const i=this.selection.lastRange,s=Rt(this.selection.getRange(),1)[0],n=i&&s?{oldRange:i,newRange:s}:void 0;_t.call(this,()=>this.editor.update(null,e,n),t)});const n=this.clipboard.convert({html:"".concat(i,"


    "),text:"\n"});this.setContents(n),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,i){var s=Rt(Dt(t,e,i),4);return t=s[0],e=s[1],i=s[3],_t.call(this,()=>this.editor.deleteText(t,e),i,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){const t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}format(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J.sources.API;return _t.call(this,()=>{const i=this.getSelection(!0);let s=new l.a;if(null==i)return s;if(this.scroll.query(t,o.BLOCK))s=this.editor.formatLine(i.index,i.length,{[t]:e});else{if(0===i.length)return this.selection.format(t,e),s;s=this.editor.formatText(i.index,i.length,{[t]:e})}return this.setSelection(i,J.sources.SILENT),s},i)}formatLine(t,e,i,s,n){let r;var l=Rt(Dt(t,e,i,s,n),4);return t=l[0],e=l[1],r=l[2],n=l[3],_t.call(this,()=>this.editor.formatLine(t,e,r),n,t,0)}formatText(t,e,i,s,n){let r;var l=Rt(Dt(t,e,i,s,n),4);return t=l[0],e=l[1],r=l[2],n=l[3],_t.call(this,()=>this.editor.formatText(t,e,r),n,t,0)}getBounds(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e="number"==typeof t?this.selection.getBounds(t,i):this.selection.getBounds(t.index,t.length);const s=this.container.getBoundingClientRect();return{bottom:e.bottom-s.top,height:e.height,left:e.left-s.left,right:e.right-s.left,top:e.top-s.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;var i=Rt(Dt(t,e),2);return t=i[0],e=i[1],this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mt.sources.API;return _t.call(this,()=>this.editor.insertEmbed(t,e,i),s,t)}insertText(t,e,i,s,n){let r;var l=Rt(Dt(t,0,i,s,n),4);return t=l[0],r=l[2],n=l[3],_t.call(this,()=>this.editor.insertText(t,e,r),n,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,i){var s=Rt(Dt(t,e,i),4);return t=s[0],e=s[1],i=s[3],_t.call(this,()=>this.editor.removeFormat(t,e),i,t)}scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}setContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;return _t.call(this,()=>{t=new l.a(t);const e=this.getLength(),i=this.editor.deleteText(0,e),s=this.editor.applyDelta(t),n=s.ops[s.ops.length-1];return null!=n&&"string"==typeof n.insert&&"\n"===n.insert[n.insert.length-1]&&(this.editor.deleteText(this.getLength()-1,1),s.delete(1)),i.compose(s)},e)}setSelection(t,e,i){if(null==t)this.selection.setRange(null,e||Mt.sources.API);else{var s=Rt(Dt(t,e,i),4);t=s[0],e=s[1],i=s[3],this.selection.setRange(new ft(Math.max(0,t),e),i),i!==J.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;const i=(new l.a).insert(t);return this.setContents(i,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J.sources.API;return _t.call(this,()=>(t=new l.a(t),this.editor.applyDelta(t,e)),e,!0)}}function _t(t,e,i,s){if(!this.isEnabled()&&e===J.sources.USER&&!this.allowReadOnlyEdits)return new l.a;let n=null==i?null:this.getSelection();const r=this.editor.delta,o=t();if(null!=n&&(!0===i&&(i=n.index),null==s?n=jt(n,o,e):0!==s&&(n=jt(n,i,s,e)),this.setSelection(n,J.sources.SILENT)),o.length()>0){const t=[J.events.TEXT_CHANGE,o,r,e];this.emitter.emit(J.events.EDITOR_CHANGE,...t),e!==J.sources.SILENT&&this.emitter.emit(...t)}return o}function Dt(t,e,i,s,n){let r={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(n=s,s=i,i=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(n=s,s=i,i=e,e=0),"object"==typeof i?(r=i,n=s):"string"==typeof i&&(null!=s?r[i]=s:n=i),[t,e,r,n=n||J.sources.API]}function jt(t,e,i,s){if(null==t)return null;let n,r;if(e instanceof l.a){var o=Rt([t.index,t.index+t.length].map(t=>e.transformPosition(t,s!==J.sources.USER)),2);n=o[0],r=o[1]}else{var a=Rt([t.index,t.index+t.length].map(t=>t=0?t+i:Math.max(e,t+i)),2);n=a[0],r=a[1]}return new ft(n,r-n)}Mt.DEFAULTS={bounds:null,modules:{},placeholder:"",readOnly:!1,registry:Bt,scrollingContainer:null,theme:"default"},Mt.events=J.events,Mt.sources=J.sources,Mt.version="2.0.14",Mt.imports={delta:l.a,parchment:s,"core/module":St,"core/theme":Ct};var Ut=class extends b{};const Pt="\ufeff";var Ht=class extends O{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable",!1),Array.from(this.domNode.childNodes).forEach(t=>{this.contentNode.appendChild(t)}),this.leftGuard=document.createTextNode(Pt),this.rightGuard=document.createTextNode(Pt),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e,i;const s=t.data.split(Pt).join("");if(t===this.leftGuard)if(this.prev instanceof it){const t=this.prev.length();this.prev.insertAt(t,s),e={startNode:this.prev.domNode,startOffset:t+s.length}}else i=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(i),this),e={startNode:i,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof it?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(i=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(i),this.next),e={startNode:i,startOffset:s.length}));return t.data=Pt,e}update(t,e){t.forEach(t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const i=this.restore(t.target);i&&(e.range=i)}})}};function Ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function zt(t){return t instanceof ot||t instanceof at}class Kt extends B{constructor(t,e,i){let s=i.emitter;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",t=>this.handleDragStart(t))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(J.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(J.events.SCROLL_BLOT_UNMOUNT,t)}deleteAt(t,e){const i=Ft(this.line(t),2),s=i[0],n=i[1],r=Ft(this.line(t+e),1)[0];if(super.deleteAt(t,e),null!=r&&s!==r&&n>0){if(s instanceof at||r instanceof at)return void this.optimize();const t=r.children.head instanceof et?null:r.children.head;s.moveChildren(r,t),s.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}formatAt(t,e,i,s){super.formatAt(t,e,i,s),this.optimize()}handleDragStart(t){t.preventDefault()}insertAt(t,e,i){if(t>=this.length())if(null==i||null==this.scroll.query(e,o.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==i&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),i):t.insertAt(0,e,i)}else{const t=this.scroll.create(e,i);this.appendChild(t)}else super.insertAt(t,e,i);this.optimize()}insertBefore(t,e){if(t.statics.scope===o.INLINE_BLOT){const i=this.scroll.create(this.statics.defaultChild.blotName);i.appendChild(t),super.insertBefore(i,e)}else super.insertBefore(t,e)}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){return this.path(t).pop()||[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(zt,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const i=(t,e,s)=>{let n=[],r=s;return t.children.forEachAt(e,s,(t,e,s)=>{zt(t)?n.push(t):t instanceof b&&(n=n.concat(i(t,e,r))),r-=s}),n};return i(this,t,e)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(J.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=J.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(J.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(J.events.SCROLL_UPDATE,e,t)}}Kt.blotName="scroll",Kt.className="ql-editor",Kt.tagName="DIV",Kt.defaultChild=ot,Kt.allowedChildren=[ot,at,Ut];var Vt=Kt;const Wt={scope:o.BLOCK,whitelist:["right","center","justify"]},Zt=new x("align","align",Wt),Gt=new q("align","ql-align",Wt),$t=new A("align","text-align",Wt);class Xt extends A{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;const i=(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(t=>"00".concat(parseInt(t,10).toString(16)).slice(-2)).join("");return"#".concat(i)}}const Yt=new q("color","ql-color",{scope:o.INLINE}),Qt=new Xt("color","color",{scope:o.INLINE}),Jt=new q("background","ql-bg",{scope:o.INLINE}),te=new Xt("background","background-color",{scope:o.INLINE});class ee extends Ut{static create(t){const e=super.create(t);return e.setAttribute("spellcheck",!1),e}html(t,e){const i=this.children.map(t=>t.domNode.innerText).join("\n").slice(t,t+e);return"
    ".concat(st(i),"
    ")}}class ie extends ot{static register(){Mt.register(ee)}}class se extends rt{}se.blotName="code",se.tagName="CODE",ie.blotName="code-block",ie.className="ql-code-block",ie.tagName="DIV",ee.blotName="code-block-container",ee.className="ql-code-block-container",ee.tagName="DIV",ee.allowedChildren=[ie],ie.allowedChildren=[it,et,bt],ie.requiredContainer=ee,ie.TAB=" ";const ne={scope:o.BLOCK,whitelist:["rtl"]},re=new x("direction","dir",ne),le=new q("direction","ql-direction",ne),oe=new A("direction","direction",ne),ae={scope:o.INLINE,whitelist:["serif","monospace"]},ce=new q("font","ql-font",ae);const he=new class extends A{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",ae),ue=new q("size","ql-size",{scope:o.INLINE,whitelist:["small","large","huge"]}),de=new A("size","font-size",{scope:o.INLINE,whitelist:["10px","18px","32px"]});function fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const me=X("quill:clipboard"),ge=[[Node.TEXT_NODE,function(t,e){let i=t.data;if("O:P"===t.parentNode.tagName)return e.insert(i.trim());if(0===i.trim().length&&i.includes("\n"))return e;if(!function t(e){if(null==e)return!1;Ee.has(e)||("PRE"===e.tagName?Ee.set(e,!0):Ee.set(e,t(e.parentNode)));return Ee.get(e)}(t)){const e=(t,e)=>{const i=e.replace(/[^\u00a0]/g,"");return i.length<1&&t?" ":i};i=(i=i.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,e.bind(e,!0)),(null==t.previousSibling&&qe(t.parentNode)||null!=t.previousSibling&&qe(t.previousSibling))&&(i=i.replace(/^\s+/,e.bind(e,!1))),(null==t.nextSibling&&qe(t.parentNode)||null!=t.nextSibling&&qe(t.nextSibling))&&(i=i.replace(/\s+$/,e.bind(e,!1)))}return e.insert(i)}],[Node.TEXT_NODE,ke],["br",function(t,e){Ne(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,ke],[Node.ELEMENT_NODE,function(t,e,i){const s=i.query(t);if(null==s)return e;if(s.prototype instanceof O){const e={},n=s.value(t);if(null!=n)return e[s.blotName]=n,(new l.a).insert(e,s.formats(t,i))}else if(s.prototype instanceof S&&!Ne(e,"\n")&&e.insert("\n"),"function"==typeof s.formats)return xe(e,s.blotName,s.formats(t,i));return e}],[Node.ELEMENT_NODE,function(t,e,i){const s=x.keys(t),n=q.keys(t),r=A.keys(t),l={};if(s.concat(n).concat(r).forEach(e=>{let s=i.query(e,o.ATTRIBUTE);null!=s&&(l[s.attrName]=s.value(t),l[s.attrName])||(null==(s=be[e])||s.attrName!==e&&s.keyName!==e||(l[s.attrName]=s.value(t)||void 0),null==(s=ye[e])||s.attrName!==e&&s.keyName!==e||(s=ye[e],l[s.attrName]=s.value(t)||void 0))}),Object.keys(l).length>0)return xe(e,l);return e}],[Node.ELEMENT_NODE,function(t,e){const i={},s=t.style||{};"italic"===s.fontStyle&&(i.italic=!0);"underline"===s.textDecoration&&(i.underline=!0);"line-through"===s.textDecoration&&(i.strike=!0);(s.fontWeight.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(i.bold=!0);Object.keys(i).length>0&&(e=xe(e,i));if(parseFloat(s.textIndent||0)>0)return(new l.a).insert("\t").concat(e);return e}],["li",function(t,e,i){const s=i.query(t);if(null==s||"list"!==s.blotName||!Ne(e,"\n"))return e;let n=-1,r=t.parentNode;for(;null!=r;)["OL","UL"].includes(r.tagName)&&(n+=1),r=r.parentNode;return n<=0?e:e.reduce((t,e)=>e.attributes&&e.attributes.list?t.push(e):t.insert(e.insert,function(t){for(var e=1;e(t[e.keyName]=e,t),{}),ye=[$t,te,Qt,oe,he,de].reduce((t,e)=>(t[e.keyName]=e,t),{});class ve extends St{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",t=>this.onCaptureCopy(t,!1)),this.quill.root.addEventListener("cut",t=>this.onCaptureCopy(t,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],ge.concat(this.options.matchers).forEach(t=>{let e=pe(t,2),i=e[0],s=e[1];this.addMatcher(i,s)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let e=t.html,i=t.text,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s[ie.blotName])return(new l.a).insert(i,{[ie.blotName]:s[ie.blotName]});if(!e)return(new l.a).insert(i||"");const n=(new DOMParser).parseFromString(e,"text/html").body,r=new WeakMap,o=pe(this.prepareMatching(n,r),2),a=o[0],c=o[1],h=Ae(this.quill.scroll,n,a,c,r);return Ne(h,"\n")&&(null==h.ops[h.ops.length-1].attributes||s.table)?h.compose((new l.a).retain(h.length()-1).delete(1)):h}dangerouslyPasteHTML(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;if("string"==typeof t){const i=this.convert({html:t,text:""});this.quill.setContents(i,e),this.quill.setSelection(0,Mt.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents((new l.a).retain(t).concat(s),i),this.quill.setSelection(t+s.length(),Mt.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const i=pe(this.quill.selection.getRange(),1)[0];if(null==i)return;const s=this.onCopy(i,e),n=s.html,r=s.text;t.clipboardData.setData("text/plain",r),t.clipboardData.setData("text/html",n),e&&this.quill.deleteText(i,Mt.sources.USER)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault(),t.stopPropagation();const e=this.quill.getSelection(!0);if(null==e)return;const i=t.clipboardData.getData("text/html"),s=t.clipboardData.getData("text/plain"),n=Array.from(t.clipboardData.files||[]);!i&&n.length>0?this.quill.uploader.upload(e,n):this.onPaste(e,{html:i,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let i=e.text,s=e.html;const n=this.quill.getFormat(t.index),r=this.convert({text:i,html:s},n);me.log("onPaste",r,{text:i,html:s});const o=(new l.a).retain(t.index).delete(t.length).concat(r);this.quill.updateContents(o,Mt.sources.USER),this.quill.setSelection(o.length()-t.length,Mt.sources.SILENT),this.quill.scrollIntoView()}prepareMatching(t,e){const i=[],s=[];return this.matchers.forEach(n=>{const r=pe(n,2),l=r[0],o=r[1];switch(l){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:i.push(o);break;default:Array.from(t.querySelectorAll(l)).forEach(t=>{if(e.has(t)){e.get(t).push(o)}else e.set(t,[o])})}}),[i,s]}}function xe(t,e,i){return"object"==typeof e?Object.keys(e).reduce((t,i)=>xe(t,i,e[i]),t):t.reduce((t,s)=>s.attributes&&s.attributes[e]?t.push(s):t.insert(s.insert,j()({},{[e]:i},s.attributes)),new l.a)}function Ne(t,e){let i="";for(let s=t.ops.length-1;s>=0&&i.lengths(e,i,t),new l.a):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((r,l)=>{let o=Ae(t,l,i,s,n);return l.nodeType===e.ELEMENT_NODE&&(o=i.reduce((e,i)=>i(l,e,t),o),o=(n.get(l)||[]).reduce((e,i)=>i(l,e,t),o)),r.concat(o)},new l.a):new l.a}function we(t,e,i){return xe(i,t,!0)}function ke(t,e,i){if(!Ne(e,"\n")){if(qe(t))return e.insert("\n");if(e.length()>0&&t.nextSibling){let s=t.nextSibling;for(;null!=s;){if(qe(s))return e.insert("\n");const t=i.query(s);if(t&&t.prototype instanceof at)return e.insert("\n");s=s.firstChild}}}return e}class Le extends St{constructor(t,e){super(t,e),this.lastRecorded=0,this.ignoreChange=!1,this.clear(),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e,i,s)=>{t!==Mt.events.TEXT_CHANGE||this.ignoreChange||(this.options.userOnly&&s!==Mt.sources.USER?this.transform(e):this.record(e,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:"z",shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this))}change(t,e){if(0===this.stack[t].length)return;const i=this.stack[t].pop(),s=this.quill.getContents(),n=i.invert(s);this.stack[e].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i,Mt.sources.USER),this.ignoreChange=!1;const r=function(t,e){const i=e.reduce((t,e)=>t+(e.delete||0),0);let s=e.length()-i;(function(t,e){const i=e.ops[e.ops.length-1];if(null==i)return!1;if(null!=i.insert)return"string"==typeof i.insert&&i.insert.endsWith("\n");if(null!=i.attributes)return Object.keys(i.attributes).some(e=>null!=t.query(e,o.BLOCK));return!1})(t,e)&&(s-=1);return s}(this.quill.scroll,i);this.quill.setSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let i=t.invert(e);const s=Date.now();if(this.lastRecorded+this.options.delay>s&&this.stack.undo.length>0){const t=this.stack.undo.pop();i=i.compose(t)}else this.lastRecorded=s;0!==i.length()&&(this.stack.undo.push(i),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Te(this.stack.undo,t),Te(this.stack.redo,t)}undo(){this.change("undo","redo")}}function Te(t,e){let i=e;for(let e=t.length-1;e>=0;e-=1){const s=t[e];t[e]=i.transform(s,!0),i=s.transform(i),0===t[e].length()&&t.splice(e,1)}}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Le.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};const Oe=X("quill:keyboard"),Ce=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Re extends St{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some(i=>!!e[i]!==t[i]&&null!==e[i])&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=P()(t,!1)}t.shortKey&&(t[Ce]=t.shortKey,delete t.shortKey);return t}(t);null!=s?("function"==typeof e&&(e={handler:e}),"function"==typeof i&&(i={handler:i}),(Array.isArray(s.key)?s.key:[s.key]).forEach(t=>{const n=j()({},s,{key:t},e,i);this.bindings[n.key]=this.bindings[n.key]||[],this.bindings[n.key].push(n)})):Oe.warn("Attempted to add invalid keyboard binding",s)}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing)return;const e=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(e=>Re.match(t,e));if(0===e.length)return;const i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;const s=Se(this.quill.getLine(i.index),2),n=s[0],r=s[1],l=Se(this.quill.getLeaf(i.index),2),o=l[0],a=l[1],c=Se(0===i.length?[o,a]:this.quill.getLeaf(i.index+i.length),2),h=c[0],u=c[1],d=o instanceof _?o.value().slice(0,a):"",f=h instanceof _?h.value().slice(u):"",p={collapsed:0===i.length,empty:0===i.length&&n.length()<=1,format:this.quill.getFormat(i),line:n,offset:r,prefix:d,suffix:f,event:t};e.some(t=>{if(null!=t.collapsed&&t.collapsed!==p.collapsed)return!1;if(null!=t.empty&&t.empty!==p.empty)return!1;if(null!=t.offset&&t.offset!==p.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(t=>null==p.format[t]))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every(e=>!0===t.format[e]?null!=p.format[e]:!1===t.format[e]?null==p.format[e]:F()(t.format[e],p.format[e])))return!1;return!(null!=t.prefix&&!t.prefix.test(p.prefix))&&(!(null!=t.suffix&&!t.suffix.test(p.suffix))&&!0!==t.handler.call(this,i,p,t))})&&t.preventDefault()})}handleBackspace(t,e){const i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let s={};const n=Se(this.quill.getLine(t.index),1)[0];let o=(new l.a).retain(t.index-i).delete(i);if(0===e.offset){if(Se(this.quill.getLine(t.index-1),1)[0]){const e=n.formats(),i=this.quill.getFormat(t.index-1,1);if(s=r.AttributeMap.diff(e,i)||{},Object.keys(s).length>0){const e=(new l.a).retain(t.index+n.length()-2).retain(1,s);o=o.compose(e)}}}this.quill.updateContents(o,Mt.sources.USER),this.quill.focus()}handleDelete(t,e){const i=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-i)return;let s={};const n=Se(this.quill.getLine(t.index),1)[0];let o=(new l.a).retain(t.index).delete(i);if(e.offset>=n.length()-1){const e=Se(this.quill.getLine(t.index+1),1)[0];if(e){const i=n.formats(),l=this.quill.getFormat(t.index,1);s=r.AttributeMap.diff(i,l)||{},Object.keys(s).length>0&&(o=o.retain(e.length()-1).retain(1,s))}}this.quill.updateContents(o,Mt.sources.USER),this.quill.focus()}handleDeleteRange(t){const e=this.quill.getLines(t);let i={};if(e.length>1){const t=e[0].formats(),s=e[e.length-1].formats();i=r.AttributeMap.diff(s,t)||{}}this.quill.deleteText(t,Mt.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index,1,i,Mt.sources.USER),this.quill.setSelection(t.index,Mt.sources.SILENT),this.quill.focus()}handleEnter(t,e){const i=Object.keys(e.format).reduce((t,i)=>(this.quill.scroll.query(i,o.BLOCK)&&!Array.isArray(e.format[i])&&(t[i]=e.format[i]),t),{}),s=(new l.a).retain(t.index).delete(t.length).insert("\n",i);this.quill.updateContents(s,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(t=>{null==i[t]&&(Array.isArray(e.format[t])||"code"!==t&&"link"!==t&&this.quill.format(t,e.format[t],Mt.sources.USER))})}}function Ie(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e){const i=this.quill.scroll.query("code-block"),s=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let n=e.index,r=e.length;s.forEach((e,s)=>{t?(e.insertAt(0,i.TAB),0===s?n+=i.TAB.length:r+=i.TAB.length):e.domNode.textContent.startsWith(i.TAB)&&(e.deleteAt(0,i.TAB.length),0===s?n-=i.TAB.length:r-=i.TAB.length)}),this.quill.update(Mt.sources.USER),this.quill.setSelection(n,r,Mt.sources.SILENT)}}}function Be(t,e){return{key:t,shiftKey:e,altKey:null,["ArrowLeft"===t?"prefix":"suffix"]:/^$/,handler(i){let s=i.index;return"ArrowRight"===t&&(s+=i.length+1),!(Se(this.quill.getLeaf(s),1)[0]instanceof O)||("ArrowLeft"===t?e?this.quill.setSelection(i.index-1,i.length+1,Mt.sources.USER):this.quill.setSelection(i.index-1,Mt.sources.USER):e?this.quill.setSelection(i.index,i.length+1,Mt.sources.USER):this.quill.setSelection(i.index+i.length+1,Mt.sources.USER),!1)}}}function Me(t){return{key:t[0],shortKey:!0,handler(e,i){this.quill.format(t,!i.format[t],Mt.sources.USER)}}}function _e(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,i){const s=t?"prev":"next",n=i.line,r=n.parent[s];if(null!=r){if("table-row"===r.statics.blotName){let t=r.children.head,e=n;for(;null!=e.prev;)e=e.prev,t=t.next;const s=t.offset(this.quill.scroll)+Math.min(i.offset,t.length()-1);this.quill.setSelection(s,0,Mt.sources.USER)}}else{const e=n.table()[s];null!=e&&(t?this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,Mt.sources.USER):this.quill.setSelection(e.offset(this.quill.scroll),0,Mt.sources.USER))}return!1}}}Re.DEFAULTS={bindings:{bold:Me("bold"),italic:Me("italic"),underline:Me("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",Mt.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",Mt.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",Mt.sources.USER):null!=e.format.list&&this.quill.format("list",!1,Mt.sources.USER)}},"indent code-block":Ie(!0),"outdent code-block":Ie(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,Mt.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const i=(new l.a).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(i,Mt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,Mt.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Mt.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const i={list:!1};e.format.indent&&(i.indent=!1),this.quill.formatLine(t.index,t.length,i,Mt.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const e=Se(this.quill.getLine(t.index),2),i=e[0],s=e[1],n=j()({},i.formats(),{list:"checked"}),r=(new l.a).retain(t.index).insert("\n",n).retain(i.length()-s-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const i=Se(this.quill.getLine(t.index),2),s=i[0],n=i[1],r=(new l.a).retain(t.index).insert("\n",e.format).retain(s.length()-n-1).retain(1,{header:null});this.quill.updateContents(r,Mt.sources.USER),this.quill.setSelection(t.index+1,Mt.sources.SILENT),this.quill.scrollIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const i=Se(e.getTable(t),4),s=i[0],n=function(t,e,i,s){if(null==e.prev&&null==e.next)return null==i.prev&&null==i.next?0===s?-1:1:null==i.prev?-1:1;if(null==e.prev)return-1;if(null==e.next)return 1;return null}(0,i[1],i[2],i[3]);if(null==n)return;let r=s.offset();if(n<0){const e=(new l.a).retain(r).insert("\n");this.quill.updateContents(e,Mt.sources.USER),this.quill.setSelection(t.index+1,t.length,Mt.sources.SILENT)}else if(n>0){r+=s.length();const t=(new l.a).retain(r).insert("\n");this.quill.updateContents(t,Mt.sources.USER),this.quill.setSelection(r,Mt.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const i=e.event,s=e.line,n=s.offset(this.quill.scroll);i.shiftKey?this.quill.setSelection(n-1,Mt.sources.USER):this.quill.setSelection(n+s.length(),Mt.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{list:!1,"code-block":!1,blockquote:!1,header:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const i=e.prefix.length,s=Se(this.quill.getLine(t.index),2),n=s[0],r=s[1];if(r>i)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(t.index," ",Mt.sources.USER),this.quill.history.cutoff();const a=(new l.a).retain(t.index-r).delete(i+1).retain(n.length()-2-r).retain(1,{list:o});return this.quill.updateContents(a,Mt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-i,Mt.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const e=Se(this.quill.getLine(t.index),2),i=e[0],s=e[1];let n=2,r=i;for(;null!=r&&r.length()<=1&&r.formats()["code-block"];)if(r=r.prev,(n-=1)<=0){const e=(new l.a).retain(t.index+i.length()-s-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(e,Mt.sources.USER),this.quill.setSelection(t.index-1,Mt.sources.SILENT),!1}return!0}},"embed left":Be("ArrowLeft",!1),"embed left shift":Be("ArrowLeft",!0),"embed right":Be("ArrowRight",!1),"embed right shift":Be("ArrowRight",!0),"table down":_e(!1),"table up":_e(!0)}};class De extends St{constructor(t,e){super(t,e),t.root.addEventListener("drop",e=>{let i;if(e.preventDefault(),document.caretRangeFromPoint)i=document.caretRangeFromPoint(e.clientX,e.clientY);else{if(!document.caretPositionFromPoint)return;{const t=document.caretPositionFromPoint(e.clientX,e.clientY);(i=document.createRange()).setStart(t.offsetNode,t.offset),i.setEnd(t.offsetNode,t.offset)}}const s=t.selection.normalizeNative(i),n=t.selection.normalizedToRange(s);this.upload(n,e.dataTransfer.files)})}upload(t,e){const i=[];Array.from(e).forEach(t=>{t&&this.options.mimetypes.includes(t.type)&&i.push(t)}),i.length>0&&this.options.handler.call(this,t,i)}}De.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){const i=e.map(t=>new Promise(e=>{const i=new FileReader;i.onload=(t=>{e(t.target.result)}),i.readAsDataURL(t)}));Promise.all(i).then(e=>{const i=e.reduce((t,e)=>t.insert({image:e}),(new l.a).retain(t.index).delete(t.length));this.quill.updateContents(i,J.sources.USER),this.quill.setSelection(t.index+e.length,J.sources.SILENT)})}};var je=De;Mt.register({"blots/block":ot,"blots/block/embed":at,"blots/break":et,"blots/container":Ut,"blots/cursor":bt,"blots/embed":Ht,"blots/inline":rt,"blots/scroll":Vt,"blots/text":it,"modules/clipboard":ve,"modules/history":Le,"modules/keyboard":Re,"modules/uploader":je});var Ue=Mt;var Pe=new class extends q{add(t,e){if("+1"===e||"-1"===e){const i=this.value(t)||0;e="+1"===e?i+1:i-1}return 0===e?(this.remove(t),!0):super.add(t,e)}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}("indent","ql-indent",{scope:o.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class He extends ot{}He.blotName="blockquote",He.tagName="blockquote";var Fe=He;class ze extends ot{static formats(t){return this.tagName.indexOf(t.tagName)+1}}ze.blotName="header",ze.tagName=["H1","H2","H3","H4","H5","H6"];var Ke=ze;class Ve extends Ut{}Ve.blotName="list-container",Ve.tagName="OL";class We extends ot{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){Mt.register(Ve)}constructor(t,e){super(t,e);const i=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const s=this.statics.formats(e,t);"checked"===s?(this.format("list","unchecked"),i.preventDefault()):"unchecked"===s&&(this.format("list","checked"),i.preventDefault())};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s),this.attachUI(i)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}We.blotName="list",We.tagName="LI",Ve.allowedChildren=[We],We.requiredContainer=Ve;class Ze extends rt{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}Ze.blotName="bold",Ze.tagName=["STRONG","B"];var Ge=Ze;class $e extends Ge{}$e.blotName="italic",$e.tagName=["EM","I"];var Xe=$e;class Ye extends rt{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return Qe(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Qe(t,e){const i=document.createElement("a");i.href=t;const s=i.href.slice(0,i.href.indexOf(":"));return e.indexOf(s)>-1}Ye.blotName="link",Ye.tagName="A",Ye.SANITIZED_URL="about:blank",Ye.PROTOCOL_WHITELIST=["http","https","mailto","tel"];class Je extends rt{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}Je.blotName="script",Je.tagName=["SUB","SUP"];var ti=Je;class ei extends rt{}ei.blotName="strike",ei.tagName="S";var ii=ei;class si extends rt{}si.blotName="underline",si.tagName="U";var ni=si;class ri extends Ht{static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const t=this.value().formula;return"".concat(t,"")}}ri.blotName="formula",ri.className="ql-formula",ri.tagName="SPAN";var li=ri;const oi=["alt","height","width"];class ai extends O{static create(t){const e=super.create(t);return"string"==typeof t&&(e.setAttribute("src",this.sanitize(t)),e.setAttribute("data-fancybox-href",this.sanitize(t))),t.thumbUrl&&e.setAttribute("src",this.sanitize(t.thumbUrl)),t.originUrl&&e.setAttribute("data-fancybox-href",this.sanitize(t.originUrl)),e.setAttribute("data-fancybox-type","image"),e.setAttribute("data-fancybox-group","editor"),e.classList.add("fancybox"),e}static formats(t){return oi.reduce((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static register(){/Firefox/i.test(navigator.userAgent)&&setTimeout(()=>{document.execCommand("enableObjectResizing",!1,!1)},1)}static sanitize(t){return Qe(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){oi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}ai.blotName="image",ai.tagName="IMG";var ci=ai;const hi=["height","width"];class ui extends at{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return hi.reduce((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e),{})}static sanitize(t){return Ye.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){hi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const t=this.value().video;return'').concat(t,"")}}ui.blotName="video",ui.className="ql-video",ui.tagName="IFRAME";var di=ui;const fi=new q("code-token","hljs",{scope:o.INLINE});class pi extends rt{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList.contains(ie.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,i){super(t,e,i),fi.add(this.domNode,i)}format(t,e){t!==pi.blotName?super.format(t,e):e?fi.add(this.domNode,e):(fi.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),fi.value(this.domNode)||this.unwrap()}}pi.blotName="code-token",pi.className="ql-token";class mi extends ie{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),pi.blotName,!1),super.replaceWith(t,e)}}class gi extends ee{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===mi.blotName&&(this.forceNext=!0,this.children.forEach(i=>{i.format(t,e)}))}formatAt(t,e,i,s){i===mi.blotName&&(this.forceNext=!0),super.formatAt(t,e,i,s)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const i=Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode),s="".concat(i.map(t=>t.textContent).join("\n"),"\n"),n=mi.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||null==this.cachedText){const e=this.children.reduce((t,e)=>t.concat(ct(e,!1)),new l.a),i=t(s,n);e.diff(i).reduce((t,e)=>{let i=e.retain,s=e.attributes;return i?(s&&Object.keys(s).forEach(e=>{[mi.blotName,pi.blotName].includes(e)&&this.formatAt(t,i,e,s[e])}),t+i):t},0)}this.cachedText=s,this.forceNext=!1}}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=mi.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}gi.allowedChildren=[mi],mi.requiredContainer=gi,mi.allowedChildren=[pi,bt,it,et];class bi extends St{static register(){Mt.register(pi,!0),Mt.register(mi,!0),Mt.register(gi,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Mt.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof gi))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(t=>{let i=t.key,s=t.label;const n=e.ownerDocument.createElement("option");n.textContent=s,n.setAttribute("value",i),e.appendChild(n)}),e.addEventListener("change",()=>{t.format(mi.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=mi.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(Mt.events.SCROLL_OPTIMIZE,()=>{clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Mt.sources.USER);const i=this.quill.getSelection();(null==t?this.quill.scroll.descendants(gi):[t]).forEach(t=>{t.highlight(this.highlightBlot,e)}),this.quill.update(Mt.sources.SILENT),null!=i&&this.quill.setSelection(i,Mt.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if("plain"===e)return st(t).split("\n").reduce((t,i,s)=>(0!==s&&t.insert("\n",{[ie.blotName]:e}),t.insert(i)),new l.a);const i=this.quill.root.ownerDocument.createElement("div");return i.classList.add(ie.className),i.innerHTML=this.options.hljs.highlight(e,t).value,Ae(this.quill.scroll,i,[(t,e)=>{const i=fi.value(t);return i?e.compose((new l.a).retain(e.length(),{[pi.blotName]:i})):e}],[(t,i)=>t.data.split("\n").reduce((t,i,s)=>(0!==s&&t.insert("\n",{[ie.blotName]:e}),t.insert(i)),i)],new WeakMap)}}function yi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}bi.DEFAULTS={hljs:(()=>window.hljs)(),interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"Javascript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class vi extends ot{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Ei()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===vi.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}vi.blotName="table",vi.tagName="TD";class xi extends Ut{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),i=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===i.table&&t.table===s.table}return!1}optimize(){super.optimize(...arguments),this.children.forEach(t=>{if(null==t.next)return;const e=t.formats(),i=t.next.formats();if(e.table!==i.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}xi.blotName="table-row",xi.tagName="TR";class Ni extends Ut{}Ni.blotName="table-body",Ni.tagName="TBODY";class qi extends Ut{balanceCells(){const t=this.descendants(xi),e=t.reduce((t,e)=>Math.max(e.children.length,t),0);t.forEach(t=>{new Array(e-t.children.length).fill(0).forEach(()=>{let e;null!=t.children.head&&(e=vi.formats(t.children.head.domNode));const i=this.scroll.create(vi.blotName,e);t.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const e=yi(this.descendant(Ni),1)[0];null!=e&&null!=e.children.head&&e.children.forEach(e=>{const i=e.children.at(t);null!=i&&i.remove()})}insertColumn(t){const e=yi(this.descendant(Ni),1)[0];null!=e&&null!=e.children.head&&e.children.forEach(e=>{const i=e.children.at(t),s=vi.formats(e.children.head.domNode),n=this.scroll.create(vi.blotName,s);e.insertBefore(n,i)})}insertRow(t){const e=yi(this.descendant(Ni),1)[0];if(null==e||null==e.children.head)return;const i=Ei(),s=this.scroll.create(xi.blotName);e.children.head.children.forEach(()=>{const t=this.scroll.create(vi.blotName,i);s.appendChild(t)});const n=e.children.at(t);e.insertBefore(s,n)}rows(){const t=this.children.head;return null==t?[]:t.children.map(t=>t)}}function Ei(){const t=Math.random().toString(36).slice(2,6);return"row-".concat(t)}function Ai(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}qi.blotName="table-container",qi.tagName="TABLE",qi.allowedChildren=[Ni],Ni.requiredContainer=qi,Ni.allowedChildren=[xi],xi.requiredContainer=Ni,xi.allowedChildren=[vi],vi.requiredContainer=xi;var wi=class extends St{static register(){Mt.register(vi),Mt.register(xi),Mt.register(Ni),Mt.register(qi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(qi).forEach(t=>{t.balanceCells()})}deleteColumn(){const t=Ai(this.getTable(),3),e=t[0],i=t[2];null!=i&&(e.deleteColumn(i.cellOffset()),this.quill.update(Mt.sources.USER))}deleteRow(){const t=Ai(this.getTable(),2)[1];null!=t&&(t.remove(),this.quill.update(Mt.sources.USER))}deleteTable(){const t=Ai(this.getTable(),1)[0];if(null==t)return;const e=t.offset();t.remove(),this.quill.update(Mt.sources.USER),this.quill.setSelection(e,Mt.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const e=Ai(this.quill.getLine(t.index),2),i=e[0],s=e[1];if(null==i||i.statics.blotName!==vi.blotName)return[null,null,null,-1];const n=i.parent;return[n.parent.parent,n,i,s]}insertColumn(t){const e=this.quill.getSelection(),i=Ai(this.getTable(e),3),s=i[0],n=i[1],r=i[2];if(null==r)return;const l=r.cellOffset();s.insertColumn(l+t),this.quill.update(Mt.sources.USER);let o=n.rowOffset();0===t&&(o+=1),this.quill.setSelection(e.index+o,e.length,Mt.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection(),i=Ai(this.getTable(e),3),s=i[0],n=i[1];if(null==i[2])return;const r=n.rowOffset();s.insertRow(r+t),this.quill.update(Mt.sources.USER),t>0?this.quill.setSelection(e,Mt.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,Mt.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const i=this.quill.getSelection();if(null==i)return;const s=new Array(t).fill(0).reduce(t=>{const i=new Array(e).fill("\n").join("");return t.insert(i,{table:Ei()})},(new l.a).retain(i.index));this.quill.updateContents(s,Mt.sources.USER),this.quill.setSelection(i.index,Mt.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Mt.events.SCROLL_OPTIMIZE,t=>{t.some(t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(Mt.events.TEXT_CHANGE,(t,e,i)=>{i===Mt.sources.USER&&this.balanceTables()}),!0))})}};function ki(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const Li=X("quill:toolbar");class Ti extends St{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const e=document.createElement("div");!function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach(e=>{const i=document.createElement("span");i.classList.add("ql-formats"),e.forEach(t=>{if("string"==typeof t)Si(i,t);else{const e=Object.keys(t)[0],s=t[e];Array.isArray(s)?function(t,e,i){const s=document.createElement("select");s.classList.add("ql-".concat(e)),i.forEach(t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),s.appendChild(e)}),t.appendChild(s)}(i,e,s):Si(i,e,s)}}),t.appendChild(i)})}(e,this.options.container),t.container.parentNode.insertBefore(e,t.container),this.container=e}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement))return Li.error("Container required for toolbar",this.options);this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},Object.keys(this.options.handlers).forEach(t=>{this.addHandler(t,this.options.handlers[t])}),Array.from(this.container.querySelectorAll("button, select")).forEach(t=>{this.attach(t)}),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e)=>{t===Mt.events.SELECTION_CHANGE&&this.update(e)}),this.quill.on(Mt.events.SCROLL_OPTIMIZE,()=>{const t=ki(this.quill.selection.getRange(),1)[0];this.update(t)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(t=>0===t.indexOf("ql-"));if(!e)return;if(e=e.slice("ql-".length),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[e]&&null==this.quill.scroll.query(e))return void Li.warn("ignoring attaching to nonexistent format",e,t);const i="SELECT"===t.tagName?"change":"click";t.addEventListener(i,i=>{let s;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];s=!e.hasAttribute("selected")&&(e.value||!1)}else s=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),i.preventDefault();this.quill.focus();const n=ki(this.quill.selection.getRange(),1)[0];if(null!=this.handlers[e])this.handlers[e].call(this,s);else if(this.quill.scroll.query(e).prototype instanceof O){if(!(s=prompt("Enter ".concat(e))))return;this.quill.updateContents((new l.a).retain(n.index).delete(n.length).insert({[e]:s}),Mt.sources.USER)}else this.quill.format(e,s,Mt.sources.USER);this.update(n)}),this.controls.push([e,t])}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(i=>{const s=ki(i,2),n=s[0],r=s[1];if("SELECT"===r.tagName){let i;if(null==t)i=null;else if(null==e[n])i=r.querySelector("option[selected]");else if(!Array.isArray(e[n])){let t=e[n];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),i=r.querySelector('option[value="'.concat(t,'"]'))}null==i?(r.value="",r.selectedIndex=-1):i.selected=!0}else if(null==t)r.classList.remove("ql-active");else if(r.hasAttribute("value")){const t=e[n]===r.getAttribute("value")||null!=e[n]&&e[n].toString()===r.getAttribute("value")||null==e[n]&&!r.getAttribute("value");r.classList.toggle("ql-active",t)}else r.classList.toggle("ql-active",null!=e[n])})}}function Si(t,e,i){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("ql-".concat(e)),null!=i&&(s.value=i),t.appendChild(s)}Ti.DEFAULTS={},Ti.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach(t=>{null!=this.quill.scroll.query(t,o.INLINE)&&this.quill.format(t,!1,Mt.sources.USER)})}else this.quill.removeFormat(t,Mt.sources.USER)},direction(t){const e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",Mt.sources.USER):t||"right"!==e||this.quill.format("align",!1,Mt.sources.USER),this.quill.format("direction",t,Mt.sources.USER)},indent(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e),s=parseInt(i.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===i.direction&&(e*=-1),this.quill.format("indent",s+e,Mt.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,Mt.sources.USER)},list(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e);"check"===t?"checked"===i.list||"unchecked"===i.list?this.quill.format("list",!1,Mt.sources.USER):this.quill.format("list","unchecked",Mt.sources.USER):this.quill.format("list",t,Mt.sources.USER)}}};var Oi=i(7),Ci=i.n(Oi),Ri=i(8),Ii=i.n(Ri),Bi=i(9),Mi=i.n(Bi),_i=i(10),Di=i.n(_i),ji=i(11),Ui=i.n(ji),Pi=i(12),Hi=i.n(Pi),Fi=i(13),zi=i.n(Fi),Ki=i(14),Vi=i.n(Ki),Wi=i(4),Zi=i.n(Wi),Gi=i(15),$i=i.n(Gi),Xi=i(16),Yi=i.n(Xi),Qi=i(17),Ji=i.n(Qi),ts=i(18),es=i.n(ts),is=i(19),ss=i.n(is),ns=i(20),rs=i.n(ns),ls=i(21),os=i.n(ls),as=i(22),cs=i.n(as),hs=i(23),us=i.n(hs),ds=i(24),fs=i.n(ds),ps=i(25),ms=i.n(ps),gs=i(26),bs=i.n(gs),ys=i(27),vs=i.n(ys),xs=i(28),Ns=i.n(xs),qs=i(29),Es=i.n(qs),As=i(30),ws=i.n(As),ks=i(31),Ls=i.n(ks),Ts=i(32),Ss=i.n(Ts),Os=i(33),Cs=i.n(Os),Rs=i(34),Is=i.n(Rs),Bs={align:{"":Ci.a,center:Ii.a,right:Mi.a,justify:Di.a},background:Ui.a,blockquote:Hi.a,bold:zi.a,clean:Vi.a,code:Zi.a,"code-block":Zi.a,color:$i.a,direction:{"":Yi.a,rtl:Ji.a},formula:es.a,header:{1:ss.a,2:rs.a},italic:os.a,image:cs.a,indent:{"+1":us.a,"-1":fs.a},link:ms.a,list:{bullet:bs.a,check:vs.a,ordered:Ns.a},script:{sub:Es.a,super:ws.a},strike:Ls.a,table:Ss.a,underline:Cs.a,video:Is.a},Ms=i(35),_s=i.n(Ms);let Ds=0;function js(t,e){t.setAttribute(e,!("true"===t.getAttribute(e)))}var Us=class{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),js(this.label,"aria-expanded"),js(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");return e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item"),t.hasAttribute("value")&&e.setAttribute("data-value",t.getAttribute("value")),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=_s.a,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-".concat(Ds),Ds+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const i=this.buildItem(e);t.appendChild(i),!0===e.selected&&this.selectItem(i)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.container.querySelector(".ql-selected");t!==i&&(null!=i&&i.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}};var Ps=class extends Us{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(t=>{t.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const i=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=s:i.style.fill=s)}};var Hs=class extends Us{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const i=t||this.defaultItem;this.label.innerHTML!==i.innerHTML&&(this.label.innerHTML=i.innerHTML)}};var Fs=class{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop="".concat(-1*this.quill.root.scrollTop,"px")}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){let e=t.left+t.width/2-this.root.offsetWidth/2;const i=this.quill.root.getBoundingClientRect(),s=this.boundsContainer.getBoundingClientRect(),n=this.root.getBoundingClientRect();e<0&&(e=8),e>i.width-n.width-8&&(e=i.width-n.width-8);const r=t.bottom+this.quill.root.scrollTop;this.root.style.left="".concat(e,"px"),this.root.style.top="".concat(r,"px"),this.root.classList.remove("ql-flip");let l=0;if(n.right>s.right&&(l=s.right-n.right,this.root.style.left="".concat(e+l,"px")),n.lefts.bottom){const e=n.bottom-n.top,i=t.bottom-t.top+e;this.root.style.top="".concat(r-i,"px"),this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const zs=[!1,"center","right","justify"],Ks=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Vs=[!1,"serif","monospace"],Ws=["1","2","3",!1],Zs=["small",!1,"large","huge"];class Gs extends Ct{constructor(t,e){super(t,e);const i=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(t=>{t.container.contains(e.target)||t.close()})):document.body.removeEventListener("click",i)};t.emitter.listenDOM("click",document.body,i)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(t=>{(t.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice("ql-".length),null!=e[i]))if("direction"===i)t.innerHTML=e[i][""]+e[i].rtl;else if("string"==typeof e[i])t.innerHTML=e[i];else{const s=t.value||"";null!=s&&e[i][s]&&(t.innerHTML=e[i][s])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(t=>{if(t.classList.contains("ql-align"))return null==t.querySelector("option")&&Xs(t,zs),new Hs(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const i=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&Xs(t,Ks,"background"===i?"#ffffff":"#000000"),new Ps(t,e[i])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?Xs(t,Vs):t.classList.contains("ql-header")?Xs(t,Ws):t.classList.contains("ql-size")&&Xs(t,Zs)),new Us(t)});this.quill.on(J.events.EDITOR_CHANGE,()=>{this.pickers.forEach(t=>{t.update()})})}}Gs.DEFAULTS=j()(!0,{},Ct.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class $s extends Fs{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())})}cancel(){this.hide()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-".concat(t))||""),this.root.setAttribute("data-mode",t)}restoreFocus(){const t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}save(){let t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{const e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,J.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,J.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return"".concat(e[1]||"https","://www.youtube.com/embed/").concat(e[2],"?showinfo=0");if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return"".concat(e[1]||"https","://player.vimeo.com/video/").concat(e[2],"/");return t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const i=e.index+e.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,J.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",J.sources.USER),this.quill.setSelection(i+2,J.sources.USER)}break}}this.textbox.value="",this.hide()}}function Xs(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(e=>{const s=document.createElement("option");e===i?s.setAttribute("selected","selected"):s.setAttribute("value",e),t.appendChild(s)})}const Ys=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Qs extends $s{constructor(t,e){super(t,e),this.quill.on(J.events.EDITOR_CHANGE,(t,e,i,s)=>{if(t===J.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&s===J.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width="".concat(this.root.offsetWidth,"px");const t=this.quill.getLines(e.index,e.length);if(1===t.length)this.position(this.quill.getBounds(e));else{const i=t[t.length-1],s=this.quill.getIndex(i),n=Math.min(i.length()-1,e.index+e.length-s),r=this.quill.getBounds(new ft(s,n));this.position(r)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(J.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();null!=t&&this.position(this.quill.getBounds(t))},1)})}cancel(){this.show()}position(t){const e=super.position(t),i=this.root.querySelector(".ql-tooltip-arrow");return i.style.marginLeft="",0!==e&&(i.style.marginLeft="".concat(-1*e-i.offsetWidth/2,"px")),e}}Qs.TEMPLATE=['','
    ','','',"
    "].join("");class Js extends Gs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=Ys),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Qs(this.quill,this.options.bounds),this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Bs),this.buildPickers(t.container.querySelectorAll("select"),Bs)}}function tn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],s=!0,n=!1,r=void 0;try{for(var l,o=t[Symbol.iterator]();!(s=(l=o.next()).done)&&(i.push(l.value),!e||i.length!==e);s=!0);}catch(t){n=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Js.DEFAULTS=j()(!0,{},Gs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});const en=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class sn extends $s{constructor(t,e){super(t,e),this.preview=this.root.querySelector("a.ql-preview")}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,J.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(J.events.SELECTION_CHANGE,(t,e,i)=>{if(null!=t){if(0===t.length&&i===J.sources.USER){const e=tn(this.quill.scroll.descendant(Ye,t.index),2),i=e[0],s=e[1];if(null!=i){this.linkRange=new ft(t.index-s,i.length());const e=Ye.formats(i.domNode);return this.preview.textContent=e,this.preview.setAttribute("href",e),void this.quill.options.linkHover(i.domNode,this.linkRange)}}else delete this.linkRange;this.quill.options.linkHide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}sn.TEMPLATE=['','','',''].join("");class nn extends Gs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=en),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),Bs),this.buildPickers(t.container.querySelectorAll("select"),Bs),this.tooltip=new sn(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,i)=>{t.handlers.link.call(t,!i.format.link)})}}nn.DEFAULTS=j()(!0,{},Gs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e="mailto:".concat(e)),this.quill.theme.tooltip.edit("link",e)}else this.quill.format("link",!1)}}}}});var rn=nn;Ue.register({"attributors/attribute/direction":re,"attributors/class/align":Gt,"attributors/class/background":Jt,"attributors/class/color":Yt,"attributors/class/direction":le,"attributors/class/font":ce,"attributors/class/size":ue,"attributors/style/align":$t,"attributors/style/background":te,"attributors/style/color":Qt,"attributors/style/direction":oe,"attributors/style/font":he,"attributors/style/size":de},!0),Ue.register({"formats/align":Gt,"formats/direction":le,"formats/indent":Pe,"formats/background":te,"formats/color":Qt,"formats/font":ce,"formats/size":ue,"formats/blockquote":Fe,"formats/code-block":ie,"formats/header":Ke,"formats/list":We,"formats/bold":Ge,"formats/code":se,"formats/italic":Xe,"formats/link":Ye,"formats/script":ti,"formats/strike":ii,"formats/underline":ni,"formats/formula":li,"formats/image":ci,"formats/video":di,"modules/syntax":bi,"modules/table":wi,"modules/toolbar":Ti,"themes/bubble":Js,"themes/snow":rn,"ui/icons":Bs,"ui/picker":Us,"ui/icon-picker":Hs,"ui/color-picker":Ps,"ui/tooltip":Fs},!0);e.default=Ue}]).default}); //# sourceMappingURL=quill.min.js.map \ No newline at end of file diff --git a/dist/quill.min.js.map b/dist/quill.min.js.map index ff6598ef00..8b38e18dba 100644 --- a/dist/quill.min.js.map +++ b/dist/quill.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Quill/webpack/universalModuleDefinition","webpack://Quill/webpack/bootstrap","webpack://Quill/./node_modules/quill-delta/dist/Delta.js","webpack://Quill/./node_modules/extend/index.js","webpack://Quill/./node_modules/clone/clone.js","webpack://Quill/./node_modules/deep-equal/index.js","webpack://Quill/./assets/icons/code.svg","webpack://Quill/./node_modules/quill-delta/dist/Op.js","webpack://Quill/./node_modules/eventemitter3/index.js","webpack://Quill/./assets/icons/align-left.svg","webpack://Quill/./assets/icons/align-center.svg","webpack://Quill/./assets/icons/align-right.svg","webpack://Quill/./assets/icons/align-justify.svg","webpack://Quill/./assets/icons/background.svg","webpack://Quill/./assets/icons/blockquote.svg","webpack://Quill/./assets/icons/bold.svg","webpack://Quill/./assets/icons/clean.svg","webpack://Quill/./assets/icons/color.svg","webpack://Quill/./assets/icons/direction-ltr.svg","webpack://Quill/./assets/icons/direction-rtl.svg","webpack://Quill/./assets/icons/formula.svg","webpack://Quill/./assets/icons/header.svg","webpack://Quill/./assets/icons/header-2.svg","webpack://Quill/./assets/icons/italic.svg","webpack://Quill/./assets/icons/image.svg","webpack://Quill/./assets/icons/indent.svg","webpack://Quill/./assets/icons/outdent.svg","webpack://Quill/./assets/icons/link.svg","webpack://Quill/./assets/icons/list-bullet.svg","webpack://Quill/./assets/icons/list-check.svg","webpack://Quill/./assets/icons/list-ordered.svg","webpack://Quill/./assets/icons/subscript.svg","webpack://Quill/./assets/icons/superscript.svg","webpack://Quill/./assets/icons/strike.svg","webpack://Quill/./assets/icons/table.svg","webpack://Quill/./assets/icons/underline.svg","webpack://Quill/./assets/icons/video.svg","webpack://Quill/./assets/icons/dropdown.svg","webpack://Quill/./node_modules/deep-equal/lib/keys.js","webpack://Quill/./node_modules/deep-equal/lib/is_arguments.js","webpack://Quill/./node_modules/fast-diff/diff.js","webpack://Quill/./node_modules/quill-delta/dist/AttributeMap.js","webpack://Quill/./node_modules/quill-delta/dist/Iterator.js","webpack://Quill/./node_modules/parchment/src/scope.ts","webpack://Quill/./node_modules/parchment/src/collection/linked-list.ts","webpack://Quill/./node_modules/parchment/src/error.ts","webpack://Quill/./node_modules/parchment/src/registry.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/shadow.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/parent.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/container.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/leaf.ts","webpack://Quill/./node_modules/parchment/src/attributor/attributor.ts","webpack://Quill/./node_modules/parchment/src/attributor/class.ts","webpack://Quill/./node_modules/parchment/src/attributor/style.ts","webpack://Quill/./node_modules/parchment/src/attributor/store.ts","webpack://Quill/./node_modules/parchment/src/blot/inline.ts","webpack://Quill/./node_modules/parchment/src/blot/block.ts","webpack://Quill/./node_modules/parchment/src/blot/embed.ts","webpack://Quill/./node_modules/parchment/src/blot/scroll.ts","webpack://Quill/./node_modules/parchment/src/blot/text.ts","webpack://Quill/./core/instances.js","webpack://Quill/./core/logger.js","webpack://Quill/./core/emitter.js","webpack://Quill/./blots/break.js","webpack://Quill/./blots/text.js","webpack://Quill/./blots/inline.js","webpack://Quill/./blots/block.js","webpack://Quill/./core/selection.js","webpack://Quill/./blots/cursor.js","webpack://Quill/./core/editor.js","webpack://Quill/./core/module.js","webpack://Quill/./core/theme.js","webpack://Quill/./core/quill.js","webpack://Quill/./blots/container.js","webpack://Quill/./blots/embed.js","webpack://Quill/./blots/scroll.js","webpack://Quill/./formats/align.js","webpack://Quill/./formats/color.js","webpack://Quill/./formats/background.js","webpack://Quill/./formats/code.js","webpack://Quill/./formats/direction.js","webpack://Quill/./formats/font.js","webpack://Quill/./formats/size.js","webpack://Quill/./modules/clipboard.js","webpack://Quill/./modules/history.js","webpack://Quill/./modules/keyboard.js","webpack://Quill/./modules/uploader.js","webpack://Quill/./core.js","webpack://Quill/./formats/indent.js","webpack://Quill/./formats/blockquote.js","webpack://Quill/./formats/header.js","webpack://Quill/./formats/list.js","webpack://Quill/./formats/bold.js","webpack://Quill/./formats/italic.js","webpack://Quill/./formats/link.js","webpack://Quill/./formats/script.js","webpack://Quill/./formats/strike.js","webpack://Quill/./formats/underline.js","webpack://Quill/./formats/formula.js","webpack://Quill/./formats/image.js","webpack://Quill/./formats/video.js","webpack://Quill/./modules/syntax.js","webpack://Quill/./formats/table.js","webpack://Quill/./modules/table.js","webpack://Quill/./modules/toolbar.js","webpack://Quill/./ui/icons.js","webpack://Quill/./ui/picker.js","webpack://Quill/./ui/color-picker.js","webpack://Quill/./ui/icon-picker.js","webpack://Quill/./ui/tooltip.js","webpack://Quill/./themes/base.js","webpack://Quill/./themes/bubble.js","webpack://Quill/./themes/snow.js","webpack://Quill/./quill.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__importDefault","this","mod","default","deep_equal_1","extend_1","fast_diff_1","AttributeMap_1","Op_1","NULL_CHARACTER","String","fromCharCode","Delta","ops","Array","isArray","insert","arg","attributes","newOp","length","keys","push","delete","retain","index","lastOp","unshift","splice","chop","pop","filter","predicate","forEach","map","partition","passed","failed","op","reduce","initialValue","changeLength","elem","slice","start","end","Infinity","iter","iterator","hasNext","nextOp","next","compose","other","thisIter","otherIter","firstOther","peek","firstLeft","peekType","peekLength","delta","length_1","Math","min","thisOp","otherOp","rest","concat","diff","cursor","strings","Error","join","retDelta","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","line","indexOf","invert","base","inverted","baseIndex","length_2","baseOp","transform","priority","transformPosition","length_3","offset","length_4","nextType","Op","AttributeMap","hasOwn","toStr","toString","gOPD","getOwnPropertyDescriptor","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","constructor","setProperty","target","options","configurable","newValue","writable","getProperty","extend","src","copy","copyIsArray","clone","arguments","deep","_instanceof","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","_clone","child","proto","resolve","reject","then","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","getPrototypeOf","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertySymbols","symbols","symbol","descriptor","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","re","flags","global","ignoreCase","multiline","clonePrototype","pSlice","objectKeys","isArguments","deepEqual","actual","expected","opts","strict","a","b","isUndefinedOrNull","ka","kb","e","sort","objEquiv","x","Iterator_1","has","prefix","Events","EE","fn","context","once","addListener","emitter","event","TypeError","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","__proto__","eventNames","events","names","listeners","handlers","ee","listenerCount","emit","a1","a2","a3","a4","a5","args","len","removeListener","undefined","apply","j","on","removeAllListeners","off","prefixed","shim","supportsArgumentsClass","supported","unsupported","propertyIsEnumerable","DIFF_DELETE","DIFF_INSERT","DIFF_EQUAL","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","newRange","oldLength","newLength","oldCursor","oldBefore","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","oldPrefix","newPrefix","oldMiddle","newMiddle","make_edit_splice","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","floor","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","diff_cleanupMerge","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","changes","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","charCode","str","before","after","tuples","ret","remove_empty_tuples","keepNull","attr","baseInverted","memo","Iterator","retOp","substr","Scope","src_scope","linked_list","[object Object]","head","tail","nodes","insertBefore","append","cur","node","refNode","remove","prev","contains","curNode","inclusive","callback","startNode","find","curIndex","curLength","ParchmentError","message","super","registry_Registry","classes","tags","types","bubble","blots","parentNode","scroll","input","match","query","blotClass","Node","nodeType","TEXT_NODE","blot","domNode","scope","ANY","Text","text","LEVEL","BLOCK","block","INLINE","inline","HTMLElement","getAttribute","split","some","tagName","TYPE","definitions","register","definition","blotName","attrName","keyName","className","toUpperCase","tag","WeakMap","shadow_ShadowBlot","parseInt","document","createElement","classList","statics","cloneNode","removeChild","isolate","BLOT","wrap","ATTRIBUTE","format","def","ref","children","_context","requiredContainer","detach","replacement","_force","_mutations","wrapper","appendChild","shadow","parent_ParentBlot","uiNode","build","attach","uiClass","setAttribute","firstChild","from","childNodes","reverse","makeAttachedBlot","forEachAt","childLength","deleteAt","criteria","descendant","Number","MAX_VALUE","descendants","lengthLeft","childIndex","done","allowedChildren","BLOCK_BLOT","splitAfter","unwrap","formatAt","insertAt","childBlot","refBlot","refDomNode","nextSibling","targetParent","optimize","enforceAllowedChildren","defaultChild","position","path","moveChildren","replaceWith","force","_length","mutations","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_FOLLOWING","replaceChild","abstract_parent","container_ContainerBlot","checkMerge","abstract_container","leaf_LeafBlot","_domNode","_inclusive","INLINE_BLOT","abstract_leaf","attributor_Attributor","item","attributeBit","whitelist","canAdd","_node","replace","removeAttribute","class_match","attributor_class","camelize","parts","part","attributor_style","trim","style","store","attribute","styles","inline_InlineBlot","toLowerCase","formats","values","obj1","obj2","prop","isEqual","update","move","block_BlockBlot","blot_block","blot_embed","_scroll","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","MAX_OPTIMIZE_ITERATIONS","scroll_ScrollBlot","registry","observer","MutationObserver","observe","disconnect","mutationsMap","records","takeRecords","mark","markParent","remaining","previousSibling","grandChild","blot_scroll","text_TextBlot","createTextNode","data","splitText","blot_text","instances","levels","level","debug","method","_len","_key","console","namespace","logger","newLevel","eventName","addEventListener","querySelectorAll","quill","handleDOM","Emitter","error","_len2","_key2","log","_len3","_key3","_ref","handler","listenDOM","EDITOR_CHANGE","SCROLL_BEFORE_UPDATE","SCROLL_BLOT_MOUNT","SCROLL_BLOT_UNMOUNT","SCROLL_OPTIMIZE","SCROLL_UPDATE","SELECTION_CHANGE","TEXT_CHANGE","sources","API","SILENT","USER","Break","EmbedBlot","TextBlot","escapeText","&","<",">","\"","'","Inline","InlineBlot","self","selfIndex","order","otherIndex","compare","NEWLINE_LENGTH","Block","BlockBlot","cache","blockDelta","lines","shift","lineIndex","BlockEmbed","AttributorStore","BLOCK_ATTRIBUTE","endsWith","LeafBlot","leaf","bubbleFormats","Range","Selection","composing","mouseDown","savedRange","lastRange","handleComposition","handleDragging","setTimeout","hasFocus","native","getNativeRange","textNode","setNativeRange","ignored","range","_context$range","startOffset","endNode","endOffset","isBlank","toggle","batchStart","batchEnd","restore","focus","setRange","nativeRange","collapsed","getBounds","scrollLength","_this$scroll$leaf2","_slicedToArray","_leaf$position2","createRange","setStart","_this$scroll$leaf4","_leaf$position4","setEnd","getBoundingClientRect","rect","side","bottom","top","height","left","right","width","selection","getSelection","rangeCount","getRangeAt","normalizeNative","info","getRange","normalized","normalizedToRange","activeElement","positions","indexes","_position","max","startContainer","endContainer","lastChild","rangeToNative","_this$scroll$leaf6","leafOffset","_leaf$position6","scrollIntoView","scrollingContainer","bounds","limit","first","last","scrollBounds","scrollTop","removeAllRanges","addRange","blur","_this$getRange2","equal","Cursor","CONTENTS","savedLength","prevTextBlot","prevTextLength","nextTextBlot","nextText","mergedTextBlot","newTextNode","remapOffset","ASCII","convertHTML","isRoot","html","items","indent","list","convertListHTML","lastIndent","endTag","editor_slicedToArray","getListType","_items","_toArray","_items$","_getListType4","previousType","_blot$domNode","outerHTML","innerHTML","_outerHTML$split2","combineFormats","combined","merged","shiftRange","amount","Editor","getDelta","applyDelta","consumeNextNewline","normalizedDelta","normalizeDelta","_this$scroll$line2","deleteText","formatLine","formatText","getContents","getFormat","leaves","formatsArr","getHTML","_this$scroll$line4","lineOffset","getText","insertEmbed","embed","insertText","removeFormat","_this$scroll$line6","suffix","change","selectionInfo","oldDelta","textBlot","oldValue","CursorBlot","relativeSelectionInfo","Module","DEFAULTS","Theme","init","addModule","ModuleClass","import","themes","globalRegistry","Parchment","Quill","imports","overwrite","warn","startsWith","container","userConfig","clipboard","keyboard","history","uploader","theme","themeConfig","config","moduleConfig","moduleClass","toolbar","querySelector","expandConfig","addContainer","ScrollBlot","editor","quill_slicedToArray","modify","contents","convert","setContents","clear","placeholder","readOnly","disable","allowReadOnlyEdits","_overload2","overload","enable","editReadOnly","modifier","enabled","setSelection","_overload4","_overload6","containerBounds","getLength","_overload8","getIndex","getLeaf","getLine","getLines","getModule","getSemanticHTML","_overload10","_overload12","_overload14","isEnabled","_overload16","deleted","applied","_overload18","setText","updateContents","_map2","pos","_map4","version","QUILL_VERSION","parchment","core/module","core/theme","Container","ContainerBlot","GUARD_TEXT","Embed","contentNode","childNode","leftGuard","rightGuard","prevLength","isLine","Scroll","batch","handleDragStart","emitMount","emitUnmount","_this$line2","scroll_slicedToArray","preventDefault","blotIndex","blotLength","AlignAttribute","Attributor","AlignClass","ClassAttributor","AlignStyle","StyleAttributor","ColorAttributor","hex","ColorClass","ColorStyle","BackgroundClass","BackgroundStyle","CodeBlockContainer","innerText","CodeBlock","Code","TAB","DirectionAttribute","DirectionClass","DirectionStyle","FontClass","FontStyle","SizeClass","SizeStyle","CLIPBOARD_CONFIG","includes","isPre","preNodes","replacer","collapse","replaced","matchNewline","deltaEndsWith","ELEMENT_NODE","applyFormat","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","fontStyle","italic","textDecoration","underline","strike","fontWeight","bold","parseFloat","textIndent","composed","_objectSpread","language","table","row","matchAlias","Clipboard","onCaptureCopy","onCapturePaste","matchers","_ref2","clipboard_slicedToArray","selector","matcher","addMatcher","_ref3","DOMParser","parseFromString","nodeMatches","_this$prepareMatching2","prepareMatching","elementMatchers","textMatchers","traverse","dangerouslyPasteHTML","paste","isCut","defaultPrevented","_this$onCopy","onCopy","clipboardData","setData","stopPropagation","getData","files","upload","onPaste","_ref4","pastedDelta","pair","_pair","newDelta","endText","childrenDelta","reducedDelta","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","test","navigator","platform","dest","stack","inverseDelta","deleteLength","changeIndex","endsWithNewlineChange","getLastChangeIndex","cutoff","changeDelta","undoDelta","timestamp","now","delay","maxStack","transformStack","remoteDelta","SHORTKEY","Keyboard","binding","which","bindings","handleEnter","metaKey","ctrlKey","altKey","userAgent","handleBackspace","handleDelete","handleDeleteRange","listen","keyBinding","normalize","singleBinding","isComposing","matches","_this$quill$getLine2","keyboard_slicedToArray","_this$quill$getLeaf2","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","curFormats","prevFormats","formatDelta","nextFormats","firstFormats","lastFormats","lineFormats","makeCodeBlockHandler","code-block","textContent","makeEmbedArrowHandler","makeFormatHandler","makeTableArrowHandler","up","cell","targetRow","targetCell","targetLine","outdent","outdent backspace","indent code-block","outdent code-block","remove tab","tab","blockquote empty enter","list empty enter","checklist enter","_this$quill$getLine12","header enter","_this$quill$getLine14","header","table backspace","table delete","table enter","_module$getTable2","getTable","tableSide","table tab","list autofill","blockquote","_this$quill$getLine16","code exit","_this$quill$getLine18","numLines","embed left","embed left shift","embed right","embed right shift","table down","table up","Uploader","caretRangeFromPoint","clientX","clientY","caretPositionFromPoint","offsetNode","dataTransfer","uploads","file","mimetypes","promises","reader","FileReader","onload","result","readAsDataURL","all","images","image","blots/block","blots/block/embed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","modules/uploader","IndentClass","Blockquote","Header","ListContainer","ListItem","ui","ownerDocument","listEventHandler","attachUI","Bold","Italic","Link","sanitize","url","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","href","protocol","Script","Strike","Underline","Formula","katex","render","throwOnError","errorColor","formula","ATTRIBUTES","Image","span","thumbUrl","originUrl","hasAttribute","execCommand","Video","video","TokenAttributor","CodeToken","SyntaxCodeBlock","SyntaxCodeBlockContainer","forceNext","highlight","forced","cachedText","BreakBlot","Syntax","hljs","highlightBlot","initListener","initTimer","select","languages","label","option","timer","clearTimeout","interval","nodeText","TableCell","tableId","cellOffset","rowOffset","TableRow","thisHead","thisTail","nextHead","nextTail","childFormats","TableBody","TableContainer","balanceCells","rows","maxColumns","fill","cells","column","at","deleteColumn","table_slicedToArray","insertColumn","insertRow","id","random","Table","listenBalanceCells","balanceTables","_this$getTable2","modules_table_slicedToArray","deleteRow","deleteTable","_this$getTable8","insertColumnLeft","insertColumnRight","_this$getTable10","insertRowAbove","insertRowBelow","insertTable","columns","old","Toolbar","groups","controls","group","control","addButton","addSelect","addControls","addHandler","toolbar_slicedToArray","selectedIndex","selected","prompt","isActive","clean","direction","align","link","ui_icons","","alignLeftIcon","center","alignCenterIcon","alignRightIcon","justify","alignJustifyIcon","background","backgroundIcon","blockquoteIcon","boldIcon","cleanIcon","code","codeIcon","color","colorIcon","directionLeftToRightIcon","rtl","directionRightToLeftIcon","formulaIcon","1","headerIcon","2","header2Icon","italicIcon","imageIcon","+1","indentIcon","-1","outdentIcon","linkIcon","bullet","listBulletIcon","check","listCheckIcon","ordered","listOrderedIcon","script","sub","subscriptIcon","superscriptIcon","strikeIcon","tableIcon","underlineIcon","videoIcon","optionsCounter","toggleAriaAttribute","element","Picker","buildPicker","display","togglePicker","escape","buildItem","tabIndex","selectItem","buildLabel","DropdownIcon","buildOptions","close","trigger","dispatchEvent","Event","ColorPicker","backgroundColor","colorLabel","stroke","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","marginTop","hide","reference","offsetWidth","quillBounds","rootBounds","verticalShift","show","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","tooltip","textbox","pickers","picker","removeEventListener","extendToolbar","buildButtons","buttons","button","buildPickers","selects","fillSelect","edit","fileInput","click","BaseTooltip","save","cancel","preview","restoreFocus","linkRange","extractVideoUrl","defaultValue","TOOLBAR_CONFIG","BubbleTooltip","lastLine","indexBounds","arrow","marginLeft","BubbleTheme","SnowTooltip","_this$quill$scroll$de2","snow_slicedToArray","LinkBlot","linkHover","linkHide","SnowTheme","attributors/attribute/direction","attributors/class/align","attributors/class/background","attributors/class/color","attributors/class/direction","attributors/class/font","attributors/class/size","attributors/style/align","attributors/style/background","attributors/style/color","attributors/style/direction","attributors/style/font","attributors/style/size","formats/align","formats/direction","formats/indent","Indent","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","List","formats/bold","formats/code","InlineCode","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/formula","formats/image","formats/video","modules/syntax","modules/table","modules/toolbar","themes/bubble","themes/snow","ui/icons","Icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,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,UCrFfpjB,GAAM7X,SACJ,CACEk7B,kCAAmC5c,GAEnC6c,0BAA2B5d,GAC3B6d,+BAAgCrd,GAChCsd,0BAA2Bxd,GAC3Byd,8BAA+B/c,GAC/Bgd,yBAA0B9c,GAC1B+c,yBAA0B7c,GAE1B8c,0BAA2Bhe,GAC3Bie,+BAAgC1d,GAChC2d,0BAA2B7d,GAC3B8d,8BAA+Bpd,GAC/Bqd,yBAA0Bnd,GAC1Bod,yBAA0Bld,KAE5B,GAGF/G,GAAM7X,SACJ,CACE+7B,gBAAiBxe,GACjBye,oBAAqBzd,GACrB0d,iBAAkBC,GAElBC,qBAAsBne,GACtBoe,gBAAiBte,GACjBue,eAAgB5d,GAChB6d,eAAgB3d,GAEhB4d,qBAAsBxQ,GACtByQ,qBAAsBre,GACtBse,iBAAkBzQ,GAClB0Q,eAAgBC,GAEhBC,eAAgBrQ,GAChBsQ,eAAgBC,GAChBC,iBAAkBvQ,GAClBwQ,eAAgBvQ,GAChBwQ,iBAAkB/P,GAClBgQ,iBAAkB/P,GAClBgQ,oBAAqB/P,GAErBgQ,kBAAmB/P,GACnBgQ,gBAAiBzP,GACjB0P,gBAAiBpP,GAEjBqP,iBAAkB1O,GAClB2O,gBAAiBrM,GACjBsM,kBAAmBtL,GAEnBuL,gBAAiBhD,GACjBiD,cAAe1C,GAEf2C,WAAYC,GACZC,YAAaxH,GACbyH,iBAAkBtG,GAClBuG,kBAAmB3G,GACnB4G,aAAcrG,KAEhB,GAGa/f","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 41);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar deep_equal_1 = __importDefault(require(\"deep-equal\"));\nvar extend_1 = __importDefault(require(\"extend\"));\nvar fast_diff_1 = __importDefault(require(\"fast-diff\"));\nvar AttributeMap_1 = __importDefault(require(\"./AttributeMap\"));\nvar Op_1 = __importDefault(require(\"./Op\"));\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\nvar Delta = /** @class */ (function () {\n function Delta(ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n }\n else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n }\n else {\n this.ops = [];\n }\n }\n Delta.prototype.insert = function (arg, attributes) {\n var newOp = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n };\n Delta.prototype.delete = function (length) {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n };\n Delta.prototype.retain = function (length, attributes) {\n if (length <= 0) {\n return this;\n }\n var newOp = { retain: length };\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n };\n Delta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend_1.default(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number') {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (deep_equal_1.default(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n else if (typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n }\n else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n };\n Delta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n };\n Delta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n };\n Delta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n };\n Delta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n };\n Delta.prototype.partition = function (predicate) {\n var passed = [];\n var failed = [];\n this.forEach(function (op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n };\n Delta.prototype.reduce = function (predicate, initialValue) {\n return this.ops.reduce(predicate, initialValue);\n };\n Delta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + Op_1.default.length(elem);\n }\n else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n };\n Delta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + Op_1.default.length(elem);\n }, 0);\n };\n Delta.prototype.slice = function (start, end) {\n if (start === void 0) { start = 0; }\n if (end === void 0) { end = Infinity; }\n var ops = [];\n var iter = Op_1.default.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp = void 0;\n if (index < start) {\n nextOp = iter.next(start - index);\n }\n else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op_1.default.length(nextOp);\n }\n return new Delta(ops);\n };\n Delta.prototype.compose = function (other) {\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n var ops = [];\n var firstOther = otherIter.peek();\n if (firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null) {\n var firstLeft = firstOther.retain;\n while (thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n var delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n }\n else {\n var length_1 = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length_1);\n var otherOp = otherIter.next(length_1);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length_1;\n }\n else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n // Optimization if rest of other is just retain\n if (!otherIter.hasNext() &&\n deep_equal_1.default(delta.ops[delta.ops.length - 1], newOp)) {\n var rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n }\n else if (typeof otherOp.delete === 'number' &&\n typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n };\n Delta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n };\n Delta.prototype.diff = function (other, cursor) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta\n .map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n var retDelta = new Delta();\n var diffResult = fast_diff_1.default(strings[0], strings[1], cursor);\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case fast_diff_1.default.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case fast_diff_1.default.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case fast_diff_1.default.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (deep_equal_1.default(thisOp.insert, otherOp.insert)) {\n retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes));\n }\n else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n };\n Delta.prototype.eachLine = function (predicate, newline) {\n if (newline === void 0) { newline = '\\n'; }\n var iter = Op_1.default.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n var thisOp = iter.peek();\n var start = Op_1.default.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n }\n else if (index > 0) {\n line.push(iter.next(index));\n }\n else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n };\n Delta.prototype.invert = function (base) {\n var inverted = new Delta();\n this.reduce(function (baseIndex, op) {\n if (op.insert) {\n inverted.delete(Op_1.default.length(op));\n }\n else if (op.retain && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n }\n else if (op.delete || (op.retain && op.attributes)) {\n var length_2 = (op.delete || op.retain);\n var slice = base.slice(baseIndex, baseIndex + length_2);\n slice.forEach(function (baseOp) {\n if (op.delete) {\n inverted.push(baseOp);\n }\n else if (op.retain && op.attributes) {\n inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes));\n }\n });\n return baseIndex + length_2;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n };\n Delta.prototype.transform = function (arg, priority) {\n if (priority === void 0) { priority = false; }\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n var other = arg;\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(Op_1.default.length(thisIter.next()));\n }\n else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else {\n var length_3 = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length_3);\n var otherOp = otherIter.next(length_3);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n }\n else if (otherOp.delete) {\n delta.push(otherOp);\n }\n else {\n // We retain either their retain or insert\n delta.retain(length_3, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n };\n Delta.prototype.transformPosition = function (index, priority) {\n if (priority === void 0) { priority = false; }\n priority = !!priority;\n var thisIter = Op_1.default.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length_4 = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length_4, index - offset);\n continue;\n }\n else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length_4;\n }\n offset += length_4;\n }\n return index;\n };\n Delta.Op = Op_1.default;\n Delta.AttributeMap = AttributeMap_1.default;\n return Delta;\n}());\nmodule.exports = Delta;\n//# sourceMappingURL=Delta.js.map","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n","module.exports = \" \";","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Iterator_1 = __importDefault(require(\"./Iterator\"));\nvar Op;\n(function (Op) {\n function iterator(ops) {\n return new Iterator_1.default(ops);\n }\n Op.iterator = iterator;\n function length(op) {\n if (typeof op.delete === 'number') {\n return op.delete;\n }\n else if (typeof op.retain === 'number') {\n return op.retain;\n }\n else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n Op.length = length;\n})(Op || (Op = {}));\nexports.default = Op;\n//# sourceMappingURL=Op.js.map","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar deep_equal_1 = __importDefault(require(\"deep-equal\"));\nvar extend_1 = __importDefault(require(\"extend\"));\nvar AttributeMap;\n(function (AttributeMap) {\n function compose(a, b, keepNull) {\n if (a === void 0) { a = {}; }\n if (b === void 0) { b = {}; }\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n var attributes = extend_1.default(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.compose = compose;\n function diff(a, b) {\n if (a === void 0) { a = {}; }\n if (b === void 0) { b = {}; }\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n var attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce(function (attrs, key) {\n if (!deep_equal_1.default(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.diff = diff;\n function invert(attr, base) {\n if (attr === void 0) { attr = {}; }\n if (base === void 0) { base = {}; }\n attr = attr || {};\n var baseInverted = Object.keys(base).reduce(function (memo, key) {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce(function (memo, key) {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n AttributeMap.invert = invert;\n function transform(a, b, priority) {\n if (priority === void 0) { priority = false; }\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n var attributes = Object.keys(b).reduce(function (attrs, key) {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.transform = transform;\n})(AttributeMap || (AttributeMap = {}));\nexports.default = AttributeMap;\n//# sourceMappingURL=AttributeMap.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Op_1 = __importDefault(require(\"./Op\"));\nvar Iterator = /** @class */ (function () {\n function Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n Iterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n };\n Iterator.prototype.next = function (length) {\n if (!length) {\n length = Infinity;\n }\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = Op_1.default.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n }\n else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n }\n else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n }\n else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n }\n else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n }\n else {\n return { retain: Infinity };\n }\n };\n Iterator.prototype.peek = function () {\n return this.ops[this.index];\n };\n Iterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op_1.default.length(this.ops[this.index]) - this.offset;\n }\n else {\n return Infinity;\n }\n };\n Iterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index].delete === 'number') {\n return 'delete';\n }\n else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n }\n else {\n return 'insert';\n }\n }\n return 'retain';\n };\n Iterator.prototype.rest = function () {\n if (!this.hasNext()) {\n return [];\n }\n else if (this.offset === 0) {\n return this.ops.slice(this.index);\n }\n else {\n var offset = this.offset;\n var index = this.index;\n var next = this.next();\n var rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n };\n return Iterator;\n}());\nexports.default = Iterator;\n//# sourceMappingURL=Iterator.js.map","enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n","import LinkedNode from './linked-node';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive: boolean = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n","export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n","import Attributor from './attributor/attributor';\nimport { Blot, BlotConstructor, Root } from './blot/abstract/blot';\nimport ParchmentError from './error';\nimport Scope from './scope';\n\nexport interface RegistryInterface {\n create(sroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(\n query: string | Node | Scope,\n scope: Scope,\n ): Attributor | BlotConstructor | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node: Node | null, bubble: boolean = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n return this.find(node.parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: Attributor | BlotConstructor } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-ignore\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble: boolean = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): Attributor | BlotConstructor | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-ignore\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof HTMLElement) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some(name => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: any[]): any {\n if (definitions.length > 1) {\n return definitions.map(d => {\n return this.register(d);\n });\n }\n const definition = definitions[0];\n if (\n typeof definition.blotName !== 'string' &&\n typeof definition.attrName !== 'string'\n ) {\n throw new ParchmentError('Invalid definition');\n } else if (definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n this.types[definition.blotName || definition.attrName] = definition;\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n } else {\n if (definition.className != null) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName != null) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n }\n}\n","import ParchmentError from '../../error';\nimport Registry from '../../registry';\nimport Scope from '../../scope';\nimport { Blot, BlotConstructor, Formattable, Parent, Root } from './blot';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string;\n\n public static create(value: any): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-ignore\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(public scroll: Root, public domNode: Node) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach() {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n","import LinkedList from '../../collection/linked-list';\nimport ParchmentError from '../../error';\nimport Scope from '../../scope';\nimport { Blot, BlotConstructor, Parent, Root } from './blot';\nimport ShadowBlot from './shadow';\n\nclass ParentBlot extends ShadowBlot implements Parent {\n public static allowedChildren: BlotConstructor[] | null;\n public static defaultChild: BlotConstructor | null;\n public static uiClass: string = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach(child => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement) {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: { new (): Blot },\n index: number,\n ): [Blot | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index: number = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: { new (): Blot },\n index: number,\n length: number,\n ): Blot[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index: number,\n length: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index: number = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach(child => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren() {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.parent = this;\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot): void {\n this.children.forEach(child => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(\n index: number,\n inclusive: boolean = false,\n ): Array<[Blot, number]> {\n const [child, offset] = this.children.find(index, inclusive);\n const position: Array<[Blot, number]> = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force: boolean = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach(mutation => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter(node => {\n return node.parentNode === this.domNode || node === this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(node => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n let blot = scroll.find(node);\n if (blot == null) {\n try {\n blot = scroll.create(node);\n } catch (e) {\n blot = scroll.create(Scope.INLINE) as Blot;\n Array.from(node.childNodes).forEach((child: Node) => {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot as Blot;\n}\n\nexport default ParentBlot;\n","import Scope from '../../scope';\nimport BlockBlot from '../block';\nimport ParentBlot from './parent';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string;\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n","import Scope from '../../scope';\nimport { Leaf } from './blot';\nimport ShadowBlot from './shadow';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n public static value(_domNode: Node): any {\n return true;\n }\n\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n","import Scope from '../scope';\n\nexport interface IAttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public attrName: string;\n public keyName: string;\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n attrName: string,\n keyName: string,\n options: IAttributorOptions = {},\n ) {\n this.attrName = attrName;\n this.keyName = keyName;\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): string {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n","import Attributor from './attributor';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter(name => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '').split(/\\s+/).map(name =>\n name\n .split('-')\n .slice(0, -1)\n .join('-'),\n );\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach(name => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): string {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n","import Attributor from './attributor';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: Element): string[] {\n return (node.getAttribute('style') || '').split(';').map(value => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): string {\n // @ts-ignore\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n","import { Formattable } from '../blot/abstract/blot';\nimport Registry from '../registry';\nimport Scope from '../scope';\nimport Attributor from './attributor';\nimport ClassAttributor from './class';\nimport StyleAttributor from './style';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(name => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach(key => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach(key => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n","import Attributor from '../attributor/attributor';\nimport AttributorStore from '../attributor/store';\nimport Scope from '../scope';\nimport {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\nimport ParentBlot from './abstract/parent';\n\n// Shallow object comparison\nfunction isEqual(obj1: object, obj2: object): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n // @ts-ignore\n for (const prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName = 'SPAN';\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any) {\n if (name === this.statics.blotName && !value) {\n this.children.forEach(child => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n mutation =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n","import Attributor from '../attributor/attributor';\nimport AttributorStore from '../attributor/store';\nimport Scope from '../scope';\nimport { Blot, BlotConstructor, Formattable, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\nimport ParentBlot from './abstract/parent';\nimport InlineBlot from './inline';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any) {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n mutation =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n","import { Formattable, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n","import Attributor from '../attributor/attributor';\nimport Registry from '../registry';\nimport Scope from '../scope';\nimport { Blot, BlotConstructor, Root } from './abstract/blot';\nimport ContainerBlot from './abstract/container';\nimport ParentBlot from './abstract/parent';\nimport BlockBlot from './block';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public registry: Registry;\n public observer: MutationObserver;\n\n constructor(registry: Registry, node: HTMLDivElement) {\n // @ts-ignore\n super(null, node);\n this.registry = registry;\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble: boolean = false): Blot | null {\n return this.registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): Attributor | BlotConstructor | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: any[]): any {\n return this.registry.register(...definitions);\n }\n\n public build() {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach() {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(child => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent: boolean = true) => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot) => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = Registry.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n","import Scope from '../scope';\nimport { Blot, Leaf, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive: boolean = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force: boolean = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some(mutation => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n","export default new WeakMap();\n","const levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce((logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\nnamespace.level = newLevel => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n","import EventEmitter from 'eventemitter3';\nimport instances from './instances';\nimport logger from './logger';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(eventName => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach(node => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args) {\n debug.log.call(debug, ...args);\n super.emit(...args);\n }\n\n handleDOM(event, ...args) {\n (this.listeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler });\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n};\n\nexport default Emitter;\n","import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n","import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text) {\n return text.replace(/[&<>\"']/g, s => {\n // https://lodash.com/docs#escape\n const entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n","import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport Break from './break';\nimport Text from './text';\n\nclass Inline extends InlineBlot {\n static compare(self, other) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index, length, name, value) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Break, EmbedBlot, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor',\n 'inline', // Must be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'link',\n 'code', // Must be higher\n];\n\nexport default Inline;\n","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n constructor(scroll, domNode) {\n super(scroll, domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce((lineIndex, line) => {\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(\n this.value(),\n extend(this.formats(), this.attributes.values()),\n );\n }\n\n format(name, value) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n const block = this.scroll.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(blot, formats = {}, filter = true) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n","import { LeafBlot, Scope } from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\nimport Break from '../blots/break';\nimport Block from '../blots/block';\n\nconst debug = logger('quill:selection');\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n this.update(Emitter.sources.SILENT);\n } catch (ignored) {\n // ignore\n }\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.root.classList.toggle('ql-blank', false);\n this.composing = true;\n this.scroll.batchStart();\n });\n this.root.addEventListener('compositionend', () => {\n setTimeout(() => {\n this.root.classList.toggle('ql-blank', this.isBlank());\n this.scroll.batchEnd();\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n }, 1);\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange() {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return (\n document.activeElement === this.root ||\n contains(this.root, document.activeElement)\n );\n }\n\n normalizedToRange(range) {\n const positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map(position => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach(position => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n const indexes = range.collapsed\n ? [range.index]\n : [range.index, range.index + range.length];\n const args = [];\n const scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n const [node, offset] = leaf.position(leafOffset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n return args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n const range = this.lastRange;\n if (range == null) return;\n const bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n const limit = this.scroll.length() - 1;\n const [first] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n const scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n\n setNativeRange(\n startNode,\n startOffset,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode.tagName === 'BR') {\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode.tagName === 'BR') {\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n clone(this.lastRange),\n clone(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport { Range, Selection as default };\n","import { EmbedBlot, Scope } from 'parchment';\nimport TextBlot from './text';\n\nclass Cursor extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n constructor(scroll, domNode, selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n let target = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Link format will insert text outside of anchor tag\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node, offset) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations, context) {\n if (\n mutations.some(mutation => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\nexport default Cursor;\n","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { LeafBlot } from 'parchment';\nimport { Range } from './selection';\nimport CursorBlot from '../blots/cursor';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\nimport TextBlot, { escapeText } from '../blots/text';\n\nconst ASCII = /^[ -~]*$/;\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n normalizedDelta.reduce((index, op) => {\n const length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (\n (index >= scrollLength ||\n this.scroll.descendant(BlockEmbed, index)[0]) &&\n !text.endsWith('\\n')\n ) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(name => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n normalizedDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach(format => {\n this.scroll.lines(index, Math.max(length, 1)).forEach(line => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, clone(formats));\n return this.update(delta);\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, clone(formats));\n return this.update(delta);\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [];\n let leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(path => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const formatsArr = [lines, leaves].map(blots => {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getHTML(index, length) {\n const [line, lineOffset] = this.scroll.line(index);\n if (line.length() >= lineOffset + length) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n\n getText(index, length) {\n return this.getContents(index, length)\n .filter(op => typeof op.insert === 'string')\n .map(op => op.insert)\n .join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], selectionInfo = undefined) {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target);\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\nfunction convertListHTML(items, lastIndent, types) {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(blot, index, length, isRoot = false) {\n if (typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot.children) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats = child.formats();\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode.outerHTML;\n}\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce((merged, name) => {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction getListType(type) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }, amount) {\n return new Range(index + amount, length);\n}\n\nexport default Editor;\n","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\nexport default Module;\n","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach(name => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {},\n};\nTheme.themes = {\n default: Theme,\n};\n\nexport default Theme;\n","import Delta from 'quill-delta';\nimport * as Parchment from 'parchment';\nimport extend from 'extend';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Selection, { Range } from './selection';\nimport instances from './instances';\nimport logger from './logger';\nimport Theme from './theme';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return instances.get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n const ScrollBlot = this.options.registry.query(\n Parchment.ScrollBlot.blotName,\n );\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, type => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const { scrollTop } = this.scrollingContainer;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args) {\n return this.emitter.off(...args);\n }\n\n on(...args) {\n return this.emitter.on(...args);\n }\n\n once(...args) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n if (\n lastOp != null &&\n typeof lastOp.insert === 'string' &&\n lastOp.insert[lastOp.insert.length - 1] === '\\n'\n ) {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n return deleted.compose(applied);\n },\n source,\n );\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n },\n source,\n true,\n );\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default',\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(\n true,\n {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n },\n userConfig,\n );\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(\n `Invalid theme ${userConfig.theme}. Did you register it?`,\n );\n }\n }\n const themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(\n Object.keys(userConfig.modules),\n );\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (\n userConfig.modules != null &&\n userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object\n ) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar,\n };\n }\n userConfig = extend(\n true,\n {},\n Quill.DEFAULTS,\n { modules: moduleConfig },\n themeConfig,\n userConfig,\n );\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(\n (config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n },\n {},\n );\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(pos =>\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map(pos => {\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n","import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n","import { EmbedBlot } from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nclass Embed extends EmbedBlot {\n constructor(scroll, node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n Array.from(this.domNode.childNodes).forEach(childNode => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range;\n let textNode;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach(mutation => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n","import { Scope, ScrollBlot, ContainerBlot } from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport Container from './container';\n\nfunction isLine(blot) {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\nclass Scroll extends ScrollBlot {\n constructor(registry, domNode, { emitter }) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', e => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n deleteAt(index, length) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n handleDragStart(event) {\n event.preventDefault();\n }\n\n insertAt(index, value, def) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(this.statics.defaultChild.blotName);\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n const getLines = (blot, blotIndex, blotLength) => {\n let lines = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(mutations) {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = Block;\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\nexport default Scroll;\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map(component => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n","import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n","import Block from '../blots/block';\nimport Break from '../blots/break';\nimport Cursor from '../blots/cursor';\nimport Inline from '../blots/inline';\nimport TextBlot, { escapeText } from '../blots/text';\nimport Container from '../blots/container';\nimport Quill from '../core/quill';\n\nclass CodeBlockContainer extends Container {\n static create(value) {\n const domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n html(index, length) {\n const text = this.children\n .map(child => child.domNode.innerText)\n .join('\\n')\n .slice(index, index + length);\n return `
    ${escapeText(text)}
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\nCodeBlock.TAB = ' ';\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport {\n Attributor,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n BlockBlot,\n} from 'parchment';\nimport { BlockEmbed } from '../blots/block';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nconst debug = logger('quill:clipboard');\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('copy', e => this.onCaptureCopy(e, false));\n this.quill.root.addEventListener('cut', e => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert({ html, text }, formats = {}) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text, {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '');\n }\n const doc = new DOMParser().parseFromString(html, 'text/html');\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n const delta = traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData.setData('text/plain', text);\n e.clipboardData.setData('text/html', html);\n if (isCut) {\n this.quill.deleteText(range, Quill.sources.USER);\n }\n }\n\n onCapturePaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n e.stopPropagation();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData.getData('text/html');\n const text = e.clipboardData.getData('text/plain');\n const files = Array.from(e.clipboardData.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n } else {\n this.onPaste(range, { html, text });\n }\n }\n\n onCopy(range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range, { text, html }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollIntoView();\n }\n\n prepareMatching(container, nodeMatches) {\n const elementMatchers = [];\n const textMatchers = [];\n this.matchers.forEach(pair => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach(node => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n};\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce((newDelta, key) => {\n return applyFormat(newDelta, key, format[key]);\n }, delta);\n }\n return delta.reduce((newDelta, op) => {\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n return newDelta.insert(\n op.insert,\n extend({}, { [format]: value }, op.attributes),\n );\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(scroll, node, elementMatchers, textMatchers, nodeMatches) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta, scroll) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(name => {\n let attr = scroll.query(name, Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n return applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta, scroll) {\n const match = scroll.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n const value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (typeof match.formats === 'function') {\n return applyFormat(delta, match.blotName, match.formats(node, scroll));\n }\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node, delta, scroll) {\n const match = scroll.query('code-block');\n const language = match ? match.formats(node, scroll) : true;\n return applyFormat(delta, 'code-block', language);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta, scroll) {\n const match = scroll.query(node);\n if (\n match == null ||\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (op.attributes && op.attributes.list) {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node, delta) {\n const list = node.tagName === 'OL' ? 'ordered' : 'bullet';\n return applyFormat(delta, 'list', list);\n}\n\nfunction matchNewline(node, delta, scroll) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node)) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let { nextSibling } = node;\n while (nextSibling != null) {\n if (isLine(nextSibling)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n const formats = {};\n const style = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight.startsWith('bold') ||\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(node, delta) {\n const table =\n node.parentNode.tagName === 'TABLE'\n ? node.parentNode\n : node.parentNode.parentNode;\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row);\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && text.includes('\\n')) {\n return delta;\n }\n if (!isPre(node)) {\n const replacer = (collapse, match) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n","import { Scope } from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n },\n );\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n const delta = this.stack[source].pop();\n const base = this.quill.getContents();\n const inverseDelta = delta.invert(base);\n this.stack[dest].push(inverseDelta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta, Quill.sources.USER);\n this.ignoreChange = false;\n const index = getLastChangeIndex(this.quill.scroll, delta);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n const timestamp = Date.now();\n if (\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta);\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push(undoDelta);\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n};\n\nfunction transformStack(stack, delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldDelta = stack[i];\n stack[i] = remoteDelta.transform(oldDelta, true);\n remoteDelta = oldDelta.transform(remoteDelta);\n if (stack[i].length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll, delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(attr => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll, delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexport { History as default, getLastChangeIndex };\n","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n if (\n ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(key => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach(name => {\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(keyBinding, context = {}, handler = {}) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach(key => {\n const singleBinding = extend({}, binding, { key }, context, handler);\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', evt => {\n if (evt.defaultPrevented || evt.isComposing) return;\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter(binding => Keyboard.match(evt, binding));\n if (matches.length === 0) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some(binding => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(name => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every(name => {\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range, context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range, context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range) {\n const lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n }\n\n handleEnter(range, context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n\n Object.keys(context.format).forEach(name => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'code' || name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n }\n}\n\nKeyboard.DEFAULTS = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = extend({}, line.formats(), { list: 'checked' });\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n list: false,\n 'code-block': false,\n blockquote: false,\n header: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range) {\n const CodeBlock = this.quill.scroll.query('code-block');\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, CodeBlock.TAB);\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.domNode.textContent.startsWith(CodeBlock.TAB)) {\n line.deleteAt(0, CodeBlock.TAB.length);\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up) {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = clone(binding, false);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nfunction tableSide(table, row, cell, offset) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize };\n","import Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Module from '../core/module';\n\nclass Uploader extends Module {\n constructor(quill, options) {\n super(quill, options);\n quill.root.addEventListener('drop', e => {\n e.preventDefault();\n let native;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n } else if (document.caretPositionFromPoint) {\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n } else {\n return;\n }\n const normalized = quill.selection.normalizeNative(native);\n const range = quill.selection.normalizedToRange(normalized);\n this.upload(range, e.dataTransfer.files);\n });\n }\n\n upload(range, files) {\n const uploads = [];\n Array.from(files).forEach(file => {\n if (file && this.options.mimetypes.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range, files) {\n const promises = files.map(file => {\n return new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = e => {\n resolve(e.target.result);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then(images => {\n const update = images.reduce((delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length));\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n","import Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\nimport Uploader from './modules/uploader';\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n});\n\nexport default Quill;\n","import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, value);\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n","import Block from '../blots/block';\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexport default Blockquote;\n","import Block from '../blots/block';\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexport default Header;\n","import Block from '../blots/block';\nimport Container from '../blots/container';\nimport Quill from '../core/quill';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value) {\n const node = super.create();\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll, domNode) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = e => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n","import Bold from './bold';\n\nclass Italic extends Bold {}\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n","import Inline from '../blots/inline';\n\nclass Link extends Inline {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction sanitize(url, protocols) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n","import Inline from '../blots/inline';\n\nclass Strike extends Inline {}\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n","import Inline from '../blots/inline';\n\nclass Underline extends Inline {}\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n","import Embed from '../blots/embed';\n\nclass Formula extends Embed {\n static create(value) {\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\nFormula.blotName = 'formula';\nFormula.className = 'ql-formula';\nFormula.tagName = 'SPAN';\n\nexport default Formula;\n","import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static create(value) {\n const node = super.create(value);\n const span = document.createElement('span');\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n span.setAttribute('href', this.sanitize(value));\n span.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n if (value.originUrl) {\n span.setAttribute('href', this.sanitize(value.originUrl));\n span.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n span.setAttribute('data-fancybox-type', 'image');\n span.setAttribute('data-fancybox-group', 'editor');\n span.classList.add('fancybox');\n span.appendChild(node);\n return span;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexport default Image;\n","import { BlockEmbed } from '../blots/block';\nimport Link from './link';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url); // eslint-disable-line import/no-named-as-default-member\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexport default Video;\n","import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport Inline from '../blots/inline';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport { blockDelta } from '../blots/block';\nimport BreakBlot from '../blots/break';\nimport CursorBlot from '../blots/cursor';\nimport TextBlot, { escapeText } from '../blots/text';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code';\nimport { traverse } from './clipboard';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node, scroll) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList.contains(CodeBlock.className)) {\n return super.formats(node, scroll);\n }\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll, domNode, value) {\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format, value) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args) {\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name, value) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name, value) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n attach() {\n super.attach();\n this.forceNext = false;\n this.scroll.emitMount(this);\n }\n\n format(name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach(child => {\n child.format(name, value);\n });\n }\n }\n\n formatAt(index, length, name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(highlight, forced = false) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n node => node !== this.uiNode,\n );\n const text = `${nodes.map(node => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach(format => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (language !== this.uiNode.value) {\n this.uiNode.value = language;\n }\n }\n }\n}\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\nclass Syntax extends Module {\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n constructor(quill, options) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, blot => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach(container => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text, language = 'plain') {\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = this.options.hljs.highlight(language, text).value;\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'Javascript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n","import Block from '../blots/block';\nimport Container from '../blots/container';\n\nclass TableCell extends Block {\n static create(value) {\n const node = super.create();\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name, value) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row() {\n return this.parent;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\nTableCell.blotName = 'table';\nTableCell.tagName = 'TD';\n\nclass TableRow extends Container {\n checkMerge() {\n if (super.checkMerge() && this.next.children.head != null) {\n const thisHead = this.children.head.formats();\n const thisTail = this.children.tail.formats();\n const nextHead = this.next.children.head.formats();\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(...args) {\n super.optimize(...args);\n this.children.forEach(child => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\nTableRow.blotName = 'table-row';\nTableRow.tagName = 'TR';\n\nclass TableBody extends Container {}\nTableBody.blotName = 'table-body';\nTableBody.tagName = 'TBODY';\n\nclass TableContainer extends Container {\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach(row => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column) {\n return this.rows().map(row => row.children.at(column));\n }\n\n deleteColumn(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const ref = row.children.at(index);\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName);\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map(row => row);\n }\n}\nTableContainer.blotName = 'table-container';\nTableContainer.tagName = 'TABLE';\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random()\n .toString(36)\n .slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n","import Delta from 'quill-delta';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach(table => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n const offset = table.offset();\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(range = this.quill.getSelection()) {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n return [table, row, cell, offset];\n }\n\n insertColumn(offset) {\n const range = this.quill.getSelection();\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset) {\n const range = this.quill.getSelection();\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows, columns) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce(memo => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, mutations => {\n mutations.some(mutation => {\n if (['TD', 'TR', 'TBODY', 'TABLE'].includes(mutation.target.tagName)) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n });\n }\n}\n\nexport default Table;\n","import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst debug = logger('quill:toolbar');\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach(format => {\n this.addHandler(format, this.options.handlers[format]);\n });\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n input => {\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = Array.from(input.classList).find(className => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, e => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(pair => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const isActive =\n formats[format] === input.getAttribute('value') ||\n (formats[format] != null &&\n formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(controls => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(control => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach(value => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach(name => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n","import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n","import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(\n attribute,\n !(element.getAttribute(attribute) === 'true'),\n );\n}\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option) {\n const item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n Array.from(this.select.options).forEach(option => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach(item => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item = this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n","import Picker from './picker';\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach(item => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n","import Picker from './picker';\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n item => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target, trigger) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\nexport default IconPicker;\n","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n const quillBounds = this.quill.root.getBoundingClientRect();\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n if (left < 0) {\n left = 8;\n }\n if (left > quillBounds.width - rootBounds.width - 8) {\n left = quillBounds.width - rootBounds.width - 8;\n }\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n const listener = e => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(picker => {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n Array.from(buttons).forEach(button => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(name => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n const value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = Array.from(selects).map(select => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format]);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach(picker => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n const { scrollTop } = this.quill.scrollingContainer;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n\n save() {\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(value => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n this.position(indexBounds);\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n].join('');\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n});\n\nexport { BubbleTooltip, BubbleTheme as default };\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', event => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', event => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.quill.options.linkHover(link.domNode, this.linkRange);\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.quill.options.linkHide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n '',\n].join('');\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (range, context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n },\n },\n },\n },\n});\n\nexport default SnowTheme;\n","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction';\nimport Indent from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Formula from './formats/formula';\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Syntax from './modules/syntax';\nimport Table from './modules/table';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport default Quill;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Quill/webpack/universalModuleDefinition","webpack://Quill/webpack/bootstrap","webpack://Quill/./node_modules/quill-delta/dist/Delta.js","webpack://Quill/./node_modules/extend/index.js","webpack://Quill/./node_modules/clone/clone.js","webpack://Quill/./node_modules/deep-equal/index.js","webpack://Quill/./assets/icons/code.svg","webpack://Quill/./node_modules/quill-delta/dist/Op.js","webpack://Quill/./node_modules/eventemitter3/index.js","webpack://Quill/./assets/icons/align-left.svg","webpack://Quill/./assets/icons/align-center.svg","webpack://Quill/./assets/icons/align-right.svg","webpack://Quill/./assets/icons/align-justify.svg","webpack://Quill/./assets/icons/background.svg","webpack://Quill/./assets/icons/blockquote.svg","webpack://Quill/./assets/icons/bold.svg","webpack://Quill/./assets/icons/clean.svg","webpack://Quill/./assets/icons/color.svg","webpack://Quill/./assets/icons/direction-ltr.svg","webpack://Quill/./assets/icons/direction-rtl.svg","webpack://Quill/./assets/icons/formula.svg","webpack://Quill/./assets/icons/header.svg","webpack://Quill/./assets/icons/header-2.svg","webpack://Quill/./assets/icons/italic.svg","webpack://Quill/./assets/icons/image.svg","webpack://Quill/./assets/icons/indent.svg","webpack://Quill/./assets/icons/outdent.svg","webpack://Quill/./assets/icons/link.svg","webpack://Quill/./assets/icons/list-bullet.svg","webpack://Quill/./assets/icons/list-check.svg","webpack://Quill/./assets/icons/list-ordered.svg","webpack://Quill/./assets/icons/subscript.svg","webpack://Quill/./assets/icons/superscript.svg","webpack://Quill/./assets/icons/strike.svg","webpack://Quill/./assets/icons/table.svg","webpack://Quill/./assets/icons/underline.svg","webpack://Quill/./assets/icons/video.svg","webpack://Quill/./assets/icons/dropdown.svg","webpack://Quill/./node_modules/deep-equal/lib/keys.js","webpack://Quill/./node_modules/deep-equal/lib/is_arguments.js","webpack://Quill/./node_modules/fast-diff/diff.js","webpack://Quill/./node_modules/quill-delta/dist/AttributeMap.js","webpack://Quill/./node_modules/quill-delta/dist/Iterator.js","webpack://Quill/./node_modules/parchment/src/scope.ts","webpack://Quill/./node_modules/parchment/src/collection/linked-list.ts","webpack://Quill/./node_modules/parchment/src/error.ts","webpack://Quill/./node_modules/parchment/src/registry.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/shadow.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/parent.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/container.ts","webpack://Quill/./node_modules/parchment/src/blot/abstract/leaf.ts","webpack://Quill/./node_modules/parchment/src/attributor/attributor.ts","webpack://Quill/./node_modules/parchment/src/attributor/class.ts","webpack://Quill/./node_modules/parchment/src/attributor/style.ts","webpack://Quill/./node_modules/parchment/src/attributor/store.ts","webpack://Quill/./node_modules/parchment/src/blot/inline.ts","webpack://Quill/./node_modules/parchment/src/blot/block.ts","webpack://Quill/./node_modules/parchment/src/blot/embed.ts","webpack://Quill/./node_modules/parchment/src/blot/scroll.ts","webpack://Quill/./node_modules/parchment/src/blot/text.ts","webpack://Quill/./core/instances.js","webpack://Quill/./core/logger.js","webpack://Quill/./core/emitter.js","webpack://Quill/./blots/break.js","webpack://Quill/./blots/text.js","webpack://Quill/./blots/inline.js","webpack://Quill/./blots/block.js","webpack://Quill/./core/selection.js","webpack://Quill/./blots/cursor.js","webpack://Quill/./core/editor.js","webpack://Quill/./core/module.js","webpack://Quill/./core/theme.js","webpack://Quill/./core/quill.js","webpack://Quill/./blots/container.js","webpack://Quill/./blots/embed.js","webpack://Quill/./blots/scroll.js","webpack://Quill/./formats/align.js","webpack://Quill/./formats/color.js","webpack://Quill/./formats/background.js","webpack://Quill/./formats/code.js","webpack://Quill/./formats/direction.js","webpack://Quill/./formats/font.js","webpack://Quill/./formats/size.js","webpack://Quill/./modules/clipboard.js","webpack://Quill/./modules/history.js","webpack://Quill/./modules/keyboard.js","webpack://Quill/./modules/uploader.js","webpack://Quill/./core.js","webpack://Quill/./formats/indent.js","webpack://Quill/./formats/blockquote.js","webpack://Quill/./formats/header.js","webpack://Quill/./formats/list.js","webpack://Quill/./formats/bold.js","webpack://Quill/./formats/italic.js","webpack://Quill/./formats/link.js","webpack://Quill/./formats/script.js","webpack://Quill/./formats/strike.js","webpack://Quill/./formats/underline.js","webpack://Quill/./formats/formula.js","webpack://Quill/./formats/image.js","webpack://Quill/./formats/video.js","webpack://Quill/./modules/syntax.js","webpack://Quill/./formats/table.js","webpack://Quill/./modules/table.js","webpack://Quill/./modules/toolbar.js","webpack://Quill/./ui/icons.js","webpack://Quill/./ui/picker.js","webpack://Quill/./ui/color-picker.js","webpack://Quill/./ui/icon-picker.js","webpack://Quill/./ui/tooltip.js","webpack://Quill/./themes/base.js","webpack://Quill/./themes/bubble.js","webpack://Quill/./themes/snow.js","webpack://Quill/./quill.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__importDefault","this","mod","default","deep_equal_1","extend_1","fast_diff_1","AttributeMap_1","Op_1","NULL_CHARACTER","String","fromCharCode","Delta","ops","Array","isArray","insert","arg","attributes","newOp","length","keys","push","delete","retain","index","lastOp","unshift","splice","chop","pop","filter","predicate","forEach","map","partition","passed","failed","op","reduce","initialValue","changeLength","elem","slice","start","end","Infinity","iter","iterator","hasNext","nextOp","next","compose","other","thisIter","otherIter","firstOther","peek","firstLeft","peekType","peekLength","delta","length_1","Math","min","thisOp","otherOp","rest","concat","diff","cursor","strings","Error","join","retDelta","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","line","indexOf","invert","base","inverted","baseIndex","length_2","baseOp","transform","priority","transformPosition","length_3","offset","length_4","nextType","Op","AttributeMap","hasOwn","toStr","toString","gOPD","getOwnPropertyDescriptor","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","constructor","setProperty","target","options","configurable","newValue","writable","getProperty","extend","src","copy","copyIsArray","clone","arguments","deep","_instanceof","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","_clone","child","proto","resolve","reject","then","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","getPrototypeOf","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertySymbols","symbols","symbol","descriptor","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","re","flags","global","ignoreCase","multiline","clonePrototype","pSlice","objectKeys","isArguments","deepEqual","actual","expected","opts","strict","a","b","isUndefinedOrNull","ka","kb","e","sort","objEquiv","x","Iterator_1","has","prefix","Events","EE","fn","context","once","addListener","emitter","event","TypeError","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","__proto__","eventNames","events","names","listeners","handlers","ee","listenerCount","emit","a1","a2","a3","a4","a5","args","len","removeListener","undefined","apply","j","on","removeAllListeners","off","prefixed","shim","supportsArgumentsClass","supported","unsupported","propertyIsEnumerable","DIFF_DELETE","DIFF_INSERT","DIFF_EQUAL","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","newRange","oldLength","newLength","oldCursor","oldBefore","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","oldPrefix","newPrefix","oldMiddle","newMiddle","make_edit_splice","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","floor","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","diff_cleanupMerge","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","changes","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","charCode","str","before","after","tuples","ret","remove_empty_tuples","keepNull","attr","baseInverted","memo","Iterator","retOp","substr","Scope","src_scope","linked_list","[object Object]","head","tail","nodes","insertBefore","append","cur","node","refNode","remove","prev","contains","curNode","inclusive","callback","startNode","find","curIndex","curLength","ParchmentError","message","super","registry_Registry","classes","tags","types","bubble","blots","parentNode","scroll","input","match","query","blotClass","Node","nodeType","TEXT_NODE","blot","domNode","scope","ANY","Text","text","LEVEL","BLOCK","block","INLINE","inline","HTMLElement","getAttribute","split","some","tagName","TYPE","definitions","register","definition","blotName","attrName","keyName","className","toUpperCase","tag","WeakMap","shadow_ShadowBlot","parseInt","document","createElement","classList","statics","cloneNode","removeChild","isolate","BLOT","wrap","ATTRIBUTE","format","def","ref","children","_context","requiredContainer","detach","replacement","_force","_mutations","wrapper","appendChild","shadow","parent_ParentBlot","uiNode","build","attach","uiClass","setAttribute","firstChild","from","childNodes","reverse","makeAttachedBlot","forEachAt","childLength","deleteAt","criteria","descendant","Number","MAX_VALUE","descendants","lengthLeft","childIndex","done","allowedChildren","BLOCK_BLOT","splitAfter","unwrap","formatAt","insertAt","childBlot","refBlot","refDomNode","nextSibling","targetParent","optimize","enforceAllowedChildren","defaultChild","position","path","moveChildren","replaceWith","force","_length","mutations","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_FOLLOWING","replaceChild","abstract_parent","container_ContainerBlot","checkMerge","abstract_container","leaf_LeafBlot","_domNode","_inclusive","INLINE_BLOT","abstract_leaf","attributor_Attributor","item","attributeBit","whitelist","canAdd","_node","replace","removeAttribute","class_match","attributor_class","camelize","parts","part","attributor_style","trim","style","store","attribute","styles","inline_InlineBlot","toLowerCase","formats","values","obj1","obj2","prop","isEqual","update","move","block_BlockBlot","blot_block","blot_embed","_scroll","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","MAX_OPTIMIZE_ITERATIONS","scroll_ScrollBlot","registry","observer","MutationObserver","observe","disconnect","mutationsMap","records","takeRecords","mark","markParent","remaining","previousSibling","grandChild","blot_scroll","text_TextBlot","createTextNode","data","splitText","blot_text","instances","levels","level","debug","method","_len","_key","console","namespace","logger","newLevel","eventName","addEventListener","querySelectorAll","quill","handleDOM","Emitter","error","_len2","_key2","log","_len3","_key3","_ref","handler","listenDOM","EDITOR_CHANGE","SCROLL_BEFORE_UPDATE","SCROLL_BLOT_MOUNT","SCROLL_BLOT_UNMOUNT","SCROLL_OPTIMIZE","SCROLL_UPDATE","SELECTION_CHANGE","TEXT_CHANGE","sources","API","SILENT","USER","Break","EmbedBlot","TextBlot","escapeText","&","<",">","\"","'","Inline","InlineBlot","self","selfIndex","order","otherIndex","compare","NEWLINE_LENGTH","Block","BlockBlot","cache","blockDelta","lines","shift","lineIndex","BlockEmbed","AttributorStore","BLOCK_ATTRIBUTE","endsWith","LeafBlot","leaf","bubbleFormats","Range","Selection","composing","mouseDown","savedRange","lastRange","handleComposition","handleDragging","setTimeout","hasFocus","native","getNativeRange","textNode","setNativeRange","ignored","range","_context$range","startOffset","endNode","endOffset","isBlank","toggle","batchStart","batchEnd","restore","focus","setRange","nativeRange","collapsed","getBounds","scrollLength","_this$scroll$leaf2","_slicedToArray","_leaf$position2","createRange","setStart","_this$scroll$leaf4","_leaf$position4","setEnd","getBoundingClientRect","rect","side","bottom","top","height","left","right","width","selection","getSelection","rangeCount","getRangeAt","normalizeNative","info","getRange","normalized","normalizedToRange","activeElement","positions","indexes","_position","max","startContainer","endContainer","lastChild","rangeToNative","_this$scroll$leaf6","leafOffset","_leaf$position6","scrollIntoView","scrollingContainer","bounds","limit","first","last","scrollBounds","scrollTop","removeAllRanges","addRange","blur","_this$getRange2","equal","Cursor","CONTENTS","savedLength","prevTextBlot","prevTextLength","nextTextBlot","nextText","mergedTextBlot","newTextNode","remapOffset","ASCII","convertHTML","isRoot","html","items","indent","list","convertListHTML","lastIndent","endTag","editor_slicedToArray","getListType","_items","_toArray","_items$","_getListType4","previousType","_blot$domNode","outerHTML","innerHTML","_outerHTML$split2","combineFormats","combined","merged","shiftRange","amount","Editor","getDelta","applyDelta","consumeNextNewline","normalizedDelta","normalizeDelta","_this$scroll$line2","deleteText","formatLine","formatText","getContents","getFormat","leaves","formatsArr","getHTML","_this$scroll$line4","lineOffset","getText","insertEmbed","embed","insertText","removeFormat","_this$scroll$line6","suffix","change","selectionInfo","oldDelta","textBlot","oldValue","CursorBlot","relativeSelectionInfo","Module","DEFAULTS","Theme","init","addModule","ModuleClass","import","themes","globalRegistry","Parchment","Quill","imports","overwrite","warn","startsWith","container","userConfig","clipboard","keyboard","history","uploader","theme","themeConfig","config","moduleConfig","moduleClass","toolbar","querySelector","expandConfig","addContainer","ScrollBlot","editor","quill_slicedToArray","modify","contents","convert","setContents","clear","placeholder","readOnly","disable","allowReadOnlyEdits","_overload2","overload","enable","editReadOnly","modifier","enabled","setSelection","_overload4","_overload6","containerBounds","getLength","_overload8","getIndex","getLeaf","getLine","getLines","getModule","getSemanticHTML","_overload10","_overload12","_overload14","isEnabled","_overload16","deleted","applied","_overload18","setText","updateContents","_map2","pos","_map4","version","QUILL_VERSION","parchment","core/module","core/theme","Container","ContainerBlot","GUARD_TEXT","Embed","contentNode","childNode","leftGuard","rightGuard","prevLength","isLine","Scroll","batch","handleDragStart","emitMount","emitUnmount","_this$line2","scroll_slicedToArray","preventDefault","blotIndex","blotLength","AlignAttribute","Attributor","AlignClass","ClassAttributor","AlignStyle","StyleAttributor","ColorAttributor","hex","ColorClass","ColorStyle","BackgroundClass","BackgroundStyle","CodeBlockContainer","innerText","CodeBlock","Code","TAB","DirectionAttribute","DirectionClass","DirectionStyle","FontClass","FontStyle","SizeClass","SizeStyle","CLIPBOARD_CONFIG","includes","isPre","preNodes","replacer","collapse","replaced","matchNewline","deltaEndsWith","ELEMENT_NODE","applyFormat","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","fontStyle","italic","textDecoration","underline","strike","fontWeight","bold","parseFloat","textIndent","composed","_objectSpread","language","table","row","matchAlias","Clipboard","onCaptureCopy","onCapturePaste","matchers","_ref2","clipboard_slicedToArray","selector","matcher","addMatcher","_ref3","DOMParser","parseFromString","nodeMatches","_this$prepareMatching2","prepareMatching","elementMatchers","textMatchers","traverse","dangerouslyPasteHTML","paste","isCut","defaultPrevented","_this$onCopy","onCopy","clipboardData","setData","stopPropagation","getData","files","upload","onPaste","_ref4","pastedDelta","pair","_pair","newDelta","endText","childrenDelta","reducedDelta","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","test","navigator","platform","dest","stack","inverseDelta","deleteLength","changeIndex","endsWithNewlineChange","getLastChangeIndex","cutoff","changeDelta","undoDelta","timestamp","now","delay","maxStack","transformStack","remoteDelta","SHORTKEY","Keyboard","binding","which","bindings","handleEnter","metaKey","ctrlKey","altKey","userAgent","handleBackspace","handleDelete","handleDeleteRange","listen","keyBinding","normalize","singleBinding","isComposing","matches","_this$quill$getLine2","keyboard_slicedToArray","_this$quill$getLeaf2","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","curFormats","prevFormats","formatDelta","nextFormats","firstFormats","lastFormats","lineFormats","makeCodeBlockHandler","code-block","textContent","makeEmbedArrowHandler","makeFormatHandler","makeTableArrowHandler","up","cell","targetRow","targetCell","targetLine","outdent","outdent backspace","indent code-block","outdent code-block","remove tab","tab","blockquote empty enter","list empty enter","checklist enter","_this$quill$getLine12","header enter","_this$quill$getLine14","header","table backspace","table delete","table enter","_module$getTable2","getTable","tableSide","table tab","list autofill","blockquote","_this$quill$getLine16","code exit","_this$quill$getLine18","numLines","embed left","embed left shift","embed right","embed right shift","table down","table up","Uploader","caretRangeFromPoint","clientX","clientY","caretPositionFromPoint","offsetNode","dataTransfer","uploads","file","mimetypes","promises","reader","FileReader","onload","result","readAsDataURL","all","images","image","blots/block","blots/block/embed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","modules/uploader","IndentClass","Blockquote","Header","ListContainer","ListItem","ui","ownerDocument","listEventHandler","attachUI","Bold","Italic","Link","sanitize","url","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","href","protocol","Script","Strike","Underline","Formula","katex","render","throwOnError","errorColor","formula","ATTRIBUTES","Image","thumbUrl","originUrl","hasAttribute","execCommand","Video","video","TokenAttributor","CodeToken","SyntaxCodeBlock","SyntaxCodeBlockContainer","forceNext","highlight","forced","cachedText","BreakBlot","Syntax","hljs","highlightBlot","initListener","initTimer","select","languages","label","option","timer","clearTimeout","interval","nodeText","TableCell","tableId","cellOffset","rowOffset","TableRow","thisHead","thisTail","nextHead","nextTail","childFormats","TableBody","TableContainer","balanceCells","rows","maxColumns","fill","cells","column","at","deleteColumn","table_slicedToArray","insertColumn","insertRow","id","random","Table","listenBalanceCells","balanceTables","_this$getTable2","modules_table_slicedToArray","deleteRow","deleteTable","_this$getTable8","insertColumnLeft","insertColumnRight","_this$getTable10","insertRowAbove","insertRowBelow","insertTable","columns","old","Toolbar","groups","controls","group","control","addButton","addSelect","addControls","addHandler","toolbar_slicedToArray","selectedIndex","selected","prompt","isActive","clean","direction","align","link","ui_icons","","alignLeftIcon","center","alignCenterIcon","alignRightIcon","justify","alignJustifyIcon","background","backgroundIcon","blockquoteIcon","boldIcon","cleanIcon","code","codeIcon","color","colorIcon","directionLeftToRightIcon","rtl","directionRightToLeftIcon","formulaIcon","1","headerIcon","2","header2Icon","italicIcon","imageIcon","+1","indentIcon","-1","outdentIcon","linkIcon","bullet","listBulletIcon","check","listCheckIcon","ordered","listOrderedIcon","script","sub","subscriptIcon","superscriptIcon","strikeIcon","tableIcon","underlineIcon","videoIcon","optionsCounter","toggleAriaAttribute","element","Picker","buildPicker","display","togglePicker","escape","buildItem","tabIndex","selectItem","buildLabel","DropdownIcon","buildOptions","close","trigger","dispatchEvent","Event","ColorPicker","backgroundColor","colorLabel","stroke","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","marginTop","hide","reference","offsetWidth","quillBounds","rootBounds","verticalShift","show","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","tooltip","textbox","pickers","picker","removeEventListener","extendToolbar","buildButtons","buttons","button","buildPickers","selects","fillSelect","edit","fileInput","click","BaseTooltip","save","cancel","preview","restoreFocus","linkRange","extractVideoUrl","defaultValue","TOOLBAR_CONFIG","BubbleTooltip","lastLine","indexBounds","arrow","marginLeft","BubbleTheme","SnowTooltip","_this$quill$scroll$de2","snow_slicedToArray","LinkBlot","linkHover","linkHide","SnowTheme","attributors/attribute/direction","attributors/class/align","attributors/class/background","attributors/class/color","attributors/class/direction","attributors/class/font","attributors/class/size","attributors/style/align","attributors/style/background","attributors/style/color","attributors/style/direction","attributors/style/font","attributors/style/size","formats/align","formats/direction","formats/indent","Indent","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","List","formats/bold","formats/code","InlineCode","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/formula","formats/image","formats/video","modules/syntax","modules/table","modules/toolbar","themes/bubble","themes/snow","ui/icons","Icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC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AC3Bwd,8BAA+B9c,GAC/B+c,yBAA0B7c,GAC1B8c,yBAA0B5c,GAE1B6c,0BAA2B/d,GAC3Bge,+BAAgCzd,GAChC0d,0BAA2B5d,GAC3B6d,8BAA+Bnd,GAC/Bod,yBAA0Bld,GAC1Bmd,yBAA0Bjd,KAE5B,GAGF/G,GAAM7X,SACJ,CACE87B,gBAAiBve,GACjBwe,oBAAqBxd,GACrByd,iBAAkBC,GAElBC,qBAAsBle,GACtBme,gBAAiBre,GACjBse,eAAgB3d,GAChB4d,eAAgB1d,GAEhB2d,qBAAsBvQ,GACtBwQ,qBAAsBpe,GACtBqe,iBAAkBxQ,GAClByQ,eAAgBC,GAEhBC,eAAgBpQ,GAChBqQ,eAAgBC,GAChBC,iBAAkBtQ,GAClBuQ,eAAgBtQ,GAChBuQ,iBAAkB9P,GAClB+P,iBAAkB9P,GAClB+P,oBAAqB9P,GAErB+P,kBAAmB9P,GACnB+P,gBAAiBxP,GACjByP,gBAAiBpP,GAEjBqP,iBAAkB1O,GAClB2O,gBAAiBrM,GACjBsM,kBAAmBtL,GAEnBuL,gBAAiBhD,GACjBiD,cAAe1C,GAEf2C,WAAYC,GACZC,YAAaxH,GACbyH,iBAAkBtG,GAClBuG,kBAAmB3G,GACnB4G,aAAcrG,KAEhB,GAGa9f","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 41);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar deep_equal_1 = __importDefault(require(\"deep-equal\"));\nvar extend_1 = __importDefault(require(\"extend\"));\nvar fast_diff_1 = __importDefault(require(\"fast-diff\"));\nvar AttributeMap_1 = __importDefault(require(\"./AttributeMap\"));\nvar Op_1 = __importDefault(require(\"./Op\"));\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\nvar Delta = /** @class */ (function () {\n function Delta(ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n }\n else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n }\n else {\n this.ops = [];\n }\n }\n Delta.prototype.insert = function (arg, attributes) {\n var newOp = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n };\n Delta.prototype.delete = function (length) {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n };\n Delta.prototype.retain = function (length, attributes) {\n if (length <= 0) {\n return this;\n }\n var newOp = { retain: length };\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n };\n Delta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend_1.default(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number') {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (deep_equal_1.default(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n else if (typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n }\n else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n };\n Delta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n };\n Delta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n };\n Delta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n };\n Delta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n };\n Delta.prototype.partition = function (predicate) {\n var passed = [];\n var failed = [];\n this.forEach(function (op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n };\n Delta.prototype.reduce = function (predicate, initialValue) {\n return this.ops.reduce(predicate, initialValue);\n };\n Delta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + Op_1.default.length(elem);\n }\n else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n };\n Delta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + Op_1.default.length(elem);\n }, 0);\n };\n Delta.prototype.slice = function (start, end) {\n if (start === void 0) { start = 0; }\n if (end === void 0) { end = Infinity; }\n var ops = [];\n var iter = Op_1.default.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp = void 0;\n if (index < start) {\n nextOp = iter.next(start - index);\n }\n else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op_1.default.length(nextOp);\n }\n return new Delta(ops);\n };\n Delta.prototype.compose = function (other) {\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n var ops = [];\n var firstOther = otherIter.peek();\n if (firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null) {\n var firstLeft = firstOther.retain;\n while (thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n var delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n }\n else {\n var length_1 = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length_1);\n var otherOp = otherIter.next(length_1);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length_1;\n }\n else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n // Optimization if rest of other is just retain\n if (!otherIter.hasNext() &&\n deep_equal_1.default(delta.ops[delta.ops.length - 1], newOp)) {\n var rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n }\n else if (typeof otherOp.delete === 'number' &&\n typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n };\n Delta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n };\n Delta.prototype.diff = function (other, cursor) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta\n .map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n var retDelta = new Delta();\n var diffResult = fast_diff_1.default(strings[0], strings[1], cursor);\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case fast_diff_1.default.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case fast_diff_1.default.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case fast_diff_1.default.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (deep_equal_1.default(thisOp.insert, otherOp.insert)) {\n retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes));\n }\n else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n };\n Delta.prototype.eachLine = function (predicate, newline) {\n if (newline === void 0) { newline = '\\n'; }\n var iter = Op_1.default.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n var thisOp = iter.peek();\n var start = Op_1.default.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n }\n else if (index > 0) {\n line.push(iter.next(index));\n }\n else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n };\n Delta.prototype.invert = function (base) {\n var inverted = new Delta();\n this.reduce(function (baseIndex, op) {\n if (op.insert) {\n inverted.delete(Op_1.default.length(op));\n }\n else if (op.retain && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n }\n else if (op.delete || (op.retain && op.attributes)) {\n var length_2 = (op.delete || op.retain);\n var slice = base.slice(baseIndex, baseIndex + length_2);\n slice.forEach(function (baseOp) {\n if (op.delete) {\n inverted.push(baseOp);\n }\n else if (op.retain && op.attributes) {\n inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes));\n }\n });\n return baseIndex + length_2;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n };\n Delta.prototype.transform = function (arg, priority) {\n if (priority === void 0) { priority = false; }\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n var other = arg;\n var thisIter = Op_1.default.iterator(this.ops);\n var otherIter = Op_1.default.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(Op_1.default.length(thisIter.next()));\n }\n else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else {\n var length_3 = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length_3);\n var otherOp = otherIter.next(length_3);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n }\n else if (otherOp.delete) {\n delta.push(otherOp);\n }\n else {\n // We retain either their retain or insert\n delta.retain(length_3, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n };\n Delta.prototype.transformPosition = function (index, priority) {\n if (priority === void 0) { priority = false; }\n priority = !!priority;\n var thisIter = Op_1.default.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length_4 = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length_4, index - offset);\n continue;\n }\n else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length_4;\n }\n offset += length_4;\n }\n return index;\n };\n Delta.Op = Op_1.default;\n Delta.AttributeMap = AttributeMap_1.default;\n return Delta;\n}());\nmodule.exports = Delta;\n//# sourceMappingURL=Delta.js.map","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n","module.exports = \" \";","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Iterator_1 = __importDefault(require(\"./Iterator\"));\nvar Op;\n(function (Op) {\n function iterator(ops) {\n return new Iterator_1.default(ops);\n }\n Op.iterator = iterator;\n function length(op) {\n if (typeof op.delete === 'number') {\n return op.delete;\n }\n else if (typeof op.retain === 'number') {\n return op.retain;\n }\n else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n Op.length = length;\n})(Op || (Op = {}));\nexports.default = Op;\n//# sourceMappingURL=Op.js.map","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","module.exports = \" \";","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar deep_equal_1 = __importDefault(require(\"deep-equal\"));\nvar extend_1 = __importDefault(require(\"extend\"));\nvar AttributeMap;\n(function (AttributeMap) {\n function compose(a, b, keepNull) {\n if (a === void 0) { a = {}; }\n if (b === void 0) { b = {}; }\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n var attributes = extend_1.default(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.compose = compose;\n function diff(a, b) {\n if (a === void 0) { a = {}; }\n if (b === void 0) { b = {}; }\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n var attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce(function (attrs, key) {\n if (!deep_equal_1.default(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.diff = diff;\n function invert(attr, base) {\n if (attr === void 0) { attr = {}; }\n if (base === void 0) { base = {}; }\n attr = attr || {};\n var baseInverted = Object.keys(base).reduce(function (memo, key) {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce(function (memo, key) {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n AttributeMap.invert = invert;\n function transform(a, b, priority) {\n if (priority === void 0) { priority = false; }\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n var attributes = Object.keys(b).reduce(function (attrs, key) {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.transform = transform;\n})(AttributeMap || (AttributeMap = {}));\nexports.default = AttributeMap;\n//# sourceMappingURL=AttributeMap.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Op_1 = __importDefault(require(\"./Op\"));\nvar Iterator = /** @class */ (function () {\n function Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n Iterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n };\n Iterator.prototype.next = function (length) {\n if (!length) {\n length = Infinity;\n }\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = Op_1.default.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n }\n else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n }\n else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n }\n else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n }\n else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n }\n else {\n return { retain: Infinity };\n }\n };\n Iterator.prototype.peek = function () {\n return this.ops[this.index];\n };\n Iterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op_1.default.length(this.ops[this.index]) - this.offset;\n }\n else {\n return Infinity;\n }\n };\n Iterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index].delete === 'number') {\n return 'delete';\n }\n else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n }\n else {\n return 'insert';\n }\n }\n return 'retain';\n };\n Iterator.prototype.rest = function () {\n if (!this.hasNext()) {\n return [];\n }\n else if (this.offset === 0) {\n return this.ops.slice(this.index);\n }\n else {\n var offset = this.offset;\n var index = this.index;\n var next = this.next();\n var rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n };\n return Iterator;\n}());\nexports.default = Iterator;\n//# sourceMappingURL=Iterator.js.map","enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n","import LinkedNode from './linked-node';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive: boolean = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n","export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n","import Attributor from './attributor/attributor';\nimport { Blot, BlotConstructor, Root } from './blot/abstract/blot';\nimport ParchmentError from './error';\nimport Scope from './scope';\n\nexport interface RegistryInterface {\n create(sroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(\n query: string | Node | Scope,\n scope: Scope,\n ): Attributor | BlotConstructor | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node: Node | null, bubble: boolean = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n return this.find(node.parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: Attributor | BlotConstructor } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-ignore\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble: boolean = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): Attributor | BlotConstructor | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-ignore\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof HTMLElement) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some(name => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: any[]): any {\n if (definitions.length > 1) {\n return definitions.map(d => {\n return this.register(d);\n });\n }\n const definition = definitions[0];\n if (\n typeof definition.blotName !== 'string' &&\n typeof definition.attrName !== 'string'\n ) {\n throw new ParchmentError('Invalid definition');\n } else if (definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n this.types[definition.blotName || definition.attrName] = definition;\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n } else {\n if (definition.className != null) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName != null) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n }\n}\n","import ParchmentError from '../../error';\nimport Registry from '../../registry';\nimport Scope from '../../scope';\nimport { Blot, BlotConstructor, Formattable, Parent, Root } from './blot';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string;\n\n public static create(value: any): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-ignore\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(public scroll: Root, public domNode: Node) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach() {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n","import LinkedList from '../../collection/linked-list';\nimport ParchmentError from '../../error';\nimport Scope from '../../scope';\nimport { Blot, BlotConstructor, Parent, Root } from './blot';\nimport ShadowBlot from './shadow';\n\nclass ParentBlot extends ShadowBlot implements Parent {\n public static allowedChildren: BlotConstructor[] | null;\n public static defaultChild: BlotConstructor | null;\n public static uiClass: string = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach(child => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement) {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: { new (): Blot },\n index: number,\n ): [Blot | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index: number = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: { new (): Blot },\n index: number,\n length: number,\n ): Blot[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index: number,\n length: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index: number = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach(child => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren() {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.parent = this;\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot): void {\n this.children.forEach(child => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(\n index: number,\n inclusive: boolean = false,\n ): Array<[Blot, number]> {\n const [child, offset] = this.children.find(index, inclusive);\n const position: Array<[Blot, number]> = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force: boolean = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach(mutation => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter(node => {\n return node.parentNode === this.domNode || node === this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(node => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n let blot = scroll.find(node);\n if (blot == null) {\n try {\n blot = scroll.create(node);\n } catch (e) {\n blot = scroll.create(Scope.INLINE) as Blot;\n Array.from(node.childNodes).forEach((child: Node) => {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot as Blot;\n}\n\nexport default ParentBlot;\n","import Scope from '../../scope';\nimport BlockBlot from '../block';\nimport ParentBlot from './parent';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string;\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n","import Scope from '../../scope';\nimport { Leaf } from './blot';\nimport ShadowBlot from './shadow';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n public static value(_domNode: Node): any {\n return true;\n }\n\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n","import Scope from '../scope';\n\nexport interface IAttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public attrName: string;\n public keyName: string;\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n attrName: string,\n keyName: string,\n options: IAttributorOptions = {},\n ) {\n this.attrName = attrName;\n this.keyName = keyName;\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): string {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n","import Attributor from './attributor';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter(name => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '').split(/\\s+/).map(name =>\n name\n .split('-')\n .slice(0, -1)\n .join('-'),\n );\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach(name => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): string {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n","import Attributor from './attributor';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: Element): string[] {\n return (node.getAttribute('style') || '').split(';').map(value => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: string): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): string {\n // @ts-ignore\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n","import { Formattable } from '../blot/abstract/blot';\nimport Registry from '../registry';\nimport Scope from '../scope';\nimport Attributor from './attributor';\nimport ClassAttributor from './class';\nimport StyleAttributor from './style';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(name => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach(key => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach(key => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n","import Attributor from '../attributor/attributor';\nimport AttributorStore from '../attributor/store';\nimport Scope from '../scope';\nimport {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\nimport ParentBlot from './abstract/parent';\n\n// Shallow object comparison\nfunction isEqual(obj1: object, obj2: object): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n // @ts-ignore\n for (const prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName = 'SPAN';\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any) {\n if (name === this.statics.blotName && !value) {\n this.children.forEach(child => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n mutation =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n","import Attributor from '../attributor/attributor';\nimport AttributorStore from '../attributor/store';\nimport Scope from '../scope';\nimport { Blot, BlotConstructor, Formattable, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\nimport ParentBlot from './abstract/parent';\nimport InlineBlot from './inline';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any) {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n mutation =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n","import { Formattable, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n","import Attributor from '../attributor/attributor';\nimport Registry from '../registry';\nimport Scope from '../scope';\nimport { Blot, BlotConstructor, Root } from './abstract/blot';\nimport ContainerBlot from './abstract/container';\nimport ParentBlot from './abstract/parent';\nimport BlockBlot from './block';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public registry: Registry;\n public observer: MutationObserver;\n\n constructor(registry: Registry, node: HTMLDivElement) {\n // @ts-ignore\n super(null, node);\n this.registry = registry;\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble: boolean = false): Blot | null {\n return this.registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): Attributor | BlotConstructor | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: any[]): any {\n return this.registry.register(...definitions);\n }\n\n public build() {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach() {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(child => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent: boolean = true) => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot) => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = Registry.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n","import Scope from '../scope';\nimport { Blot, Leaf, Root } from './abstract/blot';\nimport LeafBlot from './abstract/leaf';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive: boolean = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force: boolean = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some(mutation => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n","export default new WeakMap();\n","const levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce((logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\nnamespace.level = newLevel => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n","import EventEmitter from 'eventemitter3';\nimport instances from './instances';\nimport logger from './logger';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(eventName => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach(node => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args) {\n debug.log.call(debug, ...args);\n super.emit(...args);\n }\n\n handleDOM(event, ...args) {\n (this.listeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler });\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n};\n\nexport default Emitter;\n","import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n","import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text) {\n return text.replace(/[&<>\"']/g, s => {\n // https://lodash.com/docs#escape\n const entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n","import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport Break from './break';\nimport Text from './text';\n\nclass Inline extends InlineBlot {\n static compare(self, other) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index, length, name, value) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Break, EmbedBlot, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor',\n 'inline', // Must be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'link',\n 'code', // Must be higher\n];\n\nexport default Inline;\n","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n constructor(scroll, domNode) {\n super(scroll, domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce((lineIndex, line) => {\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(\n this.value(),\n extend(this.formats(), this.attributes.values()),\n );\n }\n\n format(name, value) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n const block = this.scroll.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(blot, formats = {}, filter = true) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n","import { LeafBlot, Scope } from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\nimport Break from '../blots/break';\nimport Block from '../blots/block';\n\nconst debug = logger('quill:selection');\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n this.update(Emitter.sources.SILENT);\n } catch (ignored) {\n // ignore\n }\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.root.classList.toggle('ql-blank', false);\n this.composing = true;\n this.scroll.batchStart();\n });\n this.root.addEventListener('compositionend', () => {\n setTimeout(() => {\n this.root.classList.toggle('ql-blank', this.isBlank());\n this.scroll.batchEnd();\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n }, 1);\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange() {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return (\n document.activeElement === this.root ||\n contains(this.root, document.activeElement)\n );\n }\n\n normalizedToRange(range) {\n const positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map(position => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach(position => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n const indexes = range.collapsed\n ? [range.index]\n : [range.index, range.index + range.length];\n const args = [];\n const scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n const [node, offset] = leaf.position(leafOffset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n return args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n const range = this.lastRange;\n if (range == null) return;\n const bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n const limit = this.scroll.length() - 1;\n const [first] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n const scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n\n setNativeRange(\n startNode,\n startOffset,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode.tagName === 'BR') {\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode.tagName === 'BR') {\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n clone(this.lastRange),\n clone(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport { Range, Selection as default };\n","import { EmbedBlot, Scope } from 'parchment';\nimport TextBlot from './text';\n\nclass Cursor extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n constructor(scroll, domNode, selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n let target = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Link format will insert text outside of anchor tag\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node, offset) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations, context) {\n if (\n mutations.some(mutation => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\nexport default Cursor;\n","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { LeafBlot } from 'parchment';\nimport { Range } from './selection';\nimport CursorBlot from '../blots/cursor';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\nimport TextBlot, { escapeText } from '../blots/text';\n\nconst ASCII = /^[ -~]*$/;\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n normalizedDelta.reduce((index, op) => {\n const length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (\n (index >= scrollLength ||\n this.scroll.descendant(BlockEmbed, index)[0]) &&\n !text.endsWith('\\n')\n ) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(name => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n normalizedDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach(format => {\n this.scroll.lines(index, Math.max(length, 1)).forEach(line => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, clone(formats));\n return this.update(delta);\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, clone(formats));\n return this.update(delta);\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [];\n let leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(path => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const formatsArr = [lines, leaves].map(blots => {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getHTML(index, length) {\n const [line, lineOffset] = this.scroll.line(index);\n if (line.length() >= lineOffset + length) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n\n getText(index, length) {\n return this.getContents(index, length)\n .filter(op => typeof op.insert === 'string')\n .map(op => op.insert)\n .join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], selectionInfo = undefined) {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target);\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\nfunction convertListHTML(items, lastIndent, types) {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(blot, index, length, isRoot = false) {\n if (typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot.children) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats = child.formats();\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode.outerHTML;\n}\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce((merged, name) => {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction getListType(type) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }, amount) {\n return new Range(index + amount, length);\n}\n\nexport default Editor;\n","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\nexport default Module;\n","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach(name => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {},\n};\nTheme.themes = {\n default: Theme,\n};\n\nexport default Theme;\n","import Delta from 'quill-delta';\nimport * as Parchment from 'parchment';\nimport extend from 'extend';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Selection, { Range } from './selection';\nimport instances from './instances';\nimport logger from './logger';\nimport Theme from './theme';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return instances.get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n const ScrollBlot = this.options.registry.query(\n Parchment.ScrollBlot.blotName,\n );\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, type => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const { scrollTop } = this.scrollingContainer;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args) {\n return this.emitter.off(...args);\n }\n\n on(...args) {\n return this.emitter.on(...args);\n }\n\n once(...args) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n if (\n lastOp != null &&\n typeof lastOp.insert === 'string' &&\n lastOp.insert[lastOp.insert.length - 1] === '\\n'\n ) {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n return deleted.compose(applied);\n },\n source,\n );\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n },\n source,\n true,\n );\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default',\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(\n true,\n {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n },\n userConfig,\n );\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(\n `Invalid theme ${userConfig.theme}. Did you register it?`,\n );\n }\n }\n const themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(\n Object.keys(userConfig.modules),\n );\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (\n userConfig.modules != null &&\n userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object\n ) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar,\n };\n }\n userConfig = extend(\n true,\n {},\n Quill.DEFAULTS,\n { modules: moduleConfig },\n themeConfig,\n userConfig,\n );\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(\n (config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n },\n {},\n );\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(pos =>\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map(pos => {\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n","import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n","import { EmbedBlot } from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nclass Embed extends EmbedBlot {\n constructor(scroll, node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n Array.from(this.domNode.childNodes).forEach(childNode => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range;\n let textNode;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach(mutation => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n","import { Scope, ScrollBlot, ContainerBlot } from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport Container from './container';\n\nfunction isLine(blot) {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\nclass Scroll extends ScrollBlot {\n constructor(registry, domNode, { emitter }) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', e => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n deleteAt(index, length) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n handleDragStart(event) {\n event.preventDefault();\n }\n\n insertAt(index, value, def) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(this.statics.defaultChild.blotName);\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n const getLines = (blot, blotIndex, blotLength) => {\n let lines = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(mutations) {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = Block;\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\nexport default Scroll;\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map(component => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n","import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n","import Block from '../blots/block';\nimport Break from '../blots/break';\nimport Cursor from '../blots/cursor';\nimport Inline from '../blots/inline';\nimport TextBlot, { escapeText } from '../blots/text';\nimport Container from '../blots/container';\nimport Quill from '../core/quill';\n\nclass CodeBlockContainer extends Container {\n static create(value) {\n const domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n html(index, length) {\n const text = this.children\n .map(child => child.domNode.innerText)\n .join('\\n')\n .slice(index, index + length);\n return `
    ${escapeText(text)}
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\nCodeBlock.TAB = ' ';\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport {\n Attributor,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n BlockBlot,\n} from 'parchment';\nimport { BlockEmbed } from '../blots/block';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nconst debug = logger('quill:clipboard');\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('copy', e => this.onCaptureCopy(e, false));\n this.quill.root.addEventListener('cut', e => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert({ html, text }, formats = {}) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text, {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '');\n }\n const doc = new DOMParser().parseFromString(html, 'text/html');\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n const delta = traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData.setData('text/plain', text);\n e.clipboardData.setData('text/html', html);\n if (isCut) {\n this.quill.deleteText(range, Quill.sources.USER);\n }\n }\n\n onCapturePaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n e.stopPropagation();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData.getData('text/html');\n const text = e.clipboardData.getData('text/plain');\n const files = Array.from(e.clipboardData.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n } else {\n this.onPaste(range, { html, text });\n }\n }\n\n onCopy(range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range, { text, html }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollIntoView();\n }\n\n prepareMatching(container, nodeMatches) {\n const elementMatchers = [];\n const textMatchers = [];\n this.matchers.forEach(pair => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach(node => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n};\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce((newDelta, key) => {\n return applyFormat(newDelta, key, format[key]);\n }, delta);\n }\n return delta.reduce((newDelta, op) => {\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n return newDelta.insert(\n op.insert,\n extend({}, { [format]: value }, op.attributes),\n );\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(scroll, node, elementMatchers, textMatchers, nodeMatches) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta, scroll) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(name => {\n let attr = scroll.query(name, Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n return applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta, scroll) {\n const match = scroll.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n const value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (typeof match.formats === 'function') {\n return applyFormat(delta, match.blotName, match.formats(node, scroll));\n }\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node, delta, scroll) {\n const match = scroll.query('code-block');\n const language = match ? match.formats(node, scroll) : true;\n return applyFormat(delta, 'code-block', language);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta, scroll) {\n const match = scroll.query(node);\n if (\n match == null ||\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (op.attributes && op.attributes.list) {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node, delta) {\n const list = node.tagName === 'OL' ? 'ordered' : 'bullet';\n return applyFormat(delta, 'list', list);\n}\n\nfunction matchNewline(node, delta, scroll) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node)) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let { nextSibling } = node;\n while (nextSibling != null) {\n if (isLine(nextSibling)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n const formats = {};\n const style = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight.startsWith('bold') ||\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(node, delta) {\n const table =\n node.parentNode.tagName === 'TABLE'\n ? node.parentNode\n : node.parentNode.parentNode;\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row);\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && text.includes('\\n')) {\n return delta;\n }\n if (!isPre(node)) {\n const replacer = (collapse, match) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n","import { Scope } from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n },\n );\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n const delta = this.stack[source].pop();\n const base = this.quill.getContents();\n const inverseDelta = delta.invert(base);\n this.stack[dest].push(inverseDelta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta, Quill.sources.USER);\n this.ignoreChange = false;\n const index = getLastChangeIndex(this.quill.scroll, delta);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n const timestamp = Date.now();\n if (\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta);\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push(undoDelta);\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n};\n\nfunction transformStack(stack, delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldDelta = stack[i];\n stack[i] = remoteDelta.transform(oldDelta, true);\n remoteDelta = oldDelta.transform(remoteDelta);\n if (stack[i].length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll, delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(attr => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll, delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexport { History as default, getLastChangeIndex };\n","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n if (\n ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(key => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach(name => {\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(keyBinding, context = {}, handler = {}) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach(key => {\n const singleBinding = extend({}, binding, { key }, context, handler);\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', evt => {\n if (evt.defaultPrevented || evt.isComposing) return;\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter(binding => Keyboard.match(evt, binding));\n if (matches.length === 0) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some(binding => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(name => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every(name => {\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range, context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range, context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range) {\n const lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n }\n\n handleEnter(range, context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n\n Object.keys(context.format).forEach(name => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'code' || name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n }\n}\n\nKeyboard.DEFAULTS = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = extend({}, line.formats(), { list: 'checked' });\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n list: false,\n 'code-block': false,\n blockquote: false,\n header: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range) {\n const CodeBlock = this.quill.scroll.query('code-block');\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, CodeBlock.TAB);\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.domNode.textContent.startsWith(CodeBlock.TAB)) {\n line.deleteAt(0, CodeBlock.TAB.length);\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up) {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = clone(binding, false);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nfunction tableSide(table, row, cell, offset) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize };\n","import Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Module from '../core/module';\n\nclass Uploader extends Module {\n constructor(quill, options) {\n super(quill, options);\n quill.root.addEventListener('drop', e => {\n e.preventDefault();\n let native;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n } else if (document.caretPositionFromPoint) {\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n } else {\n return;\n }\n const normalized = quill.selection.normalizeNative(native);\n const range = quill.selection.normalizedToRange(normalized);\n this.upload(range, e.dataTransfer.files);\n });\n }\n\n upload(range, files) {\n const uploads = [];\n Array.from(files).forEach(file => {\n if (file && this.options.mimetypes.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range, files) {\n const promises = files.map(file => {\n return new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = e => {\n resolve(e.target.result);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then(images => {\n const update = images.reduce((delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length));\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n","import Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\nimport Uploader from './modules/uploader';\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n});\n\nexport default Quill;\n","import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, value);\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n","import Block from '../blots/block';\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexport default Blockquote;\n","import Block from '../blots/block';\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexport default Header;\n","import Block from '../blots/block';\nimport Container from '../blots/container';\nimport Quill from '../core/quill';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value) {\n const node = super.create();\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll, domNode) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = e => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n","import Bold from './bold';\n\nclass Italic extends Bold {}\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n","import Inline from '../blots/inline';\n\nclass Link extends Inline {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction sanitize(url, protocols) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n","import Inline from '../blots/inline';\n\nclass Strike extends Inline {}\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n","import Inline from '../blots/inline';\n\nclass Underline extends Inline {}\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n","import Embed from '../blots/embed';\n\nclass Formula extends Embed {\n static create(value) {\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\nFormula.blotName = 'formula';\nFormula.className = 'ql-formula';\nFormula.tagName = 'SPAN';\n\nexport default Formula;\n","import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static create(value) {\n const node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n node.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n if (value.originUrl) {\n node.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n node.setAttribute('data-fancybox-type', 'image');\n node.setAttribute('data-fancybox-group', 'editor');\n node.classList.add('fancybox');\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexport default Image;\n","import { BlockEmbed } from '../blots/block';\nimport Link from './link';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url); // eslint-disable-line import/no-named-as-default-member\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexport default Video;\n","import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport Inline from '../blots/inline';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport { blockDelta } from '../blots/block';\nimport BreakBlot from '../blots/break';\nimport CursorBlot from '../blots/cursor';\nimport TextBlot, { escapeText } from '../blots/text';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code';\nimport { traverse } from './clipboard';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node, scroll) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList.contains(CodeBlock.className)) {\n return super.formats(node, scroll);\n }\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll, domNode, value) {\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format, value) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args) {\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name, value) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name, value) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n attach() {\n super.attach();\n this.forceNext = false;\n this.scroll.emitMount(this);\n }\n\n format(name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach(child => {\n child.format(name, value);\n });\n }\n }\n\n formatAt(index, length, name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(highlight, forced = false) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n node => node !== this.uiNode,\n );\n const text = `${nodes.map(node => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach(format => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (language !== this.uiNode.value) {\n this.uiNode.value = language;\n }\n }\n }\n}\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\nclass Syntax extends Module {\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n constructor(quill, options) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, blot => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach(container => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text, language = 'plain') {\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = this.options.hljs.highlight(language, text).value;\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'Javascript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n","import Block from '../blots/block';\nimport Container from '../blots/container';\n\nclass TableCell extends Block {\n static create(value) {\n const node = super.create();\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name, value) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row() {\n return this.parent;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\nTableCell.blotName = 'table';\nTableCell.tagName = 'TD';\n\nclass TableRow extends Container {\n checkMerge() {\n if (super.checkMerge() && this.next.children.head != null) {\n const thisHead = this.children.head.formats();\n const thisTail = this.children.tail.formats();\n const nextHead = this.next.children.head.formats();\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(...args) {\n super.optimize(...args);\n this.children.forEach(child => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\nTableRow.blotName = 'table-row';\nTableRow.tagName = 'TR';\n\nclass TableBody extends Container {}\nTableBody.blotName = 'table-body';\nTableBody.tagName = 'TBODY';\n\nclass TableContainer extends Container {\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach(row => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column) {\n return this.rows().map(row => row.children.at(column));\n }\n\n deleteColumn(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const ref = row.children.at(index);\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index) {\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName);\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map(row => row);\n }\n}\nTableContainer.blotName = 'table-container';\nTableContainer.tagName = 'TABLE';\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random()\n .toString(36)\n .slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n","import Delta from 'quill-delta';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach(table => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n const offset = table.offset();\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(range = this.quill.getSelection()) {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n return [table, row, cell, offset];\n }\n\n insertColumn(offset) {\n const range = this.quill.getSelection();\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset) {\n const range = this.quill.getSelection();\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows, columns) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce(memo => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, mutations => {\n mutations.some(mutation => {\n if (['TD', 'TR', 'TBODY', 'TABLE'].includes(mutation.target.tagName)) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n });\n }\n}\n\nexport default Table;\n","import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst debug = logger('quill:toolbar');\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach(format => {\n this.addHandler(format, this.options.handlers[format]);\n });\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n input => {\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = Array.from(input.classList).find(className => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, e => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(pair => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const isActive =\n formats[format] === input.getAttribute('value') ||\n (formats[format] != null &&\n formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(controls => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(control => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach(value => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach(name => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n","import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n","import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(\n attribute,\n !(element.getAttribute(attribute) === 'true'),\n );\n}\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option) {\n const item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n Array.from(this.select.options).forEach(option => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach(item => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item = this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n","import Picker from './picker';\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach(item => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n","import Picker from './picker';\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n item => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target, trigger) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\nexport default IconPicker;\n","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n const quillBounds = this.quill.root.getBoundingClientRect();\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n if (left < 0) {\n left = 8;\n }\n if (left > quillBounds.width - rootBounds.width - 8) {\n left = quillBounds.width - rootBounds.width - 8;\n }\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n const listener = e => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(picker => {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n Array.from(buttons).forEach(button => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(name => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n const value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = Array.from(selects).map(select => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format]);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach(picker => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n const { scrollTop } = this.quill.scrollingContainer;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n\n save() {\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(value => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n this.position(indexBounds);\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n].join('');\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n});\n\nexport { BubbleTooltip, BubbleTheme as default };\n","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', event => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', event => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.quill.options.linkHover(link.domNode, this.linkRange);\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.quill.options.linkHide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n '',\n].join('');\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (range, context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n },\n },\n },\n },\n});\n\nexport default SnowTheme;\n","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction';\nimport Indent from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Formula from './formats/formula';\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Syntax from './modules/syntax';\nimport Table from './modules/table';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport default Quill;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/quill.snow.css b/dist/quill.snow.css index 0971469363..3cfaed030a 100644 --- a/dist/quill.snow.css +++ b/dist/quill.snow.css @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com diff --git a/dist/unit.js b/dist/unit.js index 086f0d4d94..98f8839dd3 100644 --- a/dist/unit.js +++ b/dist/unit.js @@ -1,5 +1,5 @@ /*! - * Quill Editor v2.0.12 + * Quill Editor v2.0.14 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com @@ -608,7 +608,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nclass Module {\n constructor /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


    \"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.12\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"globalRegistry\", function() { return globalRegistry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expandConfig\", function() { return expandConfig; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"overload\", function() { return overload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Quill; });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\n\n\n\nconst debug = Object(_logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_1__[\"Registry\"]();\nparchment__WEBPACK_IMPORTED_MODULE_1__[\"ParentBlot\"].uiClass = 'ql-ui';\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_8__[\"default\"].level(limit);\n }\n\n static find(node) {\n return _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].get(node) || globalRegistry.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(\"Cannot import \".concat(name, \". Are you sure it was registered?\"));\n }\n\n return this.imports[name];\n }\n\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n const name = path.attrName || path.blotName;\n\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register(\"formats/\".concat(name), path, target);\n } else {\n Object.keys(path).forEach(key => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(\"Overwriting \".concat(path, \" with\"), target);\n }\n\n this.imports[path] = target;\n\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_7__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_1__[\"ScrollBlot\"].blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n\n const _this$selection$getRa = this.selection.getRange(),\n _this$selection$getRa2 = _slicedToArray(_this$selection$getRa, 1),\n newRange = _this$selection$getRa2[0];\n\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n const contents = this.clipboard.convert({\n html: \"\".concat(html, \"


    \"),\n text: '\\n'\n });\n this.setContents(contents);\n this.history.clear();\n\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n\n if (this.options.readOnly) {\n this.disable();\n }\n\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n const scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n if (range == null) return change;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__[\"Scope\"].BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds;\n\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n return this.editor.getContents(index, length);\n }\n\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n\n return this.scroll.lines(index, length);\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n return this.editor.getHTML(index, length);\n }\n\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload11 = overload(index, length);\n\n var _overload12 = _slicedToArray(_overload11, 2);\n\n index = _overload12[0];\n length = _overload12[1];\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats; // eslint-disable-next-line prefer-const\n\n var _overload13 = overload(index, 0, name, value, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n formats = _overload14[2];\n source = _overload14[3];\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off() {\n return this.emitter.off(...arguments);\n }\n\n on() {\n return this.emitter.on(...arguments);\n }\n\n once() {\n return this.emitter.once(...arguments);\n }\n\n removeFormat(index, length, source) {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n const length = this.getLength();\n const deleted = this.editor.deleteText(0, length);\n const applied = this.editor.applyDelta(delta);\n const lastOp = applied.ops[applied.ops.length - 1];\n\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n\n return deleted.compose(applied);\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload17 = overload(index, length, source);\n\n var _overload18 = _slicedToArray(_overload17, 4);\n\n index = _overload18[0];\n length = _overload18[1];\n source = _overload18[3];\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](Math.max(0, index), length), source);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a().insert(text);\n return this.setContents(delta, source);\n }\n\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\n this.selection.update(source); // TODO this is usually undefined\n\n return change;\n }\n\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n\n}\n\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n scrollingContainer: null,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources; // eslint-disable-next-line no-undef\n\nQuill.version = false ? undefined : \"2.0.14\";\nQuill.imports = {\n delta: quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a,\n parchment: parchment__WEBPACK_IMPORTED_MODULE_1__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n } else {\n userConfig.theme = Quill.import(\"themes/\".concat(userConfig.theme));\n\n if (userConfig.theme == null) {\n throw new Error(\"Invalid theme \".concat(userConfig.theme, \". Did you register it?\"));\n }\n }\n\n const themeConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(\"modules/\".concat(name));\n\n if (moduleClass == null) {\n debug.error(\"Cannot load \".concat(name, \" module. Are you sure you registered it?\"));\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n\n return config;\n }, {}); // Special case toolbar shorthand\n\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n\n userConfig = extend__WEBPACK_IMPORTED_MODULE_2___default()(true, {}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(key => {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce((config, name) => {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n\n return config;\n }, {});\n return userConfig;\n} // Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\n\n\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a();\n }\n\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].events.EDITOR_CHANGE, ...args);\n\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n length = index.length; // eslint-disable-line prefer-destructuring\n\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n source = value;\n value = name;\n name = length;\n length = 0;\n } // Handle format being object, two format name/value strings or excluded\n\n\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n } // Handle optional source\n\n\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start;\n let end;\n\n if (index instanceof quill_delta__WEBPACK_IMPORTED_MODULE_0___default.a) {\n var _map = [range.index, range.index + range.length].map(pos => index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER));\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(pos => {\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER) return pos;\n\n if (length >= 0) {\n return pos + length;\n }\n\n return Math.max(index, pos + length);\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n\n return new _selection__WEBPACK_IMPORTED_MODULE_6__[\"Range\"](start, end - start);\n}\n\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); /***/ }), @@ -764,7 +764,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blo /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static create(value) {\n const node = super.create(value);\n const span = document.createElement('span');\n\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n span.setAttribute('href', this.sanitize(value));\n span.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n\n if (value.originUrl) {\n span.setAttribute('href', this.sanitize(value.originUrl));\n span.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n\n span.setAttribute('data-fancybox-type', 'image');\n span.setAttribute('data-fancybox-group', 'editor');\n span.classList.add('fancybox');\n span.appendChild(node);\n return span;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return Object(_link__WEBPACK_IMPORTED_MODULE_1__[\"sanitize\"])(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n}\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Image);\n\n//# sourceURL=webpack://Quill/./formats/image.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static create(value) {\n const node = super.create(value);\n\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n node.setAttribute('data-fancybox-href', this.sanitize(value));\n }\n\n if (value.thumbUrl) {\n node.setAttribute('src', this.sanitize(value.thumbUrl));\n }\n\n if (value.originUrl) {\n node.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));\n }\n\n node.setAttribute('data-fancybox-type', 'image');\n node.setAttribute('data-fancybox-group', 'editor');\n node.classList.add('fancybox');\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n\n static sanitize(url) {\n return Object(_link__WEBPACK_IMPORTED_MODULE_1__[\"sanitize\"])(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n}\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Image);\n\n//# sourceURL=webpack://Quill/./formats/image.js?"); /***/ }), diff --git a/formats/image.js b/formats/image.js index 34aaf34d7a..4d347edb80 100644 --- a/formats/image.js +++ b/formats/image.js @@ -6,24 +6,20 @@ const ATTRIBUTES = ['alt', 'height', 'width']; class Image extends EmbedBlot { static create(value) { const node = super.create(value); - const span = document.createElement('span'); if (typeof value === 'string') { node.setAttribute('src', this.sanitize(value)); - span.setAttribute('href', this.sanitize(value)); - span.setAttribute('data-fancybox-href', this.sanitize(value)); + node.setAttribute('data-fancybox-href', this.sanitize(value)); } if (value.thumbUrl) { node.setAttribute('src', this.sanitize(value.thumbUrl)); } if (value.originUrl) { - span.setAttribute('href', this.sanitize(value.originUrl)); - span.setAttribute('data-fancybox-href', this.sanitize(value.originUrl)); + node.setAttribute('data-fancybox-href', this.sanitize(value.originUrl)); } - span.setAttribute('data-fancybox-type', 'image'); - span.setAttribute('data-fancybox-group', 'editor'); - span.classList.add('fancybox'); - span.appendChild(node); - return span; + node.setAttribute('data-fancybox-type', 'image'); + node.setAttribute('data-fancybox-group', 'editor'); + node.classList.add('fancybox'); + return node; } static formats(domNode) { diff --git a/package.json b/package.json index a8d4291612..8e64d84a38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quill", - "version": "2.0.12", + "version": "2.0.14", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "http://quilljs.com", @@ -155,7 +155,8 @@ "test:functional": "./_develop/scripts/puppeteer.sh", "test:unit": "npm run build; karma start _develop/karma.config.js", "test:coverage": "webpack --env.coverage --config _develop/webpack.config.js; karma start _develop/karma.config.js --reporters coverage", - "travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs" + "travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs", + "copy-to-editor": "npm run build && cp \"./dist/quill.js\" ../ngx-tethys-editor/node_modules/quill/dist" }, "keywords": [ "editor",