UNPKG

@pdftron/webviewer

Version:

[WebViewer](https://www.apryse.com/webviewer) is a powerful JavaScript Document SDK and UI Component Library that is a part of the [Apryse PDF SDK](https://www.apryse.com). It provides a slick, out-of-the-box responsive UI that interacts with the core lib

1 lines • 1.44 MB
(window.webpackJsonpWebViewerUI=window.webpackJsonpWebViewerUI||[]).push([[25,2,4,6,7,8,9,10,14,18,19,22,23,27,29,30,31,35,36,39,41,46,55,63,82],{1569:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const r=n(1670),o=n(1612),i=n(1613),a=n(1671);t.AttributeMap=a.default;const l=n(1614);t.Op=l.default;const c=n(1672);t.OpIterator=c.default;const u=String.fromCharCode(0),s=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class d{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=o(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+l.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+l.default.length(t),0)}slice(e=0,t=1/0){const n=[],r=new c.default(this.ops);let o=0;for(;o<t&&r.hasNext();){let i;o<e?i=r.next(e-o):(i=r.next(t-o),n.push(i)),o+=l.default.length(i)}return new d(n)}compose(e){const t=new c.default(this.ops),n=new c.default(e.ops),r=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){let e=o.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),r.push(t.next());o.retain-e>0&&n.next(o.retain-e)}const l=new d(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),o=n.next(e);if(o.retain){const c={};if("number"==typeof r.retain)c.retain="number"==typeof o.retain?e:o.retain;else if("number"==typeof o.retain)null==r.retain?c.insert=r.insert:c.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,i]=s(r[e],o.retain),a=d.getHandler(t);c[e]={[t]:a.compose(n,i,"retain"===e)}}const u=a.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(u&&(c.attributes=u),l.push(c),!n.hasNext()&&i(l.ops[l.ops.length-1],c)){const e=new d(t.rest());return l.concat(e).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(o)}return l.chop()}concat(e){const t=new d(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new d;const n=[this,e].map(t=>t.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:u;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")),o=new d,l=r(n[0],n[1],t,!0),s=new c.default(this.ops),f=new c.default(e.ops);return l.forEach(e=>{let t=e[1].length;for(;t>0;){let n=0;switch(e[0]){case r.INSERT:n=Math.min(f.peekLength(),t),o.push(f.next(n));break;case r.DELETE:n=Math.min(t,s.peekLength()),s.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(s.peekLength(),f.peekLength(),t);const e=s.next(n),l=f.next(n);i(e.insert,l.insert)?o.retain(n,a.default.diff(e.attributes,l.attributes)):o.push(l).delete(n)}t-=n}}),o.chop()}eachLine(e,t="\n"){const n=new c.default(this.ops);let r=new d,o=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),a=l.default.length(i)-n.peekLength(),c="string"==typeof i.insert?i.insert.indexOf(t,a)-a:-1;if(c<0)r.push(n.next());else if(c>0)r.push(n.next(c));else{if(!1===e(r,n.next(1).attributes||{},o))return;o+=1,r=new d}}r.length()>0&&e(r,{},o)}invert(e){const t=new d;return this.reduce((n,r)=>{if(r.insert)t.delete(l.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const o=r.delete||r.retain;return e.slice(n,n+o).forEach(e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(l.default.length(e),a.default.invert(r.attributes,e.attributes))}),n+o}if("object"==typeof r.retain&&null!==r.retain){const o=e.slice(n,n+1),i=new c.default(o.ops).next(),[l,u,f]=s(r.retain,i.insert),p=d.getHandler(l);return t.retain({[l]:p.invert(u,f)},a.default.invert(r.attributes,i.attributes)),n+1}}return n},0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new c.default(this.ops),o=new c.default(n.ops),i=new d;for(;r.hasNext()||o.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===o.peekType())if("insert"===o.peekType())i.push(o.next());else{const e=Math.min(r.peekLength(),o.peekLength()),n=r.next(e),l=o.next(e);if(n.delete)continue;if(l.delete)i.push(l);else{const r=n.retain,o=l.retain;let c="object"==typeof o&&null!==o?o:e;if("object"==typeof r&&null!==r&&"object"==typeof o&&null!==o){const e=Object.keys(r)[0];if(e===Object.keys(o)[0]){const n=d.getHandler(e);n&&(c={[e]:n.transform(r[e],o[e],t)})}}i.retain(c,a.default.transform(n.attributes,l.attributes,t))}}else i.retain(l.default.length(r.next()));return i.chop()}transformPosition(e,t=!1){t=!!t;const n=new c.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r<e||!t)&&(e+=o),r+=o):e-=Math.min(o,e-r)}return e}}d.Op=l.default,d.OpIterator=c.default,d.AttributeMap=a.default,d.handlers={},t.default=d,e.exports=d,e.exports.default=d},1574:function(e,t,n){"use strict";var r=n(0),o=n.n(r).a.createContext();t.a=o},1575:function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},1576:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return s}));n(9),n(10),n(14),n(38),n(117),n(20),n(12),n(18),n(41),n(8),n(19),n(11),n(13);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function i(e){return(t=e)&&t.prototype&&"function"==typeof t.prototype.render||function(e){var t,n=e;return"Symbol(react.forward_ref)"===(null==n||null===(t=n.$$typeof)||void 0===t?void 0:t.toString())}(e);var t}function a(e,t){}function l(e){return"function"==typeof e}function c(){}function u(e){if(!function(e){return"object"===r(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t){return"string"==typeof e||"symbol"===r(e)||!!t&&Array.isArray(e)&&e.every((function(e){return s(e,!1)}))}},1578:function(e,t,n){var r=n(36),o=n(1643);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:function(e){if(!window.isApryseWebViewerWebComponent)return void document.head.appendChild(e);let t;t=document.getElementsByTagName("apryse-webviewer"),t.length||(t=function e(t,n=document){const r=[];return n.querySelectorAll(t).forEach(e=>r.push(e)),n.querySelectorAll("*").forEach(n=>{n.shadowRoot&&r.push(...e(t,n.shadowRoot))}),r}("apryse-webviewer"));const n=[];for(let r=0;r<t.length;r++){const o=t[r];if(0===r)o.shadowRoot.appendChild(e),e.onload=function(){n.length>0&&n.forEach(t=>{t.innerHTML=e.innerHTML})};else{const t=e.cloneNode(!0);o.shadowRoot.appendChild(t),n.push(t)}}},singleton:!1};r(o,i);e.exports=o.locals||{}},1579:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var c=e.displayName||e.name,u="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+c+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return a})),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},1580:function(e,t,n){"use strict";var r=n(1638),o=n(1622);t.a=function(e,t,n,i){var a=!n;n||(n={});for(var l=-1,c=t.length;++l<c;){var u=t[l],s=i?i(n[u],e[u],u,n,e):void 0;void 0===s&&(s=e[u]),a?Object(o.a)(n,u,s):Object(r.a)(n,u,s)}return n}},1581:function(e,t,n){"use strict";t.a=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1582:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return f}));var r=n(0),o=n(1621),i=(n(157),n(1664),n(1720),n(1717)),a=n(1772),l=n(1718),c=!1,u="undefined"!=typeof document,s=r.createContext("undefined"!=typeof HTMLElement?Object(o.a)({key:"css"}):null),d=s.Provider,f=function(e){return Object(r.forwardRef)((function(t,n){var o=Object(r.useContext)(s);return e(t,o,n)}))};u||(f=function(e){return function(t){var n=Object(r.useContext)(s);return null===n?(n=Object(o.a)({key:"css"}),r.createElement(s.Provider,{value:n},e(t,n))):e(t,n)}});var p=r.createContext({});var h={}.hasOwnProperty,m="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",b=function(e,t){var n={};for(var r in t)h.call(t,r)&&(n[r]=t[r]);return n[m]=e,n},v=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;Object(i.c)(t,n,o);var a=Object(l.a)((function(){return Object(i.b)(t,n,o)}));if(!u&&void 0!==a){for(var c,s=n.name,d=n.next;void 0!==d;)s+=" "+d.name,d=d.next;return r.createElement("style",((c={})["data-emotion"]=t.key+" "+s,c.dangerouslySetInnerHTML={__html:a},c.nonce=t.sheet.nonce,c))}return null},g=f((function(e,t,n){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var l=e[m],u=[o],s="";"string"==typeof e.className?s=Object(i.a)(t.registered,u,e.className):null!=e.className&&(s=e.className+" ");var d=Object(a.a)(u,void 0,r.useContext(p));s+=t.key+"-"+d.name;var f={};for(var b in e)h.call(e,b)&&"css"!==b&&b!==m&&!c&&(f[b]=e[b]);return f.className=s,n&&(f.ref=n),r.createElement(r.Fragment,null,r.createElement(v,{cache:t,serialized:d,isStringTag:"string"==typeof l}),r.createElement(l,f))}))},1583:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"Attributor",(function(){return a})),n.d(r,"AttributorStore",(function(){return h})),n.d(r,"BlockBlot",(function(){return C})),n.d(r,"ClassAttributor",(function(){return d})),n.d(r,"ContainerBlot",(function(){return j})),n.d(r,"EmbedBlot",(function(){return A})),n.d(r,"InlineBlot",(function(){return E})),n.d(r,"LeafBlot",(function(){return g})),n.d(r,"ParentBlot",(function(){return O})),n.d(r,"Registry",(function(){return u})),n.d(r,"Scope",(function(){return i})),n.d(r,"ScrollBlot",(function(){return R})),n.d(r,"StyleAttributor",(function(){return p})),n.d(r,"TextBlot",(function(){return N}));n(9),n(10),n(14),n(21),n(77),n(20),n(22),n(18),n(16),n(49),n(24),n(48),n(50),n(17),n(19),n(11),n(13),n(32),n(38),n(34),n(83),n(27),n(12),n(44),n(119),n(33),n(29),n(163),n(483),n(35),n(8),n(173),n(136),n(31);var o=n(1591),i=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(i||{});class a{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=i.TYPE&i.ATTRIBUTE;this.scope=null!=n.scope?n.scope&i.LEVEL|r:i.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class l extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const c=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const o=this.query(n);if(null==o)throw new l(`Unable to create ${n} blot`);const i=o,a=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(r),c=new i(t,a,r);return e.blots.set(c.domNode,c),c}find(t,n=!1){return e.find(t,n)}query(e,t=i.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&i.LEVEL&i.BLOCK?n=this.types.block:e&i.LEVEL&i.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(e=>(n=this.classes[e],!!n)),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&i.LEVEL&n.scope&&t&i.TYPE&n.scope?n:null}register(...e){return e.map(e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new l("Invalid definition");if(t&&"abstract"===e.blotName)throw new l("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(e=>e.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)}))),e})}};c.blots=new WeakMap;let u=c;function s(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>0===e.indexOf(t+"-"))}const d=class extends a{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){s(e,this.keyName).forEach(t=>{e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(s(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function f(e){const t=e.split("-"),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join("");return t[0]+n}const p=class extends a{static keys(e){return(e.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(e,t){return!!this.canAdd(e,t)&&(e.style[f(this.keyName)]=t,!0)}remove(e){e.style[f(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[f(this.keyName)];return this.canAdd(e,t)?t:""}};const h=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=u.find(this.domNode);if(null==e)return;const t=a.keys(this.domNode),n=d.keys(this.domNode),r=p.keys(this.domNode);t.concat(n).concat(r).forEach(t=>{const n=e.scroll.query(t,i.ATTRIBUTE);n instanceof a&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},m=class{constructor(e,t){this.scroll=e,this.domNode=t,u.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new l("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),u.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const o=this.isolate(e,t);if(null!=this.scroll.query(n,i.BLOT)&&r)o.wrap(n,r);else if(null!=this.scroll.query(n,i.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);o.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),o=this.split(e);this.parent.insertBefore(r,o||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new l("Cannot wrap "+e);return n.appendChild(this),n}};m.blotName="abstract";let b=m;const v=class extends b{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};v.scope=i.INLINE_BLOT;const g=v;class y{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const o=r.length();if(e<o||t&&e===o&&(null==r.next||0!==r.next.length()))return[r,e];e-=o,r=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[r,o]=this.find(e);let i=e-o;const a=this.iterator(r);let l=a();for(;l&&i<e+t;){const r=l.length();e>i?n(l,e-i,Math.min(t,i+r-e)):n(l,0,Math.min(r,e+t-i)),i+=r,l=a()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function w(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(i.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const x=class e extends b{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new y,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=w(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof l)return;throw e}})}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){const[r,o]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,o]:r instanceof e?r.descendant(t,o):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let o=[],i=r;return this.children.forEachAt(n,r,(n,r,a)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=a}),o}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===i.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,r){this.children.forEachAt(e,t,(e,t,o)=>{e.formatAt(t,o,n,r)})}insertAt(e,t,n){const[r,o]=this.children.find(e);if(r)r.insertAt(o,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,o]=this.children.find(t,n),i=[[this,t]];return r instanceof e?i.concat(r.path(o,n)):(null!=r&&i.push([r,o]),i)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,r,o)=>{const i=e.split(r,t);null!=i&&n.appendChild(i)}),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach(e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.forEach(e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=w(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};x.uiClass="";const O=x;const S=class e extends O{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new h(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,i.INLINE);if(null==e)return;e instanceof a?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,i.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};S.allowedChildren=[S,g],S.blotName="inline",S.scope=i.INLINE_BLOT,S.tagName="SPAN";const E=S,k=class e extends O{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new h(this.domNode)}format(t,n){const r=this.scroll.query(t,i.BLOCK);null!=r&&(r instanceof a?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,i.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,i.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}};k.blotName="block",k.scope=i.BLOCK_BLOT,k.tagName="P",k.allowedChildren=[E,k,g];const C=k,_=class extends O{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};_.blotName="container",_.scope=i.BLOCK_BLOT;const j=_;const A=class extends g{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},T={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},P=class extends O{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,T),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=i.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const o=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&o(e.parent))},i=e=>{n.has(e.domNode)&&(e instanceof O&&e.children.forEach(i),n.delete(e.domNode),e.optimize(t))};let a=e;for(let t=0;a.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(o(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{const t=this.find(e,!1);o(t,!1),t instanceof O&&t.children.forEach(e=>{o(e,!1)})})):"attributes"===e.type&&o(t.prev)),o(t))}),this.children.forEach(i),a=Array.from(this.observer.takeRecords()),r=a.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};P.blotName="scroll",P.defaultChild=C,P.allowedChildren=[C,j],P.scope=i.BLOCK_BLOT,P.tagName="DIV";const R=P,I=class e extends g{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>"characterData"===e.type&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};I.blotName="text",I.scope=i.INLINE_BLOT;const N=I;var M=n(1569),q=n.n(M),L=(n(82),n(308),n(182),n(115),n(384),n(1603));var D=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},z=n(1638),B=n(1580),F=n(1602),H=Object(F.a)(Object.keys,Object);var W=function(e,t){return e&&Object(B.a)(t,H(t),e)},U=n(1590);var V=function(e,t){return e&&Object(B.a)(t,Object(U.a)(t),e)},G=n(1636),K=n(1635);var $=function(){return[]};var Y=function(e,t){return Object(B.a)(e,$(e),t)};var Z=function(){return[]};var X=function(e,t){return Object(B.a)(e,Z(e),t)},Q=n(1617);var J=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ee=n(1615),te=Object.prototype.hasOwnProperty;var ne=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&te.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var re=function(e){return e},oe=n(1648),ie=n(1588),ae=n(1601);var le=function(){return!1},ce=n(1581);var ue=function(){return!1},se={};se["[object Arguments]"]=se["[object Array]"]=se["[object ArrayBuffer]"]=se["[object DataView]"]=se["[object Boolean]"]=se["[object Date]"]=se["[object Float32Array]"]=se["[object Float64Array]"]=se["[object Int8Array]"]=se["[object Int16Array]"]=se["[object Int32Array]"]=se["[object Map]"]=se["[object Number]"]=se["[object Object]"]=se["[object RegExp]"]=se["[object Set]"]=se["[object String]"]=se["[object Symbol]"]=se["[object Uint8Array]"]=se["[object Uint8ClampedArray]"]=se["[object Uint16Array]"]=se["[object Uint32Array]"]=!0,se["[object Error]"]=se["[object Function]"]=se["[object WeakMap]"]=!1;var de=function e(t,n,r,o,i,a){var l,c=1&n,u=2&n,s=4&n;if(r&&(l=i?r(t,o,i,a):r(t)),void 0!==l)return l;if(!Object(ce.a)(t))return t;var d=Object(ie.a)(t);if(d){if(l=ne(t),!c)return Object(K.a)(t,l)}else{var f=Object(ee.a)(t),p="[object Function]"==f||"[object GeneratorFunction]"==f;if(Object(ae.a)(t))return Object(G.a)(t,c);if("[object Object]"==f||"[object Arguments]"==f||p&&!i){if(l=u||p?{}:Object(oe.a)(t),!c)return u?X(t,V(l,t)):Y(t,W(l,t))}else{if(!se[f])return i?t:{};l=re(t,f,c)}}a||(a=new L.a);var h=a.get(t);if(h)return h;a.set(t,l),ue(t)?t.forEach((function(o){l.add(e(o,n,r,o,t,a))})):le(t)&&t.forEach((function(o,i){l.set(i,e(o,n,r,i,t,a))}));var m=s?u?J:Q.a:u?U.a:H,b=d?void 0:m(t);return D(b||t,(function(o,i){b&&(o=t[i=o]),Object(z.a)(l,i,e(o,n,r,i,t,a))})),l};var fe=function(e){return de(e,5)},pe=n(1853);n(26),n(40),n(41),n(42),n(86),n(624),n(473);function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ve(r.key),r)}}function ve(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==he(t)?t:t+""}function ge(e,t,n){return t=ye(t),function(e,t){if(t&&("object"==he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],ye(e).constructor):t.apply(e,n))}function ye(e){return(ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(e,t){return(we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var xe=function(e){function t(){return me(this,t),ge(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(t,e),n=t,o=[{key:"value",value:function(){}}],(r=[{key:"optimize",value:function(){(this.prev||this.next)&&this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}])&&be(n.prototype,r),o&&be(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(A);xe.blotName="break",xe.tagName="BR";var Oe=xe;function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ke(r.key),r)}}function ke(e){var t=function(e,t){if("object"!=Se(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Se(t)?t:t+""}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(e,t,n){return t=je(t),function(e,t){if(t&&("object"==Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],je(e).constructor):t.apply(e,n))}function je(e){return(je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ae(e,t){return(Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var Te=function(e){function t(){return Ce(this,t),_e(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ae(e,t)}(t,e),n=t,r&&Ee(n.prototype,r),o&&Ee(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(N),Pe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Re(e){return e.replace(/[&<>"']/g,(function(e){return Pe[e]}))}function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Me(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,We(r.key),r)}}function qe(e,t,n){return t=Be(t),function(e,t){if(t&&("object"==Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],Be(e).constructor):t.apply(e,n))}function Le(e,t,n,r){var o=De(Be(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function De(){return(De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=ze(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function ze(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Be(e)););return e}function Be(e){return(Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fe(e,t){return(Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function He(e,t,n){return(t=We(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function We(e){var t=function(e,t){if("object"!=Ie(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ie(t)?t:t+""}var Ue=function(e){function t(){return Ne(this,t),qe(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fe(e,t)}(t,e),n=t,o=[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),o=t.order.indexOf(n);return r>=0||o>=0?r-o:e===n?0:e<n?-1:1}}],(r=[{key:"formatAt",value:function(e,n,r,o){if(t.compare(this.statics.blotName,r)<0&&this.scroll.query(r,i.BLOT)){var a=this.isolate(e,n);o&&a.wrap(r,o)}else Le(t,"formatAt",this,3)([e,n,r,o])}},{key:"optimize",value:function(e){if(Le(t,"optimize",this,3)([e]),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}])&&Me(n.prototype,r),o&&Me(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(E);He(Ue,"allowedChildren",[Ue,Oe,A,Te]),He(Ue,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);var Ve=Ue;function Ge(e){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,at(r.key),r)}}function Xe(e,t,n){return t&&Ze(e.prototype,t),n&&Ze(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qe(e,t,n){return t=nt(t),function(e,t){if(t&&("object"==Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],nt(e).constructor):t.apply(e,n))}function Je(e,t,n,r){var o=et(nt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function et(){return(et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=tt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function tt(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=nt(e)););return e}function nt(e){return(nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ot(e,t)}function ot(e,t){return(ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function it(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(e){var t=function(e,t){if("object"!=Ge(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ge(t)?t:t+""}var lt=function(e){function t(){var e;Ye(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return it(e=Qe(this,t,[].concat(r)),"cache",{}),e}return rt(t,e),Xe(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=ut(this)),this.cache.delta}},{key:"deleteAt",value:function(e,n){Je(t,"deleteAt",this,3)([e,n]),this.cache={}}},{key:"formatAt",value:function(e,n,r,o){n<=0||(this.scroll.query(r,i.BLOCK)?e+n===this.length()&&this.format(r,o):Je(t,"formatAt",this,3)([e,Math.min(n,this.length()-e-1),r,o]),this.cache={})}},{key:"insertAt",value:function(e,n,r){if(null!=r)return Je(t,"insertAt",this,3)([e,n,r]),void(this.cache={});if(0!==n.length){var o=n.split("\n"),i=o.shift();i.length>0&&(e<this.length()-1||null==this.children.tail?Je(t,"insertAt",this,3)([Math.min(e,this.length()-1),i]):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});var a=this;o.reduce((function(e,t){return(a=a.split(e,!0)).insertAt(0,t),t.length}),e+i.length)}}},{key:"insertBefore",value:function(e,n){var r=this.children.head;Je(t,"insertBefore",this,3)([e,n]),r instanceof Oe&&r.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=Je(t,"length",this,3)([])+1),this.cache.length}},{key:"moveChildren",value:function(e,n){Je(t,"moveChildren",this,3)([e,n]),this.cache={}}},{key:"optimize",value:function(e){Je(t,"optimize",this,3)([e]),this.cache={}}},{key:"path",value:function(e){return Je(t,"path",this,3)([e,!0])}},{key:"removeChild",value:function(e){Je(t,"removeChild",this,3)([e]),this.cache={}}},{key:"split",value:function(e){var n=arguments.leng