{“ast”:null,“code”:“function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }nn/*nTrix 1.2.0nCopyright © 2019 Basecamp, LLCntrix-editor.org/n */n(function () {}).call(this), function () {n var t;n null == window.Set && (window.Set = t = function () {n function t() {n this.clear();n }nn return t.prototype.clear = function () {n return this.values = [];n }, t.prototype.has = function (t) {n return -1 !== this.values.indexOf(t);n }, t.prototype.add = function (t) {n return this.has(t) || this.values.push(t), this;n }, t.prototype = function (t) {n var e;n return -1 === (e = this.values.indexOf(t)) ? !1 : (this.values.splice(e, 1), !0);n }, t.prototype.forEach = function () {n var t;n return (t = this.values).forEach.apply(t, arguments);n }, t;n }());n}.call(this), function (t) {n function e() {}nn function n(t, e) {n return function () {n t.apply(e, arguments);n };n }nn function i(t) {n if ("object" != _typeof(this)) throw new TypeError("Promises must be constructed via new");n if ("function" != typeof t) throw new TypeError("not a function");n this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], c(t, this);n }nn function o(t, e) {n for (; 3 === t._state;) {n t = t._value;n }nn return 0 === t._state ? void t._deferreds.push(e) : (t._handled = !0, void h(function () {n var n = 1 === t._state ? e.onFulfilled : e.onRejected;n if (null === n) return void (1 === t._state ? r : s)(e.promise, t._value);n var i;nn try {n i = n(t._value);n } catch (o) {n return void s(e.promise, o);n }nn r(e.promise, i);n }));n }nn function r(t, e) {n try {n if (e === t) throw new TypeError("A promise cannot be resolved with itself.");nn if (e && ("object" == _typeof(e) || "function" == typeof e)) {n var o = e.then;n if (e instanceof i) return t._state = 3, t._value = e, void a(t);n if ("function" == typeof o) return void c(n(o, e), t);n }nn t._state = 1, t._value = e, a(t);n } catch ® {n s(t, r);n }n }nn function s(t, e) {n t._state = 2, t._value = e, a(t);n }nn function a(t) {n 2 === t._state && 0 === t._deferreds.length && setTimeout(function () {n t._handled || p(t._value);n }, 1);nn for (var e = 0, n = t._deferreds.length; n > e; e++) {n o(t, t._deferreds);n }nn t._deferreds = null;n }nn function u(t, e, n) {n this.onFulfilled = "function" == typeof t ? t : null, this.onRejected = "function" == typeof e ? e : null, this.promise = n;n }nn function c(t, e) {n var n = !1;nn try {n t(function (t) {n n || (n = !0, r(e, t));n }, function (t) {n n || (n = !0, s(e, t));n });n } catch (i) {n if (n) return;n n = !0, s(e, i);n }n }nn var l = setTimeout,n h = "function" == typeof setImmediate && setImmediate || function (t) {n l(t, 1);n },n p = function p(t) {n "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", t);n };nn i.prototype = function (t) {n return this.then(null, t);n }, i.prototype.then = function (t, n) {n var r = new i(e);n return o(this, new u(t, n, r)), r;n }, i.all = function (t) {n var e = Array.prototype.slice.call(t);n return new i(function (t, n) {n function i(r, s) {n try {n if (s && ("object" == _typeof(s) || "function" == typeof s)) {n var a = s.then;n if ("function" == typeof a) return void a.call(s, function (t) {n i(r, t);n }, n);n }nn e = s, 0 === –o && t(e);n } catch (u) {n n(u);n }n }nn if (0 === e.length) return t([]);nn for (var o = e.length, r = 0; r < e.length; r++) {n i(r, e);n }n });n }, i.resolve = function (t) {n return t && "object" == _typeof(t) && t.constructor === i ? t : new i(function (e) {n e(t);n });n }, i.reject = function (t) {n return new i(function (e, n) {n n(t);n });n }, i.race = function (t) {n return new i(function (e, n) {n for (var i = 0, o = t.length; o > i; i++) {n t.then(e, n);n }n });n }, i._setImmediateFn = function (t) {n h = t;n }, i._setUnhandledRejectionFn = function (t) {n p = t;n }, "undefined" != typeof module && module.exports ? module.exports = i : t.Promise || (t.Promise = i);n}(this), function () {n var t = "object" == _typeof(window.customElements),n e = "function" == typeof document.registerElement,n n = t || e;nn n || (n /**n * @licensen * Copyright © 2014 The Polymer Project Authors. All rights reserved.n * This code may only be used under the BSD style license found at polymer.github.io/LICENSE.txtn * The complete set of authors may be found at polymer.github.io/AUTHORS.txtn * The complete set of contributors may be found at polymer.github.io/CONTRIBUTORS.txtn * Code distributed by Google as part of the polymer project is alson * subject to an additional IP rights grant found at polymer.github.io/PATENTS.txtn */n "undefined" == typeof WeakMap && !function () {n var t = Object.defineProperty,n e = Date.now() % 1e9,n n = function n() {n this.name = "__st" + (1e9 * Math.random() >>> 0) + (e++ + "__");n };nn n.prototype = {n set: function set(e, n) {n var i = e;n return i && i === e ? i = n : t(e, this.name, {n value: [e, n],n writable: !0n }), this;n },n get: function get(t) {n var e;n return (e = t) && e === t ? e : void 0;n },n "delete": function _delete(t) {n var e = t;n return e && e === t ? (e = e = void 0, !0) : !1;n },n has: function has(t) {n var e = t;n return e ? e === t : !1;n }n }, window.WeakMap = n;n }(), function (t) {n function e(t) {n A.push(t), b || (b = !0, g(i));n }nn function n(t) {n return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(t) || t;n }nn function i() {n b = !1;n var t = A;n A = [], t.sort(function (t, e) {n return t.uid_ - e.uid_;n });n var e = !1;n t.forEach(function (t) {n var n = t.takeRecords();n o(t), n.length && (t.callback_(n, t), e = !0);n }), e && i();n }nn function o(t) {n t.nodes_.forEach(function (e) {n var n = m.get(e);n n && n.forEach(function (e) {n e.observer === t && e.removeTransientObservers();n });n });n }nn function r(t, e) {n for (var n = t; n; n = n.parentNode) {n var i = m.get(n);n if (i) for (var o = 0; o < i.length; o++) {n var r = i,n s = r.options;nn if (n === t || s.subtree) {n var a = e(s);n a && r.enqueue(a);n }n }n }n }nn function s(t) {n this.callback_ = t, this.nodes_ = [], this.records_ = [], this.uid_ = ++C;n }nn function a(t, e) {n this.type = t, this.target = e, this.addedNodes = [], this.removedNodes = [], this.previousSibling = null, this.nextSibling = null, this.attributeName = null, this.attributeNamespace = null, this.oldValue = null;n }nn function u(t) {n var e = new a(t.type, t.target);n return e.addedNodes = t.addedNodes.slice(), e.removedNodes = t.removedNodes.slice(), e.previousSibling = t.previousSibling, e.nextSibling = t.nextSibling, e.attributeName = t.attributeName, e.attributeNamespace = t.attributeNamespace, e.oldValue = t.oldValue, e;n }nn function c(t, e) {n return x = new a(t, e);n }nn function l(t) {n return w ? w : (w = u(x), w.oldValue = t, w);n }nn function h() {n x = w = void 0;n }nn function p(t) {n return t === w || t === x;n }nn function d(t, e) {n return t === e ? t : w && p(t) ? w : null;n }nn function f(t, e, n) {n this.observer = t, this.target = e, this.options = n, this.transientObservedNodes = [];n }nn if (!t.JsMutationObserver) {n var g,n m = new WeakMap();n if (/Trident|Edge/.test(navigator.userAgent)) g = setTimeout;else if (window.setImmediate) g = window.setImmediate;else {n var v = [],n y = String(Math.random());n window.addEventListener("message", function (t) {n if (t.data === y) {n var e = v;n v = [], e.forEach(function (t) {n t();n });n }n }), g = function g(t) {n v.push(t), window.postMessage(y, "*");n };n }n var b = !1,n A = [],n C = 0;n s.prototype = {n observe: function observe(t, e) {n if (t = n(t), !e.childList && !e.attributes && !e.characterData || e.attributeOldValue && !e.attributes || e.attributeFilter && e.attributeFilter.length && !e.attributes || e.characterDataOldValue && !e.characterData) throw new SyntaxError();n var i = m.get(t);n i || m.set(t, i = []);nn for (var o, r = 0; r < i.length; r++) {n if (i.observer === this) {n o = i, o.removeListeners(), o.options = e;n break;n }n }nn o || (o = new f(this, t, e), i.push(o), this.nodes_.push(t)), o.addListeners();n },n disconnect: function disconnect() {n this.nodes_.forEach(function (t) {n for (var e = m.get(t), n = 0; n < e.length; n++) {n var i = e;nn if (i.observer === this) {n i.removeListeners(), e.splice(n, 1);n break;n }n }n }, this), this.records_ = [];n },n takeRecords: function takeRecords() {n var t = this.records_;n return this.records_ = [], t;n }n };n var x, w;n f.prototype = {n enqueue: function enqueue(t) {n var n = this.observer.records_,n i = n.length;nn if (n.length > 0) {n var o = n[i - 1],n r = d(o, t);n if ® return void (n[i - 1] = r);n } else e(this.observer);nn n = t;n },n addListeners: function addListeners() {n this.addListeners_(this.target);n },n addListeners_: function addListeners_(t) {n var e = this.options;n e.attributes && t.addEventListener("DOMAttrModified", this, !0), e.characterData && t.addEventListener("DOMCharacterDataModified", this, !0), e.childList && t.addEventListener("DOMNodeInserted", this, !0), (e.childList || e.subtree) && t.addEventListener("DOMNodeRemoved", this, !0);n },n removeListeners: function removeListeners() {n this.removeListeners_(this.target);n },n removeListeners_: function removeListeners_(t) {n var e = this.options;n e.attributes && t.removeEventListener("DOMAttrModified", this, !0), e.characterData && t.removeEventListener("DOMCharacterDataModified", this, !0), e.childList && t.removeEventListener("DOMNodeInserted", this, !0), (e.childList || e.subtree) && t.removeEventListener("DOMNodeRemoved", this, !0);n },n addTransientObserver: function addTransientObserver(t) {n if (t !== this.target) {n this.addListeners_(t), this.transientObservedNodes.push(t);n var e = m.get(t);n e || m.set(t, e = []), e.push(this);n }n },n removeTransientObservers: function removeTransientObservers() {n var t = this.transientObservedNodes;n this.transientObservedNodes = [], t.forEach(function (t) {n this.removeListeners_(t);nn for (var e = m.get(t), n = 0; n < e.length; n++) {n if (e === this) {n e.splice(n, 1);n break;n }n }n }, this);n },n handleEvent: function handleEvent(t) {n switch (t.stopImmediatePropagation(), t.type) {n case "DOMAttrModified":n var e = t.attrName,n n = t.relatedNode.namespaceURI,n i = t.target,n o = new c("attributes", i);n o.attributeName = e, o.attributeNamespace = n;n var s = t.attrChange === MutationEvent.ADDITION ? null : t.prevValue;n r(i, function (t) {n return !t.attributes || t.attributeFilter && t.attributeFilter.length && -1 === t.attributeFilter.indexOf(e) && -1 === t.attributeFilter.indexOf(n) ? void 0 : t.attributeOldValue ? l(s) : o;n });n break;nn case "DOMCharacterDataModified":n var i = t.target,n o = c("characterData", i),n s = t.prevValue;n r(i, function (t) {n return t.characterData ? t.characterDataOldValue ? l(s) : o : void 0;n });n break;nn case "DOMNodeRemoved":n this.addTransientObserver(t.target);nn case "DOMNodeInserted":n var a,n u,n p = t.target;n "DOMNodeInserted" === t.type ? (a = [p], u = []) : (a = [], u = [p]);n var d = p.previousSibling,n f = p.nextSibling,n o = c("childList", t.target.parentNode);n o.addedNodes = a, o.removedNodes = u, o.previousSibling = d, o.nextSibling = f, r(t.relatedNode, function (t) {n return t.childList ? o : void 0;n });n }nn h();n }n }, t.JsMutationObserver = s, t.MutationObserver || (t.MutationObserver = s, s._isPolyfilled = !0);n }n }(self), function () {n "use strict";nn if (!window.performance || !window.performance.now) {n var t = Date.now();n window.performance = {n now: function now() {n return Date.now() - t;n }n };n }nn window.requestAnimationFrame || (window.requestAnimationFrame = function () {n var t = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;n return t ? function (e) {n return t(function () {n e(performance.now());n });n } : function (t) {n return window.setTimeout(t, 1e3 / 60);n };n }()), window.cancelAnimationFrame || (window.cancelAnimationFrame = function () {n return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function (t) {n clearTimeout(t);n };n }());nn var e = function () {n var t = document.createEvent("Event");n return t.initEvent("foo", !0, !0), t.preventDefault(), t.defaultPrevented;n }();nn if (!e) {n var n = Event.prototype.preventDefault;nn Event.prototype.preventDefault = function () {n this.cancelable && (n.call(this), Object.defineProperty(this, "defaultPrevented", {n get: function get() {n return !0;n },n configurable: !0n }));n };n }nn var i = /Trident/.test(navigator.userAgent);nn if ((!window.CustomEvent || i && "function" != typeof window.CustomEvent) && (window.CustomEvent = function (t, e) {n e = e || {};n var n = document.createEvent("CustomEvent");n return n.initCustomEvent(t, Boolean(e.bubbles), Boolean(e.cancelable), e.detail), n;n }, window.CustomEvent.prototype = window.Event.prototype), !window.Event || i && "function" != typeof window.Event) {n var o = window.Event;n window.Event = function (t, e) {n e = e || {};n var n = document.createEvent("Event");n return n.initEvent(t, Boolean(e.bubbles), Boolean(e.cancelable)), n;n }, window.Event.prototype = o.prototype;n }n }(window.WebComponents), window.CustomElements = window.CustomElements || {n flags: {}n }, function (t) {n var e = t.flags,n n = [],n i = function i(t) {n n.push(t);n },n o = function o() {n n.forEach(function (e) {n e(t);n });n };nn t.addModule = i, t.initializeModules = o, t.hasNative = Boolean(document.registerElement), t.isIE = /Trident/.test(navigator.userAgent), t.useNative = !e.register && t.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);n }(window.CustomElements), window.CustomElements.addModule(function (t) {n function e(t, e) {n n(t, function (t) {n return e(t) ? !0 : void i(t, e);n }), i(t, e);n }nn function n(t, e, i) {n var o = t.firstElementChild;n if (!o) for (o = t.firstChild; o && o.nodeType !== Node.ELEMENT_NODE;) {n o = o.nextSibling;n }nn for (; o;) {n e(o, i) !== !0 && n(o, e, i), o = o.nextElementSibling;n }nn return null;n }nn function i(t, n) {n for (var i = t.shadowRoot; i;) {n e(i, n), i = i.olderShadowRoot;n }n }nn function o(t, e) {n r(t, e, []);n }nn function r(t, e, n) {n if (t = window.wrap(t), !(n.indexOf(t) >= 0)) {n n.push(t);nn for (var i, o = t.querySelectorAll("link[rel=" + s + "]"), a = 0, u = o.length; u > a && (i = o); a++) {n i && r(i, e, n);n }nn e(t);n }n }nn var s = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";n t.forDocumentTree = o, t.forSubtree = e;n }), window.CustomElements.addModule(function (t) {n function e(t, e) {n return n(t, e) || i(t, e);n }nn function n(e, n) {n return t.upgrade(e, n) ? !0 : void (n && s(e));n }nn function i(t, e) {n b(t, function (t) {n return n(t, e) ? !0 : void 0;n });n }nn function o(t) {n w.push(t), x || (x = !0, setTimeout®);n }nn function r() {n x = !1;nn for (var t, e = w, n = 0, i = e.length; i > n && (t = e); n++) {n t();n }nn w = [];n }nn function s(t) {n C ? o(function () {n a(t);n }) : a(t);n }nn function a(t) {n t.__upgraded__ && !t.__attached && (t.__attached = !0, t.attachedCallback && t.attachedCallback());n }nn function u(t) {n c(t), b(t, function (t) {n c(t);n });n }nn function c(t) {n C ? o(function () {n l(t);n }) : l(t);n }nn function l(t) {n t.__upgraded__ && t.__attached && (t.__attached = !1, t.detachedCallback && t.detachedCallback());n }nn function h(t) {n for (var e = t, n = window.wrap(document); e;) {n if (e == n) return !0;n e = e.parentNode || e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && e.host;n }n }nn function p(t) {n if (t.shadowRoot && !t.shadowRoot.__watched) {n y.dom && console.log("watching shadow-root for: ", t.localName);nn for (var e = t.shadowRoot; e;) {n g(e), e = e.olderShadowRoot;n }n }n }nn function d(t, n) {n if (y.dom) {n var i = n;nn if (i && "childList" === i.type && i.addedNodes && i.addedNodes) {n for (var o = i.addedNodes; o && o !== document && !o.host;) {n o = o.parentNode;n }nn var r = o && (o.URL || o._URL || o.host && o.host.localName) || "";n r = r.split("/?").shift().split("/").pop();n }nn console.group("mutations (%d) [%s]", n.length, r || "");n }nn var s = h(t);n n.forEach(function (t) {n "childList" === t.type && (E(t.addedNodes, function (t) {n t.localName && e(t, s);n }), E(t.removedNodes, function (t) {n t.localName && u(t);n }));n }), y.dom && console.groupEnd();n }nn function f(t) {n for (t = window.wrap(t), t || (t = window.wrap(document)); t.parentNode;) {n t = t.parentNode;n }nn var e = t.__observer;n e && (d(t, e.takeRecords()), r());n }nn function g(t) {n if (!t.__observer) {n var e = new MutationObserver(d.bind(this, t));n e.observe(t, {n childList: !0,n subtree: !0n }), t.__observer = e;n }n }nn function m(t) {n t = window.wrap(t), y.dom && console.group("upgradeDocument: ", t.baseURI.split("/").pop());n var n = t === window.wrap(document);n e(t, n), g(t), y.dom && console.groupEnd();n }nn function v(t) {n A(t, m);n }nn var y = t.flags,n b = t.forSubtree,n A = t.forDocumentTree,n C = window.MutationObserver._isPolyfilled && y;n t.hasPolyfillMutations = C, t.hasThrottledAttached = C;n var x = !1,n w = [],n E = Array.prototype.forEach.call.bind(Array.prototype.forEach),n S = Element.prototype.createShadowRoot;n S && (Element.prototype.createShadowRoot = function () {n var t = S.call(this);n return window.CustomElements.watchShadow(this), t;n }), t.watchShadow = p, t.upgradeDocumentTree = v, t.upgradeDocument = m, t.upgradeSubtree = i, t.upgradeAll = e, t.attached = s, t.takeRecords = f;n }), window.CustomElements.addModule(function (t) {n function e(e, i) {n if ("template" === e.localName && window.HTMLTemplateElement && HTMLTemplateElement.decorate && HTMLTemplateElement.decorate(e), !e.__upgraded__ && e.nodeType === Node.ELEMENT_NODE) {n var o = e.getAttribute("is"),n r = t.getRegisteredDefinition(e.localName) || t.getRegisteredDefinition(o);n if (r && (o && r.tag == e.localName || !o && !r)) return n(e, r, i);n }n }nn function n(e, n, o) {n return s.upgrade && console.group("upgrade:", e.localName), n.is && e.setAttribute("is", n.is), i(e, n), e.__upgraded__ = !0, r(e), o && t.attached(e), t.upgradeSubtree(e, o), s.upgrade && console.groupEnd(), e;n }nn function i(t, e) {n Object.__proto__ ? t.__proto__ = e.prototype : (o(t, e.prototype, e), t.__proto__ = e.prototype);n }nn function o(t, e, n) {n for (var i = {}, o = e; o !== n && o !== HTMLElement.prototype;) {n for (var r, s = Object.getOwnPropertyNames(o), a = 0; r = s; a++) {n i || (Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(o, r)), i = 1);n }nn o = Object.getPrototypeOf(o);n }n }nn function r(t) {n t.createdCallback && t.createdCallback();n }nn var s = t.flags;n t.upgrade = e, t.upgradeWithDefinition = n, t.implementPrototype = i;n }), window.CustomElements.addModule(function (t) {n function e(e, i) {n var u = i || {};n if (!e) throw new Error("document.registerElement: first argument `name` must not be empty");n if (e.indexOf("-") < 0) throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(e) + "'.");n if (o(e)) throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(e) + "'. The type name is invalid.");n if (c(e)) throw new Error("DuplicateDefinitionError: a type with name '" + String(e) + "' is already registered");n return u.prototype || (u.prototype = Object.create(HTMLElement.prototype)), u.__name = e.toLowerCase(), u && (u = u.toLowerCase()), u.lifecycle = u.lifecycle || {}, u.ancestry = r(u), s(u), a(u), n(u.prototype), l(u.__name, u), u.ctor = h(u), u.ctor.prototype = u.prototype, u.prototype.constructor = u.ctor, t.ready && m(document), u.ctor;n }nn function n(t) {n if (!t.setAttribute._polyfilled) {n var e = t.setAttribute;nn t.setAttribute = function (t, n) {n i.call(this, t, n, e);n };nn var n = t.removeAttribute;n t.removeAttribute = function (t) {n i.call(this, t, null, n);n }, t.setAttribute._polyfilled = !0;n }n }nn function i(t, e, n) {n t = t.toLowerCase();n var i = this.getAttribute(t);n n.apply(this, arguments);n var o = this.getAttribute(t);n this.attributeChangedCallback && o !== i && this.attributeChangedCallback(t, i, o);n }nn function o(t) {n for (var e = 0; e < C.length; e++) {n if (t === C) return !0;n }n }nn function r(t) {n var e = c(t);n return e ? r(e).concat() : [];n }nn function s(t) {n for (var e, n = t, i = 0; e = t.ancestry; i++) {n n = e.is && e.tag;n }nn t.tag = n || t.__name, n && (t.is = t.__name);n }nn function a(t) {n if (!Object.__proto__) {n var e = HTMLElement.prototype;nn if (t.is) {n var n = document.createElement(t.tag);n e = Object.getPrototypeOf(n);n }nn for (var i, o = t.prototype, r = !1; o;) {n o == e && (r = !0), i = Object.getPrototypeOf(o), i && (o.__proto__ = i), o = i;n }nn r || console.warn(t.tag + " prototype not found in prototype chain for " + t.is), t = e;n }n }nn function u(t) {n return y(E(t.tag), t);n }nn function c(t) {n return t ? x : void 0;n }nn function l(t, e) {n x = e;n }nn function h(t) {n return function () {n return u(t);n };n }nn function p(t, e, n) {n return t === w ? d(e, n) : S(t, e);n }nn function d(t, e) {n t && (t = t.toLowerCase()), e && (e = e.toLowerCase());n var n = c(e || t);nn if (n) {n if (t == n.tag && e == n.is) return new n.ctor();n if (!e && !n.is) return new n.ctor();n }nn var i;n return e ? (i = d(t), i.setAttribute("is", e), i) : (i = E(t), t.indexOf("-") >= 0 && b(i, HTMLElement), i);n }nn function f(t, e) {n var n = t;nn t = function () {n var t = n.apply(this, arguments);n return v(t), t;n };n }nn var g,n m = (t.isIE, t.upgradeDocumentTree),n v = t.upgradeAll,n y = t.upgradeWithDefinition,n b = t.implementPrototype,n A = t.useNative,n C = ["annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph"],n x = {},n w = "http://www.w3.org/1999/xhtml",n E = document.createElement.bind(document),n S = document.createElementNS.bind(document);n g = Object.__proto__ || A ? function (t, e) {n return t instanceof e;n } : function (t, e) {n if (t instanceof e) return !0;nn for (var n = t; n;) {n if (n === e.prototype) return !0;n n = n.__proto__;n }nn return !1;n }, f(Node.prototype, "cloneNode"), f(document, "importNode"), document.registerElement = e, document.createElement = d, document.createElementNS = p, t.registry = x, t = g, t.reservedTagList = C, t.getRegisteredDefinition = c, document.register = document.registerElement;n }), function (t) {n function e() {n r(window.wrap(document)), window.CustomElements.ready = !0;nn var t = window.requestAnimationFrame || function (t) {n setTimeout(t, 16);n };nn t(function () {n setTimeout(function () {n window.CustomElements.readyTime = Date.now(), window.HTMLImports && (window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime), document.dispatchEvent(new CustomEvent("WebComponentsReady", {n bubbles: !0n }));n });n });n }nn var n = t.useNative,n i = t.initializeModules;nn if (t.isIE, n) {n var o = function o() {};nn t.watchShadow = o, t.upgrade = o, t.upgradeAll = o, t.upgradeDocumentTree = o, t.upgradeSubtree = o, t.takeRecords = o, t = function (t, e) {n return t instanceof e;n };n } else i();nn var r = t.upgradeDocumentTree,n s = t.upgradeDocument;n if (window.wrap || (window.ShadowDOMPolyfill ? (window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded, window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded) : window.wrap = window.unwrap = function (t) {n return t;n }), window.HTMLImports && (window.HTMLImports.__importsParsingHook = function (t) {n t && s(wrap(t));n }), "complete" === document.readyState || t.flags.eager) e();else if ("interactive" !== document.readyState || window.attachEvent || window.HTMLImports && !window.HTMLImports.ready) {n var a = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";n window.addEventListener(a, e);n } else e();n }(window.CustomElements));n}.call(this), function () {}.call(this), function () {n var t = this;n (function () {n (function () {n this.Trix = {n VERSION: "1.2.0",n ZERO_WIDTH_SPACE: "\uFEFF",n NON_BREAKING_SPACE: "\xa0",n OBJECT_REPLACEMENT_CHARACTER: "\uFFFC",n browser: {n composesExistingText: /Android.*Chrome/.test(navigator.userAgent),n forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent),n supportsInputEvents: function () {n var t, e, n, i;n if ("undefined" == typeof InputEvent) return !1;nn for (i = ["data", "getTargetRanges", "inputType"], t = 0, e = i.length; e > t; t++) {n if (n = i, !(n in InputEvent.prototype)) return !1;n }nn return !0;n }()n },n config: {}n };n }).call(this);n }).call(t);n var e = t.Trix;n (function () {n (function () {n e.BasicObject = function () {n function t() {}nn var e, n, i;n return t.proxyMethod = function (t) {n var i, o, r, s, a;n return r = n(t), i = r.name, s = r.toMethod, a = r.toProperty, o = r.optional, this.prototype = function () {n var t, n;n return t = null != s ? o ? "function" == typeof this ? this() : void 0 : this() : null != a ? this : void 0, o ? (n = null != t ? t : void 0, null != n ? e.call(n, t, arguments) : void 0) : (n = t, e.call(n, t, arguments));n };n }, n = function n(t) {n var e, n;n if (!(n = t.match(i))) throw new Error("can't parse @proxyMethod expression: " + t);n return e = {n name: nn }, null != n ? e.toMethod = n : e.toProperty = n, null != n && (e.optional = !0), e;n }, e = Function.prototype.apply, i = /^(.+?)(\(\))?(\?)?\.(.+?)$/, t;n }();n }).call(this), function () {n var t = function t(_t, e) {n function i() {n this.constructor = _t;n }nn for (var o in e) {n n.call(e, o) && (_t = e);n }nn return i.prototype = e.prototype, _t.prototype = new i(), t._super__ = e.prototype, _t;n },n n = {}.hasOwnProperty;nn e.Object = function (n) {n function i() {n this.id = ++o;n }nn var o;n return t(i, n), o = 0, i.fromJSONString = function (t) {n return this.fromJSON(JSON.parse(t));n }, i.prototype.hasSameConstructorAs = function (t) {n return this.constructor === (null != t ? t.constructor : void 0);n }, i.prototype.isEqualTo = function (t) {n return this === t;n }, i.prototype.inspect = function () {n var t, e, n;n return t = function () {n var t, i, o;n i = null != (t = this.contentsForInspection()) ? t : {}, o = [];nn for (e in i) {n n = i, o.push(e + "=" + n);n }nn return o;n }.call(this), "#<" + this.constructor.name + ":" + this.id + (t.length ? " " + t.join(", ") : "") + ">";n }, i.prototype.contentsForInspection = function () {}, i.prototype.toJSONString = function () {n return JSON.stringify(this);n }, i.prototype.toUTF16String = function () {n return e.UTF16String.box(this);n }, i.prototype.getCacheKey = function () {n return this.id.toString();n }, i;n }(e.BasicObject);n }.call(this), function () {n e.extend = function (t) {n var e, n;nn for (e in t) {n n = t, this = n;n }nn return this;n };n }.call(this), function () {n e.extend({n defer: function defer(t) {n return setTimeout(t, 1);n }n });n }.call(this), function () {n var t, n;n e.extend({n normalizeSpaces: function normalizeSpaces(t) {n return t.replace(RegExp("" + e.ZERO_WIDTH_SPACE, "g"), "").replace(RegExp("" + e.NON_BREAKING_SPACE, "g"), " ");n },n normalizeNewlines: function normalizeNewlines(t) {n return t.replace(/\r\n/g, "\n");n },n breakableWhitespacePattern: RegExp("[^\\S" + e.NON_BREAKING_SPACE + "]"),n squishBreakableWhitespace: function squishBreakableWhitespace(t) {n return t.replace(RegExp("" + e.breakableWhitespacePattern.source, "g"), " ").replace(/\ {2,}/g, " ");n },n escapeHTML: function escapeHTML(t) {n var e;n return e = document.createElement("div"), e.textContent = t, e.innerHTML;n },n summarizeStringChange: function summarizeStringChange(t, i) {n var o, r, s, a;n return t = e.UTF16String.box(t), i = e.UTF16String.box(i), i.length < t.length ? (r = n(t, i), a = r, o = r) : (s = n(i, t), o = s, a = s), {n added: o,n removed: an };n }n }), n = function n(_n, i) {n var o, r, s, a, u;n return _n.isEqualTo(i) ? ["", ""] : (r = t(_n, i), a = r.utf16String.length, s = a ? (u = r.offset, r, o = _n.codepoints.slice(0, u).concat(_n.codepoints.slice(u + a)), t(i, e.UTF16String.fromCodepoints(o))) : t(i, _n), [r.utf16String.toString(), s.utf16String.toString()]);n }, t = function t(_t2, e) {n var n, i, o;nn for (n = 0, i = _t2.length, o = e.length; i > n && _t2.charAt(n).isEqualTo(e.charAt(n));) {n n++;n }nn for (; i > n + 1 && _t2.charAt(i - 1).isEqualTo(e.charAt(o - 1));) {n i–, o–;n }nn return {n utf16String: _t2.slice(n, i),n offset: nn };n };n }.call(this), function () {n e.extend({n copyObject: function copyObject(t) {n var e, n, i;n null == t && (t = {}), n = {};nn for (e in t) {n i = t, n = i;n }nn return n;n },n objectsAreEqual: function objectsAreEqual(t, e) {n var n, i;n if (null == t && (t = {}), null == e && (e = {}), Object.keys(t).length !== Object.keys(e).length) return !1;nn for (n in t) {n if (i = t, i !== e) return !1;n }nn return !0;n }n });n }.call(this), function () {n var t = [].slice;n e.extend({n arraysAreEqual: function arraysAreEqual(t, e) {n var n, i, o, r;n if (null == t && (t = []), null == e && (e = []), t.length !== e.length) return !1;nn for (i = n = 0, o = t.length; o > n; i = ++n) {n if (r = t, r !== e) return !1;n }nn return !0;n },n arrayStartsWith: function arrayStartsWith(t, n) {n return null == t && (t = []), null == n && (n = []), e.arraysAreEqual(t.slice(0, n.length), n);n },n spliceArray: function spliceArray() {n var e, n, i;n return n = arguments, e = 2 <= arguments.length ? t.call(arguments, 1) : [], i = n.slice(0), i.splice.apply(i, e), i;n },n summarizeArrayChange: function summarizeArrayChange(t, e) {n var n, i, o, r, s, a, u, c, l, h, p;nn for (null == t && (t = []), null == e && (e = []), n = [], h = [], o = new Set(), r = 0, u = t.length; u > r; r++) {n p = t, o.add(p);n }nn for (i = new Set(), s = 0, c = e.length; c > s; s++) {n p = e, i.add(p), o.has(p) || n.push(p);n }nn for (a = 0, l = t.length; l > a; a++) {n p = t, i.has(p) || h.push(p);n }nn return {n added: n,n removed: hn };n }n });n }.call(this), function () {n var t, n, i, o;n t = null, n = null, o = null, i = null, e.extend({n getAllAttributeNames: function getAllAttributeNames() {n return null != t ? t : t = e.getTextAttributeNames().concat(e.getBlockAttributeNames());n },n getBlockConfig: function getBlockConfig(t) {n return e.config.blockAttributes;n },n getBlockAttributeNames: function getBlockAttributeNames() {n return null != n ? n : n = Object.keys(e.config.blockAttributes);n },n getTextConfig: function getTextConfig(t) {n return e.config.textAttributes;n },n getTextAttributeNames: function getTextAttributeNames() {n return null != o ? o : o = Object.keys(e.config.textAttributes);n },n getListAttributeNames: function getListAttributeNames() {n var t, n;n return null != i ? i : i = function () {n var i, o;n i = e.config.blockAttributes, o = [];nn for (t in i) {n n = i.listAttribute, null != n && o.push(n);n }nn return o;n }();n }n });n }.call(this), function () {n var t,n n,n i,n o,n r,n s = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = document.documentElement, n = null != (i = null != (o = null != (r = t.matchesSelector) ? r : t.webkitMatchesSelector) ? o : t.msMatchesSelector) ? i : t.mozMatchesSelector, e.extend({n handleEvent: function handleEvent(n, i) {n var o, r, _s, a, u, c, l, h, p, d, f, g;nn return h = null != i ? i : {}, c = h.onElement, u = h.matchingSelector, g = h.withCallback, a = h.inPhase, l = h.preventDefault, d = h.times, r = null != c ? c : t, p = u, o = g, f = "capturing" === a, _s = function s(t) {n var n;n return null != d && 0 === –d && _s.destroy(), n = e.findClosestElementFromNode(t.target, {n matchingSelector: pn }), null != n && (null != g && g.call(n, t, n), l) ? t.preventDefault() : void 0;n }, _s.destroy = function () {n return r.removeEventListener(n, _s, f);n }, r.addEventListener(n, _s, f), _s;n },n handleEventOnce: function handleEventOnce(t, n) {n return null == n && (n = {}), n.times = 1, e.handleEvent(t, n);n },n triggerEvent: function triggerEvent(n, i) {n var o, r, s, a, u, c, l;n return l = null != i ? i : {}, c = l.onElement, r = l.bubbles, s = l.cancelable, o = l.attributes, a = null != c ? c : t, r = r !== !1, s = s !== !1, u = document.createEvent("Events"), u.initEvent(n, r, s), null != o && e.extend.call(u, o), a.dispatchEvent(u);n },n elementMatchesSelector: function elementMatchesSelector(t, e) {n return 1 === (null != t ? t.nodeType : void 0) ? n.call(t, e) : void 0;n },n findClosestElementFromNode: function findClosestElementFromNode(t, n) {n var i, o, r;nn for (o = null != n ? n : {}, i = o.matchingSelector, r = o.untilNode; null != t && t.nodeType !== Node.ELEMENT_NODE;) {n t = t.parentNode;n }nn if (null != t) {n if (null == i) return t;n if (t.closest && null == r) return t.closest(i);nn for (; t && t !== r;) {n if (e.elementMatchesSelector(t, i)) return t;n t = t.parentNode;n }n }n },n findInnerElement: function findInnerElement(t) {n for (; null != t ? t.firstElementChild : void 0;) {n t = t.firstElementChild;n }nn return t;n },n innerElementIsActive: function innerElementIsActive(t) {n return document.activeElement !== t && e.elementContainsNode(t, document.activeElement);n },n elementContainsNode: function elementContainsNode(t, e) {n if (t && e) for (; e;) {n if (e === t) return !0;n e = e.parentNode;n }n },n findNodeFromContainerAndOffset: function findNodeFromContainerAndOffset(t, e) {n var n;n if (t) return t.nodeType === Node.TEXT_NODE ? t : 0 === e ? null != (n = t.firstChild) ? n : t : t.childNodes.item(e - 1);n },n findElementFromContainerAndOffset: function findElementFromContainerAndOffset(t, n) {n var i;n return i = e.findNodeFromContainerAndOffset(t, n), e.findClosestElementFromNode(i);n },n findChildIndexOfNode: function findChildIndexOfNode(t) {n var e;nn if (null != t ? t.parentNode : void 0) {n for (e = 0; t = t.previousSibling;) {n e++;n }nn return e;n }n },n removeNode: function removeNode(t) {n var e;n return null != t && null != (e = t.parentNode) ? e.removeChild(t) : void 0;n },n walkTree: function walkTree(t, e) {n var n, i, o, r, s;n return o = null != e ? e : {}, i = o.onlyNodesOfType, r = o.usingFilter, n = o.expandEntityReferences, s = function () {n switch (i) {n case "element":n return NodeFilter.SHOW_ELEMENT;nn case "text":n return NodeFilter.SHOW_TEXT;nn case "comment":n return NodeFilter.SHOW_COMMENT;nn default:n return NodeFilter.SHOW_ALL;n }n }(), document.createTreeWalker(t, s, null != r ? r : null, n === !0);n },n tagName: function tagName(t) {n var e;n return null != t && null != (e = t.tagName) ? e.toLowerCase() : void 0;n },n makeElement: function makeElement(t, e) {n var n, i, o, r, s, a, u, c, l, h;nn if (null == e && (e = {}), "object" == _typeof(t) ? (e = t, t = e.tagName) : e = {n attributes: en }, i = document.createElement(t), null != e.editable && (null == e.attributes && (e.attributes = {}), e.attributes.contenteditable = e.editable), e.attributes) {n a = e.attributes;nn for (r in a) {n h = a, i.setAttribute(r, h);n }n }nn if (e.style) {n u = e.style;nn for (r in u) {n h = u, i.style = h;n }n }nn if (e.data) {n c = e.data;nn for (r in c) {n h = c, i.dataset = h;n }n }nn if (e.className) for (l = e.className.split(" "), o = 0, s = l.length; s > o; o++) {n n = l, i.classList.add(n);n }n return e.textContent && (i.textContent = e.textContent), i;n },n getBlockTagNames: function getBlockTagNames() {n var t, n;n return null != e.blockTagNames ? e.blockTagNames : e.blockTagNames = function () {n var i, o;n i = e.config.blockAttributes, o = [];nn for (t in i) {n n = i.tagName, n && o.push(n);n }nn return o;n }();n },n nodeIsBlockContainer: function nodeIsBlockContainer(t) {n return e.nodeIsBlockStartComment(null != t ? t.firstChild : void 0);n },n nodeProbablyIsBlockContainer: function nodeProbablyIsBlockContainer(t) {n var n, i;n return n = e.tagName(t), s.call(e.getBlockTagNames(), n) >= 0 && (i = e.tagName(t.firstChild), s.call(e.getBlockTagNames(), i) < 0);n },n nodeIsBlockStart: function nodeIsBlockStart(t, n) {n var i;n return i = (null != n ? n : {n strict: !0n }).strict, i ? e.nodeIsBlockStartComment(t) : e.nodeIsBlockStartComment(t) || !e.nodeIsBlockStartComment(t.firstChild) && e.nodeProbablyIsBlockContainer(t);n },n nodeIsBlockStartComment: function nodeIsBlockStartComment(t) {n return e.nodeIsCommentNode(t) && "block" === (null != t ? t.data : void 0);n },n nodeIsCommentNode: function nodeIsCommentNode(t) {n return (null != t ? t.nodeType : void 0) === Node.COMMENT_NODE;n },n nodeIsCursorTarget: function nodeIsCursorTarget(t, n) {n var i;n return i = (null != n ? n : {}).name, t ? e.nodeIsTextNode(t) ? t.data === e.ZERO_WIDTH_SPACE ? i ? t.parentNode.dataset.trixCursorTarget === i : !0 : void 0 : e.nodeIsCursorTarget(t.firstChild) : void 0;n },n nodeIsAttachmentElement: function nodeIsAttachmentElement(t) {n return e.elementMatchesSelector(t, e.AttachmentView.attachmentSelector);n },n nodeIsEmptyTextNode: function nodeIsEmptyTextNode(t) {n return e.nodeIsTextNode(t) && "" === (null != t ? t.data : void 0);n },n nodeIsTextNode: function nodeIsTextNode(t) {n return (null != t ? t.nodeType : void 0) === Node.TEXT_NODE;n }n });n }.call(this), function () {n var t, n, i, o, r;n t = e.copyObject, o = e.objectsAreEqual, e.extend({n normalizeRange: i = function i(t) {n var e;n if (null != t) return Array.isArray(t) || (t = [t, t]), [n(t), n(null != (e = t) ? e : t)];n },n rangeIsCollapsed: function rangeIsCollapsed(t) {n var e, n, o;n if (null != t) return n = i(t), o = n, e = n, r(o, e);n },n rangesAreEqual: function rangesAreEqual(t, e) {n var n, o, s, a, u, c;n if (null != t && null != e) return s = i(t), o = s, n = s, a = i(e), c = a, u = a, r(o, c) && r(n, u);n }n }), n = function n(e) {n return "number" == typeof e ? e : t(e);n }, r = function r(t, e) {n return "number" == typeof t ? t === e : o(t, e);n };n }.call(this), function () {n var t, n, i, o, r;n e.registerElement = function (t, e) {n var s, a;n return null == e && (e = {}), t = t.toLowerCase(), e = r(e), a = o(e), (s = a.defaultCSS) && (delete a.defaultCSS, n(s, t)), i(t, a);n }, n = function n(e, _n2) {n var i;n return i = t(_n2), i.textContent = e.replace(/%t/g, _n2);n }, t = function t(_t3) {n var e;n return e = document.createElement("style"), e.setAttribute("type", "text/css"), e.setAttribute("data-tag-name", _t3.toLowerCase()), document.head.insertBefore(e, document.head.firstChild), e;n }, o = function o(t) {n var e, n, i;n n = {};nn for (e in t) {n i = t, n = "function" == typeof i ? {n value: in } : i;n }nn return n;n }, r = function () {n var t;n return t = function t(_t4) {n var e, n, i, o, r;nn for (e = {}, r = ["initialize", "connect", "disconnect"], n = 0, o = r.length; o > n; n++) {n i = r, e = _t4, delete _t4;n }nn return e;n }, window.customElements ? function (e) {n var n, i, o, r, s;n return s = t(e), o = s.initialize, n = s.connect, i = s.disconnect, o && (r = n, n = function n() {n return this.initialized || (this.initialized = !0, o.call(this)), null != r ? r.call(this) : void 0;n }), n && (e.connectedCallback = n), i && (e.disconnectedCallback = i), e;n } : function (e) {n var n, i, o, r;n return r = t(e), o = r.initialize, n = r.connect, i = r.disconnect, o && (e.createdCallback = o), n && (e.attachedCallback = n), i && (e.detachedCallback = i), e;n };n }(), i = function () {n return window.customElements ? function (t, e) {n var _n3;nn return _n3 = function n() {n return Reflect.construct(HTMLElement, [], _n3);n }, _n3.prototype = Object.create(HTMLElement.prototype, e), window.customElements.define(t, _n3), _n3;n } : function (t, e) {n var n, i;n return i = Object.create(HTMLElement.prototype, e), n = document.registerElement(t, {n prototype: in }), Object.defineProperty(i, "constructor", {n value: nn }), n;n };n }();n }.call(this), function () {n var t, n;n e.extend({n getDOMSelection: function getDOMSelection() {n var t;n return t = window.getSelection(), t.rangeCount > 0 ? t : void 0;n },n getDOMRange: function getDOMRange() {n var n, i;n return (n = null != (i = e.getDOMSelection()) ? i.getRangeAt(0) : void 0) && !t(n) ? n : void 0;n },n setDOMRange: function setDOMRange(t) {n var n;n return n = window.getSelection(), n.removeAllRanges(), n.addRange(t), e.selectionChangeObserver.update();n }n }), t = function t(_t5) {n return n(_t5.startContainer) || n(_t5.endContainer);n }, n = function n(t) {n return !Object.getPrototypeOf(t);n };n }.call(this), function () {n var t;n t = {n "application/x-trix-feature-detection": "test"n }, e.extend({n dataTransferIsPlainText: function dataTransferIsPlainText(t) {n var e, n, i;n return i = t.getData("text/plain"), n = t.getData("text/html"), i && n ? (e = document.createElement("div"), e.innerHTML = n, e.textContent === i ? !e.querySelector(":not(meta)") : void 0) : null != i ? i.length : void 0;n },n dataTransferIsWritable: function dataTransferIsWritable(e) {n var n, i;nn if (null != (null != e ? e.setData : void 0)) {n for (n in t) {n if (i = t, !function () {n try {n return e.setData(n, i), e.getData(n) === i;n } catch (t) {}n }()) return;n }nn return !0;n }n },n keyEventIsKeyboardCommand: function () {n return /Mac|^iP/.test(navigator.platform) ? function (t) {n return t.metaKey;n } : function (t) {n return t.ctrlKey;n };n }()n });n }.call(this), function () {}.call(this), function () {n var t,n n = function n(t, e) {n function n() {n this.constructor = t;n }nn for (var o in e) {n i.call(e, o) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n i = {}.hasOwnProperty;nn t = e.arraysAreEqual, e.Hash = function (i) {n function o(t) {n null == t && (t = {}), this.values = s(t), o.__super__.constructor.apply(this, arguments);n }nn var r, s, a, u, c;n return n(o, i), o.fromCommonAttributesOfObjects = function (t) {n var e, n, i, o, s, a;n if (null == t && (t = []), !t.length) return new this();nn for (e = r(t), i = e.getKeys(), a = t.slice(1), n = 0, o = a.length; o > n; n++) {n s = a, i = e.getKeysCommonToHash(r(s)), e = e.slice(i);n }nn return e;n }, o.box = function (t) {n return r(t);n }, o.prototype.add = function (t, e) {n return this.merge(u(t, e));n }, o.prototype.remove = function (t) {n return new e.Hash(s(this.values, t));n }, o.prototype.get = function (t) {n return this.values;n }, o.prototype.has = function (t) {n return t in this.values;n }, o.prototype.merge = function (t) {n return new e.Hash(a(this.values, c(t)));n }, o.prototype.slice = function (t) {n var n, i, o, r;nn for (r = {}, n = 0, o = t.length; o > n; n++) {n i = t, this.has(i) && (r = this.values);n }nn return new e.Hash®;n }, o.prototype.getKeys = function () {n return Object.keys(this.values);n }, o.prototype.getKeysCommonToHash = function (t) {n var e, n, i, o, s;nn for (t = r(t), o = this.getKeys(), s = [], e = 0, i = o.length; i > e; e++) {n n = o, this.values === t.values && s.push(n);n }nn return s;n }, o.prototype.isEqualTo = function (e) {n return t(this.toArray(), r(e).toArray());n }, o.prototype.isEmpty = function () {n return 0 === this.getKeys().length;n }, o.prototype.toArray = function () {n var t, e, n;n return (null != this.array ? this.array : this.array = function () {n var i;n e = [], i = this.values;nn for (t in i) {n n = i, e.push(t, n);n }nn return e;n }.call(this)).slice(0);n }, o.prototype.toObject = function () {n return s(this.values);n }, o.prototype.toJSON = function () {n return this.toObject();n }, o.prototype.contentsForInspection = function () {n return {n values: JSON.stringify(this.values)n };n }, u = function u(t, e) {n var n;n return n = {}, n = e, n;n }, a = function a(t, e) {n var n, i, o;n i = s(t);nn for (n in e) {n o = e, i = o;n }nn return i;n }, s = function s(t, e) {n var n, i, o, r, s;nn for (r = {}, s = Object.keys(t).sort(), n = 0, o = s.length; o > n; n++) {n i = s, i !== e && (r = t);n }nn return r;n }, r = function r(t) {n return t instanceof e.Hash ? t : new e.Hash(t);n }, c = function c(t) {n return t instanceof e.Hash ? t.values : t;n }, o;n }(e.Object);n }.call(this), function () {n e.ObjectGroup = function () {n function t(t, e) {n var n, i;n this.objects = null != t ? t : [], i = e.depth, n = e.asTree, n && (this.depth = i, this.objects = this.constructor.groupObjects(this.objects, {n asTree: n,n depth: this.depth + 1n }));n }nn return t.groupObjects = function (t, e) {n var n, i, o, r, s, a, u, c, l;nn for (null == t && (t = []), l = null != e ? e : {}, o = l.depth, n = l.asTree, n && null == o && (o = 0), c = [], s = 0, a = t.length; a > s; s++) {n if (u = t, r) {n if (("function" == typeof u.canBeGrouped ? u.canBeGrouped(o) : void 0) && ("function" == typeof (i = r[r.length - 1]).canBeGroupedWith ? i.canBeGroupedWith(u, o) : void 0)) {n r.push(u);n continue;n }nn c.push(new this(r, {n depth: o,n asTree: nn })), r = null;n }nn ("function" == typeof u.canBeGrouped ? u.canBeGrouped(o) : void 0) ? r = [u] : c.push(u);n }nn return r && c.push(new this(r, {n depth: o,n asTree: nn })), c;n }, t.prototype.getObjects = function () {n return this.objects;n }, t.prototype.getDepth = function () {n return this.depth;n }, t.prototype.getCacheKey = function () {n var t, e, n, i, o;nn for (e = ["objectGroup"], o = this.getObjects(), t = 0, n = o.length; n > t; t++) {n i = o, e.push(i.getCacheKey());n }nn return e.join("/");n }, t;n }();n }.call(this), function () {n var t = function t(_t6, e) {n function i() {n this.constructor = _t6;n }nn for (var o in e) {n n.call(e, o) && (_t6 = e);n }nn return i.prototype = e.prototype, _t6.prototype = new i(), t6._super__ = e.prototype, _t6;n },n n = {}.hasOwnProperty;nn e.ObjectMap = function (e) {n function n(t) {n var e, n, i, o, r;nn for (null == t && (t = []), this.objects = {}, i = 0, o = t.length; o > i; i++) {n r = t, n = JSON.stringify®, null == (e = this.objects) && (e = r);n }n }nn return t(n, e), n.prototype.find = function (t) {n var e;n return e = JSON.stringify(t), this.objects;n }, n;n }(e.BasicObject);n }.call(this), function () {n e.ElementStore = function () {n function t(t) {n this.reset(t);n }nn var e;n return t.prototype.add = function (t) {n var n;n return n = e(t), this.elements = t;n }, t.prototype.remove = function (t) {n var n, i;n return n = e(t), (i = this.elements) ? (delete this.elements, i) : void 0;n }, t.prototype.reset = function (t) {n var e, n, i;nn for (null == t && (t = []), this.elements = {}, n = 0, i = t.length; i > n; n++) {n e = t, this.add(e);n }nn return t;n }, e = function e(t) {n return t.dataset.trixStoreKey;n }, t;n }();n }.call(this), function () {}.call(this), function () {n var t = function t(_t7, e) {n function i() {n this.constructor = _t7;n }nn for (var o in e) {n n.call(e, o) && (_t7 = e);n }nn return i.prototype = e.prototype, _t7.prototype = new i(), t7._super__ = e.prototype, _t7;n },n n = {}.hasOwnProperty;nn e.Operation = function (e) {n function n() {n return n.__super__.constructor.apply(this, arguments);n }nn return t(n, e), n.prototype.isPerforming = function () {n return this.performing === !0;n }, n.prototype.hasPerformed = function () {n return this.performed === !0;n }, n.prototype.hasSucceeded = function () {n return this.performed && this.succeeded;n }, n.prototype.hasFailed = function () {n return this.performed && !this.succeeded;n }, n.prototype.getPromise = function () {n return null != this.promise ? this.promise : this.promise = new Promise(function (t) {n return function (e, n) {n return t.performing = !0, t.perform(function (i, o) {n return t.succeeded = i, t.performing = !1, t.performed = !0, t.succeeded ? e(o) : n(o);n });n };n }(this));n }, n.prototype.perform = function (t) {n return t(!1);n }, n.prototype.release = function () {n var t;n return null != (t = this.promise) && "function" == typeof t.cancel && t.cancel(), this.promise = null, this.performing = null, this.performed = null, this.succeeded = null;n }, n.proxyMethod("getPromise().then"), n.proxyMethod("getPromise().catch"), n;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r,n s = function s(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n a.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n a = {}.hasOwnProperty;nn e.UTF16String = function (t) {n function e(t, e) {n this.ucs2String = t, this.codepoints = e, this.length = this.codepoints.length, this.ucs2Length = this.ucs2String.length;n }nn return s(e, t), e.box = function (t) {n return null == t && (t = ""), t instanceof this ? t : this.fromUCS2String(null != t ? t.toString() : void 0);n }, e.fromUCS2String = function (t) {n return new this(t, o(t));n }, e.fromCodepoints = function (t) {n return new this(r(t), t);n }, e.prototype.offsetToUCS2Offset = function (t) {n return r(this.codepoints.slice(0, Math.max(0, t))).length;n }, e.prototype.offsetFromUCS2Offset = function (t) {n return o(this.ucs2String.slice(0, Math.max(0, t))).length;n }, e.prototype.slice = function () {n var t;n return this.constructor.fromCodepoints((t = this.codepoints).slice.apply(t, arguments));n }, e.prototype.charAt = function (t) {n return this.slice(t, t + 1);n }, e.prototype.isEqualTo = function (t) {n return this.constructor.box(t).ucs2String === this.ucs2String;n }, e.prototype.toJSON = function () {n return this.ucs2String;n }, e.prototype.getCacheKey = function () {n return this.ucs2String;n }, e.prototype.toString = function () {n return this.ucs2String;n }, e;n }(e.BasicObject), t = 1 === ("function" == typeof Array.from ? Array.from("\uD83D\uDC7C").length : void 0), n = null != ("function" == typeof " ".codePointAt ? " ".codePointAt(0) : void 0), i = " \uD83D\uDC7C" === ("function" == typeof String.fromCodePoint ? String.fromCodePoint(32, 128124) : void 0), o = t && n ? function (t) {n return Array.from(t).map(function (t) {n return t.codePointAt(0);n });n } : function (t) {n var e, n, i, o, r;nn for (o = [], e = 0, i = t.length; i > e;) {n r = t.charCodeAt(e++), r >= 55296 && 56319 >= r && i > e && (n = t.charCodeAt(e++), 56320 === (64512 & n) ? r = ((1023 & r) << 10) + (1023 & n) + 65536 : e–), o.push®;n }nn return o;n }, r = i ? function (t) {n return String.fromCodePoint.apply(String, t);n } : function (t) {n var e, n, i;n return e = function () {n var e, o, r;nn for (r = [], e = 0, o = t.length; o > e; e++) {n i = t, n = "", i > 65535 && (i -= 65536, n += String.fromCharCode(i >>> 10 & 1023 | 55296), i = 56320 | 1023 & i), r.push(n + String.fromCharCode(i));n }nn return r;n }(), e.join("");n };n }.call(this), function () {}.call(this), function () {}.call(this), function () {n e.config.lang = {n attachFiles: "Attach Files",n bold: "Bold",n bullets: "Bullets",n "byte": "Byte",n bytes: "Bytes",n captionPlaceholder: "Add a caption\u2026",n code: "Code",n heading1: "Heading",n indent: "Increase Level",n italic: "Italic",n link: "Link",n numbers: "Numbers",n outdent: "Decrease Level",n quote: "Quote",n redo: "Redo",n remove: "Remove",n strike: "Strikethrough",n undo: "Undo",n unlink: "Unlink",n url: "URL",n urlPlaceholder: "Enter a URL\u2026",n GB: "GB",n KB: "KB",n MB: "MB",n PB: "PB",n TB: "TB"n };n }.call(this), function () {n e.config.css = {n attachment: "attachment",n attachmentCaption: "attachment__caption",n attachmentCaptionEditor: "attachment__caption-editor",n attachmentMetadata: "attachment__metadata",n attachmentMetadataContainer: "attachment__metadata-container",n attachmentName: "attachment__name",n attachmentProgress: "attachment__progress",n attachmentSize: "attachment__size",n attachmentToolbar: "attachment__toolbar",n attachmentGallery: "attachment-gallery"n };n }.call(this), function () {n var t;n e.config.blockAttributes = t = {n "default": {n tagName: "div",n parse: !1n },n quote: {n tagName: "blockquote",n nestable: !0n },n heading1: {n tagName: "h1",n terminal: !0,n breakOnReturn: !0,n group: !1n },n code: {n tagName: "pre",n terminal: !0,n text: {n plaintext: !0n }n },n bulletList: {n tagName: "ul",n parse: !1n },n bullet: {n tagName: "li",n listAttribute: "bulletList",n group: !1,n nestable: !0,n test: function test(n) {n return e.tagName(n.parentNode) === t.tagName;n }n },n numberList: {n tagName: "ol",n parse: !1n },n number: {n tagName: "li",n listAttribute: "numberList",n group: !1,n nestable: !0,n test: function test(n) {n return e.tagName(n.parentNode) === t.tagName;n }n },n attachmentGallery: {n tagName: "div",n exclusive: !0,n terminal: !0,n parse: !1,n group: !1n }n };n }.call(this), function () {n var t, n;n t = e.config.lang, n = [t.bytes, t.KB, t.MB, t.GB, t.TB, t.PB], e.config.fileSize = {n prefix: "IEC",n precision: 2,n formatter: function formatter(e) {n var i, o, r, s, a;nn switch (e) {n case 0:n return "0 " + t.bytes;nn case 1:n return "1 " + t;nn default:n return i = function () {n switch (this.prefix) {n case "SI":n return 1e3;nn case "IEC":n return 1024;n }n }.call(this), o = Math.floor(Math.log(e) / Math.log(i)), r = e / Math.pow(i, o), s = r.toFixed(this.precision), a = s.replace(/0*$/, "").replace(/\.$/, ""), a + " " + n;n }n }n };n }.call(this), function () {n e.config.textAttributes = {n bold: {n tagName: "strong",n inheritable: !0,n parser: function parser(t) {n var e;n return e = window.getComputedStyle(t), "bold" === e.fontWeight || e.fontWeight >= 600;n }n },n italic: {n tagName: "em",n inheritable: !0,n parser: function parser(t) {n var e;n return e = window.getComputedStyle(t), "italic" === e.fontStyle;n }n },n href: {n groupTagName: "a",n parser: function parser(t) {n var n, i, o;n return n = e.AttachmentView.attachmentSelector, o = "a:not(" + n + ")", (i = e.findClosestElementFromNode(t, {n matchingSelector: on })) ? i.getAttribute("href") : void 0;n }n },n strike: {n tagName: "del",n inheritable: !0n },n frozen: {n style: {n backgroundColor: "highlight"n }n }n };n }.call(this), function () {n var t, n, i, o, r;n r = "[data-trix-serialize=false]", o = ["contenteditable", "data-trix-id", "data-trix-store-key", "data-trix-mutable", "data-trix-placeholder", "tabindex"], n = "data-trix-serialized-attributes", i = "[" + n + "]", t = new RegExp("<!–block–>", "g"), e.extend({n serializers: {n "application/json": function applicationJson(t) {n var n;n if (t instanceof e.Document) n = t;else {n if (!(t instanceof HTMLElement)) throw new Error("unserializable object");n n = e.Document.fromHTML(t.innerHTML);n }n return n.toSerializableDocument().toJSONString();n },n "text/html": function textHtml(s) {n var a, u, c, l, h, p, d, f, g, m, v, y, b, A, C, x, w;n if (s instanceof e.Document) l = e.DocumentView.render(s);else {n if (!(s instanceof HTMLElement)) throw new Error("unserializable object");n l = s.cloneNode(!0);n }nn for (A = l.querySelectorAll®, h = 0, g = A.length; g > h; h++) {n c = A, e.removeNode©;n }nn for (p = 0, m = o.length; m > p; p++) {n for (a = o, C = l.querySelectorAll("[" + a + "]"), d = 0, v = C.length; v > d; d++) {n c = C, c.removeAttribute(a);n }n }nn for (x = l.querySelectorAll(i), f = 0, y = x.length; y > f; f++) {n c = x;nn try {n u = JSON.parse(c.getAttribute(n)), c.removeAttribute(n);nn for (b in u) {n w = u, c.setAttribute(b, w);n }n } catch (E) {}n }nn return l.innerHTML.replace(t, "");n }n },n deserializers: {n "application/json": function applicationJson(t) {n return e.Document.fromJSONString(t);n },n "text/html": function textHtml(t) {n return e.Document.fromHTML(t);n }n },n serializeToContentType: function serializeToContentType(t, n) {n var i;n if (i = e.serializers) return i(t);n throw new Error("unknown content type: " + n);n },n deserializeFromContentType: function deserializeFromContentType(t, n) {n var i;n if (i = e.deserializers) return i(t);n throw new Error("unknown content type: " + n);n }n });n }.call(this), function () {n var t;n t = e.config.lang, e.config.toolbar = {n getDefaultHTML: function getDefaultHTML() {n return '<div class="trix-button-row">\n <span class="trix-button-group trix-button-group–text-tools" data-trix-button-group="text-tools">\n <button type="button" class="trix-button trix-button–icon trix-button–icon-bold" data-trix-attribute="bold" data-trix-key="b" title="' + t.bold + '" tabindex="-1">' + t.bold + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-italic" data-trix-attribute="italic" data-trix-key="i" title="' + t.italic + '" tabindex="-1">' + t.italic + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-strike" data-trix-attribute="strike" title="' + t.strike + '" tabindex="-1">' + t.strike + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-link" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="' + t.link + '" tabindex="-1">' + t.link + '</button>\n </span>\n\n <span class="trix-button-group trix-button-group–block-tools" data-trix-button-group="block-tools">\n <button type="button" class="trix-button trix-button–icon trix-button–icon-heading-1" data-trix-attribute="heading1" title="' + t.heading1 + '" tabindex="-1">' + t.heading1 + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-quote" data-trix-attribute="quote" title="' + t.quote + '" tabindex="-1">' + t.quote + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-code" data-trix-attribute="code" title="' + t.code + '" tabindex="-1">' + t.code + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-bullet-list" data-trix-attribute="bullet" title="' + t.bullets + '" tabindex="-1">' + t.bullets + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-number-list" data-trix-attribute="number" title="' + t.numbers + '" tabindex="-1">' + t.numbers + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title="' + t.outdent + '" tabindex="-1">' + t.outdent + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title="' + t.indent + '" tabindex="-1">' + t.indent + '</button>\n </span>\n\n <span class="trix-button-group trix-button-group–file-tools" data-trix-button-group="file-tools">\n <button type="button" class="trix-button trix-button–icon trix-button–icon-attach" data-trix-action="attachFiles" title="' + t.attachFiles + '" tabindex="-1">' + t.attachFiles + '</button>\n </span>\n\n <span class="trix-button-group-spacer"></span>\n\n <span class="trix-button-group trix-button-group–history-tools" data-trix-button-group="history-tools">\n <button type="button" class="trix-button trix-button–icon trix-button–icon-undo" data-trix-action="undo" data-trix-key="z" title="' + t.undo + '" tabindex="-1">' + t.undo + '</button>\n <button type="button" class="trix-button trix-button–icon trix-button–icon-redo" data-trix-action="redo" data-trix-key="shift+z" title="' + t.redo + '" tabindex="-1">' + t.redo + '</button>\n </span>\n</div>\n\n<div class="trix-dialogs" data-trix-dialogs>\n <div class="trix-dialog trix-dialog–link" data-trix-dialog="href" data-trix-dialog-attribute="href">\n <div class="trix-dialog__link-fields">\n <input type="url" name="href" class="trix-input trix-input–dialog" placeholder="' + t.urlPlaceholder + '" aria-label="' + t.url + '" required data-trix-input>\n <div class="trix-button-group">\n <input type="button" class="trix-button trix-button–dialog" value="' + t.link + '" data-trix-method="setAttribute">\n <input type="button" class="trix-button trix-button–dialog" value="' + t.unlink + '" data-trix-method="removeAttribute">\n </div>\n </div>\n </div>\n</div>';n }n };n }.call(this), function () {n e.config.undoInterval = 5e3;n }.call(this), function () {n e.config.attachments = {n preview: {n presentation: "gallery",n caption: {n name: !0,n size: !0n }n },n file: {n caption: {n size: !0n }n }n };n }.call(this), function () {n e.config.keyNames = {n 8: "backspace",n 9: "tab",n 13: "return",n 27: "escape",n 37: "left",n 39: "right",n 46: "delete",n 68: "d",n 72: "h",n 79: "o"n };n }.call(this), function () {n e.config.input = {n level2Enabled: !0,n getLevel: function getLevel() {n return this.level2Enabled && e.browser.supportsInputEvents ? 2 : 0;n },n pickFiles: function pickFiles(t) {n var n;n return n = e.makeElement("input", {n type: "file",n multiple: !0,n hidden: !0,n id: this.fileInputIdn }), n.addEventListener("change", function () {n return t(n.files), e.removeNode(n);n }), e.removeNode(document.getElementById(this.fileInputId)), document.body.appendChild(n), n.click();n },n fileInputId: "trix-file-input-" + Date.now().toString(16)n };n }.call(this), function () {}.call(this), function () {n e.registerElement("trix-toolbar", {n defaultCSS: "%t {\n display: block;\n}\n\n%t {\n white-space: nowrap;\n}\n\n%t [data-trix-dialog] {\n display: none;\n}\n\n%t [data-trix-dialog] {\n display: block;\n}\n\n%t [data-trix-dialog] [data-trix-validate]:invalid {\n background-color: ffdddd;\n}",n initialize: function initialize() {n return "" === this.innerHTML ? this.innerHTML = e.config.toolbar.getDefaultHTML() : void 0;n }n });n }.call(this), function () {n var t = function t(_t8, e) {n function i() {n this.constructor = _t8;n }nn for (var o in e) {n n.call(e, o) && (_t8 = e);n }nn return i.prototype = e.prototype, _t8.prototype = new i(), t8._super__ = e.prototype, _t8;n },n n = {}.hasOwnProperty,n i = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn e.ObjectView = function (n) {n function o(t, e) {n this.object = t, this.options = null != e ? e : {}, this.childViews = [], this.rootView = this;n }nn return t(o, n), o.prototype.getNodes = function () {n var t, e, n, i, o;nn for (null == this.nodes && (this.nodes = this.createNodes()), i = this.nodes, o = [], t = 0, e = i.length; e > t; t++) {n n = i, o.push(n.cloneNode(!0));n }nn return o;n }, o.prototype.invalidate = function () {n var t;n return this.nodes = null, null != (t = this.parentView) ? t.invalidate() : void 0;n }, o.prototype.invalidateViewForObject = function (t) {n var e;n return null != (e = this.findViewForObject(t)) ? e.invalidate() : void 0;n }, o.prototype.findOrCreateCachedChildView = function (t, e) {n var n;n return (n = this.getCachedViewForObject(e)) ? this.recordChildView(n) : (n = this.createChildView.apply(this, arguments), this.cacheViewForObject(n, e)), n;n }, o.prototype.createChildView = function (t, n, i) {n var o;n return null == i && (i = {}), n instanceof e.ObjectGroup && (i.viewClass = t, t = e.ObjectGroupView), o = new t(n, i), this.recordChildView(o);n }, o.prototype.recordChildView = function (t) {n return t.parentView = this, t.rootView = this.rootView, i.call(this.childViews, t) < 0 && this.childViews.push(t), t;n }, o.prototype.getAllChildViews = function () {n var t, e, n, i, o;nn for (o = [], i = this.childViews, e = 0, n = i.length; n > e; e++) {n t = i, o.push(t), o = o.concat(t.getAllChildViews());n }nn return o;n }, o.prototype.findElement = function () {n return this.findElementForObject(this.object);n }, o.prototype.findElementForObject = function (t) {n var e;n return (e = null != t ? t.id : void 0) ? this.rootView.element.querySelector("[data-trix-id='" + e + "']") : void 0;n }, o.prototype.findViewForObject = function (t) {n var e, n, i, o;nn for (i = this.getAllChildViews(), e = 0, n = i.length; n > e; e++) {n if (o = i, o.object === t) return o;n }n }, o.prototype.getViewCache = function () {n return this.rootView !== this ? this.rootView.getViewCache() : this.isViewCachingEnabled() ? null != this.viewCache ? this.viewCache : this.viewCache = {} : void 0;n }, o.prototype.isViewCachingEnabled = function () {n return this.shouldCacheViews !== !1;n }, o.prototype.enableViewCaching = function () {n return this.shouldCacheViews = !0;n }, o.prototype.disableViewCaching = function () {n return this.shouldCacheViews = !1;n }, o.prototype.getCachedViewForObject = function (t) {n var e;n return null != (e = this.getViewCache()) ? e : void 0;n }, o.prototype.cacheViewForObject = function (t, e) {n var n;n return null != (n = this.getViewCache()) ? n = t : void 0;n }, o.prototype.garbageCollectCachedViews = function () {n var t, e, n, o, r, s;nn if (t = this.getViewCache()) {n s = this.getAllChildViews().concat(this), n = function () {n var t, e, n;nn for (n = [], t = 0, e = s.length; e > t; t++) {n r = s, n.push(r.object.getCacheKey());n }nn return n;n }(), o = [];nn for (e in t) {n i.call(n, e) < 0 && o.push(delete t);n }nn return o;n }n }, o;n }(e.BasicObject);n }.call(this), function () {n var t = function t(_t9, e) {n function i() {n this.constructor = _t9;n }nn for (var o in e) {n n.call(e, o) && (_t9 = e);n }nn return i.prototype = e.prototype, _t9.prototype = new i(), t9._super__ = e.prototype, _t9;n },n n = {}.hasOwnProperty;nn e.ObjectGroupView = function (e) {n function n() {n n.__super__.constructor.apply(this, arguments), this.objectGroup = this.object, this.viewClass = this.options.viewClass, delete this.options.viewClass;n }nn return t(n, e), n.prototype.getChildViews = function () {n var t, e, n, i;n if (!this.childViews.length) for (i = this.objectGroup.getObjects(), t = 0, e = i.length; e > t; t++) {n n = i, this.findOrCreateCachedChildView(this.viewClass, n, this.options);n }n return this.childViews;n }, n.prototype.createNodes = function () {n var t, e, n, i, o, r, s, a, u;nn for (t = this.createContainerElement(), s = this.getChildViews(), e = 0, i = s.length; i > e; e++) {n for (u = s, a = u.getNodes(), n = 0, o = a.length; o > n; n++) {n r = a, t.appendChild®;n }n }nn return [t];n }, n.prototype.createContainerElement = function (t) {n return null == t && (t = this.objectGroup.getDepth()), this.getChildViews().createContainerElement(t);n }, n;n }(e.ObjectView);n }.call(this), function () {n var t = function t(_t10, e) {n function i() {n this.constructor = _t10;n }nn for (var o in e) {n n.call(e, o) && (_t10 = e);n }nn return i.prototype = e.prototype, _t10.prototype = new i(), t10._super__ = e.prototype, _t10;n },n n = {}.hasOwnProperty;nn e.Controller = function (e) {n function n() {n return n.__super__.constructor.apply(this, arguments);n }nn return t(n, e), n;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a = function a(t, e) {n return function () {n return t.apply(e, arguments);n };n },n u = function u(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n c.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n c = {}.hasOwnProperty,n l = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = e.findClosestElementFromNode, i = e.nodeIsEmptyTextNode, n = e.nodeIsBlockStartComment, o = e.normalizeSpaces, r = e.summarizeStringChange, s = e.tagName, e.MutationObserver = function (e) {n function c(t) {n this.element = t, this.didMutate = a(this.didMutate, this), this.observer = new window.MutationObserver(this.didMutate), this.start();n }nn var _h, p, d, f;nn return u(c, e), p = "data-trix-mutable", d = "[" + p + "]", f = {n attributes: !0,n childList: !0,n characterData: !0,n characterDataOldValue: !0,n subtree: !0n }, c.prototype.start = function () {n return this.reset(), this.observer.observe(this.element, f);n }, c.prototype.stop = function () {n return this.observer.disconnect();n }, c.prototype.didMutate = function (t) {n var e, n;n return (e = this.mutations).push.apply(e, this.findSignificantMutations(t)), this.mutations.length ? (null != (n = this.delegate) && "function" == typeof n.elementDidMutate && n.elementDidMutate(this.getMutationSummary()), this.reset()) : void 0;n }, c.prototype.reset = function () {n return this.mutations = [];n }, c.prototype.findSignificantMutations = function (t) {n var e, n, i, o;nn for (o = [], e = 0, n = t.length; n > e; e++) {n i = t, this.mutationIsSignificant(i) && o.push(i);n }nn return o;n }, c.prototype.mutationIsSignificant = function (t) {n var e, n, i, o;n if (this.nodeIsMutable(t.target)) return !1;nn for (o = this.nodesModifiedByMutation(t), e = 0, n = o.length; n > e; e++) {n if (i = o, this.nodeIsSignificant(i)) return !0;n }nn return !1;n }, c.prototype.nodeIsSignificant = function (t) {n return t !== this.element && !this.nodeIsMutable(t) && !i(t);n }, c.prototype.nodeIsMutable = function (e) {n return t(e, {n matchingSelector: dn });n }, c.prototype.nodesModifiedByMutation = function (t) {n var e;nn switch (e = [], t.type) {n case "attributes":n t.attributeName !== p && e.push(t.target);n break;nn case "characterData":n e.push(t.target.parentNode), e.push(t.target);n break;nn case "childList":n e.push.apply(e, t.addedNodes), e.push.apply(e, t.removedNodes);n }nn return e;n }, c.prototype.getMutationSummary = function () {n return this.getTextMutationSummary();n }, c.prototype.getTextMutationSummary = function () {n var t, e, n, i, o, r, s, a, u, c, h;nn for (a = this.getTextChangesFromCharacterData(), n = a.additions, o = a.deletions, h = this.getTextChangesFromChildList(), u = h.additions, r = 0, s = u.length; s > r; r++) {n e = u, l.call(n, e) < 0 && n.push(e);n }nn return o.push.apply(o, h.deletions), c = {}, (t = n.join("")) && (c.textAdded = t), (i = o.join("")) && (c.textDeleted = i), c;n }, c.prototype.getMutationsByType = function (t) {n var e, n, i, o, r;nn for (o = this.mutations, r = [], e = 0, n = o.length; n > e; e++) {n i = o, i.type === t && r.push(i);n }nn return r;n }, c.prototype.getTextChangesFromChildList = function () {n var t, e, i, r, s, a, u, c, l, p, d;nn for (t = [], u = [], a = this.getMutationsByType("childList"), e = 0, r = a.length; r > e; e++) {n s = a, t.push.apply(t, s.addedNodes), u.push.apply(u, s.removedNodes);n }nn return c = 0 === t.length && 1 === u.length && n(u), c ? (p = [], d = ["\n"]) : (p = _h(t), d = _h(u)), {n additions: function () {n var t, e, n;nn for (n = [], i = t = 0, e = p.length; e > t; i = ++t) {n l = p, l !== d && n.push(o(l));n }nn return n;n }(),n deletions: function () {n var t, e, n;nn for (n = [], i = t = 0, e = d.length; e > t; i = ++t) {n l = d, l !== p && n.push(o(l));n }nn return n;n }()n };n }, c.prototype.getTextChangesFromCharacterData = function () {n var t, e, n, i, s, a, u, c;n return e = this.getMutationsByType("characterData"), e.length && (c = e, n = e[e.length - 1], s = o(c.oldValue), i = o(n.target.data), a = r(s, i), t = a.added, u = a.removed), {n additions: t ? [t] : [],n deletions: u ? [u] : []n };n }, _h = function h(t) {n var e, n, i, o;nn for (null == t && (t = []), o = [], e = 0, n = t.length; n > e; e++) {n switch (i = t, i.nodeType) {n case Node.TEXT_NODE:n o.push(i.data);n break;nn case Node.ELEMENT_NODE:n "br" === s(i) ? o.push("\n") : o.push.apply(o, _h(i.childNodes));n }n }nn return o;n }, c;n }(e.BasicObject);n }.call(this), function () {n var t = function t(_t11, e) {n function i() {n this.constructor = _t11;n }nn for (var o in e) {n n.call(e, o) && (_t11 = e);n }nn return i.prototype = e.prototype, _t11.prototype = new i(), t11._super__ = e.prototype, _t11;n },n n = {}.hasOwnProperty;nn e.FileVerificationOperation = function (e) {n function n(t) {n this.file = t;n }nn return t(n, e), n.prototype.perform = function (t) {n var e;n return e = new FileReader(), e.onerror = function () {n return t(!1);n }, e.onload = function (n) {n return function () {n e.onerror = null;nn try {n e.abort();n } catch (i) {}nn return t(!0, n.file);n };n }(this), e.readAsArrayBuffer(this.file);n }, n;n }(e.Operation);n }.call(this), function () {n var t,n n,n i = function i(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n o.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n o = {}.hasOwnProperty;nn t = e.handleEvent, n = e.innerElementIsActive, e.InputController = function (o) {n function r(n) {n var i;n this.element = n, this.mutationObserver = new e.MutationObserver(this.element), this.mutationObserver.delegate = this;nn for (i in this.events) {n t(i, {n onElement: this.element,n withCallback: this.handlerFor(i)n });n }n }nn return i(r, o), r.prototype.events = {}, r.prototype.elementDidMutate = function () {}, r.prototype.editorWillSyncDocumentView = function () {n return this.mutationObserver.stop();n }, r.prototype.editorDidSyncDocumentView = function () {n return this.mutationObserver.start();n }, r.prototype.requestRender = function () {n var t;n return null != (t = this.delegate) && "function" == typeof t.inputControllerDidRequestRender ? t.inputControllerDidRequestRender() : void 0;n }, r.prototype.requestReparse = function () {n var t;n return null != (t = this.delegate) && "function" == typeof t.inputControllerDidRequestReparse && t.inputControllerDidRequestReparse(), this.requestRender();n }, r.prototype.attachFiles = function (t) {n var n, i;n return i = function () {n var i, o, r;nn for (r = [], i = 0, o = t.length; o > i; i++) {n n = t, r.push(new e.FileVerificationOperation(n));n }nn return r;n }(), Promise.all(i).then(function (t) {n return function (e) {n return t.handleInput(function () {n var t, n;n return null != (t = this.delegate) && t.inputControllerWillAttachFiles(), null != (n = this.responder) && n.insertFiles(e), this.requestRender();n });n };n }(this));n }, r.prototype.handlerFor = function (t) {n return function (e) {n return function (i) {n return i.defaultPrevented ? void 0 : e.handleInput(function () {n return n(this.element) ? void 0 : (this.eventName = t, this.events.call(this, i));n });n };n }(this);n }, r.prototype.handleInput = function (t) {n var e, n;nn try {n return null != (e = this.delegate) && e.inputControllerWillHandleInput(), t.call(this);n } finally {n null != (n = this.delegate) && n.inputControllerDidHandleInput();n }n }, r;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a,n u,n c,n l,n h,n p,n d,n f = function f(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n g.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n g = {}.hasOwnProperty,n m = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn c = e.makeElement, l = e.objectsAreEqual, d = e.tagName, n = e.browser, a = e.keyEventIsKeyboardCommand, o = e.dataTransferIsWritable, i = e.dataTransferIsPlainText, u = e.config.keyNames, e.Level0InputController = function (n) {n function s() {n s.__super__.constructor.apply(this, arguments), this.resetInputSummary();n }nn var d;n return f(s, n), d = 0, s.prototype.setInputSummary = function (t) {n var e, n;n null == t && (t = {}), this.inputSummary.eventName = this.eventName;nn for (e in t) {n n = t, this.inputSummary = n;n }nn return this.inputSummary;n }, s.prototype.resetInputSummary = function () {n return this.inputSummary = {};n }, s.prototype.reset = function () {n return this.resetInputSummary(), e.selectionChangeObserver.reset();n }, s.prototype.elementDidMutate = function (t) {n var e;n return this.isComposing() ? null != (e = this.delegate) && "function" == typeof e.inputControllerDidAllowUnhandledInput ? e.inputControllerDidAllowUnhandledInput() : void 0 : this.handleInput(function () {n return this.mutationIsSignificant(t) && (this.mutationIsExpected(t) ? this.requestRender() : this.requestReparse()), this.reset();n });n }, s.prototype.mutationIsExpected = function (t) {n var e, n, i, o, r, s, a, u, c, l;n return a = t.textAdded, u = t.textDeleted, this.inputSummary.preferDocument ? !0 : (e = null != a ? a === this.inputSummary.textAdded : !this.inputSummary.textAdded, n = null != u ? this.inputSummary.didDelete : !this.inputSummary.didDelete, c = ("\n" === a || " \n" === a) && !e, l = "\n" === u && !n, s = c && !l || l && !c, s && (o = this.getSelectedRange()) && (i = c ? a.replace(/\n$/, "").length || -1 : (null != a ? a.length : void 0) || 1, null != (r = this.responder) ? r.positionIsBlockBreak(o + i) : void 0) ? !0 : e && n);n }, s.prototype.mutationIsSignificant = function (t) {n var e, n, i;n return i = Object.keys(t).length > 0, e = "" === (null != (n = this.compositionInput) ? n.getEndData() : void 0), i || !e;n }, s.prototype.events = {n keydown: function keydown(t) {n var n, i, o, r, s, c, l, h, p;nn if (this.isComposing() || this.resetInputSummary(), this.inputSummary.didInput = !0, r = u) {n for (i = this.keys, h = ["ctrl", "alt", "shift", "meta"], o = 0, c = h.length; c > o; o++) {n l = h, t[l + "Key"] && ("ctrl" === l && (l = "control"), i = null != i ? i : void 0);n }nn null != (null != i ? i : void 0) && (this.setInputSummary({n keyName: rn }), e.selectionChangeObserver.reset(), i.call(this, t));n }nn return a(t) && (n = String.fromCharCode(t.keyCode).toLowerCase()) && (s = function () {n var e, n, i, o;nn for (i = ["alt", "shift"], o = [], e = 0, n = i.length; n > e; e++) {n l = i, t[l + "Key"] && o.push(l);n }nn return o;n }(), s.push(n), null != (p = this.delegate) ? p.inputControllerDidReceiveKeyboardCommand(s) : void 0) ? t.preventDefault() : void 0;n },n keypress: function keypress(t) {n var e, n, i;n if (null == this.inputSummary.eventName && !t.metaKey && (!t.ctrlKey || t.altKey)) return (i = p(t)) ? (null != (e = this.delegate) && e.inputControllerWillPerformTyping(), null != (n = this.responder) && n.insertString(i), this.setInputSummary({n textAdded: i,n didDelete: this.selectionIsExpanded()n })) : void 0;n },n textInput: function textInput(t) {n var e, n, i, o;n return e = t.data, o = this.inputSummary.textAdded, o && o !== e && o.toUpperCase() === e ? (n = this.getSelectedRange(), this.setSelectedRange([n, n + o.length]), null != (i = this.responder) && i.insertString(e), this.setInputSummary({n textAdded: en }), this.setSelectedRange(n)) : void 0;n },n dragenter: function dragenter(t) {n return t.preventDefault();n },n dragstart: function dragstart(t) {n var e, n;n return n = t.target, this.serializeSelectionToDataTransfer(t.dataTransfer), this.draggedRange = this.getSelectedRange(), null != (e = this.delegate) && "function" == typeof e.inputControllerDidStartDrag ? e.inputControllerDidStartDrag() : void 0;n },n dragover: function dragover(t) {n var e, n;n return !this.draggedRange && !this.canAcceptDataTransfer(t.dataTransfer) || (t.preventDefault(), e = {n x: t.clientX,n y: t.clientYn }, l(e, this.draggingPoint)) ? void 0 : (this.draggingPoint = e, null != (n = this.delegate) && "function" == typeof n.inputControllerDidReceiveDragOverPoint ? n.inputControllerDidReceiveDragOverPoint(this.draggingPoint) : void 0);n },n dragend: function dragend() {n var t;n return null != (t = this.delegate) && "function" == typeof t.inputControllerDidCancelDrag && t.inputControllerDidCancelDrag(), this.draggedRange = null, this.draggingPoint = null;n },n drop: function drop(t) {n var n, i, o, r, s, a, u, c, l;n return t.preventDefault(), o = null != (s = t.dataTransfer) ? s.files : void 0, r = {n x: t.clientX,n y: t.clientYn }, null != (a = this.responder) && a.setLocationRangeFromPointRange®, (null != o ? o.length : void 0) ? this.attachFiles(o) : this.draggedRange ? (null != (u = this.delegate) && u.inputControllerWillMoveText(), null != (c = this.responder) && c.moveTextFromRange(this.draggedRange), this.draggedRange = null, this.requestRender()) : (i = t.dataTransfer.getData("application/x-trix-document")) && (n = e.Document.fromJSONString(i), null != (l = this.responder) && l.insertDocument(n), this.requestRender()), this.draggedRange = null, this.draggingPoint = null;n },n cut: function cut(t) {n var e, n;n return (null != (e = this.responder) ? e.selectionIsExpanded() : void 0) && (this.serializeSelectionToDataTransfer(t.clipboardData) && t.preventDefault(), null != (n = this.delegate) && n.inputControllerWillCutText(), this.deleteInDirection("backward"), t.defaultPrevented) ? this.requestRender() : void 0;n },n copy: function copy(t) {n var e;n return (null != (e = this.responder) ? e.selectionIsExpanded() : void 0) && this.serializeSelectionToDataTransfer(t.clipboardData) ? t.preventDefault() : void 0;n },n paste: function paste(t) {n var n, o, s, a, u, c, l, p, f, g, v, y, b, A, C, x, w, E, S, R, k, D;n return n = null != (p = t.clipboardData) ? p : t.testClipboardData, l = {n clipboard: nn }, null == n || h(t) ? void this.getPastedHTMLUsingHiddenElement(function (t) {n return function (e) {n var n, i, o;n return l.type = "text/html", l.html = e, null != (n = t.delegate) && n.inputControllerWillPaste(l), null != (i = t.responder) && i.insertHTML(l.html), t.requestRender(), null != (o = t.delegate) ? o.inputControllerDidPaste(l) : void 0;n };n }(this)) : ((a = n.getData("URL")) ? (l.type = "URL", l.href = a, l.string = (c = n.getData("public.url-name")) ? e.squishBreakableWhitespace©.trim() : a, null != (f = this.delegate) && f.inputControllerWillPaste(l), this.setInputSummary({n textAdded: l.string,n didDelete: this.selectionIsExpanded()n }), null != (C = this.responder) && C.insertText(e.Text.textForStringWithAttributes(l.string, {n href: l.hrefn })), this.requestRender(), null != (x = this.delegate) && x.inputControllerDidPaste(l)) : i(n) ? (l.type = "text/plain", l.string = n.getData("text/plain"), null != (w = this.delegate) && w.inputControllerWillPaste(l), this.setInputSummary({n textAdded: l.string,n didDelete: this.selectionIsExpanded()n }), null != (E = this.responder) && E.insertString(l.string), this.requestRender(), null != (S = this.delegate) && S.inputControllerDidPaste(l)) : (u = n.getData("text/html")) ? (l.type = "text/html", l.html = u, null != (R = this.delegate) && R.inputControllerWillPaste(l), null != (k = this.responder) && k.insertHTML(l.html), this.requestRender(), null != (D = this.delegate) && D.inputControllerDidPaste(l)) : m.call(n.types, "Files") >= 0 && (s = null != (g = n.items) && null != (v = g) && "function" == typeof v.getAsFile ? v.getAsFile() : void 0) && (!s.name && (o = r(s)) && (s.name = "pasted-file-" + ++d + "." + o), l.type = "File", l.file = s, null != (y = this.delegate) && y.inputControllerWillAttachFiles(), null != (b = this.responder) && b.insertFile(l.file), this.requestRender(), null != (A = this.delegate) && A.inputControllerDidPaste(l)), t.preventDefault());n },n compositionstart: function compositionstart(t) {n return this.getCompositionInput().start(t.data);n },n compositionupdate: function compositionupdate(t) {n return this.getCompositionInput().update(t.data);n },n compositionend: function compositionend(t) {n return this.getCompositionInput().end(t.data);n },n beforeinput: function beforeinput() {n return this.inputSummary.didInput = !0;n },n input: function input(t) {n return this.inputSummary.didInput = !0, t.stopPropagation();n }n }, s.prototype.keys = {n backspace: function backspace(t) {n var e;n return null != (e = this.delegate) && e.inputControllerWillPerformTyping(), this.deleteInDirection("backward", t);n },n "delete": function _delete(t) {n var e;n return null != (e = this.delegate) && e.inputControllerWillPerformTyping(), this.deleteInDirection("forward", t);n },n "return": function _return() {n var t, e;n return this.setInputSummary({n preferDocument: !0n }), null != (t = this.delegate) && t.inputControllerWillPerformTyping(), null != (e = this.responder) ? e.insertLineBreak() : void 0;n },n tab: function tab(t) {n var e, n;n return (null != (e = this.responder) ? e.canIncreaseNestingLevel() : void 0) ? (null != (n = this.responder) && n.increaseNestingLevel(), this.requestRender(), t.preventDefault()) : void 0;n },n left: function left(t) {n var e;n return this.selectionIsInCursorTarget() ? (t.preventDefault(), null != (e = this.responder) ? e.moveCursorInDirection("backward") : void 0) : void 0;n },n right: function right(t) {n var e;n return this.selectionIsInCursorTarget() ? (t.preventDefault(), null != (e = this.responder) ? e.moveCursorInDirection("forward") : void 0) : void 0;n },n control: {n d: function d(t) {n var e;n return null != (e = this.delegate) && e.inputControllerWillPerformTyping(), this.deleteInDirection("forward", t);n },n h: function h(t) {n var e;n return null != (e = this.delegate) && e.inputControllerWillPerformTyping(), this.deleteInDirection("backward", t);n },n o: function o(t) {n var e, n;n return t.preventDefault(), null != (e = this.delegate) && e.inputControllerWillPerformTyping(), null != (n = this.responder) && n.insertString("\n", {n updatePosition: !1n }), this.requestRender();n }n },n shift: {n "return": function _return(t) {n var e, n;n return null != (e = this.delegate) && e.inputControllerWillPerformTyping(), null != (n = this.responder) && n.insertString("\n"), this.requestRender(), t.preventDefault();n },n tab: function tab(t) {n var e, n;n return (null != (e = this.responder) ? e.canDecreaseNestingLevel() : void 0) ? (null != (n = this.responder) && n.decreaseNestingLevel(), this.requestRender(), t.preventDefault()) : void 0;n },n left: function left(t) {n return this.selectionIsInCursorTarget() ? (t.preventDefault(), this.expandSelectionInDirection("backward")) : void 0;n },n right: function right(t) {n return this.selectionIsInCursorTarget() ? (t.preventDefault(), this.expandSelectionInDirection("forward")) : void 0;n }n },n alt: {n backspace: function backspace() {n var t;n return this.setInputSummary({n preferDocument: !1n }), null != (t = this.delegate) ? t.inputControllerWillPerformTyping() : void 0;n }n },n meta: {n backspace: function backspace() {n var t;n return this.setInputSummary({n preferDocument: !1n }), null != (t = this.delegate) ? t.inputControllerWillPerformTyping() : void 0;n }n }n }, s.prototype.getCompositionInput = function () {n return this.isComposing() ? this.compositionInput : this.compositionInput = new t(this);n }, s.prototype.isComposing = function () {n return null != this.compositionInput && !this.compositionInput.isEnded();n }, s.prototype.deleteInDirection = function (t, e) {n var n;n return (null != (n = this.responder) ? n.deleteInDirection(t) : void 0) !== !1 ? this.setInputSummary({n didDelete: !0n }) : e ? (e.preventDefault(), this.requestRender()) : void 0;n }, s.prototype.serializeSelectionToDataTransfer = function (t) {n var n, i;n if (o(t)) return n = null != (i = this.responder) ? i.getSelectedDocument().toSerializableDocument() : void 0, t.setData("application/x-trix-document", JSON.stringify(n)), t.setData("text/html", e.DocumentView.render(n).innerHTML), t.setData("text/plain", n.toString().replace(/\n$/, "")), !0;n }, s.prototype.canAcceptDataTransfer = function (t) {n var e, n, i, o, r, s;nn for (s = {}, o = null != (i = null != t ? t.types : void 0) ? i : [], e = 0, n = o.length; n > e; e++) {n r = o, s = !0;n }nn return s.Files || s || s || s;n }, s.prototype.getPastedHTMLUsingHiddenElement = function (t) {n var n, i, o;n return i = this.getSelectedRange(), o = {n position: "absolute",n left: window.pageXOffset + "px",n top: window.pageYOffset + "px",n opacity: 0n }, n = c({n style: o,n tagName: "div",n editable: !0n }), document.body.appendChild(n), n.focus(), requestAnimationFrame(function (o) {n return function () {n var r;n return r = n.innerHTML, e.removeNode(n), o.setSelectedRange(i), t®;n };n }(this));n }, s.proxyMethod("responder?.getSelectedRange"), s.proxyMethod("responder?.setSelectedRange"), s.proxyMethod("responder?.expandSelectionInDirection"), s.proxyMethod("responder?.selectionIsInCursorTarget"), s.proxyMethod("responder?.selectionIsExpanded"), s;n }(e.InputController), r = function r(t) {n var e, n;n return null != (e = t.type) && null != (n = e.match(/\/(\w+)$/)) ? n : void 0;n }, s = null != ("function" == typeof " ".codePointAt ? " ".codePointAt(0) : void 0), p = function p(t) {n var n;n return t.key && s && t.key.codePointAt(0) === t.keyCode ? t.key : (null === t.which ? n = t.keyCode : 0 !== t.which && 0 !== t.charCode && (n = t.charCode), null != n && "escape" !== u ? e.UTF16String.fromCodepoints().toString() : void 0);n }, h = function h(t) {n var e, n, i, o, r, s, a, u, c, l;nn if (u = t.clipboardData) {n if (m.call(u.types, "text/html") >= 0) {n for (c = u.types, i = 0, s = c.length; s > i; i++) {n if (l = c, e = /^CorePasteboardFlavorType/.test(l), n = /^dyn\./.test(l) && u.getData(l), a = e || n) return !0;n }nn return !1;n }nn return o = m.call(u.types, "com.apple.webarchive") >= 0, r = m.call(u.types, "com.apple.flat-rtfd") >= 0, o || r;n }n }, t = function (t) {n function e(t) {n var e;n this.inputController = t, e = this.inputController, this.responder = e.responder, this.delegate = e.delegate, this.inputSummary = e.inputSummary, this.data = {};n }nn return f(e, t), e.prototype.start = function (t) {n var e, n;n return this.data.start = t, this.isSignificant() ? ("keypress" === this.inputSummary.eventName && this.inputSummary.textAdded && null != (e = this.responder) && e.deleteInDirection("left"), this.selectionIsExpanded() || (this.insertPlaceholder(), this.requestRender()), this.range = null != (n = this.responder) ? n.getSelectedRange() : void 0) : void 0;n }, e.prototype.update = function (t) {n var e;n return this.data.update = t, this.isSignificant() && (e = this.selectPlaceholder()) ? (this.forgetPlaceholder(), this.range = e) : void 0;n }, e.prototype.end = function (t) {n var e, n, i, o;n return this.data.end = t, this.isSignificant() ? (this.forgetPlaceholder(), this.canApplyToDocument() ? (this.setInputSummary({n preferDocument: !0,n didInput: !1n }), null != (e = this.delegate) && e.inputControllerWillPerformTyping(), null != (n = this.responder) && n.setSelectedRange(this.range), null != (i = this.responder) && i.insertString(this.data.end), null != (o = this.responder) ? o.setSelectedRange(this.range + this.data.end.length) : void 0) : null != this.data.start || null != this.data.update ? (this.requestReparse(), this.inputController.reset()) : void 0) : this.inputController.reset();n }, e.prototype.getEndData = function () {n return this.data.end;n }, e.prototype.isEnded = function () {n return null != this.getEndData();n }, e.prototype.isSignificant = function () {n return n.composesExistingText ? this.inputSummary.didInput : !0;n }, e.prototype.canApplyToDocument = function () {n var t, e;n return 0 === (null != (t = this.data.start) ? t.length : void 0) && (null != (e = this.data.end) ? e.length : void 0) > 0 && null != this.range;n }, e.proxyMethod("inputController.setInputSummary"), e.proxyMethod("inputController.requestRender"), e.proxyMethod("inputController.requestReparse"), e.proxyMethod("responder?.selectionIsExpanded"), e.proxyMethod("responder?.insertPlaceholder"), e.proxyMethod("responder?.selectPlaceholder"), e.proxyMethod("responder?.forgetPlaceholder"), e;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n return function () {n return t.apply(e, arguments);n };n },n r = function r(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n s.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n s = {}.hasOwnProperty,n a = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = e.dataTransferIsPlainText, n = e.keyEventIsKeyboardCommand, i = e.objectsAreEqual, e.Level2InputController = function (s) {n function u() {n return this.render = o(this.render, this), u.__super__.constructor.apply(this, arguments);n }nn var c, l, h, p, d, f;n return r(u, s), u.prototype.elementDidMutate = function () {n var t;n return this.scheduledRender ? this.composing && null != (t = this.delegate) && "function" == typeof t.inputControllerDidAllowUnhandledInput ? t.inputControllerDidAllowUnhandledInput() : void 0 : this.reparse();n }, u.prototype.scheduleRender = function () {n return null != this.scheduledRender ? this.scheduledRender : this.scheduledRender = requestAnimationFrame(this.render);n }, u.prototype.render = function () {n var t;n return cancelAnimationFrame(this.scheduledRender), this.scheduledRender = null, this.composing || null != (t = this.delegate) && t.render(), "function" == typeof this.afterRender && this.afterRender(), this.afterRender = null;n }, u.prototype.reparse = function () {n var t;n return null != (t = this.delegate) ? t.reparse() : void 0;n }, u.prototype.events = {n keydown: function keydown(t) {n var e, i, o, r;nn if (n(t)) {n if (e = l(t), null != (r = this.delegate) ? r.inputControllerDidReceiveKeyboardCommand(e) : void 0) return t.preventDefault();n } else if (o = t.key, t.altKey && (o += "+Alt"), t.shiftKey && (o += "+Shift"), i = this.keys) return this.withEvent(t, i);n },n paste: function paste(t) {n var n, i, o, r, s, a, u, c, l;n return h(t) ? (t.preventDefault(), this.attachFiles(t.clipboardData.files)) : p(t) ? (t.preventDefault(), i = {n type: "text/plain",n string: t.clipboardData.getData("text/plain")n }, null != (o = this.delegate) && o.inputControllerWillPaste(i), null != (r = this.responder) && r.insertString(i.string), this.render(), null != (s = this.delegate) ? s.inputControllerDidPaste(i) : void 0) : (n = null != (a = t.clipboardData) ? a.getData("URL") : void 0) ? (t.preventDefault(), i = {n type: "URL",n href: n,n string: nn }, null != (u = this.delegate) && u.inputControllerWillPaste(i), null != (c = this.responder) && c.insertText(e.Text.textForStringWithAttributes(i.string, {n href: i.hrefn })), this.render(), null != (l = this.delegate) ? l.inputControllerDidPaste(i) : void 0) : void 0;n },n beforeinput: function beforeinput(t) {n var e;n return (e = this.inputTypes) ? (this.withEvent(t, e), this.scheduleRender()) : void 0;n },n input: function input() {n return e.selectionChangeObserver.reset();n },n dragstart: function dragstart(t) {n var e, n;n return (null != (e = this.responder) ? e.selectionContainsAttachments() : void 0) ? (t.dataTransfer.setData("application/x-trix-dragging", !0), this.dragging = {n range: null != (n = this.responder) ? n.getSelectedRange() : void 0,n point: d(t)n }) : void 0;n },n dragenter: function dragenter(t) {n return c(t) ? t.preventDefault() : void 0;n },n dragover: function dragover(t) {n var e, n;n return this.dragging && (t.preventDefault(), e = d(t), !i(e, this.dragging.point)) ? (this.dragging.point = e, null != (n = this.responder) ? n.setLocationRangeFromPointRange(e) : void 0) : void 0;n },n drop: function drop(t) {n var e, n, i, o;n return this.dragging ? (t.preventDefault(), null != (n = this.delegate) && n.inputControllerWillMoveText(), null != (i = this.responder) && i.moveTextFromRange(this.dragging.range), this.dragging = null, this.scheduleRender()) : c(t) ? (t.preventDefault(), e = d(t), null != (o = this.responder) && o.setLocationRangeFromPointRange(e), this.attachFiles(t.dataTransfer.files)) : void 0;n },n dragend: function dragend() {n var t;n return this.dragging ? (null != (t = this.responder) && t.setSelectedRange(this.dragging.range), this.dragging = null) : void 0;n },n compositionend: function compositionend() {n return this.composing ? (this.composing = !1, this.scheduleRender()) : void 0;n }n }, u.prototype.keys = {n ArrowLeft: function ArrowLeft() {n var t, e;n return (null != (t = this.responder) ? t.shouldManageMovingCursorInDirection("backward") : void 0) ? (this.event.preventDefault(), null != (e = this.responder) ? e.moveCursorInDirection("backward") : void 0) : void 0;n },n ArrowRight: function ArrowRight() {n var t, e;n return (null != (t = this.responder) ? t.shouldManageMovingCursorInDirection("forward") : void 0) ? (this.event.preventDefault(), null != (e = this.responder) ? e.moveCursorInDirection("forward") : void 0) : void 0;n },n Backspace: function Backspace() {n var t, e, n;n return (null != (t = this.responder) ? t.shouldManageDeletingInDirection("backward") : void 0) ? (this.event.preventDefault(), null != (e = this.delegate) && e.inputControllerWillPerformTyping(), null != (n = this.responder) && n.deleteInDirection("backward"), this.render()) : void 0;n },n Tab: function Tab() {n var t, e;n return (null != (t = this.responder) ? t.canIncreaseNestingLevel() : void 0) ? (this.event.preventDefault(), null != (e = this.responder) && e.increaseNestingLevel(), this.render()) : void 0;n },n "Tab+Shift": function TabShift() {n var t, e;n return (null != (t = this.responder) ? t.canDecreaseNestingLevel() : void 0) ? (this.event.preventDefault(), null != (e = this.responder) && e.decreaseNestingLevel(), this.render()) : void 0;n }n }, u.prototype.inputTypes = {n deleteByComposition: function deleteByComposition() {n return this.deleteInDirection("backward", {n recordUndoEntry: !1n });n },n deleteByCut: function deleteByCut() {n return this.deleteInDirection("backward");n },n deleteByDrag: function deleteByDrag() {n return this.event.preventDefault(), this.withTargetDOMRange(function () {n var t;n return this.deleteByDragRange = null != (t = this.responder) ? t.getSelectedRange() : void 0;n });n },n deleteCompositionText: function deleteCompositionText() {n return this.deleteInDirection("backward", {n recordUndoEntry: !1n });n },n deleteContent: function deleteContent() {n return this.deleteInDirection("backward");n },n deleteContentBackward: function deleteContentBackward() {n return this.deleteInDirection("backward");n },n deleteContentForward: function deleteContentForward() {n return this.deleteInDirection("forward");n },n deleteEntireSoftLine: function deleteEntireSoftLine() {n return this.deleteInDirection("forward");n },n deleteHardLineBackward: function deleteHardLineBackward() {n return this.deleteInDirection("backward");n },n deleteHardLineForward: function deleteHardLineForward() {n return this.deleteInDirection("forward");n },n deleteSoftLineBackward: function deleteSoftLineBackward() {n return this.deleteInDirection("backward");n },n deleteSoftLineForward: function deleteSoftLineForward() {n return this.deleteInDirection("forward");n },n deleteWordBackward: function deleteWordBackward() {n return this.deleteInDirection("backward");n },n deleteWordForward: function deleteWordForward() {n return this.deleteInDirection("forward");n },n formatBackColor: function formatBackColor() {n return this.activateAttributeIfSupported("backgroundColor", this.event.data);n },n formatBold: function formatBold() {n return this.toggleAttributeIfSupported("bold");n },n formatFontColor: function formatFontColor() {n return this.activateAttributeIfSupported("color", this.event.data);n },n formatFontName: function formatFontName() {n return this.activateAttributeIfSupported("font", this.event.data);n },n formatIndent: function formatIndent() {n var t;n return (null != (t = this.responder) ? t.canIncreaseNestingLevel() : void 0) ? this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.increaseNestingLevel() : void 0;n }) : void 0;n },n formatItalic: function formatItalic() {n return this.toggleAttributeIfSupported("italic");n },n formatJustifyCenter: function formatJustifyCenter() {n return this.toggleAttributeIfSupported("justifyCenter");n },n formatJustifyFull: function formatJustifyFull() {n return this.toggleAttributeIfSupported("justifyFull");n },n formatJustifyLeft: function formatJustifyLeft() {n return this.toggleAttributeIfSupported("justifyLeft");n },n formatJustifyRight: function formatJustifyRight() {n return this.toggleAttributeIfSupported("justifyRight");n },n formatOutdent: function formatOutdent() {n var t;n return (null != (t = this.responder) ? t.canDecreaseNestingLevel() : void 0) ? this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.decreaseNestingLevel() : void 0;n }) : void 0;n },n formatRemove: function formatRemove() {n return this.withTargetDOMRange(function () {n var t, e, n, i;n i = [];nn for (t in null != (e = this.responder) ? e.getCurrentAttributes() : void 0) {n i.push(null != (n = this.responder) ? n.removeCurrentAttribute(t) : void 0);n }nn return i;n });n },n formatSetBlockTextDirection: function formatSetBlockTextDirection() {n return this.activateAttributeIfSupported("blockDir", this.event.data);n },n formatSetInlineTextDirection: function formatSetInlineTextDirection() {n return this.activateAttributeIfSupported("textDir", this.event.data);n },n formatStrikeThrough: function formatStrikeThrough() {n return this.toggleAttributeIfSupported("strike");n },n formatSubscript: function formatSubscript() {n return this.toggleAttributeIfSupported("sub");n },n formatSuperscript: function formatSuperscript() {n return this.toggleAttributeIfSupported("sup");n },n formatUnderline: function formatUnderline() {n return this.toggleAttributeIfSupported("underline");n },n historyRedo: function historyRedo() {n var t;n return null != (t = this.delegate) ? t.inputControllerWillPerformRedo() : void 0;n },n historyUndo: function historyUndo() {n var t;n return null != (t = this.delegate) ? t.inputControllerWillPerformUndo() : void 0;n },n insertCompositionText: function insertCompositionText() {n return this.composing = !0, this.insertString(this.event.data);n },n insertFromComposition: function insertFromComposition() {n return this.composing = !1, this.insertString(this.event.data);n },n insertFromDrop: function insertFromDrop() {n var t, e;n return (t = this.deleteByDragRange) ? (this.deleteByDragRange = null, null != (e = this.delegate) && e.inputControllerWillMoveText(), this.withTargetDOMRange(function () {n var e;n return null != (e = this.responder) ? e.moveTextFromRange(t) : void 0;n })) : void 0;n },n insertFromPaste: function insertFromPaste() {n var n, i, o, r, s, a, u, c, l, h;n return n = this.event.dataTransfer, s = {n dataTransfer: nn }, (i = n.getData("URL")) ? (s.type = "URL", s.href = i, s.string = (r = n.getData("public.url-name")) ? e.squishBreakableWhitespace®.trim() : i, null != (a = this.delegate) && a.inputControllerWillPaste(s), this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.insertText(e.Text.textForStringWithAttributes(s.string, {n href: s.hrefn })) : void 0;n }), this.afterRender = function (t) {n return function () {n var e;n return null != (e = t.delegate) ? e.inputControllerDidPaste(s) : void 0;n };n }(this)) : t(n) ? (s.type = "text/plain", s.string = n.getData("text/plain"), null != (u = this.delegate) && u.inputControllerWillPaste(s), this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.insertString(s.string) : void 0;n }), this.afterRender = function (t) {n return function () {n var e;n return null != (e = t.delegate) ? e.inputControllerDidPaste(s) : void 0;n };n }(this)) : (o = n.getData("text/html")) ? (s.type = "text/html", s.html = o, null != (c = this.delegate) && c.inputControllerWillPaste(s), this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.insertHTML(s.html) : void 0;n }), this.afterRender = function (t) {n return function () {n var e;n return null != (e = t.delegate) ? e.inputControllerDidPaste(s) : void 0;n };n }(this)) : (null != (l = n.files) ? l.length : void 0) ? (s.type = "File", s.file = n.files, null != (h = this.delegate) && h.inputControllerWillPaste(s), this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.insertFile(s.file) : void 0;n }), this.afterRender = function (t) {n return function () {n var e;n return null != (e = t.delegate) ? e.inputControllerDidPaste(s) : void 0;n };n }(this)) : void 0;n },n insertFromYank: function insertFromYank() {n return this.insertString(this.event.data);n },n insertLineBreak: function insertLineBreak() {n return this.insertString("\n");n },n insertLink: function insertLink() {n return this.activateAttributeIfSupported("href", this.event.data);n },n insertOrderedList: function insertOrderedList() {n return this.toggleAttributeIfSupported("number");n },n insertParagraph: function insertParagraph() {n var t;n return null != (t = this.delegate) && t.inputControllerWillPerformTyping(), this.withTargetDOMRange(function () {n var t;n return null != (t = this.responder) ? t.insertLineBreak() : void 0;n });n },n insertReplacementText: function insertReplacementText() {n return this.insertString(this.event.dataTransfer.getData("text/plain"), {n updatePosition: !1n });n },n insertText: function insertText() {n var t, e;n return this.insertString(null != (t = this.event.data) ? t : null != (e = this.event.dataTransfer) ? e.getData("text/plain") : void 0);n },n insertTranspose: function insertTranspose() {n return this.insertString(this.event.data);n },n insertUnorderedList: function insertUnorderedList() {n return this.toggleAttributeIfSupported("bullet");n }n }, u.prototype.insertString = function (t, e) {n var n;n return null == t && (t = ""), null != (n = this.delegate) && n.inputControllerWillPerformTyping(), this.withTargetDOMRange(function () {n var n;n return null != (n = this.responder) ? n.insertString(t, e) : void 0;n });n }, u.prototype.toggleAttributeIfSupported = function (t) {n var n;n return a.call(e.getAllAttributeNames(), t) >= 0 ? (null != (n = this.delegate) && n.inputControllerWillPerformFormatting(t), this.withTargetDOMRange(function () {n var e;n return null != (e = this.responder) ? e.toggleCurrentAttribute(t) : void 0;n })) : void 0;n }, u.prototype.activateAttributeIfSupported = function (t, n) {n var i;n return a.call(e.getAllAttributeNames(), t) >= 0 ? (null != (i = this.delegate) && i.inputControllerWillPerformFormatting(t), this.withTargetDOMRange(function () {n var e;n return null != (e = this.responder) ? e.setCurrentAttribute(t, n) : void 0;n })) : void 0;n }, u.prototype.deleteInDirection = function (t, e) {n var n, i, o, r;n return o = (null != e ? e : {n recordUndoEntry: !0n }).recordUndoEntry, o && null != (r = this.delegate) && r.inputControllerWillPerformTyping(), i = function (e) {n return function () {n var n;n return null != (n = e.responder) ? n.deleteInDirection(t) : void 0;n };n }(this), (n = this.getTargetDOMRange({n minLength: 2n })) ? this.withTargetDOMRange(n, i) : i();n }, u.prototype.withTargetDOMRange = function (t, n) {n var i;n return "function" == typeof t && (n = t, t = this.getTargetDOMRange()), t ? null != (i = this.responder) ? i.withTargetDOMRange(t, n.bind(this)) : void 0 : (e.selectionChangeObserver.reset(), n.call(this));n }, u.prototype.getTargetDOMRange = function (t) {n var e, n, i, o;n return i = (null != t ? t : {n minLength: 0n }).minLength, (o = "function" == typeof (e = this.event).getTargetRanges ? e.getTargetRanges() : void 0) && o.length && (n = f(o), 0 === i || n.toString().length >= i) ? n : void 0;n }, f = function f(t) {n var e;n return e = document.createRange(), e.setStart(t.startContainer, t.startOffset), e.setEnd(t.endContainer, t.endOffset), e;n }, u.prototype.withEvent = function (t, e) {n var n;n this.event = t;nn try {n n = e.call(this);n } finally {n this.event = null;n }nn return n;n }, c = function c(t) {n var e, n;n return a.call(null != (e = null != (n = t.dataTransfer) ? n.types : void 0) ? e : [], "Files") >= 0;n }, h = function h(t) {n var e;n return (e = t.clipboardData) ? a.call(e.types, "Files") >= 0 && 1 === e.types.length && e.files.length >= 1 : void 0;n }, p = function p(t) {n var e;n return (e = t.clipboardData) ? a.call(e.types, "text/plain") >= 0 && 1 === e.types.length : void 0;n }, l = function l(t) {n var e;n return e = [], t.altKey && e.push("alt"), t.shiftKey && e.push("shift"), e.push(t.key), e;n }, d = function d(t) {n return {n x: t.clientX,n y: t.clientYn };n }, u;n }(e.InputController);n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a,n u,n c,n l = function l(t, e) {n return function () {n return t.apply(e, arguments);n };n },n h = function h(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n p.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n p = {}.hasOwnProperty;nn n = e.defer, i = e.escapeHTML, o = e.handleEvent, a = e.makeElement, c = e.tagName, u = e.config, s = u.lang, t = u.css, r = u.keyNames, e.AttachmentEditorController = function (u) {n function p(t, e, n, i) {n this.attachmentPiece = t, this.element = e, this.container = n, this.options = null != i ? i : {}, this.didBlurCaption = l(this.didBlurCaption, this), this.didChangeCaption = l(this.didChangeCaption, this), this.didInputCaption = l(this.didInputCaption, this), this.didKeyDownCaption = l(this.didKeyDownCaption, this), this.didClickActionButton = l(this.didClickActionButton, this), this.didClickToolbar = l(this.didClickToolbar, this), this.attachment = this.attachmentPiece.attachment, "a" === c(this.element) && (this.element = this.element.firstChild), this.install();n }nn var d;n return h(p, u), d = function d(t) {n return function () {n var e;n return e = t.apply(this, arguments), e(), null == this.undos && (this.undos = []), this.undos.push(e.undo);n };n }, p.prototype.install = function () {n return this.makeElementMutable(), this.addToolbar(), this.attachment.isPreviewable() ? this.installCaptionEditor() : void 0;n }, p.prototype.uninstall = function () {n var t, e;nn for (this.savePendingCaption(); e = this.undos.pop();) {n e();n }nn return null != (t = this.delegate) ? t.didUninstallAttachmentEditor(this) : void 0;n }, p.prototype.savePendingCaption = function () {n var t, e, n;n return null != this.pendingCaption ? (t = this.pendingCaption, this.pendingCaption = null, t ? null != (e = this.delegate) && "function" == typeof e.attachmentEditorDidRequestUpdatingAttributesForAttachment ? e.attachmentEditorDidRequestUpdatingAttributesForAttachment({n caption: tn }, this.attachment) : void 0 : null != (n = this.delegate) && "function" == typeof n.attachmentEditorDidRequestRemovingAttributeForAttachment ? n.attachmentEditorDidRequestRemovingAttributeForAttachment("caption", this.attachment) : void 0) : void 0;n }, p.prototype.makeElementMutable = d(function () {n return {n "do": function (t) {n return function () {n return t.element.dataset.trixMutable = !0;n };n }(this),n undo: function (t) {n return function () {n return delete t.element.dataset.trixMutable;n };n }(this)n };n }), p.prototype.addToolbar = d(function () {n var n, r, u;n return n = a({n tagName: "div",n className: t.attachmentToolbar,n data: {n trixMutable: !0n }n }), n.innerHTML = '<div class="trix-button-row">\n <span class="trix-button-group trix-button-group–actions">\n <button type="button" data-trix-action="remove" class="trix-button trix-button–remove" title="' + s.remove + '">' + s.remove + "</button>\n </span>\n</div>", this.attachment.isPreviewable() && (r = i(this.attachment.getFilename()), u = i(this.attachment.getFormattedFilesize()), n.innerHTML += '<div class="' + t.attachmentMetadataContainer + '">\n <span class="' + t.attachmentMetadata + '">\n <span class="' + t.attachmentName + '" title="' + r + '">' + r + '</span>\n <span class="' + t.attachmentSize + '">' + u + "</span>\n </span>\n</div>"), o("click", {n onElement: n,n withCallback: this.didClickToolbarn }), o("click", {n onElement: n,n matchingSelector: "[data-trix-action]",n withCallback: this.didClickActionButtonn }), {n "do": function (t) {n return function () {n return t.element.appendChild(n);n };n }(this),n undo: function () {n return function () {n return e.removeNode(n);n };n }(this)n };n }), p.prototype.installCaptionEditor = d(function () {n var i, r, u, c, l;n return c = a({n tagName: "textarea",n className: t.attachmentCaptionEditor,n attributes: {n placeholder: s.captionPlaceholdern },n data: {n trixMutable: !0n }n }), c.value = this.attachmentPiece.getCaption(), l = c.cloneNode(), l.classList.add("trix-autoresize-clone"), l.tabIndex = -1, i = function i() {n return l.value = c.value, c.style.height = l.scrollHeight + "px";n }, o("input", {n onElement: c,n withCallback: in }), o("input", {n onElement: c,n withCallback: this.didInputCaptionn }), o("keydown", {n onElement: c,n withCallback: this.didKeyDownCaptionn }), o("change", {n onElement: c,n withCallback: this.didChangeCaptionn }), o("blur", {n onElement: c,n withCallback: this.didBlurCaptionn }), u = this.element.querySelector("figcaption"), r = u.cloneNode(), {n "do": function (e) {n return function () {n return u.style.display = "none", r.appendChild©, r.appendChild(l), r.classList.add(t.attachmentCaption + "–editing"), u.parentElement.insertBefore(r, u), i(), e.options.editCaption ? n(function () {n return c.focus();n }) : void 0;n };n }(this),n undo: function undo() {n return e.removeNode®, u.style.display = null;n }n };n }), p.prototype.didClickToolbar = function (t) {n return t.preventDefault(), t.stopPropagation();n }, p.prototype.didClickActionButton = function (t) {n var e, n;nn switch (e = t.target.getAttribute("data-trix-action")) {n case "remove":n return null != (n = this.delegate) ? n.attachmentEditorDidRequestRemovalOfAttachment(this.attachment) : void 0;n }n }, p.prototype.didKeyDownCaption = function (t) {n var e;n return "return" === r ? (t.preventDefault(), this.savePendingCaption(), null != (e = this.delegate) && "function" == typeof e.attachmentEditorDidRequestDeselectingAttachment ? e.attachmentEditorDidRequestDeselectingAttachment(this.attachment) : void 0) : void 0;n }, p.prototype.didInputCaption = function (t) {n return this.pendingCaption = t.target.value.replace(/\s/g, " ").trim();n }, p.prototype.didChangeCaption = function () {n return this.savePendingCaption();n }, p.prototype.didBlurCaption = function () {n return this.savePendingCaption();n }, p;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n r.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n r = {}.hasOwnProperty;nn i = e.makeElement, t = e.config.css, e.AttachmentView = function ® {n function s() {n s.__super__.constructor.apply(this, arguments), this.attachment = this.object, this.attachment.uploadProgressDelegate = this, this.attachmentPiece = this.options.piece;n }nn var a;n return o(s, r), s.attachmentSelector = "[data-trix-attachment]", s.prototype.createContentNodes = function () {n return [];n }, s.prototype.createNodes = function () {n var e, n, o, r, s, u, c;n if (e = r = i({n tagName: "figure",n className: this.getClassName(),n data: this.getData(),n editable: !1n }), (n = this.getHref()) && (r = i({n tagName: "a",n editable: !1,n attributes: {n href: n,n tabindex: -1n }n }), e.appendChild®), this.attachment.hasContent()) r.innerHTML = this.attachment.getContent();else for (c = this.createContentNodes(), o = 0, s = c.length; s > o; o++) {n u = c, r.appendChild(u);n }n return r.appendChild(this.createCaptionElement()), this.attachment.isPending() && (this.progressElement = i({n tagName: "progress",n attributes: {n "class": t.attachmentProgress,n value: this.attachment.getUploadProgress(),n max: 100n },n data: {n trixMutable: !0,n trixStoreKey: ["progressElement", this.attachment.id].join("/")n }n }), e.appendChild(this.progressElement)), [a("left"), e, a("right")];n }, s.prototype.createCaptionElement = function () {n var e, n, o, r, s, a, u;n return o = i({n tagName: "figcaption",n className: t.attachmentCaptionn }), (e = this.attachmentPiece.getCaption()) ? (o.classList.add(t.attachmentCaption + "–edited"), o.textContent = e) : (n = this.getCaptionConfig(), n.name && (r = this.attachment.getFilename()), n.size && (a = this.attachment.getFormattedFilesize()), r && (s = i({n tagName: "span",n className: t.attachmentName,n textContent: rn }), o.appendChild(s)), a && (r && o.appendChild(document.createTextNode(" ")), u = i({n tagName: "span",n className: t.attachmentSize,n textContent: an }), o.appendChild(u))), o;n }, s.prototype.getClassName = function () {n var e, n;n return n = [t.attachment, t.attachment + "–" + this.attachment.getType()], (e = this.attachment.getExtension()) && n.push(t.attachment + "–" + e), n.join(" ");n }, s.prototype.getData = function () {n var t, e;n return e = {n trixAttachment: JSON.stringify(this.attachment),n trixContentType: this.attachment.getContentType(),n trixId: this.attachment.idn }, t = this.attachmentPiece.attributes, t.isEmpty() || (e.trixAttributes = JSON.stringify(t)), this.attachment.isPending() && (e.trixSerialize = !1), e;n }, s.prototype.getHref = function () {n return n(this.attachment.getContent(), "a") ? void 0 : this.attachment.getHref();n }, s.prototype.getCaptionConfig = function () {n var t, n, i;n return i = this.attachment.getType(), t = e.copyObject(null != (n = e.config.attachments) ? n.caption : void 0), "file" === i && (t.name = !0), t;n }, s.prototype.findProgressElement = function () {n var t;n return null != (t = this.findElement()) ? t.querySelector("progress") : void 0;n }, a = function a(t) {n return i({n tagName: "span",n textContent: e.ZERO_WIDTH_SPACE,n data: {n trixCursorTarget: t,n trixSerialize: !1n }n });n }, s.prototype.attachmentDidChangeUploadProgress = function () {n var t, e;n return e = this.attachment.getUploadProgress(), null != (t = this.findProgressElement()) ? t.value = e : void 0;n }, s;n }(e.ObjectView), n = function n(t, e) {n var n;n return n = i("div"), n.innerHTML = null != t ? t : "", n.querySelector(e);n };n }.call(this), function () {n var t,n n = function n(t, e) {n function n() {n this.constructor = t;n }nn for (var o in e) {n i.call(e, o) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n i = {}.hasOwnProperty;nn t = e.makeElement, e.PreviewableAttachmentView = function (i) {n function o() {n o.__super__.constructor.apply(this, arguments), this.attachment.previewDelegate = this;n }nn return n(o, i), o.prototype.createContentNodes = function () {n return this.image = t({n tagName: "img",n attributes: {n src: ""n },n data: {n trixMutable: !0n }n }), this.refresh(this.image), [this.image];n }, o.prototype.createCaptionElement = function () {n var t;n return t = o.__super__.createCaptionElement.apply(this, arguments), t.textContent || t.setAttribute("data-trix-placeholder", e.config.lang.captionPlaceholder), t;n }, o.prototype.refresh = function (t) {n var e;n return null == t && (t = null != (e = this.findElement()) ? e.querySelector("img") : void 0), t ? this.updateAttributesForImage(t) : void 0;n }, o.prototype.updateAttributesForImage = function (t) {n var e, n, i, o, r, s;n return r = this.attachment.getURL(), n = this.attachment.getPreviewURL(), t.src = n || r, n === r ? t.removeAttribute("data-trix-serialized-attributes") : (i = JSON.stringify({n src: rn }), t.setAttribute("data-trix-serialized-attributes", i)), s = this.attachment.getWidth(), e = this.attachment.getHeight(), null != s && (t.width = s), null != e && (t.height = e), o = ["imageElement", this.attachment.id, t.src, t.width, t.height].join("/"), t.dataset.trixStoreKey = o;n }, o.prototype.attachmentDidChangeAttributes = function () {n return this.refresh(this.image), this.refresh();n }, o;n }(e.AttachmentView);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n r.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n r = {}.hasOwnProperty;nn i = e.makeElement, t = e.findInnerElement, n = e.getTextConfig, e.PieceView = function ® {n function s() {n var t;n s.__super__.constructor.apply(this, arguments), this.piece = this.object, this.attributes = this.piece.getAttributes(), t = this.options, this.textConfig = t.textConfig, this.context = t.context, this.piece.attachment ? this.attachment = this.piece.attachment : this.string = this.piece.toString();n }nn var a;n return o(s, r), s.prototype.createNodes = function () {n var e, n, i, o, r, s;nn if (s = this.attachment ? this.createAttachmentNodes() : this.createStringNodes(), e = this.createElement()) {n for (i = t(e), n = 0, o = s.length; o > n; n++) {n r = s, i.appendChild®;n }nn s = [e];n }nn return s;n }, s.prototype.createAttachmentNodes = function () {n var t, n;n return t = this.attachment.isPreviewable() ? e.PreviewableAttachmentView : e.AttachmentView, n = this.createChildView(t, this.piece.attachment, {n piece: this.piecen }), n.getNodes();n }, s.prototype.createStringNodes = function () {n var t, e, n, o, r, s, a, u, c, l;n if (null != (u = this.textConfig) ? u.plaintext : void 0) return [document.createTextNode(this.string)];nn for (a = [], c = this.string.split("\n"), n = e = 0, o = c.length; o > e; n = ++e) {n l = c, n > 0 && (t = i("br"), a.push(t)), (r = l.length) && (s = document.createTextNode(this.preserveSpaces(l)), a.push(s));n }nn return a;n }, s.prototype.createElement = function () {n var t, e, o, r, s, a, u, c, l;n c = {}, a = this.attributes;nn for (r in a) {n if (l = a, (t = n®) && (t.tagName && (s = i(t.tagName), o ? (o.appendChild(s), o = s) : e = o = s), t.styleProperty && (c = l), t.style)) {n u = t.style;nn for (r in u) {n l = u, c = l;n }n }n }nn if (Object.keys©.length) {n null == e && (e = i("span"));nn for (r in c) {n l = c, e.style = l;n }n }nn return e;n }, s.prototype.createContainerElement = function () {n var t, e, o, r, s;n r = this.attributes;nn for (o in r) {n if (s = r, (e = n(o)) && e.groupTagName) return t = {}, t = s, i(e.groupTagName, t);n }n }, a = e.NON_BREAKING_SPACE, s.prototype.preserveSpaces = function (t) {n return this.context.isLast && (t = t.replace(/\ $/, a)), t = t.replace(/(\S)\ {3}(\S)/g, "$1 " + a + " $2").replace(/\ {2}/g, a + " ").replace(/\ {2}/g, " " + a), (this.context.isFirst || this.context.followsWhitespace) && (t = t.replace(/^\ /, a)), t;n }, s;n }(e.ObjectView);n }.call(this), function () {n var t = function t(_t12, e) {n function i() {n this.constructor = _t12;n }nn for (var o in e) {n n.call(e, o) && (_t12 = e);n }nn return i.prototype = e.prototype, _t12.prototype = new i(), t12._super__ = e.prototype, _t12;n },n n = {}.hasOwnProperty;nn e.TextView = function (n) {n function i() {n i.__super__.constructor.apply(this, arguments), this.text = this.object, this.textConfig = this.options.textConfig;n }nn var o;n return t(i, n), i.prototype.createNodes = function () {n var t, n, i, r, s, a, u, c, l, h;nn for (a = [], c = e.ObjectGroup.groupObjects(this.getPieces()), r = c.length - 1, i = n = 0, s = c.length; s > n; i = ++n) {n u = c, t = {}, 0 === i && (t.isFirst = !0), i === r && (t.isLast = !0), o(l) && (t.followsWhitespace = !0), h = this.findOrCreateCachedChildView(e.PieceView, u, {n textConfig: this.textConfig,n context: tn }), a.push.apply(a, h.getNodes()), l = u;n }nn return a;n }, i.prototype.getPieces = function () {n var t, e, n, i, o;nn for (i = this.text.getPieces(), o = [], t = 0, e = i.length; e > t; t++) {n n = i, n.hasAttribute("blockBreak") || o.push(n);n }nn return o;n }, o = function o(t) {n return /\s$/.test(null != t ? t.toString() : void 0);n }, i;n }(e.ObjectView);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n r.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n r = {}.hasOwnProperty;nn i = e.makeElement, n = e.getBlockConfig, t = e.config.css, e.BlockView = function ® {n function s() {n s.__super__.constructor.apply(this, arguments), this.block = this.object, this.attributes = this.block.getAttributes();n }nn return o(s, r), s.prototype.createNodes = function () {n var t, o, r, s, a, u, c, l, h;n if (t = document.createComment("block"), u = [t], this.block.isEmpty() ? u.push(i("br")) : (l = null != (c = n(this.block.getLastAttribute())) ? c.text : void 0, h = this.findOrCreateCachedChildView(e.TextView, this.block.text, {n textConfig: ln }), u.push.apply(u, h.getNodes()), this.shouldAddExtraNewlineElement() && u.push(i("br"))), this.attributes.length) return u;nn for (o = i(e.config.blockAttributes.tagName), r = 0, s = u.length; s > r; r++) {n a = u, o.appendChild(a);n }nn return [o];n }, s.prototype.createContainerElement = function (e) {n var o, r, s, a;n return o = this.attributes, a = n(o).tagName, r = {n tagName: an }, "attachmentGallery" === o && (s = this.block.getBlockBreakPosition(), r.className = t.attachmentGallery + " " + t.attachmentGallery + "–" + s), i®;n }, s.prototype.shouldAddExtraNewlineElement = function () {n return /\n\n$/.test(this.block.toString());n }, s;n }(e.ObjectView);n }.call(this), function () {n var t,n n,n i = function i(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n o.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n o = {}.hasOwnProperty;nn t = e.defer, n = e.makeElement, e.DocumentView = function (o) {n function r() {n r.__super__.constructor.apply(this, arguments), this.element = this.options.element, this.elementStore = new e.ElementStore(), this.setDocument(this.object);n }nn var s, a, u;n return i(r, o), r.render = function (t) {n var e, i;n return e = n("div"), i = new this(t, {n element: en }), i.render(), i.sync(), e;n }, r.prototype.setDocument = function (t) {n return t.isEqualTo(this.document) ? void 0 : this.document = this.object = t;n }, r.prototype.render = function () {n var t, i, o, r, s, a, u;nn if (this.childViews = [], this.shadowElement = n("div"), !this.document.isEmpty()) {n for (s = e.ObjectGroup.groupObjects(this.document.getBlocks(), {n asTree: !0n }), a = [], t = 0, i = s.length; i > t; t++) {n r = s, u = this.findOrCreateCachedChildView(e.BlockView, r), a.push(function () {n var t, e, n, i;nn for (n = u.getNodes(), i = [], t = 0, e = n.length; e > t; t++) {n o = n, i.push(this.shadowElement.appendChild(o));n }nn return i;n }.call(this));n }nn return a;n }n }, r.prototype.isSynced = function () {n return s(this.shadowElement, this.element);n }, r.prototype.sync = function () {n var t;nn for (t = this.createDocumentFragmentForSync(); this.element.lastChild;) {n this.element.removeChild(this.element.lastChild);n }nn return this.element.appendChild(t), this.didSync();n }, r.prototype.didSync = function () {n return this.elementStore.reset(a(this.element)), t(function (t) {n return function () {n return t.garbageCollectCachedViews();n };n }(this));n }, r.prototype.createDocumentFragmentForSync = function () {n var t, e, n, i, o, r, s, u, c, l;nn for (e = document.createDocumentFragment(), u = this.shadowElement.childNodes, n = 0, o = u.length; o > n; n++) {n s = u, e.appendChild(s.cloneNode(!0));n }nn for (c = a(e), i = 0, r = c.length; r > i; i++) {n t = c, (l = this.elementStore.remove(t)) && t.parentNode.replaceChild(l, t);n }nn return e;n }, a = function a(t) {n return t.querySelectorAll("");n }, s = function s(t, e) {n return u(t.innerHTML) === u(e.innerHTML);n }, u = function u(t) {n return t.replace(/&nbsp;/g, " ");n }, r;n }(e.ObjectView);n }.call(this), function () {n var t,n n,n i,n o,n r,n s = function s(t, e) {n return function () {n return t.apply(e, arguments);n };n },n a = function a(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n u.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n u = {}.hasOwnProperty;nn i = e.findClosestElementFromNode, o = e.handleEvent, r = e.innerElementIsActive, n = e.defer, t = e.AttachmentView.attachmentSelector, e.CompositionController = function (u) {n function c(n, i) {n this.element = n, this.composition = i, this.didClickAttachment = s(this.didClickAttachment, this), this.didBlur = s(this.didBlur, this), this.didFocus = s(this.didFocus, this), this.documentView = new e.DocumentView(this.composition.document, {n element: this.elementn }), o("focus", {n onElement: this.element,n withCallback: this.didFocusn }), o("blur", {n onElement: this.element,n withCallback: this.didBlurn }), o("click", {n onElement: this.element,n matchingSelector: "a[contenteditable=false]",n preventDefault: !0n }), o("mousedown", {n onElement: this.element,n matchingSelector: t,n withCallback: this.didClickAttachmentn }), o("click", {n onElement: this.element,n matchingSelector: "a" + t,n preventDefault: !0n });n }nn return a(c, u), c.prototype.didFocus = function () {n var t, e, n;n return t = function (t) {n return function () {n var e;n return t.focused ? void 0 : (t.focused = !0, null != (e = t.delegate) && "function" == typeof e.compositionControllerDidFocus ? e.compositionControllerDidFocus() : void 0);n };n }(this), null != (e = null != (n = this.blurPromise) ? n.then(t) : void 0) ? e : t();n }, c.prototype.didBlur = function () {n return this.blurPromise = new Promise(function (t) {n return function (e) {n return n(function () {n var n;n return r(t.element) || (t.focused = null, null != (n = t.delegate) && "function" == typeof n.compositionControllerDidBlur && n.compositionControllerDidBlur()), t.blurPromise = null, e();n });n };n }(this));n }, c.prototype.didClickAttachment = function (t, e) {n var n, o, r;n return n = this.findAttachmentForElement(e), o = null != i(t.target, {n matchingSelector: "figcaption"n }), null != (r = this.delegate) && "function" == typeof r.compositionControllerDidSelectAttachment ? r.compositionControllerDidSelectAttachment(n, {n editCaption: on }) : void 0;n }, c.prototype.getSerializableElement = function () {n return this.isEditingAttachment() ? this.documentView.shadowElement : this.element;n }, c.prototype.render = function () {n var t, e, n;n return this.revision !== this.composition.revision && (this.documentView.setDocument(this.composition.document), this.documentView.render(), this.revision = this.composition.revision), this.canSyncDocumentView() && !this.documentView.isSynced() && (null != (t = this.delegate) && "function" == typeof t.compositionControllerWillSyncDocumentView && t.compositionControllerWillSyncDocumentView(), this.documentView.sync(), null != (e = this.delegate) && "function" == typeof e.compositionControllerDidSyncDocumentView && e.compositionControllerDidSyncDocumentView()), null != (n = this.delegate) && "function" == typeof n.compositionControllerDidRender ? n.compositionControllerDidRender() : void 0;n }, c.prototype.rerenderViewForObject = function (t) {n return this.invalidateViewForObject(t), this.render();n }, c.prototype.invalidateViewForObject = function (t) {n return this.documentView.invalidateViewForObject(t);n }, c.prototype.isViewCachingEnabled = function () {n return this.documentView.isViewCachingEnabled();n }, c.prototype.enableViewCaching = function () {n return this.documentView.enableViewCaching();n }, c.prototype.disableViewCaching = function () {n return this.documentView.disableViewCaching();n }, c.prototype.refreshViewCache = function () {n return this.documentView.garbageCollectCachedViews();n }, c.prototype.isEditingAttachment = function () {n return null != this.attachmentEditor;n }, c.prototype.installAttachmentEditorForAttachment = function (t, n) {n var i, o, r;n if ((null != (r = this.attachmentEditor) ? r.attachment : void 0) !== t && (o = this.documentView.findElementForObject(t))) return this.uninstallAttachmentEditor(), i = this.composition.document.getAttachmentPieceForAttachment(t), this.attachmentEditor = new e.AttachmentEditorController(i, o, this.element, n), this.attachmentEditor.delegate = this;n }, c.prototype.uninstallAttachmentEditor = function () {n var t;n return null != (t = this.attachmentEditor) ? t.uninstall() : void 0;n }, c.prototype.didUninstallAttachmentEditor = function () {n return this.attachmentEditor = null, this.render();n }, c.prototype.attachmentEditorDidRequestUpdatingAttributesForAttachment = function (t, e) {n var n;n return null != (n = this.delegate) && "function" == typeof n.compositionControllerWillUpdateAttachment && n.compositionControllerWillUpdateAttachment(e), this.composition.updateAttributesForAttachment(t, e);n }, c.prototype.attachmentEditorDidRequestRemovingAttributeForAttachment = function (t, e) {n var n;n return null != (n = this.delegate) && "function" == typeof n.compositionControllerWillUpdateAttachment && n.compositionControllerWillUpdateAttachment(e), this.composition.removeAttributeForAttachment(t, e);n }, c.prototype.attachmentEditorDidRequestRemovalOfAttachment = function (t) {n var e;n return null != (e = this.delegate) && "function" == typeof e.compositionControllerDidRequestRemovalOfAttachment ? e.compositionControllerDidRequestRemovalOfAttachment(t) : void 0;n }, c.prototype.attachmentEditorDidRequestDeselectingAttachment = function (t) {n var e;n return null != (e = this.delegate) && "function" == typeof e.compositionControllerDidRequestDeselectingAttachment ? e.compositionControllerDidRequestDeselectingAttachment(t) : void 0;n }, c.prototype.canSyncDocumentView = function () {n return !this.isEditingAttachment();n }, c.prototype.findAttachmentForElement = function (t) {n return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId, 10));n }, c;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n return function () {n return t.apply(e, arguments);n };n },n r = function r(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n s.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n s = {}.hasOwnProperty;nn n = e.handleEvent, i = e.triggerEvent, t = e.findClosestElementFromNode, e.ToolbarController = function (e) {n function s(t) {n this.element = t, this.didKeyDownDialogInput = o(this.didKeyDownDialogInput, this), this.didClickDialogButton = o(this.didClickDialogButton, this), this.didClickAttributeButton = o(this.didClickAttributeButton, this), this.didClickActionButton = o(this.didClickActionButton, this), this.attributes = {}, this.actions = {}, this.resetDialogInputs(), n("mousedown", {n onElement: this.element,n matchingSelector: a,n withCallback: this.didClickActionButtonn }), n("mousedown", {n onElement: this.element,n matchingSelector: c,n withCallback: this.didClickAttributeButtonn }), n("click", {n onElement: this.element,n matchingSelector: v,n preventDefault: !0n }), n("click", {n onElement: this.element,n matchingSelector: l,n withCallback: this.didClickDialogButtonn }), n("keydown", {n onElement: this.element,n matchingSelector: h,n withCallback: this.didKeyDownDialogInputn });n }nn var a, u, c, l, h, p, d, f, g, m, v;n return r(s, e), c = "[data-trix-attribute]", a = "[data-trix-action]", v = c + ", " + a, p = "[data-trix-dialog]", u = p + "[data-trix-active]", l = p + " [data-trix-method]", h = p + " [data-trix-input]", s.prototype.didClickActionButton = function (t, e) {n var n, i, o;n return null != (i = this.delegate) && i.toolbarDidClickButton(), t.preventDefault(), n = d(e), this.getDialog(n) ? this.toggleDialog(n) : null != (o = this.delegate) ? o.toolbarDidInvokeAction(n) : void 0;n }, s.prototype.didClickAttributeButton = function (t, e) {n var n, i, o;n return null != (i = this.delegate) && i.toolbarDidClickButton(), t.preventDefault(), n = f(e), this.getDialog(n) ? this.toggleDialog(n) : null != (o = this.delegate) && o.toolbarDidToggleAttribute(n), this.refreshAttributeButtons();n }, s.prototype.didClickDialogButton = function (e, n) {n var i, o;n return i = t(n, {n matchingSelector: pn }), o = n.getAttribute("data-trix-method"), this.call(this, i);n }, s.prototype.didKeyDownDialogInput = function (t, e) {n var n, i;n return 13 === t.keyCode && (t.preventDefault(), n = e.getAttribute("name"), i = this.getDialog(n), this.setAttribute(i)), 27 === t.keyCode ? (t.preventDefault(), this.hideDialog()) : void 0;n }, s.prototype.updateActions = function (t) {n return this.actions = t, this.refreshActionButtons();n }, s.prototype.refreshActionButtons = function () {n return this.eachActionButton(function (t) {n return function (e, n) {n return e.disabled = t.actions === !1;n };n }(this));n }, s.prototype.eachActionButton = function (t) {n var e, n, i, o, r;nn for (o = this.element.querySelectorAll(a), r = [], n = 0, i = o.length; i > n; n++) {n e = o, r.push(t(e, d(e)));n }nn return r;n }, s.prototype.updateAttributes = function (t) {n return this.attributes = t, this.refreshAttributeButtons();n }, s.prototype.refreshAttributeButtons = function () {n return this.eachAttributeButton(function (t) {n return function (e, n) {n return e.disabled = t.attributes === !1, t.attributes || t.dialogIsVisible(n) ? (e.setAttribute("data-trix-active", ""), e.classList.add("trix-active")) : (e.removeAttribute("data-trix-active"), e.classList.remove("trix-active"));n };n }(this));n }, s.prototype.eachAttributeButton = function (t) {n var e, n, i, o, r;nn for (o = this.element.querySelectorAll©, r = [], n = 0, i = o.length; i > n; n++) {n e = o, r.push(t(e, f(e)));n }nn return r;n }, s.prototype.applyKeyboardCommand = function (t) {n var e, n, o, r, s, a, u;nn for (s = JSON.stringify(t.sort()), u = this.element.querySelectorAll(""), r = 0, a = u.length; a > r; r++) {n if (e = u, o = e.getAttribute("data-trix-key").split("+"), n = JSON.stringify(o.sort()), n === s) return i("mousedown", {n onElement: en }), !0;n }nn return !1;n }, s.prototype.dialogIsVisible = function (t) {n var e;n return (e = this.getDialog(t)) ? e.hasAttribute("data-trix-active") : void 0;n }, s.prototype.toggleDialog = function (t) {n return this.dialogIsVisible(t) ? this.hideDialog() : this.showDialog(t);n }, s.prototype.showDialog = function (t) {n var e, n, i, o, r, s, a, u, c, l;nn for (this.hideDialog(), null != (a = this.delegate) && a.toolbarWillShowDialog(), i = this.getDialog(t), i.setAttribute("data-trix-active", ""), i.classList.add("trix-active"), u = i.querySelectorAll("input"), o = 0, s = u.length; s > o; o++) {n n = u, n.removeAttribute("disabled");n }nn return (e = f(i)) && (r = m(i, t)) && (r.value = null != (c = this.attributes) ? c : "", r.select()), null != (l = this.delegate) ? l.toolbarDidShowDialog(t) : void 0;n }, s.prototype.setAttribute = function (t) {n var e, n, i;n return e = f(t), n = m(t, e), n.willValidate && !n.checkValidity() ? (n.setAttribute("data-trix-validate", ""), n.classList.add("trix-validate"), n.focus()) : (null != (i = this.delegate) && i.toolbarDidUpdateAttribute(e, n.value), this.hideDialog());n }, s.prototype.removeAttribute = function (t) {n var e, n;n return e = f(t), null != (n = this.delegate) && n.toolbarDidRemoveAttribute(e), this.hideDialog();n }, s.prototype.hideDialog = function () {n var t, e;n return (t = this.element.querySelector(u)) ? (t.removeAttribute("data-trix-active"), t.classList.remove("trix-active"), this.resetDialogInputs(), null != (e = this.delegate) ? e.toolbarDidHideDialog(g(t)) : void 0) : void 0;n }, s.prototype.resetDialogInputs = function () {n var t, e, n, i, o;nn for (i = this.element.querySelectorAll(h), o = [], t = 0, n = i.length; n > t; t++) {n e = i, e.setAttribute("disabled", "disabled"), e.removeAttribute("data-trix-validate"), o.push(e.classList.remove("trix-validate"));n }nn return o;n }, s.prototype.getDialog = function (t) {n return this.element.querySelector("[data-trix-dialog=" + t + "]");n }, m = function m(t, e) {n return null == e && (e = f(t)), t.querySelector("[name='" + e + "']");n }, d = function d(t) {n return t.getAttribute("data-trix-action");n }, f = function f(t) {n var e;n return null != (e = t.getAttribute("data-trix-attribute")) ? e : t.getAttribute("data-trix-dialog-attribute");n }, g = function g(t) {n return t.getAttribute("data-trix-dialog");n }, s;n }(e.BasicObject);n }.call(this), function () {n var t = function t(_t13, e) {n function i() {n this.constructor = _t13;n }nn for (var o in e) {n n.call(e, o) && (_t13 = e);n }nn return i.prototype = e.prototype, _t13.prototype = new i(), t13._super__ = e.prototype, _t13;n },n n = {}.hasOwnProperty;nn e.ImagePreloadOperation = function (e) {n function n(t) {n this.url = t;n }nn return t(n, e), n.prototype.perform = function (t) {n var e;n return e = new Image(), e.onload = function (n) {n return function () {n return e.width = n.width = e.naturalWidth, e.height = n.height = e.naturalHeight, t(!0, e);n };n }(this), e.onerror = function () {n return t(!1);n }, e.src = this.url;n }, n;n }(e.Operation);n }.call(this), function () {n var t = function t(_t14, e) {n return function () {n return _t14.apply(e, arguments);n };n },n n = function n(t, e) {n function n() {n this.constructor = t;n }nn for (var o in e) {n i.call(e, o) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n i = {}.hasOwnProperty;nn e.Attachment = function (i) {n function o(n) {n null == n && (n = {}), this.releaseFile = t(this.releaseFile, this), o.__super__.constructor.apply(this, arguments), this.attributes = e.Hash.box(n), this.didChangeAttributes();n }nn return n(o, i), o.previewablePattern = /^image(\/(gif|png|jpe?g)|$)/, o.attachmentForFile = function (t) {n var e, n;n return n = this.attributesForFile(t), e = new this(n), e.setFile(t), e;n }, o.attributesForFile = function (t) {n return new e.Hash({n filename: t.name,n filesize: t.size,n contentType: t.typen });n }, o.fromJSON = function (t) {n return new this(t);n }, o.prototype.getAttribute = function (t) {n return this.attributes.get(t);n }, o.prototype.hasAttribute = function (t) {n return this.attributes.has(t);n }, o.prototype.getAttributes = function () {n return this.attributes.toObject();n }, o.prototype.setAttributes = function (t) {n var e, n, i;n return null == t && (t = {}), e = this.attributes.merge(t), this.attributes.isEqualTo(e) ? void 0 : (this.attributes = e, this.didChangeAttributes(), null != (n = this.previewDelegate) && "function" == typeof n.attachmentDidChangeAttributes && n.attachmentDidChangeAttributes(this), null != (i = this.delegate) && "function" == typeof i.attachmentDidChangeAttributes ? i.attachmentDidChangeAttributes(this) : void 0);n }, o.prototype.didChangeAttributes = function () {n return this.isPreviewable() ? this.preloadURL() : void 0;n }, o.prototype.isPending = function () {n return null != this.file && !(this.getURL() || this.getHref());n }, o.prototype.isPreviewable = function () {n return this.attributes.has("previewable") ? this.attributes.get("previewable") : this.constructor.previewablePattern.test(this.getContentType());n }, o.prototype.getType = function () {n return this.hasContent() ? "content" : this.isPreviewable() ? "preview" : "file";n }, o.prototype.getURL = function () {n return this.attributes.get("url");n }, o.prototype.getHref = function () {n return this.attributes.get("href");n }, o.prototype.getFilename = function () {n var t;n return null != (t = this.attributes.get("filename")) ? t : "";n }, o.prototype.getFilesize = function () {n return this.attributes.get("filesize");n }, o.prototype.getFormattedFilesize = function () {n var t;n return t = this.attributes.get("filesize"), "number" == typeof t ? e.config.fileSize.formatter(t) : "";n }, o.prototype.getExtension = function () {n var t;n return null != (t = this.getFilename().match(/\.(\w+)$/)) ? t.toLowerCase() : void 0;n }, o.prototype.getContentType = function () {n return this.attributes.get("contentType");n }, o.prototype.hasContent = function () {n return this.attributes.has("content");n }, o.prototype.getContent = function () {n return this.attributes.get("content");n }, o.prototype.getWidth = function () {n return this.attributes.get("width");n }, o.prototype.getHeight = function () {n return this.attributes.get("height");n }, o.prototype.getFile = function () {n return this.file;n }, o.prototype.setFile = function (t) {n return this.file = t, this.isPreviewable() ? this.preloadFile() : void 0;n }, o.prototype.releaseFile = function () {n return this.releasePreloadedFile(), this.file = null;n }, o.prototype.getUploadProgress = function () {n var t;n return null != (t = this.uploadProgress) ? t : 0;n }, o.prototype.setUploadProgress = function (t) {n var e;n return this.uploadProgress !== t ? (this.uploadProgress = t, null != (e = this.uploadProgressDelegate) && "function" == typeof e.attachmentDidChangeUploadProgress ? e.attachmentDidChangeUploadProgress(this) : void 0) : void 0;n }, o.prototype.toJSON = function () {n return this.getAttributes();n }, o.prototype.getCacheKey = function () {n return [o.__super__.getCacheKey.apply(this, arguments), this.attributes.getCacheKey(), this.getPreviewURL()].join("/");n }, o.prototype.getPreviewURL = function () {n return this.previewURL || this.preloadingURL;n }, o.prototype.setPreviewURL = function (t) {n var e, n;n return t !== this.getPreviewURL() ? (this.previewURL = t, null != (e = this.previewDelegate) && "function" == typeof e.attachmentDidChangeAttributes && e.attachmentDidChangeAttributes(this), null != (n = this.delegate) && "function" == typeof n.attachmentDidChangePreviewURL ? n.attachmentDidChangePreviewURL(this) : void 0) : void 0;n }, o.prototype.preloadURL = function () {n return this.preload(this.getURL(), this.releaseFile);n }, o.prototype.preloadFile = function () {n return this.file ? (this.fileObjectURL = URL.createObjectURL(this.file), this.preload(this.fileObjectURL)) : void 0;n }, o.prototype.releasePreloadedFile = function () {n return this.fileObjectURL ? (URL.revokeObjectURL(this.fileObjectURL), this.fileObjectURL = null) : void 0;n }, o.prototype.preload = function (t, n) {n var i;n return t && t !== this.getPreviewURL() ? (this.preloadingURL = t, i = new e.ImagePreloadOperation(t), i.then(function (e) {n return function (i) {n var o, r;n return r = i.width, o = i.height, e.setAttributes({n width: r,n height: on }), e.preloadingURL = null, e.setPreviewURL(t), "function" == typeof n ? n() : void 0;n };n }(this))) : void 0;n }, o;n }(e.Object);n }.call(this), function () {n var t = function t(_t15, e) {n function i() {n this.constructor = _t15;n }nn for (var o in e) {n n.call(e, o) && (_t15 = e);n }nn return i.prototype = e.prototype, _t15.prototype = new i(), t15._super__ = e.prototype, _t15;n },n n = {}.hasOwnProperty;nn e.Piece = function (n) {n function i(t, n) {n null == n && (n = {}), i.__super__.constructor.apply(this, arguments), this.attributes = e.Hash.box(n);n }nn return t(i, n), i.types = {}, i.registerType = function (t, e) {n return e.type = t, this.types = e;n }, i.fromJSON = function (t) {n var e;n return (e = this.types) ? e.fromJSON(t) : void 0;n }, i.prototype.copyWithAttributes = function (t) {n return new this.constructor(this.getValue(), t);n }, i.prototype.copyWithAdditionalAttributes = function (t) {n return this.copyWithAttributes(this.attributes.merge(t));n }, i.prototype.copyWithoutAttribute = function (t) {n return this.copyWithAttributes(this.attributes.remove(t));n }, i.prototype.copy = function () {n return this.copyWithAttributes(this.attributes);n }, i.prototype.getAttribute = function (t) {n return this.attributes.get(t);n }, i.prototype.getAttributesHash = function () {n return this.attributes;n }, i.prototype.getAttributes = function () {n return this.attributes.toObject();n }, i.prototype.getCommonAttributes = function () {n var t, e, n;n return (n = pieceList.getPieceAtIndex(0)) ? (t = n.attributes, e = t.getKeys(), pieceList.eachPiece(function (n) {n return e = t.getKeysCommonToHash(n.attributes), t = t.slice(e);n }), t.toObject()) : {};n }, i.prototype.hasAttribute = function (t) {n return this.attributes.has(t);n }, i.prototype.hasSameStringValueAsPiece = function (t) {n return null != t && this.toString() === t.toString();n }, i.prototype.hasSameAttributesAsPiece = function (t) {n return null != t && (this.attributes === t.attributes || this.attributes.isEqualTo(t.attributes));n }, i.prototype.isBlockBreak = function () {n return !1;n }, i.prototype.isEqualTo = function (t) {n return i.__super__.isEqualTo.apply(this, arguments) || this.hasSameConstructorAs(t) && this.hasSameStringValueAsPiece(t) && this.hasSameAttributesAsPiece(t);n }, i.prototype.isEmpty = function () {n return 0 === this.length;n }, i.prototype.isSerializable = function () {n return !0;n }, i.prototype.toJSON = function () {n return {n type: this.constructor.type,n attributes: this.getAttributes()n };n }, i.prototype.contentsForInspection = function () {n return {n type: this.constructor.type,n attributes: this.attributes.inspect()n };n }, i.prototype.canBeGrouped = function () {n return this.hasAttribute("href");n }, i.prototype.canBeGroupedWith = function (t) {n return this.getAttribute("href") === t.getAttribute("href");n }, i.prototype.getLength = function () {n return this.length;n }, i.prototype.canBeConsolidatedWith = function () {n return !1;n }, i;n }(e.Object);n }.call(this), function () {n var t = function t(_t16, e) {n function i() {n this.constructor = _t16;n }nn for (var o in e) {n n.call(e, o) && (_t16 = e);n }nn return i.prototype = e.prototype, _t16.prototype = new i(), t16._super__ = e.prototype, _t16;n },n n = {}.hasOwnProperty;nn e.Piece.registerType("attachment", e.AttachmentPiece = function (n) {n function i(t) {n this.attachment = t, i.__super__.constructor.apply(this, arguments), this.length = 1, this.ensureAttachmentExclusivelyHasAttribute("href"), this.attachment.hasContent() || this.removeProhibitedAttributes();n }nn return t(i, n), i.fromJSON = function (t) {n return new this(e.Attachment.fromJSON(t.attachment), t.attributes);n }, i.permittedAttributes = ["caption", "presentation"], i.prototype.ensureAttachmentExclusivelyHasAttribute = function (t) {n return this.hasAttribute(t) ? (this.attachment.hasAttribute(t) || this.attachment.setAttributes(this.attributes.slice(t)), this.attributes = this.attributes.remove(t)) : void 0;n }, i.prototype.removeProhibitedAttributes = function () {n var t;n return t = this.attributes.slice(this.constructor.permittedAttributes), t.isEqualTo(this.attributes) ? void 0 : this.attributes = t;n }, i.prototype.getValue = function () {n return this.attachment;n }, i.prototype.isSerializable = function () {n return !this.attachment.isPending();n }, i.prototype.getCaption = function () {n var t;n return null != (t = this.attributes.get("caption")) ? t : "";n }, i.prototype.isEqualTo = function (t) {n var e;n return i.__super__.isEqualTo.apply(this, arguments) && this.attachment.id === (null != t && null != (e = t.attachment) ? e.id : void 0);n }, i.prototype.toString = function () {n return e.OBJECT_REPLACEMENT_CHARACTER;n }, i.prototype.toJSON = function () {n var t;n return t = i.__super__.toJSON.apply(this, arguments), t.attachment = this.attachment, t;n }, i.prototype.getCacheKey = function () {n return [i.__super__.getCacheKey.apply(this, arguments), this.attachment.getCacheKey()].join("/");n }, i.prototype.toConsole = function () {n return JSON.stringify(this.toString());n }, i;n }(e.Piece));n }.call(this), function () {n var t,n n = function n(t, e) {n function n() {n this.constructor = t;n }nn for (var o in e) {n i.call(e, o) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n i = {}.hasOwnProperty;nn t = e.normalizeNewlines, e.Piece.registerType("string", e.StringPiece = function (e) {n function i(e) {n i.__super__.constructor.apply(this, arguments), this.string = t(e), this.length = this.string.length;n }nn return n(i, e), i.fromJSON = function (t) {n return new this(t.string, t.attributes);n }, i.prototype.getValue = function () {n return this.string;n }, i.prototype.toString = function () {n return this.string.toString();n }, i.prototype.isBlockBreak = function () {n return "\n" === this.toString() && this.getAttribute("blockBreak") === !0;n }, i.prototype.toJSON = function () {n var t;n return t = i.__super__.toJSON.apply(this, arguments), t.string = this.string, t;n }, i.prototype.canBeConsolidatedWith = function (t) {n return null != t && this.hasSameConstructorAs(t) && this.hasSameAttributesAsPiece(t);n }, i.prototype.consolidateWith = function (t) {n return new this.constructor(this.toString() + t.toString(), this.attributes);n }, i.prototype.splitAtOffset = function (t) {n var e, n;n return 0 === t ? (e = null, n = this) : t === this.length ? (e = this, n = null) : (e = new this.constructor(this.string.slice(0, t), this.attributes), n = new this.constructor(this.string.slice(t), this.attributes)), [e, n];n }, i.prototype.toConsole = function () {n var t;n return t = this.string, t.length > 15 && (t = t.slice(0, 14) + "\u2026"), JSON.stringify(t.toString());n }, i;n }(e.Piece));n }.call(this), function () {n var t,n n = function n(t, e) {n function n() {n this.constructor = t;n }nn for (var o in e) {n i.call(e, o) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n i = {}.hasOwnProperty,n o = [].slice;nn t = e.spliceArray, e.SplittableList = function (e) {n function i(t) {n null == t && (t = []), i.__super__.constructor.apply(this, arguments), this.objects = t.slice(0), this.length = this.objects.length;n }nn var r, s, a;n return n(i, e), i.box = function (t) {n return t instanceof this ? t : new this(t);n }, i.prototype.indexOf = function (t) {n return this.objects.indexOf(t);n }, i.prototype.splice = function () {n var e;n return e = 1 <= arguments.length ? o.call(arguments, 0) : [], new this.constructor(t.apply(null, [this.objects].concat(o.call(e))));n }, i.prototype.eachObject = function (t) {n var e, n, i, o, r, s;nn for (r = this.objects, s = [], n = e = 0, i = r.length; i > e; n = ++e) {n o = r, s.push(t(o, n));n }nn return s;n }, i.prototype.insertObjectAtIndex = function (t, e) {n return this.splice(e, 0, t);n }, i.prototype.insertSplittableListAtIndex = function (t, e) {n return this.splice.apply(this, [e, 0].concat(o.call(t.objects)));n }, i.prototype.insertSplittableListAtPosition = function (t, e) {n var n, i, o;n return o = this.splitObjectAtPosition(e), i = o, n = o, new this.constructor(i).insertSplittableListAtIndex(t, n);n }, i.prototype.editObjectAtIndex = function (t, e) {n return this.replaceObjectAtIndex(e(this.objects), t);n }, i.prototype.replaceObjectAtIndex = function (t, e) {n return this.splice(e, 1, t);n }, i.prototype.removeObjectAtIndex = function (t) {n return this.splice(t, 1);n }, i.prototype.getObjectAtIndex = function (t) {n return this.objects;n }, i.prototype.getSplittableListInRange = function (t) {n var e, n, i, o;n return i = this.splitObjectsAtRange(t), n = i, e = i, o = i, new this.constructor(n.slice(e, o + 1));n }, i.prototype.selectSplittableList = function (t) {n var e, n;n return n = function () {n var n, i, o, r;nn for (o = this.objects, r = [], n = 0, i = o.length; i > n; n++) {n e = o, t(e) && r.push(e);n }nn return r;n }.call(this), new this.constructor(n);n }, i.prototype.removeObjectsInRange = function (t) {n var e, n, i, o;n return i = this.splitObjectsAtRange(t), n = i, e = i, o = i, new this.constructor(n).splice(e, o - e + 1);n }, i.prototype.transformObjectsInRange = function (t, e) {n var n, i, o, r, s, a, u;n return s = this.splitObjectsAtRange(t), r = s, i = s, a = s, u = function () {n var t, s, u;nn for (u = [], n = t = 0, s = r.length; s > t; n = ++t) {n o = r, u.push(n >= i && a >= n ? e(o) : o);n }nn return u;n }(), new this.constructor(u);n }, i.prototype.splitObjectsAtRange = function (t) {n var e, n, i, o, s, u;n return o = this.splitObjectAtPosition(a(t)), n = o, e = o, i = o, s = new this.constructor(n).splitObjectAtPosition(r(t) + i), n = s, u = s, [n, e, u - 1];n }, i.prototype.getObjectAtPosition = function (t) {n var e, n, i;n return i = this.findIndexAndOffsetAtPosition(t), e = i.index, n = i.offset, this.objects;n }, i.prototype.splitObjectAtPosition = function (t) {n var e, n, i, o, r, s, a, u, c, l;n return s = this.findIndexAndOffsetAtPosition(t), e = s.index, r = s.offset, o = this.objects.slice(0), null != e ? 0 === r ? (c = e, l = 0) : (i = this.getObjectAtIndex(e), a = i.splitAtOffset®, n = a, u = a, o.splice(e, 1, n, u), c = e + 1, l = n.getLength() - r) : (c = o.length, l = 0), [o, c, l];n }, i.prototype.consolidate = function () {n var t, e, n, i, o, r;nn for (i = [], o = this.objects, r = this.objects.slice(1), t = 0, e = r.length; e > t; t++) {n n = r, ("function" == typeof o.canBeConsolidatedWith ? o.canBeConsolidatedWith(n) : void 0) ? o = o.consolidateWith(n) : (i.push(o), o = n);n }nn return null != o && i.push(o), new this.constructor(i);n }, i.prototype.consolidateFromIndexToIndex = function (t, e) {n var n, i, r;n return i = this.objects.slice(0), r = i.slice(t, e + 1), n = new this.constructor®.consolidate().toArray(), this.splice.apply(this, [t, r.length].concat(o.call(n)));n }, i.prototype.findIndexAndOffsetAtPosition = function (t) {n var e, n, i, o, r, s, a;nn for (e = 0, a = this.objects, i = n = 0, o = a.length; o > n; i = ++n) {n if (s = a, r = e + s.getLength(), t >= e && r > t) return {n index: i,n offset: t - en };n e = r;n }nn return {n index: null,n offset: nulln };n }, i.prototype.findPositionAtIndexAndOffset = function (t, e) {n var n, i, o, r, s, a;nn for (s = 0, a = this.objects, n = i = 0, o = a.length; o > i; n = ++i) {n if (r = a, t > n) s += r.getLength();else if (n === t) {n s += e;n break;n }n }nn return s;n }, i.prototype.getEndPosition = function () {n var t, e;n return null != this.endPosition ? this.endPosition : this.endPosition = function () {n var n, i, o;nn for (e = 0, o = this.objects, n = 0, i = o.length; i > n; n++) {n t = o, e += t.getLength();n }nn return e;n }.call(this);n }, i.prototype.toString = function () {n return this.objects.join("");n }, i.prototype.toArray = function () {n return this.objects.slice(0);n }, i.prototype.toJSON = function () {n return this.toArray();n }, i.prototype.isEqualTo = function (t) {n return i.__super__.isEqualTo.apply(this, arguments) || s(this.objects, null != t ? t.objects : void 0);n }, s = function s(t, e) {n var n, i, o, r, s;n if (null == e && (e = []), t.length !== e.length) return !1;nn for (s = !0, i = n = 0, o = t.length; o > n; i = ++n) {n r = t, s && !r.isEqualTo(e) && (s = !1);n }nn return s;n }, i.prototype.contentsForInspection = function () {n var t;n return {n objects: "[" + function () {n var e, n, i, o;nn for (i = this.objects, o = [], e = 0, n = i.length; n > e; e++) {n t = i, o.push(t.inspect());n }nn return o;n }.call(this).join(", ") + "]"n };n }, a = function a(t) {n return t;n }, r = function r(t) {n return t;n }, i;n }(e.Object);n }.call(this), function () {n var t = function t(_t17, e) {n function i() {n this.constructor = _t17;n }nn for (var o in e) {n n.call(e, o) && (_t17 = e);n }nn return i.prototype = e.prototype, _t17.prototype = new i(), t17._super__ = e.prototype, _t17;n },n n = {}.hasOwnProperty;nn e.Text = function (n) {n function i(t) {n var n;n null == t && (t = []), i.__super__.constructor.apply(this, arguments), this.pieceList = new e.SplittableList(function () {n var e, i, o;nn for (o = [], e = 0, i = t.length; i > e; e++) {n n = t, n.isEmpty() || o.push(n);n }nn return o;n }());n }nn return t(i, n), i.textForAttachmentWithAttributes = function (t, n) {n var i;n return i = new e.AttachmentPiece(t, n), new this();n }, i.textForStringWithAttributes = function (t, n) {n var i;n return i = new e.StringPiece(t, n), new this();n }, i.fromJSON = function (t) {n var n, i;n return i = function () {n var i, o, r;nn for (r = [], i = 0, o = t.length; o > i; i++) {n n = t, r.push(e.Piece.fromJSON(n));n }nn return r;n }(), new this(i);n }, i.prototype.copy = function () {n return this.copyWithPieceList(this.pieceList);n }, i.prototype.copyWithPieceList = function (t) {n return new this.constructor(t.consolidate().toArray());n }, i.prototype.copyUsingObjectMap = function (t) {n var e, n;n return n = function () {n var n, i, o, r, s;nn for (o = this.getPieces(), s = [], n = 0, i = o.length; i > n; n++) {n e = o, s.push(null != (r = t.find(e)) ? r : e);n }nn return s;n }.call(this), new this.constructor(n);n }, i.prototype.appendText = function (t) {n return this.insertTextAtPosition(t, this.getLength());n }, i.prototype.insertTextAtPosition = function (t, e) {n return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList, e));n }, i.prototype.removeTextAtRange = function (t) {n return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t));n }, i.prototype.replaceTextAtRange = function (t, e) {n return this.removeTextAtRange(e).insertTextAtPosition(t, e);n }, i.prototype.moveTextFromRangeToPosition = function (t, e) {n var n, i;n if (!(t <= e && e <= t)) return i = this.getTextAtRange(t), n = i.getLength(), t < e && (e -= n), this.removeTextAtRange(t).insertTextAtPosition(i, e);n }, i.prototype.addAttributeAtRange = function (t, e, n) {n var i;n return i = {}, i = e, this.addAttributesAtRange(i, n);n }, i.prototype.addAttributesAtRange = function (t, e) {n return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e, function (e) {n return e.copyWithAdditionalAttributes(t);n }));n }, i.prototype.removeAttributeAtRange = function (t, e) {n return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e, function (e) {n return e.copyWithoutAttribute(t);n }));n }, i.prototype.setAttributesAtRange = function (t, e) {n return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e, function (e) {n return e.copyWithAttributes(t);n }));n }, i.prototype.getAttributesAtPosition = function (t) {n var e, n;n return null != (e = null != (n = this.pieceList.getObjectAtPosition(t)) ? n.getAttributes() : void 0) ? e : {};n }, i.prototype.getCommonAttributes = function () {n var t, n;n return t = function () {n var t, e, i, o;nn for (i = this.pieceList.toArray(), o = [], t = 0, e = i.length; e > t; t++) {n n = i, o.push(n.getAttributes());n }nn return o;n }.call(this), e.Hash.fromCommonAttributesOfObjects(t).toObject();n }, i.prototype.getCommonAttributesAtRange = function (t) {n var e;n return null != (e = this.getTextAtRange(t).getCommonAttributes()) ? e : {};n }, i.prototype.getExpandedRangeForAttributeAtOffset = function (t, e) {n var n, i, o;nn for (n = o = e, i = this.getLength(); n > 0 && this.getCommonAttributesAtRange([n - 1, o]);) {n n–;n }nn for (; i > o && this.getCommonAttributesAtRange([e, o + 1]);) {n o++;n }nn return [n, o];n }, i.prototype.getTextAtRange = function (t) {n return this.copyWithPieceList(this.pieceList.getSplittableListInRange(t));n }, i.prototype.getStringAtRange = function (t) {n return this.pieceList.getSplittableListInRange(t).toString();n }, i.prototype.getStringAtPosition = function (t) {n return this.getStringAtRange([t, t + 1]);n }, i.prototype.startsWithString = function (t) {n return this.getStringAtRange([0, t.length]) === t;n }, i.prototype.endsWithString = function (t) {n var e;n return e = this.getLength(), this.getStringAtRange([e - t.length, e]) === t;n }, i.prototype.getAttachmentPieces = function () {n var t, e, n, i, o;nn for (i = this.pieceList.toArray(), o = [], t = 0, e = i.length; e > t; t++) {n n = i, null != n.attachment && o.push(n);n }nn return o;n }, i.prototype.getAttachments = function () {n var t, e, n, i, o;nn for (i = this.getAttachmentPieces(), o = [], t = 0, e = i.length; e > t; t++) {n n = i, o.push(n.attachment);n }nn return o;n }, i.prototype.getAttachmentAndPositionById = function (t) {n var e, n, i, o, r, s;nn for (o = 0, r = this.pieceList.toArray(), e = 0, n = r.length; n > e; e++) {n if (i = r, (null != (s = i.attachment) ? s.id : void 0) === t) return {n attachment: i.attachment,n position: on };n o += i.length;n }nn return {n attachment: null,n position: nulln };n }, i.prototype.getAttachmentById = function (t) {n var e, n, i;n return i = this.getAttachmentAndPositionById(t), e = i.attachment, n = i.position, e;n }, i.prototype.getRangeOfAttachment = function (t) {n var e, n;n return n = this.getAttachmentAndPositionById(t.id), t = n.attachment, e = n.position, null != t ? [e, e + 1] : void 0;n }, i.prototype.updateAttributesForAttachment = function (t, e) {n var n;n return (n = this.getRangeOfAttachment(e)) ? this.addAttributesAtRange(t, n) : this;n }, i.prototype.getLength = function () {n return this.pieceList.getEndPosition();n }, i.prototype.isEmpty = function () {n return 0 === this.getLength();n }, i.prototype.isEqualTo = function (t) {n var e;n return i.__super__.isEqualTo.apply(this, arguments) || (null != t && null != (e = t.pieceList) ? e.isEqualTo(this.pieceList) : void 0);n }, i.prototype.isBlockBreak = function () {n return 1 === this.getLength() && this.pieceList.getObjectAtIndex(0).isBlockBreak();n }, i.prototype.eachPiece = function (t) {n return this.pieceList.eachObject(t);n }, i.prototype.getPieces = function () {n return this.pieceList.toArray();n }, i.prototype.getPieceAtPosition = function (t) {n return this.pieceList.getObjectAtPosition(t);n }, i.prototype.contentsForInspection = function () {n return {n pieceList: this.pieceList.inspect()n };n }, i.prototype.toSerializableText = function () {n var t;n return t = this.pieceList.selectSplittableList(function (t) {n return t.isSerializable();n }), this.copyWithPieceList(t);n }, i.prototype.toString = function () {n return this.pieceList.toString();n }, i.prototype.toJSON = function () {n return this.pieceList.toJSON();n }, i.prototype.toConsole = function () {n var t;n return JSON.stringify(function () {n var e, n, i, o;nn for (i = this.pieceList.toArray(), o = [], e = 0, n = i.length; n > e; e++) {n t = i, o.push(JSON.parse(t.toConsole()));n }nn return o;n }.call(this));n }, i;n }(e.Object);n }.call(this), function () {n var t,n n,n i,n o,n r,n s = function s(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n a.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n a = {}.hasOwnProperty,n u = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n },n c = [].slice;nn t = e.arraysAreEqual, r = e.spliceArray, i = e.getBlockConfig, n = e.getBlockAttributeNames, o = e.getListAttributeNames, e.Block = function (n) {n function a(t, n) {n null == t && (t = new e.Text()), null == n && (n = []), a.__super__.constructor.apply(this, arguments), this.text = h(t), this.attributes = n;n }nn var l, h, p, d, f, g, m, v, y;n return s(a, n), a.fromJSON = function (t) {n var n;n return n = e.Text.fromJSON(t.text), new this(n, t.attributes);n }, a.prototype.isEmpty = function () {n return this.text.isBlockBreak();n }, a.prototype.isEqualTo = function (e) {n return a.__super__.isEqualTo.apply(this, arguments) || this.text.isEqualTo(null != e ? e.text : void 0) && t(this.attributes, null != e ? e.attributes : void 0);n }, a.prototype.copyWithText = function (t) {n return new this.constructor(t, this.attributes);n }, a.prototype.copyWithoutText = function () {n return this.copyWithText(null);n }, a.prototype.copyWithAttributes = function (t) {n return new this.constructor(this.text, t);n }, a.prototype.copyWithoutAttributes = function () {n return this.copyWithAttributes(null);n }, a.prototype.copyUsingObjectMap = function (t) {n var e;n return this.copyWithText((e = t.find(this.text)) ? e : this.text.copyUsingObjectMap(t));n }, a.prototype.addAttribute = function (t) {n var e;n return e = this.attributes.concat(d(t)), this.copyWithAttributes(e);n }, a.prototype.removeAttribute = function (t) {n var e, n;n return n = i(t).listAttribute, e = g(g(this.attributes, t), n), this.copyWithAttributes(e);n }, a.prototype.removeLastAttribute = function () {n return this.removeAttribute(this.getLastAttribute());n }, a.prototype.getLastAttribute = function () {n return f(this.attributes);n }, a.prototype.getAttributes = function () {n return this.attributes.slice(0);n }, a.prototype.getAttributeLevel = function () {n return this.attributes.length;n }, a.prototype.getAttributeAtLevel = function (t) {n return this.attributes[t - 1];n }, a.prototype.hasAttribute = function (t) {n return u.call(this.attributes, t) >= 0;n }, a.prototype.hasAttributes = function () {n return this.getAttributeLevel() > 0;n }, a.prototype.getLastNestableAttribute = function () {n return f(this.getNestableAttributes());n }, a.prototype.getNestableAttributes = function () {n var t, e, n, o, r;nn for (o = this.attributes, r = [], e = 0, n = o.length; n > e; e++) {n t = o, i(t).nestable && r.push(t);n }nn return r;n }, a.prototype.getNestingLevel = function () {n return this.getNestableAttributes().length;n }, a.prototype.decreaseNestingLevel = function () {n var t;n return (t = this.getLastNestableAttribute()) ? this.removeAttribute(t) : this;n }, a.prototype.increaseNestingLevel = function () {n var t, e, n;n return (t = this.getLastNestableAttribute()) ? (n = this.attributes.lastIndexOf(t), e = r.apply(null, [this.attributes, n + 1, 0].concat(c.call(d(t)))), this.copyWithAttributes(e)) : this;n }, a.prototype.getListItemAttributes = function () {n var t, e, n, o, r;nn for (o = this.attributes, r = [], e = 0, n = o.length; n > e; e++) {n t = o, i(t).listAttribute && r.push(t);n }nn return r;n }, a.prototype.isListItem = function () {n var t;n return null != (t = i(this.getLastAttribute())) ? t.listAttribute : void 0;n }, a.prototype.isTerminalBlock = function () {n var t;n return null != (t = i(this.getLastAttribute())) ? t.terminal : void 0;n }, a.prototype.breaksOnReturn = function () {n var t;n return null != (t = i(this.getLastAttribute())) ? t.breakOnReturn : void 0;n }, a.prototype.findLineBreakInDirectionFromPosition = function (t, e) {n var n, i;n return i = this.toString(), n = function () {n switch (t) {n case "forward":n return i.indexOf("\n", e);nn case "backward":n return i.slice(0, e).lastIndexOf("\n");n }n }(), -1 !== n ? n : void 0;n }, a.prototype.contentsForInspection = function () {n return {n text: this.text.inspect(),n attributes: this.attributesn };n }, a.prototype.toString = function () {n return this.text.toString();n }, a.prototype.toJSON = function () {n return {n text: this.text,n attributes: this.attributesn };n }, a.prototype.getLength = function () {n return this.text.getLength();n }, a.prototype.canBeConsolidatedWith = function (t) {n return !this.hasAttributes() && !t.hasAttributes();n }, a.prototype.consolidateWith = function (t) {n var n, i;n return n = e.Text.textForStringWithAttributes("\n"), i = this.getTextWithoutBlockBreak().appendText(n), this.copyWithText(i.appendText(t.text));n }, a.prototype.splitAtOffset = function (t) {n var e, n;n return 0 === t ? (e = null, n = this) : t === this.getLength() ? (e = this, n = null) : (e = this.copyWithText(this.text.getTextAtRange([0, t])), n = this.copyWithText(this.text.getTextAtRange([t, this.getLength()]))), [e, n];n }, a.prototype.getBlockBreakPosition = function () {n return this.text.getLength() - 1;n }, a.prototype.getTextWithoutBlockBreak = function () {n return m(this.text) ? this.text.getTextAtRange([0, this.getBlockBreakPosition()]) : this.text.copy();n }, a.prototype.canBeGrouped = function (t) {n return this.attributes;n }, a.prototype.canBeGroupedWith = function (t, e) {n var n, r, s, a;n return s = t.getAttributes(), r = s, n = this.attributes, n === r && !(i(n).group === !1 && (a = s[e + 1], u.call(o(), a) < 0));n }, h = function h(t) {n return t = y(t), t = l(t);n }, y = function y(t) {n var n, i, o, r, s, a;n return r = !1, a = t.getPieces(), i = 2 <= a.length ? c.call(a, 0, n = a.length - 1) : (n = 0, []), o = a, null == o ? t : (i = function () {n var t, e, n;nn for (n = [], t = 0, e = i.length; e > t; t++) {n s = i, s.isBlockBreak() ? (r = !0, n.push(v(s))) : n.push(s);n }nn return n;n }(), r ? new e.Text(c.call(i).concat()) : t);n }, p = e.Text.textForStringWithAttributes("\n", {n blockBreak: !0n }), l = function l(t) {n return m(t) ? t : t.appendText(p);n }, m = function m(t) {n var e, n;n return n = t.getLength(), 0 === n ? !1 : (e = t.getTextAtRange([n - 1, n]), e.isBlockBreak());n }, v = function v(t) {n return t.copyWithoutAttribute("blockBreak");n }, d = function d(t) {n var e;n return e = i(t).listAttribute, null != e ? [e, t] : [t];n }, f = function f(t) {n return t.slice(-1);n }, g = function g(t, e) {n var n;n return n = t.lastIndexOf(e), -1 === n ? t : r(t, n, 1);n }, a;n }(e.Object);n }.call(this), function () {n var t,n n,n i,n o = function o(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n r.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n r = {}.hasOwnProperty,n s = [].slice,n a = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn n = e.tagName, i = e.walkTree, t = e.nodeIsAttachmentElement, e.HTMLSanitizer = function ® {n function u(t, e) {n this.allowedAttributes = (null != e ? e : {}).allowedAttributes, null == this.allowedAttributes && (this.allowedAttributes = c), this.body = l(t);n }nn var c, l, h;n return o(u, r), c = "style href src width height class".split(" "), u.sanitize = function (t, e) {n var n;n return n = new this(t, e), n.sanitize(), n;n }, u.prototype.sanitize = function () {n return this.sanitizeElements(), this.normalizeListElementNesting();n }, u.prototype.getHTML = function () {n return this.body.innerHTML;n }, u.prototype.getBody = function () {n return this.body;n }, u.prototype.sanitizeElements = function () {n var t, n, o, r, s;nn for (s = i(this.body), r = []; s.nextNode();) {n switch (o = s.currentNode, o.nodeType) {n case Node.ELEMENT_NODE:n h(o) ? r.push(o) : this.sanitizeElement(o);n break;nn case Node.COMMENT_NODE:n r.push(o);n }n }nn for (t = 0, n = r.length; n > t; t++) {n o = r, e.removeNode(o);n }nn return this.body;n }, u.prototype.sanitizeElement = function (t) {n var e, n, i, o;nn for (o = s.call(t.attributes), e = 0, n = o.length; n > e; e++) {n i = o.name, a.call(this.allowedAttributes, i) >= 0 || 0 === i.indexOf("data-trix") || t.removeAttribute(i);n }nn return t;n }, u.prototype.normalizeListElementNesting = function () {n var t, e, i, o, r;nn for (r = s.call(this.body.querySelectorAll("ul,ol")), t = 0, e = r.length; e > t; t++) {n i = r, (o = i.previousElementSibling) && "li" === n(o) && o.appendChild(i);n }nn return this.body;n }, h = function h(e) {n return (null != e ? e.nodeType : void 0) !== Node.ELEMENT_NODE || t(e) ? void 0 : "script" === n(e) || "false" === e.getAttribute("data-trix-serialize");n }, l = function l(t) {n var e, n, i, o, r;nn for (null == t && (t = ""), t = r, e.body.appendChild(n);n }nn return e.body;n }, u;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a,n u,n c,n l,n h,n p = function p(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n d.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n d = {}.hasOwnProperty,n f = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = e.arraysAreEqual, s = e.makeElement, l = e.tagName, r = e.getBlockTagNames, h = e.walkTree, o = e.findClosestElementFromNode, i = e.elementContainsNode, a = e.nodeIsAttachmentElement, u = e.normalizeSpaces, n = e.breakableWhitespacePattern, c = e.squishBreakableWhitespace, e.HTMLParser = function (d) {n function g(t, e) {n this.html = t, this.referenceElement = (null != e ? e : {}).referenceElement, this.blocks = [], this.blockElements = [], this.processedElements = [];n }nn var m, v, y, b, A, C, x, w, E, S, R, k;n return p(g, d), g.parse = function (t, e) {n var n;n return n = new this(t, e), n.parse(), n;n }, g.prototype.getDocument = function () {n return e.Document.fromJSON(this.blocks);n }, g.prototype.parse = function () {n var t, n;nn try {n for (this.createHiddenContainer(), t = e.HTMLSanitizer.sanitize(this.html).getHTML(), this.containerElement.innerHTML = t, n = h(this.containerElement, {n usingFilter: wn }); n.nextNode();) {n this.processNode(n.currentNode);n }nn return this.translateBlockElementMarginsToNewlines();n } finally {n this.removeHiddenContainer();n }n }, g.prototype.createHiddenContainer = function () {n return this.referenceElement ? (this.containerElement = this.referenceElement.cloneNode(!1), this.containerElement.removeAttribute("id"), this.containerElement.setAttribute("data-trix-internal", ""), this.containerElement.style.display = "none", this.referenceElement.parentNode.insertBefore(this.containerElement, this.referenceElement.nextSibling)) : (this.containerElement = s({n tagName: "div",n style: {n display: "none"n }n }), document.body.appendChild(this.containerElement));n }, g.prototype.removeHiddenContainer = function () {n return e.removeNode(this.containerElement);n }, w = function w(t) {n return "style" === l(t) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;n }, g.prototype.processNode = function (t) {n switch (t.nodeType) {n case Node.TEXT_NODE:n return this.processTextNode(t);nn case Node.ELEMENT_NODE:n return this.appendBlockForElement(t), this.processElement(t);n }n }, g.prototype.appendBlockForElement = function (e) {n var n, o, r, s;nn if (r = this.isBlockElement(e), o = i(this.currentBlockElement, e), r && !this.isBlockElement(e.firstChild)) {n if (!(this.isInsignificantTextNode(e.firstChild) && this.isBlockElement(e.firstElementChild) || (n = this.getBlockAttributes(e), o && t(n, this.currentBlock.attributes)))) return this.currentBlock = this.appendBlockForAttributesWithElement(n, e), this.currentBlockElement = e;n } else if (this.currentBlockElement && !o && !r) return (s = this.findParentBlockElement(e)) ? this.appendBlockForElement(s) : (this.currentBlock = this.appendEmptyBlock(), this.currentBlockElement = null);n }, g.prototype.findParentBlockElement = function (t) {n var e;nn for (e = t.parentElement; e && e !== this.containerElement;) {n if (this.isBlockElement(e) && f.call(this.blockElements, e) >= 0) return e;n e = e.parentElement;n }nn return null;n }, g.prototype.processTextNode = function (t) {n var e, n;n return this.isInsignificantTextNode(t) ? void 0 : (n = t.data, v(t.parentNode) || (n = c(n), R(null != (e = t.previousSibling) ? e.textContent : void 0) && (n = C(n))), this.appendStringWithAttributes(n, this.getTextAttributes(t.parentNode)));n }, g.prototype.processElement = function (t) {n var e, n, i, o, r;n if (a(t)) return e = y(t), Object.keys(e).length && (o = this.getTextAttributes(t), this.appendAttachmentWithAttributes(e, o), t.innerHTML = ""), this.processedElements.push(t);nn switch (l(t)) {n case "br":n return this.isExtraBR(t) || this.isBlockElement(t.nextSibling) || this.appendStringWithAttributes("\n", this.getTextAttributes(t)), this.processedElements.push(t);nn case "img":n e = {n url: t.getAttribute("src"),n contentType: "image"n }, i = A(t);nn for (n in i) {n r = i, e = r;n }nn return this.appendAttachmentWithAttributes(e, this.getTextAttributes(t)), this.processedElements.push(t);nn case "tr":n if (t.parentNode.firstChild !== t) return this.appendStringWithAttributes("\n");n break;nn case "td":n if (t.parentNode.firstChild !== t) return this.appendStringWithAttributes(" | ");n }n }, g.prototype.appendBlockForAttributesWithElement = function (t, e) {n var n;n return this.blockElements.push(e), n = m(t), this.blocks.push(n), n;n }, g.prototype.appendEmptyBlock = function () {n return this.appendBlockForAttributesWithElement([], null);n }, g.prototype.appendStringWithAttributes = function (t, e) {n return this.appendPiece(S(t, e));n }, g.prototype.appendAttachmentWithAttributes = function (t, e) {n return this.appendPiece(E(t, e));n }, g.prototype.appendPiece = function (t) {n return 0 === this.blocks.length && this.appendEmptyBlock(), this.blocks[this.blocks.length - 1].text.push(t);n }, g.prototype.appendStringToTextAtIndex = function (t, e) {n var n, i;n return i = this.blocks.text, n = i[i.length - 1], "string" === (null != n ? n.type : void 0) ? n.string += t : i.push(S(t));n }, g.prototype.prependStringToTextAtIndex = function (t, e) {n var n, i;n return i = this.blocks.text, n = i, "string" === (null != n ? n.type : void 0) ? n.string = t + n.string : i.unshift(S(t));n }, S = function S(t, e) {n var n;n return null == e && (e = {}), n = "string", t = u(t), {n string: t,n attributes: e,n type: nn };n }, E = function E(t, e) {n var n;n return null == e && (e = {}), n = "attachment", {n attachment: t,n attributes: e,n type: nn };n }, m = function m(t) {n var e;n return null == t && (t = {}), e = [], {n text: e,n attributes: tn };n }, g.prototype.getTextAttributes = function (t) {n var n, i, r, s, u, c, l, h, p, d, f, g, m;n r = {}, d = e.config.textAttributes;nn for (n in d) {n if (u = d, u.tagName && o(t, {n matchingSelector: u.tagName,n untilNode: this.containerElementn })) r = !0;else if (u.parser) {n if (m = u.parser(t)) {n for (i = !1, f = this.findBlockElementAncestors(t), c = 0, p = f.length; p > c; c++) {n if (s = f, u.parser(s) === m) {n i = !0;n break;n }n }nn i || (r = m);n }n } else u.styleProperty && (m = t.style) && (r = m);n }nn if (a(t) && (l = t.getAttribute("data-trix-attributes"))) {n g = JSON.parse(l);nn for (h in g) {n m = g, r = m;n }n }nn return r;n }, g.prototype.getBlockAttributes = function (t) {n var n, i, o, r;nn for (i = []; t && t !== this.containerElement;) {n r = e.config.blockAttributes;nn for (n in r) {n o = r, o.parse !== !1 && l(t) === o.tagName && (("function" == typeof o.test ? o.test(t) : void 0) || !o.test) && (i.push(n), o.listAttribute && i.push(o.listAttribute));n }nn t = t.parentNode;n }nn return i.reverse();n }, g.prototype.findBlockElementAncestors = function (t) {n var e, n;nn for (e = []; t && t !== this.containerElement;) {n n = l(t), f.call(r(), n) >= 0 && e.push(t), t = t.parentNode;n }nn return e;n }, y = function y(t) {n return JSON.parse(t.getAttribute("data-trix-attachment"));n }, A = function A(t) {n var e, n, i;n return i = t.getAttribute("width"), n = t.getAttribute("height"), e = {}, i && (e.width = parseInt(i, 10)), n && (e.height = parseInt(n, 10)), e;n }, g.prototype.isBlockElement = function (t) {n var e;n if ((null != t ? t.nodeType : void 0) === Node.ELEMENT_NODE && !a(t) && !o(t, {n matchingSelector: "td",n untilNode: this.containerElementn })) return e = l(t), f.call(r(), e) >= 0 || "block" === window.getComputedStyle(t).display;n }, g.prototype.isInsignificantTextNode = function (t) {n var e, n, i;n if ((null != t ? t.nodeType : void 0) === Node.TEXT_NODE && k(t.data) && (n = t.parentNode, i = t.previousSibling, e = t.nextSibling, (!x(n.previousSibling) || this.isBlockElement(n.previousSibling)) && !v(n))) return !i || this.isBlockElement(i) || !e || this.isBlockElement(e);n }, g.prototype.isExtraBR = function (t) {n return "br" === l(t) && this.isBlockElement(t.parentNode) && t.parentNode.lastChild === t;n }, v = function v(t) {n var e;n return e = window.getComputedStyle(t).whiteSpace, "pre" === e || "pre-wrap" === e || "pre-line" === e;n }, x = function x(t) {n return t && !R(t.textContent);n }, g.prototype.translateBlockElementMarginsToNewlines = function () {n var t, e, n, i, o, r, s, a;nn for (e = this.getMarginOfDefaultBlockElement(), s = this.blocks, a = [], i = n = 0, o = s.length; o > n; i = ++n) {n t = s, (r = this.getMarginOfBlockElementAtIndex(i)) && (r.top > 2 * e.top && this.prependStringToTextAtIndex("\n", i), a.push(r.bottom > 2 * e.bottom ? this.appendStringToTextAtIndex("\n", i) : void 0));n }nn return a;n }, g.prototype.getMarginOfBlockElementAtIndex = function (t) {n var e, n;n return !(e = this.blockElements) || !e.textContent || (n = l(e), f.call(r(), n) >= 0 || f.call(this.processedElements, e) >= 0) ? void 0 : b(e);n }, g.prototype.getMarginOfDefaultBlockElement = function () {n var t;n return t = s(e.config.blockAttributes.tagName), this.containerElement.appendChild(t), b(t);n }, b = function b(t) {n var e;n return e = window.getComputedStyle(t), "block" === e.display ? {n top: parseInt(e.marginTop),n bottom: parseInt(e.marginBottom)n } : void 0;n }, C = function C(t) {n return t.replace(RegExp("^" + n.source + "+"), "");n }, k = function k(t) {n return RegExp("^" + n.source + "*$").test(t);n }, R = function R(t) {n return /\s$/.test(t);n }, g;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r = function r(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n s.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n s = {}.hasOwnProperty,n a = [].slice,n u = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = e.arraysAreEqual, i = e.normalizeRange, o = e.rangeIsCollapsed, n = e.getBlockConfig, e.Document = function (s) {n function c(t) {n null == t && (t = []), c.__super__.constructor.apply(this, arguments), 0 === t.length && (t = [new e.Block()]), this.blockList = e.SplittableList.box(t);n }nn var l;n return r(c, s), c.fromJSON = function (t) {n var n, i;n return i = function () {n var i, o, r;nn for (r = [], i = 0, o = t.length; o > i; i++) {n n = t, r.push(e.Block.fromJSON(n));n }nn return r;n }(), new this(i);n }, c.fromHTML = function (t, n) {n return e.HTMLParser.parse(t, n).getDocument();n }, c.fromString = function (t, n) {n var i;n return i = e.Text.textForStringWithAttributes(t, n), new this([new e.Block(i)]);n }, c.prototype.isEmpty = function () {n var t;n return 1 === this.blockList.length && (t = this.getBlockAtIndex(0), t.isEmpty() && !t.hasAttributes());n }, c.prototype.copy = function (t) {n var e;n return null == t && (t = {}), e = t.consolidateBlocks ? this.blockList.consolidate().toArray() : this.blockList.toArray(), new this.constructor(e);n }, c.prototype.copyUsingObjectsFromDocument = function (t) {n var n;n return n = new e.ObjectMap(t.getObjects()), this.copyUsingObjectMap(n);n }, c.prototype.copyUsingObjectMap = function (t) {n var e, n, i;n return n = function () {n var n, o, r, s;nn for (r = this.getBlocks(), s = [], n = 0, o = r.length; o > n; n++) {n e = r, s.push((i = t.find(e)) ? i : e.copyUsingObjectMap(t));n }nn return s;n }.call(this), new this.constructor(n);n }, c.prototype.copyWithBaseBlockAttributes = function (t) {n var e, n, i;n return null == t && (t = []), i = function () {n var i, o, r, s;nn for (r = this.getBlocks(), s = [], i = 0, o = r.length; o > i; i++) {n n = r, e = t.concat(n.getAttributes()), s.push(n.copyWithAttributes(e));n }nn return s;n }.call(this), new this.constructor(i);n }, c.prototype.replaceBlock = function (t, e) {n var n;n return n = this.blockList.indexOf(t), -1 === n ? this : new this.constructor(this.blockList.replaceObjectAtIndex(e, n));n }, c.prototype.insertDocumentAtRange = function (t, e) {n var n, r, s, a, u, c, l;n return r = t.blockList, u = (e = i(e)), c = this.locationFromPosition(u), s = c.index, a = c.offset, l = this, n = this.getBlockAtPosition(u), o(e) && n.isEmpty() && !n.hasAttributes() ? l = new this.constructor(l.blockList.removeObjectAtIndex(s)) : n.getBlockBreakPosition() === a && u++, l = l.removeTextAtRange(e), new this.constructor(l.blockList.insertSplittableListAtPosition(r, u));n }, c.prototype.mergeDocumentAtRange = function (e, n) {n var o, r, s, a, u, c, l, h, p, d, f, g;n return f = (n = i(n)), d = this.locationFromPosition(f), r = this.getBlockAtIndex(d.index).getAttributes(), o = e.getBaseBlockAttributes(), g = r.slice(-o.length), t(o, g) ? (l = r.slice(0, -o.length), c = e.copyWithBaseBlockAttributes(l)) : c = e.copy({n consolidateBlocks: !0n }).copyWithBaseBlockAttributes®, s = c.getBlockCount(), a = c.getBlockAtIndex(0), t(r, a.getAttributes()) ? (u = a.getTextWithoutBlockBreak(), p = this.insertTextAtRange(u, n), s > 1 && (c = new this.constructor(c.getBlocks().slice(1)), h = f + u.getLength(), p = p.insertDocumentAtRange(c, h))) : p = this.insertDocumentAtRange(c, n), p;n }, c.prototype.insertTextAtRange = function (t, e) {n var n, o, r, s, a;n return a = (e = i(e)), s = this.locationFromPosition(a), o = s.index, r = s.offset, n = this.removeTextAtRange(e), new this.constructor(n.blockList.editObjectAtIndex(o, function (e) {n return e.copyWithText(e.text.insertTextAtPosition(t, r));n }));n }, c.prototype.removeTextAtRange = function (t) {n var e, n, r, s, a, u, c, l, h, p, d, f, g, m, v, y, b, A, C, x, w;n return p = t = i(t), l = p, A = p, o(t) ? this : (d = this.locationRangeFromRange(t), u = d, y = d, a = u.index, c = u.offset, s = this.getBlockAtIndex(a), v = y.index, b = y.offset, m = this.getBlockAtIndex(v), f = A - l === 1 && s.getBlockBreakPosition() === c && m.getBlockBreakPosition() !== b && "\n" === m.text.getStringAtPosition(b), f ? r = this.blockList.editObjectAtIndex(v, function (t) {n return t.copyWithText(t.text.removeTextAtRange([b, b + 1]));n }) : (h = s.text.getTextAtRange([0, c]), C = m.text.getTextAtRange([b, m.getLength()]), x = h.appendText(C), g = a !== v && 0 === c, w = g && s.getAttributeLevel() >= m.getAttributeLevel(), n = w ? m.copyWithText(x) : s.copyWithText(x), e = v + 1 - a, r = this.blockList.splice(a, e, n)), new this.constructor®);n }, c.prototype.moveTextFromRangeToPosition = function (t, e) {n var n, o, r, s, u, c, l, h, p, d;n return c = t = i(t), p = c, r = c, e >= p && r >= e ? this : (o = this.getDocumentAtRange(t), h = this.removeTextAtRange(t), u = e > p, u && (e -= o.getLength()), l = o.getBlocks(), s = l, n = 2 <= l.length ? a.call(l, 1) : [], 0 === n.length ? (d = s.getTextWithoutBlockBreak(), u && (e += 1)) : d = s.text, h = h.insertTextAtRange(d, e), 0 === n.length ? h : (o = new this.constructor(n), e += d.getLength(), h.insertDocumentAtRange(o, e)));n }, c.prototype.addAttributeAtRange = function (t, e, i) {n var o;n return o = this.blockList, this.eachBlockAtRange(i, function (i, r, s) {n return o = o.editObjectAtIndex(s, function () {n return n(t) ? i.addAttribute(t, e) : r === r ? i : i.copyWithText(i.text.addAttributeAtRange(t, e, r));n });n }), new this.constructor(o);n }, c.prototype.addAttribute = function (t, e) {n var n;n return n = this.blockList, this.eachBlock(function (i, o) {n return n = n.editObjectAtIndex(o, function () {n return i.addAttribute(t, e);n });n }), new this.constructor(n);n }, c.prototype.removeAttributeAtRange = function (t, e) {n var i;n return i = this.blockList, this.eachBlockAtRange(e, function (e, o, r) {n return n(t) ? i = i.editObjectAtIndex(r, function () {n return e.removeAttribute(t);n }) : o !== o ? i = i.editObjectAtIndex(r, function () {n return e.copyWithText(e.text.removeAttributeAtRange(t, o));n }) : void 0;n }), new this.constructor(i);n }, c.prototype.updateAttributesForAttachment = function (t, e) {n var n, i, o, r;n return o = (i = this.getRangeOfAttachment(e)), n = this.locationFromPosition(o).index, r = this.getTextAtIndex(n), new this.constructor(this.blockList.editObjectAtIndex(n, function (n) {n return n.copyWithText(r.updateAttributesForAttachment(t, e));n }));n }, c.prototype.removeAttributeForAttachment = function (t, e) {n var n;n return n = this.getRangeOfAttachment(e), this.removeAttributeAtRange(t, n);n }, c.prototype.insertBlockBreakAtRange = function (t) {n var n, o, r, s;n return s = (t = i(t)), r = this.locationFromPosition(s).offset, o = this.removeTextAtRange(t), 0 === r && (n = [new e.Block()]), new this.constructor(o.blockList.insertSplittableListAtPosition(new e.SplittableList(n), s));n }, c.prototype.applyBlockAttributeAtRange = function (t, e, i) {n var o, r, s, a;n return s = this.expandRangeToLineBreaksAndSplitBlocks(i), r = s.document, i = s.range, o = n(t), o.listAttribute ? (r = r.removeLastListAttributeAtRange(i, {n exceptAttributeName: tn }), a = r.convertLineBreaksToBlockBreaksInRange(i), r = a.document, i = a.range) : r = o.exclusive ? r.removeBlockAttributesAtRange(i) : o.terminal ? r.removeLastTerminalAttributeAtRange(i) : r.consolidateBlocksAtRange(i), r.addAttributeAtRange(t, e, i);n }, c.prototype.removeLastListAttributeAtRange = function (t, e) {n var i;n return null == e && (e = {}), i = this.blockList, this.eachBlockAtRange(t, function (t, o, r) {n var s;n if ((s = t.getLastAttribute()) && n(s).listAttribute && s !== e.exceptAttributeName) return i = i.editObjectAtIndex(r, function () {n return t.removeAttribute(s);n });n }), new this.constructor(i);n }, c.prototype.removeLastTerminalAttributeAtRange = function (t) {n var e;n return e = this.blockList, this.eachBlockAtRange(t, function (t, i, o) {n var r;n if ((r = t.getLastAttribute()) && n®.terminal) return e = e.editObjectAtIndex(o, function () {n return t.removeAttribute®;n });n }), new this.constructor(e);n }, c.prototype.removeBlockAttributesAtRange = function (t) {n var e;n return e = this.blockList, this.eachBlockAtRange(t, function (t, n, i) {n return t.hasAttributes() ? e = e.editObjectAtIndex(i, function () {n return t.copyWithoutAttributes();n }) : void 0;n }), new this.constructor(e);n }, c.prototype.expandRangeToLineBreaksAndSplitBlocks = function (t) {n var e, n, o, r, s, a, u, c, l;n return a = t = i(t), l = a, r = a, c = this.locationFromPosition(l), o = this.locationFromPosition®, e = this, u = e.getBlockAtIndex(c.index), null != (c.offset = u.findLineBreakInDirectionFromPosition("backward", c.offset)) && (s = e.positionFromLocation©, e = e.insertBlockBreakAtRange([s, s + 1]), o.index += 1, o.offset -= e.getBlockAtIndex(c.index).getLength(), c.index += 1), c.offset = 0, 0 === o.offset && o.index > c.index ? (o.index -= 1, o.offset = e.getBlockAtIndex(o.index).getBlockBreakPosition()) : (n = e.getBlockAtIndex(o.index), "\n" === n.text.getStringAtRange([o.offset - 1, o.offset]) ? o.offset -= 1 : o.offset = n.findLineBreakInDirectionFromPosition("forward", o.offset), o.offset !== n.getBlockBreakPosition() && (s = e.positionFromLocation(o), e = e.insertBlockBreakAtRange([s, s + 1]))), l = e.positionFromLocation©, r = e.positionFromLocation(o), t = i([l, r]), {n document: e,n range: tn };n }, c.prototype.convertLineBreaksToBlockBreaksInRange = function (t) {n var e, n, o;n return n = (t = i(t)), o = this.getStringAtRange(t).slice(0, -1), e = this, o.replace(/.*?\n/g, function (t) {n return n += t.length, e = e.insertBlockBreakAtRange([n - 1, n]);n }), {n document: e,n range: tn };n }, c.prototype.consolidateBlocksAtRange = function (t) {n var e, n, o, r, s;n return o = t = i(t), s = o, n = o, r = this.locationFromPosition(s).index, e = this.locationFromPosition(n).index, new this.constructor(this.blockList.consolidateFromIndexToIndex(r, e));n }, c.prototype.getDocumentAtRange = function (t) {n var e;n return t = i(t), e = this.blockList.getSplittableListInRange(t).toArray(), new this.constructor(e);n }, c.prototype.getStringAtRange = function (t) {n var e, n, o;n return o = t = i(t), n = o[o.length - 1], n !== this.getLength() && (e = -1), this.getDocumentAtRange(t).toString().slice(0, e);n }, c.prototype.getBlockAtIndex = function (t) {n return this.blockList.getObjectAtIndex(t);n }, c.prototype.getBlockAtPosition = function (t) {n var e;n return e = this.locationFromPosition(t).index, this.getBlockAtIndex(e);n }, c.prototype.getTextAtIndex = function (t) {n var e;n return null != (e = this.getBlockAtIndex(t)) ? e.text : void 0;n }, c.prototype.getTextAtPosition = function (t) {n var e;n return e = this.locationFromPosition(t).index, this.getTextAtIndex(e);n }, c.prototype.getPieceAtPosition = function (t) {n var e, n, i;n return i = this.locationFromPosition(t), e = i.index, n = i.offset, this.getTextAtIndex(e).getPieceAtPosition(n);n }, c.prototype.getCharacterAtPosition = function (t) {n var e, n, i;n return i = this.locationFromPosition(t), e = i.index, n = i.offset, this.getTextAtIndex(e).getStringAtRange([n, n + 1]);n }, c.prototype.getLength = function () {n return this.blockList.getEndPosition();n }, c.prototype.getBlocks = function () {n return this.blockList.toArray();n }, c.prototype.getBlockCount = function () {n return this.blockList.length;n }, c.prototype.getEditCount = function () {n return this.editCount;n }, c.prototype.eachBlock = function (t) {n return this.blockList.eachObject(t);n }, c.prototype.eachBlockAtRange = function (t, e) {n var n, o, r, s, a, u, c, l, h, p, d, f;n if (u = t = i(t), d = u, r = u, p = this.locationFromPosition(d), o = this.locationFromPosition®, p.index === o.index) return n = this.getBlockAtIndex(p.index), f = [p.offset, o.offset], e(n, f, p.index);nn for (h = [], a = s = c = p.index, l = o.index; l >= c ? l >= s : s >= l; a = l >= c ? ++s : –s) {n (n = this.getBlockAtIndex(a)) ? (f = function () {n switch (a) {n case p.index:n return [p.offset, n.text.getLength()];nn case o.index:n return [0, o.offset];nn default:n return [0, n.text.getLength()];n }n }(), h.push(e(n, f, a))) : h.push(void 0);n }nn return h;n }, c.prototype.getCommonAttributesAtRange = function (t) {n var n, r, s;n return r = (t = i(t)), o(t) ? this.getCommonAttributesAtPosition® : (s = [], n = [], this.eachBlockAtRange(t, function (t, e) {n return e !== e ? (s.push(t.text.getCommonAttributesAtRange(e)), n.push(l(t))) : void 0;n }), e.Hash.fromCommonAttributesOfObjects(s).merge(e.Hash.fromCommonAttributesOfObjects(n)).toObject());n }, c.prototype.getCommonAttributesAtPosition = function (t) {n var n, i, o, r, s, a, c, h, p, d;n if (p = this.locationFromPosition(t), s = p.index, h = p.offset, o = this.getBlockAtIndex(s), !o) return {};n r = l(o), n = o.text.getAttributesAtPosition(h), i = o.text.getAttributesAtPosition(h - 1), a = function () {n var t, n;n t = e.config.textAttributes, n = [];nn for (c in t) {n d = t, d.inheritable && n.push©;n }nn return n;n }();nn for (c in i) {n d = i, (d === n || u.call(a, c) >= 0) && (r = d);n }nn return r;n }, c.prototype.getRangeOfCommonAttributeAtPosition = function (t, e) {n var n, o, r, s, a, u, c, l, h;n return a = this.locationFromPosition(e), r = a.index, s = a.offset, h = this.getTextAtIndex®, u = h.getExpandedRangeForAttributeAtOffset(t, s), l = u, o = u, c = this.positionFromLocation({n index: r,n offset: ln }), n = this.positionFromLocation({n index: r,n offset: on }), i([c, n]);n }, c.prototype.getBaseBlockAttributes = function () {n var t, e, n, i, o, r, s;nn for (t = this.getBlockAtIndex(0).getAttributes(), n = i = 1, s = this.getBlockCount(); s >= 1 ? s > i : i > s; n = s >= 1 ? ++i : –i) {n e = this.getBlockAtIndex(n).getAttributes(), r = Math.min(t.length, e.length), t = function () {n var n, i, s;nn for (s = [], o = n = 0, i = r; (i >= 0 ? i > n : n > i) && e === t; o = i >= 0 ? ++n : –n) {n s.push(e);n }nn return s;n }();n }nn return t;n }, l = function l(t) {n var e, n;n return n = {}, (e = t.getLastAttribute()) && (n = !0), n;n }, c.prototype.getAttachmentById = function (t) {n var e, n, i, o;nn for (o = this.getAttachments(), n = 0, i = o.length; i > n; n++) {n if (e = o, e.id === t) return e;n }n }, c.prototype.getAttachmentPieces = function () {n var t;n return t = [], this.blockList.eachObject(function (e) {n var n;n return n = e.text, t = t.concat(n.getAttachmentPieces());n }), t;n }, c.prototype.getAttachments = function () {n var t, e, n, i, o;nn for (i = this.getAttachmentPieces(), o = [], t = 0, e = i.length; e > t; t++) {n n = i, o.push(n.attachment);n }nn return o;n }, c.prototype.getRangeOfAttachment = function (t) {n var e, n, o, r, s, a, u;nn for (r = 0, s = this.blockList.toArray(), n = e = 0, o = s.length; o > e; n = ++e) {n if (a = s.text, u = a.getRangeOfAttachment(t)) return i([r + u, r + u]);n r += a.getLength();n }n }, c.prototype.getLocationRangeOfAttachment = function (t) {n var e;n return e = this.getRangeOfAttachment(t), this.locationRangeFromRange(e);n }, c.prototype.getAttachmentPieceForAttachment = function (t) {n var e, n, i, o;nn for (o = this.getAttachmentPieces(), e = 0, n = o.length; n > e; e++) {n if (i = o, i.attachment === t) return i;n }n }, c.prototype.findRangesForBlockAttribute = function (t) {n var e, n, i, o, r, s, a;nn for (r = 0, s = [], a = this.getBlocks(), n = 0, i = a.length; i > n; n++) {n e = a, o = e.getLength(), e.hasAttribute(t) && s.push([r, r + o]), r += o;n }nn return s;n }, c.prototype.findRangesForTextAttribute = function (t, e) {n var n, i, o, r, s, a, u, c, l, h;nn for (h = (null != e ? e : {}).withValue, a = 0, u = [], c = [], r = function r(e) {n return null != h ? e.getAttribute(t) === h : e.hasAttribute(t);n }, l = this.getPieces(), n = 0, i = l.length; i > n; n++) {n s = l, o = s.getLength(), r(s) && (u === a ? u = a + o : c.push(u = [a, a + o])), a += o;n }nn return c;n }, c.prototype.locationFromPosition = function (t) {n var e, n;n return n = this.blockList.findIndexAndOffsetAtPosition(Math.max(0, t)), null != n.index ? n : (e = this.getBlocks(), {n index: e.length - 1,n offset: e[e.length - 1].getLength()n });n }, c.prototype.positionFromLocation = function (t) {n return this.blockList.findPositionAtIndexAndOffset(t.index, t.offset);n }, c.prototype.locationRangeFromPosition = function (t) {n return i(this.locationFromPosition(t));n }, c.prototype.locationRangeFromRange = function (t) {n var e, n, o, r;n if (t = i(t)) return r = t, n = t, o = this.locationFromPosition®, e = this.locationFromPosition(n), i([o, e]);n }, c.prototype.rangeFromLocationRange = function (t) {n var e, n;n return t = i(t), e = this.positionFromLocation(t), o(t) || (n = this.positionFromLocation(t)), i([e, n]);n }, c.prototype.isEqualTo = function (t) {n return this.blockList.isEqualTo(null != t ? t.blockList : void 0);n }, c.prototype.getTexts = function () {n var t, e, n, i, o;nn for (i = this.getBlocks(), o = [], e = 0, n = i.length; n > e; e++) {n t = i, o.push(t.text);n }nn return o;n }, c.prototype.getPieces = function () {n var t, e, n, i, o;nn for (n = [], i = this.getTexts(), t = 0, e = i.length; e > t; t++) {n o = i, n.push.apply(n, o.getPieces());n }nn return n;n }, c.prototype.getObjects = function () {n return this.getBlocks().concat(this.getTexts()).concat(this.getPieces());n }, c.prototype.toSerializableDocument = function () {n var t;n return t = [], this.blockList.eachObject(function (e) {n return t.push(e.copyWithText(e.text.toSerializableText()));n }), new this.constructor(t);n }, c.prototype.toString = function () {n return this.blockList.toString();n }, c.prototype.toJSON = function () {n return this.blockList.toJSON();n }, c.prototype.toConsole = function () {n var t;n return JSON.stringify(function () {n var e, n, i, o;nn for (i = this.blockList.toArray(), o = [], e = 0, n = i.length; n > e; e++) {n t = i, o.push(JSON.parse(t.text.toConsole()));n }nn return o;n }.call(this));n }, c;n }(e.Object);n }.call(this), function () {n e.LineBreakInsertion = function () {n function t(t) {n var e;n this.composition = t, this.document = this.composition.document, e = this.composition.getSelectedRange(), this.startPosition = e, this.endPosition = e, this.startLocation = this.document.locationFromPosition(this.startPosition), this.endLocation = this.document.locationFromPosition(this.endPosition), this.block = this.document.getBlockAtIndex(this.endLocation.index), this.breaksOnReturn = this.block.breaksOnReturn(), this.previousCharacter = this.block.text.getStringAtPosition(this.endLocation.offset - 1), this.nextCharacter = this.block.text.getStringAtPosition(this.endLocation.offset);n }nn return t.prototype.shouldInsertBlockBreak = function () {n return this.block.hasAttributes() && this.block.isListItem() && !this.block.isEmpty() ? 0 !== this.startLocation.offset : this.breaksOnReturn && "\n" !== this.nextCharacter;n }, t.prototype.shouldBreakFormattedBlock = function () {n return this.block.hasAttributes() && !this.block.isListItem() && (this.breaksOnReturn && "\n" === this.nextCharacter || "\n" === this.previousCharacter);n }, t.prototype.shouldDecreaseListLevel = function () {n return this.block.hasAttributes() && this.block.isListItem() && this.block.isEmpty();n }, t.prototype.shouldPrependListItem = function () {n return this.block.isListItem() && 0 === this.startLocation.offset && !this.block.isEmpty();n }, t.prototype.shouldRemoveLastBlockAttribute = function () {n return this.block.hasAttributes() && !this.block.isListItem() && this.block.isEmpty();n }, t;n }();n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a,n u,n c,n l,n h = function h(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n p.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n p = {}.hasOwnProperty;nn s = e.normalizeRange, c = e.rangesAreEqual, u = e.rangeIsCollapsed, a = e.objectsAreEqual, t = e.arrayStartsWith, l = e.summarizeArrayChange, i = e.getAllAttributeNames, o = e.getBlockConfig, r = e.getTextConfig, n = e.extend, e.Composition = function (p) {n function d() {n this.document = new e.Document(), this.attachments = [], this.currentAttributes = {}, this.revision = 0;n }nn var f;n return h(d, p), d.prototype.setDocument = function (t) {n var e;n return t.isEqualTo(this.document) ? void 0 : (this.document = t, this.refreshAttachments(), this.revision++, null != (e = this.delegate) && "function" == typeof e.compositionDidChangeDocument ? e.compositionDidChangeDocument(t) : void 0);n }, d.prototype.getSnapshot = function () {n return {n document: this.document,n selectedRange: this.getSelectedRange()n };n }, d.prototype.loadSnapshot = function (t) {n var n, i, o, r;n return n = t.document, r = t.selectedRange, null != (i = this.delegate) && "function" == typeof i.compositionWillLoadSnapshot && i.compositionWillLoadSnapshot(), this.setDocument(null != n ? n : new e.Document()), this.setSelection(null != r ? r : [0, 0]), null != (o = this.delegate) && "function" == typeof o.compositionDidLoadSnapshot ? o.compositionDidLoadSnapshot() : void 0;n }, d.prototype.insertText = function (t, e) {n var n, i, o, r;n return r = (null != e ? e : {n updatePosition: !0n }).updatePosition, i = this.getSelectedRange(), this.setDocument(this.document.insertTextAtRange(t, i)), o = i, n = o + t.getLength(), r && this.setSelection(n), this.notifyDelegateOfInsertionAtRange([o, n]);n }, d.prototype.insertBlock = function (t) {n var n;n return null == t && (t = new e.Block()), n = new e.Document(), this.insertDocument(n);n }, d.prototype.insertDocument = function (t) {n var n, i, o;n return null == t && (t = new e.Document()), i = this.getSelectedRange(), this.setDocument(this.document.insertDocumentAtRange(t, i)), o = i, n = o + t.getLength(), this.setSelection(n), this.notifyDelegateOfInsertionAtRange([o, n]);n }, d.prototype.insertString = function (t, n) {n var i, o;n return i = this.getCurrentTextAttributes(), o = e.Text.textForStringWithAttributes(t, i), this.insertText(o, n);n }, d.prototype.insertBlockBreak = function () {n var t, e, n;n return e = this.getSelectedRange(), this.setDocument(this.document.insertBlockBreakAtRange(e)), n = e, t = n + 1, this.setSelection(t), this.notifyDelegateOfInsertionAtRange([n, t]);n }, d.prototype.insertLineBreak = function () {n var t, n;n return n = new e.LineBreakInsertion(this), n.shouldDecreaseListLevel() ? (this.decreaseListLevel(), this.setSelection(n.startPosition)) : n.shouldPrependListItem() ? (t = new e.Document(), this.insertDocument(t)) : n.shouldInsertBlockBreak() ? this.insertBlockBreak() : n.shouldRemoveLastBlockAttribute() ? this.removeLastBlockAttribute() : n.shouldBreakFormattedBlock() ? this.breakFormattedBlock(n) : this.insertString("\n");n }, d.prototype.insertHTML = function (t) {n var n, i, o, r;n return n = e.Document.fromHTML(t), o = this.getSelectedRange(), this.setDocument(this.document.mergeDocumentAtRange(n, o)), r = o, i = r + n.getLength() - 1, this.setSelection(i), this.notifyDelegateOfInsertionAtRange([r, i]);n }, d.prototype.replaceHTML = function (t) {n var n, i, o;n return n = e.Document.fromHTML(t).copyUsingObjectsFromDocument(this.document), i = this.getLocationRange({n strict: !1n }), o = this.document.rangeFromLocationRange(i), this.setDocument(n), this.setSelection(o);n }, d.prototype.insertFile = function (t) {n return this.insertFiles();n }, d.prototype.insertFiles = function (t) {n var n, i, o, r, s, a;nn for (i = [], r = 0, s = t.length; s > r; r++) {n o = t, (null != (a = this.delegate) ? a.compositionShouldAcceptFile(o) : void 0) && (n = e.Attachment.attachmentForFile(o), i.push(n));n }nn return this.insertAttachments(i);n }, d.prototype.insertAttachment = function (t) {n return this.insertAttachments();n }, d.prototype.insertAttachments = function (t) {n var n, i, o, r, s, a, u, c, l;nn for (c = new e.Text(), r = 0, s = t.length; s > r; r++) {n n = t, l = n.getType(), a = null != (u = e.config.attachments) ? u.presentation : void 0, o = this.getCurrentTextAttributes(), a && (o.presentation = a), i = e.Text.textForAttachmentWithAttributes(n, o), c = c.appendText(i);n }nn return this.insertText©;n }, d.prototype.shouldManageDeletingInDirection = function (t) {n var e;nn if (e = this.getLocationRange(), u(e)) {n if ("backward" === t && 0 === e.offset) return !0;n if (this.shouldManageMovingCursorInDirection(t)) return !0;n } else if (e.index !== e.index) return !0;nn return !1;n }, d.prototype.deleteInDirection = function (t, e) {n var n, i, o, r, s, a, c, l;n return r = (null != e ? e : {}).length, s = this.getLocationRange(), a = this.getSelectedRange(), c = u(a), c ? o = "backward" === t && 0 === s.offset : l = s.index !== s.index, o && this.canDecreaseBlockAttributeLevel() && (i = this.getBlock(), i.isListItem() ? this.decreaseListLevel() : this.decreaseBlockAttributeLevel(), this.setSelection(a), i.isEmpty()) ? !1 : (c && (a = this.getExpandedRangeInDirection(t, {n length: rn }), "backward" === t && (n = this.getAttachmentAtRange(a))), n ? (this.editAttachment(n), !1) : (this.setDocument(this.document.removeTextAtRange(a)), this.setSelection(a), o || l ? !1 : void 0));n }, d.prototype.moveTextFromRange = function (t) {n var e;n return e = this.getSelectedRange(), this.setDocument(this.document.moveTextFromRangeToPosition(t, e)), this.setSelection(e);n }, d.prototype.removeAttachment = function (t) {n var e;n return (e = this.document.getRangeOfAttachment(t)) ? (this.stopEditingAttachment(), this.setDocument(this.document.removeTextAtRange(e)), this.setSelection(e)) : void 0;n }, d.prototype.removeLastBlockAttribute = function () {n var t, e, n, i;n return n = this.getSelectedRange(), i = n, e = n, t = this.document.getBlockAtPosition(e), this.removeCurrentAttribute(t.getLastAttribute()), this.setSelection(i);n }, f = " ", d.prototype.insertPlaceholder = function () {n return this.placeholderPosition = this.getPosition(), this.insertString(f);n }, d.prototype.selectPlaceholder = function () {n return null != this.placeholderPosition ? (this.setSelectedRange([this.placeholderPosition, this.placeholderPosition + f.length]), this.getSelectedRange()) : void 0;n }, d.prototype.forgetPlaceholder = function () {n return this.placeholderPosition = null;n }, d.prototype.hasCurrentAttribute = function (t) {n var e;n return e = this.currentAttributes, null != e && e !== !1;n }, d.prototype.toggleCurrentAttribute = function (t) {n var e;n return (e = !this.currentAttributes) ? this.setCurrentAttribute(t, e) : this.removeCurrentAttribute(t);n }, d.prototype.canSetCurrentAttribute = function (t) {n return o(t) ? this.canSetCurrentBlockAttribute(t) : this.canSetCurrentTextAttribute(t);n }, d.prototype.canSetCurrentTextAttribute = function () {n var t, e, n, i, o;nn if (e = this.getSelectedDocument()) {n for (o = e.getAttachments(), n = 0, i = o.length; i > n; n++) {n if (t = o, !t.hasContent()) return !1;n }nn return !0;n }n }, d.prototype.canSetCurrentBlockAttribute = function () {n var t;n if (t = this.getBlock()) return !t.isTerminalBlock();n }, d.prototype.setCurrentAttribute = function (t, e) {n return o(t) ? this.setBlockAttribute(t, e) : (this.setTextAttribute(t, e), this.currentAttributes = e, this.notifyDelegateOfCurrentAttributesChange());n }, d.prototype.setTextAttribute = function (t, n) {n var i, o, r, s;n if (o = this.getSelectedRange()) return r = o, i = o, r !== i ? this.setDocument(this.document.addAttributeAtRange(t, n, o)) : "href" === t ? (s = e.Text.textForStringWithAttributes(n, {n href: nn }), this.insertText(s)) : void 0;n }, d.prototype.setBlockAttribute = function (t, e) {n var n, i;n if (i = this.getSelectedRange()) return this.canSetCurrentAttribute(t) ? (n = this.getBlock(), this.setDocument(this.document.applyBlockAttributeAtRange(t, e, i)), this.setSelection(i)) : void 0;n }, d.prototype.removeCurrentAttribute = function (t) {n return o(t) ? (this.removeBlockAttribute(t), this.updateCurrentAttributes()) : (this.removeTextAttribute(t), delete this.currentAttributes, this.notifyDelegateOfCurrentAttributesChange());n }, d.prototype.removeTextAttribute = function (t) {n var e;n if (e = this.getSelectedRange()) return this.setDocument(this.document.removeAttributeAtRange(t, e));n }, d.prototype.removeBlockAttribute = function (t) {n var e;n if (e = this.getSelectedRange()) return this.setDocument(this.document.removeAttributeAtRange(t, e));n }, d.prototype.canDecreaseNestingLevel = function () {n var t;n return (null != (t = this.getBlock()) ? t.getNestingLevel() : void 0) > 0;n }, d.prototype.canIncreaseNestingLevel = function () {n var e, n, i;n if (e = this.getBlock()) return (null != (i = o(e.getLastNestableAttribute())) ? i.listAttribute : 0) ? (n = this.getPreviousBlock()) ? t(n.getListItemAttributes(), e.getListItemAttributes()) : void 0 : e.getNestingLevel() > 0;n }, d.prototype.decreaseNestingLevel = function () {n var t;n if (t = this.getBlock()) return this.setDocument(this.document.replaceBlock(t, t.decreaseNestingLevel()));n }, d.prototype.increaseNestingLevel = function () {n var t;n if (t = this.getBlock()) return this.setDocument(this.document.replaceBlock(t, t.increaseNestingLevel()));n }, d.prototype.canDecreaseBlockAttributeLevel = function () {n var t;n return (null != (t = this.getBlock()) ? t.getAttributeLevel() : void 0) > 0;n }, d.prototype.decreaseBlockAttributeLevel = function () {n var t, e;n return (t = null != (e = this.getBlock()) ? e.getLastAttribute() : void 0) ? this.removeCurrentAttribute(t) : void 0;n }, d.prototype.decreaseListLevel = function () {n var t, e, n, i, o, r;nn for (r = this.getSelectedRange(), o = this.document.locationFromPosition®.index, n = o, t = this.getBlock().getAttributeLevel(); (e = this.document.getBlockAtIndex(n + 1)) && e.isListItem() && e.getAttributeLevel() > t;) {n n++;n }nn return r = this.document.positionFromLocation({n index: o,n offset: 0n }), i = this.document.positionFromLocation({n index: n,n offset: 0n }), this.setDocument(this.document.removeLastListAttributeAtRange([r, i]));n }, d.prototype.updateCurrentAttributes = function () {n var t, e, n, o, r, s;nn if (s = this.getSelectedRange({n ignoreLock: !0n })) {n for (e = this.document.getCommonAttributesAtRange(s), r = i(), n = 0, o = r.length; o > n; n++) {n t = r, e || this.canSetCurrentAttribute(t) || (e = !1);n }nn if (!a(e, this.currentAttributes)) return this.currentAttributes = e, this.notifyDelegateOfCurrentAttributesChange();n }n }, d.prototype.getCurrentAttributes = function () {n return n.call({}, this.currentAttributes);n }, d.prototype.getCurrentTextAttributes = function () {n var t, e, n, i;n t = {}, n = this.currentAttributes;nn for (e in n) {n i = n, i !== !1 && r(e) && (t = i);n }nn return t;n }, d.prototype.freezeSelection = function () {n return this.setCurrentAttribute("frozen", !0);n }, d.prototype.thawSelection = function () {n return this.removeCurrentAttribute("frozen");n }, d.prototype.hasFrozenSelection = function () {n return this.hasCurrentAttribute("frozen");n }, d.proxyMethod("getSelectionManager().getPointRange"), d.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"), d.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"), d.proxyMethod("getSelectionManager().locationIsCursorTarget"), d.proxyMethod("getSelectionManager().selectionIsExpanded"), d.proxyMethod("delegate?.getSelectionManager"), d.prototype.setSelection = function (t) {n var e, n;n return e = this.document.locationRangeFromRange(t), null != (n = this.delegate) ? n.compositionDidRequestChangingSelectionToLocationRange(e) : void 0;n }, d.prototype.getSelectedRange = function () {n var t;n return (t = this.getLocationRange()) ? this.document.rangeFromLocationRange(t) : void 0;n }, d.prototype.setSelectedRange = function (t) {n var e;n return e = this.document.locationRangeFromRange(t), this.getSelectionManager().setLocationRange(e);n }, d.prototype.getPosition = function () {n var t;n return (t = this.getLocationRange()) ? this.document.positionFromLocation(t) : void 0;n }, d.prototype.getLocationRange = function (t) {n var e, n;n return null != (e = null != (n = this.targetLocationRange) ? n : this.getSelectionManager().getLocationRange(t)) ? e : s({n index: 0,n offset: 0n });n }, d.prototype.withTargetLocationRange = function (t, e) {n var n;n this.targetLocationRange = t;nn try {n n = e();n } finally {n this.targetLocationRange = null;n }nn return n;n }, d.prototype.withTargetRange = function (t, e) {n var n;n return n = this.document.locationRangeFromRange(t), this.withTargetLocationRange(n, e);n }, d.prototype.withTargetDOMRange = function (t, e) {n var n;n return n = this.createLocationRangeFromDOMRange(t, {n strict: !1n }), this.withTargetLocationRange(n, e);n }, d.prototype.getExpandedRangeInDirection = function (t, e) {n var n, i, o, r;n return i = (null != e ? e : {}).length, o = this.getSelectedRange(), r = o, n = o, "backward" === t ? i ? r -= i : r = this.translateUTF16PositionFromOffset(r, -1) : i ? n += i : n = this.translateUTF16PositionFromOffset(n, 1), s([r, n]);n }, d.prototype.shouldManageMovingCursorInDirection = function (t) {n var e;n return this.editingAttachment ? !0 : (e = this.getExpandedRangeInDirection(t), null != this.getAttachmentAtRange(e));n }, d.prototype.moveCursorInDirection = function (t) {n var e, n, i, o;n return this.editingAttachment ? i = this.document.getRangeOfAttachment(this.editingAttachment) : (o = this.getSelectedRange(), i = this.getExpandedRangeInDirection(t), n = !c(o, i)), this.setSelectedRange("backward" === t ? i : i), n && (e = this.getAttachmentAtRange(i)) ? this.editAttachment(e) : void 0;n }, d.prototype.expandSelectionInDirection = function (t, e) {n var n, i;n return n = (null != e ? e : {}).length, i = this.getExpandedRangeInDirection(t, {n length: nn }), this.setSelectedRange(i);n }, d.prototype.expandSelectionForEditing = function () {n return this.hasCurrentAttribute("href") ? this.expandSelectionAroundCommonAttribute("href") : void 0;n }, d.prototype.expandSelectionAroundCommonAttribute = function (t) {n var e, n;n return e = this.getPosition(), n = this.document.getRangeOfCommonAttributeAtPosition(t, e), this.setSelectedRange(n);n }, d.prototype.selectionContainsAttachments = function () {n var t;n return (null != (t = this.getSelectedAttachments()) ? t.length : void 0) > 0;n }, d.prototype.selectionIsInCursorTarget = function () {n return this.editingAttachment || this.positionIsCursorTarget(this.getPosition());n }, d.prototype.positionIsCursorTarget = function (t) {n var e;n return (e = this.document.locationFromPosition(t)) ? this.locationIsCursorTarget(e) : void 0;n }, d.prototype.positionIsBlockBreak = function (t) {n var e;n return null != (e = this.document.getPieceAtPosition(t)) ? e.isBlockBreak() : void 0;n }, d.prototype.getSelectedDocument = function () {n var t;n return (t = this.getSelectedRange()) ? this.document.getDocumentAtRange(t) : void 0;n }, d.prototype.getSelectedAttachments = function () {n var t;n return null != (t = this.getSelectedDocument()) ? t.getAttachments() : void 0;n }, d.prototype.getAttachments = function () {n return this.attachments.slice(0);n }, d.prototype.refreshAttachments = function () {n var t, e, n, i, o, r, s, a, u, c, h, p;nn for (n = this.document.getAttachments(), a = l(this.attachments, n), t = a.added, h = a.removed, this.attachments = n, i = 0, r = h.length; r > i; i++) {n e = h, e.delegate = null, null != (u = this.delegate) && "function" == typeof u.compositionDidRemoveAttachment && u.compositionDidRemoveAttachment(e);n }nn for (p = [], o = 0, s = t.length; s > o; o++) {n e = t, e.delegate = this, p.push(null != (c = this.delegate) && "function" == typeof c.compositionDidAddAttachment ? c.compositionDidAddAttachment(e) : void 0);n }nn return p;n }, d.prototype.attachmentDidChangeAttributes = function (t) {n var e;n return this.revision++, null != (e = this.delegate) && "function" == typeof e.compositionDidEditAttachment ? e.compositionDidEditAttachment(t) : void 0;n }, d.prototype.attachmentDidChangePreviewURL = function (t) {n var e;n return this.revision++, null != (e = this.delegate) && "function" == typeof e.compositionDidChangeAttachmentPreviewURL ? e.compositionDidChangeAttachmentPreviewURL(t) : void 0;n }, d.prototype.editAttachment = function (t, e) {n var n;n if (t !== this.editingAttachment) return this.stopEditingAttachment(), this.editingAttachment = t, null != (n = this.delegate) && "function" == typeof n.compositionDidStartEditingAttachment ? n.compositionDidStartEditingAttachment(this.editingAttachment, e) : void 0;n }, d.prototype.stopEditingAttachment = function () {n var t;n if (this.editingAttachment) return null != (t = this.delegate) && "function" == typeof t.compositionDidStopEditingAttachment && t.compositionDidStopEditingAttachment(this.editingAttachment), this.editingAttachment = null;n }, d.prototype.updateAttributesForAttachment = function (t, e) {n return this.setDocument(this.document.updateAttributesForAttachment(t, e));n }, d.prototype.removeAttributeForAttachment = function (t, e) {n return this.setDocument(this.document.removeAttributeForAttachment(t, e));n }, d.prototype.breakFormattedBlock = function (t) {n var n, i, o, r, s;n return i = t.document, n = t.block, r = t.startPosition, s = [r - 1, r], n.getBlockBreakPosition() === t.startLocation.offset ? (n.breaksOnReturn() && "\n" === t.nextCharacter ? r += 1 : i = i.removeTextAtRange(s), s = [r, r]) : "\n" === t.nextCharacter ? "\n" === t.previousCharacter ? s = [r - 1, r + 1] : (s = [r, r + 1], r += 1) : t.startLocation.offset - 1 !== 0 && (r += 1), o = new e.Document(), this.setDocument(i.insertDocumentAtRange(o, s)), this.setSelection®;n }, d.prototype.getPreviousBlock = function () {n var t, e;n return (e = this.getLocationRange()) && (t = e.index, t > 0) ? this.document.getBlockAtIndex(t - 1) : void 0;n }, d.prototype.getBlock = function () {n var t;n return (t = this.getLocationRange()) ? this.document.getBlockAtIndex(t.index) : void 0;n }, d.prototype.getAttachmentAtRange = function (t) {n var n;n return n = this.document.getDocumentAtRange(t), n.toString() === e.OBJECT_REPLACEMENT_CHARACTER + "\n" ? n.getAttachments() : void 0;n }, d.prototype.notifyDelegateOfCurrentAttributesChange = function () {n var t;n return null != (t = this.delegate) && "function" == typeof t.compositionDidChangeCurrentAttributes ? t.compositionDidChangeCurrentAttributes(this.currentAttributes) : void 0;n }, d.prototype.notifyDelegateOfInsertionAtRange = function (t) {n var e;n return null != (e = this.delegate) && "function" == typeof e.compositionDidPerformInsertionAtRange ? e.compositionDidPerformInsertionAtRange(t) : void 0;n }, d.prototype.translateUTF16PositionFromOffset = function (t, e) {n var n, i;n return i = this.document.toUTF16String(), n = i.offsetFromUCS2Offset(t), i.offsetToUCS2Offset(n + e);n }, d;n }(e.BasicObject);n }.call(this), function () {n var t = function t(_t18, e) {n function i() {n this.constructor = _t18;n }nn for (var o in e) {n n.call(e, o) && (_t18 = e);n }nn return i.prototype = e.prototype, _t18.prototype = new i(), t18._super__ = e.prototype, _t18;n },n n = {}.hasOwnProperty;nn e.UndoManager = function (e) {n function n(t) {n this.composition = t, this.undoEntries = [], this.redoEntries = [];n }nn var i;n return t(n, e), n.prototype.recordUndoEntry = function (t, e) {n var n, o, r, s, a;n return s = null != e ? e : {}, o = s.context, n = s.consolidatable, r = this.undoEntries.slice(-1), n && i(r, t, o) ? void 0 : (a = this.createEntry({n description: t,n context: on }), this.undoEntries.push(a), this.redoEntries = []);n }, n.prototype.undo = function () {n var t, e;n return (e = this.undoEntries.pop()) ? (t = this.createEntry(e), this.redoEntries.push(t), this.composition.loadSnapshot(e.snapshot)) : void 0;n }, n.prototype.redo = function () {n var t, e;n return (t = this.redoEntries.pop()) ? (e = this.createEntry(t), this.undoEntries.push(e), this.composition.loadSnapshot(t.snapshot)) : void 0;n }, n.prototype.canUndo = function () {n return this.undoEntries.length > 0;n }, n.prototype.canRedo = function () {n return this.redoEntries.length > 0;n }, n.prototype.createEntry = function (t) {n var e, n, i;n return i = null != t ? t : {}, n = i.description, e = i.context, {n description: null != n ? n.toString() : void 0,n context: JSON.stringify(e),n snapshot: this.composition.getSnapshot()n };n }, i = function i(t, e, n) {n return (null != t ? t.description : void 0) === (null != e ? e.toString() : void 0) && (null != t ? t.context : void 0) === JSON.stringify(n);n }, n;n }(e.BasicObject);n }.call(this), function () {n var t;n e.attachmentGalleryFilter = function (e) {n var n;n return n = new t(e), n.perform(), n.getSnapshot();n }, t = function () {n function t(t) {n this.document = t.document, this.selectedRange = t.selectedRange;n }nn var e, n, i;n return e = "attachmentGallery", n = "presentation", i = "gallery", t.prototype.perform = function () {n return this.removeBlockAttribute(), this.applyBlockAttribute();n }, t.prototype.getSnapshot = function () {n return {n document: this.document,n selectedRange: this.selectedRangen };n }, t.prototype.removeBlockAttribute = function () {n var t, n, i, o, r;nn for (o = this.findRangesOfBlocks(), r = [], t = 0, n = o.length; n > t; t++) {n i = o, r.push(this.document = this.document.removeAttributeAtRange(e, i));n }nn return r;n }, t.prototype.applyBlockAttribute = function () {n var t, n, i, o, r, s;nn for (i = 0, r = this.findRangesOfPieces(), s = [], t = 0, n = r.length; n > t; t++) {n o = r, o - o > 1 && (o += i, o += i, "\n" !== this.document.getCharacterAtPosition(o) && (this.document = this.document.insertBlockBreakAtRange(o), o < this.selectedRange && this.moveSelectedRangeForward(), o++, i++), 0 !== o && "\n" !== this.document.getCharacterAtPosition(o - 1) && (this.document = this.document.insertBlockBreakAtRange(o), o < this.selectedRange && this.moveSelectedRangeForward(), o++, i++), s.push(this.document = this.document.applyBlockAttributeAtRange(e, !0, o)));n }nn return s;n }, t.prototype.findRangesOfBlocks = function () {n return this.document.findRangesForBlockAttribute(e);n }, t.prototype.findRangesOfPieces = function () {n return this.document.findRangesForTextAttribute(n, {n withValue: in });n }, t.prototype.moveSelectedRangeForward = function () {n return this.selectedRange += 1, this.selectedRange += 1;n }, t;n }();n }.call(this), function () {n var t = function t(_t19, e) {n return function () {n return _t19.apply(e, arguments);n };n };nn e.Editor = function () {n function n(n, o, r) {n this.composition = n, this.selectionManager = o, this.element = r, this.insertFiles = t(this.insertFiles, this), this.undoManager = new e.UndoManager(this.composition), this.filters = i.slice(0);n }nn var i;n return i = [e.attachmentGalleryFilter], n.prototype.loadDocument = function (t) {n return this.loadSnapshot({n document: t,n selectedRange: [0, 0]n });n }, n.prototype.loadHTML = function (t) {n return null == t && (t = ""), this.loadDocument(e.Document.fromHTML(t, {n referenceElement: this.elementn }));n }, n.prototype.loadJSON = function (t) {n var n, i;n return n = t.document, i = t.selectedRange, n = e.Document.fromJSON(n), this.loadSnapshot({n document: n,n selectedRange: in });n }, n.prototype.loadSnapshot = function (t) {n return this.undoManager = new e.UndoManager(this.composition), this.composition.loadSnapshot(t);n }, n.prototype.getDocument = function () {n return this.composition.document;n }, n.prototype.getSelectedDocument = function () {n return this.composition.getSelectedDocument();n }, n.prototype.getSnapshot = function () {n return this.composition.getSnapshot();n }, n.prototype.toJSON = function () {n return this.getSnapshot();n }, n.prototype.deleteInDirection = function (t) {n return this.composition.deleteInDirection(t);n }, n.prototype.insertAttachment = function (t) {n return this.composition.insertAttachment(t);n }, n.prototype.insertDocument = function (t) {n return this.composition.insertDocument(t);n }, n.prototype.insertFile = function (t) {n return this.composition.insertFile(t);n }, n.prototype.insertFiles = function (t) {n return this.composition.insertFiles(t);n }, n.prototype.insertHTML = function (t) {n return this.composition.insertHTML(t);n }, n.prototype.insertString = function (t) {n return this.composition.insertString(t);n }, n.prototype.insertText = function (t) {n return this.composition.insertText(t);n }, n.prototype.insertLineBreak = function () {n return this.composition.insertLineBreak();n }, n.prototype.getSelectedRange = function () {n return this.composition.getSelectedRange();n }, n.prototype.getPosition = function () {n return this.composition.getPosition();n }, n.prototype.getClientRectAtPosition = function (t) {n var e;n return e = this.getDocument().locationRangeFromRange([t, t + 1]), this.selectionManager.getClientRectAtLocationRange(e);n }, n.prototype.expandSelectionInDirection = function (t) {n return this.composition.expandSelectionInDirection(t);n }, n.prototype.moveCursorInDirection = function (t) {n return this.composition.moveCursorInDirection(t);n }, n.prototype.setSelectedRange = function (t) {n return this.composition.setSelectedRange(t);n }, n.prototype.activateAttribute = function (t, e) {n return null == e && (e = !0), this.composition.setCurrentAttribute(t, e);n }, n.prototype.attributeIsActive = function (t) {n return this.composition.hasCurrentAttribute(t);n }, n.prototype.canActivateAttribute = function (t) {n return this.composition.canSetCurrentAttribute(t);n }, n.prototype.deactivateAttribute = function (t) {n return this.composition.removeCurrentAttribute(t);n }, n.prototype.canDecreaseNestingLevel = function () {n return this.composition.canDecreaseNestingLevel();n }, n.prototype.canIncreaseNestingLevel = function () {n return this.composition.canIncreaseNestingLevel();n }, n.prototype.decreaseNestingLevel = function () {n return this.canDecreaseNestingLevel() ? this.composition.decreaseNestingLevel() : void 0;n }, n.prototype.increaseNestingLevel = function () {n return this.canIncreaseNestingLevel() ? this.composition.increaseNestingLevel() : void 0;n }, n.prototype.canRedo = function () {n return this.undoManager.canRedo();n }, n.prototype.canUndo = function () {n return this.undoManager.canUndo();n }, n.prototype.recordUndoEntry = function (t, e) {n var n, i, o;n return o = null != e ? e : {}, i = o.context, n = o.consolidatable, this.undoManager.recordUndoEntry(t, {n context: i,n consolidatable: nn });n }, n.prototype.redo = function () {n return this.canRedo() ? this.undoManager.redo() : void 0;n }, n.prototype.undo = function () {n return this.canUndo() ? this.undoManager.undo() : void 0;n }, n;n }();n }.call(this), function () {n var t = function t(_t20, e) {n function i() {n this.constructor = _t20;n }nn for (var o in e) {n n.call(e, o) && (_t20 = e);n }nn return i.prototype = e.prototype, _t20.prototype = new i(), t20._super__ = e.prototype, _t20;n },n n = {}.hasOwnProperty;nn e.ManagedAttachment = function (e) {n function n(t, e) {n var n;n this.attachmentManager = t, this.attachment = e, n = this.attachment, this.id = n.id, this.file = n.file;n }nn return t(n, e), n.prototype.remove = function () {n return this.attachmentManager.requestRemovalOfAttachment(this.attachment);n }, n.proxyMethod("attachment.getAttribute"), n.proxyMethod("attachment.hasAttribute"), n.proxyMethod("attachment.setAttribute"), n.proxyMethod("attachment.getAttributes"), n.proxyMethod("attachment.setAttributes"), n.proxyMethod("attachment.isPending"), n.proxyMethod("attachment.isPreviewable"), n.proxyMethod("attachment.getURL"), n.proxyMethod("attachment.getHref"), n.proxyMethod("attachment.getFilename"), n.proxyMethod("attachment.getFilesize"), n.proxyMethod("attachment.getFormattedFilesize"), n.proxyMethod("attachment.getExtension"), n.proxyMethod("attachment.getContentType"), n.proxyMethod("attachment.getFile"), n.proxyMethod("attachment.setFile"), n.proxyMethod("attachment.releaseFile"), n.proxyMethod("attachment.getUploadProgress"), n.proxyMethod("attachment.setUploadProgress"), n;n }(e.BasicObject);n }.call(this), function () {n var t = function t(_t21, e) {n function i() {n this.constructor = _t21;n }nn for (var o in e) {n n.call(e, o) && (_t21 = e);n }nn return i.prototype = e.prototype, _t21.prototype = new i(), t21._super__ = e.prototype, _t21;n },n n = {}.hasOwnProperty;nn e.AttachmentManager = function (n) {n function i(t) {n var e, n, i;nn for (null == t && (t = []), this.managedAttachments = {}, n = 0, i = t.length; i > n; n++) {n e = t, this.manageAttachment(e);n }n }nn return t(i, n), i.prototype.getAttachments = function () {n var t, e, n, i;n n = this.managedAttachments, i = [];nn for (e in n) {n t = n, i.push(t);n }nn return i;n }, i.prototype.manageAttachment = function (t) {n var n, i;n return null != (n = this.managedAttachments)[i = t.id] ? n : n = new e.ManagedAttachment(this, t);n }, i.prototype.attachmentIsManaged = function (t) {n return t.id in this.managedAttachments;n }, i.prototype.requestRemovalOfAttachment = function (t) {n var e;n return this.attachmentIsManaged(t) && null != (e = this.delegate) && "function" == typeof e.attachmentManagerDidRequestRemovalOfAttachment ? e.attachmentManagerDidRequestRemovalOfAttachment(t) : void 0;n }, i.prototype.unmanageAttachment = function (t) {n var e;n return e = this.managedAttachments, delete this.managedAttachments, e;n }, i;n }(e.BasicObject);n }.call(this), function () {n var t, n, i, o, r, s, a, u, c, l, h;n t = e.elementContainsNode, n = e.findChildIndexOfNode, r = e.nodeIsBlockStart, s = e.nodeIsBlockStartComment, o = e.nodeIsBlockContainer, a = e.nodeIsCursorTarget, u = e.nodeIsEmptyTextNode, c = e.nodeIsTextNode, i = e.nodeIsAttachmentElement, l = e.tagName, h = e.walkTree, e.LocationMapper = function () {n function e(t) {n this.element = t;n }nn var p, d, f, g;n return e.prototype.findLocationFromContainerAndOffset = function (e, i, o) {n var s, u, l, p, g, m, v;nn for (m = (null != o ? o : {n strict: !0n }).strict, u = 0, l = !1, p = {n index: 0,n offset: 0n }, (s = this.findAttachmentElementParentForNode(e)) && (e = s.parentNode, i = n(s)), v = h(this.element, {n usingFilter: fn }); v.nextNode();) {n if (g = v.currentNode, g === e && c(e)) {n a(g) || (p.offset += i);n break;n }nn if (g.parentNode === e) {n if (u++ === i) break;n } else if (!t(e, g) && u > 0) break;nn r(g, {n strict: mn }) ? (l && p.index++, p.offset = 0, l = !0) : p.offset += d(g);n }nn return p;n }, e.prototype.findContainerAndOffsetFromLocation = function (t) {n var e, i, s, u, l;nn if (0 === t.index && 0 === t.offset) {n for (e = this.element, u = 0; e.firstChild;) {n if (e = e.firstChild, o(e)) {n u = 1;n break;n }n }nn return [e, u];n }nn if (l = this.findNodeAndOffsetFromLocation(t), i = l, s = l, i) {n if (c(i)) 0 === d(i) ? (e = i.parentNode.parentNode, u = n(i.parentNode), a(i, {n name: "right"n }) && u++) : (e = i, u = t.offset - s);else {n if (e = i.parentNode, !r(i.previousSibling) && !o(e)) for (; i === e.lastChild && (i = e, e = e.parentNode, !o(e));) {n ;n }n u = n(i), 0 !== t.offset && u++;n }n return [e, u];n }n }, e.prototype.findNodeAndOffsetFromLocation = function (t) {n var e, n, i, o, r, s, u, l;nn for (u = 0, l = this.getSignificantNodesForIndex(t.index), n = 0, i = l.length; i > n; n++) {n if (e = l, o = d(e), t.offset <= u + o) if (c(e)) {n if (r = e, s = u, t.offset === s && a®) break;n } else r || (r = e, s = u);n if (u += o, u > t.offset) break;n }nn return [r, s];n }, e.prototype.findAttachmentElementParentForNode = function (t) {n for (; t && t !== this.element;) {n if (i(t)) return t;n t = t.parentNode;n }n }, e.prototype.getSignificantNodesForIndex = function (t) {n var e, n, i, o, r;nn for (i = [], r = h(this.element, {n usingFilter: pn }), o = !1; r.nextNode();) {n if (n = r.currentNode, s(n)) {n if ("undefined" != typeof e && null !== e ? e++ : e = 0, e === t) o = !0;else if (o) break;n } else o && i.push(n);n }nn return i;n }, d = function d(t) {n var e;n return t.nodeType === Node.TEXT_NODE ? a(t) ? 0 : (e = t.textContent, e.length) : "br" === l(t) || i(t) ? 1 : 0;n }, p = function p(t) {n return g(t) === NodeFilter.FILTER_ACCEPT ? f(t) : NodeFilter.FILTER_REJECT;n }, g = function g(t) {n return u(t) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;n }, f = function f(t) {n return i(t.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;n }, e;n }();n }.call(this), function () {n var t,n n,n i = [].slice;n t = e.getDOMRange, n = e.setDOMRange, e.PointMapper = function () {n function e() {}nn return e.prototype.createDOMRangeFromPoint = function (e) {n var i, o, r, s, a, u, c, l;n if (c = e.x, l = e.y, document.caretPositionFromPoint) return a = document.caretPositionFromPoint(c, l), r = a.offsetNode, o = a.offset, i = document.createRange(), i.setStart(r, o), i;n if (document.caretRangeFromPoint) return document.caretRangeFromPoint(c, l);nn if (document.body.createTextRange) {n s = t();nn try {n u = document.body.createTextRange(), u.moveToPoint(c, l), u.select();n } catch (h) {}nn return i = t(), n(s), i;n }n }, e.prototype.getClientRectsForDOMRange = function (t) {n var e, n, o;n return n = i.call(t.getClientRects()), o = n, e = n[n.length - 1], [o, e];n }, e;n }();n }.call(this), function () {n var t,n n = function n(t, e) {n return function () {n return t.apply(e, arguments);n };n },n i = function i(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n o.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n o = {}.hasOwnProperty,n r = [].indexOf || function (t) {n for (var e = 0, n = this.length; n > e; e++) {n if (e in this && this === t) return e;n }nn return -1;n };nn t = e.getDOMRange, e.SelectionChangeObserver = function (e) {n function o() {n this.run = n(this.run, this), this.update = n(this.update, this), this.selectionManagers = [];n }nn var s;n return i(o, e), o.prototype.start = function () {n return this.started ? void 0 : (this.started = !0, "onselectionchange" in document ? document.addEventListener("selectionchange", this.update, !0) : this.run());n }, o.prototype.stop = function () {n return this.started ? (this.started = !1, document.removeEventListener("selectionchange", this.update, !0)) : void 0;n }, o.prototype.registerSelectionManager = function (t) {n return r.call(this.selectionManagers, t) < 0 ? (this.selectionManagers.push(t), this.start()) : void 0;n }, o.prototype.unregisterSelectionManager = function (t) {n var e;n return this.selectionManagers = function () {n var n, i, o, r;nn for (o = this.selectionManagers, r = [], n = 0, i = o.length; i > n; n++) {n e = o, e !== t && r.push(e);n }nn return r;n }.call(this), 0 === this.selectionManagers.length ? this.stop() : void 0;n }, o.prototype.notifySelectionManagersOfSelectionChange = function () {n var t, e, n, i, o;nn for (n = this.selectionManagers, i = [], t = 0, e = n.length; e > t; t++) {n o = n, i.push(o.selectionDidChange());n }nn return i;n }, o.prototype.update = function () {n var e;n return e = t(), s(e, this.domRange) ? void 0 : (this.domRange = e, this.notifySelectionManagersOfSelectionChange());n }, o.prototype.reset = function () {n return this.domRange = null, this.update();n }, o.prototype.run = function () {n return this.started ? (this.update(), requestAnimationFrame(this.run)) : void 0;n }, s = function s(t, e) {n return (null != t ? t.startContainer : void 0) === (null != e ? e.startContainer : void 0) && (null != t ? t.startOffset : void 0) === (null != e ? e.startOffset : void 0) && (null != t ? t.endContainer : void 0) === (null != e ? e.endContainer : void 0) && (null != t ? t.endOffset : void 0) === (null != e ? e.endOffset : void 0);n }, o;n }(e.BasicObject), null == e.selectionChangeObserver && (e.selectionChangeObserver = new e.SelectionChangeObserver());n }.call(this), function () {n var t,n n,n i,n o,n r,n s,n a,n u,n c,n l,n h = function h(t, e) {n return function () {n return t.apply(e, arguments);n };n },n p = function p(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n d.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n d = {}.hasOwnProperty;nn i = e.getDOMSelection, n = e.getDOMRange, l = e.setDOMRange, t = e.elementContainsNode, s = e.nodeIsCursorTarget, r = e.innerElementIsActive, o = e.handleEvent, a = e.normalizeRange, u = e.rangeIsCollapsed, c = e.rangesAreEqual, e.SelectionManager = function (d) {n function f(t) {n this.element = t, this.selectionDidChange = h(this.selectionDidChange, this), this.didMouseDown = h(this.didMouseDown, this), this.locationMapper = new e.LocationMapper(this.element), this.pointMapper = new e.PointMapper(), this.lockCount = 0, o("mousedown", {n onElement: this.element,n withCallback: this.didMouseDownn });n }nn return p(f, d), f.prototype.getLocationRange = function (t) {n var e, i;n return null == t && (t = {}), e = t.strict === !1 ? this.createLocationRangeFromDOMRange(n(), {n strict: !1n }) : t.ignoreLock ? this.currentLocationRange : null != (i = this.lockedLocationRange) ? i : this.currentLocationRange;n }, f.prototype.setLocationRange = function (t) {n var e;n if (!this.lockedLocationRange) return t = a(t), (e = this.createDOMRangeFromLocationRange(t)) ? (l(e), this.updateCurrentLocationRange(t)) : void 0;n }, f.prototype.setLocationRangeFromPointRange = function (t) {n var e, n;n return t = a(t), n = this.getLocationAtPoint(t), e = this.getLocationAtPoint(t), this.setLocationRange([n, e]);n }, f.prototype.getClientRectAtLocationRange = function (t) {n var e;n return (e = this.createDOMRangeFromLocationRange(t)) ? this.getClientRectsForDOMRange(e) : void 0;n }, f.prototype.locationIsCursorTarget = function (t) {n var e, n, i;n return i = this.findNodeAndOffsetFromLocation(t), e = i, n = i, s(e);n }, f.prototype.lock = function () {n return 0 === this.lockCount++ ? (this.updateCurrentLocationRange(), this.lockedLocationRange = this.getLocationRange()) : void 0;n }, f.prototype.unlock = function () {n var t;n return 0 === –this.lockCount && (t = this.lockedLocationRange, this.lockedLocationRange = null, null != t) ? this.setLocationRange(t) : void 0;n }, f.prototype.clearSelection = function () {n var t;n return null != (t = i()) ? t.removeAllRanges() : void 0;n }, f.prototype.selectionIsCollapsed = function () {n var t;n return (null != (t = n()) ? t.collapsed : void 0) === !0;n }, f.prototype.selectionIsExpanded = function () {n return !this.selectionIsCollapsed();n }, f.prototype.createLocationRangeFromDOMRange = function (t, e) {n var n, i;n if (null != t && this.domRangeWithinElement(t) && (i = this.findLocationFromContainerAndOffset(t.startContainer, t.startOffset, e))) return t.collapsed || (n = this.findLocationFromContainerAndOffset(t.endContainer, t.endOffset, e)), a([i, n]);n }, f.proxyMethod("locationMapper.findLocationFromContainerAndOffset"), f.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"), f.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"), f.proxyMethod("pointMapper.createDOMRangeFromPoint"), f.proxyMethod("pointMapper.getClientRectsForDOMRange"), f.prototype.didMouseDown = function () {n return this.pauseTemporarily();n }, f.prototype.pauseTemporarily = function () {n var e, n, i, r;n return this.paused = !0, n = function (e) {n return function () {n var n, o, s;nn for (e.paused = !1, clearTimeout®, o = 0, s = i.length; s > o; o++) {n n = i, n.destroy();n }nn return t(document, e.element) ? e.selectionDidChange() : void 0;n };n }(this), r = setTimeout(n, 200), i = function () {n var t, i, r, s;nn for (r = ["mousemove", "keydown"], s = [], t = 0, i = r.length; i > t; t++) {n e = r, s.push(o(e, {n onElement: document,n withCallback: nn }));n }nn return s;n }();n }, f.prototype.selectionDidChange = function () {n return this.paused || r(this.element) ? void 0 : this.updateCurrentLocationRange();n }, f.prototype.updateCurrentLocationRange = function (t) {n var e;n return (null != t ? t : t = this.createLocationRangeFromDOMRange(n())) && !c(t, this.currentLocationRange) ? (this.currentLocationRange = t, null != (e = this.delegate) && "function" == typeof e.locationRangeDidChange ? e.locationRangeDidChange(this.currentLocationRange.slice(0)) : void 0) : void 0;n }, f.prototype.createDOMRangeFromLocationRange = function (t) {n var e, n, i, o;n return i = this.findContainerAndOffsetFromLocation(t), n = u(t) ? i : null != (o = this.findContainerAndOffsetFromLocation(t)) ? o : i, null != i && null != n ? (e = document.createRange(), e.setStart.apply(e, i), e.setEnd.apply(e, n), e) : void 0;n }, f.prototype.getLocationAtPoint = function (t) {n var e, n;n return (e = this.createDOMRangeFromPoint(t)) && null != (n = this.createLocationRangeFromDOMRange(e)) ? n : void 0;n }, f.prototype.domRangeWithinElement = function (e) {n return e.collapsed ? t(this.element, e.startContainer) : t(this.element, e.startContainer) && t(this.element, e.endContainer);n }, f;n }(e.BasicObject);n }.call(this), function () {n var t,n n,n i,n o,n r = function r(t, e) {n function n() {n this.constructor = t;n }nn for (var i in e) {n s.call(e, i) && (t = e);n }nn return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;n },n s = {}.hasOwnProperty,n a = [].slice;nn i = e.rangeIsCollapsed, o = e.rangesAreEqual, n = e.objectsAreEqual, t = e.getBlockConfig, e.EditorController = function (s) {n function u(t) {n var n, i;n this.editorElement = t.editorElement, n = t.document, i = t.html, this.selectionManager = new e.SelectionManager(this.editorElement), this.selectionManager.delegate = this, this.composition = new e.Composition(), this.composition.delegate = this, this.attachmentManager = new e.AttachmentManager(this.composition.getAttachments()), this.attachmentManager.delegate = this, this.inputController = new e["Level" + e.config.input.getLevel() + "InputController"](this.editorElement), this.inputController.delegate = this, this.inputController.responder = this.composition, this.compositionController = new e.CompositionController(this.editorElement, this.composition), this.compositionController.delegate = this, this.toolbarController = new e.ToolbarController(this.editorElement.toolbarElement), this.toolbarController.delegate = this, this.editor = new e.Editor(this.composition, this.selectionManager, this.editorElement), null != n ? this.editor.loadDocument(n) : this.editor.loadHTML(i);n }nn var c;n return r(u, s), u.prototype.registerSelectionManager = function () {n return e.selectionChangeObserver.registerSelectionManager(this.selectionManager);n }, u.prototype.unregisterSelectionManager = function () {n return e.selectionChangeObserver.unregisterSelectionManager(this.selectionManager);n }, u.prototype.render = function () {n return this.compositionController.render();n }, u.prototype.reparse = function () {n return this.composition.replaceHTML(this.editorElement.innerHTML);n }, u.prototype.compositionDidChangeDocument = function () {n return this.notifyEditorElement("document-change"), this.handlingInput ? void 0 : this.render();n }, u.prototype.compositionDidChangeCurrentAttributes = function (t) {n return this.currentAttributes = t, this.toolbarController.updateAttributes(this.currentAttributes), this.updateCurrentActions(), this.notifyEditorElement("attributes-change", {n attributes: this.currentAttributesn });n }, u.prototype.compositionDidPerformInsertionAtRange = function (t) {n return this.pasting ? this.pastedRange = t : void 0;n }, u.prototype.compositionShouldAcceptFile = function (t) {n return this.notifyEditorElement("file-accept", {n file: tn });n }, u.prototype.compositionDidAddAttachment = function (t) {n var e;n return e = this.attachmentManager.manageAttachment(t), this.notifyEditorElement("attachment-add", {n attachment: en });n }, u.prototype.compositionDidEditAttachment = function (t) {n var e;n return this.compositionController.rerenderViewForObject(t), e = this.attachmentManager.manageAttachment(t), this.notifyEditorElement("attachment-edit", {n attachment: en }), this.notifyEditorElement("change");n }, u.prototype.compositionDidChangeAttachmentPreviewURL = function (t) {n return this.compositionController.invalidateViewForObject(t), this.notifyEditorElement("change");n }, u.prototype.compositionDidRemoveAttachment = function (t) {n var e;n return e = this.attachmentManager.unmanageAttachment(t), this.notifyEditorElement("attachment-remove", {n attachment: en });n }, u.prototype.compositionDidStartEditingAttachment = function (t, e) {n return this.attachmentLocationRange = this.composition.document.getLocationRangeOfAttachment(t), this.compositionController.installAttachmentEditorForAttachment(t, e), this.selectionManager.setLocationRange(this.attachmentLocationRange);n }, u.prototype.compositionDidStopEditingAttachment = function () {n return this.compositionController.uninstallAttachmentEditor(), this.attachmentLocationRange = null;n }, u.prototype.compositionDidRequestChangingSelectionToLocationRange = function (t) {n return !this.loadingSnapshot || this.isFocused() ? (this.requestedLocationRange = t, this.compositionRevisionWhenLocationRangeRequested = this.composition.revision, this.handlingInput ? void 0 : this.render()) : void 0;n }, u.prototype.compositionWillLoadSnapshot = function () {n return this.loadingSnapshot = !0;n }, u.prototype.compositionDidLoadSnapshot = function () {n return this.compositionController.refreshViewCache(), this.render(), this.loadingSnapshot = !1;n }, u.prototype.getSelectionManager = function () {n return this.selectionManager;n }, u.proxyMethod("getSelectionManager().setLocationRange"), u.proxyMethod("getSelectionManager().getLocationRange"), u.prototype.attachmentManagerDidRequestRemovalOfAttachment = function (t) {n return this.removeAttachment(t);n }, u.prototype.compositionControllerWillSyncDocumentView = function () {n return this.inputController.editorWillSyncDocumentView(), this.selectionManager.lock(), this.selectionManager.clearSelection();n }, u.prototype.compositionControllerDidSyncDocumentView = function () {n return this.inputController.editorDidSyncDocumentView(), this.selectionManager.unlock(), this.updateCurrentActions(), this.notifyEditorElement("sync");n }, u.prototype.compositionControllerDidRender = function () {n return null != this.requestedLocationRange && (this.compositionRevisionWhenLocationRangeRequested === this.composition.revision && this.selectionManager.setLocationRange(this.requestedLocationRange), this.requestedLocationRange = null, this.compositionRevisionWhenLocationRangeRequested = null), this.renderedCompositionRevision !== this.composition.revision && (this.runEditorFilters(), this.composition.updateCurrentAttributes(), this.notifyEditorElement("render")), this.renderedCompositionRevision = this.composition.revision;n }, u.prototype.compositionControllerDidFocus = function () {n return this.toolbarController.hideDialog(), this.notifyEditorElement("focus");n }, u.prototype.compositionControllerDidBlur = function () {n return this.notifyEditorElement("blur");n }, u.prototype.compositionControllerDidSelectAttachment = function (t, e) {n return this.composition.editAttachment(t, e);n }, u.prototype.compositionControllerDidRequestDeselectingAttachment = function (t) {n var e, n;n return e = null != (n = this.attachmentLocationRange) ? n : this.composition.document.getLocationRangeOfAttachment(t), this.selectionManager.setLocationRange(e);n }, u.prototype.compositionControllerWillUpdateAttachment = function (t) {n return this.editor.recordUndoEntry("Edit Attachment", {n context: t.id,n consolidatable: !0n });n }, u.prototype.compositionControllerDidRequestRemovalOfAttachment = function (t) {n return this.removeAttachment(t);n }, u.prototype.inputControllerWillHandleInput = function () {n return this.handlingInput = !0, this.requestedRender = !1;n }, u.prototype.inputControllerDidRequestRender = function () {n return this.requestedRender = !0;n }, u.prototype.inputControllerDidHandleInput = function () {n return this.handlingInput = !1, this.requestedRender ? (this.requestedRender = !1, this.render()) : void 0;n }, u.prototype.inputControllerDidAllowUnhandledInput = function () {n return this.notifyEditorElement("change");n }, u.prototype.inputControllerDidRequestReparse = function () {n return this.reparse();n }, u.prototype.inputControllerWillPerformTyping = function () {n return this.recordTypingUndoEntry();n }, u.prototype.inputControllerWillPerformFormatting = function (t) {n return this.recordFormattingUndoEntry(t);n }, u.prototype.inputControllerWillCutText = function () {n return this.editor.recordUndoEntry("Cut");n }, u.prototype.inputControllerWillPaste = function (t) {n return this.editor.recordUndoEntry("Paste"), this.pasting = !0, this.notifyEditorElement("before-paste", {n paste: tn });n }, u.prototype.inputControllerDidPaste = function (t) {n return t.range = this.pastedRange, this.pastedRange = null, this.pasting = null, this.notifyEditorElement("paste", {n paste: tn });n }, u.prototype.inputControllerWillMoveText = function () {n return this.editor.recordUndoEntry("Move");n }, u.prototype.inputControllerWillAttachFiles = function () {n return this.editor.recordUndoEntry("Drop Files");n }, u.prototype.inputControllerWillPerformUndo = function () {n return this.editor.undo();n }, u.prototype.inputControllerWillPerformRedo = function () {n return this.editor.redo();n }, u.prototype.inputControllerDidReceiveKeyboardCommand = function (t) {n return this.toolbarController.applyKeyboardCommand(t);n }, u.prototype.inputControllerDidStartDrag = function () {n return this.locationRangeBeforeDrag = this.selectionManager.getLocationRange();n }, u.prototype.inputControllerDidReceiveDragOverPoint = function (t) {n return this.selectionManager.setLocationRangeFromPointRange(t);n }, u.prototype.inputControllerDidCancelDrag = function () {n return this.selectionManager.setLocationRange(this.locationRangeBeforeDrag), this.locationRangeBeforeDrag = null;n }, u.prototype.locationRangeDidChange = function (t) {n return this.composition.updateCurrentAttributes(), this.updateCurrentActions(), this.attachmentLocationRange && !o(this.attachmentLocationRange, t) && this.composition.stopEditingAttachment(), this.notifyEditorElement("selection-change");n }, u.prototype.toolbarDidClickButton = function () {n return this.getLocationRange() ? void 0 : this.setLocationRange({n index: 0,n offset: 0n });n }, u.prototype.toolbarDidInvokeAction = function (t) {n return this.invokeAction(t);n }, u.prototype.toolbarDidToggleAttribute = function (t) {n return this.recordFormattingUndoEntry(t), this.composition.toggleCurrentAttribute(t), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus();n }, u.prototype.toolbarDidUpdateAttribute = function (t, e) {n return this.recordFormattingUndoEntry(t), this.composition.setCurrentAttribute(t, e), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus();n }, u.prototype.toolbarDidRemoveAttribute = function (t) {n return this.recordFormattingUndoEntry(t), this.composition.removeCurrentAttribute(t), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus();n }, u.prototype.toolbarWillShowDialog = function () {n return this.composition.expandSelectionForEditing(), this.freezeSelection();n }, u.prototype.toolbarDidShowDialog = function (t) {n return this.notifyEditorElement("toolbar-dialog-show", {n dialogName: tn });n }, u.prototype.toolbarDidHideDialog = function (t) {n return this.thawSelection(), this.editorElement.focus(), this.notifyEditorElement("toolbar-dialog-hide", {n dialogName: tn });n }, u.prototype.freezeSelection = function () {n return this.selectionFrozen ? void 0 : (this.selectionManager.lock(), this.composition.freezeSelection(), this.selectionFrozen = !0, this.render());n }, u.prototype.thawSelection = function () {n return this.selectionFrozen ? (this.composition.thawSelection(), this.selectionManager.unlock(), this.selectionFrozen = !1, this.render()) : void 0;n }, u.prototype.actions = {n undo: {n test: function test() {n return this.editor.canUndo();n },n perform: function perform() {n return this.editor.undo();n }n },n redo: {n test: function test() {n return this.editor.canRedo();n },n perform: function perform() {n return this.editor.redo();n }n },n link: {n test: function test() {n return this.editor.canActivateAttribute("href");n }n },n increaseNestingLevel: {n test: function test() {n return this.editor.canIncreaseNestingLevel();n },n perform: function perform() {n return this.editor.increaseNestingLevel() && this.render();n }n },n decreaseNestingLevel: {n test: function test() {n return this.editor.canDecreaseNestingLevel();n },n perform: function perform() {n return this.editor.decreaseNestingLevel() && this.render();n }n },n attachFiles: {n test: function test() {n return !0;n },n perform: function perform() {n return e.config.input.pickFiles(this.editor.insertFiles);n }n }n }, u.prototype.canInvokeAction = function (t) {n var e, n;n return this.actionIsExternal(t) ? !0 : !!(null != (e = this.actions) && null != (n = e.test) ? n.call(this) : void 0);n }, u.prototype.invokeAction = function (t) {n var e, n;n return this.actionIsExternal(t) ? this.notifyEditorElement("action-invoke", {n actionName: tn }) : null != (e = this.actions) && null != (n = e.perform) ? n.call(this) : void 0;n }, u.prototype.actionIsExternal = function (t) {n return /^x-./.test(t);n }, u.prototype.getCurrentActions = function () {n var t, e;n e = {};nn for (t in this.actions) {n e = this.canInvokeAction(t);n }nn return e;n }, u.prototype.updateCurrentActions = function () {n var t;n return t = this.getCurrentActions(), n(t, this.currentActions) ? void 0 : (this.currentActions = t, this.toolbarController.updateActions(this.currentActions), this.notifyEditorElement("actions-change", {n actions: this.currentActionsn }));n }, u.prototype.runEditorFilters = function () {n var t, e, n, i, o, r, s, a;nn for (a = this.composition.getSnapshot(), o = this.editor.filters, n = 0, i = o.length; i > n; n++) {n e = o, t = a.document, s = a.selectedRange, a = null != (r = e.call(this.editor, a)) ? r : {}, null == a.document && (a.document = t), null == a.selectedRange && (a.selectedRange = s);n }nn return c(a, this.composition.getSnapshot()) ? void 0 : this.composition.loadSnapshot(a);n }, c = function c(t, e) {n return o(t.selectedRange, e.selectedRange) && t.document.isEqualTo(e.document);n }, u.prototype.updateInputElement = function () {n var t, n;n return t = this.compositionController.getSerializableElement(), n = e.serializeToContentType(t, "text/html"), this.editorElement.setInputElementValue(n);n }, u.prototype.notifyEditorElement = function (t, e) {n switch (t) {n case "document-change":n this.documentChangedSinceLastRender = !0;n break;nn case "render":n this.documentChangedSinceLastRender && (this.documentChangedSinceLastRender = !1, this.notifyEditorElement("change"));n break;nn case "change":n case "attachment-add":n case "attachment-edit":n case "attachment-remove":n this.updateInputElement();n }nn return this.editorElement.notify(t, e);n }, u.prototype.removeAttachment = function (t) {n return this.editor.recordUndoEntry("Delete Attachment"), this.composition.removeAttachment(t), this.render();n }, u.prototype.recordFormattingUndoEntry = function (e) {n var n, o;n return n = t(e), o = this.selectionManager.getLocationRange(), n || !i(o) ? this.editor.recordUndoEntry("Formatting", {n context: this.getUndoContext(),n consolidatable: !0n }) : void 0;n }, u.prototype.recordTypingUndoEntry = function () {n return this.editor.recordUndoEntry("Typing", {n context: this.getUndoContext(this.currentAttributes),n consolidatable: !0n });n }, u.prototype.getUndoContext = function () {n var t;n return t = 1 <= arguments.length ? a.call(arguments, 0) : [], [this.getLocationContext(), this.getTimeContext()].concat(a.call(t));n }, u.prototype.getLocationContext = function () {n var t;n return t = this.selectionManager.getLocationRange(), i(t) ? t.index : t;n }, u.prototype.getTimeContext = function () {n return e.config.undoInterval > 0 ? Math.floor(new Date().getTime() / e.config.undoInterval) : 0;n }, u.prototype.isFocused = function () {n var t;n return this.editorElement === (null != (t = this.editorElement.ownerDocument) ? t.activeElement : void 0);n }, u;n }(e.Controller);n }.call(this), function () {n var t, n, i, o, r, s;n n = e.browser, r = e.makeElement, s = e.triggerEvent, i = e.handleEvent, o = e.handleEventOnce, t = e.AttachmentView.attachmentSelector, e.registerElement("trix-editor", function () {n var a, u, c, l, h, p, d, f;n return p = 0, u = function u(t) {n return !document.querySelector(":focus") && t.hasAttribute("autofocus") && document.querySelector("") === t ? t.focus() : void 0;n }, d = function d(t) {n return t.hasAttribute("contenteditable") ? void 0 : (t.setAttribute("contenteditable", ""), o("focus", {n onElement: t,n withCallback: function withCallback() {n return c(t);n }n }));n }, a = function a(t) {n return t.hasAttribute("role") ? void 0 : t.setAttribute("role", "textbox");n }, c = function c(t) {n return h(t), f(t);n }, h = function h(t) {n return ("function" == typeof document.queryCommandSupported ? document.queryCommandSupported("enableObjectResizing") : void 0) ? (document.execCommand("enableObjectResizing", !1, !1), i("mscontrolselect", {n onElement: t,n preventDefault: !0n })) : void 0;n }, f = function f() {n var t;n return ("function" == typeof document.queryCommandSupported ? document.queryCommandSupported("DefaultParagraphSeparator") : void 0) && (t = e.config.blockAttributes.tagName, "div" === t || "p" === t) ? document.execCommand("DefaultParagraphSeparator", !1, t) : void 0;n }, l = function () {n return n.forcesObjectResizing ? {n display: "inline",n width: "auto"n } : {n display: "inline-block",n width: "1px"n };n }(), {n defaultCSS: "%t {\n display: block;\n}\n\n%t:empty:not(:focus)::before {\n content: attr(placeholder);\n color: graytext;\n cursor: text;\n}\n\n%t a {\n cursor: text;\n}\n\n%t img {\n max-width: 100%;\n height: auto;\n}\n\n%t " + t + " figcaption textarea {\n resize: none;\n}\n\n%t " + t + " figcaption textarea.trix-autoresize-clone {\n position: absolute;\n left: -9999px;\n max-height: 0px;\n}\n\n%t " + t + " figcaption:empty::before {\n content: attr(data-trix-placeholder);\n color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n display: " + l.display + " !important;\n width: " + l.width + " !important;\n padding: 0 !important;\n margin: 0 !important;\n border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n vertical-align: top !important;\n margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n vertical-align: bottom !important;\n margin-right: -1px !important;\n}",n trixId: {n get: function get() {n return this.hasAttribute("trix-id") ? this.getAttribute("trix-id") : (this.setAttribute("trix-id", ++p), this.trixId);n }n },n toolbarElement: {n get: function get() {n var t, e, n;n return this.hasAttribute("toolbar") ? null != (e = this.ownerDocument) ? e.getElementById(this.getAttribute("toolbar")) : void 0 : this.parentNode ? (n = "trix-toolbar-" + this.trixId, this.setAttribute("toolbar", n), t = r("trix-toolbar", {n id: nn }), this.parentNode.insertBefore(t, this), t) : void 0;n }n },n inputElement: {n get: function get() {n var t, e, n;n return this.hasAttribute("input") ? null != (n = this.ownerDocument) ? n.getElementById(this.getAttribute("input")) : void 0 : this.parentNode ? (e = "trix-input-" + this.trixId, this.setAttribute("input", e), t = r("input", {n type: "hidden",n id: en }), this.parentNode.insertBefore(t, this.nextElementSibling), t) : void 0;n }n },n editor: {n get: function get() {n var t;n return null != (t = this.editorController) ? t.editor : void 0;n }n },n name: {n get: function get() {n var t;n return null != (t = this.inputElement) ? t.name : void 0;n }n },n value: {n get: function get() {n var t;n return null != (t = this.inputElement) ? t.value : void 0;n },n set: function set(t) {n var e;n return this.defaultValue = t, null != (e = this.editor) ? e.loadHTML(this.defaultValue) : void 0;n }n },n notify: function notify(t, e) {n return this.editorController ? s("trix-" + t, {n onElement: this,n attributes: en }) : void 0;n },n setInputElementValue: function setInputElementValue(t) {n var e;n return null != (e = this.inputElement) ? e.value = t : void 0;n },n initialize: function initialize() {n return d(this), a(this);n },n connect: function connect() {n return this.hasAttribute("data-trix-internal") ? void 0 : (this.editorController || (s("trix-before-initialize", {n onElement: thisn }), this.editorController = new e.EditorController({n editorElement: this,n html: this.defaultValue = this.valuen }), requestAnimationFrame(function (t) {n return function () {n return s("trix-initialize", {n onElement: tn });n };n }(this))), this.editorController.registerSelectionManager(), this.registerResetListener(), u(this));n },n disconnect: function disconnect() {n var t;n return null != (t = this.editorController) && t.unregisterSelectionManager(), this.unregisterResetListener();n },n registerResetListener: function registerResetListener() {n return this.resetListener = this.resetBubbled.bind(this), window.addEventListener("reset", this.resetListener, !1);n },n unregisterResetListener: function unregisterResetListener() {n return window.removeEventListener("reset", this.resetListener, !1);n },n resetBubbled: function resetBubbled(t) {n var e;n return t.target !== (null != (e = this.inputElement) ? e.form : void 0) || t.defaultPrevented ? void 0 : this.reset();n },n reset: function reset() {n return this.value = this.defaultValue;n }n };n }());n }.call(this), function () {}.call(this);n }).call(this), "object" == (typeof module === "undefined" ? "undefined" : _typeof(module)) && module.exports ? module.exports = e : "function" == typeof define && define.amd && define(e);n}.call(this);“,”map“:null,”metadata“:{},”sourceType“:”module“}