/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ /*! For license information please see index.js.LICENSE.txt */ var TLDR = function(t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } return n.m = t, n.c = e, n.d = function(t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) }, n.r = function(t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, n.t = function(t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var o in t) n.d(r, o, function(e) { return t[e] }.bind(null, o)); return r }, n.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t }; return n.d(e, "a", e), e }, n.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "", n(n.s = 40) }([function(t, e, n) { var r; "undefined" != typeof self && self, r = function() { return function(t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } return n.m = t, n.c = e, n.d = function(t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { configurable: !1, enumerable: !0, get: r }) }, n.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t }; return n.d(e, "a", e), e }, n.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "", n(n.s = 9) }([function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = function(t) { function e(e) { var n = this; return e = "[Parchment] " + e, (n = t.call(this, e) || this).message = e, n.name = n.constructor.name, n } return o(e, t), e }(Error); e.ParchmentError = i; var a, s = {}, l = {}, c = {}, u = {}; function d(t, e) { var n; if (void 0 === e && (e = a.ANY), "string" == typeof t) n = u[t] || s[t]; else if (t instanceof Text || t.nodeType === Node.TEXT_NODE) n = u.text; else if ("number" == typeof t) t & a.LEVEL & a.BLOCK ? n = u.block : t & a.LEVEL & a.INLINE && (n = u.inline); else if (t instanceof HTMLElement) { var r = (t.getAttribute("class") || "").split(/\s+/); for (var o in r) if (n = l[r[o]]) break; n = n || c[t.tagName] } return null == n ? null : e & a.LEVEL & n.scope && e & a.TYPE & n.scope ? n : null } e.DATA_KEY = "__blot", 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" }(a = e.Scope || (e.Scope = {})), e.create = function(t, e) { var n = d(t); if (null == n) throw new i("Unable to create " + t + " blot"); var r = n, o = t instanceof Node || t.nodeType === Node.TEXT_NODE ? t : r.create(e); return new r(o, e) }, e.find = function t(n, r) { return void 0 === r && (r = !1), null == n ? null : null != n[e.DATA_KEY] ? n[e.DATA_KEY].blot : r ? t(n.parentNode, r) : null }, e.query = d, e.register = function t() { for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; if (e.length > 1) return e.map((function(e) { return t(e) })); var r = e[0]; if ("string" != typeof r.blotName && "string" != typeof r.attrName) throw new i("Invalid definition"); if ("abstract" === r.blotName) throw new i("Cannot register abstract class"); if (u[r.blotName || r.attrName] = r, "string" == typeof r.keyName) s[r.keyName] = r; else if (null != r.className && (l[r.className] = r), null != r.tagName) { Array.isArray(r.tagName) ? r.tagName = r.tagName.map((function(t) { return t.toUpperCase() })) : r.tagName = r.tagName.toUpperCase(); var o = Array.isArray(r.tagName) ? r.tagName : [r.tagName]; o.forEach((function(t) { null != c[t] && null != r.className || (c[t] = r) })) } return r } }, function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = n(0), o = function() { function t(t, e, n) { void 0 === n && (n = {}), this.attrName = t, this.keyName = e; var o = r.Scope.TYPE & r.Scope.ATTRIBUTE; null != n.scope ? this.scope = n.scope & r.Scope.LEVEL | o : this.scope = r.Scope.ATTRIBUTE, null != n.whitelist && (this.whitelist = n.whitelist) } return t.keys = function(t) { return [].map.call(t.attributes, (function(t) { return t.name })) }, t.prototype.add = function(t, e) { return !!this.canAdd(t, e) && (t.setAttribute(this.keyName, e), !0) }, t.prototype.canAdd = function(t, e) { return null != r.query(t, r.Scope.BLOT & (this.scope | r.Scope.TYPE)) && (null == this.whitelist || ("string" == typeof e ? this.whitelist.indexOf(e.replace(/["']/g, "")) > -1 : this.whitelist.indexOf(e) > -1)) }, t.prototype.remove = function(t) { t.removeAttribute(this.keyName) }, t.prototype.value = function(t) { var e = t.getAttribute(this.keyName); return this.canAdd(t, e) && e ? e : "" }, t }(); e.default = o }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(11), a = n(5), s = n(0), l = function(t) { function e(e) { var n = t.call(this, e) || this; return n.build(), n } return o(e, t), e.prototype.appendChild = function(t) { this.insertBefore(t) }, e.prototype.attach = function() { t.prototype.attach.call(this), this.children.forEach((function(t) { t.attach() })) }, e.prototype.build = function() { var t = this; this.children = new i.default, [].slice.call(this.domNode.childNodes).reverse().forEach((function(e) { try { var n = c(e); t.insertBefore(n, t.children.head || void 0) } catch (t) { if (t instanceof s.ParchmentError) return; throw t } })) }, e.prototype.deleteAt = function(t, e) { if (0 === t && e === this.length()) return this.remove(); this.children.forEachAt(t, e, (function(t, e, n) { t.deleteAt(e, n) })) }, e.prototype.descendant = function(t, n) { var r = this.children.find(n), o = r[0], i = r[1]; return null == t.blotName && t(o) || null != t.blotName && o instanceof t ? [o, i] : o instanceof e ? o.descendant(t, i) : [null, -1] }, e.prototype.descendants = function(t, n, r) { void 0 === n && (n = 0), void 0 === r && (r = Number.MAX_VALUE); var o = [], i = r; return this.children.forEachAt(n, r, (function(n, r, a) { (null == t.blotName && t(n) || null != t.blotName && n instanceof t) && o.push(n), n instanceof e && (o = o.concat(n.descendants(t, r, i))), i -= a })), o }, e.prototype.detach = function() { this.children.forEach((function(t) { t.detach() })), t.prototype.detach.call(this) }, e.prototype.formatAt = function(t, e, n, r) { this.children.forEachAt(t, e, (function(t, e, o) { t.formatAt(e, o, n, r) })) }, e.prototype.insertAt = function(t, e, n) { var r = this.children.find(t), o = r[0], i = r[1]; if (o) o.insertAt(i, e, n); else { var a = null == n ? s.create("text", e) : s.create(e, n); this.appendChild(a) } }, e.prototype.insertBefore = function(t, e) { if (null != this.statics.allowedChildren && !this.statics.allowedChildren.some((function(e) { return t instanceof e }))) throw new s.ParchmentError("Cannot insert " + t.statics.blotName + " into " + this.statics.blotName); t.insertInto(this, e) }, e.prototype.length = function() { return this.children.reduce((function(t, e) { return t + e.length() }), 0) }, e.prototype.moveChildren = function(t, e) { this.children.forEach((function(n) { t.insertBefore(n, e) })) }, e.prototype.optimize = function(e) { if (t.prototype.optimize.call(this, e), 0 === this.children.length) if (null != this.statics.defaultChild) { var n = s.create(this.statics.defaultChild); this.appendChild(n), n.optimize(e) } else this.remove() }, e.prototype.path = function(t, n) { void 0 === n && (n = !1); var r = this.children.find(t, n), o = r[0], i = r[1], a = [ [this, t] ]; return o instanceof e ? a.concat(o.path(i, n)) : (null != o && a.push([o, i]), a) }, e.prototype.removeChild = function(t) { this.children.remove(t) }, e.prototype.replace = function(n) { n instanceof e && n.moveChildren(this), t.prototype.replace.call(this, n) }, e.prototype.split = function(t, e) { if (void 0 === e && (e = !1), !e) { if (0 === t) return this; if (t === this.length()) return this.next } var n = this.clone(); return this.parent.insertBefore(n, this.next), this.children.forEachAt(t, this.length(), (function(t, r, o) { t = t.split(r, e), n.appendChild(t) })), n }, e.prototype.unwrap = function() { this.moveChildren(this.parent, this.next), this.remove() }, e.prototype.update = function(t, e) { var n = this, r = [], o = []; t.forEach((function(t) { t.target === n.domNode && "childList" === t.type && (r.push.apply(r, t.addedNodes), o.push.apply(o, t.removedNodes)) })), o.forEach((function(t) { if (!(null != t.parentNode && "IFRAME" !== t.tagName && document.body.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_CONTAINED_BY)) { var e = s.find(t); null != e && (null != e.domNode.parentNode && e.domNode.parentNode !== n.domNode || e.detach()) } })), r.filter((function(t) { return t.parentNode == n.domNode })).sort((function(t, e) { return t === e ? 0 : t.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : -1 })).forEach((function(t) { var e = null; null != t.nextSibling && (e = s.find(t.nextSibling)); var r = c(t); r.next == e && null != r.next || (null != r.parent && r.parent.removeChild(n), n.insertBefore(r, e || void 0)) })) }, e }(a.default); function c(t) { var e = s.find(t); if (null == e) try { e = s.create(t) } catch (n) { e = s.create(s.Scope.INLINE), [].slice.call(t.childNodes).forEach((function(t) { e.domNode.appendChild(t) })), t.parentNode && t.parentNode.replaceChild(e.domNode, t), e.attach() } return e } e.default = l }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(1), a = n(6), s = n(2), l = n(0), c = function(t) { function e(e) { var n = t.call(this, e) || this; return n.attributes = new a.default(n.domNode), n } return o(e, t), e.formats = function(t) { return "string" == typeof this.tagName || (Array.isArray(this.tagName) ? t.tagName.toLowerCase() : void 0) }, e.prototype.format = function(t, e) { var n = l.query(t); n instanceof i.default ? this.attributes.attribute(n, e) : e && (null == n || t === this.statics.blotName && this.formats()[t] === e || this.replaceWith(t, e)) }, e.prototype.formats = function() { var t = this.attributes.values(), e = this.statics.formats(this.domNode); return null != e && (t[this.statics.blotName] = e), t }, e.prototype.replaceWith = function(e, n) { var r = t.prototype.replaceWith.call(this, e, n); return this.attributes.copy(r), r }, e.prototype.update = function(e, n) { var r = this; t.prototype.update.call(this, e, n), e.some((function(t) { return t.target === r.domNode && "attributes" === t.type })) && this.attributes.build() }, e.prototype.wrap = function(n, r) { var o = t.prototype.wrap.call(this, n, r); return o instanceof e && o.statics.scope === this.statics.scope && this.attributes.move(o), o }, e }(s.default); e.default = c }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(5), a = n(0), s = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.value = function(t) { return !0 }, e.prototype.index = function(t, e) { return this.domNode === t || this.domNode.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_CONTAINED_BY ? Math.min(e, 1) : -1 }, e.prototype.position = function(t, e) { var n = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); return t > 0 && (n += 1), [this.parent.domNode, n] }, e.prototype.value = function() { return (t = {})[this.statics.blotName] = this.statics.value(this.domNode) || !0, t; var t }, e.scope = a.Scope.INLINE_BLOT, e }(i.default); e.default = s }, function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = n(0), o = function() { function t(t) { this.domNode = t, this.domNode[r.DATA_KEY] = { blot: this } } return Object.defineProperty(t.prototype, "statics", { get: function() { return this.constructor }, enumerable: !0, configurable: !0 }), t.create = function(t) { if (null == this.tagName) throw new r.ParchmentError("Blot definition missing tagName"); var e; return Array.isArray(this.tagName) ? ("string" == typeof t && (t = t.toUpperCase(), parseInt(t).toString() === t && (t = parseInt(t))), 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 }, t.prototype.attach = function() { null != this.parent && (this.scroll = this.parent.scroll) }, t.prototype.clone = function() { var t = this.domNode.cloneNode(!1); return r.create(t) }, t.prototype.detach = function() { null != this.parent && this.parent.removeChild(this), delete this.domNode[r.DATA_KEY] }, t.prototype.deleteAt = function(t, e) { this.isolate(t, e).remove() }, t.prototype.formatAt = function(t, e, n, o) { var i = this.isolate(t, e); if (null != r.query(n, r.Scope.BLOT) && o) i.wrap(n, o); else if (null != r.query(n, r.Scope.ATTRIBUTE)) { var a = r.create(this.statics.scope); i.wrap(a), a.format(n, o) } }, t.prototype.insertAt = function(t, e, n) { var o = null == n ? r.create("text", e) : r.create(e, n), i = this.split(t); this.parent.insertBefore(o, i) }, t.prototype.insertInto = function(t, e) { void 0 === e && (e = null), null != this.parent && this.parent.children.remove(this); var n = null; t.children.insertBefore(this, e), null != e && (n = e.domNode), this.domNode.parentNode == t.domNode && this.domNode.nextSibling == n || t.domNode.insertBefore(this.domNode, n), this.parent = t, this.attach() }, t.prototype.isolate = function(t, e) { var n = this.split(t); return n.split(e), n }, t.prototype.length = function() { return 1 }, t.prototype.offset = function(t) { return void 0 === t && (t = this.parent), null == this.parent || this == t ? 0 : this.parent.children.offset(this) + this.parent.offset(t) }, t.prototype.optimize = function(t) { null != this.domNode[r.DATA_KEY] && delete this.domNode[r.DATA_KEY].mutations }, t.prototype.remove = function() { null != this.domNode.parentNode && this.domNode.parentNode.removeChild(this.domNode), this.detach() }, t.prototype.replace = function(t) { null != t.parent && (t.parent.insertBefore(this, t.next), t.remove()) }, t.prototype.replaceWith = function(t, e) { var n = "string" == typeof t ? r.create(t, e) : t; return n.replace(this), n }, t.prototype.split = function(t, e) { return 0 === t ? this : this.next }, t.prototype.update = function(t, e) {}, t.prototype.wrap = function(t, e) { var n = "string" == typeof t ? r.create(t, e) : t; return null != this.parent && this.parent.insertBefore(n, this.next), n.appendChild(this), n }, t.blotName = "abstract", t }(); e.default = o }, function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = n(1), o = n(7), i = n(8), a = n(0), s = function() { function t(t) { this.attributes = {}, this.domNode = t, this.build() } return t.prototype.attribute = function(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]) }, t.prototype.build = function() { var t = this; this.attributes = {}; var e = r.default.keys(this.domNode), n = o.default.keys(this.domNode), s = i.default.keys(this.domNode); e.concat(n).concat(s).forEach((function(e) { var n = a.query(e, a.Scope.ATTRIBUTE); n instanceof r.default && (t.attributes[n.attrName] = n) })) }, t.prototype.copy = function(t) { var e = this; Object.keys(this.attributes).forEach((function(n) { var r = e.attributes[n].value(e.domNode); t.format(n, r) })) }, t.prototype.move = function(t) { var e = this; this.copy(t), Object.keys(this.attributes).forEach((function(t) { e.attributes[t].remove(e.domNode) })), this.attributes = {} }, t.prototype.values = function() { var t = this; return Object.keys(this.attributes).reduce((function(e, n) { return e[n] = t.attributes[n].value(t.domNode), e }), {}) }, t }(); e.default = s }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); function i(t, e) { return (t.getAttribute("class") || "").split(/\s+/).filter((function(t) { return 0 === t.indexOf(e + "-") })) } Object.defineProperty(e, "__esModule", { value: !0 }); var a = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.keys = function(t) { return (t.getAttribute("class") || "").split(/\s+/).map((function(t) { return t.split("-").slice(0, -1).join("-") })) }, e.prototype.add = function(t, e) { return !!this.canAdd(t, e) && (this.remove(t), t.classList.add(this.keyName + "-" + e), !0) }, e.prototype.remove = function(t) { i(t, this.keyName).forEach((function(e) { t.classList.remove(e) })), 0 === t.classList.length && t.removeAttribute("class") }, e.prototype.value = function(t) { var e = (i(t, this.keyName)[0] || "").slice(this.keyName.length + 1); return this.canAdd(t, e) ? e : "" }, e }(n(1).default); e.default = a }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); function i(t) { var e = t.split("-"), n = e.slice(1).map((function(t) { return t[0].toUpperCase() + t.slice(1) })).join(""); return e[0] + n } Object.defineProperty(e, "__esModule", { value: !0 }); var a = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.keys = function(t) { return (t.getAttribute("style") || "").split(";").map((function(t) { return t.split(":")[0].trim() })) }, e.prototype.add = function(t, e) { return !!this.canAdd(t, e) && (t.style[i(this.keyName)] = e, !0) }, e.prototype.remove = function(t) { t.style[i(this.keyName)] = "", t.getAttribute("style") || t.removeAttribute("style") }, e.prototype.value = function(t) { var e = t.style[i(this.keyName)]; return this.canAdd(t, e) ? e : "" }, e }(n(1).default); e.default = a }, function(t, e, n) { t.exports = n(10) }, function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = n(2), o = n(3), i = n(4), a = n(12), s = n(13), l = n(14), c = n(15), u = n(16), d = n(1), h = n(7), f = n(8), p = n(6), g = n(0), y = { Scope: g.Scope, create: g.create, find: g.find, query: g.query, register: g.register, Container: r.default, Format: o.default, Leaf: i.default, Embed: c.default, Scroll: a.default, Block: l.default, Inline: s.default, Text: u.default, Attributor: { Attribute: d.default, Class: h.default, Style: f.default, Store: p.default } }; e.default = y }, function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = function() { function t() { this.head = this.tail = null, this.length = 0 } return t.prototype.append = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; this.insertBefore(t[0], null), t.length > 1 && this.append.apply(this, t.slice(1)) }, t.prototype.contains = function(t) { for (var e, n = this.iterator(); e = n();) if (e === t) return !0; return !1 }, t.prototype.insertBefore = function(t, e) { 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) }, t.prototype.offset = function(t) { for (var e = 0, n = this.head; null != n;) { if (n === t) return e; e += n.length(), n = n.next } return -1 }, t.prototype.remove = function(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) }, t.prototype.iterator = function(t) { return void 0 === t && (t = this.head), function() { var e = t; return null != t && (t = t.next), e } }, t.prototype.find = function(t, e) { void 0 === e && (e = !1); for (var n, r = this.iterator(); n = r();) { var o = n.length(); if (t < o || e && t === o && (null == n.next || 0 !== n.next.length())) return [n, t]; t -= o } return [null, 0] }, t.prototype.forEach = function(t) { for (var e, n = this.iterator(); e = n();) t(e) }, t.prototype.forEachAt = function(t, e, n) { if (!(e <= 0)) for (var r, o = this.find(t), i = o[0], a = t - o[1], s = this.iterator(i); (r = s()) && a < t + e;) { var l = r.length(); t > a ? n(r, t - a, Math.min(e, a + l - t)) : n(r, 0, Math.min(l, t + e - a)), a += l } }, t.prototype.map = function(t) { return this.reduce((function(e, n) { return e.push(t(n)), e }), []) }, t.prototype.reduce = function(t, e) { for (var n, r = this.iterator(); n = r();) e = t(e, n); return e }, t }(); e.default = r }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(2), a = n(0), s = { attributes: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }, l = function(t) { function e(e) { var n = t.call(this, e) || this; return n.scroll = n, n.observer = new MutationObserver((function(t) { n.update(t) })), n.observer.observe(n.domNode, s), n.attach(), n } return o(e, t), e.prototype.detach = function() { t.prototype.detach.call(this), this.observer.disconnect() }, e.prototype.deleteAt = function(e, n) { this.update(), 0 === e && n === this.length() ? this.children.forEach((function(t) { t.remove() })) : t.prototype.deleteAt.call(this, e, n) }, e.prototype.formatAt = function(e, n, r, o) { this.update(), t.prototype.formatAt.call(this, e, n, r, o) }, e.prototype.insertAt = function(e, n, r) { this.update(), t.prototype.insertAt.call(this, e, n, r) }, e.prototype.optimize = function(e, n) { var r = this; void 0 === e && (e = []), void 0 === n && (n = {}), t.prototype.optimize.call(this, n); for (var o = [].slice.call(this.observer.takeRecords()); o.length > 0;) e.push(o.pop()); for (var s = function(t, e) { void 0 === e && (e = !0), null != t && t !== r && null != t.domNode.parentNode && (null == t.domNode[a.DATA_KEY].mutations && (t.domNode[a.DATA_KEY].mutations = []), e && s(t.parent)) }, l = function(t) { null != t.domNode[a.DATA_KEY] && null != t.domNode[a.DATA_KEY].mutations && (t instanceof i.default && t.children.forEach(l), t.optimize(n)) }, c = e, u = 0; c.length > 0; u += 1) { if (u >= 100) throw new Error("[Parchment] Maximum optimize iterations reached"); for (c.forEach((function(t) { var e = a.find(t.target, !0); null != e && (e.domNode === t.target && ("childList" === t.type ? (s(a.find(t.previousSibling, !1)), [].forEach.call(t.addedNodes, (function(t) { var e = a.find(t, !1); s(e, !1), e instanceof i.default && e.children.forEach((function(t) { s(t, !1) })) }))) : "attributes" === t.type && s(e.prev)), s(e)) })), this.children.forEach(l), o = (c = [].slice.call(this.observer.takeRecords())).slice(); o.length > 0;) e.push(o.pop()) } }, e.prototype.update = function(e, n) { var r = this; void 0 === n && (n = {}), (e = e || this.observer.takeRecords()).map((function(t) { var e = a.find(t.target, !0); return null == e ? null : null == e.domNode[a.DATA_KEY].mutations ? (e.domNode[a.DATA_KEY].mutations = [t], e) : (e.domNode[a.DATA_KEY].mutations.push(t), null) })).forEach((function(t) { null != t && t !== r && null != t.domNode[a.DATA_KEY] && t.update(t.domNode[a.DATA_KEY].mutations || [], n) })), null != this.domNode[a.DATA_KEY].mutations && t.prototype.update.call(this, this.domNode[a.DATA_KEY].mutations, n), this.optimize(e, n) }, e.blotName = "scroll", e.defaultChild = "block", e.scope = a.Scope.BLOCK_BLOT, e.tagName = "DIV", e }(i.default); e.default = l }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(3), a = n(0), s = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.formats = function(n) { if (n.tagName !== e.tagName) return t.formats.call(this, n) }, e.prototype.format = function(n, r) { var o = this; n !== this.statics.blotName || r ? t.prototype.format.call(this, n, r) : (this.children.forEach((function(t) { t instanceof i.default || (t = t.wrap(e.blotName, !0)), o.attributes.copy(t) })), this.unwrap()) }, e.prototype.formatAt = function(e, n, r, o) { null != this.formats()[r] || a.query(r, a.Scope.ATTRIBUTE) ? this.isolate(e, n).format(r, o) : t.prototype.formatAt.call(this, e, n, r, o) }, e.prototype.optimize = function(n) { t.prototype.optimize.call(this, n); var r = this.formats(); if (0 === Object.keys(r).length) return this.unwrap(); var o = this.next; o instanceof e && o.prev === this && function(t, e) { if (Object.keys(t).length !== Object.keys(e).length) return !1; for (var n in t) if (t[n] !== e[n]) return !1; return !0 }(r, o.formats()) && (o.moveChildren(this), o.remove()) }, e.blotName = "inline", e.scope = a.Scope.INLINE_BLOT, e.tagName = "SPAN", e }(i.default); e.default = s }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(3), a = n(0), s = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.formats = function(n) { var r = a.query(e.blotName).tagName; if (n.tagName !== r) return t.formats.call(this, n) }, e.prototype.format = function(n, r) { null != a.query(n, a.Scope.BLOCK) && (n !== this.statics.blotName || r ? t.prototype.format.call(this, n, r) : this.replaceWith(e.blotName)) }, e.prototype.formatAt = function(e, n, r, o) { null != a.query(r, a.Scope.BLOCK) ? this.format(r, o) : t.prototype.formatAt.call(this, e, n, r, o) }, e.prototype.insertAt = function(e, n, r) { if (null == r || null != a.query(n, a.Scope.INLINE)) t.prototype.insertAt.call(this, e, n, r); else { var o = this.split(e), i = a.create(n, r); o.parent.insertBefore(i, o) } }, e.prototype.update = function(e, n) { navigator.userAgent.match(/Trident/) ? this.build() : t.prototype.update.call(this, e, n) }, e.blotName = "block", e.scope = a.Scope.BLOCK_BLOT, e.tagName = "P", e }(i.default); e.default = s }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.formats = function(t) {}, e.prototype.format = function(e, n) { t.prototype.formatAt.call(this, 0, this.length(), e, n) }, e.prototype.formatAt = function(e, n, r, o) { 0 === e && n === this.length() ? this.format(r, o) : t.prototype.formatAt.call(this, e, n, r, o) }, e.prototype.formats = function() { return this.statics.formats(this.domNode) }, e }(n(4).default); e.default = i }, function(t, e, n) { "use strict"; var r, o = this && this.__extends || (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) }, function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(4), a = n(0), s = function(t) { function e(e) { var n = t.call(this, e) || this; return n.text = n.statics.value(n.domNode), n } return o(e, t), e.create = function(t) { return document.createTextNode(t) }, e.value = function(t) { var e = t.data; return e.normalize && (e = e.normalize()), e }, e.prototype.deleteAt = function(t, e) { this.domNode.data = this.text = this.text.slice(0, t) + this.text.slice(t + e) }, e.prototype.index = function(t, e) { return this.domNode === t ? e : -1 }, e.prototype.insertAt = function(e, n, r) { null == r ? (this.text = this.text.slice(0, e) + n + this.text.slice(e), this.domNode.data = this.text) : t.prototype.insertAt.call(this, e, n, r) }, e.prototype.length = function() { return this.text.length }, e.prototype.optimize = function(n) { t.prototype.optimize.call(this, n), this.text = this.statics.value(this.domNode), 0 === this.text.length ? this.remove() : this.next instanceof e && this.next.prev === this && (this.insertAt(this.length(), this.next.value()), this.next.remove()) }, e.prototype.position = function(t, e) { return void 0 === e && (e = !1), [this.domNode, t] }, e.prototype.split = function(t, e) { if (void 0 === e && (e = !1), !e) { if (0 === t) return this; if (t === this.length()) return this.next } var n = a.create(this.domNode.splitText(t)); return this.parent.insertBefore(n, this.next), this.text = this.statics.value(this.domNode), n }, e.prototype.update = function(t, e) { var n = this; t.some((function(t) { return "characterData" === t.type && t.target === n.domNode })) && (this.text = this.statics.value(this.domNode)) }, e.prototype.value = function() { return this.text }, e.blotName = "text", e.scope = a.Scope.INLINE_BLOT, e }(i.default); e.default = s }]) }, t.exports = r() }, function(t, e, n) { var r = n(20), o = n(4), i = n(2), a = n(5), s = String.fromCharCode(0), l = function(t) { Array.isArray(t) ? this.ops = t : null != t && Array.isArray(t.ops) ? this.ops = t.ops : this.ops = [] }; l.prototype.insert = function(t, e) { var n = {}; return 0 === t.length ? this : (n.insert = t, null != e && "object" == typeof e && Object.keys(e).length > 0 && (n.attributes = e), this.push(n)) }, l.prototype.delete = function(t) { return t <= 0 ? this : this.push({ delete: t }) }, l.prototype.retain = function(t, e) { if (t <= 0) return this; var n = { retain: t }; return null != e && "object" == typeof e && Object.keys(e).length > 0 && (n.attributes = e), this.push(n) }, l.prototype.push = function(t) { var e = this.ops.length, n = this.ops[e - 1]; if (t = i(!0, {}, t), "object" == typeof n) { if ("number" == typeof t.delete && "number" == typeof n.delete) return this.ops[e - 1] = { delete: n.delete + t.delete }, this; if ("number" == typeof n.delete && null != t.insert && (e -= 1, "object" != typeof(n = this.ops[e - 1]))) return this.ops.unshift(t), this; if (o(t.attributes, n.attributes)) { if ("string" == typeof t.insert && "string" == typeof n.insert) return this.ops[e - 1] = { insert: n.insert + t.insert }, "object" == typeof t.attributes && (this.ops[e - 1].attributes = t.attributes), this; if ("number" == typeof t.retain && "number" == typeof n.retain) return this.ops[e - 1] = { retain: n.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 }, l.prototype.chop = function() { var t = this.ops[this.ops.length - 1]; return t && t.retain && !t.attributes && this.ops.pop(), this }, l.prototype.filter = function(t) { return this.ops.filter(t) }, l.prototype.forEach = function(t) { this.ops.forEach(t) }, l.prototype.map = function(t) { return this.ops.map(t) }, l.prototype.partition = function(t) { var e = [], n = []; return this.forEach((function(r) { (t(r) ? e : n).push(r) })), [e, n] }, l.prototype.reduce = function(t, e) { return this.ops.reduce(t, e) }, l.prototype.changeLength = function() { return this.reduce((function(t, e) { return e.insert ? t + a.length(e) : e.delete ? t - e.delete : t }), 0) }, l.prototype.length = function() { return this.reduce((function(t, e) { return t + a.length(e) }), 0) }, l.prototype.slice = function(t, e) { t = t || 0, "number" != typeof e && (e = 1 / 0); for (var n = [], r = a.iterator(this.ops), o = 0; o < e && r.hasNext();) { var i; o < t ? i = r.next(t - o) : (i = r.next(e - o), n.push(i)), o += a.length(i) } return new l(n) }, l.prototype.compose = function(t) { var e = a.iterator(this.ops), n = a.iterator(t.ops), r = [], i = n.peek(); if (null != i && "number" == typeof i.retain && null == i.attributes) { for (var s = i.retain; "insert" === e.peekType() && e.peekLength() <= s;) s -= e.peekLength(), r.push(e.next()); i.retain - s > 0 && n.next(i.retain - s) } for (var c = new l(r); e.hasNext() || n.hasNext();) if ("insert" === n.peekType()) c.push(n.next()); else if ("delete" === e.peekType()) c.push(e.next()); else { var u = Math.min(e.peekLength(), n.peekLength()), d = e.next(u), h = n.next(u); if ("number" == typeof h.retain) { var f = {}; "number" == typeof d.retain ? f.retain = u : f.insert = d.insert; var p = a.attributes.compose(d.attributes, h.attributes, "number" == typeof d.retain); if (p && (f.attributes = p), c.push(f), !n.hasNext() && o(c.ops[c.ops.length - 1], f)) { var g = new l(e.rest()); return c.concat(g).chop() } } else "number" == typeof h.delete && "number" == typeof d.retain && c.push(h) } return c.chop() }, l.prototype.concat = function(t) { var e = new l(this.ops.slice()); return t.ops.length > 0 && (e.push(t.ops[0]), e.ops = e.ops.concat(t.ops.slice(1))), e }, l.prototype.diff = function(t, e) { if (this.ops === t.ops) return new l; var n = [this, t].map((function(e) { return e.map((function(n) { if (null != n.insert) return "string" == typeof n.insert ? n.insert : s; throw new Error("diff() called " + (e === t ? "on" : "with") + " non-document") })).join("") })), i = new l, c = r(n[0], n[1], e), u = a.iterator(this.ops), d = a.iterator(t.ops); return c.forEach((function(t) { for (var e = t[1].length; e > 0;) { var n = 0; switch (t[0]) { case r.INSERT: n = Math.min(d.peekLength(), e), i.push(d.next(n)); break; case r.DELETE: n = Math.min(e, u.peekLength()), u.next(n), i.delete(n); break; case r.EQUAL: n = Math.min(u.peekLength(), d.peekLength(), e); var s = u.next(n), l = d.next(n); o(s.insert, l.insert) ? i.retain(n, a.attributes.diff(s.attributes, l.attributes)) : i.push(l).delete(n) } e -= n } })), i.chop() }, l.prototype.eachLine = function(t, e) { e = e || "\n"; for (var n = a.iterator(this.ops), r = new l, o = 0; n.hasNext();) { if ("insert" !== n.peekType()) return; var i = n.peek(), s = a.length(i) - n.peekLength(), c = "string" == typeof i.insert ? i.insert.indexOf(e, s) - s : -1; if (c < 0) r.push(n.next()); else if (c > 0) r.push(n.next(c)); else { if (!1 === t(r, n.next(1).attributes || {}, o)) return; o += 1, r = new l } } r.length() > 0 && t(r, {}, o) }, l.prototype.transform = function(t, e) { if (e = !!e, "number" == typeof t) return this.transformPosition(t, e); for (var n = a.iterator(this.ops), r = a.iterator(t.ops), o = new l; n.hasNext() || r.hasNext();) if ("insert" !== n.peekType() || !e && "insert" === r.peekType()) if ("insert" === r.peekType()) o.push(r.next()); else { var i = Math.min(n.peekLength(), r.peekLength()), s = n.next(i), c = r.next(i); if (s.delete) continue; c.delete ? o.push(c) : o.retain(i, a.attributes.transform(s.attributes, c.attributes, e)) } else o.retain(a.length(n.next())); return o.chop() }, l.prototype.transformPosition = function(t, e) { e = !!e; for (var n = a.iterator(this.ops), r = 0; n.hasNext() && r <= t;) { var o = n.peekLength(), i = n.peekType(); n.next(), "delete" !== i ? ("insert" === i && (r < t || !e) && (t += o), r += o) : t -= Math.min(o, t - r) } return t }, t.exports = l }, function(t, e, n) { "use strict"; var r = Object.prototype.hasOwnProperty, o = Object.prototype.toString, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, s = function(t) { return "function" == typeof Array.isArray ? Array.isArray(t) : "[object Array]" === o.call(t) }, l = function(t) { if (!t || "[object Object]" !== o.call(t)) return !1; var e, n = r.call(t, "constructor"), i = t.constructor && t.constructor.prototype && r.call(t.constructor.prototype, "isPrototypeOf"); if (t.constructor && !n && !i) return !1; for (e in t); return void 0 === e || r.call(t, e) }, c = function(t, e) { i && "__proto__" === e.name ? i(t, e.name, { enumerable: !0, configurable: !0, value: e.newValue, writable: !0 }) : t[e.name] = e.newValue }, u = function(t, e) { if ("__proto__" === e) { if (!r.call(t, e)) return; if (a) return a(t, e).value } return t[e] }; t.exports = function t() { var e, n, r, o, i, a, d = arguments[0], h = 1, f = arguments.length, p = !1; for ("boolean" == typeof d && (p = d, d = arguments[1] || {}, h = 2), (null == d || "object" != typeof d && "function" != typeof d) && (d = {}); h < f; ++h) if (null != (e = arguments[h])) for (n in e) r = u(d, n), d !== (o = u(e, n)) && (p && o && (l(o) || (i = s(o))) ? (i ? (i = !1, a = r && s(r) ? r : []) : a = r && l(r) ? r : {}, c(d, { name: n, newValue: t(p, a, o) })) : void 0 !== o && c(d, { name: n, newValue: o })); return d } }, function(t, e, n) { (function(e) { var n = function() { "use strict"; function t(t, e) { return null != e && t instanceof e } var n, r, o; try { n = Map } catch (t) { n = function() {} } try { r = Set } catch (t) { r = function() {} } try { o = Promise } catch (t) { o = function() {} } function i(a, l, c, u, d) { "object" == typeof l && (c = l.depth, u = l.prototype, d = l.includeNonEnumerable, l = l.circular); var h = [], f = [], p = void 0 !== e; return void 0 === l && (l = !0), void 0 === c && (c = 1 / 0), function a(c, g) { if (null === c) return null; if (0 === g) return c; var y, m; if ("object" != typeof c) return c; if (t(c, n)) y = new n; else if (t(c, r)) y = new r; else if (t(c, o)) y = new o((function(t, e) { c.then((function(e) { t(a(e, g - 1)) }), (function(t) { e(a(t, g - 1)) })) })); else if (i.__isArray(c)) y = []; else if (i.__isRegExp(c)) y = new RegExp(c.source, s(c)), c.lastIndex && (y.lastIndex = c.lastIndex); else if (i.__isDate(c)) y = new Date(c.getTime()); else { if (p && e.isBuffer(c)) return y = e.allocUnsafe ? e.allocUnsafe(c.length) : new e(c.length), c.copy(y), y; t(c, Error) ? y = Object.create(c) : void 0 === u ? (m = Object.getPrototypeOf(c), y = Object.create(m)) : (y = Object.create(u), m = u) } if (l) { var b = h.indexOf(c); if (-1 != b) return f[b]; h.push(c), f.push(y) } for (var E in t(c, n) && c.forEach((function(t, e) { var n = a(e, g - 1), r = a(t, g - 1); y.set(n, r) })), t(c, r) && c.forEach((function(t) { var e = a(t, g - 1); y.add(e) })), c) { var A; m && (A = Object.getOwnPropertyDescriptor(m, E)), A && null == A.set || (y[E] = a(c[E], g - 1)) } if (Object.getOwnPropertySymbols) { var v = Object.getOwnPropertySymbols(c); for (E = 0; E < v.length; E++) { var T = v[E]; (!(_ = Object.getOwnPropertyDescriptor(c, T)) || _.enumerable || d) && (y[T] = a(c[T], g - 1), _.enumerable || Object.defineProperty(y, T, { enumerable: !1 })) } } if (d) { var O = Object.getOwnPropertyNames(c); for (E = 0; E < O.length; E++) { var _, I = O[E]; (_ = Object.getOwnPropertyDescriptor(c, I)) && _.enumerable || (y[I] = a(c[I], g - 1), Object.defineProperty(y, I, { enumerable: !1 })) } } return y }(a, c) } function a(t) { return Object.prototype.toString.call(t) } function s(t) { var e = ""; return t.global && (e += "g"), t.ignoreCase && (e += "i"), t.multiline && (e += "m"), e } return i.clonePrototype = function(t) { if (null === t) return null; var e = function() {}; return e.prototype = t, new e }, i.__objToStr = a, i.__isDate = function(t) { return "object" == typeof t && "[object Date]" === a(t) }, i.__isArray = function(t) { return "object" == typeof t && "[object Array]" === a(t) }, i.__isRegExp = function(t) { return "object" == typeof t && "[object RegExp]" === a(t) }, i.__getRegExpFlags = s, i }(); t.exports && (t.exports = n) }).call(this, n(35).Buffer) }, function(t, e, n) { var r = n(9), o = n(22), i = n(27), a = n(29), s = n(30), l = n(34), c = Date.prototype.getTime; function u(t) { return null == t } function d(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]) } t.exports = function t(e, n, h) { var f = h || {}; return !!(f.strict ? i(e, n) : e === n) || (!e || !n || "object" != typeof e && "object" != typeof n ? f.strict ? i(e, n) : e == n : function(e, n, i) { var h, f; if (typeof e != typeof n) return !1; if (u(e) || u(n)) return !1; if (e.prototype !== n.prototype) return !1; if (o(e) !== o(n)) return !1; var p = a(e), g = a(n); if (p !== g) return !1; if (p || g) return e.source === n.source && s(e) === s(n); if (l(e) && l(n)) return c.call(e) === c.call(n); var y = d(e), m = d(n); if (y !== m) return !1; if (y || m) { if (e.length !== n.length) return !1; for (h = 0; h < e.length; h++) if (e[h] !== n[h]) return !1; return !0 } if (typeof e != typeof n) return !1; try { var b = r(e), E = r(n) } catch (e) { return !1 } if (b.length !== E.length) return !1; for (b.sort(), E.sort(), h = b.length - 1; h >= 0; h--) if (b[h] != E[h]) return !1; for (h = b.length - 1; h >= 0; h--) if (!t(e[f = b[h]], n[f], i)) return !1; return !0 }(e, n, f)) } }, function(t, e, n) { var r = n(4), o = n(2), i = { attributes: { compose: function(t, e, n) { "object" != typeof t && (t = {}), "object" != typeof e && (e = {}); var r = o(!0, {}, e); for (var i in n || (r = Object.keys(r).reduce((function(t, e) { return null != r[e] && (t[e] = r[e]), t }), {})), t) void 0 !== t[i] && void 0 === e[i] && (r[i] = t[i]); return Object.keys(r).length > 0 ? r : void 0 }, diff: function(t, e) { "object" != typeof t && (t = {}), "object" != typeof e && (e = {}); var n = Object.keys(t).concat(Object.keys(e)).reduce((function(n, o) { return r(t[o], e[o]) || (n[o] = void 0 === e[o] ? null : e[o]), n }), {}); return Object.keys(n).length > 0 ? n : void 0 }, transform: function(t, e, n) { if ("object" != typeof t) return e; if ("object" == typeof e) { if (!n) return e; var r = Object.keys(e).reduce((function(n, r) { return void 0 === t[r] && (n[r] = e[r]), n }), {}); return Object.keys(r).length > 0 ? r : void 0 } } }, iterator: function(t) { return new a(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 } }; function a(t) { this.ops = t, this.index = 0, this.offset = 0 } a.prototype.hasNext = function() { return this.peekLength() < 1 / 0 }, a.prototype.next = function(t) { t || (t = 1 / 0); var e = this.ops[this.index]; if (e) { var n = this.offset, r = i.length(e); if (t >= r - n ? (t = r - n, this.index += 1, this.offset = 0) : this.offset += t, "number" == typeof e.delete) return { delete: t }; var o = {}; return e.attributes && (o.attributes = e.attributes), "number" == typeof e.retain ? o.retain = t : "string" == typeof e.insert ? o.insert = e.insert.substr(n, t) : o.insert = e.insert, o } return { retain: 1 / 0 } }, a.prototype.peek = function() { return this.ops[this.index] }, a.prototype.peekLength = function() { return this.ops[this.index] ? i.length(this.ops[this.index]) - this.offset : 1 / 0 }, a.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" }, a.prototype.rest = function() { if (this.hasNext()) { if (0 === this.offset) return this.ops.slice(this.index); var t = this.offset, e = this.index, n = this.next(), r = this.ops.slice(this.index); return this.offset = t, this.index = e, [n].concat(r) } return [] }, t.exports = i }, function(t, e, n) { "use strict"; var r = n(25); t.exports = Function.prototype.bind || r }, function(t, e, n) { "use strict"; var r = n(9), o = "function" == typeof Symbol && "symbol" == typeof Symbol("foo"), i = Object.prototype.toString, a = Array.prototype.concat, s = Object.defineProperty, l = s && function() { var t = {}; try { for (var e in s(t, "x", { enumerable: !1, value: t }), t) return !1; return t.x === t } catch (t) { return !1 } }(), c = function(t, e, n, r) { var o; (!(e in t) || "function" == typeof(o = r) && "[object Function]" === i.call(o) && r()) && (l ? s(t, e, { configurable: !0, enumerable: !1, value: n, writable: !0 }) : t[e] = n) }, u = function(t, e) { var n = arguments.length > 2 ? arguments[2] : {}, i = r(e); o && (i = a.call(i, Object.getOwnPropertySymbols(e))); for (var s = 0; s < i.length; s += 1) c(t, i[s], e[i[s]], n[i[s]]) }; u.supportsDescriptors = !!l, t.exports = u }, function(t, e, n) { "use strict"; (function(e) { var r = e.Symbol, o = n(24); t.exports = function() { return "function" == typeof r && "function" == typeof Symbol && "symbol" == typeof r("foo") && "symbol" == typeof Symbol("bar") && o() } }).call(this, n(12)) }, function(t, e, n) { "use strict"; var r = Array.prototype.slice, o = n(10), i = Object.keys, a = i ? function(t) { return i(t) } : n(21), s = Object.keys; a.shim = function() { return Object.keys ? function() { var t = Object.keys(arguments); return t && t.length === arguments.length }(1, 2) || (Object.keys = function(t) { return o(t) ? s(r.call(t)) : s(t) }) : Object.keys = a, Object.keys || a }, t.exports = a }, function(t, e, n) { "use strict"; var r = Object.prototype.toString; t.exports = function(t) { var e = r.call(t), n = "[object Arguments]" === e; return n || (n = "[object Array]" !== e && null !== t && "object" == typeof t && "number" == typeof t.length && t.length >= 0 && "[object Function]" === r.call(t.callee)), n } }, function(t, e, n) { "use strict"; var r = SyntaxError, o = Function, i = TypeError, a = function(t) { try { return Function('"use strict"; return (' + t + ").constructor;")() } catch (t) {} }, s = Object.getOwnPropertyDescriptor; if (s) try { s({}, "") } catch (t) { s = null } var l = function() { throw new i }, c = s ? function() { try { return l } catch (t) { try { return s(arguments, "callee").get } catch (t) { return l } } }() : l, u = n(8)(), d = Object.getPrototypeOf || function(t) { return t.__proto__ }, h = a("async function* () {}"), f = h ? h.prototype : void 0, p = f ? f.prototype : void 0, g = "undefined" == typeof Uint8Array ? void 0 : d(Uint8Array), y = { "%AggregateError%": "undefined" == typeof AggregateError ? void 0 : AggregateError, "%Array%": Array, "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer, "%ArrayIteratorPrototype%": u ? d([][Symbol.iterator]()) : void 0, "%AsyncFromSyncIteratorPrototype%": void 0, "%AsyncFunction%": a("async function () {}"), "%AsyncGenerator%": f, "%AsyncGeneratorFunction%": h, "%AsyncIteratorPrototype%": p ? d(p) : void 0, "%Atomics%": "undefined" == typeof Atomics ? void 0 : Atomics, "%BigInt%": "undefined" == typeof BigInt ? void 0 : BigInt, "%Boolean%": Boolean, "%DataView%": "undefined" == typeof DataView ? void 0 : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": Error, "%eval%": eval, "%EvalError%": EvalError, "%Float32Array%": "undefined" == typeof Float32Array ? void 0 : Float32Array, "%Float64Array%": "undefined" == typeof Float64Array ? void 0 : Float64Array, "%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? void 0 : FinalizationRegistry, "%Function%": o, "%GeneratorFunction%": a("function* () {}"), "%Int8Array%": "undefined" == typeof Int8Array ? void 0 : Int8Array, "%Int16Array%": "undefined" == typeof Int16Array ? void 0 : Int16Array, "%Int32Array%": "undefined" == typeof Int32Array ? void 0 : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": u ? d(d([][Symbol.iterator]())) : void 0, "%JSON%": "object" == typeof JSON ? JSON : void 0, "%Map%": "undefined" == typeof Map ? void 0 : Map, "%MapIteratorPrototype%": "undefined" != typeof Map && u ? d((new Map)[Symbol.iterator]()) : void 0, "%Math%": Math, "%Number%": Number, "%Object%": Object, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": "undefined" == typeof Promise ? void 0 : Promise, "%Proxy%": "undefined" == typeof Proxy ? void 0 : Proxy, "%RangeError%": RangeError, "%ReferenceError%": ReferenceError, "%Reflect%": "undefined" == typeof Reflect ? void 0 : Reflect, "%RegExp%": RegExp, "%Set%": "undefined" == typeof Set ? void 0 : Set, "%SetIteratorPrototype%": "undefined" != typeof Set && u ? d((new Set)[Symbol.iterator]()) : void 0, "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": u ? d("" [Symbol.iterator]()) : void 0, "%Symbol%": u ? Symbol : void 0, "%SyntaxError%": r, "%ThrowTypeError%": c, "%TypedArray%": g, "%TypeError%": i, "%Uint8Array%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array, "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray, "%Uint16Array%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array, "%Uint32Array%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array, "%URIError%": URIError, "%WeakMap%": "undefined" == typeof WeakMap ? void 0 : WeakMap, "%WeakRef%": "undefined" == typeof WeakRef ? void 0 : WeakRef, "%WeakSet%": "undefined" == typeof WeakSet ? void 0 : WeakSet }, m = { "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, b = n(6), E = n(26), A = b.call(Function.call, Array.prototype.concat), v = b.call(Function.apply, Array.prototype.splice), T = b.call(Function.call, String.prototype.replace), O = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, _ = /\\(\\)?/g, I = function(t) { var e = []; return T(t, O, (function(t, n, r, o) { e[e.length] = r ? T(o, _, "$1") : n || t })), e }, S = function(t, e) { var n, o = t; if (E(m, o) && (o = "%" + (n = m[o])[0] + "%"), E(y, o)) { var a = y[o]; if (void 0 === a && !e) throw new i("intrinsic " + t + " exists, but is not available. Please file an issue!"); return { alias: n, name: o, value: a } } throw new r("intrinsic " + t + " does not exist!") }; t.exports = function(t, e) { if ("string" != typeof t || 0 === t.length) throw new i("intrinsic name must be a non-empty string"); if (arguments.length > 1 && "boolean" != typeof e) throw new i('"allowMissing" argument must be a boolean'); var n = I(t), r = n.length > 0 ? n[0] : "", o = S("%" + r + "%", e), a = o.name, l = o.value, c = !1, u = o.alias; u && (r = u[0], v(n, A([0, 1], u))); for (var d = 1, h = !0; d < n.length; d += 1) { var f = n[d]; if ("constructor" !== f && h || (c = !0), E(y, a = "%" + (r += "." + f) + "%")) l = y[a]; else if (null != l) { if (s && d + 1 >= n.length) { var p = s(l, f); if (h = !!p, !e && !(f in l)) throw new i("base intrinsic for " + t + " exists, but the property is not available."); l = h && "get" in p && !("originalValue" in p.get) ? p.get : l[f] } else h = E(l, f), l = l[f]; h && !c && (y[a] = l) } } return l } }, function(t, e) { var n; n = function() { return this }(); try { n = n || new Function("return this")() } catch (t) { "object" == typeof window && (n = window) } t.exports = n }, function(t, e, n) { "use strict"; var r = n(6), o = n(11), i = o("%Function.prototype.apply%"), a = o("%Function.prototype.call%"), s = o("%Reflect.apply%", !0) || r.call(a, i), l = o("%Object.defineProperty%", !0); if (l) try { l({}, "a", { value: 1 }) } catch (t) { l = null } t.exports = function() { return s(r, a, arguments) }; var c = function() { return s(r, i, arguments) }; l ? l(t.exports, "apply", { value: c }) : t.exports.apply = c }, function(t, e, n) { "use strict"; var r = function(t) { return t != t }; t.exports = function(t, e) { return 0 === t && 0 === e ? 1 / t == 1 / e : t === e || !(!r(t) || !r(e)) } }, function(t, e, n) { "use strict"; var r = n(14); t.exports = function() { return "function" == typeof Object.is ? Object.is : r } }, function(t, e, n) { "use strict"; var r = Object, o = TypeError; t.exports = function() { if (null != this && this !== r(this)) throw new o("RegExp.prototype.flags getter called on non-object"); var t = ""; return this.global && (t += "g"), this.ignoreCase && (t += "i"), this.multiline && (t += "m"), this.dotAll && (t += "s"), this.unicode && (t += "u"), this.sticky && (t += "y"), t } }, function(t, e, n) { "use strict"; var r = n(16), o = n(7).supportsDescriptors, i = Object.getOwnPropertyDescriptor, a = TypeError; t.exports = function() { if (!o) throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors"); if ("gim" === /a/gim.flags) { var t = i(RegExp.prototype, "flags"); if (t && "function" == typeof t.get && "boolean" == typeof /a/.dotAll) return t.get } return r } }, function(t, e, n) { "use strict"; var r = Object.prototype.hasOwnProperty, o = "~"; function i() {} function a(t, e, n) { this.fn = t, this.context = e, this.once = n || !1 } function s() { this._events = new i, this._eventsCount = 0 } Object.create && (i.prototype = Object.create(null), (new i).__proto__ || (o = !1)), s.prototype.eventNames = function() { var t, e, n = []; if (0 === this._eventsCount) return n; for (e in t = this._events) r.call(t, e) && n.push(o ? e.slice(1) : e); return Object.getOwnPropertySymbols ? n.concat(Object.getOwnPropertySymbols(t)) : n }, s.prototype.listeners = function(t, e) { var n = o ? o + t : t, r = this._events[n]; if (e) return !!r; if (!r) return []; if (r.fn) return [r.fn]; for (var i = 0, a = r.length, s = new Array(a); i < a; i++) s[i] = r[i].fn; return s }, s.prototype.emit = function(t, e, n, r, i, a) { var s = o ? o + t : t; if (!this._events[s]) return !1; var l, c, u = this._events[s], d = arguments.length; if (u.fn) { switch (u.once && this.removeListener(t, u.fn, void 0, !0), d) { case 1: return u.fn.call(u.context), !0; case 2: return u.fn.call(u.context, e), !0; case 3: return u.fn.call(u.context, e, n), !0; case 4: return u.fn.call(u.context, e, n, r), !0; case 5: return u.fn.call(u.context, e, n, r, i), !0; case 6: return u.fn.call(u.context, e, n, r, i, a), !0 } for (c = 1, l = new Array(d - 1); c < d; c++) l[c - 1] = arguments[c]; u.fn.apply(u.context, l) } else { var h, f = u.length; for (c = 0; c < f; c++) switch (u[c].once && this.removeListener(t, u[c].fn, void 0, !0), d) { case 1: u[c].fn.call(u[c].context); break; case 2: u[c].fn.call(u[c].context, e); break; case 3: u[c].fn.call(u[c].context, e, n); break; case 4: u[c].fn.call(u[c].context, e, n, r); break; default: if (!l) for (h = 1, l = new Array(d - 1); h < d; h++) l[h - 1] = arguments[h]; u[c].fn.apply(u[c].context, l) } } return !0 }, s.prototype.on = function(t, e, n) { var r = new a(e, n || this), i = o ? o + t : t; return this._events[i] ? this._events[i].fn ? this._events[i] = [this._events[i], r] : this._events[i].push(r) : (this._events[i] = r, this._eventsCount++), this }, s.prototype.once = function(t, e, n) { var r = new a(e, n || this, !0), i = o ? o + t : t; return this._events[i] ? this._events[i].fn ? this._events[i] = [this._events[i], r] : this._events[i].push(r) : (this._events[i] = r, this._eventsCount++), this }, s.prototype.removeListener = function(t, e, n, r) { var a = o ? o + t : t; if (!this._events[a]) return this; if (!e) return 0 == --this._eventsCount ? this._events = new i : delete this._events[a], this; var s = this._events[a]; if (s.fn) s.fn !== e || r && !s.once || n && s.context !== n || (0 == --this._eventsCount ? this._events = new i : delete this._events[a]); else { for (var l = 0, c = [], u = s.length; l < u; l++)(s[l].fn !== e || r && !s[l].once || n && s[l].context !== n) && c.push(s[l]); c.length ? this._events[a] = 1 === c.length ? c[0] : c : 0 == --this._eventsCount ? this._events = new i : delete this._events[a] } return this }, s.prototype.removeAllListeners = function(t) { var e; return t ? (e = o ? o + t : t, this._events[e] && (0 == --this._eventsCount ? this._events = new i : delete this._events[e])) : (this._events = new i, this._eventsCount = 0), this }, s.prototype.off = s.prototype.removeListener, s.prototype.addListener = s.prototype.on, s.prototype.setMaxListeners = function() { return this }, s.prefixed = o, s.EventEmitter = s, t.exports = s }, function(t, e) { let n = document.createElement("div"); if (n.classList.toggle("test-class", !1), n.classList.contains("test-class")) { let t = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function(e, n) { return arguments.length > 1 && !this.contains(e) == !n ? n : t.call(this, e) } } String.prototype.startsWith || (String.prototype.startsWith = function(t, e) { return e = e || 0, this.substr(e, t.length) === t }), String.prototype.endsWith || (String.prototype.endsWith = function(t, e) { var n = this.toString(); ("number" != typeof e || !isFinite(e) || Math.floor(e) !== e || e > n.length) && (e = n.length), e -= t.length; var r = n.indexOf(t, e); return -1 !== r && r === e }), Array.prototype.find || Object.defineProperty(Array.prototype, "find", { value: function(t) { if (null === this) throw new TypeError("Array.prototype.find called on null or undefined"); if ("function" != typeof t) throw new TypeError("predicate must be a function"); for (var e, n = Object(this), r = n.length >>> 0, o = arguments[1], i = 0; i < r; i++) if (e = n[i], t.call(o, e, i, n)) return e } }), document.addEventListener("DOMContentLoaded", (function() { document.execCommand("enableObjectResizing", !1, !1), document.execCommand("autoUrlDetect", !1, !1) })) }, function(t, e) { function n(t, e, a) { if (t == e) return t ? [ [0, t] ] : []; (a < 0 || t.length < a) && (a = null); var l = o(t, e), c = t.substring(0, l); l = i(t = t.substring(l), e = e.substring(l)); var u = t.substring(t.length - l), d = function(t, e) { var a; if (!t) return [ [1, e] ]; if (!e) return [ [-1, t] ]; var s = t.length > e.length ? t : e, l = t.length > e.length ? e : t, c = s.indexOf(l); if (-1 != c) return a = [ [1, s.substring(0, c)], [0, l], [1, s.substring(c + l.length)] ], t.length > e.length && (a[0][0] = a[2][0] = -1), a; if (1 == l.length) return [ [-1, t], [1, e] ]; var u = function(t, e) { var n = t.length > e.length ? t : e, r = t.length > e.length ? e : t; if (n.length < 4 || 2 * r.length < n.length) return null; function a(t, e, n) { for (var r, a, s, l, c = t.substring(n, n + Math.floor(t.length / 4)), u = -1, d = ""; - 1 != (u = e.indexOf(c, u + 1));) { var h = o(t.substring(n), e.substring(u)), f = i(t.substring(0, n), e.substring(0, u)); d.length < f + h && (d = e.substring(u - f, u) + e.substring(u, u + h), r = t.substring(0, n - f), a = t.substring(n + h), s = e.substring(0, u - f), l = e.substring(u + h)) } return 2 * d.length >= t.length ? [r, a, s, l, d] : null } var s, l, c, u, d, h = a(n, r, Math.ceil(n.length / 4)), f = a(n, r, Math.ceil(n.length / 2)); return h || f ? (s = f ? h && h[4].length > f[4].length ? h : f : h, t.length > e.length ? (l = s[0], c = s[1], u = s[2], d = s[3]) : (u = s[0], d = s[1], l = s[2], c = s[3]), [l, c, u, d, s[4]]) : null }(t, e); if (u) { var d = u[0], h = u[1], f = u[2], p = u[3], g = u[4], y = n(d, f), m = n(h, p); return y.concat([ [0, g] ], m) } return function(t, e) { for (var n = t.length, o = e.length, i = Math.ceil((n + o) / 2), a = i, s = 2 * i, l = new Array(s), c = new Array(s), u = 0; u < s; u++) l[u] = -1, c[u] = -1; l[a + 1] = 0, c[a + 1] = 0; for (var d = n - o, h = d % 2 != 0, f = 0, p = 0, g = 0, y = 0, m = 0; m < i; m++) { for (var b = -m + f; b <= m - p; b += 2) { for (var E = a + b, A = (I = b == -m || b != m && l[E - 1] < l[E + 1] ? l[E + 1] : l[E - 1] + 1) - b; I < n && A < o && t.charAt(I) == e.charAt(A);) I++, A++; if (l[E] = I, I > n) p += 2; else if (A > o) f += 2; else if (h && (O = a + d - b) >= 0 && O < s && -1 != c[O]) { var v = n - c[O]; if (I >= v) return r(t, e, I, A) } } for (var T = -m + g; T <= m - y; T += 2) { for (var O = a + T, _ = (v = T == -m || T != m && c[O - 1] < c[O + 1] ? c[O + 1] : c[O - 1] + 1) - T; v < n && _ < o && t.charAt(n - v - 1) == e.charAt(o - _ - 1);) v++, _++; if (c[O] = v, v > n) y += 2; else if (_ > o) g += 2; else if (!h && (E = a + d - T) >= 0 && E < s && -1 != l[E]) { var I = l[E]; if (A = a + I - E, I >= (v = n - v)) return r(t, e, I, A) } } } return [ [-1, t], [1, e] ] }(t, e) }(t = t.substring(0, t.length - l), e = e.substring(0, e.length - l)); return c && d.unshift([0, c]), u && d.push([0, u]), function t(e) { e.push([0, ""]); for (var n, r = 0, a = 0, s = 0, l = "", c = ""; r < e.length;) switch (e[r][0]) { case 1: s++, c += e[r][1], r++; break; case -1: a++, l += e[r][1], r++; break; case 0: a + s > 1 ? (0 !== a && 0 !== s && (0 !== (n = o(c, l)) && (r - a - s > 0 && 0 == e[r - a - s - 1][0] ? e[r - a - s - 1][1] += c.substring(0, n) : (e.splice(0, 0, [0, c.substring(0, n)]), r++), c = c.substring(n), l = l.substring(n)), 0 !== (n = i(c, l)) && (e[r][1] = c.substring(c.length - n) + e[r][1], c = c.substring(0, c.length - n), l = l.substring(0, l.length - n))), 0 === a ? e.splice(r - s, a + s, [1, c]) : 0 === s ? e.splice(r - a, a + s, [-1, l]) : e.splice(r - a - s, a + s, [-1, l], [1, c]), r = r - a - s + (a ? 1 : 0) + (s ? 1 : 0) + 1) : 0 !== r && 0 == e[r - 1][0] ? (e[r - 1][1] += e[r][1], e.splice(r, 1)) : r++, s = 0, a = 0, l = "", c = "" } "" === e[e.length - 1][1] && e.pop(); var u = !1; for (r = 1; r < e.length - 1;) 0 == e[r - 1][0] && 0 == e[r + 1][0] && (e[r][1].substring(e[r][1].length - e[r - 1][1].length) == e[r - 1][1] ? (e[r][1] = e[r - 1][1] + e[r][1].substring(0, e[r][1].length - e[r - 1][1].length), e[r + 1][1] = e[r - 1][1] + e[r + 1][1], e.splice(r - 1, 1), u = !0) : e[r][1].substring(0, e[r + 1][1].length) == e[r + 1][1] && (e[r - 1][1] += e[r + 1][1], e[r][1] = e[r][1].substring(e[r + 1][1].length) + e[r + 1][1], e.splice(r + 1, 1), u = !0)), r++; u && t(e) }(d), null != a && (d = function(t, e) { var n = function(t, e) { if (0 === e) return [0, t]; for (var n = 0, r = 0; r < t.length; r++) { var o = t[r]; if (-1 === o[0] || 0 === o[0]) { var i = n + o[1].length; if (e === i) return [r + 1, t]; if (e < i) { t = t.slice(); var a = e - n, s = [o[0], o[1].slice(0, a)], l = [o[0], o[1].slice(a)]; return t.splice(r, 1, s, l), [r + 1, t] } n = i } } throw new Error("cursor_pos is out of bounds!") }(t, e), r = n[1], o = n[0], i = r[o], a = r[o + 1]; if (null == i) return t; if (0 !== i[0]) return t; if (null != a && i[1] + a[1] === a[1] + i[1]) return r.splice(o, 2, a, i), s(r, o, 2); if (null != a && 0 === a[1].indexOf(i[1])) { r.splice(o, 2, [a[0], i[1]], [0, i[1]]); var l = a[1].slice(i[1].length); return l.length > 0 && r.splice(o + 2, 0, [a[0], l]), s(r, o, 3) } return t }(d, a)), function(t) { for (var e = !1, n = function(t) { return t.charCodeAt(0) >= 56320 && t.charCodeAt(0) <= 57343 }, r = 2; r < t.length; r += 1) 0 === t[r - 2][0] && (o = t[r - 2][1]).charCodeAt(o.length - 1) >= 55296 && o.charCodeAt(o.length - 1) <= 56319 && -1 === t[r - 1][0] && n(t[r - 1][1]) && 1 === t[r][0] && n(t[r][1]) && (e = !0, t[r - 1][1] = t[r - 2][1].slice(-1) + t[r - 1][1], t[r][1] = t[r - 2][1].slice(-1) + t[r][1], t[r - 2][1] = t[r - 2][1].slice(0, -1)); var o; if (!e) return t; var i = []; for (r = 0; r < t.length; r += 1) t[r][1].length > 0 && i.push(t[r]); return i }(d) } function r(t, e, r, o) { var i = t.substring(0, r), a = e.substring(0, o), s = t.substring(r), l = e.substring(o), c = n(i, a), u = n(s, l); return c.concat(u) } function o(t, e) { if (!t || !e || t.charAt(0) != e.charAt(0)) return 0; for (var n = 0, r = Math.min(t.length, e.length), o = r, i = 0; n < o;) t.substring(i, o) == e.substring(i, o) ? i = n = o : r = o, o = Math.floor((r - n) / 2 + n); return o } function i(t, e) { if (!t || !e || t.charAt(t.length - 1) != e.charAt(e.length - 1)) return 0; for (var n = 0, r = Math.min(t.length, e.length), o = r, i = 0; n < o;) t.substring(t.length - o, t.length - i) == e.substring(e.length - o, e.length - i) ? i = n = o : r = o, o = Math.floor((r - n) / 2 + n); return o } var a = n; function s(t, e, n) { for (var r = e + n - 1; r >= 0 && r >= e - 1; r--) if (r + 1 < t.length) { var o = t[r], i = t[r + 1]; o[0] === i[1] && t.splice(r, 2, [o[0], o[1] + i[1]]) } return t } a.INSERT = 1, a.DELETE = -1, a.EQUAL = 0, t.exports = a }, function(t, e, n) { "use strict"; var r; if (!Object.keys) { var o = Object.prototype.hasOwnProperty, i = Object.prototype.toString, a = n(10), s = Object.prototype.propertyIsEnumerable, l = !s.call({ toString: null }, "toString"), c = s.call((function() {}), "prototype"), u = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], d = function(t) { var e = t.constructor; return e && e.prototype === t }, h = { $applicationCache: !0, $console: !0, $external: !0, $frame: !0, $frameElement: !0, $frames: !0, $innerHeight: !0, $innerWidth: !0, $onmozfullscreenchange: !0, $onmozfullscreenerror: !0, $outerHeight: !0, $outerWidth: !0, $pageXOffset: !0, $pageYOffset: !0, $parent: !0, $scrollLeft: !0, $scrollTop: !0, $scrollX: !0, $scrollY: !0, $self: !0, $webkitIndexedDB: !0, $webkitStorageInfo: !0, $window: !0 }, f = function() { if ("undefined" == typeof window) return !1; for (var t in window) try { if (!h["$" + t] && o.call(window, t) && null !== window[t] && "object" == typeof window[t]) try { d(window[t]) } catch (t) { return !0 } } catch (t) { return !0 } return !1 }(); r = function(t) { var e = null !== t && "object" == typeof t, n = "[object Function]" === i.call(t), r = a(t), s = e && "[object String]" === i.call(t), h = []; if (!e && !n && !r) throw new TypeError("Object.keys called on a non-object"); var p = c && n; if (s && t.length > 0 && !o.call(t, 0)) for (var g = 0; g < t.length; ++g) h.push(String(g)); if (r && t.length > 0) for (var y = 0; y < t.length; ++y) h.push(String(y)); else for (var m in t) p && "prototype" === m || !o.call(t, m) || h.push(String(m)); if (l) for (var b = function(t) { if ("undefined" == typeof window || !f) return d(t); try { return d(t) } catch (t) { return !1 } }(t), E = 0; E < u.length; ++E) b && "constructor" === u[E] || !o.call(t, u[E]) || h.push(u[E]); return h } } t.exports = r }, function(t, e, n) { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag, o = n(23)("Object.prototype.toString"), i = function(t) { return !(r && t && "object" == typeof t && Symbol.toStringTag in t) && "[object Arguments]" === o(t) }, a = function(t) { return !!i(t) || null !== t && "object" == typeof t && "number" == typeof t.length && t.length >= 0 && "[object Array]" !== o(t) && "[object Function]" === o(t.callee) }, s = function() { return i(arguments) }(); i.isLegacyArguments = a, t.exports = s ? i : a }, function(t, e, n) { "use strict"; var r = n(11), o = n(13), i = o(r("String.prototype.indexOf")); t.exports = function(t, e) { var n = r(t, !!e); return "function" == typeof n && i(t, ".prototype.") > -1 ? o(n) : n } }, function(t, e, n) { "use strict"; t.exports = function() { if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) return !1; if ("symbol" == typeof Symbol.iterator) return !0; var t = {}, e = Symbol("test"), n = Object(e); if ("string" == typeof e) return !1; if ("[object Symbol]" !== Object.prototype.toString.call(e)) return !1; if ("[object Symbol]" !== Object.prototype.toString.call(n)) return !1; for (e in t[e] = 42, t) return !1; if ("function" == typeof Object.keys && 0 !== Object.keys(t).length) return !1; if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(t).length) return !1; var r = Object.getOwnPropertySymbols(t); if (1 !== r.length || r[0] !== e) return !1; if (!Object.prototype.propertyIsEnumerable.call(t, e)) return !1; if ("function" == typeof Object.getOwnPropertyDescriptor) { var o = Object.getOwnPropertyDescriptor(t, e); if (42 !== o.value || !0 !== o.enumerable) return !1 } return !0 } }, function(t, e, n) { "use strict"; var r = "Function.prototype.bind called on incompatible ", o = Array.prototype.slice, i = Object.prototype.toString; t.exports = function(t) { var e = this; if ("function" != typeof e || "[object Function]" !== i.call(e)) throw new TypeError(r + e); for (var n, a = o.call(arguments, 1), s = function() { if (this instanceof n) { var r = e.apply(this, a.concat(o.call(arguments))); return Object(r) === r ? r : this } return e.apply(t, a.concat(o.call(arguments))) }, l = Math.max(0, e.length - a.length), c = [], u = 0; u < l; u++) c.push("$" + u); if (n = Function("binder", "return function (" + c.join(",") + "){ return binder.apply(this,arguments); }")(s), e.prototype) { var d = function() {}; d.prototype = e.prototype, n.prototype = new d, d.prototype = null } return n } }, function(t, e, n) { "use strict"; var r = n(6); t.exports = r.call(Function.call, Object.prototype.hasOwnProperty) }, function(t, e, n) { "use strict"; var r = n(7), o = n(13), i = n(14), a = n(15), s = n(28), l = o(a(), Object); r(l, { getPolyfill: a, implementation: i, shim: s }), t.exports = l }, function(t, e, n) { "use strict"; var r = n(15), o = n(7); t.exports = function() { var t = r(); return o(Object, { is: t }, { is: function() { return Object.is !== t } }), t } }, function(t, e, n) { "use strict"; var r, o, i, a, s = n(8)() && "symbol" == typeof Symbol.toStringTag; if (s) { r = Function.call.bind(Object.prototype.hasOwnProperty), o = Function.call.bind(RegExp.prototype.exec), i = {}; var l = function() { throw i }; a = { toString: l, valueOf: l }, "symbol" == typeof Symbol.toPrimitive && (a[Symbol.toPrimitive] = l) } var c = Object.prototype.toString, u = Object.getOwnPropertyDescriptor; t.exports = s ? function(t) { if (!t || "object" != typeof t) return !1; var e = u(t, "lastIndex"); if (!e || !r(e, "value")) return !1; try { o(t, a) } catch (t) { return t === i } } : function(t) { return !(!t || "object" != typeof t && "function" != typeof t) && "[object RegExp]" === c.call(t) } }, function(t, e, n) { "use strict"; var r = n(7), o = n(31), i = n(16), a = n(17), s = n(33), l = o(i); r(l, { getPolyfill: a, implementation: i, shim: s }), t.exports = l }, function(t, e, n) { "use strict"; var r = n(6), o = n(32), i = o("%Function.prototype.apply%"), a = o("%Function.prototype.call%"), s = o("%Reflect.apply%", !0) || r.call(a, i), l = o("%Object.defineProperty%", !0); if (l) try { l({}, "a", { value: 1 }) } catch (t) { l = null } t.exports = function() { return s(r, a, arguments) }; var c = function() { return s(r, i, arguments) }; l ? l(t.exports, "apply", { value: c }) : t.exports.apply = c }, function(t, e, n) { "use strict"; var r = TypeError, o = Object.getOwnPropertyDescriptor; if (o) try { o({}, "") } catch (t) { o = null } var i = function() { throw new r }, a = o ? function() { try { return i } catch (t) { try { return o(arguments, "callee").get } catch (t) { return i } } }() : i, s = n(8)(), l = Object.getPrototypeOf || function(t) { return t.__proto__ }, c = "undefined" == typeof Uint8Array ? void 0 : l(Uint8Array), u = { "%Array%": Array, "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer, "%ArrayBufferPrototype%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer.prototype, "%ArrayIteratorPrototype%": s ? l([][Symbol.iterator]()) : void 0, "%ArrayPrototype%": Array.prototype, "%ArrayProto_entries%": Array.prototype.entries, "%ArrayProto_forEach%": Array.prototype.forEach, "%ArrayProto_keys%": Array.prototype.keys, "%ArrayProto_values%": Array.prototype.values, "%AsyncFromSyncIteratorPrototype%": void 0, "%AsyncFunction%": void 0, "%AsyncFunctionPrototype%": void 0, "%AsyncGenerator%": void 0, "%AsyncGeneratorFunction%": void 0, "%AsyncGeneratorPrototype%": void 0, "%AsyncIteratorPrototype%": void 0, "%Atomics%": "undefined" == typeof Atomics ? void 0 : Atomics, "%Boolean%": Boolean, "%BooleanPrototype%": Boolean.prototype, "%DataView%": "undefined" == typeof DataView ? void 0 : DataView, "%DataViewPrototype%": "undefined" == typeof DataView ? void 0 : DataView.prototype, "%Date%": Date, "%DatePrototype%": Date.prototype, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": Error, "%ErrorPrototype%": Error.prototype, "%eval%": eval, "%EvalError%": EvalError, "%EvalErrorPrototype%": EvalError.prototype, "%Float32Array%": "undefined" == typeof Float32Array ? void 0 : Float32Array, "%Float32ArrayPrototype%": "undefined" == typeof Float32Array ? void 0 : Float32Array.prototype, "%Float64Array%": "undefined" == typeof Float64Array ? void 0 : Float64Array, "%Float64ArrayPrototype%": "undefined" == typeof Float64Array ? void 0 : Float64Array.prototype, "%Function%": Function, "%FunctionPrototype%": Function.prototype, "%Generator%": void 0, "%GeneratorFunction%": void 0, "%GeneratorPrototype%": void 0, "%Int8Array%": "undefined" == typeof Int8Array ? void 0 : Int8Array, "%Int8ArrayPrototype%": "undefined" == typeof Int8Array ? void 0 : Int8Array.prototype, "%Int16Array%": "undefined" == typeof Int16Array ? void 0 : Int16Array, "%Int16ArrayPrototype%": "undefined" == typeof Int16Array ? void 0 : Int8Array.prototype, "%Int32Array%": "undefined" == typeof Int32Array ? void 0 : Int32Array, "%Int32ArrayPrototype%": "undefined" == typeof Int32Array ? void 0 : Int32Array.prototype, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": s ? l(l([][Symbol.iterator]())) : void 0, "%JSON%": "object" == typeof JSON ? JSON : void 0, "%JSONParse%": "object" == typeof JSON ? JSON.parse : void 0, "%Map%": "undefined" == typeof Map ? void 0 : Map, "%MapIteratorPrototype%": "undefined" != typeof Map && s ? l((new Map)[Symbol.iterator]()) : void 0, "%MapPrototype%": "undefined" == typeof Map ? void 0 : Map.prototype, "%Math%": Math, "%Number%": Number, "%NumberPrototype%": Number.prototype, "%Object%": Object, "%ObjectPrototype%": Object.prototype, "%ObjProto_toString%": Object.prototype.toString, "%ObjProto_valueOf%": Object.prototype.valueOf, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": "undefined" == typeof Promise ? void 0 : Promise, "%PromisePrototype%": "undefined" == typeof Promise ? void 0 : Promise.prototype, "%PromiseProto_then%": "undefined" == typeof Promise ? void 0 : Promise.prototype.then, "%Promise_all%": "undefined" == typeof Promise ? void 0 : Promise.all, "%Promise_reject%": "undefined" == typeof Promise ? void 0 : Promise.reject, "%Promise_resolve%": "undefined" == typeof Promise ? void 0 : Promise.resolve, "%Proxy%": "undefined" == typeof Proxy ? void 0 : Proxy, "%RangeError%": RangeError, "%RangeErrorPrototype%": RangeError.prototype, "%ReferenceError%": ReferenceError, "%ReferenceErrorPrototype%": ReferenceError.prototype, "%Reflect%": "undefined" == typeof Reflect ? void 0 : Reflect, "%RegExp%": RegExp, "%RegExpPrototype%": RegExp.prototype, "%Set%": "undefined" == typeof Set ? void 0 : Set, "%SetIteratorPrototype%": "undefined" != typeof Set && s ? l((new Set)[Symbol.iterator]()) : void 0, "%SetPrototype%": "undefined" == typeof Set ? void 0 : Set.prototype, "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer, "%SharedArrayBufferPrototype%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer.prototype, "%String%": String, "%StringIteratorPrototype%": s ? l("" [Symbol.iterator]()) : void 0, "%StringPrototype%": String.prototype, "%Symbol%": s ? Symbol : void 0, "%SymbolPrototype%": s ? Symbol.prototype : void 0, "%SyntaxError%": SyntaxError, "%SyntaxErrorPrototype%": SyntaxError.prototype, "%ThrowTypeError%": a, "%TypedArray%": c, "%TypedArrayPrototype%": c ? c.prototype : void 0, "%TypeError%": r, "%TypeErrorPrototype%": r.prototype, "%Uint8Array%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array, "%Uint8ArrayPrototype%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array.prototype, "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray, "%Uint8ClampedArrayPrototype%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray.prototype, "%Uint16Array%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array, "%Uint16ArrayPrototype%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array.prototype, "%Uint32Array%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array, "%Uint32ArrayPrototype%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array.prototype, "%URIError%": URIError, "%URIErrorPrototype%": URIError.prototype, "%WeakMap%": "undefined" == typeof WeakMap ? void 0 : WeakMap, "%WeakMapPrototype%": "undefined" == typeof WeakMap ? void 0 : WeakMap.prototype, "%WeakSet%": "undefined" == typeof WeakSet ? void 0 : WeakSet, "%WeakSetPrototype%": "undefined" == typeof WeakSet ? void 0 : WeakSet.prototype }, d = n(6).call(Function.call, String.prototype.replace), h = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, f = /\\(\\)?/g, p = function(t) { var e = []; return d(t, h, (function(t, n, r, o) { e[e.length] = r ? d(o, f, "$1") : n || t })), e }, g = function(t, e) { if (!(t in u)) throw new SyntaxError("intrinsic " + t + " does not exist!"); if (void 0 === u[t] && !e) throw new r("intrinsic " + t + " exists, but is not available. Please file an issue!"); return u[t] }; t.exports = function(t, e) { if ("string" != typeof t || 0 === t.length) throw new TypeError("intrinsic name must be a non-empty string"); if (arguments.length > 1 && "boolean" != typeof e) throw new TypeError('"allowMissing" argument must be a boolean'); for (var n = p(t), i = g("%" + (n.length > 0 ? n[0] : "") + "%", e), a = 1; a < n.length; a += 1) if (null != i) if (o && a + 1 >= n.length) { var s = o(i, n[a]); if (!e && !(n[a] in i)) throw new r("base intrinsic for " + t + " exists, but the property is not available."); i = s && "get" in s && !("originalValue" in s.get) ? s.get : i[n[a]] } else i = i[n[a]]; return i } }, function(t, e, n) { "use strict"; var r = n(7).supportsDescriptors, o = n(17), i = Object.getOwnPropertyDescriptor, a = Object.defineProperty, s = TypeError, l = Object.getPrototypeOf, c = /a/; t.exports = function() { if (!r || !l) throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors"); var t = o(), e = l(c), n = i(e, "flags"); return n && n.get === t || a(e, "flags", { configurable: !0, enumerable: !1, get: t }), t } }, function(t, e, n) { "use strict"; var r = Date.prototype.getDay, o = Object.prototype.toString, i = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag; t.exports = function(t) { return "object" == typeof t && null !== t && (i ? function(t) { try { return r.call(t), !0 } catch (t) { return !1 } }(t) : "[object Date]" === o.call(t)) } }, function(t, e, n) { "use strict"; (function(t) { var r = n(36), o = n(37), i = n(38); function a() { return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823 } function s(t, e) { if (a() < e) throw new RangeError("Invalid typed array length"); return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)).__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t } function l(t, e, n) { if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, n); if ("number" == typeof t) { if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string"); return d(this, t) } return c(this, t, e, n) } function c(t, e, n, r) { if ("number" == typeof e) throw new TypeError('"value" argument must not be a number'); return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, n, r) { if (e.byteLength, n < 0 || e.byteLength < n) throw new RangeError("'offset' is out of bounds"); if (e.byteLength < n + (r || 0)) throw new RangeError("'length' is out of bounds"); return e = void 0 === n && void 0 === r ? new Uint8Array(e) : void 0 === r ? new Uint8Array(e, n) : new Uint8Array(e, n, r), l.TYPED_ARRAY_SUPPORT ? (t = e).__proto__ = l.prototype : t = h(t, e), t }(t, e, n, r) : "string" == typeof e ? function(t, e, n) { if ("string" == typeof n && "" !== n || (n = "utf8"), !l.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding'); var r = 0 | p(e, n), o = (t = s(t, r)).write(e, n); return o !== r && (t = t.slice(0, o)), t }(t, e, n) : function(t, e) { if (l.isBuffer(e)) { var n = 0 | f(e.length); return 0 === (t = s(t, n)).length || e.copy(t, 0, 0, n), t } if (e) { if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (r = e.length) != r ? s(t, 0) : h(t, e); if ("Buffer" === e.type && i(e.data)) return h(t, e.data) } var r; throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.") }(t, e) } function u(t) { if ("number" != typeof t) throw new TypeError('"size" argument must be a number'); if (t < 0) throw new RangeError('"size" argument must not be negative') } function d(t, e) { if (u(e), t = s(t, e < 0 ? 0 : 0 | f(e)), !l.TYPED_ARRAY_SUPPORT) for (var n = 0; n < e; ++n) t[n] = 0; return t } function h(t, e) { var n = e.length < 0 ? 0 : 0 | f(e.length); t = s(t, n); for (var r = 0; r < n; r += 1) t[r] = 255 & e[r]; return t } function f(t) { if (t >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a().toString(16) + " bytes"); return 0 | t } function p(t, e) { if (l.isBuffer(t)) return t.length; if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength; "string" != typeof t && (t = "" + t); var n = t.length; if (0 === n) return 0; for (var r = !1;;) switch (e) { case "ascii": case "latin1": case "binary": return n; case "utf8": case "utf-8": case void 0: return F(t).length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return 2 * n; case "hex": return n >>> 1; case "base64": return j(t).length; default: if (r) return F(t).length; e = ("" + e).toLowerCase(), r = !0 } } function g(t, e, n) { var r = !1; if ((void 0 === e || e < 0) && (e = 0), e > this.length) return ""; if ((void 0 === n || n > this.length) && (n = this.length), n <= 0) return ""; if ((n >>>= 0) <= (e >>>= 0)) return ""; for (t || (t = "utf8");;) switch (t) { case "hex": return R(this, e, n); case "utf8": case "utf-8": return S(this, e, n); case "ascii": return L(this, e, n); case "latin1": case "binary": return N(this, e, n); case "base64": return I(this, e, n); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return w(this, e, n); default: if (r) throw new TypeError("Unknown encoding: " + t); t = (t + "").toLowerCase(), r = !0 } } function y(t, e, n) { var r = t[e]; t[e] = t[n], t[n] = r } function m(t, e, n, r, o) { if (0 === t.length) return -1; if ("string" == typeof n ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, isNaN(n) && (n = o ? 0 : t.length - 1), n < 0 && (n = t.length + n), n >= t.length) { if (o) return -1; n = t.length - 1 } else if (n < 0) { if (!o) return -1; n = 0 } if ("string" == typeof e && (e = l.from(e, r)), l.isBuffer(e)) return 0 === e.length ? -1 : b(t, e, n, r, o); if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(t, e, n) : Uint8Array.prototype.lastIndexOf.call(t, e, n) : b(t, [e], n, r, o); throw new TypeError("val must be string, number or Buffer") } function b(t, e, n, r, o) { var i, a = 1, s = t.length, l = e.length; if (void 0 !== r && ("ucs2" === (r = String(r).toLowerCase()) || "ucs-2" === r || "utf16le" === r || "utf-16le" === r)) { if (t.length < 2 || e.length < 2) return -1; a = 2, s /= 2, l /= 2, n /= 2 } function c(t, e) { return 1 === a ? t[e] : t.readUInt16BE(e * a) } if (o) { var u = -1; for (i = n; i < s; i++) if (c(t, i) === c(e, -1 === u ? 0 : i - u)) { if (-1 === u && (u = i), i - u + 1 === l) return u * a } else -1 !== u && (i -= i - u), u = -1 } else for (n + l > s && (n = s - l), i = n; i >= 0; i--) { for (var d = !0, h = 0; h < l; h++) if (c(t, i + h) !== c(e, h)) { d = !1; break } if (d) return i } return -1 } function E(t, e, n, r) { n = Number(n) || 0; var o = t.length - n; r ? (r = Number(r)) > o && (r = o) : r = o; var i = e.length; if (i % 2 != 0) throw new TypeError("Invalid hex string"); r > i / 2 && (r = i / 2); for (var a = 0; a < r; ++a) { var s = parseInt(e.substr(2 * a, 2), 16); if (isNaN(s)) return a; t[n + a] = s } return a } function A(t, e, n, r) { return q(F(e, t.length - n), t, n, r) } function v(t, e, n, r) { return q(function(t) { for (var e = [], n = 0; n < t.length; ++n) e.push(255 & t.charCodeAt(n)); return e }(e), t, n, r) } function T(t, e, n, r) { return v(t, e, n, r) } function O(t, e, n, r) { return q(j(e), t, n, r) } function _(t, e, n, r) { return q(function(t, e) { for (var n, r, o, i = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) r = (n = t.charCodeAt(a)) >> 8, o = n % 256, i.push(o), i.push(r); return i }(e, t.length - n), t, n, r) } function I(t, e, n) { return 0 === e && n === t.length ? r.fromByteArray(t) : r.fromByteArray(t.slice(e, n)) } function S(t, e, n) { n = Math.min(t.length, n); for (var r = [], o = e; o < n;) { var i, a, s, l, c = t[o], u = null, d = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1; if (o + d <= n) switch (d) { case 1: c < 128 && (u = c); break; case 2: 128 == (192 & (i = t[o + 1])) && (l = (31 & c) << 6 | 63 & i) > 127 && (u = l); break; case 3: i = t[o + 1], a = t[o + 2], 128 == (192 & i) && 128 == (192 & a) && (l = (15 & c) << 12 | (63 & i) << 6 | 63 & a) > 2047 && (l < 55296 || l > 57343) && (u = l); break; case 4: i = t[o + 1], a = t[o + 2], s = t[o + 3], 128 == (192 & i) && 128 == (192 & a) && 128 == (192 & s) && (l = (15 & c) << 18 | (63 & i) << 12 | (63 & a) << 6 | 63 & s) > 65535 && l < 1114112 && (u = l) } null === u ? (u = 65533, d = 1) : u > 65535 && (u -= 65536, r.push(u >>> 10 & 1023 | 55296), u = 56320 | 1023 & u), r.push(u), o += d } return function(t) { var e = t.length; if (e <= 4096) return String.fromCharCode.apply(String, t); for (var n = "", r = 0; r < e;) n += String.fromCharCode.apply(String, t.slice(r, r += 4096)); return n }(r) } function L(t, e, n) { var r = ""; n = Math.min(t.length, n); for (var o = e; o < n; ++o) r += String.fromCharCode(127 & t[o]); return r } function N(t, e, n) { var r = ""; n = Math.min(t.length, n); for (var o = e; o < n; ++o) r += String.fromCharCode(t[o]); return r } function R(t, e, n) { var r = t.length; (!e || e < 0) && (e = 0), (!n || n < 0 || n > r) && (n = r); for (var o = "", i = e; i < n; ++i) o += W(t[i]); return o } function w(t, e, n) { for (var r = t.slice(e, n), o = "", i = 0; i < r.length; i += 2) o += String.fromCharCode(r[i] + 256 * r[i + 1]); return o } function x(t, e, n) { if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint"); if (t + e > n) throw new RangeError("Trying to access beyond buffer length") } function M(t, e, n, r, o, i) { if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (e > o || e < i) throw new RangeError('"value" argument is out of bounds'); if (n + r > t.length) throw new RangeError("Index out of range") } function D(t, e, n, r) { e < 0 && (e = 65535 + e + 1); for (var o = 0, i = Math.min(t.length - n, 2); o < i; ++o) t[n + o] = (e & 255 << 8 * (r ? o : 1 - o)) >>> 8 * (r ? o : 1 - o) } function C(t, e, n, r) { e < 0 && (e = 4294967295 + e + 1); for (var o = 0, i = Math.min(t.length - n, 4); o < i; ++o) t[n + o] = e >>> 8 * (r ? o : 3 - o) & 255 } function k(t, e, n, r, o, i) { if (n + r > t.length) throw new RangeError("Index out of range"); if (n < 0) throw new RangeError("Index out of range") } function P(t, e, n, r, i) { return i || k(t, 0, n, 4), o.write(t, e, n, r, 23, 4), n + 4 } function U(t, e, n, r, i) { return i || k(t, 0, n, 8), o.write(t, e, n, r, 52, 8), n + 8 } e.Buffer = l, e.SlowBuffer = function(t) { return +t != t && (t = 0), l.alloc(+t) }, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() { try { var t = new Uint8Array(1); return t.__proto__ = { __proto__: Uint8Array.prototype, foo: function() { return 42 } }, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1).byteLength } catch (t) { return !1 } }(), e.kMaxLength = a(), l.poolSize = 8192, l._augment = function(t) { return t.__proto__ = l.prototype, t }, l.from = function(t, e, n) { return c(null, t, e, n) }, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, { value: null, configurable: !0 })), l.alloc = function(t, e, n) { return function(t, e, n, r) { return u(e), e <= 0 ? s(t, e) : void 0 !== n ? "string" == typeof r ? s(t, e).fill(n, r) : s(t, e).fill(n) : s(t, e) }(null, t, e, n) }, l.allocUnsafe = function(t) { return d(null, t) }, l.allocUnsafeSlow = function(t) { return d(null, t) }, l.isBuffer = function(t) { return !(null == t || !t._isBuffer) }, l.compare = function(t, e) { if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers"); if (t === e) return 0; for (var n = t.length, r = e.length, o = 0, i = Math.min(n, r); o < i; ++o) if (t[o] !== e[o]) { n = t[o], r = e[o]; break } return n < r ? -1 : r < n ? 1 : 0 }, l.isEncoding = function(t) { switch (String(t).toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "latin1": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return !0; default: return !1 } }, l.concat = function(t, e) { if (!i(t)) throw new TypeError('"list" argument must be an Array of Buffers'); if (0 === t.length) return l.alloc(0); var n; if (void 0 === e) for (e = 0, n = 0; n < t.length; ++n) e += t[n].length; var r = l.allocUnsafe(e), o = 0; for (n = 0; n < t.length; ++n) { var a = t[n]; if (!l.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers'); a.copy(r, o), o += a.length } return r }, l.byteLength = p, l.prototype._isBuffer = !0, l.prototype.swap16 = function() { var t = this.length; if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); for (var e = 0; e < t; e += 2) y(this, e, e + 1); return this }, l.prototype.swap32 = function() { var t = this.length; if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); for (var e = 0; e < t; e += 4) y(this, e, e + 3), y(this, e + 1, e + 2); return this }, l.prototype.swap64 = function() { var t = this.length; if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); for (var e = 0; e < t; e += 8) y(this, e, e + 7), y(this, e + 1, e + 6), y(this, e + 2, e + 5), y(this, e + 3, e + 4); return this }, l.prototype.toString = function() { var t = 0 | this.length; return 0 === t ? "" : 0 === arguments.length ? S(this, 0, t) : g.apply(this, arguments) }, l.prototype.equals = function(t) { if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer"); return this === t || 0 === l.compare(this, t) }, l.prototype.inspect = function() { var t = "", n = e.INSPECT_MAX_BYTES; return this.length > 0 && (t = this.toString("hex", 0, n).match(/.{2}/g).join(" "), this.length > n && (t += " ... ")), "" }, l.prototype.compare = function(t, e, n, r, o) { if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer"); if (void 0 === e && (e = 0), void 0 === n && (n = t ? t.length : 0), void 0 === r && (r = 0), void 0 === o && (o = this.length), e < 0 || n > t.length || r < 0 || o > this.length) throw new RangeError("out of range index"); if (r >= o && e >= n) return 0; if (r >= o) return -1; if (e >= n) return 1; if (this === t) return 0; for (var i = (o >>>= 0) - (r >>>= 0), a = (n >>>= 0) - (e >>>= 0), s = Math.min(i, a), c = this.slice(r, o), u = t.slice(e, n), d = 0; d < s; ++d) if (c[d] !== u[d]) { i = c[d], a = u[d]; break } return i < a ? -1 : a < i ? 1 : 0 }, l.prototype.includes = function(t, e, n) { return -1 !== this.indexOf(t, e, n) }, l.prototype.indexOf = function(t, e, n) { return m(this, t, e, n, !0) }, l.prototype.lastIndexOf = function(t, e, n) { return m(this, t, e, n, !1) }, l.prototype.write = function(t, e, n, r) { if (void 0 === e) r = "utf8", n = this.length, e = 0; else if (void 0 === n && "string" == typeof e) r = e, n = this.length, e = 0; else { if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); e |= 0, isFinite(n) ? (n |= 0, void 0 === r && (r = "utf8")) : (r = n, n = void 0) } var o = this.length - e; if ((void 0 === n || n > o) && (n = o), t.length > 0 && (n < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds"); r || (r = "utf8"); for (var i = !1;;) switch (r) { case "hex": return E(this, t, e, n); case "utf8": case "utf-8": return A(this, t, e, n); case "ascii": return v(this, t, e, n); case "latin1": case "binary": return T(this, t, e, n); case "base64": return O(this, t, e, n); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return _(this, t, e, n); default: if (i) throw new TypeError("Unknown encoding: " + r); r = ("" + r).toLowerCase(), i = !0 } }, l.prototype.toJSON = function() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) } }, l.prototype.slice = function(t, e) { var n, r = this.length; if ((t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t), l.TYPED_ARRAY_SUPPORT)(n = this.subarray(t, e)).__proto__ = l.prototype; else { var o = e - t; n = new l(o, void 0); for (var i = 0; i < o; ++i) n[i] = this[i + t] } return n }, l.prototype.readUIntLE = function(t, e, n) { t |= 0, e |= 0, n || x(t, e, this.length); for (var r = this[t], o = 1, i = 0; ++i < e && (o *= 256);) r += this[t + i] * o; return r }, l.prototype.readUIntBE = function(t, e, n) { t |= 0, e |= 0, n || x(t, e, this.length); for (var r = this[t + --e], o = 1; e > 0 && (o *= 256);) r += this[t + --e] * o; return r }, l.prototype.readUInt8 = function(t, e) { return e || x(t, 1, this.length), this[t] }, l.prototype.readUInt16LE = function(t, e) { return e || x(t, 2, this.length), this[t] | this[t + 1] << 8 }, l.prototype.readUInt16BE = function(t, e) { return e || x(t, 2, this.length), this[t] << 8 | this[t + 1] }, l.prototype.readUInt32LE = function(t, e) { return e || x(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3] }, l.prototype.readUInt32BE = function(t, e) { return e || x(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]) }, l.prototype.readIntLE = function(t, e, n) { t |= 0, e |= 0, n || x(t, e, this.length); for (var r = this[t], o = 1, i = 0; ++i < e && (o *= 256);) r += this[t + i] * o; return r >= (o *= 128) && (r -= Math.pow(2, 8 * e)), r }, l.prototype.readIntBE = function(t, e, n) { t |= 0, e |= 0, n || x(t, e, this.length); for (var r = e, o = 1, i = this[t + --r]; r > 0 && (o *= 256);) i += this[t + --r] * o; return i >= (o *= 128) && (i -= Math.pow(2, 8 * e)), i }, l.prototype.readInt8 = function(t, e) { return e || x(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t] }, l.prototype.readInt16LE = function(t, e) { e || x(t, 2, this.length); var n = this[t] | this[t + 1] << 8; return 32768 & n ? 4294901760 | n : n }, l.prototype.readInt16BE = function(t, e) { e || x(t, 2, this.length); var n = this[t + 1] | this[t] << 8; return 32768 & n ? 4294901760 | n : n }, l.prototype.readInt32LE = function(t, e) { return e || x(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24 }, l.prototype.readInt32BE = function(t, e) { return e || x(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3] }, l.prototype.readFloatLE = function(t, e) { return e || x(t, 4, this.length), o.read(this, t, !0, 23, 4) }, l.prototype.readFloatBE = function(t, e) { return e || x(t, 4, this.length), o.read(this, t, !1, 23, 4) }, l.prototype.readDoubleLE = function(t, e) { return e || x(t, 8, this.length), o.read(this, t, !0, 52, 8) }, l.prototype.readDoubleBE = function(t, e) { return e || x(t, 8, this.length), o.read(this, t, !1, 52, 8) }, l.prototype.writeUIntLE = function(t, e, n, r) { t = +t, e |= 0, n |= 0, r || M(this, t, e, n, Math.pow(2, 8 * n) - 1, 0); var o = 1, i = 0; for (this[e] = 255 & t; ++i < n && (o *= 256);) this[e + i] = t / o & 255; return e + n }, l.prototype.writeUIntBE = function(t, e, n, r) { t = +t, e |= 0, n |= 0, r || M(this, t, e, n, Math.pow(2, 8 * n) - 1, 0); var o = n - 1, i = 1; for (this[e + o] = 255 & t; --o >= 0 && (i *= 256);) this[e + o] = t / i & 255; return e + n }, l.prototype.writeUInt8 = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1 }, l.prototype.writeUInt16LE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : D(this, t, e, !0), e + 2 }, l.prototype.writeUInt16BE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : D(this, t, e, !1), e + 2 }, l.prototype.writeUInt32LE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : C(this, t, e, !0), e + 4 }, l.prototype.writeUInt32BE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : C(this, t, e, !1), e + 4 }, l.prototype.writeIntLE = function(t, e, n, r) { if (t = +t, e |= 0, !r) { var o = Math.pow(2, 8 * n - 1); M(this, t, e, n, o - 1, -o) } var i = 0, a = 1, s = 0; for (this[e] = 255 & t; ++i < n && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + i - 1] && (s = 1), this[e + i] = (t / a >> 0) - s & 255; return e + n }, l.prototype.writeIntBE = function(t, e, n, r) { if (t = +t, e |= 0, !r) { var o = Math.pow(2, 8 * n - 1); M(this, t, e, n, o - 1, -o) } var i = n - 1, a = 1, s = 0; for (this[e + i] = 255 & t; --i >= 0 && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + i + 1] && (s = 1), this[e + i] = (t / a >> 0) - s & 255; return e + n }, l.prototype.writeInt8 = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1 }, l.prototype.writeInt16LE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : D(this, t, e, !0), e + 2 }, l.prototype.writeInt16BE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : D(this, t, e, !1), e + 2 }, l.prototype.writeInt32LE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : C(this, t, e, !0), e + 4 }, l.prototype.writeInt32BE = function(t, e, n) { return t = +t, e |= 0, n || M(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : C(this, t, e, !1), e + 4 }, l.prototype.writeFloatLE = function(t, e, n) { return P(this, t, e, !0, n) }, l.prototype.writeFloatBE = function(t, e, n) { return P(this, t, e, !1, n) }, l.prototype.writeDoubleLE = function(t, e, n) { return U(this, t, e, !0, n) }, l.prototype.writeDoubleBE = function(t, e, n) { return U(this, t, e, !1, n) }, l.prototype.copy = function(t, e, n, r) { if (n || (n = 0), r || 0 === r || (r = this.length), e >= t.length && (e = t.length), e || (e = 0), r > 0 && r < n && (r = n), r === n) return 0; if (0 === t.length || 0 === this.length) return 0; if (e < 0) throw new RangeError("targetStart out of bounds"); if (n < 0 || n >= this.length) throw new RangeError("sourceStart out of bounds"); if (r < 0) throw new RangeError("sourceEnd out of bounds"); r > this.length && (r = this.length), t.length - e < r - n && (r = t.length - e + n); var o, i = r - n; if (this === t && n < e && e < r) for (o = i - 1; o >= 0; --o) t[o + e] = this[o + n]; else if (i < 1e3 || !l.TYPED_ARRAY_SUPPORT) for (o = 0; o < i; ++o) t[o + e] = this[o + n]; else Uint8Array.prototype.set.call(t, this.subarray(n, n + i), e); return i }, l.prototype.fill = function(t, e, n, r) { if ("string" == typeof t) { if ("string" == typeof e ? (r = e, e = 0, n = this.length) : "string" == typeof n && (r = n, n = this.length), 1 === t.length) { var o = t.charCodeAt(0); o < 256 && (t = o) } if (void 0 !== r && "string" != typeof r) throw new TypeError("encoding must be a string"); if ("string" == typeof r && !l.isEncoding(r)) throw new TypeError("Unknown encoding: " + r) } else "number" == typeof t && (t &= 255); if (e < 0 || this.length < e || this.length < n) throw new RangeError("Out of range index"); if (n <= e) return this; var i; if (e >>>= 0, n = void 0 === n ? this.length : n >>> 0, t || (t = 0), "number" == typeof t) for (i = e; i < n; ++i) this[i] = t; else { var a = l.isBuffer(t) ? t : F(new l(t, r).toString()), s = a.length; for (i = 0; i < n - e; ++i) this[i + e] = a[i % s] } return this }; var B = /[^+\/0-9A-Za-z-_]/g; function W(t) { return t < 16 ? "0" + t.toString(16) : t.toString(16) } function F(t, e) { var n; e = e || 1 / 0; for (var r = t.length, o = null, i = [], a = 0; a < r; ++a) { if ((n = t.charCodeAt(a)) > 55295 && n < 57344) { if (!o) { if (n > 56319) { (e -= 3) > -1 && i.push(239, 191, 189); continue } if (a + 1 === r) { (e -= 3) > -1 && i.push(239, 191, 189); continue } o = n; continue } if (n < 56320) { (e -= 3) > -1 && i.push(239, 191, 189), o = n; continue } n = 65536 + (o - 55296 << 10 | n - 56320) } else o && (e -= 3) > -1 && i.push(239, 191, 189); if (o = null, n < 128) { if ((e -= 1) < 0) break; i.push(n) } else if (n < 2048) { if ((e -= 2) < 0) break; i.push(n >> 6 | 192, 63 & n | 128) } else if (n < 65536) { if ((e -= 3) < 0) break; i.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128) } else { if (!(n < 1114112)) throw new Error("Invalid code point"); if ((e -= 4) < 0) break; i.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128) } } return i } function j(t) { return r.toByteArray(function(t) { if ((t = function(t) { return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "") }(t).replace(B, "")).length < 2) return ""; for (; t.length % 4 != 0;) t += "="; return t }(t)) } function q(t, e, n, r) { for (var o = 0; o < r && !(o + n >= e.length || o >= t.length); ++o) e[o + n] = t[o]; return o } }).call(this, n(12)) }, function(t, e, n) { "use strict"; e.byteLength = function(t) { var e = c(t), n = e[0], r = e[1]; return 3 * (n + r) / 4 - r }, e.toByteArray = function(t) { var e, n, r = c(t), a = r[0], s = r[1], l = new i(function(t, e, n) { return 3 * (e + n) / 4 - n }(0, a, s)), u = 0, d = s > 0 ? a - 4 : a; for (n = 0; n < d; n += 4) e = o[t.charCodeAt(n)] << 18 | o[t.charCodeAt(n + 1)] << 12 | o[t.charCodeAt(n + 2)] << 6 | o[t.charCodeAt(n + 3)], l[u++] = e >> 16 & 255, l[u++] = e >> 8 & 255, l[u++] = 255 & e; return 2 === s && (e = o[t.charCodeAt(n)] << 2 | o[t.charCodeAt(n + 1)] >> 4, l[u++] = 255 & e), 1 === s && (e = o[t.charCodeAt(n)] << 10 | o[t.charCodeAt(n + 1)] << 4 | o[t.charCodeAt(n + 2)] >> 2, l[u++] = e >> 8 & 255, l[u++] = 255 & e), l }, e.fromByteArray = function(t) { for (var e, n = t.length, o = n % 3, i = [], a = 0, s = n - o; a < s; a += 16383) i.push(u(t, a, a + 16383 > s ? s : a + 16383)); return 1 === o ? (e = t[n - 1], i.push(r[e >> 2] + r[e << 4 & 63] + "==")) : 2 === o && (e = (t[n - 2] << 8) + t[n - 1], i.push(r[e >> 10] + r[e >> 4 & 63] + r[e << 2 & 63] + "=")), i.join("") }; for (var r = [], o = [], i = "undefined" != typeof Uint8Array ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, l = a.length; s < l; ++s) r[s] = a[s], o[a.charCodeAt(s)] = s; function c(t) { var e = t.length; if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); var n = t.indexOf("="); return -1 === n && (n = e), [n, n === e ? 0 : 4 - n % 4] } function u(t, e, n) { for (var o, i, a = [], s = e; s < n; s += 3) o = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), a.push(r[(i = o) >> 18 & 63] + r[i >> 12 & 63] + r[i >> 6 & 63] + r[63 & i]); return a.join("") } o["-".charCodeAt(0)] = 62, o["_".charCodeAt(0)] = 63 }, function(t, e) { e.read = function(t, e, n, r, o) { var i, a, s = 8 * o - r - 1, l = (1 << s) - 1, c = l >> 1, u = -7, d = n ? o - 1 : 0, h = n ? -1 : 1, f = t[e + d]; for (d += h, i = f & (1 << -u) - 1, f >>= -u, u += s; u > 0; i = 256 * i + t[e + d], d += h, u -= 8); for (a = i & (1 << -u) - 1, i >>= -u, u += r; u > 0; a = 256 * a + t[e + d], d += h, u -= 8); if (0 === i) i = 1 - c; else { if (i === l) return a ? NaN : 1 / 0 * (f ? -1 : 1); a += Math.pow(2, r), i -= c } return (f ? -1 : 1) * a * Math.pow(2, i - r) }, e.write = function(t, e, n, r, o, i) { var a, s, l, c = 8 * i - o - 1, u = (1 << c) - 1, d = u >> 1, h = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = r ? 0 : i - 1, p = r ? 1 : -1, g = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0; for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = u) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + d >= 1 ? h / l : h * Math.pow(2, 1 - d)) * l >= 2 && (a++, l /= 2), a + d >= u ? (s = 0, a = u) : a + d >= 1 ? (s = (e * l - 1) * Math.pow(2, o), a += d) : (s = e * Math.pow(2, d - 1) * Math.pow(2, o), a = 0)); o >= 8; t[n + f] = 255 & s, f += p, s /= 256, o -= 8); for (a = a << o | s, c += o; c > 0; t[n + f] = 255 & a, f += p, a /= 256, c -= 8); t[n + f - p] |= 128 * g } }, function(t, e) { var n = {}.toString; t.exports = Array.isArray || function(t) { return "[object Array]" == n.call(t) } }, function(t, e, n) {}, function(t, e, n) { "use strict"; n.r(e); var r = n(0), o = n.n(r), i = (n(19), n(1)), a = n.n(i), s = n(5), l = n.n(s), c = n(2), u = n.n(c); class d extends o.a.Embed { static value() {} insertInto(t, e) { 0 === t.children.length ? super.insertInto(t, e) : this.remove() } length() { return 0 } value() { return "" } } d.blotName = "break", d.tagName = "BR"; var h = d; class f extends o.a.Text {} var p = f; class g extends o.a.Inline { static compare(t, e) { let n = g.order.indexOf(t), r = g.order.indexOf(e); return n >= 0 || r >= 0 ? n - r : t === e ? 0 : t < e ? -1 : 1 } formatAt(t, e, n, r) { if (g.compare(this.statics.blotName, n) < 0 && o.a.query(n, o.a.Scope.BLOT)) { let o = this.isolate(t, e); r && o.wrap(n, r) } else super.formatAt(t, e, n, r) } optimize(t) { if (super.optimize(t), this.parent instanceof g && g.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { let t = this.parent.isolate(this.offset(), this.length()); this.moveChildren(t), t.wrap(this) } } } g.allowedChildren = [g, o.a.Embed, p], g.order = ["cursor", "inline", "underline", "strike", "italic", "bold", "script", "link", "code"]; var y = g; class m extends o.a.Embed { attach() { super.attach(), this.attributes = new o.a.Attributor.Store(this.domNode) } delta() { return (new a.a).insert(this.value(), u()(this.formats(), this.attributes.values())) } format(t, e) { let n = o.a.query(t, o.a.Scope.BLOCK_ATTRIBUTE); null != n && this.attributes.attribute(n, e) } formatAt(t, e, n, r) { this.format(n, r) } insertAt(t, e, n) { if ("string" == typeof e && e.endsWith("\n")) { let n = o.a.create(b.blotName); this.parent.insertBefore(n, 0 === t ? this : this.next), n.insertAt(0, e.slice(0, -1)) } else super.insertAt(t, e, n) } } m.scope = o.a.Scope.BLOCK_BLOT; class b extends o.a.Block { constructor(t) { super(t), this.cache = {} } delta() { return null == this.cache.delta && (this.cache.delta = this.descendants(o.a.Leaf).reduce(((t, e) => 0 === e.length() ? t : t.insert(e.value(), E(e))), new a.a).insert("\n", E(this))), this.cache.delta } deleteAt(t, e) { super.deleteAt(t, e), this.cache = {} } formatAt(t, e, n, r) { e <= 0 || (o.a.query(n, o.a.Scope.BLOCK) ? t + e === this.length() && this.format(n, r) : super.formatAt(t, Math.min(e, this.length() - t - 1), n, r), this.cache = {}) } insertAt(t, e, n) { if (null != n) return super.insertAt(t, e, n); if (0 === e.length) return; let r = e.split("\n"), o = r.shift(); o.length > 0 && (t < this.length() - 1 || null == this.children.tail ? super.insertAt(Math.min(t, this.length() - 1), o) : this.children.tail.insertAt(this.children.tail.length(), o), this.cache = {}); let i = this; r.reduce((function(t, e) { return i = i.split(t, !0), i.insertAt(0, e), e.length }), t + o.length) } insertBefore(t, e) { let n = this.children.head; super.insertBefore(t, e), n instanceof h && n.remove(), this.cache = {} } length() { return null == this.cache.length && (this.cache.length = super.length() + 1), 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, e = !1) { if (e && (0 === t || t >= this.length() - 1)) { let e = this.clone(); return 0 === t ? (this.parent.insertBefore(e, this), this) : (this.parent.insertBefore(e, this.next), e) } { let n = super.split(t, e); return this.cache = {}, n } } } function E(t, e = {}) { return null == t ? e : ("function" == typeof t.formats && (e = u()(e, t.formats())), null == t.parent || "scroll" == t.parent.blotName || t.parent.statics.scope !== t.statics.scope ? e : E(t.parent, e)) } b.blotName = "block", b.tagName = "P", b.defaultChild = "break", b.allowedChildren = [y, o.a.Embed, p]; class A extends y {} A.blotName = "code", A.tagName = "CODE"; class v extends b { static create(t) { let e = super.create(t); return e.setAttribute("spellcheck", !1), e } static formats() { return !0 } delta() { let t = this.domNode.textContent; return t.endsWith("\n") && (t = t.slice(0, -1)), t.split("\n").reduce(((t, e) => t.insert(e).insert("\n", this.formats())), new a.a) } format(t, e) { if (t === this.statics.blotName && e) return; let [n] = this.descendant(p, this.length() - 1); null != n && n.deleteAt(n.length() - 1, 1), super.format(t, e) } formatAt(t, e, n, r) { if (0 === e) return; if (null == o.a.query(n, o.a.Scope.BLOCK) || n === this.statics.blotName && r === this.statics.formats(this.domNode)) return; let i = this.newlineIndex(t); if (i < 0 || i >= t + e) return; let a = this.newlineIndex(t, !0) + 1, s = i - a + 1, l = this.isolate(a, s), c = l.next; l.format(n, r), c instanceof v && c.formatAt(0, t - a + e - s, n, r) } insertAt(t, e, n) { if (null != n) return; let [r, o] = this.descendant(p, t); r.insertAt(o, e) } length() { let t = this.domNode.textContent.length; return this.domNode.textContent.endsWith("\n") ? t : t + 1 } newlineIndex(t, e = !1) { if (e) return this.domNode.textContent.slice(0, t).lastIndexOf("\n"); { let e = this.domNode.textContent.slice(t).indexOf("\n"); return e > -1 ? t + e : -1 } } optimize(t) { this.domNode.textContent.endsWith("\n") || this.appendChild(o.a.create("text", "\n")), super.optimize(t); let e = this.next; null != e && e.prev === this && e.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === e.statics.formats(e.domNode) && (e.optimize(t), e.moveChildren(this), e.remove()) } replace(t) { super.replace(t), [].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t) { let e = o.a.find(t); null == e ? t.parentNode.removeChild(t) : e instanceof o.a.Embed ? e.remove() : e.unwrap() })) } } v.blotName = "code-block", v.tagName = "PRE", v.TAB = " "; class T extends o.a.Embed { static value() {} constructor(t, e) { super(t), this.selection = e, this.textNode = document.createTextNode(T.CONTENTS), this.domNode.appendChild(this.textNode), this._length = 0 } detach() { null != this.parent && this.parent.removeChild(this) } format(t, e) { if (0 !== this._length) return super.format(t, e); let n = this, r = 0; for (; null != n && n.statics.scope !== o.a.Scope.BLOCK_BLOT;) r += n.offset(n.parent), n = n.parent; null != n && (this._length = T.CONTENTS.length, n.optimize(), n.formatAt(r, T.CONTENTS.length, t, e), this._length = 0) } index(t, e) { return t === this.textNode ? 0 : super.index(t, e) } length() { return this._length } position() { return [this.textNode, this.textNode.data.length] } remove() { super.remove(), this.parent = null } restore() { if (this.selection.composing || null == this.parent) return; let t, e, n, r = this.textNode, i = this.selection.getNativeRange(); for (null != i && i.start.node === r && i.end.node === r && ([t, e, n] = [r, i.start.offset, i.end.offset]); null != this.domNode.lastChild && this.domNode.lastChild !== this.textNode;) this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); if (this.textNode.data !== T.CONTENTS) { let e = this.textNode.data.split(T.CONTENTS).join(""); this.next instanceof p ? (t = this.next.domNode, this.next.insertAt(0, e), this.textNode.data = T.CONTENTS) : (this.textNode.data = e, this.parent.insertBefore(o.a.create(this.textNode), this), this.textNode = document.createTextNode(T.CONTENTS), this.domNode.appendChild(this.textNode)) } return this.remove(), null != e ? ([e, n] = [e, n].map((function(e) { return Math.max(0, Math.min(t.data.length, e - 1)) })), { startNode: t, startOffset: e, endNode: t, endOffset: n }) : void 0 } update(t, e) { if (t.some((t => "characterData" === t.type && t.target === this.textNode))) { let t = this.restore(); t && (e.range = t) } } value() { return "" } } T.blotName = "cursor", T.className = "ql-cursor", T.tagName = "span", T.CONTENTS = "\ufeff"; var O = T, _ = n(3), I = n.n(_), S = n(4), L = n.n(S); const N = /^[ -~]*$/; function R(t, e) { return Object.keys(e).reduce((function(n, r) { return null == t[r] || (e[r] === t[r] ? n[r] = e[r] : Array.isArray(e[r]) ? e[r].indexOf(t[r]) < 0 && (n[r] = e[r].concat([t[r]])) : n[r] = [e[r], t[r]]), n }), {}) } var w = n(18), x = n.n(w); let M = ["error", "warn", "log", "info"], D = "warn"; function C(t, ...e) { M.indexOf(t) <= M.indexOf(D) && console[t](...e) } function k(t) { return M.reduce((function(e, n) { return e[n] = C.bind(console, n, t), e }), {}) } C.level = k.level = function(t) { D = t }; var P = k; let U = P("quill:events"); ["selectionchange", "mousedown", "mouseup", "click"].forEach((function(t) { document.addEventListener(t, ((...t) => { [].slice.call(document.querySelectorAll(".ql-container")).forEach((e => { e.__quill && e.__quill.emitter && e.__quill.emitter.handleDOM(...t) })) })) })); class B extends x.a { constructor() { super(), this.listeners = {}, this.on("error", U.error) } emit() { U.log.apply(U, arguments), super.emit.apply(this, arguments) } handleDOM(t, ...e) { (this.listeners[t.type] || []).forEach((function({ node: n, handler: r }) { (t.target === n || n.contains(t.target)) && r(t, ...e) })) } listenDOM(t, e, n) { this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push({ node: e, handler: n }) } } B.events = { EDITOR_CHANGE: "editor-change", SCROLL_BEFORE_UPDATE: "scroll-before-update", SCROLL_OPTIMIZE: "scroll-optimize", SCROLL_UPDATE: "scroll-update", SELECTION_CHANGE: "selection-change", TEXT_CHANGE: "text-change" }, B.sources = { API: "api", SILENT: "silent", USER: "user" }; var W = B; class F { constructor(t, e = {}) { this.quill = t, this.options = e } } F.DEFAULTS = {}; var j = F; let q = P("quill:selection"); class V { constructor(t, e = 0) { this.index = t, this.length = e } } class G { constructor(t, e) { this.emitter = e, this.scroll = t, this.composing = !1, this.mouseDown = !1, this.root = this.scroll.domNode, this.cursor = o.a.create("cursor", this), this.lastRange = this.savedRange = new V(0, 0), this.handleComposition(), this.handleDragging(), this.emitter.listenDOM("selectionchange", document, (() => { this.mouseDown || setTimeout(this.update.bind(this, W.sources.USER), 1) })), this.emitter.on(W.events.EDITOR_CHANGE, ((t, e) => { t === W.events.TEXT_CHANGE && e.length() > 0 && this.update(W.sources.SILENT) })), this.emitter.on(W.events.SCROLL_BEFORE_UPDATE, (() => { if (!this.hasFocus()) return; let t = this.getNativeRange(); null != t && t.start.node !== this.cursor.textNode && this.emitter.once(W.events.SCROLL_UPDATE, (() => { try { this.setNativeRange(t.start.node, t.start.offset, t.end.node, t.end.offset) } catch (t) {} })) })), this.emitter.on(W.events.SCROLL_OPTIMIZE, ((t, e) => { if (e.range) { const { startNode: t, startOffset: n, endNode: r, endOffset: o } = e.range; this.setNativeRange(t, n, r, o) } })), this.update(W.sources.SILENT) } handleComposition() { this.root.addEventListener("compositionstart", (() => { this.composing = !0 })), this.root.addEventListener("compositionend", (() => { if (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) } })) } handleDragging() { this.emitter.listenDOM("mousedown", document.body, (() => { this.mouseDown = !0 })), this.emitter.listenDOM("mouseup", document.body, (() => { this.mouseDown = !1, this.update(W.sources.USER) })) } focus() { this.hasFocus() || (this.root.focus(), this.setRange(this.savedRange)) } format(t, e) { if (null != this.scroll.whitelist && !this.scroll.whitelist[t]) return; this.scroll.update(); let n = this.getNativeRange(); if (null != n && n.native.collapsed && !o.a.query(t, o.a.Scope.BLOCK)) { if (n.start.node !== this.cursor.textNode) { let t = o.a.find(n.start.node, !1); if (null == t) return; if (t instanceof o.a.Leaf) { let e = t.split(n.start.offset); t.parent.insertBefore(this.cursor, e) } else t.insertBefore(this.cursor, n.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, e = 0) { let n = this.scroll.length(); t = Math.min(t, n - 1), e = Math.min(t + e, n - 1) - t; let r, [o, i] = this.scroll.leaf(t); if (null == o) return null; [r, i] = o.position(i, !0); let a = document.createRange(); if (e > 0) return a.setStart(r, i), [o, i] = this.scroll.leaf(t + e), null == o ? null : ([r, i] = o.position(i, !0), a.setEnd(r, i), a.getBoundingClientRect()); { let t, e = "left"; return r instanceof Text ? (i < r.data.length ? (a.setStart(r, i), a.setEnd(r, i + 1)) : (a.setStart(r, i - 1), a.setEnd(r, i), e = "right"), t = a.getBoundingClientRect()) : (t = o.domNode.getBoundingClientRect(), i > 0 && (e = "right")), { bottom: t.top + t.height, height: t.height, left: t[e], right: t[e], top: t.top, width: 0 } } } getNativeRange() { let t = document.getSelection(); if (null == t || t.rangeCount <= 0) return null; let e = t.getRangeAt(0); if (null == e) return null; let n = this.normalizeNative(e); return q.info("getNativeRange", n), n } getRange() { let t = this.getNativeRange(); return null == t ? [null, null] : [this.normalizedToRange(t), t] } hasFocus() { return document.activeElement === this.root } normalizedToRange(t) { let e = [ [t.start.node, t.start.offset] ]; t.native.collapsed || e.push([t.end.node, t.end.offset]); let n = e.map((t => { let [e, n] = t, r = o.a.find(e, !0), i = r.offset(this.scroll); return 0 === n ? i : r instanceof o.a.Container ? i + r.length() : i + r.index(e, n) })), r = Math.min(Math.max(...n), this.scroll.length() - 1), i = Math.min(r, ...n); return new V(i, r - i) } normalizeNative(t) { if (!K(this.root, t.startContainer) || !t.collapsed && !K(this.root, t.endContainer)) return null; let e = { start: { node: t.startContainer, offset: t.startOffset }, end: { node: t.endContainer, offset: t.endOffset }, native: t }; return [e.start, e.end].forEach((function(t) { let e = t.node, n = t.offset; for (; !(e instanceof Text) && e.childNodes.length > 0;) if (e.childNodes.length > n) e = e.childNodes[n], n = 0; else { if (e.childNodes.length !== n) break; e = e.lastChild, n = e instanceof Text ? e.data.length : e.childNodes.length + 1 } t.node = e, t.offset = n })), e } rangeToNative(t) { let e = t.collapsed ? [t.index] : [t.index, t.index + t.length], n = [], r = this.scroll.length(); return e.forEach(((t, e) => { t = Math.min(r - 1, t); let o, [i, a] = this.scroll.leaf(t); [o, a] = i.position(a, 0 !== e), n.push(o, a) })), n.length < 2 && (n = n.concat(n)), n } scrollIntoView(t) { let e = this.lastRange; if (null == e) return; let n = this.getBounds(e.index, e.length); if (null == n) return; let r = this.scroll.length() - 1, [o] = this.scroll.line(Math.min(e.index, r)), i = o; if (e.length > 0 && ([i] = this.scroll.line(Math.min(e.index + e.length, r))), null == o || null == i) return; let a = t.getBoundingClientRect(); n.top < a.top ? t.scrollTop -= a.top - n.top : n.bottom > a.bottom && (t.scrollTop += n.bottom - a.bottom) } setNativeRange(t, e, n = t, r = e, o = !1) { if (q.info("setNativeRange", t, e, n, r), null != t && (null == this.root.parentNode || null == t.parentNode || null == n.parentNode)) return; let i = document.getSelection(); if (null != i) if (null != t) { this.hasFocus() || this.root.focus(); let a = (this.getNativeRange() || {}).native; if (null == a || o || t !== a.startContainer || e !== a.startOffset || n !== a.endContainer || r !== a.endOffset) { "BR" == t.tagName && (e = [].indexOf.call(t.parentNode.childNodes, t), t = t.parentNode), "BR" == n.tagName && (r = [].indexOf.call(n.parentNode.childNodes, n), n = n.parentNode); let o = document.createRange(); o.setStart(t, e), o.setEnd(n, r), i.removeAllRanges(), i.addRange(o) } } else i.removeAllRanges(), this.root.blur(), document.body.focus() } setRange(t, e = !1, n = W.sources.API) { if ("string" == typeof e && (n = e, e = !1), q.info("setRange", t), null != t) { let n = this.rangeToNative(t); this.setNativeRange(...n, e) } else this.setNativeRange(null); this.update(n) } update(t = W.sources.USER) { let e = this.lastRange, [n, r] = this.getRange(); if (this.lastRange = n, null != this.lastRange && (this.savedRange = this.lastRange), !L()(e, this.lastRange)) { !this.composing && null != r && r.native.collapsed && r.start.node !== this.cursor.textNode && this.cursor.restore(); let n = [W.events.SELECTION_CHANGE, I()(this.lastRange), I()(e), t]; this.emitter.emit(W.events.EDITOR_CHANGE, ...n), t !== W.sources.SILENT && this.emitter.emit(...n) } } } function K(t, e) { try { e.parentNode } catch (t) { return !1 } return e instanceof Text && (e = e.parentNode), t.contains(e) } class H { 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) { let e = this.quill.constructor.import("modules/" + t); return this.modules[t] = new e(this.quill, this.options.modules[t] || {}), this.modules[t] } } H.DEFAULTS = { modules: {} }, H.themes = { default: H }; var Z = H; let z = P("quill"); class Y { static debug(t) { !0 === t && (t = "log"), P.level(t) } static find(t) { return t.__quill || o.a.find(t) } static import(t) { return null == this.imports[t] && z.error(`Cannot import ${t}. Are you sure it was registered?`), this.imports[t] } static register(t, e, n = !1) { if ("string" != typeof t) { let n = t.attrName || t.blotName; "string" == typeof n ? this.register("formats/" + n, t, e) : Object.keys(t).forEach((n => { this.register(n, t[n], e) })) } else null == this.imports[t] || n || z.warn(`Overwriting ${t} with`, e), this.imports[t] = e, (t.startsWith("blots/") || t.startsWith("formats/")) && "abstract" !== e.blotName ? o.a.register(e) : t.startsWith("modules") && "function" == typeof e.register && e.register() } constructor(t, e = {}) { if (this.options = function(t, e) { if ((e = u()(!0, { container: t, modules: { clipboard: !0, keyboard: !0, history: !0 } }, e)).theme && e.theme !== Y.DEFAULTS.theme) { if (e.theme = Y.import("themes/" + e.theme), null == e.theme) throw new Error(`Invalid theme ${e.theme}. Did you register it?`) } else e.theme = Z; let n = u()(!0, {}, e.theme.DEFAULTS); [n, e].forEach((function(t) { t.modules = t.modules || {}, Object.keys(t.modules).forEach((function(e) { !0 === t.modules[e] && (t.modules[e] = {}) })) })); let r = Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t, e) { let n = Y.import("modules/" + e); return null == n ? z.error(`Cannot load ${e} module. Are you sure you registered it?`) : t[e] = n.DEFAULTS || {}, t }), {}); return null != e.modules && e.modules.toolbar && e.modules.toolbar.constructor !== Object && (e.modules.toolbar = { container: e.modules.toolbar }), e = u()(!0, {}, Y.DEFAULTS, { modules: r }, n, e), ["bounds", "container", "scrollingContainer"].forEach((function(t) { "string" == typeof e[t] && (e[t] = document.querySelector(e[t])) })), e.modules = Object.keys(e.modules).reduce((function(t, n) { return e.modules[n] && (t[n] = e.modules[n]), t }), {}), e }(t, e), this.container = this.options.container, null == this.container) return z.error("Invalid Quill container", t); this.options.debug && Y.debug(this.options.debug); let n = this.container.innerHTML.trim(); this.container.classList.add("ql-container"), this.container.innerHTML = "", this.container.__quill = 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 W, this.scroll = o.a.create(this.root, { emitter: this.emitter, whitelist: this.options.formats }), this.editor = new class { constructor(t) { this.scroll = t, this.delta = this.getDelta() } applyDelta(t) { let e = !1; this.scroll.update(); let n = this.scroll.length(); return this.scroll.batchStart(), (t = function(t) { return t.reduce((function(t, e) { if (1 === e.insert) { let n = I()(e.attributes); return delete n.image, t.insert({ image: e.attributes.image }, n) } if (null == e.attributes || !0 !== e.attributes.list && !0 !== e.attributes.bullet || ((e = I()(e)).attributes.list ? e.attributes.list = "ordered" : (e.attributes.list = "bullet", delete e.attributes.bullet)), "string" == typeof e.insert) { let n = e.insert.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); return t.insert(n, e.attributes) } return t.push(e) }), new a.a) }(t)).reduce(((t, r) => { let i = r.retain || r.delete || r.insert.length || 1, a = r.attributes || {}; if (null != r.insert) { if ("string" == typeof r.insert) { let i = r.insert; i.endsWith("\n") && e && (e = !1, i = i.slice(0, -1)), t >= n && !i.endsWith("\n") && (e = !0), this.scroll.insertAt(t, i); let [s, c] = this.scroll.line(t), d = u()({}, E(s)); if (s instanceof b) { let [t] = s.descendant(o.a.Leaf, c); d = u()(d, E(t)) } a = l.a.attributes.diff(d, a) || {} } else if ("object" == typeof r.insert) { let e = Object.keys(r.insert)[0]; if (null == e) return t; this.scroll.insertAt(t, e, r.insert[e]) } n += i } return Object.keys(a).forEach((e => { this.scroll.formatAt(t, i, e, a[e]) })), t + i }), 0), t.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.update(t) } deleteText(t, e) { return this.scroll.deleteAt(t, e), this.update((new a.a).retain(t).delete(e)) } formatLine(t, e, n = {}) { return this.scroll.update(), Object.keys(n).forEach((r => { if (null != this.scroll.whitelist && !this.scroll.whitelist[r]) return; let o = this.scroll.lines(t, Math.max(e, 1)), i = e; o.forEach((e => { let o = e.length(); if (e instanceof v) { let o = t - e.offset(this.scroll), a = e.newlineIndex(o + i) - o + 1; e.formatAt(o, a, r, n[r]) } else e.format(r, n[r]); i -= o })) })), this.scroll.optimize(), this.update((new a.a).retain(t).retain(e, I()(n))) } formatText(t, e, n = {}) { return Object.keys(n).forEach((r => { this.scroll.formatAt(t, e, r, n[r]) })), this.update((new a.a).retain(t).retain(e, I()(n))) } getContents(t, e) { return this.delta.slice(t, t + e) } getDelta() { return this.scroll.lines().reduce(((t, e) => t.concat(e.delta())), new a.a) } getFormat(t, e = 0) { let n = [], r = []; 0 === e ? this.scroll.path(t).forEach((function(t) { let [e] = t; e instanceof b ? n.push(e) : e instanceof o.a.Leaf && r.push(e) })) : (n = this.scroll.lines(t, e), r = this.scroll.descendants(o.a.Leaf, t, e)); let i = [n, r].map((function(t) { if (0 === t.length) return {}; let e = E(t.shift()); for (; Object.keys(e).length > 0;) { let n = t.shift(); if (null == n) return e; e = R(E(n), e) } return e })); return u.a.apply(u.a, i) } getText(t, e) { return this.getContents(t, e).filter((function(t) { return "string" == typeof t.insert })).map((function(t) { return t.insert })).join("") } insertEmbed(t, e, n) { return this.scroll.insertAt(t, e, n), this.update((new a.a).retain(t).insert({ [e]: n })) } insertText(t, e, n = {}) { return e = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), this.scroll.insertAt(t, e), Object.keys(n).forEach((r => { this.scroll.formatAt(t, e.length, r, n[r]) })), this.update((new a.a).retain(t).insert(e, I()(n))) } isBlank() { if (0 == this.scroll.children.length) return !0; if (this.scroll.children.length > 1) return !1; let t = this.scroll.children.head; return t.statics.blotName === b.blotName && !(t.children.length > 1) && t.children.head instanceof h } removeFormat(t, e) { let n = this.getText(t, e), [r, o] = this.scroll.line(t + e), i = 0, s = new a.a; null != r && (i = r instanceof v ? r.newlineIndex(o) - o + 1 : r.length() - o, s = r.delta().slice(o, o + i - 1).insert("\n")); let l = this.getContents(t, e + i).diff((new a.a).insert(n).concat(s)), c = (new a.a).retain(t).concat(l); return this.applyDelta(c) } update(t, e = [], n) { let r = this.delta; if (1 === e.length && "characterData" === e[0].type && e[0].target.data.match(N) && o.a.find(e[0].target)) { let i = o.a.find(e[0].target), s = E(i), l = i.offset(this.scroll), c = e[0].oldValue.replace(O.CONTENTS, ""), u = (new a.a).insert(c), d = (new a.a).insert(i.value()); t = (new a.a).retain(l).concat(u.diff(d, n)).reduce((function(t, e) { return e.insert ? t.insert(e.insert, s) : t.push(e) }), new a.a), this.delta = r.compose(t) } else this.delta = this.getDelta(), t && L()(r.compose(t), this.delta) || (t = r.diff(this.delta, n)); return t } }(this.scroll), this.selection = new G(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.theme.init(), this.emitter.on(W.events.EDITOR_CHANGE, (t => { t === W.events.TEXT_CHANGE && this.root.classList.toggle("ql-blank", this.editor.isBlank()) })), this.emitter.on(W.events.SCROLL_UPDATE, ((t, e) => { let n = this.selection.lastRange, r = n && 0 === n.length ? n.index : void 0; X.call(this, (() => this.editor.update(null, e, r)), t) })); let r = this.clipboard.convert(`
${n}


`); this.setContents(r), this.history.clear(), this.options.placeholder && this.root.setAttribute("data-placeholder", this.options.placeholder), this.options.readOnly && this.disable() } addContainer(t, e = null) { if ("string" == typeof t) { let e = t; (t = document.createElement("div")).classList.add(e) } return this.container.insertBefore(t, e), t } blur() { this.selection.setRange(null) } deleteText(t, e, n) { return [t, e, , n] = Q(t, e, n), X.call(this, (() => this.editor.deleteText(t, e)), n, t, -1 * e) } disable() { this.enable(!1) } enable(t = !0) { this.scroll.enable(t), this.container.classList.toggle("ql-disabled", !t) } focus() { let t = this.scrollingContainer.scrollTop; this.selection.focus(), this.scrollingContainer.scrollTop = t, this.scrollIntoView() } format(t, e, n = W.sources.API) { return X.call(this, (() => { let n = this.getSelection(!0), r = new a.a; if (null == n) return r; if (o.a.query(t, o.a.Scope.BLOCK)) r = this.editor.formatLine(n.index, n.length, { [t]: e }); else { if (0 === n.length) return this.selection.format(t, e), r; r = this.editor.formatText(n.index, n.length, { [t]: e }) } return this.setSelection(n, W.sources.SILENT), r }), n) } formatLine(t, e, n, r, o) { let i; return [t, e, i, o] = Q(t, e, n, r, o), X.call(this, (() => this.editor.formatLine(t, e, i)), o, t, 0) } formatText(t, e, n, r, o) { let i; return [t, e, i, o] = Q(t, e, n, r, o), X.call(this, (() => this.editor.formatText(t, e, i)), o, t, 0) } getBounds(t, e = 0) { let n; n = "number" == typeof t ? this.selection.getBounds(t, e) : this.selection.getBounds(t.index, t.length); let r = this.container.getBoundingClientRect(); return { bottom: n.bottom - r.top, height: n.height, left: n.left - r.left, right: n.right - r.left, top: n.top - r.top, width: n.width } } getContents(t = 0, e = this.getLength() - t) { return [t, e] = Q(t, e), this.editor.getContents(t, e) } getFormat(t = this.getSelection(!0), e = 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(t = 0, e = 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(t = !1) { return t && this.focus(), this.update(), this.selection.getRange()[0] } getText(t = 0, e = this.getLength() - t) { return [t, e] = Q(t, e), this.editor.getText(t, e) } hasFocus() { return this.selection.hasFocus() } insertEmbed(t, e, n, r = Y.sources.API) { return X.call(this, (() => this.editor.insertEmbed(t, e, n)), r, t) } insertText(t, e, n, r, o) { let i; return [t, , i, o] = Q(t, 0, n, r, o), X.call(this, (() => this.editor.insertText(t, e, i)), o, t, e.length) } isEnabled() { return !this.container.classList.contains("ql-disabled") } off() { return this.emitter.off.apply(this.emitter, arguments) } on() { return this.emitter.on.apply(this.emitter, arguments) } once() { return this.emitter.once.apply(this.emitter, arguments) } pasteHTML(t, e, n) { this.clipboard.dangerouslyPasteHTML(t, e, n) } removeFormat(t, e, n) { return [t, e, , n] = Q(t, e, n), X.call(this, (() => this.editor.removeFormat(t, e)), n, t) } scrollIntoView() { this.selection.scrollIntoView(this.scrollingContainer) } setContents(t, e = W.sources.API) { return X.call(this, (() => { t = new a.a(t); let e = this.getLength(), n = this.editor.deleteText(0, e), r = this.editor.applyDelta(t), o = r.ops[r.ops.length - 1]; return null != o && "string" == typeof o.insert && "\n" === o.insert[o.insert.length - 1] && (this.editor.deleteText(this.getLength() - 1, 1), r.delete(1)), n.compose(r) }), e) } setSelection(t, e, n) { null == t ? this.selection.setRange(null, e || Y.sources.API) : ([t, e, , n] = Q(t, e, n), this.selection.setRange(new V(t, e), n), n !== W.sources.SILENT && this.selection.scrollIntoView(this.scrollingContainer)) } setText(t, e = W.sources.API) { let n = (new a.a).insert(t); return this.setContents(n, e) } update(t = W.sources.USER) { let e = this.scroll.update(t); return this.selection.update(t), e } updateContents(t, e = W.sources.API) { return X.call(this, (() => (t = new a.a(t), this.editor.applyDelta(t, e))), e, !0) } } function X(t, e, n, r) { if (this.options.strict && !this.isEnabled() && e === W.sources.USER) return new a.a; let o = null == n ? null : this.getSelection(), i = this.editor.delta, s = t(); if (null != o && (!0 === n && (n = o.index), null == r ? o = $(o, s, e) : 0 !== r && (o = $(o, n, r, e)), this.setSelection(o, W.sources.SILENT)), s.length() > 0) { let t = [W.events.TEXT_CHANGE, s, i, e]; this.emitter.emit(W.events.EDITOR_CHANGE, ...t), e !== W.sources.SILENT && this.emitter.emit(...t) } return s } function Q(t, e, n, r, o) { let i = {}; return "number" == typeof t.index && "number" == typeof t.length ? "number" != typeof e ? (o = r, r = n, n = e, e = t.length, t = t.index) : (e = t.length, t = t.index) : "number" != typeof e && (o = r, r = n, n = e, e = 0), "object" == typeof n ? (i = n, o = r) : "string" == typeof n && (null != r ? i[n] = r : o = n), [t, e, i, o = o || W.sources.API] } function $(t, e, n, r) { if (null == t) return null; let o, i; return e instanceof a.a ? [o, i] = [t.index, t.index + t.length].map((function(t) { return e.transformPosition(t, r !== W.sources.USER) })) : [o, i] = [t.index, t.index + t.length].map((function(t) { return t < e || t === e && r === W.sources.USER ? t : n >= 0 ? t + n : Math.max(e, t + n) })), new V(o, i - o) } Y.DEFAULTS = { bounds: null, formats: null, modules: {}, placeholder: "", readOnly: !1, scrollingContainer: null, strict: !0, theme: "default" }, Y.events = W.events, Y.sources = W.sources, Y.version = "undefined" == typeof QUILL_VERSION ? "dev" : QUILL_VERSION, Y.imports = { delta: a.a, parchment: o.a, "core/module": j, "core/theme": Z }; class J extends o.a.Container {} J.allowedChildren = [b, m, J]; var tt = J; class et extends o.a.Embed { constructor(t) { super(t), this.contentNode = document.createElement("span"), this.contentNode.setAttribute("contenteditable", !1), [].slice.call(this.domNode.childNodes).forEach((t => { this.contentNode.appendChild(t) })), this.leftGuard = document.createTextNode("\ufeff"), this.rightGuard = document.createTextNode("\ufeff"), 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, n, r = t.data.split("\ufeff").join(""); if (t === this.leftGuard) if (this.prev instanceof p) { let t = this.prev.length(); this.prev.insertAt(t, r), e = { startNode: this.prev.domNode, startOffset: t + r.length } } else n = document.createTextNode(r), this.parent.insertBefore(o.a.create(n), this), e = { startNode: n, startOffset: r.length }; else t === this.rightGuard && (this.next instanceof p ? (this.next.insertAt(0, r), e = { startNode: this.next.domNode, startOffset: r.length }) : (n = document.createTextNode(r), this.parent.insertBefore(o.a.create(n), this.next), e = { startNode: n, startOffset: r.length })); return t.data = "\ufeff", e } update(t, e) { t.forEach((t => { if ("characterData" === t.type && (t.target === this.leftGuard || t.target === this.rightGuard)) { let n = this.restore(t.target); n && (e.range = n) } })) } } var nt = et; function rt(t) { return t instanceof b || t instanceof m } class ot extends o.a.Scroll { constructor(t, e) { super(t), this.emitter = e.emitter, Array.isArray(e.whitelist) && (this.whitelist = e.whitelist.reduce((function(t, e) { return t[e] = !0, t }), {})), this.domNode.addEventListener("DOMNodeInserted", (function() {})), this.optimize(), this.enable() } batchStart() { this.batch = !0 } batchEnd() { this.batch = !1, this.optimize() } deleteAt(t, e) { let [n, r] = this.line(t), [o] = this.line(t + e); if (super.deleteAt(t, e), null != o && n !== o && r > 0) { if (n instanceof m || o instanceof m) return void this.optimize(); if (n instanceof v) { let t = n.newlineIndex(n.length(), !0); if (t > -1 && (n = n.split(t + 1), n === o)) return void this.optimize() } else if (o instanceof v) { let t = o.newlineIndex(0); t > -1 && o.split(t + 1) } let t = o.children.head instanceof h ? null : o.children.head; n.moveChildren(o, t), n.remove() } this.optimize() } enable(t = !0) { this.domNode.setAttribute("contenteditable", t) } formatAt(t, e, n, r) { (null == this.whitelist || this.whitelist[n]) && (super.formatAt(t, e, n, r), this.optimize()) } insertAt(t, e, n) { if (null == n || null == this.whitelist || this.whitelist[e]) { if (t >= this.length()) if (null == n || null == o.a.query(e, o.a.Scope.BLOCK)) { let t = o.a.create(this.statics.defaultChild); this.appendChild(t), null == n && e.endsWith("\n") && (e = e.slice(0, -1)), t.insertAt(0, e, n) } else { let t = o.a.create(e, n); this.appendChild(t) } else super.insertAt(t, e, n); this.optimize() } } insertBefore(t, e) { if (t.statics.scope === o.a.Scope.INLINE_BLOT) { let e = o.a.create(this.statics.defaultChild); e.appendChild(t), t = e } super.insertBefore(t, e) } leaf(t) { return this.path(t).pop() || [null, -1] } line(t) { return t === this.length() ? this.line(t - 1) : this.descendant(rt, t) } lines(t = 0, e = Number.MAX_VALUE) { let n = (t, e, r) => { let i = [], a = r; return t.children.forEachAt(e, r, (function(t, e, r) { rt(t) ? i.push(t) : t instanceof o.a.Container && (i = i.concat(n(t, e, a))), a -= r })), i }; return n(this, t, e) } optimize(t = [], e = {}) { !0 !== this.batch && (super.optimize(t, e), t.length > 0 && this.emitter.emit(W.events.SCROLL_OPTIMIZE, t, e)) } path(t) { return super.path(t).slice(1) } update(t) { if (!0 === this.batch) return; let e = W.sources.USER; "string" == typeof t && (e = t), Array.isArray(t) || (t = this.observer.takeRecords()), t.length > 0 && this.emitter.emit(W.events.SCROLL_BEFORE_UPDATE, e, t), super.update(t.concat([])), t.length > 0 && this.emitter.emit(W.events.SCROLL_UPDATE, e, t) } } ot.blotName = "scroll", ot.className = "ql-editor", ot.tagName = "DIV", ot.defaultChild = "block", ot.allowedChildren = [b, m, tt]; var it = ot; let at = { scope: o.a.Scope.BLOCK, whitelist: ["right", "center", "justify"] }, st = new o.a.Attributor.Attribute("align", "align", at), lt = new o.a.Attributor.Class("align", "ql-align", at), ct = new o.a.Attributor.Style("align", "text-align", at); class ut extends o.a.Attributor.Style { value(t) { let e = super.value(t); return e.startsWith("rgb(") ? (e = e.replace(/^[^\d]+/, "").replace(/[^\d]+$/, ""), "#" + e.split(",").map((function(t) { return ("00" + parseInt(t).toString(16)).slice(-2) })).join("")) : e } } new o.a.Attributor.Class("color", "ql-color", { scope: o.a.Scope.INLINE }); let dt = new ut("color", "color", { scope: o.a.Scope.INLINE }), ht = (new o.a.Attributor.Class("background", "ql-bg", { scope: o.a.Scope.INLINE }), new ut("background", "background-color", { scope: o.a.Scope.INLINE })), ft = { scope: o.a.Scope.BLOCK, whitelist: ["rtl"] }, pt = new o.a.Attributor.Attribute("direction", "dir", ft), gt = (new o.a.Attributor.Class("direction", "ql-direction", ft), new o.a.Attributor.Style("direction", "direction", ft)), yt = { scope: o.a.Scope.INLINE, whitelist: ["serif", "monospace"] }; new o.a.Attributor.Class("font", "ql-font", yt); class mt extends o.a.Attributor.Style { value(t) { return super.value(t).replace(/["']/g, "") } } let bt = new mt("font", "font-family", yt), Et = (new o.a.Attributor.Class("size", "ql-size", { scope: o.a.Scope.INLINE, whitelist: ["small", "large", "huge"] }), new o.a.Attributor.Style("size", "font-size", { scope: o.a.Scope.INLINE, whitelist: ["10px", "18px", "32px"] })), At = P("quill:clipboard"); const vt = "__ql-matcher", Tt = [ [Node.TEXT_NODE, function(t, e) { let n = t.data; if ("O:P" === t.parentNode.tagName) return e.insert(n.trim()); if (0 === n.trim().length && t.parentNode.classList.contains("ql-clipboard")) return e; if (!Lt(t.parentNode).whiteSpace.startsWith("pre")) { let e = function(t, e) { return (e = e.replace(/[^\u00a0]/g, "")).length < 1 && t ? " " : e }; n = n.replace(/\r\n/g, " ").replace(/\n/g, " "), n = n.replace(/\s\s+/g, e.bind(e, !0)), (null == t.previousSibling && Rt(t.parentNode) || null != t.previousSibling && Rt(t.previousSibling)) && (n = n.replace(/^\s+/, e.bind(e, !1))), (null == t.nextSibling && Rt(t.parentNode) || null != t.nextSibling && Rt(t.nextSibling)) && (n = n.replace(/\s+$/, e.bind(e, !1))) } return e.insert(n) }], [Node.TEXT_NODE, xt], ["br", function(t, e) { return Nt(e, "\n") || e.insert("\n"), e }], [Node.ELEMENT_NODE, xt], [Node.ELEMENT_NODE, function(t, e) { let n = o.a.query(t); if (null == n) return e; if (n.prototype instanceof o.a.Embed) { let r = {}, o = n.value(t); null != o && (r[n.blotName] = o, e = (new a.a).insert(r, n.formats(t))) } else "function" == typeof n.formats && (e = St(e, n.blotName, n.formats(t))); return e }], [Node.ELEMENT_NODE, Mt], [Node.ELEMENT_NODE, function(t, e) { let n = o.a.Attributor.Attribute.keys(t), r = o.a.Attributor.Class.keys(t), i = o.a.Attributor.Style.keys(t), a = {}; return n.concat(r).concat(i).forEach((e => { let n = o.a.query(e, o.a.Scope.ATTRIBUTE); null != n && (a[n.attrName] = n.value(t), a[n.attrName]) || (n = Ot[e], null == n || n.attrName !== e && n.keyName !== e || (a[n.attrName] = n.value(t) || void 0), n = _t[e], null == n || n.attrName !== e && n.keyName !== e || (n = _t[e], a[n.attrName] = n.value(t) || void 0)) })), Object.keys(a).length > 0 && (e = St(e, a)), e }], [Node.ELEMENT_NODE, function(t, e) { let n = {}, r = t.style || {}; return r.fontStyle && "italic" === Lt(t).fontStyle && (n.italic = !0), r.fontWeight && (Lt(t).fontWeight.startsWith("bold") || parseInt(Lt(t).fontWeight) >= 700) && (n.bold = !0), Object.keys(n).length > 0 && (e = St(e, n)), parseFloat(r.textIndent || 0) > 0 && (e = (new a.a).insert("\t").concat(e)), e }], ["li", function(t, e) { let n = o.a.query(t); if (null == n || "list-item" !== n.blotName || !Nt(e, "\n")) return e; let r = -1, i = t.parentNode; for (; !i.classList.contains("ql-clipboard");) "list" === (o.a.query(i) || {}).blotName && (r += 1), i = i.parentNode; return r <= 0 ? e : e.compose((new a.a).retain(e.length() - 1).retain(1, { indent: r })) }], ["b", wt.bind(wt, "bold")], ["i", wt.bind(wt, "italic")], ["style", function() { return new a.a }] ], Ot = [st, pt].reduce((function(t, e) { return t[e.keyName] = e, t }), {}), _t = [ct, ht, dt, gt, bt, Et].reduce((function(t, e) { return t[e.keyName] = e, t }), {}); class It extends j { constructor(t, e) { super(t, e), this.quill.root.addEventListener("paste", this.onPaste.bind(this)), this.container = this.quill.addContainer("ql-clipboard"), this.container.setAttribute("contenteditable", !0), this.container.setAttribute("tabindex", -1), this.matchers = [], Tt.concat(this.options.matchers).forEach((([t, n]) => { (e.matchVisual || n !== Mt) && this.addMatcher(t, n) })) } addMatcher(t, e) { this.matchers.push([t, e]) } convert(t) { if ("string" == typeof t) return this.container.innerHTML = t.replace(/\>\r?\n +\<"), this.convert(); const e = this.quill.getFormat(this.quill.selection.savedRange.index); if (e[v.blotName]) { const t = this.container.innerText; return this.container.innerHTML = "", (new a.a).insert(t, { [v.blotName]: e[v.blotName] }) } let [n, r] = this.prepareMatching(), o = function t(e, n, r) { return e.nodeType === e.TEXT_NODE ? r.reduce((function(t, n) { return n(e, t) }), new a.a) : e.nodeType === e.ELEMENT_NODE ? [].reduce.call(e.childNodes || [], ((o, i) => { let a = t(i, n, r); return i.nodeType === e.ELEMENT_NODE && (a = n.reduce((function(t, e) { return e(i, t) }), a), a = (i[vt] || []).reduce((function(t, e) { return e(i, t) }), a)), o.concat(a) }), new a.a) : new a.a }(this.container, n, r); return Nt(o, "\n") && null == o.ops[o.ops.length - 1].attributes && (o = o.compose((new a.a).retain(o.length() - 1).delete(1))), At.log("convert", this.container.innerHTML, o), this.container.innerHTML = "", o } dangerouslyPasteHTML(t, e, n = Y.sources.API) { if ("string" == typeof t) this.quill.setContents(this.convert(t), e), this.quill.setSelection(0, Y.sources.SILENT); else { let r = this.convert(e); this.quill.updateContents((new a.a).retain(t).concat(r), n), this.quill.setSelection(t + r.length(), Y.sources.SILENT) } } onPaste(t) { if (t.defaultPrevented || !this.quill.isEnabled()) return; let e = this.quill.getSelection(), n = (new a.a).retain(e.index), r = this.quill.scrollingContainer.scrollTop; this.container.focus(), this.quill.selection.update(Y.sources.SILENT), setTimeout((() => { n = n.concat(this.convert()).delete(e.length), this.quill.updateContents(n, Y.sources.USER), this.quill.setSelection(n.length() - e.length, Y.sources.SILENT), this.quill.scrollingContainer.scrollTop = r, this.quill.focus() }), 1) } prepareMatching() { let t = [], e = []; return this.matchers.forEach((n => { let [r, o] = n; switch (r) { case Node.TEXT_NODE: e.push(o); break; case Node.ELEMENT_NODE: t.push(o); break; default: [].forEach.call(this.container.querySelectorAll(r), (t => { t[vt] = t[vt] || [], t[vt].push(o) })) } })), [t, e] } } function St(t, e, n) { return "object" == typeof e ? Object.keys(e).reduce((function(t, n) { return St(t, n, e[n]) }), t) : t.reduce((function(t, r) { return r.attributes && r.attributes[e] ? t.push(r) : t.insert(r.insert, u()({}, { [e]: n }, r.attributes)) }), new a.a) } function Lt(t) { return t.nodeType !== Node.ELEMENT_NODE ? {} : t["__ql-computed-style"] || (t["__ql-computed-style"] = window.getComputedStyle(t)) } function Nt(t, e) { let n = ""; for (let r = t.ops.length - 1; r >= 0 && n.length < e.length; --r) { let e = t.ops[r]; if ("string" != typeof e.insert) break; n = e.insert + n } return n.slice(-1 * e.length) === e } function Rt(t) { if (0 === t.childNodes.length) return !1; let e = Lt(t); return ["block", "list-item"].indexOf(e.display) > -1 } function wt(t, e, n) { return St(n, t, !0) } function xt(t, e) { return Nt(e, "\n") || (Rt(t) || e.length() > 0 && t.nextSibling && Rt(t.nextSibling)) && e.insert("\n"), e } function Mt(t, e) { if (Rt(t) && null != t.nextElementSibling && !Nt(e, "\n\n")) { let n = t.offsetHeight + parseFloat(Lt(t).marginTop) + parseFloat(Lt(t).marginBottom); t.nextElementSibling.offsetTop > t.offsetTop + 1.5 * n && e.insert("\n") } return e } It.DEFAULTS = { matchers: [], matchVisual: !0 }; class Dt extends j { constructor(t, e) { super(t, e), this.lastRecorded = 0, this.ignoreChange = !1, this.clear(), this.quill.on(Y.events.EDITOR_CHANGE, ((t, e, n, r) => { t !== Y.events.TEXT_CHANGE || this.ignoreChange || (this.options.userOnly && r !== Y.sources.USER ? this.transform(e) : this.record(e, n)) })), 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; let n = this.stack[t].pop(); this.stack[e].push(n), this.lastRecorded = 0, this.ignoreChange = !0, this.quill.updateContents(n[t], Y.sources.USER), this.ignoreChange = !1; let r = function(t) { let e = t.reduce((function(t, e) { return t + (e.delete || 0) }), 0), n = t.length() - e; return function(t) { let e = t.ops[t.ops.length - 1]; return null != e && (null != e.insert ? "string" == typeof e.insert && e.insert.endsWith("\n") : null != e.attributes && Object.keys(e.attributes).some((function(t) { return null != o.a.query(t, o.a.Scope.BLOCK) }))) }(t) && (n -= 1), n }(n[t]); 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 n = this.quill.getContents().diff(e), r = Date.now(); if (this.lastRecorded + this.options.delay > r && this.stack.undo.length > 0) { let e = this.stack.undo.pop(); n = n.compose(e.undo), t = e.redo.compose(t) } else this.lastRecorded = r; this.stack.undo.push({ redo: t, undo: n }), this.stack.undo.length > this.options.maxStack && this.stack.undo.shift() } redo() { this.change("redo", "undo") } transform(t) { this.stack.undo.forEach((function(e) { e.undo = t.transform(e.undo, !0), e.redo = t.transform(e.redo, !0) })), this.stack.redo.forEach((function(e) { e.undo = t.transform(e.undo, !0), e.redo = t.transform(e.redo, !0) })) } undo() { this.change("undo", "redo") } } Dt.DEFAULTS = { delay: 1e3, maxStack: 100, userOnly: !1 }; let Ct = P("quill:keyboard"); const kt = /Mac/i.test(navigator.platform) ? "metaKey" : "ctrlKey"; class Pt extends j { static match(t, e) { return e = Gt(e), !["altKey", "ctrlKey", "metaKey", "shiftKey"].some((function(n) { return !!e[n] !== t[n] && null !== e[n] })) && e.key === (t.which || t.keyCode) } constructor(t, e) { super(t, e), this.bindings = {}, Object.keys(this.options.bindings).forEach((e => { ("list autofill" !== e || null == t.scroll.whitelist || t.scroll.whitelist.list) && this.options.bindings[e] && this.addBinding(this.options.bindings[e]) })), this.addBinding({ key: Pt.keys.ENTER, shiftKey: null }, jt), this.addBinding({ key: Pt.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, (function() {})), /Firefox/i.test(navigator.userAgent) ? (this.addBinding({ key: Pt.keys.BACKSPACE }, { collapsed: !0 }, Bt), this.addBinding({ key: Pt.keys.DELETE }, { collapsed: !0 }, Wt)) : (this.addBinding({ key: Pt.keys.BACKSPACE }, { collapsed: !0, prefix: /^.?$/ }, Bt), this.addBinding({ key: Pt.keys.DELETE }, { collapsed: !0, suffix: /^.?$/ }, Wt)), this.addBinding({ key: Pt.keys.BACKSPACE }, { collapsed: !1 }, Ft), this.addBinding({ key: Pt.keys.DELETE }, { collapsed: !1 }, Ft), this.addBinding({ key: Pt.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: !0, offset: 0 }, Bt), this.listen() } addBinding(t, e = {}, n = {}) { let r = Gt(t); if (null == r || null == r.key) return Ct.warn("Attempted to add invalid keyboard binding", r); "function" == typeof e && (e = { handler: e }), "function" == typeof n && (n = { handler: n }), r = u()(r, e, n), this.bindings[r.key] = this.bindings[r.key] || [], this.bindings[r.key].push(r) } listen() { this.quill.root.addEventListener("keydown", (t => { if (t.defaultPrevented) return; let e = t.which || t.keyCode, n = (this.bindings[e] || []).filter((function(e) { return Pt.match(t, e) })); if (0 === n.length) return; let r = this.quill.getSelection(); if (null == r || !this.quill.hasFocus()) return; let [i, a] = this.quill.getLine(r.index), [s, l] = this.quill.getLeaf(r.index), [c, u] = 0 === r.length ? [s, l] : this.quill.getLeaf(r.index + r.length), d = s instanceof o.a.Text ? s.value().slice(0, l) : "", h = c instanceof o.a.Text ? c.value().slice(u) : "", f = { collapsed: 0 === r.length, empty: 0 === r.length && i.length() <= 1, format: this.quill.getFormat(r), offset: a, prefix: d, suffix: h }; n.some((t => { if (null != t.collapsed && t.collapsed !== f.collapsed) return !1; if (null != t.empty && t.empty !== f.empty) return !1; if (null != t.offset && t.offset !== f.offset) return !1; if (Array.isArray(t.format)) { if (t.format.every((function(t) { return null == f.format[t] }))) return !1 } else if ("object" == typeof t.format && !Object.keys(t.format).every((function(e) { return !0 === t.format[e] ? null != f.format[e] : !1 === t.format[e] ? null == f.format[e] : L()(t.format[e], f.format[e]) }))) return !1; return !(null != t.prefix && !t.prefix.test(f.prefix) || null != t.suffix && !t.suffix.test(f.suffix) || !0 === t.handler.call(this, r, f)) })) && t.preventDefault() })) } } function Ut(t, e) { const n = t === Pt.keys.LEFT ? "prefix" : "suffix"; return { key: t, shiftKey: e, altKey: null, [n]: /^$/, handler: function(n) { let r = n.index; t === Pt.keys.RIGHT && (r += n.length + 1); const [i] = this.quill.getLeaf(r); return !(i instanceof o.a.Embed && (t === Pt.keys.LEFT ? e ? this.quill.setSelection(n.index - 1, n.length + 1, Y.sources.USER) : this.quill.setSelection(n.index - 1, Y.sources.USER) : e ? this.quill.setSelection(n.index, n.length + 1, Y.sources.USER) : this.quill.setSelection(n.index + n.length + 1, Y.sources.USER), 1)) } } } function Bt(t, e) { if (0 === t.index || this.quill.getLength() <= 1) return; let [n] = this.quill.getLine(t.index), r = {}; if (0 === e.offset) { let [e] = this.quill.getLine(t.index - 1); if (null != e && e.length() > 1) { let e = n.formats(), o = this.quill.getFormat(t.index - 1, 1); r = l.a.attributes.diff(e, o) || {} } } let o = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix) ? 2 : 1; this.quill.deleteText(t.index - o, o, Y.sources.USER), Object.keys(r).length > 0 && this.quill.formatLine(t.index - o, o, r, Y.sources.USER), this.quill.focus() } function Wt(t, e) { let n = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix) ? 2 : 1; if (t.index >= this.quill.getLength() - n) return; let r = {}, o = 0, [i] = this.quill.getLine(t.index); if (e.offset >= i.length() - 1) { let [e] = this.quill.getLine(t.index + 1); if (e) { let n = i.formats(), a = this.quill.getFormat(t.index, 1); r = l.a.attributes.diff(n, a) || {}, o = e.length() } } this.quill.deleteText(t.index, n, Y.sources.USER), Object.keys(r).length > 0 && this.quill.formatLine(t.index + o - 1, n, r, Y.sources.USER) } function Ft(t) { let e = this.quill.getLines(t), n = {}; if (e.length > 1) { let t = e[0].formats(), r = e[e.length - 1].formats(); n = l.a.attributes.diff(r, t) || {} } this.quill.deleteText(t, Y.sources.USER), Object.keys(n).length > 0 && this.quill.formatLine(t.index, 1, n, Y.sources.USER), this.quill.setSelection(t.index, Y.sources.SILENT), this.quill.focus() } function jt(t, e) { t.length > 0 && this.quill.scroll.deleteAt(t.index, t.length); let n = Object.keys(e.format).reduce((function(t, n) { return o.a.query(n, o.a.Scope.BLOCK) && !Array.isArray(e.format[n]) && (t[n] = e.format[n]), t }), {}); this.quill.insertText(t.index, "\n", n, Y.sources.USER), this.quill.setSelection(t.index + 1, Y.sources.SILENT), this.quill.focus(), Object.keys(e.format).forEach((t => { null == n[t] && (Array.isArray(e.format[t]) || "link" !== t && this.quill.format(t, e.format[t], Y.sources.USER)) })) } function qt(t) { return { key: Pt.keys.TAB, shiftKey: !t, format: { "code-block": !0 }, handler: function(e) { let n = o.a.query("code-block"), r = e.index, i = e.length, [a, s] = this.quill.scroll.descendant(n, r); if (null == a) return; let l = this.quill.getIndex(a), c = a.newlineIndex(s, !0) + 1, u = a.newlineIndex(l + s + i), d = a.domNode.textContent.slice(c, u).split("\n"); s = 0, d.forEach(((e, o) => { t ? (a.insertAt(c + s, n.TAB), s += n.TAB.length, 0 === o ? r += n.TAB.length : i += n.TAB.length) : e.startsWith(n.TAB) && (a.deleteAt(c + s, n.TAB.length), s -= n.TAB.length, 0 === o ? r -= n.TAB.length : i -= n.TAB.length), s += e.length + 1 })), this.quill.update(Y.sources.USER), this.quill.setSelection(r, i, Y.sources.SILENT) } } } function Vt(t) { return { key: t[0].toUpperCase(), shortKey: !0, handler: function(e, n) { this.quill.format(t, !n.format[t], Y.sources.USER) } } } function Gt(t) { if ("string" == typeof t || "number" == typeof t) return Gt({ key: t }); if ("object" == typeof t && (t = I()(t, !1)), "string" == typeof t.key) if (null != Pt.keys[t.key.toUpperCase()]) t.key = Pt.keys[t.key.toUpperCase()]; else { if (1 !== t.key.length) return null; t.key = t.key.toUpperCase().charCodeAt(0) } return t.shortKey && (t[kt] = t.shortKey, delete t.shortKey), t } Pt.keys = { BACKSPACE: 8, TAB: 9, ENTER: 13, ESCAPE: 27, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }, Pt.DEFAULTS = { bindings: { bold: Vt("bold"), italic: Vt("italic"), underline: Vt("underline"), indent: { key: Pt.keys.TAB, format: ["blockquote", "indent", "list"], handler: function(t, e) { if (e.collapsed && 0 !== e.offset) return !0; this.quill.format("indent", "+1", Y.sources.USER) } }, outdent: { key: Pt.keys.TAB, shiftKey: !0, format: ["blockquote", "indent", "list"], handler: function(t, e) { if (e.collapsed && 0 !== e.offset) return !0; this.quill.format("indent", "-1", Y.sources.USER) } }, "outdent backspace": { key: Pt.keys.BACKSPACE, collapsed: !0, shiftKey: null, metaKey: null, ctrlKey: null, altKey: null, format: ["indent", "list"], offset: 0, handler: function(t, e) { null != e.format.indent ? this.quill.format("indent", "-1", Y.sources.USER) : null != e.format.list && this.quill.format("list", !1, Y.sources.USER) } }, "indent code-block": qt(!0), "outdent code-block": qt(!1), "remove tab": { key: Pt.keys.TAB, shiftKey: !0, collapsed: !0, prefix: /\t$/, handler: function(t) { this.quill.deleteText(t.index - 1, 1, Y.sources.USER) } }, tab: { key: Pt.keys.TAB, handler: function(t) { this.quill.history.cutoff(); let e = (new a.a).retain(t.index).delete(t.length).insert("\t"); this.quill.updateContents(e, Y.sources.USER), this.quill.history.cutoff(), this.quill.setSelection(t.index + 1, Y.sources.SILENT) } }, "list empty enter": { key: Pt.keys.ENTER, collapsed: !0, format: ["list"], empty: !0, handler: function(t, e) { this.quill.format("list", !1, Y.sources.USER), e.format.indent && this.quill.format("indent", !1, Y.sources.USER) } }, "checklist enter": { key: Pt.keys.ENTER, collapsed: !0, format: { list: "checked" }, handler: function(t) { let [e, n] = this.quill.getLine(t.index), r = u()({}, e.formats(), { list: "checked" }), o = (new a.a).retain(t.index).insert("\n", r).retain(e.length() - n - 1).retain(1, { list: "unchecked" }); this.quill.updateContents(o, Y.sources.USER), this.quill.setSelection(t.index + 1, Y.sources.SILENT), this.quill.scrollIntoView() } }, "header enter": { key: Pt.keys.ENTER, collapsed: !0, format: ["header"], suffix: /^$/, handler: function(t, e) { let [n, r] = this.quill.getLine(t.index), o = (new a.a).retain(t.index).insert("\n", e.format).retain(n.length() - r - 1).retain(1, { header: null }); this.quill.updateContents(o, Y.sources.USER), this.quill.setSelection(t.index + 1, Y.sources.SILENT), this.quill.scrollIntoView() } }, "list autofill": { key: " ", collapsed: !0, format: { list: !1 }, prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, handler: function(t, e) { let n, r = e.prefix.length, [o, i] = this.quill.getLine(t.index); if (i > r) return !0; switch (e.prefix.trim()) { case "[]": case "[ ]": n = "unchecked"; break; case "[x]": n = "checked"; break; case "-": case "*": n = "bullet"; break; default: n = "ordered" } this.quill.insertText(t.index, " ", Y.sources.USER), this.quill.history.cutoff(); let s = (new a.a).retain(t.index - i).delete(r + 1).retain(o.length() - 2 - i).retain(1, { list: n }); this.quill.updateContents(s, Y.sources.USER), this.quill.history.cutoff(), this.quill.setSelection(t.index - r, Y.sources.SILENT) } }, "code exit": { key: Pt.keys.ENTER, collapsed: !0, format: ["code-block"], prefix: /\n\n$/, suffix: /^\s+$/, handler: function(t) { const [e, n] = this.quill.getLine(t.index), r = (new a.a).retain(t.index + e.length() - n - 2).retain(1, { "code-block": null }).delete(1); this.quill.updateContents(r, Y.sources.USER) } }, "embed left": Ut(Pt.keys.LEFT, !1), "embed left shift": Ut(Pt.keys.LEFT, !0), "embed right": Ut(Pt.keys.RIGHT, !1), "embed right shift": Ut(Pt.keys.RIGHT, !0) } }, Y.register({ "blots/block": b, "blots/block/embed": m, "blots/break": h, "blots/container": tt, "blots/cursor": O, "blots/embed": nt, "blots/inline": y, "blots/scroll": it, "blots/text": p, "modules/clipboard": It, "modules/history": Dt, "modules/keyboard": Pt }), o.a.register(b, h, O, y, it, p); var Kt = Y; class Ht extends y { 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) } } Ht.blotName = "bold", Ht.tagName = ["STRONG", "B"]; var Zt = Ht; class zt extends Zt {} zt.blotName = "italic", zt.tagName = ["EM", "I"]; var Yt = zt; class Xt extends y {} Xt.blotName = "underline", Xt.tagName = "U"; var Qt = Xt; class $t extends b {} $t.blotName = "blockquote", $t.tagName = "blockquote"; var Jt = $t; class te extends o.a.Attributor.Class { add(t, e) { if ("+1" === e || "-1" === e) { let n = this.value(t) || 0; e = "+1" === e ? n + 1 : n - 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)) } value(t) { return parseInt(super.value(t)) || void 0 } } let ee = new te("indent", "ql-indent", { scope: o.a.Scope.BLOCK, whitelist: [1, 2, 3, 4, 5, 6, 7, 8] }); class ne extends b { static formats(t) { return t.tagName === this.tagName ? void 0 : super.formats(t) } format(t, e) { t !== re.blotName || e ? super.format(t, e) : this.replaceWith(o.a.create(this.statics.scope)) } remove() { null == this.prev && null == this.next ? this.parent.remove() : super.remove() } replaceWith(t, e) { return this.parent.isolate(this.offset(this.parent), this.length()), t === this.parent.statics.blotName ? (this.parent.replaceWith(t, e), this) : (this.parent.unwrap(), super.replaceWith(t, e)) } } ne.blotName = "list-item", ne.tagName = "LI"; class re extends tt { static create(t) { let e = "ordered" === t ? "OL" : "UL", n = super.create(e); return "checked" !== t && "unchecked" !== t || n.setAttribute("data-checked", "checked" === t), n } static formats(t) { return "OL" === t.tagName ? "ordered" : "UL" === t.tagName ? t.hasAttribute("data-checked") ? "true" === t.getAttribute("data-checked") ? "checked" : "unchecked" : "bullet" : void 0 } constructor(t) { super(t); const e = e => { if (e.target.parentNode !== t) return; let n = this.statics.formats(t), r = o.a.find(e.target); "checked" === n ? r.format("list", "unchecked") : "unchecked" === n && r.format("list", "checked") }; t.addEventListener("touchstart", e), t.addEventListener("mousedown", e) } format(t, e) { this.children.length > 0 && this.children.tail.format(t, e) } formats() { return { [this.statics.blotName]: this.statics.formats(this.domNode) } } insertBefore(t, e) { if (t instanceof ne) super.insertBefore(t, e); else { let n = null == e ? this.length() : e.offset(this), r = this.split(n); r.parent.insertBefore(t, r) } } optimize(t) { super.optimize(t); let e = this.next; null != e && e.prev === this && e.statics.blotName === this.statics.blotName && e.domNode.tagName === this.domNode.tagName && e.domNode.getAttribute("data-checked") === this.domNode.getAttribute("data-checked") && (e.moveChildren(this), e.remove()) } replace(t) { if (t.statics.blotName !== this.statics.blotName) { let e = o.a.create(this.statics.defaultChild); t.moveChildren(e), this.appendChild(e) } super.replace(t) } } re.blotName = "list", re.scope = o.a.Scope.BLOCK_BLOT, re.tagName = ["OL", "UL"], re.defaultChild = "list-item", re.allowedChildren = [ne]; class oe extends y { static create(t) { let e = super.create(t); return t = this.sanitize(t), e.setAttribute("href", t), e.setAttribute("rel", "noopener noreferrer"), e.setAttribute("target", "_blank"), e } static formats(t) { return t.getAttribute("href") } static sanitize(t) { return ie(t, this.PROTOCOL_WHITELIST) ? t : this.SANITIZED_URL } format(t, e) { if (t !== this.statics.blotName || !e) return super.format(t, e); e = this.constructor.sanitize(e), this.domNode.setAttribute("href", e) } } function ie(t, e) { let n = document.createElement("a"); n.href = t; let r = n.href.slice(0, n.href.indexOf(":")); return e.indexOf(r) > -1 } oe.blotName = "link", oe.tagName = "A", oe.SANITIZED_URL = "about:blank", oe.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel"]; const ae = ["alt", "height", "width"]; class se extends o.a.Embed { static create(t) { let e = super.create(t); return "string" == typeof t && e.setAttribute("src", this.sanitize(t)), e } static formats(t) { return ae.reduce((function(e, n) { return t.hasAttribute(n) && (e[n] = t.getAttribute(n)), e }), {}) } static match(t) { return /\.(jpe?g|gif|png)$/.test(t) || /^data:image\/.+;base64/.test(t) } static sanitize(t) { return ie(t, ["http", "https", "data"]) ? t : "//:0" } static value(t) { return t.getAttribute("src") } format(t, e) { ae.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e) } } se.blotName = "image", se.tagName = "IMG"; var le = se; const ce = ["height", "width"]; class ue extends m { static create(t) { let e = super.create(t); return e.setAttribute("frameborder", "0"), e.setAttribute("allowfullscreen", !0), e.setAttribute("src", this.sanitize(t)), e } static formats(t) { return ce.reduce((function(e, n) { return t.hasAttribute(n) && (e[n] = t.getAttribute(n)), e }), {}) } static sanitize(t) { return oe.sanitize(t) } static value(t) { return t.getAttribute("src") } format(t, e) { ce.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e) } } ue.blotName = "video", ue.className = "ql-video", ue.tagName = "IFRAME"; var de = ue; class he extends v { replaceWith(t) { this.domNode.textContent = this.domNode.textContent, this.attach(), super.replaceWith(t) } highlight(t) { let e = this.domNode.textContent; this.cachedText !== e && ((e.trim().length > 0 || null == this.cachedText) && (this.domNode.innerHTML = t(e), this.domNode.normalize(), this.attach()), this.cachedText = e) } } he.className = "ql-syntax"; let fe = new o.a.Attributor.Class("token", "hljs", { scope: o.a.Scope.INLINE }); class pe extends j { static register() { Y.register(fe, !0), Y.register(he, !0) } constructor(t, e) { if (super(t, e), "function" != typeof this.options.highlight) throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill."); let n = null; this.quill.on(Y.events.SCROLL_OPTIMIZE, (() => { clearTimeout(n), n = setTimeout((() => { this.highlight(), n = null }), this.options.interval) })), this.highlight() } highlight() { if (this.quill.selection.composing) return; this.quill.update(Y.sources.USER); let t = this.quill.getSelection(); this.quill.scroll.descendants(he).forEach((t => { t.highlight(this.options.highlight) })), this.quill.update(Y.sources.SILENT), null != t && this.quill.setSelection(t, Y.sources.SILENT) } } pe.DEFAULTS = { highlight: null == window.hljs ? null : function(t) { return window.hljs.highlightAuto(t).value }, interval: 1e3 }; var ge = { single: /^(http:\/\/|https:\/\/|www.)[^\s]+/, inString: /(http:\/\/|https:\/\/|www.)[^\s]+/, inStringGlobal: /(http:\/\/|https:\/\/|www.)[^\s]+/g, inStringDomainGlobal: /(http:\/\/[^\s]+|https:\/\/[^\s]+|www.[^\s]+)/g, normalize: function(t) { return t.startsWith("http://") || t.startsWith("https://") ? t : "https://".concat(t) } }; function ye(t) { return (ye = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function me(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter((function(e) { return Object.getOwnPropertyDescriptor(t, e).enumerable }))), n.push.apply(n, r) } return n } function be(t) { for (var e = 1; e < arguments.length; e++) { var n = null != arguments[e] ? arguments[e] : {}; e % 2 ? me(Object(n), !0).forEach((function(e) { Ee(t, e, n[e]) })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : me(Object(n)).forEach((function(e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)) })) } return t } function Ee(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t } var Ae = { ATTR_NAME: "data-rte", VALUE_ATTR_NAME: "data-rte-value", ACTIVE_CLASS_NAME: "rte-active", VIEWPORT_CHANGE_THROTTLE_TIME: 500, MODEL_FOCUS_TIMEOUT: 500, CODE_HIGHLIGHTING: !1, ON_TEXT_CHANGE_CB: !1, ON_TEXT_CHANGE_CB_DEBOUNCE_TIMEOUT: 300, MAX_INDENT: 2, LOG_FORMATS: !1, SMALL_VIEWPORT_BREAKPOINT: 768, SMALL_VIEWPORT_FORMATS: ["bold", "italic", "underline", "blockquote", "header", "code-block", "to-link", "list", "log"], VALIDATE_VIDEO: null, INITIAL_QUOTE: null, INITIAL_QUOTE_AUTHOR: null, LENGTH_LIMIT: null, EXPORT_CODE_HIGHLIGHTING_IN_HTML: !1, UPLOAD_LOG: null, UPLOAD_LOG_RESPONSE_PROCESSOR: null, MAX_LOG_TITLE_LENGTH: 50, MAX_LOG_BODY_LENGTH: 25e4, HEIGHT: 110, HEIGHT_SMALL_VIEWPORT: 110, UPLOAD_ERROR_TIMEOUT: 3e3, UPLOAD_IMAGE: null, UPLOAD_IMAGE_RESPONSE_PROCESSOR: null, ALLOWED_IMAGE_FORMATS: ["png", "gif", "jpeg", "bmp"], MAX_IMAGE_SIZE: 5242880, GET_LINK_TITLE: null, ENABLE_MARKDOWN: !1, URL_WHITE_LIST: ["*"], MARKDOWN_DEBUG: !1, EXPANDABLE: !1, SMALL_VIEWPORT_EXPANDABLE: !1, RESET_EXPANDED_HEIGHT_TO_DEFAULT_ON_VIEWPORT_CHANGE: !1, ENABLE_TOOLTIPS: !1, SMALL_VIEWPORT_ENABLE_TOOLTIPS: !1, TOOLTIPS_DELAY: 1, SMALL_VIEWPORT_GROUP_LIST: !1, WHITE_LISTED_FORMATS: ["list", "image", "video", "log"], SPECIAL_FORMATS: ["image-input", "video-input", "link-input", "to-link", "to-video", "to-formats", "to-main-row", "to-headers", "to-align", "to-list"], FORMATS_ROW_FORMATS: ["bold", "italic", "underline", "blockquote", "header"], MARKDOWN: { INSERTED_TEXT: !0, NESTED_NUMBERED_LISTS: !1, HEADER_IN_QUOTE: !0, ADD_EXTRA_EMPTY_LINES: !0 }, MARKDOWN_PREVIEW_TAGS_DEFINITIONS: { HEADER: { name: "header", enabled: !0 }, CODE_BLOCK: { name: "code-block", enabled: !0 }, INDENTED_CODE_BLOCK: { name: "intended-code-block", enabled: !0 }, INLINE_CODE: { name: "inline-code", enabled: !1 }, UNDERLINE: { name: "underline", enabled: !1 }, BOLD: { name: "bold", enabled: !0 }, ITALIC: { name: "italic", enabled: !0 }, BOLDITALIC: { name: "bolditalic", enabled: !0 }, MULTIPLE_BULLETS: { name: "multiple-bullets", enabled: !0 }, SINGLE_BULLET: { name: "single-bullet", enabled: !0 }, BLOCKQUOTE: { name: "blockquote", enabled: !0 }, STRIKETHROUGH: { name: "strikethrough", enabled: !0 }, IMAGE: { name: "image", enabled: !1 }, TASKLIST: { name: "tasklist", enabled: !0 }, LINK: { name: "link", enabled: !0 }, URL: { name: "url", enabled: !0 }, XMAN: { name: "xman", enabled: !0 }, COMMUNITY_TAG: { name: "community-tag", enabled: !1 }, ENCODE_HTML_ANGULAR: { name: "html-encoding", enabled: !0 }, ENCODE_AMPERSAND: { name: "ampersand-encoding", enabled: !0 }, HR: { name: "hr", enabled: !0 }, NEWLINE: { name: "newline", enabled: !0 } }, LOCALIZATIONS: { editor: "Rich text editor", toolbar: "Editor toolbar", formats: "Basic text formats", bold: "Bold", italic: "Italic", underline: "Underline", quote: "Quote", header: "Headings", header1: "Headline", header2: "Subheader", header3: "Section header", headerNone: "Body", indent: "Indent", outdent: "Outdent", align: "Align text", alignLeft: "Left align", alignCenter: "Center align", alignRight: "Right align", orderedList: "Ordered list", unorderedList: "Unordered list", taskList: "To-do list", code: "Insert code", link: "Insert link", linkInputPlaceholder: "Enter or paste link here...", linkInputA11yLabel: "Link URL", applyLink: "Apply link insertion", closeLink: "Close insert link", image: "Insert Image", video: "Insert YouTube video", videoInputPlaceholder: "Enter or paste YouTube video link here", videoInputA11yLabel: "YouTube video URL", applyVideo: "Apply YouTube video insertion", closeVideo: "Close insert YouTube video", log: "Insert log", close: "Close", help: "Help Menu", helpKeyboardShortcuts: "Keyboard Shortcuts", helpEmoji: "Emoji:", helpEmojiValue: "Command + Control + Space bar", helpBold: "Bold:", helpBoldValue: "Ctrl + B", helpBoldValueMac: "Command + B", helpItalic: "Italics:", helpItalicValue: "Ctrl + I", helpItalicValueMac: "Command + I", helpUnderline: "Underline:", helpUnderlineValue: "Ctrl + U", helpUnderlineValueMac: "Command + U", helpLink: "Insert Link:", helpLinkValue: "Ctrl + K", helpLinkValueMac: "Command + K", helpIndent: "Indent:", helpIndentValue: "Ctrl + ]", helpIndentValueMac: "Command + ]", helpOutdent: "Outdent:", helpOutdentValue: "Ctrl + [", helpOutdentValueMac: "Command + [", helpCodeBlock: "Code Block:", helpCodeBlockValue: "Ctrl + `", helpCodeBlockValueMac: "Ctrl + `", helpBlockQuote: "Quote:", helpBlockQuoteValue: "Ctrl + E", helpBlockQuoteValueMac: "Command + E", errorImageLoadingFaliure: "There is an error occurred while loading this image. Please try again later.", errorImageTooLarge: "Image size should not exceed {0}Mb.", errorInvalidImageFormat: "Invalid image format. You can only upload {0} images.", errorEmptyLink: "Link URL should not be empty.", errorInvalidLink: "Please enter valid URL.", errorInvalidVideoUrl: "Please enter valid YouTube video URL.", errorLogUploadingFailure: "There is an error occurred while uploading this log. Please try again later.", placeholder: "Enter your text here...", ariaCode: "Code", ariaImage: "User uploaded image", ariaImages: "User uploaded image {0}", dialogCloseIconAria: "Close dialog", dialogHeader: "Text attachment", dialogTitle: "Title", dialogBodyAria: "Body", dialogBodyPlaceholder: "Add a note, error log, etc...", dialogSave: "Add Text", dialogCancel: "Cancel", dialogErrorTitleEmpty: "Title can not be empty.", dialogErrorTitleTooLong: "Title should not exceed {0} characters.", dialogErrorBodyEmpty: "Body can not be empty.", dialogErrorBodyTooLong: "Body should not exceed {0} characters.", initialQuoteAuthorLabel: "{0} wrote:", tooltipFormats: "Additional formats", tooltipBold: "Bold", tooltipItalic: "Italic", tooltipUnderline: "Underline", tooltipHeaders: "Headings", tooltipHeader1: "Headline text style", tooltipHeader2: "Subhead text style", tooltipHeader3: "Section title text style", tooltipHeaderNone: "Body text style", tooltipOutdent: "Decrease indent", tooltipIndent: "Increase indent", tooltipOrderedList: "Numbered list", tooltipUnorderedList: "Bulleted list", tooltiptaskList: "To-do list", tooltipAlign: "Text alignment", tooltipAlignLeft: "Align text left", tooltipAlignCenter: "Align text center", tooltipAlignRight: "Align text right", tooltipQuote: "Quote", tooltipCode: "Code block", tooltipLink: "Link", tooltipLog: "Text attachment", tooltipImage: "Image insertion", tooltipVideo: "YouTube embedding" }, MESSAGES: function(t) { switch (t) { case "image-failure": return this.LOCALIZATIONS.errorImageLoadingFaliure; case "image-too-large": return this.LOCALIZATIONS.errorImageTooLarge; case "invalid-image-format": return this.LOCALIZATIONS.errorInvalidImageFormat; case "empty-link": return this.LOCALIZATIONS.errorEmptyLink; case "invalid-link": return this.LOCALIZATIONS.errorInvalidLink; case "invalid-video-url": return this.LOCALIZATIONS.errorInvalidVideoUrl; case "log-failure": return this.LOCALIZATIONS.errorLogUploadingFailure; default: return "Error message for ".concat(t, " key not found.") } }, HELP_MENU_ITEMS: function() { var t = /Mac||iPhone||iPad||iPod/i.test(navigator.platform), e = []; if (t && e.push({ key: this.LOCALIZATIONS.helpEmoji, value: this.LOCALIZATIONS.helpEmojiValue }), this.WHITE_LISTED_FORMATS.includes("bold")) { var n = this.LOCALIZATIONS.helpBoldValue, r = !1; t && (n = this.LOCALIZATIONS.helpBoldValueMac), this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("bold") && (r = !0), e.push({ key: this.LOCALIZATIONS.helpBold, value: n, hideOnSmallViewport: r }) } if (this.WHITE_LISTED_FORMATS.includes("italic")) { var o = this.LOCALIZATIONS.helpItalicValue, i = !1; t && (o = this.LOCALIZATIONS.helpItalicValueMac), this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("italic") && (i = !0), e.push({ key: this.LOCALIZATIONS.helpItalic, value: o, hideOnSmallViewport: i }) } if (this.WHITE_LISTED_FORMATS.includes("underline")) { var a = this.LOCALIZATIONS.helpUnderlineValue, s = !1; t && (a = this.LOCALIZATIONS.helpUnderlineValueMac), this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("underline") && (s = !0), e.push({ key: this.LOCALIZATIONS.helpUnderline, value: a, hideOnSmallViewport: s }) } if (this.WHITE_LISTED_FORMATS.includes("to-link")) { var l = this.LOCALIZATIONS.helpLinkValue, c = !1; this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("to-link") && (c = !0), t && (l = this.LOCALIZATIONS.helpLinkValueMac), e.push({ key: this.LOCALIZATIONS.helpLink, value: l, hideOnSmallViewport: c }) } if (this.WHITE_LISTED_FORMATS.includes("code-block")) { var u = this.LOCALIZATIONS.helpCodeBlockValue, d = !1; this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("code-block") && (d = !0), t && (u = this.LOCALIZATIONS.helpCodeBlockValueMac), e.push({ key: this.LOCALIZATIONS.helpCodeBlock, value: u, hideOnSmallViewport: d }) } if (this.WHITE_LISTED_FORMATS.includes("blockquote")) { var h = this.LOCALIZATIONS.helpBlockQuoteValue, f = !1; this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("blockquote") && (f = !0), t && (h = this.LOCALIZATIONS.helpBlockQuoteValueMac), e.push({ key: this.LOCALIZATIONS.helpBlockQuote, value: h, hideOnSmallViewport: f }) } if (this.WHITE_LISTED_FORMATS.includes("indent")) { var p = this.LOCALIZATIONS.helpIndentValue, g = this.LOCALIZATIONS.helpOutdentValue, y = !1; this.SMALL_VIEWPORT_FORMATS && !this.SMALL_VIEWPORT_FORMATS.includes("indent") && (y = !0), t && (p = this.LOCALIZATIONS.helpIndentValueMac, g = this.LOCALIZATIONS.helpOutdentValueMac), e.push({ key: this.LOCALIZATIONS.helpIndent, value: p, hideOnSmallViewport: y }), e.push({ key: this.LOCALIZATIONS.helpOutdent, value: g, hideOnSmallViewport: y }) } return e } }; function ve(t, e) { var n = be({}, t); return "object" === ye(e.localizations) && (n.LOCALIZATIONS = be(be({}, n.LOCALIZATIONS), e.localizations)), "object" === ye(e.urlWhiteList) && (n.URL_WHITE_LIST = e.urlWhiteList), "boolean" == typeof e.enableMarkdown && (n.ENABLE_MARKDOWN = e.enableMarkdown), e.formats && Array.isArray(e.formats) && (n.WHITE_LISTED_FORMATS = e.formats), "boolean" == typeof e.logFormats && (n.LOG_FORMATS = e.logFormats), "function" == typeof e.codeHighlighting && (n.CODE_HIGHLIGHTING = e.codeHighlighting), "number" == typeof e.maxIndent && (n.MAX_INDENT = e.maxIndent), e.smallViewportFormats && Array.isArray(e.smallViewportFormats) && (n.SMALL_VIEWPORT_FORMATS = e.smallViewportFormats), "number" == typeof e.smallViewportBreakpoint && (n.SMALL_VIEWPORT_BREAKPOINT = e.smallViewportBreakpoint), "function" == typeof e.youtubeValidator && (n.VALIDATE_VIDEO = e.youtubeValidator), "object" === ye(e.initialQuote) && Array.isArray(e.initialQuote.ops) && (n.INITIAL_QUOTE = e.initialQuote), "string" == typeof e.initialQuoteAuthor && (n.INITIAL_QUOTE_AUTHOR = e.initialQuoteAuthor), "number" == typeof e.lengthLimit && (n.LENGTH_LIMIT = e.lengthLimit), "boolean" == typeof e.exportCodeHighlightingInHtml && (n.EXPORT_CODE_HIGHLIGHTING_IN_HTML = e.exportCodeHighlightingInHtml), "function" == typeof e.onTextChangeCallback && (n.ON_TEXT_CHANGE_CB = e.onTextChangeCallback), "number" == typeof e.onTextChangeCbDebounceTimeout && (n.ON_TEXT_CHANGE_CB_DEBOUNCE_TIMEOUT = e.onTextChangeCbDebounceTimeout), "number" == typeof e.height && (n.HEIGHT = e.height), "number" == typeof e.heightSmallViewport && (n.HEIGHT_SMALL_VIEWPORT = e.heightSmallViewport), "function" == typeof e.uploadImage && (n.UPLOAD_IMAGE = e.uploadImage), "function" == typeof e.uploadImageResponseProcessor && (n.UPLOAD_IMAGE_RESPONSE_PROCESSOR = e.uploadImageResponseProcessor), e.allowedImageFormats && Array.isArray(e.allowedImageFormats) && (n.ALLOWED_IMAGE_FORMATS = e.allowedImageFormats), "number" == typeof e.maxImageSize && (n.MAX_IMAGE_SIZE = e.maxImageSize), "function" == typeof e.uploadLog && (n.UPLOAD_LOG = e.uploadLog), "function" == typeof e.uploadLogResponseProcessor && (n.UPLOAD_LOG_RESPONSE_PROCESSOR = e.uploadLogResponseProcessor), "number" == typeof e.maxLogTitleLength && (n.MAX_LOG_TITLE_LENGTH = e.maxLogTitleLength), "number" == typeof e.maxLogBodyLength && (n.MAX_LOG_BODY_LENGTH = e.maxLogBodyLength), "function" == typeof e.getLinkTitle && (n.GET_LINK_TITLE = e.getLinkTitle), "object" === ye(e.markdown) && ("boolean" == typeof e.markdown.insertedText && (n.MARKDOWN.INSERTED_TEXT = e.markdown.insertedText), "boolean" == typeof e.markdown.nestedNumberedLists && (n.MARKDOWN.NESTED_NUMBERED_LISTS = e.markdown.nestedNumberedLists), "boolean" == typeof e.markdown.headerInQuote && (n.MARKDOWN.HEADER_IN_QUOTE = e.markdown.headerInQuote), "boolean" == typeof e.markdown.addExtraEmptyLines && (n.MARKDOWN.ADD_EXTRA_EMPTY_LINES = e.markdown.addExtraEmptyLines)), "boolean" == typeof e.enableTooltips && (n.ENABLE_TOOLTIPS = e.enableTooltips), "boolean" == typeof e.smallViewportEnableTooltips && (n.SMALL_VIEWPORT_ENABLE_TOOLTIPS = e.smallViewportEnableTooltips), "number" == typeof e.tooltipsDelay && (n.TOOLTIPS_DELAY = e.tooltipsDelay), "boolean" == typeof e.smallViewportGroupList && (n.SMALL_VIEWPORT_GROUP_LIST = e.smallViewportGroupList), "boolean" == typeof e.expandable && (n.EXPANDABLE = e.expandable), "boolean" == typeof e.smallViewportExpandable && (n.SMALL_VIEWPORT_EXPANDABLE = e.smallViewportExpandable), "boolean" == typeof e.resetExpandedHeightToDefaultOnViewportChange && (n.RESET_EXPANDED_HEIGHT_TO_DEFAULT_ON_VIEWPORT_CHANGE = e.resetExpandedHeightToDefaultOnViewportChange), "string" == typeof e.activeClassName && (n.ACTIVE_CLASS_NAME = e.activeClassName), n } function Te(t) { return (Te = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function Oe(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t } function _e(t, e) { return function(t) { if (Array.isArray(t)) return t }(t) || function(t, e) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) { var n = [], r = !0, o = !1, i = void 0; try { for (var a, s = t[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !e || n.length !== e); r = !0); } catch (t) { o = !0, i = t } finally { try { r || null == s.return || s.return() } finally { if (o) throw i } } return n } }(t, e) || function(t, e) { if (t) { if ("string" == typeof t) return Ie(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ie(t, e) : void 0 } }(t, e) || function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() } function Ie(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r } function Se(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } function Le(t, e) { return (Le = Object.setPrototypeOf || function(t, e) { return t.__proto__ = e, t })(t, e) } function Ne(t, e) { return !e || "object" !== Te(e) && "function" != typeof e ? Re(t) : e } function Re(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t } function we(t) { return (we = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t) })(t) } var xe = P("quill:clipboard"), Me = [ [Node.TEXT_NODE, Ye], [Node.TEXT_NODE, He], ["br", Ve], [Node.ELEMENT_NODE, He], [Node.ELEMENT_NODE, Ze] ], De = [st, pt].reduce((function(t, e) { return t[e.keyName] = e, t }), {}), Ce = [ct, ht, dt, gt, bt, Et].reduce((function(t, e) { return t[e.keyName] = e, t }), {}), ke = function(t) { ! function(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && Le(t, e) }(o, t); var e, n, r = function(t) { var e = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0 } catch (t) { return !1 } }(); return function() { var n, r = we(t); if (e) { var o = we(this).constructor; n = Reflect.construct(r, arguments, o) } else n = r.apply(this, arguments); return Ne(this, n) } }(o); function o(t, e) { var n; return function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, o), (n = r.call(this, t, e)).quill.root.addEventListener("paste", n.onPaste.bind(Re(n))), n.container = n.quill.addContainer("ql-clipboard"), n.container.setAttribute("contenteditable", !0), n.container.setAttribute("tabindex", -1), n.matchers = [], Ae.ENABLE_MARKDOWN || (Me = [ [Node.TEXT_NODE, Ye], [Node.TEXT_NODE, He], ["br", Ve], [Node.ELEMENT_NODE, He], [Node.ELEMENT_NODE, qe], [Node.ELEMENT_NODE, Ze], [Node.ELEMENT_NODE, je], [Node.ELEMENT_NODE, ze], ["li", Ke], ["b", Fe.bind(Fe, "bold")], ["i", Fe.bind(Fe, "italic")], ["style", Ge], [Node.TEXT_NODE, Xe] ]), Me.concat(n.options.matchers).forEach((function(t) { var r = _e(t, 2), o = r[0], i = r[1]; (e.matchVisual || i !== Ze) && n.addMatcher(o, i) })), n } return e = o, (n = [{ key: "addMatcher", value: function(t, e) { this.matchers.push([t, e]) } }, { key: "convert", value: function(t) { if ("string" == typeof t) return this.container.innerHTML = t.replace(/\>\r?\n +\<"), this.convert(); var e = this.quill.getFormat(this.quill.selection.savedRange.index); if (e[v.blotName]) { this.container.innerHTML = this.container.innerHTML.replace(/>( +)?\n( +)?<").replace(//g, "").replace(/

/g, "").trim(); var n = this.container.innerText; return this.container.innerHTML = "", (new a.a).insert(n, Oe({}, v.blotName, e[v.blotName])) } var r = _e(this.prepareMatching(), 2), o = r[0], i = r[1], s = function t(e, n, r) { return e.nodeType === e.TEXT_NODE ? r.reduce((function(t, n) { return n(e, t) }), new a.a) : e.nodeType === e.ELEMENT_NODE ? [].reduce.call(e.childNodes || [], (function(o, i) { var a = t(i, n, r); return i.nodeType === e.ELEMENT_NODE && (a = n.reduce((function(t, e) { return e(i, t) }), a), a = (i["__ql-matcher"] || []).reduce((function(t, e) { return e(i, t) }), a)), o.concat(a) }), new a.a) : new a.a }(this.container, o, i); return Be(s, "\n") && null == s.ops[s.ops.length - 1].attributes && (s = s.compose((new a.a).retain(s.length() - 1).delete(1))), xe.log("convert", this.container.innerHTML, s), this.container.innerHTML = "", s } }, { key: "dangerouslyPasteHTML", value: function(t, e) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Y.sources.API; if ("string" == typeof t) this.quill.setContents(this.convert(t), e), this.quill.setSelection(0, Y.sources.SILENT); else { var r = this.convert(e); this.quill.updateContents((new a.a).retain(t).concat(r), n), this.quill.setSelection(t + r.length(), Y.sources.SILENT) } } }, { key: "pasteMarkdown", value: function(t) { this.quill.setText(t), this.quill.setSelection(0, Y.sources.SILENT) } }, { key: "onPaste", value: function(t) { var e = this; if (!t.defaultPrevented && this.quill.isEnabled()) { var n = this.quill.getSelection(), r = (new a.a).retain(n.index), o = this.quill.scrollingContainer.scrollTop; this.container.focus(), this.quill.selection.update(Y.sources.SILENT), setTimeout((function() { r = r.concat(e.convert()).delete(n.length), e.quill.updateContents(r, Y.sources.USER), e.quill.setSelection(r.length() - n.length, Y.sources.SILENT), e.quill.scrollingContainer.scrollTop = o, e.quill.focus() }), 1) } } }, { key: "prepareMatching", value: function() { var t = this, e = [], n = []; return this.matchers.forEach((function(r) { var o = _e(r, 2), i = o[0], a = o[1]; switch (i) { case Node.TEXT_NODE: n.push(a); break; case Node.ELEMENT_NODE: e.push(a); break; default: [].forEach.call(t.container.querySelectorAll(i), (function(t) { t["__ql-matcher"] = t["__ql-matcher"] || [], t["__ql-matcher"].push(a) })) } })), [e, n] } }]) && Se(e.prototype, n), o }(j); function Pe(t, e, n) { return "object" === Te(e) ? Object.keys(e).reduce((function(t, n) { return Pe(t, n, e[n]) }), t) : t.reduce((function(t, r) { return r.attributes && r.attributes[e] ? t.push(r) : t.insert(r.insert, u()({}, Oe({}, e, n), r.attributes)) }), new a.a) } function Ue(t) { return t.nodeType !== Node.ELEMENT_NODE ? {} : t["__ql-computed-style"] || (t["__ql-computed-style"] = window.getComputedStyle(t)) } function Be(t, e) { for (var n = "", r = t.ops.length - 1; r >= 0 && n.length < e.length; --r) { var o = t.ops[r]; if ("string" != typeof o.insert) break; n = o.insert + n } return n.slice(-1 * e.length) === e } function We(t) { if (0 === t.childNodes.length) return !1; var e = Ue(t); return ["block", "list-item"].indexOf(e.display) > -1 } function Fe(t, e, n) { return Pe(n, t, !0) } function je(t, e) { var n = o.a.Attributor.Attribute.keys(t), r = o.a.Attributor.Class.keys(t), i = o.a.Attributor.Style.keys(t), a = {}; return n.concat(r).concat(i).forEach((function(e) { var n = o.a.query(e, o.a.Scope.ATTRIBUTE); null != n && (a[n.attrName] = n.value(t), a[n.attrName]) || (null == (n = De[e]) || n.attrName !== e && n.keyName !== e || (a[n.attrName] = n.value(t) || void 0), null == (n = Ce[e]) || n.attrName !== e && n.keyName !== e || (n = Ce[e], a[n.attrName] = n.value(t) || void 0)) })), Object.keys(a).length > 0 && (e = Pe(e, a)), e } function qe(t, e) { var n = o.a.query(t); if (null == n) return e; if (n.prototype instanceof o.a.Embed) { var r = {}, i = n.value(t); null != i && (r[n.blotName] = i, e = (new a.a).insert(r, n.formats(t))) } else "function" == typeof n.formats && (e = Pe(e, n.blotName, n.formats(t))); return e } function Ve(t, e) { return Be(e, "\n") || e.insert("\n"), e } function Ge() { return new a.a } function Ke(t, e) { var n = o.a.query(t); if (null == n || "list-item" !== n.blotName || !Be(e, "\n")) return e; for (var r = -1, i = t.parentNode; !i.classList.contains("ql-clipboard");) "list" === (o.a.query(i) || {}).blotName && (r += 1), i = i.parentNode; return r <= 0 ? e : e.compose((new a.a).retain(e.length() - 1).retain(1, { indent: r })) } function He(t, e) { return Be(e, "\n") || (We(t) || e.length() > 0 && t.nextSibling && We(t.nextSibling)) && e.insert("\n"), e } function Ze(t, e) { if (We(t) && null != t.nextElementSibling && !Be(e, "\n\n")) { var n = t.offsetHeight + parseFloat(Ue(t).marginTop) + parseFloat(Ue(t).marginBottom); t.nextElementSibling.offsetTop > t.offsetTop + 1.5 * n && e.insert("\n") } return e } function ze(t, e) { var n = {}, r = t.style || {}; return r.fontStyle && "italic" === Ue(t).fontStyle && (n.italic = !0), r.fontWeight && (Ue(t).fontWeight.startsWith("bold") || parseInt(Ue(t).fontWeight) >= 700) && (n.bold = !0), Object.keys(n).length > 0 && (e = Pe(e, n)), parseFloat(r.textIndent || 0) > 0 && (e = (new a.a).insert("\t").concat(e)), e } function Ye(t, e) { var n = t.data; if ("O:P" === t.parentNode.tagName) return e.insert(n.trim()); if (0 === n.trim().length && t.parentNode.classList.contains("ql-clipboard")) return e; if (!Ue(t.parentNode).whiteSpace.startsWith("pre")) { var r = function(t, e) { return (e = e.replace(/[^\u00a0]/g, "")).length < 1 && t ? " " : e }; n = (n = n.replace(/\r\n/g, " ").replace(/\n/g, " ")).replace(/\s\s+/g, r.bind(r, !0)), (null == t.previousSibling && We(t.parentNode) || null != t.previousSibling && We(t.previousSibling)) && (n = n.replace(/^\s+/, r.bind(r, !1))), (null == t.nextSibling && We(t.parentNode) || null != t.nextSibling && We(t.nextSibling)) && (n = n.replace(/\s+$/, r.bind(r, !1))) } return e.insert(n) } function Xe(t, e) { var n = []; if ("string" == typeof t.data && t.data.match(ge.inStringDomainGlobal) && t.data.split(ge.inStringDomainGlobal).forEach((function(t) { t.match(ge.inStringDomainGlobal) ? n.push({ insert: t, attributes: { link: ge.normalize(t) } }) : n.push({ insert: t }) })), n.length) { var r = e.ops.length - 1; return e.ops[r] && e.ops[r].delete && n.push(e.ops[r]), { ops: n } } return e } function Qe(t) { return (Qe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function $e(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } function Je(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } function tn(t, e, n) { return (tn = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function(t, e, n) { var r = function(t, e) { for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = rn(t));); return t }(t, e); if (r) { var o = Object.getOwnPropertyDescriptor(r, e); return o.get ? o.get.call(n) : o.value } })(t, e, n || t) } function en(t, e) { return (en = Object.setPrototypeOf || function(t, e) { return t.__proto__ = e, t })(t, e) } function nn(t, e) { return !e || "object" !== Qe(e) && "function" != typeof e ? function(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t }(t) : e } function rn(t) { return (rn = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t) })(t) } ke.DEFAULTS = { matchers: [], matchVisual: !0 }; var on = function(t) { ! function(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && en(t, e) }(o, t); var e, n, r = function(t) { var e = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0 } catch (t) { return !1 } }(); return function() { var n, r = rn(t); if (e) { var o = rn(this).constructor; n = Reflect.construct(r, arguments, o) } else n = r.apply(this, arguments); return nn(this, n) } }(o); function o() { return $e(this, o), r.apply(this, arguments) } return e = o, n = [{ key: "create", value: function(t) { var e = t.url, n = t.title, r = tn(rn(o), "create", this).call(this); r.setAttribute("contenteditable", !1); var i = document.createElement("a"); return i.setAttribute("href", e), i.setAttribute("download", "".concat(n, ".log")), i.textContent = n.trim(), r.appendChild(i), r } }, { key: "value", value: function(t) { return { url: t.querySelector("a").getAttribute("href"), title: t.querySelector("a").textContent } } }], null && Je(e.prototype, null), n && Je(e, n), o }(m); on.blotName = "log", on.tagName = "div", on.className = "log-attachment"; var an = on; function sn(t) { t.classList.remove("hidden") } function ln(t) { t.classList.add("hidden") } function cn() { for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n]; var r = e[0], o = e; return o.shift(), o.forEach((function(t, e) { r = r.replace("{".concat(e, "}"), t) })), r } var un = function(t, e) { return function(t) { return t.querySelectorAll("[contenteditable]").forEach((function(t) { t.removeAttribute("contenteditable") })), t }(t = function(t, e) { var n = t.querySelectorAll("img"); return n.length && n.forEach((function(t, r) { 1 === n.length ? t.setAttribute("aria-label", e.LOCALIZATIONS.ariaImage) : n.length > 1 && t.setAttribute("aria-label", cn(e.LOCALIZATIONS.ariaImages, r + 1)) })), t }(t = function(t) { return t.querySelectorAll("ul, ol").forEach((function(t) { var e = document.createElement(t.tagName), n = t.querySelectorAll("li"), r = 0, o = e, i = e; n.forEach((function(n) { var a = function(t) { var e = t.getAttribute("class"); if (!e) return 0; if (!e.includes("indent-")) return 0; var n = e.indexOf("indent-"); if ((e = e.substring(n, e.length)).includes(" ")) { var r = e.indexOf(" "); e = e.substring(0, r) } return parseInt(e.substring("indent-".length, e.length), 10) }(n), s = n.cloneNode(!0); if (0 === a) e.appendChild(s); else if (s.classList.remove("indent-".concat(a)), a === r) o.appendChild(s); else if (a > r) { var l = function(t, e, n) { for (var r, o, i = 0; i < t; i++) { var a = document.createElement(n); 0 === i ? r = a : o.appendChild(a), o = a } return o.appendChild(e), { newChild: r, newLastList: o } }(a - r, s, t.tagName), c = l.newChild, u = l.newLastList; i.appendChild(c), o = u } else if (a < r) { for (var d = r - a, h = o, f = 0; f < d; f++) h = h.parentNode.parentNode; h.appendChild(s), o = h } r = a, i = s })), t.parentNode.replaceChild(e, t) })), t }(t = function(t, e) { return t.querySelectorAll("pre").forEach((function(t) { var n = t.innerHTML, r = document.createElement("code"); r.setAttribute("aria-label", e.LOCALIZATIONS.ariaCode), e.EXPORT_CODE_HIGHLIGHTING_IN_HTML ? r.innerHTML = n : r.innerText = t.innerText, t.innerHTML = "", t.appendChild(r) })), t }(t, e)), e)) }, dn = function(t) { return t.replace(/&/g, "&") }, hn = { pattern: /(?:\*){2}([^*]+?)(?:\*){2}/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "bold", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : "".concat(e, "") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "bold", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : e }))) : t } }, fn = { pattern: /(?:[_|+]){2}(.+?)(?:[_|+]){2}/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "underline", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : "".concat(e, "") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "underline", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : e }))) : t } }, pn = { pattern: /(?!^\w){0,1}(?:_){1}([^_]+?)(?:_){1}(?!\w)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "italic", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : "".concat(e, "") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "underline", match: n }), t.replace(e, (function(t, e) { return t.match(/^([*_ \n]+)$/g) ? t : e }))) : t } }, gn = { pattern: /(?:\*|_){3}(^[*_]+?)(?:\*|_){3}/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "bolditalic", match: n }), t.replace(e, (function(t, e) { return "".concat(e, "") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "bolditalic", match: n }), t.replace(e, (function(t, e) { return e }))) : t } }, yn = { pattern: /(?:~~)(.+?)(?:~~)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "strikethru", match: n }), t.replace(e, (function(t, e) { return ''.concat(e, "") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "strikethru", match: n }), t.replace(e, (function(t, e) { return e }))) : t } }, mn = { pattern: /(#{1,6})\s+(.*)(\n|)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "header", match: n }), t.replace(e, (function(t, e, n) { return '

').concat(n, "

") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "header", match: n }), t.replace(e, (function(t, e, n) { return "".concat(n, " \n") }))) : t } }, bn = { pattern: /(?:^|\n)?((-\s?\[ ?([x ]? ?)\])\s+(.*)\n){1,}/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "tasklist", match: n }), t.replace(e, (function(t) { var e = t.replace(/^(\n)+/, "").replace(/(-\s?\[ ?([x ]? ?)\])\s+(.*)\n/g, (function(t, e, n, r) { return '
  • ').concat(r, "
  • ") })); return "
      ".concat(e, "
    ") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "tasklist", match: n }), t.replace(e, (function(t) { return t.replace(/^(\n)+/, "").replace(/(-\s?\[ ?([x ]? ?)\])\s+(.*)\n/g, (function(t, e, n, r) { return "".concat("x" === n ? " ✓ " : " ").concat(r, "\n") })) }))) : t } }, En = { pattern: /(?:^|\n[ ]*)((?: {0,6})(\*|\+|-|[1-9]+\.[1-9]*)(?:[ ]{0,5})(.*)\n{0,2})+/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "multiple-bullets", match: n }), t.replace(e, (function(t, e, n) { var r = function(t, e) { return /^[1-9]+.[1-9]*.*/.test(e) ? "
      ".concat(t, "
    ") : "
      ".concat(t, "
    ") }, o = function(t) { return "
  • ".concat(t, "

    ") }, i = /( {0,6})(\*|\+|-|[1-9]+\.[1-9]*)(.*)/, a = /(?:^|\n)(?: {0,2})(\*|\+|-|[1-9]+\.)\s+(.*)/.exec(t); if (a && /^[1-9]/.test(a[1]) && /^[2-9]/.test(a[1])) return t; for (var s = "", l = t.replace(/^(\n)+/, "").split("\n"), c = [], u = 0; u < l.length; u++) if ("" === l[u]) c.push(null); else { var d = l[u].match(i)[1].length; c.push(d) } for (var h = c.filter((function(t) { return null !== t })).sort()[0], f = function(t) { return h === t }, p = [], g = "*", y = 0; y < l.length; y++) { var m = null; null !== c[y] && (0 === y ? f(c[y]) ? (m = i.exec(l[0]), s += o(m[3])) : s += "".concat(l[y], "\n") : (m = i.exec(l[y]), f(c[y]) ? f(c[y]) ? (p.length ? (s += r(p.map((function(t) { return "
  • ".concat(t, "

  • ") })).join(""), g), s += "", p = [], g = "*") : s += "", s += o(m[3])) : s += "".concat(l[y], "\n") : (p.push(m[3]), g = m[2]))) } return p.length ? (s += r(p.map((function(t) { return o(t) })).join(""), g), s += "") : s += "", r(s, n) }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "multiple-bullets", match: n }), t.replace(e, (function(t, e, n) { var r = /( {0,9})(\*|\+|-|[1-9]+\.[1-9]*)(.*)/, o = /(?:^|\n)(?: {0,2})(\*|\+|-|[1-9]+\.)\s+(.*)/.exec(t); if (o && /^[1-9]/.test(o[1]) && /^[2-9]/.test(o[1])) return t; for (var i = "", a = t.replace(/^(\n)+/, "").split("\n"), s = [], l = 0; l < a.length; l++) if ("" === a[l]) s.push(null); else { var c = a[l].match(r)[1].length; s.push(c) } for (var u = s.filter((function(t) { return null !== t })).sort()[0], d = function(t) { return u === t }, h = [], f = 0; f < a.length; f++) { var p = null; null !== s[f] && (0 === f ? d(s[f]) ? i += (p = r.exec(a[0]))[3] : i += "".concat(a[f], "\n") : (p = r.exec(a[f]), d(s[f]) ? d(s[f]) ? (h.length ? (i += h.map((function(t) { return t })).join(""), i += "\n", h = []) : i += "\n", i += p[3]) : i += "".concat(a[f], "\n") : (h.push(p[3]), p[2]))) } return h.length ? (i += h.map((function(t) { return t })).join(""), i += "\n") : i += "\n", i }))) : t } }, An = { pattern: /(?:\n\s)(?:\*|\+|-)\s+(.*)\n/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "single-bullet", match: n }), t.replace(e, (function(t, e) { return "
    • ".concat(e, "
    ") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "single-bullet", match: n }), t.replace(e, (function(t, e) { return e }))) : t } }, vn = { pattern: /(!\[(.+?)\])\((\S+)(\s"(.*)")?\s?(=(\d+)x(\d+))?\)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "image", match: n }), t.replace(e, (function(t, e, n, r, o) { var i = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "", a = arguments.length > 7 ? arguments[7] : void 0, s = arguments.length > 8 ? arguments[8] : void 0, l = n ? ' alt="'.concat(n, '"') : "", c = i ? ' title="'.concat(i, '"') : "", u = a ? ' width="'.concat(a, '"') : "", d = s ? ' height="'.concat(s, '"') : ""; return '") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "image", match: n }), t.replace(e, (function(t, e, n, r, o) { var i = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "", a = arguments.length > 7 ? arguments[7] : void 0, s = arguments.length > 8 ? arguments[8] : void 0, l = n ? ' alt="'.concat(n, '"') : "", c = i ? ' title="'.concat(i, '"') : "", u = a ? ' width="'.concat(a, '"') : "", d = s ? ' height="'.concat(s, '"') : ""; return '") }))) : t } }, Tn = { pattern: /([^"])#(\S*)(\s|,|\.|;|>)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "ctag", match: n }), t.replace(e, (function(t, e, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ""; return "".concat(e, '').concat(n, "").concat(r) }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "ctag", match: n }), t.replace(e, (function(t, e, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ""; return "".concat(e, '').concat(n, "").concat(r) }))) : t } }, On = { pattern: /(-|-\s){3,}\n/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "hr", match: n }), t.replace(e, "
    ")) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "hr", match: n }), t.replace(e, " \n")) : t } }, _n = { pattern: /(.)?\n/gm, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "newline", match: n }), t.replace(e, (function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; return "".concat(e, "
    ") }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "newline", match: n }), t.replace(e, (function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; return "".concat(e, "\n") }))) : t } }, In = { pattern: /(&)/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "ampsd", match: n }), t.replace(e, (function() { return "&" }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "ampsd", match: n }), t.replace(e, (function() { return "&" }))) : t } }, Sn = { pattern: /<|>/g, action: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "< >", match: n }), t.replace(e, (function(t) { return "<" === t ? "<" : ">" === t ? ">" : void 0 }))) : t }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "< >", match: n }), t.replace(e, (function() { return "" }))) : t } }, Ln = function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n = t.replace(//g, ">").split("\n"), r = n.map((function(t, e) { return "").concat(t, "") })), o = 1 === r.length ? "noLineNumbers" : "", i = Math.floor(1e4 * Math.random()); return "").concat(r.join(""), "
    Code Block ').concat(e, "
    ") }, Nn = { pattern: /`{3}([\s\S]*?)`{3}/g, template: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "code-block", matches: t }); var e, n = /(.*)([\s\S]*)/gm.exec(t[1]), r = n[1], o = n[2]; return o ? o = o.replace(/^\n|\n$/g, "") : (o = r, r = ""), '
    ').concat((e = r, e ? '') : "")).concat(Ln(o, r), "
    ") }, textTemplate: function(t) { return Ae.MARKDOWN_DEBUG && console.log({ name: "code-block", matches: t }), t[1] } }, Rn = { pattern: /(?:\n *\n)( {4,5}.*\n)+/g, template: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "indented-code-block", matches: t }); for (var e = t[0], n = 0; " " === e[n] || "\n" === e[n];) n++; switch (e[n]) { case "+": case "-": case "*": return t.input } return e = e.replace(/^\n\n/, "").replace(/^ {4}/, "").replace(/\n {4}/g, "\n").replace(/^\n|\n$/g, "").replace(/ {2}/g, " "), '
    '.concat(Ln(e), "
    ") }, textTemplate: function(t) { return Ae.MARKDOWN_DEBUG && console.log({ name: "indented-code-block", matches: t }), t[1] } }, wn = { pattern: /`{1}([^`]+)`{1}/g, template: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "inline-code", matches: t }); var e = t[1]; return ''.concat(e, "") }, textTemplate: function(t) { return Ae.MARKDOWN_DEBUG && console.log({ name: "inline-code", matches: t }), t[1] } }, xn = [Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_AMPERSAND, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_HTML_ANGULAR], Mn = [{ name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.CODE_BLOCK.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.CODE_BLOCK.enabled, pattern: Nn.pattern, template: Nn.template, textTemplate: Nn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INDENTED_CODE_BLOCK.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INDENTED_CODE_BLOCK.enabled, pattern: Rn.pattern, template: Rn.template, textTemplate: Rn.textTemplate }], Dn = [Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BOLD, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HEADER, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HR, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.UNDERLINE, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.TASKLIST, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.MULTIPLE_BULLETS, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.SINGLE_BULLET], Cn = [Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.NEWLINE, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ITALIC, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.STRIKETHROUGH, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.IMAGE, Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.COMMUNITY_TAG], kn = [{ name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HEADER.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HEADER.enabled, pattern: mn.pattern, action: mn.action, textTemplate: mn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.TASKLIST.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.TASKLIST.enabled, pattern: bn.pattern, action: bn.action, textTemplate: bn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.MULTIPLE_BULLETS.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.MULTIPLE_BULLETS.enabled, pattern: En.pattern, action: En.action, textTemplate: En.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.SINGLE_BULLET.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.SINGLE_BULLET.enabled, pattern: An.pattern, action: An.action, textTemplate: An.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BOLD.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BOLD.enabled, pattern: hn.pattern, action: hn.action, textTemplate: hn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.UNDERLINE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.UNDERLINE.enabled, pattern: fn.pattern, action: fn.action, textTemplate: fn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ITALIC.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ITALIC.enabled, pattern: pn.pattern, action: pn.action, textTemplate: pn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BOLDITALIC.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BOLDITALIC.enabled, pattern: gn.pattern, action: gn.action, textTemplate: gn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.STRIKETHROUGH.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.STRIKETHROUGH.enabled, pattern: yn.pattern, action: yn.action, textTemplate: yn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.IMAGE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.IMAGE.enabled, pattern: vn.pattern, action: vn.action, textTemplate: vn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.COMMUNITY_TAG.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.COMMUNITY_TAG.enabled, pattern: Tn.pattern, action: Tn.action, textTemplate: Tn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HR.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.HR.enabled, pattern: On.pattern, action: On.action, textTemplate: On.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_HTML_ANGULAR.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_HTML_ANGULAR.enabled, pattern: Sn.pattern, action: Sn.action, textTemplate: Sn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_AMPERSAND.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.ENCODE_AMPERSAND.enabled, pattern: In.pattern, action: In.action, textTemplate: In.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.NEWLINE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.NEWLINE.enabled, pattern: _n.pattern, action: _n.action, textTemplate: _n.textTemplate }]; function Pn(t, e) { var n; if ("undefined" == typeof Symbol || null == t[Symbol.iterator]) { if (Array.isArray(t) || (n = Un(t)) || e && t && "number" == typeof t.length) { n && (t = n); var r = 0, o = function() {}; return { s: o, n: function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] } }, e: function(t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var i, a = !0, s = !1; return { s: function() { n = t[Symbol.iterator]() }, n: function() { var t = n.next(); return a = t.done, t }, e: function(t) { s = !0, i = t }, f: function() { try { a || null == n.return || n.return() } finally { if (s) throw i } } } } function Un(t, e) { if (t) { if ("string" == typeof t) return Bn(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Bn(t, e) : void 0 } } function Bn(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r } function Wn(t, e, n) { var r, o = Pn(e.map((function(t) { return t.pattern ? t : (e = t.name, n = !1, kn.forEach((function(t) { t.name === e && (n = t) })), n); var e, n })).filter((function(t) { return t.enabled }))); try { for (o.s(); !(r = o.n()).done;) { var i = r.value; t = n.html ? i.action(t, i.pattern) : i.textTemplate(t, i.pattern) } } catch (t) { o.e(t) } finally { o.f() } return t } function Fn(t, e, n) { var r, o = 0, i = 0, a = 0, s = [], l = Pn(function(t, e) { t.match(e); var n, r = [], o = {}; for (o[e.lastIndex] = !0; n = e.exec(t);) o[e.lastIndex] = !0, r.push(n); return r }(t, e.pattern)); try { for (l.s(); !(r = l.n()).done;) { var c = r.value; o = c.index, i = c.index + c[0].length, s.push({ postProcess: !0, str: t.substring(a, o) }), s.push({ postProcess: !1, str: n.html ? e.template(c) : e.textTemplate(c) }), a = i } } catch (t) { l.e(t) } finally { l.f() } return s.push({ postProcess: !0, str: t.substring(i) }), s } function jn(t, e, n) { var r, o = [], i = Pn(t); try { for (i.s(); !(r = i.n()).done;) { var a = r.value; a.postProcess ? o = o.concat(Fn(a.str, e, n)) : o.push(a) } } catch (t) { i.e(t) } finally { i.f() } return o } function qn(t) { var e, n = t.inputStr, r = t.shouldPostProcess, o = t.stagePatternPairs, i = t.formats, a = [{ str: n, postProcess: r }], s = Pn(o); try { for (s.s(); !(e = s.n()).done;) a = jn(a, e.value, i) } catch (t) { s.e(t) } finally { s.f() } return a } function Vn(t) { var e, n, r, o, i, a = t.inputStr, s = t.processorSequence, l = t.formats, c = function(t, e) { return function(t) { if (Array.isArray(t)) return t }(t) || function(t, e) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) { var n = [], r = !0, o = !1, i = void 0; try { for (var a, s = t[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !e || n.length !== e); r = !0); } catch (t) { o = !0, i = t } finally { try { r || null == s.return || s.return() } finally { if (o) throw i } } return n } }(t, e) || Un(t, e) || function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() }(s, 5); e = c[0], n = c[1], r = c[2], o = c[3], i = c[4], Ae.MARKDOWN_DEBUG && console.log({ beginning: a }), a = Wn(a = a.replace(/\\\*/g, "\*").replace(/\\-/g, "\-").replace(/\\\+/g, "\+").replace(/\\_/g, "\_").replace(/\\`/g, "\`"), e, l), Ae.MARKDOWN_DEBUG && console.log({ afterStage1: a }); var u = qn({ inputStr: a, shouldPostProcess: !0, stagePatternPairs: n, formats: l }); Ae.MARKDOWN_DEBUG && console.log({ before2: u }); for (var d = 0; d < u.length; d++) u[d].str = Wn(u[d].str, r, l); Ae.MARKDOWN_DEBUG && console.log({ afterStage2: u }); var h, f = [], p = Pn(u); try { for (p.s(); !(h = p.n()).done;) { var g = h.value; f = f.concat(qn({ inputStr: g.str, shouldPostProcess: g.postProcess, stagePatternPairs: o, formats: l })) } } catch (t) { p.e(t) } finally { p.f() } Ae.MARKDOWN_DEBUG && console.log({ afterStage3: f }); var y, m = "", b = Pn(f); try { for (b.s(); !(y = b.n()).done;) { var E = y.value; E.postProcess ? m += Wn(E.str, i, l) : m += E.str } } catch (t) { b.e(t) } finally { b.f() } return Ae.MARKDOWN_DEBUG && console.log({ afterStage4: m }), function(t) { return t.replace(/&#92;&#42;/g, "*").replace(/&#92;&#45;/g, "-").replace(/&#92;&#43;/g, "+").replace(/&#92;&#95;/g, "_").replace(/&#92;&#96;/g, "`") }(m) } function Gn(t) { return (Gn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function Kn(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } var Hn = function() { function t(e) { ! function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), this.urlWhitelist = e, this.errors = {}, this.errorEnum = { invalidUrl: "invalidUrl", notWhitelistedUrl: "notWhitelistedUrl", hrefTextCantBeLink: "hrefTextCantBeLink" }, this.whitelistDomainTLDPairs = this.urlWhitelist.map((function(t) { var e = t.split("."); if (2 === e.length) return { domain: e[0], tld: e[1] }; var n = e[0]; return { domain: n, tld: t.split("".concat(n, "."))[1] } })), Ae.MARKDOWN_DEBUG && console.log("whitelist: ", this.whitelistDomainTLDPairs), this.urlRegexStrings = ["https?://(?:www.|(?!www))([a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9])\\.([^\\s]{2,})", "https?://(?:www.|(?!www))([a-zA-Z0-9]+)\\.([^\\s]{2,})", "www.([a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9])\\.([^\\s]{2,})", "www.([a-zA-Z0-9]+)\\.([^\\s]{2,})"], this.urlRegex = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gm, this.xmanRegexFreeForm = /x-man-page:\/\/\S+/gm, this.xmanRegexWithin = /^x-man-page:\/\/\S+/gm, this.regexTemplateStr = function(t) { var e = t.domain, n = t.tld; return "(?:.*.?".concat(e, ".").concat(n, ")") }, this.allowedCharactersInURL = /[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\-._~:\/?#\[\]@!$&'\(\)*+,;=%]*/ } var e, n, r; return e = t, r = [{ key: "getErrorEnums", value: function() { return this.errorEnum } }], (n = [{ key: "isValidUrl", value: function(t) { var e, n, r = t.url, o = t.freeform, i = t.linkText; if (void 0 === i || !i) { var a = r.match(this.allowedCharactersInURL); if (null === a) return !1; if (a[0] !== a.input) return !1 } try { var s = new URL(r); return Ae.MARKDOWN_DEBUG && console.log({ urlObj: s, url: r }), "" === s.host && "applefeedback:" === s.protocol && (s = new URL("https:".concat(s.pathname))), { domain: s.host.split(".")[s.host.split(".").length - 2], tld: s.host.split(".")[s.host.split(".").length - 1] } } catch (t) { for (var l = 0; l < this.urlRegexStrings.length; l++) { var c = this.urlRegexStrings[l]; if (e = new RegExp("".concat(o ? "" : "^").concat(c)), n = r.match(e), Ae.MARKDOWN_DEBUG && console.log({ match: n, i: l, regex: e, rStr: c, freeform: o, url: r }), n) return { domain: n[1], tld: n[2] } } return !1 } } }, { key: "whitelistVerifier", value: function(t) { var e = t.givenDomain, n = t.givenTld; return 1 === this.urlWhitelist.length && "*" === this.urlWhitelist[0] || this.whitelistDomainTLDPairs.some((function(t) { if (!e.endsWith(t.domain)) { var r = "".concat(t.domain, ".").concat(t.tld), o = n.indexOf(r); if (-1 === o) return !1; var i = n.indexOf("/"), a = n.indexOf("#"), s = n.indexOf("?"); if (a > -1 && i > a) return !1; if (s > -1 && i > s) return !1; if (0 !== n.indexOf(r) && "." !== n[o - 1]) return !1; if (-1 === i && (i = s), -1 === i && (i = a), Ae.MARKDOWN_DEBUG && console.log({ positionOfWhiteListURL: o, positionOfFirstSlash: i, whitelistURL: r, givenDomain: e, givenTld: n }), -1 === i && r.length === n.slice(o).length) return !0; if (r.length === i - o) return !0 } if (e.endsWith(t.domain)) { var l = t.domain, c = n.indexOf(l); if (e.length !== l.length && "." !== e[c - 1]) return !1; if (0 === n.indexOf(t.tld)) return n === t.tld || "/" === n[t.tld.length] || "?" === n[t.tld.length] || "#" === n[t.tld.length] } return !1 })) } }, { key: "manPageVerifier", value: function(t) { var e = t.handle; return t.freeform ? this.xmanRegexFreeForm.test(e) : this.xmanRegexWithin.test(e) } }, { key: "getErrors", value: function() { return this.errors } }, { key: "getCombinators", value: function() { var t = this; return { link: { pattern: /(\[(.+?)\])(\((.+?)\))({: \.(\S+?)})?/gm, template: function(e) { Ae.MARKDOWN_DEBUG && console.log({ name: "link", matches: e }); var n = e[2].trim().replace(/"/g, "").replace(/'/g, ""), r = e[4], o = r.split(" "), i = o[0], a = ""; o.length > 1 && (a = r.split(i)[1].trim().replace(/"/g, '\\"').replace(/'/g, "\\'")); var s = e[6], l = "object" === Gn(t.isValidUrl({ url: n, freeform: !1, linkText: !0 })), c = t.isValidUrl({ url: i, freeform: !1 }), u = !1, d = decodeURIComponent(i) !== i; if (c && (u = t.whitelistVerifier({ givenDomain: c.domain, givenTld: c.tld })), !l && u) return "log-attachment" === s ? '") : '').concat(n, ""); if (l && (t.errors[n] = t.errorEnum.hrefTextCantBeLink, n = ''.concat(n, "")), !u) { if (t.manPageVerifier({ handle: i, freeform: !1 })) return '').concat(n, ""); t.errors["(".concat(dn(i))] = t.errorEnum.notWhitelistedUrl, i = ''.concat(i, "") } return "[".concat(n, "](").concat(i, ")") }, textTemplate: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "link", matches: t }); var e = t[2], n = t[4]; return "".concat(e, " - ").concat(n) } }, url: { pattern: this.urlRegex, template: function(e) { Ae.MARKDOWN_DEBUG && console.log({ name: "url", matches: e }); var n = e[0], r = t.isValidUrl({ url: n, freeform: !0 }), o = !1, i = decodeURIComponent(n) !== n; return r && (o = t.whitelistVerifier({ url: n, givenDomain: r.domain, givenTld: r.tld })), o || t.manPageVerifier({ handle: n, freeform: !1 }) ? '').concat(n, "") : (t.errors[dn(n)] = t.errorEnum.notWhitelistedUrl, ''.concat(n, "")) }, textTemplate: function(t) { return Ae.MARKDOWN_DEBUG && console.log({ name: "url", matches: t }), t[0] } }, xman: { pattern: this.xmanRegexFreeForm, template: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "url", matches: t }); var e = t[0]; return '').concat(e, "") } } } } }]) && Kn(e.prototype, n), r && Kn(e, r), t }(); function Zn(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } var zn = function() { function t(e) { ! function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), this.urlParser = new Hn(e.URL_WHITE_LIST), this.urlCombinators = this.urlParser.getCombinators() } var e, n; return e = t, (n = [{ key: "parititionStage2", value: function() { return [{ name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INLINE_CODE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INLINE_CODE.enabled, pattern: wn.pattern, template: wn.template, textTemplate: wn.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.LINK.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.LINK.enabled, pattern: this.urlCombinators.link.pattern, template: this.urlCombinators.link.template, textTemplate: this.urlCombinators.link.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.URL.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.URL.enabled, pattern: this.urlCombinators.url.pattern, template: this.urlCombinators.url.template, textTemplate: this.urlCombinators.url.textTemplate }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.XMAN.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.XMAN.enabled, pattern: this.urlCombinators.xman.pattern, template: this.urlCombinators.xman.template }] } }]) && Zn(e.prototype, n), t }(), Yn = function t(e) { var n = this; ! function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), this.config = e; var r = new zn(e); this.parititionStage2 = r.parititionStage2(), this.blockquote = { pattern: /(?:^> ?)([\s\S]+?)(?:\r?\n\n)/gm, template: function(t) { Ae.MARKDOWN_DEBUG && console.log({ name: "blockquote", matches: t, inputStr: t[1].replace(/\n>/g, "\\n").replace(/ /g, "_") }); var e = Vn({ inputStr: t[1].replace(/\n>/g, "\n"), processorSequence: [ [], [{ name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.CODE_BLOCK.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.CODE_BLOCK.enabled, pattern: Nn.pattern, template: Nn.template }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INLINE_CODE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INLINE_CODE.enabled, pattern: wn.pattern, template: wn.template }, { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INDENTED_CODE_BLOCK.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.INDENTED_CODE_BLOCK.enabled, pattern: Rn.pattern, template: Rn.template }], Dn, n.parititionStage2, Cn ], formats: { text: !0, html: !0 } }); return Ae.MARKDOWN_DEBUG && console.log({ processedText: e }), "

    ".concat(e, "

    ") }, textTemplate: function(t, e) { var n = e.exec(t); return n ? (Ae.MARKDOWN_DEBUG && console.log({ name: "blockquote", match: n }), t.replace(e, (function(t, e) { return "".concat(e.replace(/\n>/g, ""), " ") }))) : t } }, this.parseDefn = { name: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BLOCKQUOTE.name, enabled: Ae.MARKDOWN_PREVIEW_TAGS_DEFINITIONS.BLOCKQUOTE.enabled, pattern: this.blockquote.pattern, template: this.blockquote.template, textTemplate: this.blockquote.textTemplate } }; function Xn(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } var Qn = function() { function t(e) { ! function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), this.config = e; var n = new zn(e); this.parititionStage2 = n.parititionStage2(), this.urlParser = n.urlParser } var e, n; return e = t, (n = [{ key: "convert", value: function(t) { return this.config.MARKDOWN_DEBUG && console.log({ beginning: t }), { html: Vn({ inputStr: t, processorSequence: [xn, [new Yn(this.config).parseDefn].concat(Mn), Dn, this.parititionStage2, Cn], formats: { text: !1, html: !0 } }), text: Vn({ inputStr: t, processorSequence: [xn, [new Yn(this.config).parseDefn].concat(Mn), Dn, this.parititionStage2, Cn], formats: { text: !0, html: !1 } }), errors: this.urlParser.getErrors() } } }]) && Xn(e.prototype, n), t }(), $n = { USER_SELECT_PROPERTIES: ["userSelect", "mozUserSelect", "webkitUserSelect", "msUserSelect"] }; function Jn(t) { return (Jn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function tr(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } function er(t, e, n) { return (er = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function(t, e, n) { var r = function(t, e) { for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = ir(t));); return t }(t, e); if (r) { var o = Object.getOwnPropertyDescriptor(r, e); return o.get ? o.get.call(n) : o.value } })(t, e, n || t) } function nr(t, e) { return (nr = Object.setPrototypeOf || function(t, e) { return t.__proto__ = e, t })(t, e) } function rr(t, e) { return !e || "object" !== Jn(e) && "function" != typeof e ? or(t) : e } function or(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t } function ir(t) { return (ir = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t) })(t) } var ar = { position: "absolute", height: "12px", width: "12px", backgroundColor: "white", border: "1px solid #777", boxSizing: "border-box", opacity: "0.80" }, sr = { position: "absolute", boxSizing: "border-box", border: "1px dashed #444" }, lr = 50, cr = function(t) { ! function(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && nr(t, e) }(a, t); var e, n, r, i = function(t) { var e = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0 } catch (t) { return !1 } }(); return function() { var n, r = ir(t); if (e) { var o = ir(this).constructor; n = Reflect.construct(r, arguments, o) } else n = r.apply(this, arguments); return rr(this, n) } }(a); function a(t) { var e; return function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, a), (e = i.call(this, t)).editor = t.root, e.container = t.container, e.img = null, e.overlay = null, e.boxes = [], e.handleClick = e.handleClick.bind(or(e)), e.handleMousedown = e.handleMousedown.bind(or(e)), e.handleMouseup = e.handleMouseup.bind(or(e)), e.handleDrag = e.handleDrag.bind(or(e)), e.repositionOverlay = e.repositionOverlay.bind(or(e)), e.enableResizing = e.enableResizing.bind(or(e)), e.disableResizing = e.disableResizing.bind(or(e)), e.ifDeleteImage = e.ifDeleteImage.bind(or(e)), document.addEventListener("mousedown", e.handleClick, !1), e } return e = a, r = [{ key: "create", value: function(t) { return er(ir(a), "create", this).call(this, t) } }, { key: "value", value: function(t) { return t.getAttribute("src") } }], (n = [{ key: "handleClick", value: function(t) { if (t.target && t.target.tagName && "IMG" === t.target.tagName.toUpperCase() && this.container.contains(t.target)) { if (t.target === this.img) return; this.img && this.disableResizing(), this.enableResizing(t.target) } else this.img && t.target && !this.boxes.includes(t.target) && this.disableResizing() } }, { key: "enableResizing", value: function(t) { this.img = t, this.container.style.position = "relative", this.addOverlay(), this.addBox("nwse-resize"), this.addBox("nesw-resize"), this.addBox("nwse-resize"), this.addBox("nesw-resize"), this.positionBoxes(), this.container.addEventListener("scroll", this.repositionOverlay, !0) } }, { key: "disableResizing", value: function() { this.overlay && (this.setUserSelect(""), this.img = null, this.container.removeChild(this.overlay), this.overlay = null, this.boxes = [], this.container.removeEventListener("scroll", this.repositionOverlay, !0), document.removeEventListener("keydown", this.ifDeleteImage, !0)) } }, { key: "repositionOverlay", value: function() { var t = this.container, e = this.img.getBoundingClientRect(), n = t.getBoundingClientRect(); Object.assign(this.overlay.style, { left: "".concat(e.left - n.left - 1 + t.scrollLeft, "px"), top: "".concat(e.top - n.top + t.scrollTop, "px"), width: "".concat(e.width, "px"), height: "".concat(e.height, "px") }) } }, { key: "addOverlay", value: function() { this.setUserSelect("none"), this.overlay = document.createElement("DIV"), Object.assign(this.overlay.style, sr), this.container.appendChild(this.overlay), this.repositionOverlay(), document.addEventListener("keydown", this.ifDeleteImage, !0) } }, { key: "addBox", value: function(t) { var e = document.createElement("DIV"); Object.assign(e.style, ar), e.style.cursor = t, e.style.width = ar.width, e.style.height = ar.height, e.addEventListener("mousedown", this.handleMousedown, !1), e.addEventListener("touchstart", this.handleMousedown, !1), this.overlay.appendChild(e), this.boxes.push(e) } }, { key: "positionBoxes", value: function() { var t = this, e = "".concat(-parseFloat(ar.width) / 2, "px"), n = "".concat(-parseFloat(ar.height) / 2, "px"); [{ left: e, top: n }, { right: e, top: n }, { right: e, bottom: n }, { left: e, bottom: n }].forEach((function(e, n) { Object.assign(t.boxes[n].style, e) })) } }, { key: "handleMousedown", value: function(t) { t.preventDefault(), this.dragBox = t.target, this.dragStartX = t.clientX || t.touches[0].clientX, this.preDragWidth = this.img.width || this.img.naturalWidth, this.setCursor(this.dragBox.style.cursor), document.addEventListener("mousemove", this.handleDrag, !1), document.addEventListener("mouseup", this.handleMouseup, !1), document.addEventListener("touchmove", this.handleDrag, !1), document.addEventListener("touchend", this.handleMouseup, !1) } }, { key: "handleMouseup", value: function() { this.setCursor("auto"), document.removeEventListener("mousemove", this.handleDrag), document.removeEventListener("mouseup", this.handleMouseup), document.removeEventListener("touchmove", this.handleDrag), document.removeEventListener("touchend", this.handleMouseup), this.img.height = this.img.height } }, { key: "handleDrag", value: function(t) { if (this.img) { var e = (void 0 !== t.clientX ? t.clientX : t.touches[0].clientX) - this.dragStartX; if (this.dragBox === this.boxes[0] || this.dragBox === this.boxes[3]) { var n = Math.round(this.preDragWidth - e); this.img.width = n >= lr ? n : lr } else { var r = Math.round(this.preDragWidth + e); this.img.width = r >= lr ? r : lr } this.repositionOverlay() } } }, { key: "setCursor", value: function(t) { [document.body, this.img].forEach((function(e) { e.style.cursor = t })) } }, { key: "setUserSelect", value: function(t) { var e = this; $n.USER_SELECT_PROPERTIES.forEach((function(n) { e.editor.style[n] = t })) } }, { key: "ifDeleteImage", value: function(t) { if (this.img && (8 === t.keyCode || 46 === t.keyCode)) { t.preventDefault(); var e = o.a.find(this.img); e && e.deleteAt(0, 1), this.disableResizing() } } }]) && tr(e.prototype, n), r && tr(e, r), a }(le); function ur(t) { return function(t) { if (Array.isArray(t)) return dr(t) }(t) || function(t) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t) }(t) || function(t, e) { if (t) { if ("string" == typeof t) return dr(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? dr(t, e) : void 0 } }(t) || function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() } function dr(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r } function hr(t, e, n, r, o) { var i; Array.isArray(n) || (n = Array.from(n)); var a = (i = t ? [].concat(ur(n.slice(e + 1, n.length)), ur(n.slice(0, e + 1))) : [].concat(ur(n.slice(e, n.length)), ur(n.slice(0, e))).reverse())[0]; r && (a = i.find((function(t) { var e = "input" === t.tagName.toLowerCase() && "checkbox" === t.getAttribute("type"); return !e && function(t) { if (!(t instanceof Element)) throw Error("DomUtil: elem is not an element."); var e = getComputedStyle(t); if ("none" === e.display) return !1; if ("visible" !== e.visibility) return !1; if (e.opacity < .1) return !1; if (t.offsetWidth + t.offsetHeight + t.getBoundingClientRect().height + t.getBoundingClientRect().width === 0) return !1; var n = t.getBoundingClientRect().left + t.offsetWidth / 2, r = t.getBoundingClientRect().top + t.offsetHeight / 2; return !(n < 0 || n > (document.documentElement.clientWidth || window.innerWidth) || r < 0 || r > (document.documentElement.clientHeight || window.innerHeight)) }(t) && !t.disabled || e && o }))), a.focus() } var fr = []; function pr(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } var gr = Ae.MODEL_FOCUS_TIMEOUT, yr = function() { function t(e) { if (function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), e.WHITE_LISTED_FORMATS.includes("log")) { var n = this.constructor.getTemplate(e), r = { overlay: n, dialog: n.querySelector('[data-action="rte-dialog"]'), closeButton: n.querySelector('[data-action="rte-close-dialog"]'), title: n.querySelector('[data-action="rte-dialog-title"]'), body: n.querySelector('[data-action="rte-dialog-body"]'), titleError: n.querySelector('[data-action="rte-dialog-title-error"]'), titleErrorContent: n.querySelector('[data-action="rte-dialog-title-error-content"]'), bodyError: n.querySelector('[data-action="rte-dialog-body-error"]'), bodyErrorContent: n.querySelector('[data-action="rte-dialog-body-error-content"]'), save: n.querySelector('[data-action="rte-dialog-save"]'), cancel: n.querySelector('[data-action="rte-dialog-cancel"]'), form: n.querySelector('[data-action="rte-dialog-form"]') }, o = { _shown: !1, _title: "", _body: "", _titleErrorShown: !1, _bodyErrorShown: !1, _prevFocus: null, get shown() { return this._shown }, set shown(t) { this._shown = t, t ? (this._prevFocus = document.activeElement, sn(r.overlay), function(t, e) { document.querySelectorAll("".concat(t, " > *")).forEach((function(t) { var n, r = "true" !== t.getAttribute("aria-hidden"); t !== e && r && (n = t, fr.push(n), n.setAttribute("aria-hidden", "true")) })) }("body", r.overlay), getSelection().removeAllRanges(), document.body.classList.add("modal-open"), setTimeout((function() { r.dialog.focus() }), gr)) : (ln(r.overlay), fr.forEach((function(t) { t.removeAttribute("aria-hidden") })), fr = [], this._prevFocus && this._prevFocus.focus(), this.title = "", this.body = "", this.titleErrorShown = !1, this.bodyErrorShown = !1, document.body.classList.remove("modal-open")) }, get title() { return this._title }, set title(t) { this._title = t, r.title.value !== t && (r.title.value = t) }, get body() { return this._body }, set body(t) { this._body = t, r.body.value !== t && (r.body.value = t) }, get titleErrorShown() { return this._titleErrorShown }, set titleErrorShown(t) { this._titleErrorShown = t, t ? sn(r.titleError) : ln(r.titleError) }, get bodyErrorShown() { return this._bodyErrorShown }, set bodyErrorShown(t) { this._bodyErrorShown = t, t ? sn(r.bodyError) : ln(r.bodyError) } }; this.elements = r, this.state = o, this.config = e, this.cb = null, this.addEvents(), document.querySelector("body").appendChild(r.overlay) } } var e, n, r; return e = t, r = [{ key: "getTemplate", value: function(t) { var e = '\n \n "), n = document.createElement("div"); return n.classList.add("rte-common"), n.classList.add("rte-dialog-overlay"), n.classList.add("hidden"), n.setAttribute("data-action", "rte-logs-dialog"), n.innerHTML = e, n } }], (n = [{ key: "markAria", value: function(t) { var e = t.state, n = void 0 === e ? "invalid" : e, r = t.element; "invalid" === n ? r.setAttribute("aria-invalid", "true") : r.setAttribute("aria-invalid", "false") } }, { key: "validateTitle", value: function() { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n = function(n) { return t.elements.titleErrorContent.textContent = n, t.state.titleErrorShown = !0, t.markAria({ state: "invalid", element: t.elements.title }), e && t.elements.title.focus(), !1 }; if (0 === this.state.title.length) { var r = this.config.LOCALIZATIONS.dialogErrorTitleEmpty; return n(r) } if (this.state.title.length > this.config.MAX_LOG_TITLE_LENGTH) { var o = cn(this.config.LOCALIZATIONS.dialogErrorTitleTooLong, this.config.MAX_LOG_TITLE_LENGTH); return n(o) } return this.markAria({ state: "valid", element: this.elements.title }), "" !== this.elements.titleErrorContent.textContent && (this.elements.titleErrorContent.textContent = ""), this.state.titleErrorShown && (this.state.titleErrorShown = !1), !0 } }, { key: "validateBody", value: function() { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n = function(n) { return t.elements.bodyErrorContent.textContent = n, t.state.bodyErrorShown = !0, t.markAria({ state: "invalid", element: t.elements.body }), e && t.elements.body.focus(), !1 }; return 0 === this.state.body.length ? n(this.config.LOCALIZATIONS.dialogErrorBodyEmpty) : this.state.body.length > this.config.MAX_LOG_BODY_LENGTH ? n(cn(this.config.LOCALIZATIONS.dialogErrorBodyTooLong, this.config.MAX_LOG_BODY_LENGTH)) : (this.markAria({ state: "valid", element: this.elements.body }), "" !== this.elements.bodyErrorContent.textContent && (this.elements.bodyErrorContent.textContent = ""), this.state.bodyErrorShown && (this.state.bodyErrorShown = !1), !0) } }, { key: "addEvents", value: function() { var t = this; this.elements.closeButton.addEventListener("click", (function() { t.state.shown = !1 })), this.elements.cancel.addEventListener("click", (function(e) { e.preventDefault(), t.state.shown = !1 })), this.elements.form.addEventListener("submit", (function(e) { e.preventDefault(), t.validateTitle(!0) && t.validateBody(!0) && (t.cb && t.cb({ title: t.state.title, body: t.state.body }), t.state.shown = !1) })), function(t, e, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], o = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4]; n && window.addEventListener("keydown", (function(e) { (!t || t && t.checked) && 27 === e.keyCode && n() })), e && e.forEach((function(n, i) { n.addEventListener("keydown", (function(n) { if ((t && t.checked || !t) && 9 === n.keyCode) { n.preventDefault(); var a = !0; n.shiftKey && (a = !1), hr(a, i, e, r, o) } })) })) }(null, this.elements.overlay.querySelectorAll("button, input, textarea"), (function() { t.state.shown && (t.state.shown = !1) })), this.elements.title.addEventListener("input", (function() { t.state.title = t.elements.title.value, t.validateTitle() })), this.elements.title.addEventListener("blur", (function() { t.validateTitle() })), this.elements.body.addEventListener("input", (function() { t.state.body = t.elements.body.value, t.validateBody() })), this.elements.body.addEventListener("blur", (function() { t.validateBody() })), this.config.SMALL_VIEWPORT_FORMATS && !this.config.SMALL_VIEWPORT_FORMATS.includes("log") && window.addEventListener("resize", (function() { t.state.shown && window.innerWidth < 736 && (t.state.shown = !1) })) } }, { key: "open", value: function(t) { this.state.shown = !0, this.cb = t } }]) && pr(e.prototype, n), r && pr(e, r), t }(); function mr(t) { var e = t.searchStr, n = void 0 === e ? "" : e, r = t.fullText, o = t.caseSensitive, i = void 0 !== o && o, a = n.length; if (0 === a) return []; var s, l = 0, c = []; for (i || (r = r.toLowerCase(), n = n.toLowerCase()); (s = r.indexOf(n, l)) > -1;) c.push(s), l = s + a; return c.map((function(t) { return { index: t, length: a } })) } function br(t) { return (br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function Er(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } function Ar(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } function vr(t, e, n) { return (vr = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function(t, e, n) { var r = function(t, e) { for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = _r(t));); return t }(t, e); if (r) { var o = Object.getOwnPropertyDescriptor(r, e); return o.get ? o.get.call(n) : o.value } })(t, e, n || t) } function Tr(t, e) { return (Tr = Object.setPrototypeOf || function(t, e) { return t.__proto__ = e, t })(t, e) } function Or(t, e) { return !e || "object" !== br(e) && "function" != typeof e ? function(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t }(t) : e } function _r(t) { return (_r = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t) })(t) } var Ir = function(t) { ! function(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && Tr(t, e) }(o, t); var e, n, r = function(t) { var e = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0 } catch (t) { return !1 } }(); return function() { var n, r = _r(t); if (e) { var o = _r(this).constructor; n = Reflect.construct(r, arguments, o) } else n = r.apply(this, arguments); return Or(this, n) } }(o); function o() { return Er(this, o), r.apply(this, arguments) } return e = o, n = [{ key: "create", value: function(t) { var e = vr(_r(o), "create", this).call(this, t); return e.setAttribute("class", "errorblock"), e } }, { key: "formats", value: function() { return {} } }], null && Ar(e.prototype, null), n && Ar(e, n), o }(y); Ir.blotName = "errorhighlight", Ir.className = "errorhighlight", Ir.tagName = "SPAN"; var Sr = Ir; function Lr(t) { var e = t.range, n = t.editor, r = t.lineBoundary, o = t.wordBoundary, i = t.blockBoundary, a = function(t) { var e = t.range, n = t.fullText, r = t.lineBoundary, o = t.wordBoundary, i = t.blockBoundary, a = e.index, s = e.index + e.length, l = function() { return !1 }; if (o) l = function(t) { return " " === t || "\n" === t }; else if (r) l = function(t) { return "\n" === t }; else { if (!i) return e; l = function(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; return "\n" === t && "\n" === e } } if (a > 0) for (; --a > 0;) if (l(n[a])) { a++; break } var c = n.length - 1; if (s < c) for (; s < c && !l(n[s]);) s++; return { index: a, length: s - a } }({ range: e, fullText: n.getText(), lineBoundary: r, wordBoundary: o, blockBoundary: i }); return n.setSelection(a.index, a.length), { expandedRange: a, expandedText: n.getText(a.index, a.length) } } function Nr(t) { var e = t.action, n = t.range, r = t.selectedRange, o = t.newText; this.action = e, this.range = n, this.selectedRange = r, this.newText = o } function Rr(t) { var e = t.hText, n = void 0 === e ? "body text" : e, r = t.level, o = void 0 === r ? "" : r, i = t.prefix, a = void 0 === i ? "" : i; switch (o) { case 1: return "".concat(a, "# ").concat(n, "\n"); case 2: return "".concat(a, "## ").concat(n, "\n"); case 3: return "".concat(a, "### ").concat(n, "\n"); default: return n } } var wr, xr, Mr, Dr = { tasklist: "\n- [] TODO Item\n- [x] DONE Item\n", ordered: "\n1. Item 1\n2. Item 2\n", bullet: "\n* Item 1\n* Item 2\n" }; function Cr(t) { var e = t.editor, n = function(t) { var e = t.editor, n = t.originalRange, r = t.attrValue; switch (t.format) { case "header": var o = Lr({ editor: e, range: n, lineBoundary: !0 }); return wr = o.expandedText, function(t) { var e = t.oldText, n = t.attrValue, r = t.range, o = parseInt(n, 10), i = ""; if ("" === e || "\n" === e) return new Nr({ selectedRange: { index: o + 1, length: (i = function(t) { var e = t.level, n = t.prefix; return Rr({ level: e, hText: "header ".concat(e), prefix: n }) }({ level: o, prefix: "" })).length }, newText: i, action: "insert", range: r }); var a = mn.pattern.exec(e); return new Nr({ selectedRange: { index: o + 1, length: (i = Rr(a ? { hText: a[2], level: o } : { hText: e, level: o })).length }, newText: i, action: "replace", range: r }) }({ range: o.expandedRange, oldText: wr, attrValue: r }); case "bold": var i = Lr({ editor: e, range: n, wordBoundary: !0 }); return wr = i.expandedText, function(t) { var e = t.oldText, n = t.range; return new Nr("" === e ? { newText: "**bold**", selectedRange: { index: 2, length: 4 }, range: n, action: "insert" } : { newText: "**".concat(e, "**"), selectedRange: { index: 2, length: e.length }, range: n, action: "replace" }) }({ range: i.expandedRange, oldText: wr }); case "italic": var a = Lr({ editor: e, range: n, wordBoundary: !0 }); return wr = a.expandedText, function(t) { var e = t.oldText, n = t.range; return new Nr("" === e ? { newText: "_italic_", selectedRange: { index: 1, length: 6 }, range: n, action: "insert" } : { newText: "_".concat(e, "_"), selectedRange: { index: 1, length: e.length }, range: n, action: "replace" }) }({ range: a.expandedRange, oldText: wr }); case "underline": var s = Lr({ editor: e, range: n, wordBoundary: !0 }); return wr = s.expandedText, function(t) { var e = t.oldText, n = t.range; return new Nr("" === e ? { newText: "__underline__", selectedRange: { index: 2, length: 9 }, range: n, action: "insert" } : { newText: "_".concat(e, "_"), selectedRange: { index: 2, length: e.length }, range: n, action: "replace" }) }({ range: s.expandedRange, oldText: wr }); case "blockquote": var l = Lr({ editor: e, range: n, lineBoundary: !0 }); return wr = l.expandedText, function(t) { var e = t.oldText, n = t.range; return new Nr("" === e ? { newText: "\n> Multiline\n> BlockQuote\n\n", selectedRange: { index: 3, length: 22 }, range: n, action: "insert" } : { newText: "\n> ".concat(e, "\n\n"), selectedRange: { index: 3, length: e.length }, range: n, action: "replace" }) }({ range: l.expandedRange, oldText: wr }); case "code-block": var c = Lr({ editor: e, range: n, lineBoundary: !0 }); return wr = c.expandedText, function(t) { var e = t.oldText, n = t.range; return new Nr("" === e ? { newText: "```language\ncode-block\n```\n", selectedRange: { index: 3, length: 19 }, range: n, action: "insert" } : { newText: "```\n".concat(e, "\n```"), selectedRange: { index: 4, length: e.length }, range: n, action: "replace" }) }({ range: c.expandedRange, oldText: wr }); case "to-link": var u = Lr({ editor: e, range: n, wordBoundary: !0 }); return wr = u.expandedText, function(t) { var e = t.oldText, n = t.range; if ("" === e) return new Nr({ newText: "[linkText](https://www.example.com/)", selectedRange: { index: 1, length: 34 }, range: n, action: "insert" }); var r = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/.exec(e); if (r) { var o = r[0], i = "".concat(e.substring(0, r.index)).concat(e.substring(r.index + r[0].length)); return "" === i || i.match(/^\s+$/) ? new Nr({ newText: "[Insert link text here](".concat(o, ")"), selectedRange: { index: 1, length: 21 }, range: n, action: "replace" }) : new Nr({ newText: "[".concat(i, "](").concat(o, ")"), selectedRange: { index: 1, length: i.length }, range: n, action: "replace" }) } return new Nr({ newText: "[".concat(e, "](https://www.example.com/)"), selectedRange: { index: 3 + e.length, length: 24 }, range: n, action: "replace" }) }({ range: u.expandedRange, oldText: wr }); case "list": var d = Lr({ editor: e, range: n, lineBoundary: !0 }); return wr = d.expandedText, function(t) { var e, n, r, o = t.oldText, i = t.range, a = t.attrValue, s = /(^(.*)\n?)/gm, l = [], c = 0, u = 0; if ("" === o) { if ("bullet" === a) return new Nr({ newText: Dr.bullet, action: "insert", selectedRange: { index: 0, length: Dr.bullet.length }, range: i }); if ("tasklist" === a) return new Nr({ newText: Dr.tasklist, action: "insert", selectedRange: { index: 0, length: Dr.tasklist.length }, range: i }); if ("ordered" === a) return new Nr({ newText: Dr.ordered, action: "insert", selectedRange: { index: 0, length: Dr.ordered.length }, range: i }) } var d = function(t) { var e = t.oldText, n = t.targetAttrValue, r = "", o = !1; if (-1 !== Dr.bullet.indexOf(e) && (r = "bullet", o = !0), -1 !== Dr.tasklist.indexOf(e) && (r = "tasklist", o = !0), -1 !== Dr.ordered.indexOf(e) && (r = "ordered", o = !0), o) switch (n) { case r: return { found: o, switchedStyleText: e }; case "ordered": return { found: o, switchedStyleText: Dr.ordered }; case "tasklist": return { found: o, switchedStyleText: Dr.tasklist }; case "bullet": return { found: o, switchedStyleText: Dr.bullet }; default: return { found: o, switchedStyleText: e } } return { found: o, switchedStyleText: e } }({ oldText: o, targetAttrValue: a }); if (n = d.found, r = d.switchedStyleText, n) return new Nr({ range: i, action: "replace", newText: r, selectedRange: { index: 0, length: r.length } }); for (; null !== (e = s.exec(o));) e.index === s.lastIndex && s.lastIndex++, c++, "bullet" === a && (l.push("* ".concat(e[0])), u = 2), "tasklist" === a && (l.push("- [ ] ".concat(e[0])), u = 5), "ordered" === a && (l.push("".concat(c, ". ").concat(e[0])), u = 3); var h = l.join(""); return console.log({ retStr: h, rIndex: u }), new Nr({ newText: "".concat(h, "\n"), action: "replace", selectedRange: { index: u, length: h.length - u }, range: i }) }({ range: d.expandedRange, oldText: wr, attrValue: r }); default: return new Nr({ newText: "", range: n, selectedRange: { index: 0, length: 0 }, selectLength: 0, action: "insert" }) } }({ editor: e, originalRange: t.range, format: t.format, attrValue: t.attrValue }); "replace" === n.action && function(t) { var e = t.editor, n = t.range, r = t.selectedRange, o = t.replacedText; e.deleteText(n.index, n.length), e.insertText(n.index, o), e.setSelection(n.index + r.index, r.length) }({ editor: e, range: n.range, selectedRange: n.selectedRange, replacedText: n.newText }), "insert" === n.action && function(t) { var e = t.editor, n = t.range, r = t.selectedRange, o = t.insertedText; e.insertText(n.index, o), e.setSelection(n.index + r.index, r.length) }({ editor: e, range: n.range, selectedRange: n.selectedRange, insertedText: n.newText }) } function kr(t, e) { return function(t) { if (Array.isArray(t)) return t }(t) || function(t, e) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) { var n = [], r = !0, o = !1, i = void 0; try { for (var a, s = t[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !e || n.length !== e); r = !0); } catch (t) { o = !0, i = t } finally { try { r || null == s.return || s.return() } finally { if (o) throw i } } return n } }(t, e) || Br(t, e) || function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() } function Pr(t) { return (Pr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function Ur(t) { return function(t) { if (Array.isArray(t)) return Wr(t) }(t) || function(t) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t) }(t) || Br(t) || function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() } function Br(t, e) { if (t) { if ("string" == typeof t) return Wr(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Wr(t, e) : void 0 } } function Wr(t, e) { (null == e || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r } function Fr(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter((function(e) { return Object.getOwnPropertyDescriptor(t, e).enumerable }))), n.push.apply(n, r) } return n } function jr(t) { for (var e = 1; e < arguments.length; e++) { var n = null != arguments[e] ? arguments[e] : {}; e % 2 ? Fr(Object(n), !0).forEach((function(e) { qr(t, e, n[e]) })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Fr(Object(n)).forEach((function(e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)) })) } return t } function qr(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t } n(39); var Vr, Gr = jr({}, Ae), Kr = { _activeRow: null, activeFormats: [], prevFormats: {}, prevFocus: null, initialQuoteInserted: !1, errorHighlightList: [], set activeRow(t) { if (this._activeRow) { var e = this._activeRow.querySelector('input[type="text"]'); e && (e.value = ""); var n = this._activeRow.querySelector("[".concat(Gr.ATTR_NAME, "-apply]")); n && n.setAttribute("disabled", !0), this._activeRow === xr.mainRow && (this.prevFocus = document.activeElement), ln(this._activeRow), zr() } if (t && sn(t), this._activeRow = t, this._activeRow === xr.mainRow && this.prevFocus) this.prevFocus.focus(), this.prevFocus = null; else if (this._activeRow !== xr.mainRow) { var r = this._activeRow.querySelector('input[type="text"]'), o = this._activeRow.querySelector("button"); r ? r.focus() : o ? o.focus() : this._activeRow.focus() } }, get activeRow() { return this._activeRow } }, Hr = { default: function(t, e) { var n = Mr.getFormat(), r = !0; t.hasAttribute(Gr.VALUE_ATTR_NAME) ? (r = t.getAttribute(Gr.VALUE_ATTR_NAME), n[e] == r && (r = !1)) : n[e] && (r = !1), Gr.ENABLE_MARKDOWN ? Cr({ editor: Mr, range: Mr.getSelection(), format: e, attrValue: r }) : (Mr.format(e, r), Xr(Mr.getSelection())) } }; function Zr(t) { for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r]; xr.messagesContent.textContent = cn.apply(void 0, [Gr.MESSAGES(t)].concat(n)), sn(xr.messages) } function zr(t) { var e = function() { xr.messagesContent.textContent = "", ln(xr.messages) }; "number" == typeof t ? setTimeout((function() { e() }), t) : e() } function Yr() { xr.globalMessageContent.textContent = "", ln(xr.globalMessage) } function Xr(t) { if (t) { var e = Mr.getFormat(t), n = !0, r = Object.keys(Kr.prevFormats), o = Object.keys(e), i = ["header", "indent", "align", "list"]; if (r.length !== o.length) n = !1; else for (var a = 0; n && a < o.length;) Kr.prevFormats[o[a]] ? i.includes(o[a]) && Kr.prevFormats[o[a]] !== e[o[a]] && (n = !1) : n = !1, a++; if (!n) { var s = function(t) { t.classList.add(Gr.ACTIVE_CLASS_NAME), t.setAttribute("aria-pressed", !0), Kr.activeFormats.push(t) }, l = function(t) { t.setAttribute("disabled", !0) }; Kr.activeFormats.forEach((function(t) { t.classList.remove(Gr.ACTIVE_CLASS_NAME), t.removeAttribute("aria-pressed") })), xr.toolbar.querySelectorAll("[".concat(Gr.ATTR_NAME, '="indent"]')).forEach((function(t) { t.removeAttribute("disabled") })); var c = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, "='align-dropdown']")); if (c && !c.classList.contains("hidden") && ln(c), Object.keys(e).forEach((function(t) { if ("token" !== t) { if ("align" === t) { var n = xr.toolbar.querySelectorAll("[".concat(Gr.ATTR_NAME, '="').concat(t, '"]')), r = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="to-align"]')); n.forEach((function(n) { n.getAttribute(Gr.VALUE_ATTR_NAME) === e[t] && s(n) })), r && s(r), c && ln(c) } else if ("indent" === t) { var o = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="').concat(t, '"][').concat(Gr.VALUE_ATTR_NAME, '="+1"]')); e[t] < Gr.MAX_INDENT ? s(o) : e[t] === Gr.MAX_INDENT && l(o) } else if ("link" === t || "video" === t) { var i = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="to-').concat(t, '"]')); s(i) } else if ("header" === t) { var a = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="').concat(t, '"][').concat(Gr.VALUE_ATTR_NAME, '="').concat(e[t], '"]')), u = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="to-headers"]')); s(a), s(u) } else if ("list" === t) { var d = xr.toolbar.querySelectorAll("[".concat(Gr.ATTR_NAME, '="').concat(t, '"]')), h = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="to-list"]')), f = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="list-dropdown"]')); d.forEach((function(n) { n.getAttribute(Gr.VALUE_ATTR_NAME) === e[t] && s(n) })), h && s(h), f && ln(f) } else { var p = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="').concat(t, '"]')); p && p.hasAttribute(Gr.VALUE_ATTR_NAME) && p.getAttribute(Gr.VALUE_ATTR_NAME).length > 0 && (p = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="').concat(t, '"][').concat(Gr.VALUE_ATTR_NAME, '="').concat(e[t], '"]'))), p && s(p) } if (Gr.FORMATS_ROW_FORMATS.includes(t)) { var g = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="to-formats"]')); g && s(g) } } })), !e.indent && Gr.WHITE_LISTED_FORMATS.includes("indent")) { var u = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, '="indent"][').concat(Gr.VALUE_ATTR_NAME, '="-1"]')); l(u) } Kr.prevFormats = Object.assign({}, e) } } } Hr.log = function() { if (Vr && Gr.UPLOAD_LOG && Gr.UPLOAD_LOG_RESPONSE_PROCESSOR) { var t = function() { var t; (t = console).error.apply(t, arguments), Zr("log-failure"), zr(Gr.UPLOAD_ERROR_TIMEOUT) }; Vr.open((function(e) { Gr.UPLOAD_LOG(e.body).then((function(n) { var r = Mr.getSelection(!0), o = Gr.UPLOAD_LOG_RESPONSE_PROCESSOR(n); if (o) if (Gr.ENABLE_MARKDOWN) { var i = "\n[".concat(e.title, "](").concat(o, "){: .log-attachment}\n"); Mr.insertText(r.index, i), Mr.setSelection(r.index + i.length + 1, W.sources.SILENT) } else Mr.insertEmbed(r.index, "log", { url: o, title: e.title }, W.sources.USER), Mr.setSelection(r.index + 1, W.sources.SILENT); else t('Unable to upload log into RCE. Received "false" when parsing response.') })).catch((function(e) { t("Unable to upload log into RCE.", e) })) })) } }, Hr.blockquote = function(t, e) { if (Gr.INITIAL_QUOTE && !Kr.initialQuoteInserted) { var n = [], r = !1; Mr.getLength() > 1 && (n = Ur(Mr.getContents().ops)), Gr.INITIAL_QUOTE_AUTHOR && Gr.INITIAL_QUOTE.ops.unshift({ insert: "".concat(cn(Gr.LOCALIZATIONS.initialQuoteAuthorLabel, Gr.INITIAL_QUOTE_AUTHOR), "\n") }, { insert: "\n" }), Gr.INITIAL_QUOTE.ops.map((function(t, e) { if (t.attributes && t.attributes.blockquote && (r = e - 1 > 0 && !r ? e - 1 : r, t.attributes.indent ? t.attributes.indent += t.attributes.indent : t.attributes.indent = 1), "string" == typeof t.insert && t.insert.includes("\n")) { if (t.attributes ? t.attributes.blockquote = !0 : t.attributes = { blockquote: !0 }, t.attributes && t.attributes["code-block"]) t.attributes["code-block"] = !1; else if (t.attributes && t.attributes.list && "bullet" === t.attributes.list && Gr.INITIAL_QUOTE.ops[e - 1]) Gr.INITIAL_QUOTE.ops[e - 1].insert = "• ".concat(Gr.INITIAL_QUOTE.ops[e - 1].insert); else if (t.attributes && t.attributes.list && "ordered" === t.attributes.list && Gr.INITIAL_QUOTE.ops[e - 1]) { var n = 1, o = 0, i = !1, a = 2; for ("number" == typeof t.attributes.indent && (o = t.attributes.indent); !i;) { var s = Gr.INITIAL_QUOTE.ops[e - a]; if (s && s.attributes && s.attributes.list && "ordered" === s.attributes.list) { var l = "number" == typeof s.attributes.indent ? s.attributes.indent : 0; l < o ? i = !0 : l === o ? (n++, a += 2) : a += 2 } else i = !0 } Gr.INITIAL_QUOTE.ops[e - 1].insert = "".concat(n, ". ").concat(Gr.INITIAL_QUOTE.ops[e - 1].insert) } } else if ("object" === Pr(t.insert)) { var c = function(t, n) { t && ("string" == typeof t.insert ? t.insert.includes("\n") && t.insert.indexOf("\n") === t.insert.length - 1 || (Gr.INITIAL_QUOTE.ops[e - 1].insert = "".concat(Gr.INITIAL_QUOTE.ops[e - 1].insert, "\n"), Gr.INITIAL_QUOTE.ops[e - 1].attributes = { blockquote: !0 }) : n.insert.attributes && (t.insert.attributes.link || t.insert.attributes.video || t.insert.attributes.image) && Gr.INITIAL_QUOTE.ops.splice(e, 0, { insert: "\n", attributes: { blockquote: !0 } })), n && ("string" == typeof n.insert ? n.insert.includes("\n") && 0 === n.insert.indexOf("\n") || (Gr.INITIAL_QUOTE.ops[e + 1].insert = "\n".concat(Gr.INITIAL_QUOTE.ops[e + 1].insert), Gr.INITIAL_QUOTE.ops[e + 1].attributes = { blockquote: !0 }) : n.insert.attributes && (n.insert.attributes.link || n.insert.attributes.video || n.insert.attributes.image) && Gr.INITIAL_QUOTE.ops.splice(e + 1, 0, { insert: "\n", attributes: { blockquote: !0 } })) }; if (t.insert.video) { var u = t.insert.video.substring(0, t.insert.video.length - 11).substring(t.insert.video.lastIndexOf("/") + 1, t.insert.video.length - 11), d = "https://www.youtube.com/watch?v=".concat(u); t.insert = d, t.attributes = { link: d }, c(Gr.INITIAL_QUOTE.ops[e - 1], Gr.INITIAL_QUOTE.ops[e + 1]) } else if (t.insert.image) { var h = t.insert.image; t.insert = h, t.attributes = { link: h }, c(Gr.INITIAL_QUOTE.ops[e - 1], Gr.INITIAL_QUOTE.ops[e + 1]) } else if (t.insert.log) { var f = "<".concat(t.insert.log.title, ".log>\n"); t.insert = f, t.attributes = { blockquote: !0 } } } return t })), r && Gr.INITIAL_QUOTE.ops.splice(r, 0, { attributes: { blockquote: !0 }, insert: "\n" }), n = [].concat(Ur(n), Ur(Gr.INITIAL_QUOTE.ops)), Mr.setContents(n); var o = Mr.getLength(); Mr.insertText(o, "\n"), Mr.setSelection(o, 0), Kr.initialQuoteInserted = !0 } else Hr.default(t, e) }, Hr.indent = function(t, e) { var n = t.getAttribute(Gr.VALUE_ATTR_NAME); Mr.format(e, n), Xr(Mr.getSelection()) }, Hr.image = function(t) { var e = t.parentElement.querySelector("[".concat(Gr.ATTR_NAME, '="image-input"]')); e && (e.click(), Mr.getModule("imageResize").disableResizing()) }, Hr["image-input"] = function(t) { var e = new FileReader, n = function() { var e; (e = console).error.apply(e, arguments), Zr("image-failure"), zr(Gr.UPLOAD_ERROR_TIMEOUT), t.value = "" }; e.onload = function(e) { var r = function(e) { var n = Mr.getSelection(!0), r = (new a.a).retain(n.index).delete(n.length).insert({ image: e }); Mr.updateContents(r, W.sources.USER), Mr.setSelection(n.index + 1, W.sources.SILENT), t.value = "" }; return t.files[0].size > Gr.MAX_IMAGE_SIZE ? (Zr("image-too-large", Gr.MAX_IMAGE_SIZE / 1024 / 1024), zr(Gr.UPLOAD_ERROR_TIMEOUT), void(t.value = "")) : Gr.ALLOWED_IMAGE_FORMATS.some((function(e) { return "image/".concat(e) === t.files[0].type })) ? void(Gr.UPLOAD_IMAGE && Gr.UPLOAD_IMAGE_RESPONSE_PROCESSOR ? Gr.UPLOAD_IMAGE(t.files[0]).then((function(t) { var e = Gr.UPLOAD_IMAGE_RESPONSE_PROCESSOR(t); e ? r(e) : n('Unable to upload into into RCE. Received "false" when parsing response.') })).catch((function(t) { n("Unable to upload image into RCE.", t) })) : r(e.target.result)) : (Zr("invalid-image-format", Gr.ALLOWED_IMAGE_FORMATS.join(", ")), zr(Gr.UPLOAD_ERROR_TIMEOUT), void(t.value = "")) }, e.onerror = function(e) { console.error("Unable to upload image into RCE", e), Zr("image-failure"), zr(Gr.UPLOAD_ERROR_TIMEOUT), t.value = "" }, e.readAsDataURL(t.files[0]) }, Hr.link = function() { if (xr.linkRow && !xr.linkRow.querySelector("[".concat(Gr.ATTR_NAME, '="link"][').concat(Gr.ATTR_NAME, '-apply="true"]')).getAttribute("disabled")) { var t = xr.linkRow.querySelector("[".concat(Gr.ATTR_NAME, '="link-input"]')); if (t) { var e = Mr.getSelection(!0); if (Mr.blur(), null !== e) { var n = t.value, r = ge.normalize(n), o = Mr.getFormat(e); if (0 !== n.length) if (ge.single.test(n)) { if (o.link) { var i = kr(Mr.scroll.descendant(oe, e.index), 2), a = i[0], s = i[1], l = new V(e.index - s, a.length()); Mr.formatText(l, "link", r, W.sources.USER) } else if (e.length > 0) Mr.format("link", r, W.sources.USER); else { var c = function(t, n) { Mr.insertText(e.index, t, "link", n, W.sources.USER), Mr.setSelection(e.index + t.length, 0) }; Gr.GET_LINK_TITLE ? Gr.GET_LINK_TITLE(r).then((function(t) { c(t, r) }), (function() { c(n, r) })) : c(n, r) } Kr.activeRow = xr.mainRow } else Zr("invalid-link"); else Zr("empty-link") } } } }, Hr["link-input"] = function(t) { if (xr.linkRow) { var e = xr.linkRow.querySelector("[".concat(Gr.ATTR_NAME, '="link"][').concat(Gr.ATTR_NAME, '-apply="true"]')); if (e) { var n = !e.hasAttribute("disabled"); 0 === t.value.length ? n && e.setAttribute("disabled", !0) : n || e.removeAttribute("disabled") } } }, Hr.video = function() { if (xr.videoRow) { var t = xr.videoRow.querySelector("[".concat(Gr.ATTR_NAME, '="video-input"]')); if (t) { var e = t.value, n = e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/), r = e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/), o = n || r; if (!o) return Zr("invalid-video-url"), void t.focus(); var i = function() { var t = "".concat(o[1] || "https", "://www.youtube.com/embed/").concat(o[2], "?showinfo=0"), e = Mr.getSelection(!0); Mr.blur(), Mr.insertEmbed(e.index, "video", t, W.sources.USER), Mr.setSelection(e.index + 1, 0), Kr.activeRow = xr.mainRow }; Gr.VALIDATE_VIDEO ? Gr.VALIDATE_VIDEO(o[2]).then((function() { i() }), (function() { var t; t = Mr.getSelection(!0), Mr.blur(), Mr.insertText(t.index, e, "link", e, W.sources.USER), Mr.setSelection(t.index + e.length, 0), Kr.activeRow = xr.mainRow })) : i() } } }, Hr["video-input"] = function(t) { if (xr.videoRow) { var e = xr.videoRow.querySelector("[".concat(Gr.ATTR_NAME, '="video"][').concat(Gr.ATTR_NAME, '-apply="true"]')); if (e) { var n = !e.hasAttribute("disabled"), r = t.value; r.length > 0 && !n ? e.removeAttribute("disabled") : 0 === r.length && n && e.setAttribute("disabled", !0) } } }, Hr.header = function(t, e) { var n = parseInt(t.getAttribute(Gr.VALUE_ATTR_NAME), 10); Gr.ENABLE_MARKDOWN ? Cr({ editor: Mr, range: Mr.getSelection(!0), format: "header", attrValue: n }) : Mr.format(e, n); var r = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, "='headers-dropdown']")); r && r.classList.toggle("hidden") }, Hr["to-formats"] = function() { Kr.activeRow = xr.formatsRow }, Hr["to-link"] = function() { if (Gr.ENABLE_MARKDOWN) Cr({ editor: Mr, range: Mr.getSelection(!0), format: "to-link" }); else { var t = document.activeElement, e = Mr.getSelection(!0); if (Mr.blur(), t.focus(), e) { var n = Mr.getFormat(e); if (n.link) { var r = xr.linkRow.querySelector("[".concat(Gr.ATTR_NAME, '="link-input"]')); r && (r.value = n.link) } } Kr.activeRow = xr.linkRow } }, Hr["to-video"] = function() { Kr.activeRow = xr.videoRow }, Hr["to-main-row"] = function() { Kr.activeRow = xr.mainRow }, Hr["to-headers"] = function() { var t = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, "='headers-dropdown']")); t && t.classList.toggle("hidden") }, Hr["to-align"] = function() { var t = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, "='align-dropdown']")); t && t.classList.toggle("hidden") }, Hr["to-list"] = function() { var t = xr.toolbar.querySelector("[".concat(Gr.ATTR_NAME, "='list-dropdown']")); t && t.classList.toggle("hidden") }, e.default = function(t) { return Gr = ve(Gr, t), t.container.setAttribute("data-rte-container", !0), t.container.classList.add("rte-common"), t.container.innerHTML = function(t) { function e(t, e, n, r, o, i) { var a = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : "", s = arguments.length > 7 && void 0 !== arguments[7] && arguments[7]; return !1 === n && (n = null), '\n \n ") } function n(e, n) { return e ? t.ENABLE_TOOLTIPS ? '\n
    \n '.concat(e, '\n \n
    \n ") : e : "" } function r(t, e, n, r) { var o = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4]; return t ? '\n
    \n ').concat(t, '\n \n
    \n ") : "" } return '\n
    \n\n
    \n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("bold") || t.WHITE_LISTED_FORMATS.includes("italic") || t.WHITE_LISTED_FORMATS.includes("header") ? '\n
    \n\n ').concat(t.WHITE_LISTED_FORMATS.includes("header") && t.ENABLE_MARKDOWN ? "\n ".concat(r("\n ".concat(n("".concat(e("rte-dropdown-button", "to-headers", !1, !0, !0, !1, ''.concat(t.LOCALIZATIONS.header, ""))), t.LOCALIZATIONS.header), "\n "), "\n ".concat(e("rte-hl-bg-active", "header", "1", !1, !0, t.LOCALIZATIONS.header1, " ".concat(t.LOCALIZATIONS.header1)), "\n ").concat(e("rte-hl-bg-active", "header", "2", !1, !0, t.LOCALIZATIONS.header2, "".concat(t.LOCALIZATIONS.header2)), "\n ").concat(e("rte-hl-bg-active", "header", "3", !1, !0, t.LOCALIZATIONS.header3, "".concat(t.LOCALIZATIONS.header3)), "\n ").concat(e("rte-hl-bg-active", "header", "", !1, !0, !1, "".concat(t.LOCALIZATIONS.headerNone)), "\n "), t.LOCALIZATIONS.header, "headers", "header")) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("bold") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active ".concat(t.SMALL_VIEWPORT_FORMATS && !t.SMALL_VIEWPORT_FORMATS.includes("bold") ? "hide-mobile" : ""), "bold", !1, !1, !0, t.LOCALIZATIONS.bold, "")), t.LOCALIZATIONS.tooltipBold)) : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("italic") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active ".concat(t.SMALL_VIEWPORT_FORMATS && !t.SMALL_VIEWPORT_FORMATS.includes("italic") ? "hide-mobile" : ""), "italic", !1, !1, !0, t.LOCALIZATIONS.italic, "")), t.LOCALIZATIONS.tooltipItalic)) : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("underline") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active ".concat(t.SMALL_VIEWPORT_FORMATS && !t.SMALL_VIEWPORT_FORMATS.includes("underline") ? "hide-mobile" : ""), "underline", !1, !1, !0, t.LOCALIZATIONS.underline, "")), t.LOCALIZATIONS.tooltipUnderline)) : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("header") && !t.ENABLE_MARKDOWN ? "\n ".concat(r("\n ".concat(n("".concat(e("rte-dropdown-button icon icon-after icon-chevrondown", "to-headers", !1, !0, !0, !1)), t.LOCALIZATIONS.tooltipHeaders), "\n "), "\n ".concat(e("rte-ch-bf-active", "header", "1", !1, !1, t.LOCALIZATIONS.header1, t.LOCALIZATIONS.header1), "\n ").concat(e("rte-ch-bf-active", "header", "2", !1, !1, t.LOCALIZATIONS.header2, t.LOCALIZATIONS.header2), "\n ").concat(e("rte-ch-bf-active", "header", "3", !1, !1, t.LOCALIZATIONS.header3, t.LOCALIZATIONS.header3), "\n ").concat(e("rte-ch-bf-active", "header", "", !1, !1, t.LOCALIZATIONS.headerNone, t.LOCALIZATIONS.headerNone), "\n "), t.LOCALIZATIONS.header, "headers"), "\n ") : "", "\n\n
    \n ") : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("blockquote") && t.ENABLE_MARKDOWN ? '\n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("code-block") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active", "code-block", !1, !1, !1, t.LOCALIZATIONS.code)), t.LOCALIZATIONS.tooltipCode)) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("blockquote") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active", "blockquote", !1, !1, !1, t.LOCALIZATIONS.quote)), t.LOCALIZATIONS.tooltipQuote)) : "", "\n
    \n ") : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("link") && t.ENABLE_MARKDOWN ? '\n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("link") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active", "to-link", !1, !1, !1, t.LOCALIZATIONS.link)), t.LOCALIZATIONS.tooltipLink)) : "", "\n
    \n ") : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("list") || t.WHITE_LISTED_FORMATS.includes("align") || t.WHITE_LISTED_FORMATS.includes("indent") ? '\n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("indent") && !t.ENABLE_MARKDOWN ? "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active", "indent", "-1", !1, !1, t.LOCALIZATIONS.outdent, "", !0)), t.LOCALIZATIONS.tooltipOutdent), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active", "indent", "+1", !1, !1, t.LOCALIZATIONS.indent, "", !1)), t.LOCALIZATIONS.tooltipIndent), "\n ") : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("list") ? "\n ".concat(t.SMALL_VIEWPORT_GROUP_LIST ? "\n ".concat(r("\n ".concat(n("".concat(e("rte-button rte-hl-bg-active icon icon-after icon-chevrondown show-mobile", "to-list", !1, !0, !0, t.LOCALIZATIONS.orderedList, "")), t.LOCALIZATIONS.tooltipOrderedList), "\n "), "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active left-spacer", "list", "ordered", !1, !1, t.LOCALIZATIONS.orderedList, "")), t.LOCALIZATIONS.tooltipOrderedList), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active", "list", "bullet", !1, !1, t.LOCALIZATIONS.unorderedList, "")), t.LOCALIZATIONS.tooltipUnorderedList), "\n ").concat(t.WHITE_LISTED_FORMATS.includes("tasklist") ? "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active", "list", "tasklist", !1, !1, t.LOCALIZATIONS.taskList, "")), t.LOCALIZATIONS.tooltiptaskList), "\n ") : "", "\n "), t.LOCALIZATIONS.orderedList, "list"), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active left-spacer hide-mobile", "list", "ordered", !1, !1, t.LOCALIZATIONS.orderedList, "")), t.LOCALIZATIONS.tooltipOrderedList), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active hide-mobile", "list", "bullet", !1, !1, t.LOCALIZATIONS.unorderedList, "")), t.LOCALIZATIONS.tooltipUnorderedList), "\n ").concat(t.WHITE_LISTED_FORMATS.includes("tasklist") ? "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active hide-mobile", "list", "tasklist", !1, !1, t.LOCALIZATIONS.taskList, "")), t.LOCALIZATIONS.tooltiptaskList), "\n ") : "", "\n ") : "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active left-spacer", "list", "ordered", !1, !1, t.LOCALIZATIONS.orderedList, "")), t.LOCALIZATIONS.tooltipOrderedList), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active", "list", "bullet", !1, !1, t.LOCALIZATIONS.unorderedList, "")), t.LOCALIZATIONS.tooltipUnorderedList), "\n ").concat(t.WHITE_LISTED_FORMATS.includes("tasklist") ? "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active", "list", "tasklist", !1, !1, t.LOCALIZATIONS.taskList, "")), t.LOCALIZATIONS.tooltiptaskList), "\n ") : "", "\n "), "\n ") : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("align") && !t.ENABLE_MARKDOWN ? "\n ".concat(r("\n ".concat(n("".concat(e("rte-button rte-hl-bg-active icon icon-after icon-chevrondown", "to-align", !1, !0, !0, t.LOCALIZATIONS.alignLeft)), t.LOCALIZATIONS.tooltipAlignLeft), "\n "), "\n ".concat(n("".concat(e("rte-button rte-hl-bg-active", "align", "", !1, !1, t.LOCALIZATIONS.alignLeft)), t.LOCALIZATIONS.tooltipAlignLeft), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active", "align", "center", !1, !1, t.LOCALIZATIONS.alignCenter)), t.LOCALIZATIONS.tooltipAlignCenter), "\n ").concat(n("".concat(e("rte-button rte-hl-bg-active", "align", "right", !1, !1, t.LOCALIZATIONS.alignRight)), t.LOCALIZATIONS.tooltipAlignRight), "\n "), t.LOCALIZATIONS.align, "align"), "\n ") : "", "\n
    ") : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("blockquote") && !t.ENABLE_MARKDOWN ? '\n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("blockquote") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active", "blockquote", !1, !1, !1, t.LOCALIZATIONS.quote)), t.LOCALIZATIONS.tooltipQuote)) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("code-block") ? "".concat(n("".concat(e("rte-button rte-hl-bg-active", "code-block", !1, !1, !1, t.LOCALIZATIONS.code)), t.LOCALIZATIONS.tooltipCode)) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("link") ? "".concat(n(''), t.LOCALIZATIONS.tooltipLink)) : "", "\n
    \n ") : "", "\n\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("log") || t.WHITE_LISTED_FORMATS.includes("image") || t.WHITE_LISTED_FORMATS.includes("video") ? '\n
    \n ').concat(t.WHITE_LISTED_FORMATS.includes("log") ? "".concat(n(''), t.LOCALIZATIONS.tooltipLog)) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("image") ? "".concat(n('\n '), t.LOCALIZATIONS.tooltipImage)) : "", "\n ").concat(t.WHITE_LISTED_FORMATS.includes("video") ? "".concat(n(''), t.LOCALIZATIONS.tooltipVideo)) : "", "\n
    \n ") : "", "\n\n ").concat(t.HELP_MENU_ITEMS().length > 0 ? '\n ") : "", "\n\n ").concat(t.EXPANDABLE ? '') : "", "\n
    \n\n ").concat(t.WHITE_LISTED_FORMATS.includes("link") ? '
    \n
    \n \n \n \n
    \n \n
    ') : "", "\n\n ").concat(t.WHITE_LISTED_FORMATS.includes("video") ? '
    \n
    \n \n \n \n
    \n \n
    ') : "", '\n\n
    \n
    \n\n \n\n \n\n \n\n ').concat(t.LOG_FORMATS ? '
    ' : "", '\n\n
    \n ') }(Gr), xr = function(t, e) { if (t) { var n = {}; if (n.toolbar = t.querySelector("[".concat(e.ATTR_NAME, '="toolbar"]')), n.toolbar) return n.mainRow = n.toolbar.querySelector("[".concat(e.ATTR_NAME, '="main-row"]')), n.formatsRow = n.toolbar.querySelector("[".concat(e.ATTR_NAME, '="formats-row"]')), n.linkRow = n.toolbar.querySelector("[".concat(e.ATTR_NAME, '="link-row"]')), n.videoRow = n.toolbar.querySelector("[".concat(e.ATTR_NAME, '="video-row"]')), n.messages = t.querySelector("[".concat(e.ATTR_NAME, "-messages]")), n.messagesContent = t.querySelector("[".concat(e.ATTR_NAME, "-messages-content]")), n.globalMessage = t.querySelector("[".concat(e.ATTR_NAME, "-global-message]")), n.globalMessageContent = t.querySelector("[".concat(e.ATTR_NAME, "-global-message-content]")), n.validationMessages = t.querySelector("[".concat(e.ATTR_NAME, "-validation-messages]")), n.validationMessagesContent = t.querySelector("[".concat(e.ATTR_NAME, "-validation-messages-content]")), n.editorEl = t.querySelector('[data-action="editor"]'), n.spinner = t.querySelector('[data-action="spinner"]'), n.cover = t.querySelector('[data-action="rte-toolbar-cover"]'), e.LOG_FORMATS && (n.logs = t.querySelector('[data-action="logs"]')), n.expandableButton = document.querySelector('[data-rte-expand-button="true"]'), n } }(t.container, Gr), Kr.activeRow = xr.mainRow, function() { ee.keyName = "indent", ee.whitelist = [0, 1, 2], lt.keyName = "align"; var t = new o.a.Attributor.Class("header", "header", { scope: o.a.Scope.BLOCK }), e = {}; Gr.WHITE_LISTED_FORMATS.includes("code-block") && (e["formats/code-block"] = v, "function" == typeof Gr.CODE_HIGHLIGHTING && (e["modules/syntax"] = pe)), Gr.WHITE_LISTED_FORMATS.includes("log") && (e["formats/log"] = an), Gr.WHITE_LISTED_FORMATS.includes("align") && (e["formats/align"] = lt), Gr.WHITE_LISTED_FORMATS.includes("indent") && (e["formats/indent"] = ee), Gr.WHITE_LISTED_FORMATS.includes("blockquote") && (e["formats/blockquote"] = Jt), Gr.WHITE_LISTED_FORMATS.includes("header") && (e["formats/header"] = t), Gr.WHITE_LISTED_FORMATS.includes("list") && (e["formats/list"] = re, e["formats/list/item"] = ne), Gr.WHITE_LISTED_FORMATS.includes("bold") && (e["formats/bold"] = Zt), Gr.WHITE_LISTED_FORMATS.includes("italic") && (e["formats/italic"] = Yt), Gr.WHITE_LISTED_FORMATS.includes("underline") && (e["formats/underline"] = Qt), Gr.WHITE_LISTED_FORMATS.includes("link") && (e["formats/link"] = oe), Gr.WHITE_LISTED_FORMATS.includes("image") && (e["formats/image"] = le), Gr.WHITE_LISTED_FORMATS.includes("video") && (e["formats/video"] = de), Pt.DEFAULTS.bindings.indent.key = 221, Pt.DEFAULTS.bindings.indent.metaKey = !0, delete Pt.DEFAULTS.bindings.outdent.shiftKey, Pt.DEFAULTS.bindings.outdent.key = 219, Pt.DEFAULTS.bindings.outdent.metaKey = !0, Pt.DEFAULTS.bindings.tab.key = 221, Pt.DEFAULTS.bindings.tab.metaKey = !0, delete Pt.DEFAULTS.bindings["remove tab"].shiftKey, Pt.DEFAULTS.bindings["remove tab"].key = 219, Pt.DEFAULTS.bindings["remove tab"].metaKey = !0, delete Pt.DEFAULTS.bindings["indent code-block"].shiftKey, Pt.DEFAULTS.bindings["indent code-block"].key = 221, Pt.DEFAULTS.bindings["indent code-block"].metaKey = !0, delete Pt.DEFAULTS.bindings["outdent code-block"].shiftKey, Pt.DEFAULTS.bindings["outdent code-block"].key = 219, Pt.DEFAULTS.bindings["outdent code-block"].metaKey = !0, Gr.ENABLE_MARKDOWN && (Gr.WHITE_LISTED_FORMATS.includes("bold") && (Pt.DEFAULTS.bindings.bold.handler = function(t) { return Cr({ editor: Mr, range: t, format: "bold" }) }), Gr.WHITE_LISTED_FORMATS.includes("italic") && (Pt.DEFAULTS.bindings.italic.handler = function(t) { return Cr({ editor: Mr, range: t, format: "italic" }) }), Gr.WHITE_LISTED_FORMATS.includes("underline") && (Pt.DEFAULTS.bindings.underline.handler = function(t) { return Cr({ editor: Mr, range: t, format: "underline" }) }), Gr.WHITE_LISTED_FORMATS.includes("code-block") && (Pt.DEFAULTS.bindings["code-block"] = { key: 192, ctrlKey: !0, handler: function(t) { return Cr({ editor: Mr, range: t, format: "code-block" }) } }), Gr.WHITE_LISTED_FORMATS.includes("blockquote") && (Pt.DEFAULTS.bindings.blockquote = { key: "E", shortKey: !0, handler: function(t) { return Cr({ editor: Mr, range: t, format: "blockquote" }) } })), e["modules/keyboard"] = Pt, e["modules/clipboard"] = ke, e["modules/imageResize"] = cr, e["formats/errorHighlight"] = Sr, Kt.register(e, !0); var n = {}, r = function() { var t = 0; return function(e) { var n, r = ge.inStringGlobal, o = Mr.getText(t, e.index).match(r); if (null === o) return t = e.index, !0; n = o.length > 1 ? o[o.length - 1] : o[0]; var i = ge.normalize(n), a = []; return e.index - n.length > 0 && a.push({ retain: e.index - n.length }), a.push({ delete: n.length }), a.push({ insert: n, attributes: { link: i } }), Mr.updateContents({ ops: a }), t = e.index, !0 } }; Gr.WHITE_LISTED_FORMATS.includes("link") && (Gr.ENABLE_MARKDOWN ? (n.linkShortcut = { key: "K", metaKey: !0, handler: function(t) { Gr.ENABLE_MARKDOWN ? Cr({ editor: Mr, range: t, format: "to-link" }) : (!Gr.SMALL_VIEWPORT_BREAKPOINT || window.innerWidth > Gr.SMALL_VIEWPORT_BREAKPOINT || Gr.SMALL_VIEWPORT_FORMATS && Gr.SMALL_VIEWPORT_FORMATS.includes("link")) && Hr["to-link"]() } }, n.exitQuote = { key: 13, collapsed: !0, format: ["blockquote"], offset: 0, handler: function(t) { var e = kr(Mr.getLine(t.index), 2), n = e[0], r = e[1], o = (new a.a).retain(t.index + n.length() - r - 1).retain(1, { blockquote: null }).delete(1); Mr.updateContents(o, Kt.sources.USER) } }) : n = { linkShortcut: { key: "K", metaKey: !0, handler: function() { (!Gr.SMALL_VIEWPORT_BREAKPOINT || window.innerWidth > Gr.SMALL_VIEWPORT_BREAKPOINT || Gr.SMALL_VIEWPORT_FORMATS && Gr.SMALL_VIEWPORT_FORMATS.includes("link")) && Hr["to-link"]() } }, spaceToLink: { collapsed: !0, key: " ", prefix: ge.inString, handler: r() }, enterToLink: { collapsed: !0, key: 13, prefix: ge.inString, handler: r() }, exitQuote: { key: 13, collapsed: !0, format: ["blockquote"], offset: 0, handler: function(t) { var e = kr(Mr.getLine(t.index), 2), n = e[0], r = e[1], o = (new a.a).retain(t.index + n.length() - r - 1).retain(1, { blockquote: null }).delete(1); Mr.updateContents(o, Kt.sources.USER) } } }), Gr.ENABLE_MARKDOWN && (n["list autofill"] = null), Gr.ENABLE_MARKDOWN || Gr.WHITE_LISTED_FORMATS.includes("list") || (n["list autofill"] = null); var i = { placeholder: Gr.LOCALIZATIONS.placeholder, modules: { keyboard: { bindings: n }, clipboard: { matchers: [ ["h1", function(t, e) { return e.compose((new a.a).retain(e.length(), { header: 1 })) }], ["h2", function(t, e) { return e.compose((new a.a).retain(e.length(), { header: 2 })) }], ["h3", function(t, e) { return e.compose((new a.a).retain(e.length(), { header: 3 })) }], ["h4", function(t, e) { return e.compose((new a.a).retain(e.length(), { header: 3 })) }], ["h5", function(t, e) { return e.compose((new a.a).retain(e.length(), { bold: !0 })) }], ["h6", function(t, e) { return e.compose((new a.a).retain(e.length(), { bold: !0 })) }] ] }, imageResize: {} } }; "function" == typeof Gr.CODE_HIGHLIGHTING && (i.modules.syntax = { highlight: function(t) { return Gr.CODE_HIGHLIGHTING(t).value } }), Mr = new Kt(xr.editorEl, i), Gr.LOG_FORMATS && Mr.on("text-change", (function() { var t = "\n
    \n

    Delta

    \n
    ".concat(JSON.stringify(Mr.getContents(), null, "  "), "
    \n
    \n
    \n

    Text

    \n

    ").concat(Mr.getText(), "

    \n
    \n
    \n

    HTML

    \n
    ").concat(Mr.root.innerHTML.replace(/<").replace(/>/g, ">
    "), "
    \n
    \n "); xr.logs.innerHTML = t })), Mr.on("selection-change", (function(t) { Xr(t) })); var s = function(t, e) { var n, r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return function() { var o = this, i = arguments, a = r && !n, s = function() { n = null, t.apply(o, i) }; clearTimeout(n), n = setTimeout(s, e), a && s() } }((function() { Gr.ON_TEXT_CHANGE_CB() }), Gr.ON_TEXT_CHANGE_CB_DEBOUNCE_TIMEOUT); Mr.on("text-change", (function() { Xr(Mr.getSelection()), Gr.ON_TEXT_CHANGE_CB && s() })), Gr.LENGTH_LIMIT && Mr.on("text-change", (function() { Mr.getLength() > Gr.LENGTH_LIMIT && Mr.deleteText(Gr.LENGTH_LIMIT, Mr.getLength()) })), xr.editorEl.querySelector(".ql-clipboard").setAttribute("aria-hidden", !0) }(), Mr.root.setAttribute("aria-labelledby", "reply-to-this-question"), Mr.root.setAttribute("role", "textbox"), Mr.root.setAttribute("aria-multiline", "true"), Mr.root.setAttribute("aria-required", "true"), Mr.root.setAttribute("required", "required"), Mr.root.setAttribute("aria-describedby", "rte-global-message"), Mr.root.setAttribute("aria-placeholder", Gr.LOCALIZATIONS.placeholder), function() { if (xr.toolbar) { [].concat(Ur(Gr.WHITE_LISTED_FORMATS), Ur(Gr.SPECIAL_FORMATS)).forEach((function(t) { xr.toolbar.querySelectorAll("[".concat(Gr.ATTR_NAME, '="').concat(t, '"]')).forEach((function(e) { var n = "click", r = e.tagName.toLowerCase(); "input" === r && "file" === e.getAttribute("type") ? n = "change" : "input" === r ? n = "input" : "form" === r && (n = "submit"); var o = Hr.default; Hr[t] && (o = Hr[t]), e.addEventListener(n, (function(n) { n.preventDefault(), o(e, t) })) })) })); var t = xr.toolbar.querySelectorAll("[data-rte-dropdown-container]"), e = function(t) { t.classList.contains("hidden") || ln(t) }; t.forEach((function(t) { var n, r, o, i = t.querySelector("[data-rte-dropdown]"); n = t, r = function() { e(i) }, o = function(t) { var e = function(e) { return t.target === e || e.contains(t.target) }, o = !1; if (n.forEach && n.length > 0) for (var i = 0; !o && i < n.length;) o = e(n[i]), i++; else o = e(n); o || r() }, document.addEventListener("click", (function(t) { o(t) })), document.addEventListener("touchstart", (function(t) { o(t) })); var a = i.querySelectorAll("button"); a[0].addEventListener("keydown", (function(t) { t.shiftKey && 9 === t.keyCode && e(i) })), a[a.length - 1].addEventListener("keydown", (function(t) { t.shiftKey || 9 !== t.keyCode || e(i) })), a[a.length - 1].addEventListener("blur", (function() { setTimeout((function() { a[a.length - 2] === document.activeElement || e(i) }), 0) })); var s = t.querySelector("[data-rte-dropdown-button]"); s.addEventListener("keydown", (function(t) { t.shiftKey && 9 === t.keyCode && e(i) })), s.addEventListener("click", (function() { i.classList.contains("hidden") ? s.classList.remove("dropdown-shown") : s.classList.add("dropdown-shown") })) })); var n = xr.toolbar.querySelector("[data-rte-help-button]"); if (n.addEventListener("focus", (function() { n.setAttribute("aria-expanded", !0) })), n.addEventListener("blur", (function() { n.setAttribute("aria-expanded", !1) })), Gr.EXPANDABLE || Gr.SMALL_VIEWPORT_EXPANDABLE) { var r, o = xr.toolbar.querySelector("[data-rte-expand-button]"), i = 0, a = Gr.HEIGHT, s = function(t) { t.preventDefault() }, l = function(t) { var e; "touchmove" === t.type ? i = t.touches[0].movementY : (t.preventDefault(), i = t.movementY), ((r = a + i) > Gr.HEIGHT || r > Gr.HEIGHT_SMALL_VIEWPORT) && (a = e = r, Gr.EXPANDABLE && xr.editorEl.style.setProperty("--editor-height", "".concat(e, "px")), Gr.SMALL_VIEWPORT_EXPANDABLE && xr.editorEl.style.setProperty("--editor-height-small-viewport", "".concat(e, "px"))), window.addEventListener("mousedown", s, !1), window.addEventListener("touchstart", s, !1) }; o.addEventListener("mousedown", (function() { document.addEventListener("mousemove", l, !1) }), !1), document.addEventListener("mouseup", (function() { document.removeEventListener("mousemove", l, !1), window.removeEventListener("mousedown", s, !1), window.removeEventListener("touchstart", s, !1) }), !1), o.addEventListener("touchstart", (function() { document.addEventListener("touchmove", l, !1) }), !1), document.addEventListener("touchend", (function() { document.removeEventListener("touchmove", l, !1), window.removeEventListener("mousedown", s, !1), window.removeEventListener("touchstart", s, !1) }), !1) } window.addEventListener("keydown", (function(r) { if (219 === r.keyCode && !0 === r.metaKey) r.preventDefault(); else if (27 === r.keyCode) { for (var o = 0, i = !1; !i && o < t.length;) { var a = t[o].querySelector("[data-rte-dropdown]"); if (a && a.contains(r.target)) { i = !0; var s = t[o].querySelector("button"); s ? s.focus() : t[o].focus(), a && e(a) } o++ } if (!i) { var l = Kr.activeRow !== xr.mainRow, c = xr.linkRow && xr.linkRow.contains(r.target) || xr.linkRow && xr.videoRow.contains(r.target) || xr.linkRow && xr.formatsRow.contains(r.target); l && c && (Kr.activeRow = xr.mainRow), document.activeElement === n && n.blur() } } })), xr.editorEl.addEventListener("dragstart", (function(t) { t.preventDefault() })) } }(), Gr.WHITE_LISTED_FORMATS.includes("log") && (Vr = new yr(Gr)), Gr.SMALL_VIEWPORT_BREAKPOINT && Array.isArray(Gr.SMALL_VIEWPORT_FORMATS) && (Kr.largeViewport = window.innerWidth > Gr.SMALL_VIEWPORT_BREAKPOINT, Kr.viewportChangeTimeout = null, window.addEventListener("resize", (function() { clearTimeout(Kr.viewportChangeTimeout), Kr.viewportChangeTimeout = setTimeout((function() { (Gr.EXPANDABLE || Gr.SMALL_VIEWPORT_EXPANDABLE) && Gr.RESET_EXPANDED_HEIGHT_TO_DEFAULT_ON_VIEWPORT_CHANGE && (xr.editorEl.style.setProperty("--editor-height", "".concat(Gr.HEIGHT, "px")), xr.editorEl.style.setProperty("--editor-height-small-viewport", "".concat(Gr.HEIGHT_SMALL_VIEWPORT, "px"))), window.innerWidth <= Gr.SMALL_VIEWPORT_BREAKPOINT && Kr.largeViewport && Kr.activeRow !== xr.mainRow && (Kr.activeRow = xr.mainRow), Kr.largeViewport = window.innerWidth > Gr.SMALL_VIEWPORT_BREAKPOINT }), Gr.VIEWPORT_CHANGE_THROTTLE_TIME) }))), xr.editorEl.style.setProperty("--editor-height", "".concat(Gr.HEIGHT, "px")), xr.editorEl.style.setProperty("--editor-height-small-viewport", "".concat(Gr.HEIGHT_SMALL_VIEWPORT, "px")), xr.editorEl.style.setProperty("--tooltip-delay", "".concat(Gr.TOOLTIPS_DELAY, "s")), Gr.ENABLE_MARKDOWN ? (xr.editorEl.style.setProperty("--editor-placeholder-font-color", "#6e6e73"), xr.toolbar.classList.add("markdown-template"), xr.editorEl.classList.add("markdown-template")) : xr.editorEl.style.setProperty("--editor-placeholder-font-color", "#888"), t.container.addEventListener("copy", (function(t) { var e = Mr.getSelection(), n = Mr.getText(e.index, e.length); t.clipboardData.setData("text/plain", n), t.preventDefault() })), { getQ: function() { return Mr }, getText: function() { var t = Mr.getText(); return Gr.ENABLE_MARKDOWN && (t = function(t, e) { if (t && Array.isArray(t.ops)) { var n = ""; return t.ops.forEach((function(t) { n += t.insert })), new Qn(e).convert(n).text } console.error("Can not convert HTML delta to Markdown. Invalid delta.", t) }(Mr.getContents(), Gr)), t }, getDelta: function() { return Mr.getContents() }, getMarkdown: function() { var t = Mr.getContents(), e = ""; return t.ops.forEach((function(t) { e += t.insert })), e }, markdownToHTML: function() { var t = function(t, e) { if (t && Array.isArray(t.ops)) { var n = ""; t.ops.forEach((function(t) { n += t.insert })); var r = new Qn(e).convert(n), o = r.html, i = r.errors; return { html: o.trim(), errors: i } } console.error("Can not convert HTML delta to Markdown. Invalid delta.", t) }(Mr.getContents(), Gr), e = t.html, n = t.errors; if (Object.keys(n).length) ! function(t) { var e, n = { invalidUrl: function(t) { return "
  • ".concat(t, " -- This URL can't be included in your post. Please remove it to continue.
  • ") }, notWhitelistedUrl: function(t) { return "
  • ".concat(t, " -- This URL can't be included in your post. Please remove it to continue.
  • ") }, hrefTextCantBeLink: function(t) { return "
  • ".concat(t, " - LinkText can't be a URL. Please fix it to continue.
  • ") } }, r = Object.keys(t), o = r.map((function(e) { return n[t[e]].call(null, e) })).join(""); e = "Please fix the following URL related errors:
      ".concat(o, "
    "), xr.validationMessagesContent.innerHTML = e, sn(xr.validationMessages), Kr.errorHighlightList = [], Ae.MARKDOWN_DEBUG && console.log({ errorList: t }); for (var i = 0; i < r.length; i++) { var a = mr({ fullText: Mr.getText(), searchStr: r[i] }); Ae.MARKDOWN_DEBUG && console.log({ searchStr: r[i], foundRanges: a }), Kr.errorHighlightList.push(a); for (var s = 0; s < a.length; s++) { var l = a[s]; Mr.formatText(l, "errorhighlight", !0) } } }(n); else { for (var r = 0; r < Kr.errorHighlightList.length; r++) for (var o = 0; o < Kr.errorHighlightList[r].length; o++) Mr.editor.removeFormat(Kr.errorHighlightList[r][o].index, Kr.errorHighlightList[r][o].length); Kr.errorHighlightList = [], xr.validationMessagesContent.innerHTML = "", ln(xr.validationMessages) } return { html: e, isDirty: Object.keys(n).length > 0 } }, getHTML: function() { var t = Mr.root.cloneNode(!0); return (t = un(t, Gr)).innerHTML }, disable: function() { var t = xr.toolbar.querySelectorAll("button"); Mr.disable(), t.forEach((function(t) { t.setAttribute("tabindex", "-1") })), xr.toolbar.setAttribute("aria-hidden", !0), xr.editorEl.setAttribute("aria-hidden", !0), xr.toolbar.classList.add("rte-disabled"), xr.editorEl.classList.add("rte-disabled"), xr.spinner.classList.add("shown"), xr.cover.classList.add("rte-shown"), xr.expandableButton && xr.expandableButton.setAttribute("tabindex", "-1") }, enable: function() { var t = xr.toolbar.querySelectorAll("button"); Mr.enable(), t.forEach((function(t) { t.removeAttribute("tabindex") })), xr.toolbar.removeAttribute("aria-hidden"), xr.editorEl.removeAttribute("aria-hidden"), xr.toolbar.classList.remove("rte-disabled"), xr.editorEl.classList.remove("rte-disabled"), xr.spinner.classList.remove("shown"), xr.cover.classList.remove("rte-shown"), xr.expandableButton && xr.expandableButton.setAttribute("tabindex", "-1") }, enableErrorStyle: function(t) { var e; t && (xr.toolbar.classList.add("rte-error"), xr.editorEl.classList.add("rte-error"), e = t, xr.globalMessageContent.textContent = e, sn(xr.globalMessage)) }, disableErrorStyle: function() { xr.toolbar.classList.remove("rte-error"), xr.editorEl.classList.remove("rte-error"), Yr() }, focus: function() { Mr.focus() }, focusElement: function() { return Mr.root }, reset: function() { Mr.setText(""), Kr.activeRow = xr.mainRow, Yr(), Mr.getModule("imageResize").disableResizing() }, pasteDelta: function(t) { t.ops && Mr.setContents(t.ops) }, updateConfig: function(t) { var e = {}; t.initialQuote && (e = jr(jr({}, e), {}, { initialQuote: t.initialQuote })), t.initialQuoteAuthor && (e = jr(jr({}, e), {}, { initialQuoteAuthor: t.initialQuoteAuthor })); var n = ve(Gr, e); (!Gr.INITIAL_QUOTE || Gr.INITIAL_QUOTE && Gr.INITIAL_QUOTE.ops !== n.INITIAL_QUOTE.ops) && (Kr.initialQuoteInserted = !1, Gr = n) } } } }]);