import{ct as e,it as t,n,ut as r}from"./axios-CiYFffbI.js";import{A as i,C as a,E as o,G as s,I as c,N as l,O as u,V as d,Y as f,_ as p,d as m,it as h,kt as g,l as _,p as v,q as y,ut as b,v as x,y as S}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{o as C}from"./index-CMCK8R6Y.js";var w=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.Quill=r():n.Quill=r()})(typeof self<`u`?self:e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=109)})([(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(17),i=n(18),a=n(19),o=n(45),s=n(46),c=n(47),l=n(48),u=n(49),d=n(12),f=n(32),p=n(33),m=n(31),h=n(1);t.default={Scope:h.Scope,create:h.create,find:h.find,query:h.query,register:h.register,Container:r.default,Format:i.default,Leaf:a.default,Embed:l.default,Scroll:o.default,Block:c.default,Inline:s.default,Text:u.default,Attributor:{Attribute:d.default,Class:f.default,Style:p.default,Store:m.default}}}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=function(e){r(t,e);function t(t){var n=this;return t=`[Parchment] `+t,n=e.call(this,t)||this,n.message=t,n.name=n.constructor.name,n}return t}(Error);t.ParchmentError=i;var a={},o={},s={},c={};t.DATA_KEY=`__blot`;var l;(function(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`})(l=t.Scope||={});function u(e,t){var n=f(e);if(n==null)throw new i(`Unable to create `+e+` blot`);var r=n;return new r(e instanceof Node||e.nodeType===Node.TEXT_NODE?e:r.create(t),t)}t.create=u;function d(e,n){return n===void 0&&(n=!1),e==null?null:e[t.DATA_KEY]==null?n?d(e.parentNode,n):null:e[t.DATA_KEY].blot}t.find=d;function f(e,t){t===void 0&&(t=l.ANY);var n;if(typeof e==`string`)n=c[e]||a[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=c.text;else if(typeof e==`number`)e&l.LEVEL&l.BLOCK?n=c.block:e&l.LEVEL&l.INLINE&&(n=c.inline);else if(e instanceof HTMLElement){var r=(e.getAttribute(`class`)||``).split(/\s+/);for(var i in r)if(n=o[r[i]],n)break;n||=s[e.tagName]}return n==null?null:t&l.LEVEL&n.scope&&t&l.TYPE&n.scope?n:null}t.query=f;function p(){var e=[...arguments];if(e.length>1)return e.map(function(e){return p(e)});var t=e[0];if(typeof t.blotName!=`string`&&typeof t.attrName!=`string`)throw new i(`Invalid definition`);if(t.blotName===`abstract`)throw new i(`Cannot register abstract class`);return c[t.blotName||t.attrName]=t,typeof t.keyName==`string`?a[t.keyName]=t:(t.className!=null&&(o[t.className]=t),t.tagName!=null&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(function(e){return e.toUpperCase()}):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(function(e){(s[e]==null||t.className==null)&&(s[e]=t)}))),t}t.register=p}),(function(e,t,n){var r=n(51),i=n(11),a=n(3),o=n(20),s=`\0`,c=function(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};c.prototype.insert=function(e,t){var n={};return e.length===0?this:(n.insert=e,typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},c.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},c.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},c.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=a(!0,{},e),typeof n==`object`){if(typeof e.delete==`number`&&typeof n.delete==`number`)return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete==`number`&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!=`object`))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if(typeof e.insert==`string`&&typeof n.insert==`string`)return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain==`number`&&typeof n.retain==`number`)return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},c.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},c.prototype.filter=function(e){return this.ops.filter(e)},c.prototype.forEach=function(e){this.ops.forEach(e)},c.prototype.map=function(e){return this.ops.map(e)},c.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},c.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},c.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+o.length(t):t.delete?e-t.delete:e},0)},c.prototype.length=function(){return this.reduce(function(e,t){return e+o.length(t)},0)},c.prototype.slice=function(e,t){e||=0,typeof t!=`number`&&(t=1/0);for(var n=[],r=o.iterator(this.ops),i=0;i0&&n.next(a.retain-s)}for(var l=new c(r);t.hasNext()||n.hasNext();)if(n.peekType()===`insert`)l.push(n.next());else if(t.peekType()===`delete`)l.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),d=t.next(u),f=n.next(u);if(typeof f.retain==`number`){var p={};typeof d.retain==`number`?p.retain=u:p.insert=d.insert;var m=o.attributes.compose(d.attributes,f.attributes,typeof d.retain==`number`);if(m&&(p.attributes=m),l.push(p),!n.hasNext()&&i(l.ops[l.ops.length-1],p)){var h=new c(t.rest());return l.concat(h).chop()}}else typeof f.delete==`number`&&typeof d.retain==`number`&&l.push(f)}return l.chop()},c.prototype.concat=function(e){var t=new c(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},c.prototype.diff=function(e,t){if(this.ops===e.ops)return new c;var n=[this,e].map(function(t){return t.map(function(n){if(n.insert!=null)return typeof n.insert==`string`?n.insert:s;throw Error(`diff() called `+(t===e?`on`:`with`)+` non-document`)}).join(``)}),a=new c,l=r(n[0],n[1],t),u=o.iterator(this.ops),d=o.iterator(e.ops);return l.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(d.peekLength(),t),a.push(d.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),a.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),t);var s=u.next(n),c=d.next(n);i(s.insert,c.insert)?a.retain(n,o.attributes.diff(s.attributes,c.attributes)):a.push(c).delete(n);break}t-=n}}),a.chop()},c.prototype.eachLine=function(e,t){t||=` `;for(var n=o.iterator(this.ops),r=new c,i=0;n.hasNext();){if(n.peekType()!==`insert`)return;var a=n.peek(),s=o.length(a)-n.peekLength(),l=typeof a.insert==`string`?a.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(e(r,n.next(1).attributes||{},i)===!1)return;i+=1,r=new c}}r.length()>0&&e(r,{},i)},c.prototype.transform=function(e,t){if(t=!!t,typeof e==`number`)return this.transformPosition(e,t);for(var n=o.iterator(this.ops),r=o.iterator(e.ops),i=new c;n.hasNext()||r.hasNext();)if(n.peekType()===`insert`&&(t||r.peekType()!==`insert`))i.retain(o.length(n.next()));else if(r.peekType()===`insert`)i.push(r.next());else{var a=Math.min(n.peekLength(),r.peekLength()),s=n.next(a),l=r.next(a);if(s.delete)continue;l.delete?i.push(l):i.retain(a,o.attributes.transform(s.attributes,l.attributes,t))}return i.chop()},c.prototype.transformPosition=function(e,t){t=!!t;for(var n=o.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}else a===`insert`&&(r0&&(e1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(e===0||e>=this.length()-h)){var r=this.clone();return e===0?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}else{var a=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`split`,this).call(this,e,n);return this.cache={},a}}}]),t}(s.default.Block);_.blotName=`block`,_.tagName=`P`,_.defaultChild=`break`,_.allowedChildren=[l.default,s.default.Embed,u.default];function v(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e==null||(typeof e.formats==`function`&&(t=(0,a.default)(t,e.formats())),e.parent==null||e.parent.blotName==`scroll`||e.parent.statics.scope!==e.statics.scope)?t:v(e.parent,t)}t.bubbleFormats=v,t.BlockEmbed=g,t.default=_}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof e!=`string`){var i=e.attrName||e.blotName;typeof i==`string`?this.register(`formats/`+i,e,t):Object.keys(e).forEach(function(r){n.register(r,e[r],t)})}else this.imports[e]!=null&&!r&&y.warn(`Overwriting `+e+` with`,t),this.imports[e]=t,(e.startsWith(`blots/`)||e.startsWith(`formats/`))&&t.blotName!==`abstract`?u.default.register(t):e.startsWith(`modules`)&&typeof t.register==`function`&&t.register()}}]);function e(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(v(this,e),this.options=x(t,r),this.container=this.options.container,this.container==null)return y.error(`Invalid Quill container`,t);this.options.debug&&e.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add(`ql-container`),this.container.innerHTML=``,this.container.__quill=this,this.root=this.addContainer(`ql-editor`),this.root.classList.add(`ql-blank`),this.root.setAttribute(`data-gramm`,!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new c.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new f.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule(`keyboard`),this.clipboard=this.theme.addModule(`clipboard`),this.history=this.theme.addModule(`history`),this.theme.init(),this.emitter.on(c.default.events.EDITOR_CHANGE,function(e){e===c.default.events.TEXT_CHANGE&&n.root.classList.toggle(`ql-blank`,n.editor.isBlank())}),this.emitter.on(c.default.events.SCROLL_UPDATE,function(e,t){var r=n.selection.lastRange,i=r&&r.length===0?r.index:void 0;S.call(n,function(){return n.editor.update(null,t,i)},e)});var a=this.clipboard.convert(`
`+i+`


`);this.setContents(a),this.history.clear(),this.options.placeholder&&this.root.setAttribute(`data-placeholder`,this.options.placeholder),this.options.readOnly&&this.disable()}return a(e,[{key:`addContainer`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e==`string`){var n=e;e=document.createElement(`div`),e.classList.add(n)}return this.container.insertBefore(e,t),e}},{key:`blur`,value:function(){this.selection.setRange(null)}},{key:`deleteText`,value:function(e,t,n){var r=this,a=i(C(e,t,n),4);return e=a[0],t=a[1],n=a[3],S.call(this,function(){return r.editor.deleteText(e,t)},n,e,-1*t)}},{key:`disable`,value:function(){this.enable(!1)}},{key:`enable`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle(`ql-disabled`,!e)}},{key:`focus`,value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:`format`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.default.sources.API;return S.call(this,function(){var r=n.getSelection(!0),i=new o.default;if(r==null)return i;if(u.default.query(e,u.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,_({},e,t));else if(r.length===0)return n.selection.format(e,t),i;else i=n.editor.formatText(r.index,r.length,_({},e,t));return n.setSelection(r,c.default.sources.SILENT),i},r)}},{key:`formatLine`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,t,n,r,a),4);return e=c[0],t=c[1],s=c[2],a=c[3],S.call(this,function(){return o.editor.formatLine(e,t,s)},a,e,0)}},{key:`formatText`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,t,n,r,a),4);return e=c[0],t=c[1],s=c[2],a=c[3],S.call(this,function(){return o.editor.formatText(e,t,s)},a,e,0)}},{key:`getBounds`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=void 0;n=typeof e==`number`?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:`getContents`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e,n=i(C(e,t),2);return e=n[0],t=n[1],this.editor.getContents(e,t)}},{key:`getFormat`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e==`number`?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:`getIndex`,value:function(e){return e.offset(this.scroll)}},{key:`getLength`,value:function(){return this.scroll.length()}},{key:`getLeaf`,value:function(e){return this.scroll.leaf(e)}},{key:`getLine`,value:function(e){return this.scroll.line(e)}},{key:`getLines`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e==`number`?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}},{key:`getModule`,value:function(e){return this.theme.modules[e]}},{key:`getSelection`,value:function(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:`getText`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e,n=i(C(e,t),2);return e=n[0],t=n[1],this.editor.getText(e,t)}},{key:`hasFocus`,value:function(){return this.selection.hasFocus()}},{key:`insertEmbed`,value:function(t,n,r){var i=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return S.call(this,function(){return i.editor.insertEmbed(t,n,r)},a,t)}},{key:`insertText`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,0,n,r,a),4);return e=c[0],s=c[2],a=c[3],S.call(this,function(){return o.editor.insertText(e,t,s)},a,e,t.length)}},{key:`isEnabled`,value:function(){return!this.container.classList.contains(`ql-disabled`)}},{key:`off`,value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:`on`,value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:`once`,value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:`pasteHTML`,value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:`removeFormat`,value:function(e,t,n){var r=this,a=i(C(e,t,n),4);return e=a[0],t=a[1],n=a[3],S.call(this,function(){return r.editor.removeFormat(e,t)},n,e)}},{key:`scrollIntoView`,value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:`setContents`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return S.call(this,function(){e=new o.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),i=t.editor.applyDelta(e),a=i.ops[i.ops.length-1];return a!=null&&typeof a.insert==`string`&&a.insert[a.insert.length-1]===` `&&(t.editor.deleteText(t.getLength()-1,1),i.delete(1)),r.compose(i)},n)}},{key:`setSelection`,value:function(t,n,r){if(t==null)this.selection.setRange(null,n||e.sources.API);else{var a=i(C(t,n,r),4);t=a[0],n=a[1],r=a[3],this.selection.setRange(new d.Range(t,n),r),r!==c.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:`setText`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API,n=new o.default().insert(e);return this.setContents(n,t)}},{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:`updateContents`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return S.call(this,function(){return e=new o.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:``,readOnly:!1,scrollingContainer:null,strict:!0,theme:`default`},b.events=c.default.events,b.sources=c.default.sources,b.version=`1.3.7`,b.imports={delta:o.default,parchment:u.default,"core/module":l.default,"core/theme":h.default};function x(e,t){if(t=(0,p.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t),!t.theme||t.theme===b.DEFAULTS.theme)t.theme=h.default;else if(t.theme=b.import(`themes/`+t.theme),t.theme==null)throw Error(`Invalid theme `+t.theme+`. Did you register it?`);var n=(0,p.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){e.modules[t]===!0&&(e.modules[t]={})})});var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import(`modules/`+t);return n==null?y.error(`Cannot load `+t+` module. Are you sure you registered it?`):e[t]=n.DEFAULTS||{},e},{});return t.modules!=null&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,p.default)(!0,{},b.DEFAULTS,{modules:r},n,t),[`bounds`,`container`,`scrollingContainer`].forEach(function(e){typeof t[e]==`string`&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function S(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===c.default.sources.USER)return new o.default;var i=n==null?null:this.getSelection(),a=this.editor.delta,s=e();if(i!=null&&(n===!0&&(n=i.index),r==null?i=w(i,s,t):r!==0&&(i=w(i,n,r,t)),this.setSelection(i,c.default.sources.SILENT)),s.length()>0){var l,u=[c.default.events.TEXT_CHANGE,s,a,t];if((l=this.emitter).emit.apply(l,[c.default.events.EDITOR_CHANGE].concat(u)),t!==c.default.sources.SILENT){var d;(d=this.emitter).emit.apply(d,u)}}return s}function C(e,t,n,i,a){var o={};return typeof e.index==`number`&&typeof e.length==`number`?typeof t==`number`?(t=e.length,e=e.index):(a=i,i=n,n=t,t=e.length,e=e.index):typeof t!=`number`&&(a=i,i=n,n=t,t=0),(n===void 0?`undefined`:r(n))===`object`?(o=n,a=i):typeof n==`string`&&(i==null?a=n:o[n]=i),a||=c.default.sources.API,[e,t,o,a]}function w(e,t,n,r){if(e==null)return null;var a=void 0,s=void 0;if(t instanceof o.default){var l=i([e.index,e.index+e.length].map(function(e){return t.transformPosition(e,r!==c.default.sources.USER)}),2);a=l[0],s=l[1]}else{var u=i([e.index,e.index+e.length].map(function(e){return e=0?e+n:Math.max(t,e+n)}),2);a=u[0],s=u[1]}return new d.Range(a,s-a)}t.expandConfig=x,t.overload=C,t.default=b}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:`compare`,value:function(e,n){var r=t.order.indexOf(e),i=t.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e1&&arguments[1]!==void 0?arguments[1]:{};r(this,e),this.quill=t,this.options=n};i.DEFAULTS={},t.default=i}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=[`error`,`warn`,`log`,`info`],i=`warn`;function a(e){if(r.indexOf(e)<=r.indexOf(i)){var t,n=[...arguments].slice(1);(t=console)[e].apply(t,n)}}function o(e){return r.reduce(function(t,n){return t[n]=a.bind(console,n,e),t},{})}a.level=o.level=function(e){i=e},t.default=o}),(function(e,t,n){var r=Array.prototype.slice,i=n(52),a=n(53),o=e.exports=function(e,t,n){return n||={},e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||typeof e!=`object`&&typeof t!=`object`?n.strict?e===t:e==t:l(e,t,n)};function s(e){return e==null}function c(e){return!(!e||typeof e!=`object`||typeof e.length!=`number`||typeof e.copy!=`function`||typeof e.slice!=`function`||e.length>0&&typeof e[0]!=`number`)}function l(e,t,n){var l,u;if(s(e)||s(t)||e.prototype!==t.prototype)return!1;if(a(e))return a(t)?(e=r.call(e),t=r.call(t),o(e,t,n)):!1;if(c(e)){if(!c(t)||e.length!==t.length)return!1;for(l=0;l=0;l--)if(d[l]!=f[l])return!1;for(l=d.length-1;l>=0;l--)if(u=d[l],!o(e[u],t[u],n))return!1;return typeof e==typeof t}}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(1);t.default=function(){function e(e,t,n){n===void 0&&(n={}),this.attrName=e,this.keyName=t;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;n.scope==null?this.scope=r.Scope.ATTRIBUTE:this.scope=n.scope&r.Scope.LEVEL|i,n.whitelist!=null&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1},e.prototype.canAdd=function(e,t){return r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))==null?!1:this.whitelist==null?!0:typeof t==`string`?this.whitelist.indexOf(t.replace(/["']/g,``))>-1:this.whitelist.indexOf(t)>-1},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:``},e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.Code=void 0;var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(e,t){for(var n=0;n=e+n)){var o=this.newlineIndex(e,!0)+1,c=a-o+1,l=this.isolate(o,c),u=l.next;l.format(r,i),u instanceof t&&u.formatAt(0,e-o+n-c,r,i)}}}},{key:`insertAt`,value:function(e,t,n){if(n==null){var i=r(this.descendant(u.default,e),2),a=i[0],o=i[1];a.insertAt(o,t)}}},{key:`length`,value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith(` `)?e:e+1}},{key:`newlineIndex`,value:function(e){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf(` `);var t=this.domNode.textContent.slice(e).indexOf(` `);return t>-1?e+t:-1}},{key:`optimize`,value:function(e){this.domNode.textContent.endsWith(` `)||this.appendChild(s.default.create(`text`,` `)),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e);var n=this.next;n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:`replace`,value:function(e){a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replace`,this).call(this,e),[].slice.call(this.domNode.querySelectorAll(`*`)).forEach(function(e){var t=s.default.find(e);t==null?e.parentNode.removeChild(e):t instanceof s.default.Embed?t.remove():t.unwrap()})}}],[{key:`create`,value:function(e){var n=a(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return n.setAttribute(`spellcheck`,!1),n}},{key:`formats`,value:function(){return!0}}]),t}(c.default);g.blotName=`code-block`,g.tagName=`PRE`,g.TAB=` `,t.Code=h,t.default=g}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(e,t){for(var n=0;n=a&&!p.endsWith(` `)&&(n=!0),t.scroll.insertAt(e,p);var m=i(t.scroll.line(e),2),h=m[0],_=m[1],v=(0,g.default)({},(0,d.bubbleFormats)(h));if(h instanceof f.default){var y=i(h.descendant(c.default.Leaf,_),1)[0];v=(0,g.default)(v,(0,d.bubbleFormats)(y))}u=s.default.attributes.diff(v,u)||{}}else if(r(o.insert)===`object`){var b=Object.keys(o.insert)[0];if(b==null)return e;t.scroll.insertAt(e,b,o.insert[b])}a+=l}return Object.keys(u).forEach(function(n){t.scroll.formatAt(e,l,n,u[n])}),e+l},0),e.reduce(function(e,n){return typeof n.delete==`number`?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:`deleteText`,value:function(e,t){return this.scroll.deleteAt(e,t),this.update(new o.default().retain(e).delete(t))}},{key:`formatLine`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(i){if(!(n.scroll.whitelist!=null&&!n.scroll.whitelist[i])){var a=n.scroll.lines(e,Math.max(t,1)),o=t;a.forEach(function(t){var a=t.length();if(!(t instanceof l.default))t.format(i,r[i]);else{var s=e-t.offset(n.scroll),c=t.newlineIndex(s+o)-s+1;t.formatAt(s,c,i,r[i])}o-=a})}}),this.scroll.optimize(),this.update(new o.default().retain(e).retain(t,(0,m.default)(r)))}},{key:`formatText`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t,i,r[i])}),this.update(new o.default().retain(e).retain(t,(0,m.default)(r)))}},{key:`getContents`,value:function(e,t){return this.delta.slice(e,e+t)}},{key:`getDelta`,value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new o.default)}},{key:`getFormat`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(function(e){var t=i(e,1)[0];t instanceof f.default?n.push(t):t instanceof c.default.Leaf&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(c.default.Leaf,e,t));var a=[n,r].map(function(e){if(e.length===0)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(n==null)return t;t=S((0,d.bubbleFormats)(n),t)}return t});return g.default.apply(g.default,a)}},{key:`getText`,value:function(e,t){return this.getContents(e,t).filter(function(e){return typeof e.insert==`string`}).map(function(e){return e.insert}).join(``)}},{key:`insertEmbed`,value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new o.default().retain(e).insert(v({},t,n)))}},{key:`insertText`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,` `).replace(/\r/g,` `),this.scroll.insertAt(e,t),Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t.length,i,r[i])}),this.update(new o.default().retain(e).insert(t,(0,m.default)(r)))}},{key:`isBlank`,value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName!==f.default.blotName||e.children.length>1?!1:e.children.head instanceof p.default}},{key:`removeFormat`,value:function(e,t){var n=this.getText(e,t),r=i(this.scroll.line(e+t),2),a=r[0],s=r[1],c=0,u=new o.default;a!=null&&(c=a instanceof l.default?a.newlineIndex(s)-s+1:a.length()-s,u=a.delta().slice(s,s+c-1).insert(` `));var d=this.getContents(e,t+c).diff(new o.default().insert(n).concat(u)),f=new o.default().retain(e).concat(d);return this.applyDelta(f)}},{key:`update`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type===`characterData`&&t[0].target.data.match(b)&&c.default.find(t[0].target)){var i=c.default.find(t[0].target),a=(0,d.bubbleFormats)(i),s=i.offset(this.scroll),l=t[0].oldValue.replace(u.default.CONTENTS,``),f=new o.default().insert(l),p=new o.default().insert(i.value());e=new o.default().retain(s).concat(f.diff(p,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,a):e.push(t)},new o.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!(0,h.default)(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}}]),e}();function S(e,t){return Object.keys(t).reduce(function(n,r){return e[r]==null||(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?t[r].indexOf(e[r])<0&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]]),n},{})}function C(e){return e.reduce(function(e,t){if(t.insert===1){var n=(0,m.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(t.attributes!=null&&(t.attributes.list===!0||t.attributes.bullet===!0)&&(t=(0,m.default)(t),t.attributes.list?t.attributes.list=`ordered`:(t.attributes.list=`bullet`,delete t.attributes.bullet)),typeof t.insert==`string`){var r=t.insert.replace(/\r\n/g,` `).replace(/\r/g,` `);return e.insert(r,t.attributes)}return e.push(t)},new o.default)}t.default=x}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.Range=void 0;var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:0;f(this,e),this.index=t,this.length=n},h=function(){function e(t,n){var r=this;f(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=a.default.create(`cursor`,this),this.lastRange=this.savedRange=new m(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM(`selectionchange`,document,function(){r.mouseDown||setTimeout(r.update.bind(r,c.default.sources.USER),1)}),this.emitter.on(c.default.events.EDITOR_CHANGE,function(e,t){e===c.default.events.TEXT_CHANGE&&t.length()>0&&r.update(c.default.sources.SILENT)}),this.emitter.on(c.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var e=r.getNativeRange();e!=null&&e.start.node!==r.cursor.textNode&&r.emitter.once(c.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch{}})}}),this.emitter.on(c.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,i=n.startNode,a=n.startOffset,o=n.endNode,s=n.endOffset;r.setNativeRange(i,a,o,s)}}),this.update(c.default.sources.SILENT)}return i(e,[{key:`handleComposition`,value:function(){var e=this;this.root.addEventListener(`compositionstart`,function(){e.composing=!0}),this.root.addEventListener(`compositionend`,function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:`handleDragging`,value:function(){var e=this;this.emitter.listenDOM(`mousedown`,document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM(`mouseup`,document.body,function(){e.mouseDown=!1,e.update(c.default.sources.USER)})}},{key:`focus`,value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:`format`,value:function(e,t){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[e])){this.scroll.update();var n=this.getNativeRange();if(!(n==null||!n.native.collapsed||a.default.query(e,a.default.Scope.BLOCK))){if(n.start.node!==this.cursor.textNode){var r=a.default.find(n.start.node,!1);if(r==null)return;if(r instanceof a.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:`getBounds`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var i=void 0,a=r(this.scroll.leaf(e),2),o=a[0],s=a[1];if(o==null)return null;var c=r(o.position(s,!0),2);i=c[0],s=c[1];var l=document.createRange();if(t>0){l.setStart(i,s);var u=r(this.scroll.leaf(e+t),2);if(o=u[0],s=u[1],o==null)return null;var d=r(o.position(s,!0),2);return i=d[0],s=d[1],l.setEnd(i,s),l.getBoundingClientRect()}else{var f=`left`,p=void 0;return i instanceof Text?(s0&&(f=`right`)),{bottom:p.top+p.height,height:p.height,left:p[f],right:p[f],top:p.top,width:0}}}},{key:`getNativeRange`,value:function(){var e=document.getSelection();if(e==null||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(t==null)return null;var n=this.normalizeNative(t);return p.info(`getNativeRange`,n),n}},{key:`getRange`,value:function(){var e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}},{key:`hasFocus`,value:function(){return document.activeElement===this.root}},{key:`normalizedToRange`,value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var i=n.map(function(e){var n=r(e,2),i=n[0],o=n[1],s=a.default.find(i,!0),c=s.offset(t.scroll);return o===0?c:s instanceof a.default.Container?c+s.length():c+s.index(i,o)}),o=Math.min(Math.max.apply(Math,d(i)),this.scroll.length()-1),s=Math.min.apply(Math,[o].concat(d(i)));return new m(s,o-s)}},{key:`normalizeNative`,value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}},{key:`rangeToNative`,value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],i=[],a=this.scroll.length();return n.forEach(function(e,n){e=Math.min(a-1,e);var o=void 0,s=r(t.scroll.leaf(e),2),c=s[0],l=s[1],u=r(c.position(l,n!==0),2);o=u[0],l=u[1],i.push(o,l)}),i.length<2&&(i=i.concat(i)),i}},{key:`scrollIntoView`,value:function(e){var t=this.lastRange;if(t!=null){var n=this.getBounds(t.index,t.length);if(n!=null){var i=this.scroll.length()-1,a=r(this.scroll.line(Math.min(t.index,i)),1)[0],o=a;if(t.length>0&&(o=r(this.scroll.line(Math.min(t.index+t.length,i)),1)[0]),!(a==null||o==null)){var s=e.getBoundingClientRect();n.tops.bottom&&(e.scrollTop+=n.bottom-s.bottom)}}}}},{key:`setNativeRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(p.info(`setNativeRange`,e,t,n,r),!(e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))){var a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus();var o=(this.getNativeRange()||{}).native;if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e.tagName==`BR`&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),n.tagName==`BR`&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(e,t),s.setEnd(n,r),a.removeAllRanges(),a.addRange(s)}}else a.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:`setRange`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.default.sources.API;if(typeof t==`string`&&(n=t,t=!1),p.info(`setRange`,e),e!=null){var r=this.rangeToNative(e);this.setNativeRange.apply(this,d(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.default.sources.USER,t=this.lastRange,n=r(this.getRange(),2),i=n[0],a=n[1];if(this.lastRange=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,s.default)(t,this.lastRange)){var l;!this.composing&&a!=null&&a.native.collapsed&&a.start.node!==this.cursor.textNode&&this.cursor.restore();var u=[c.default.events.SELECTION_CHANGE,(0,o.default)(this.lastRange),(0,o.default)(t),e];if((l=this.emitter).emit.apply(l,[c.default.events.EDITOR_CHANGE].concat(u)),e!==c.default.sources.SILENT){var d;(d=this.emitter).emit.apply(d,u)}}}}]),e}();function g(e,t){try{t.parentNode}catch{return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=m,t.default=h}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return e={},e[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(i.default)}),(function(e,t,n){var r=n(11),i=n(3),a={attributes:{compose:function(e,t,n){typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var r=i(!0,{},t);for(var a in n||(r=Object.keys(r).reduce(function(e,t){return r[t]!=null&&(e[t]=r[t]),e},{})),e)e[a]!==void 0&&t[a]===void 0&&(r[a]=e[a]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r(e[i],t[i])||(n[i]=t[i]===void 0?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if(typeof e!=`object`)return t;if(typeof t==`object`){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return e[r]===void 0&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new o(e)},length:function(e){return typeof e.delete==`number`?e.delete:typeof e.retain==`number`?e.retain:typeof e.insert==`string`?e.insert.length:1}};function o(e){this.ops=e,this.index=0,this.offset=0}o.prototype.hasNext=function(){return this.peekLength()<1/0},o.prototype.next=function(e){e||=1/0;var t=this.ops[this.index];if(t){var n=this.offset,r=a.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete==`number`)return{delete:e};var i={};return t.attributes&&(i.attributes=t.attributes),typeof t.retain==`number`?i.retain=e:typeof t.insert==`string`?i.insert=t.insert.substr(n,e):i.insert=t.insert,i}else return{retain:1/0}},o.prototype.peek=function(){return this.ops[this.index]},o.prototype.peekLength=function(){return this.ops[this.index]?a.length(this.ops[this.index])-this.offset:1/0},o.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete==`number`?`delete`:typeof this.ops[this.index].retain==`number`?`retain`:`insert`:`retain`},o.prototype.rest=function(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)},e.exports=a}),(function(e,t){var n=(function(){function e(e,t){return t!=null&&e instanceof t}var t;try{t=Map}catch{t=function(){}}var n;try{n=Set}catch{n=function(){}}var r;try{r=Promise}catch{r=function(){}}function i(a,o,s,c,u){typeof o==`object`&&(s=o.depth,c=o.prototype,u=o.includeNonEnumerable,o=o.circular);var d=[],f=[],p=typeof Buffer<`u`;o===void 0&&(o=!0),s===void 0&&(s=1/0);function m(a,s){if(a===null)return null;if(s===0)return a;var h,g;if(typeof a!=`object`)return a;if(e(a,t))h=new t;else if(e(a,n))h=new n;else if(e(a,r))h=new r(function(e,t){a.then(function(t){e(m(t,s-1))},function(e){t(m(e,s-1))})});else if(i.__isArray(a))h=[];else if(i.__isRegExp(a))h=new RegExp(a.source,l(a)),a.lastIndex&&(h.lastIndex=a.lastIndex);else if(i.__isDate(a))h=new Date(a.getTime());else if(p&&Buffer.isBuffer(a))return h=Buffer.allocUnsafe?Buffer.allocUnsafe(a.length):new Buffer(a.length),a.copy(h),h;else e(a,Error)?h=Object.create(a):c===void 0?(g=Object.getPrototypeOf(a),h=Object.create(g)):(h=Object.create(c),g=c);if(o){var _=d.indexOf(a);if(_!=-1)return f[_];d.push(a),f.push(h)}for(var v in e(a,t)&&a.forEach(function(e,t){var n=m(t,s-1),r=m(e,s-1);h.set(n,r)}),e(a,n)&&a.forEach(function(e){var t=m(e,s-1);h.add(t)}),a){var y;g&&(y=Object.getOwnPropertyDescriptor(g,v)),!(y&&y.set==null)&&(h[v]=m(a[v],s-1))}if(Object.getOwnPropertySymbols)for(var b=Object.getOwnPropertySymbols(a),v=0;v0){if(o instanceof c.BlockEmbed||l instanceof c.BlockEmbed){this.optimize();return}if(o instanceof d.default){var f=o.newlineIndex(o.length(),!0);if(f>-1&&(o=o.split(f+1),o===l)){this.optimize();return}}else if(l instanceof d.default){var p=l.newlineIndex(0);p>-1&&l.split(p+1)}var m=l.children.head instanceof u.default?null:l.children.head;o.moveChildren(l,m),o.remove()}this.optimize()}},{key:`enable`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute(`contenteditable`,e)}},{key:`formatAt`,value:function(e,n,r,i){this.whitelist!=null&&!this.whitelist[r]||(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`formatAt`,this).call(this,e,n,r,i),this.optimize())}},{key:`insertAt`,value:function(e,n,r){if(!(r!=null&&this.whitelist!=null&&!this.whitelist[n])){if(e>=this.length())if(r==null||o.default.query(n,o.default.Scope.BLOCK)==null){var i=o.default.create(this.statics.defaultChild);this.appendChild(i),r==null&&n.endsWith(` `)&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var s=o.default.create(n,r);this.appendChild(s)}else a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r);this.optimize()}}},{key:`insertBefore`,value:function(e,n){if(e.statics.scope===o.default.Scope.INLINE_BLOT){var r=o.default.create(this.statics.defaultChild);r.appendChild(e),e=r}a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n)}},{key:`leaf`,value:function(e){return this.path(e).pop()||[null,-1]}},{key:`line`,value:function(e){return e===this.length()?this.line(e-1):this.descendant(_,e)}},{key:`lines`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return function e(t,n,r){var i=[],a=r;return t.children.forEachAt(n,r,function(t,n,r){_(t)?i.push(t):t instanceof o.default.Container&&(i=i.concat(e(t,n,a))),a-=r}),i}(this,e,t)}},{key:`optimize`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e,n),e.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,e,n))}},{key:`path`,value:function(e){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`path`,this).call(this,e).slice(1)}},{key:`update`,value:function(e){if(this.batch!==!0){var n=s.default.sources.USER;typeof e==`string`&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,e),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`update`,this).call(this,e.concat([])),e.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,e)}}}]),t}(o.default.Scroll);v.blotName=`scroll`,v.className=`ql-editor`,v.tagName=`DIV`,v.defaultChild=`block`,v.allowedChildren=[l.default,c.BlockEmbed,f.default],t.default=v}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.SHORTKEY=t.default=void 0;var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=A(e);if(r==null||r.key==null)return b.warn(`Attempted to add invalid keyboard binding`,r);typeof t==`function`&&(t={handler:t}),typeof n==`function`&&(n={handler:n}),r=(0,c.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:`listen`,value:function(){var e=this;this.quill.root.addEventListener(`keydown`,function(n){if(!n.defaultPrevented){var a=n.which||n.keyCode,o=(e.bindings[a]||[]).filter(function(e){return t.match(n,e)});if(o.length!==0){var c=e.quill.getSelection();if(!(c==null||!e.quill.hasFocus())){var l=i(e.quill.getLine(c.index),2),u=l[0],f=l[1],p=i(e.quill.getLeaf(c.index),2),m=p[0],h=p[1],g=i(c.length===0?[m,h]:e.quill.getLeaf(c.index+c.length),2),_=g[0],v=g[1],y=m instanceof d.default.Text?m.value().slice(0,h):``,b=_ instanceof d.default.Text?_.value().slice(v):``,x={collapsed:c.length===0,empty:c.length===0&&u.length()<=1,format:e.quill.getFormat(c),offset:f,prefix:y,suffix:b};o.some(function(t){if(t.collapsed!=null&&t.collapsed!==x.collapsed||t.empty!=null&&t.empty!==x.empty||t.offset!=null&&t.offset!==x.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return x.format[e]==null}))return!1}else if(r(t.format)===`object`&&!Object.keys(t.format).every(function(e){return t.format[e]===!0?x.format[e]!=null:t.format[e]===!1?x.format[e]==null:(0,s.default)(t.format[e],x.format[e])}))return!1;return t.prefix!=null&&!t.prefix.test(x.prefix)||t.suffix!=null&&!t.suffix.test(x.suffix)?!1:t.handler.call(e,c,x)!==!0})&&n.preventDefault()}}}})}}]),t}(m.default);S.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},S.DEFAULTS={bindings:{bold:k(`bold`),italic:k(`italic`),underline:k(`underline`),indent:{key:S.keys.TAB,format:[`blockquote`,`indent`,`list`],handler:function(e,t){if(t.collapsed&&t.offset!==0)return!0;this.quill.format(`indent`,`+1`,f.default.sources.USER)}},outdent:{key:S.keys.TAB,shiftKey:!0,format:[`blockquote`,`indent`,`list`],handler:function(e,t){if(t.collapsed&&t.offset!==0)return!0;this.quill.format(`indent`,`-1`,f.default.sources.USER)}},"outdent backspace":{key:S.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:[`indent`,`list`],offset:0,handler:function(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format(`list`,!1,f.default.sources.USER):this.quill.format(`indent`,`-1`,f.default.sources.USER)}},"indent code-block":O(!0),"outdent code-block":O(!1),"remove tab":{key:S.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,f.default.sources.USER)}},tab:{key:S.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=new l.default().retain(e.index).delete(e.length).insert(` `);this.quill.updateContents(t,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,f.default.sources.SILENT)}},"list empty enter":{key:S.keys.ENTER,collapsed:!0,format:[`list`],empty:!0,handler:function(e,t){this.quill.format(`list`,!1,f.default.sources.USER),t.format.indent&&this.quill.format(`indent`,!1,f.default.sources.USER)}},"checklist enter":{key:S.keys.ENTER,collapsed:!0,format:{list:`checked`},handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],a=(0,c.default)({},n.formats(),{list:`checked`}),o=new l.default().retain(e.index).insert(` `,a).retain(n.length()-r-1).retain(1,{list:`unchecked`});this.quill.updateContents(o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:S.keys.ENTER,collapsed:!0,format:[`header`],suffix:/^$/,handler:function(e,t){var n=i(this.quill.getLine(e.index),2),r=n[0],a=n[1],o=new l.default().retain(e.index).insert(` `,t.format).retain(r.length()-a-1).retain(1,{header:null});this.quill.updateContents(o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:` `,collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=i(this.quill.getLine(e.index),2),a=r[0],o=r[1];if(o>n)return!0;var s=void 0;switch(t.prefix.trim()){case`[]`:case`[ ]`:s=`unchecked`;break;case`[x]`:s=`checked`;break;case`-`:case`*`:s=`bullet`;break;default:s=`ordered`}this.quill.insertText(e.index,` `,f.default.sources.USER),this.quill.history.cutoff();var c=new l.default().retain(e.index-o).delete(n+1).retain(a.length()-2-o).retain(1,{list:s});this.quill.updateContents(c,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,f.default.sources.SILENT)}},"code exit":{key:S.keys.ENTER,collapsed:!0,format:[`code-block`],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],a=new l.default().retain(e.index+n.length()-r-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,f.default.sources.USER)}},"embed left":C(S.keys.LEFT,!1),"embed left shift":C(S.keys.LEFT,!0),"embed right":C(S.keys.RIGHT,!1),"embed right shift":C(S.keys.RIGHT,!0)}};function C(e,t){var n,r=e===S.keys.LEFT?`prefix`:`suffix`;return n={key:e,shiftKey:t,altKey:null},g(n,r,/^$/),g(n,`handler`,function(n){var r=n.index;return e===S.keys.RIGHT&&(r+=n.length+1),i(this.quill.getLeaf(r),1)[0]instanceof d.default.Embed?(e===S.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index-1,f.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index+n.length+1,f.default.sources.USER),!1):!0}),n}function w(e,t){if(!(e.index===0||this.quill.getLength()<=1)){var n=i(this.quill.getLine(e.index),1)[0],r={};if(t.offset===0){var a=i(this.quill.getLine(e.index-1),1)[0];if(a!=null&&a.length()>1){var o=n.formats(),s=this.quill.getFormat(e.index-1,1);r=u.default.attributes.diff(o,s)||{}}}var c=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-c,c,f.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index-c,c,r,f.default.sources.USER),this.quill.focus()}}function T(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},a=0,o=i(this.quill.getLine(e.index),1)[0];if(t.offset>=o.length()-1){var s=i(this.quill.getLine(e.index+1),1)[0];if(s){var c=o.formats(),l=this.quill.getFormat(e.index,1);r=u.default.attributes.diff(c,l)||{},a=s.length()}}this.quill.deleteText(e.index,n,f.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+a-1,n,r,f.default.sources.USER)}}function E(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),i=t[t.length-1].formats();n=u.default.attributes.diff(i,r)||{}}this.quill.deleteText(e,f.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,f.default.sources.USER),this.quill.setSelection(e.index,f.default.sources.SILENT),this.quill.focus()}function D(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,` `,r,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){r[e]??(Array.isArray(t.format[e])||e!==`link`&&n.quill.format(e,t.format[e],f.default.sources.USER))})}function O(e){return{key:S.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query(`code-block`),r=t.index,a=t.length,o=i(this.quill.scroll.descendant(n,r),2),s=o[0],c=o[1];if(s!=null){var l=this.quill.getIndex(s),u=s.newlineIndex(c,!0)+1,p=s.newlineIndex(l+c+a),m=s.domNode.textContent.slice(u,p).split(` `);c=0,m.forEach(function(t,i){e?(s.insertAt(u+c,n.TAB),c+=n.TAB.length,i===0?r+=n.TAB.length:a+=n.TAB.length):t.startsWith(n.TAB)&&(s.deleteAt(u+c,n.TAB.length),c-=n.TAB.length,i===0?r-=n.TAB.length:a-=n.TAB.length),c+=t.length+1}),this.quill.update(f.default.sources.USER),this.quill.setSelection(r,a,f.default.sources.SILENT)}}}}function k(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],f.default.sources.USER)}}}function A(e){if(typeof e==`string`||typeof e==`number`)return A({key:e});if((e===void 0?`undefined`:r(e))===`object`&&(e=(0,o.default)(e,!1)),typeof e.key==`string`)if(S.keys[e.key.toUpperCase()]!=null)e.key=S.keys[e.key.toUpperCase()];else if(e.key.length===1)e.key=e.key.toUpperCase().charCodeAt(0);else return null;return e.shortKey&&(e[x]=e.shortKey,delete e.shortKey),e}t.default=S,t.SHORTKEY=x}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=function(){function e(e,t){for(var n=0;n-1}t.default=u,t.sanitize=d}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(`.ql-selected`);if(e!==n&&(n?.classList.remove(`ql-selected`),e!=null&&(e.classList.add(`ql-selected`),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute(`data-value`)?this.label.setAttribute(`data-value`,e.getAttribute(`data-value`)):this.label.removeAttribute(`data-value`),e.hasAttribute(`data-label`)?this.label.setAttribute(`data-label`,e.getAttribute(`data-label`)):this.label.removeAttribute(`data-label`),t))){if(typeof Event==`function`)this.select.dispatchEvent(new Event(`change`));else if((typeof Event>`u`?`undefined`:r(Event))===`object`){var i=document.createEvent(`Event`);i.initEvent(`change`,!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:`update`,value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(`.ql-picker-options`).children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=e!=null&&e!==this.select.querySelector(`option[selected]`);this.label.classList.toggle(`ql-active`,n)}}]),e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=_(n(0)),i=_(n(5)),a=n(4),o=_(a),s=_(n(16)),c=_(n(25)),l=_(n(24)),u=_(n(35)),d=_(n(6)),f=_(n(22)),p=_(n(7)),m=_(n(55)),h=_(n(42)),g=_(n(23));function _(e){return e&&e.__esModule?e:{default:e}}i.default.register({"blots/block":o.default,"blots/block/embed":a.BlockEmbed,"blots/break":s.default,"blots/container":c.default,"blots/cursor":l.default,"blots/embed":u.default,"blots/inline":d.default,"blots/scroll":f.default,"blots/text":p.default,"modules/clipboard":m.default,"modules/history":h.default,"modules/keyboard":g.default}),r.default.register(o.default,s.default,l.default,d.default,f.default,p.default),t.default=i.default}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(1);t.default=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,`statics`,{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(this.tagName==null)throw new r.ParchmentError(`Blot definition missing tagName`);var t;return Array.isArray(this.tagName)?(typeof e==`string`&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t=typeof e==`number`?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,i){var a=this.isolate(e,t);if(r.query(n,r.Scope.BLOT)!=null&&i)a.wrap(n,i);else if(r.query(n,r.Scope.ATTRIBUTE)!=null){var o=r.create(this.statics.scope);a.wrap(o),o.format(n,i)}},e.prototype.insertAt=function(e,t,n){var i=n==null?r.create(`text`,t):r.create(t,n),a=this.split(e);this.parent.insertBefore(i,a)},e.prototype.insertInto=function(e,t){t===void 0&&(t=null),this.parent!=null&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),t!=null&&(n=t.domNode),(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=n)&&e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return e===void 0&&(e=this.parent),this.parent==null||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){this.domNode[r.DATA_KEY]!=null&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){e.parent!=null&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n=typeof e==`string`?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return e===0?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n=typeof e==`string`?r.create(e,t):e;return this.parent!=null&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName=`abstract`,e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(12),i=n(32),a=n(33),o=n(1);t.default=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)==null?delete this.attributes[e.attrName]:this.attributes[e.attrName]=e):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=i.default.keys(this.domNode),s=a.default.keys(this.domNode);t.concat(n).concat(s).forEach(function(t){var n=o.query(t,o.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}()}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(12);function a(e,t){return(e.getAttribute(`class`)||``).split(/\s+/).filter(function(e){return e.indexOf(t+`-`)===0})}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.keys=function(e){return(e.getAttribute(`class`)||``).split(/\s+/).map(function(e){return e.split(`-`).slice(0,-1).join(`-`)})},t.prototype.add=function(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(this.keyName+`-`+t),!0):!1},t.prototype.remove=function(e){a(e,this.keyName).forEach(function(t){e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute(`class`)},t.prototype.value=function(e){var t=(a(e,this.keyName)[0]||``).slice(this.keyName.length+1);return this.canAdd(e,t)?t:``},t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(12);function a(e){var t=e.split(`-`),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(``);return t[0]+n}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.keys=function(e){return(e.getAttribute(`style`)||``).split(`;`).map(function(e){return e.split(`:`)[0].trim()})},t.prototype.add=function(e,t){return this.canAdd(e,t)?(e.style[a(this.keyName)]=t,!0):!1},t.prototype.remove=function(e){e.style[a(this.keyName)]=``,e.getAttribute(`style`)||e.removeAttribute(`style`)},t.prototype.value=function(e){var t=e.style[a(this.keyName)];return this.canAdd(e,t)?t:``},t}(i.default)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;nr&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),e=i.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:`redo`,value:function(){this.change(`redo`,`undo`)}},{key:`transform`,value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:`undo`,value:function(){this.change(`undo`,`redo`)}}]),t}(o.default);d.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function f(e){var t=e.ops[e.ops.length-1];return t==null?!1:t.insert==null?t.attributes==null?!1:Object.keys(t.attributes).some(function(e){return i.default.query(e,i.default.Scope.BLOCK)!=null}):typeof t.insert==`string`&&t.insert.endsWith(` `)}function p(e){var t=e.reduce(function(e,t){return e+=t.delete||0,e},0),n=e.length()-t;return f(e)&&--n,n}t.default=d,t.getLastChangeIndex=p}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:`link`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove(`ql-hidden`),this.root.classList.add(`ql-editing`),t==null?e!==this.root.getAttribute(`data-mode`)&&(this.textbox.value=``):this.textbox.value=t,this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute(`placeholder`,this.textbox.getAttribute(`data-`+e)||``),this.root.setAttribute(`data-mode`,e)}},{key:`restoreFocus`,value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:`save`,value:function(){var e=this.textbox.value;switch(this.root.getAttribute(`data-mode`)){case`link`:var t=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,`link`,e,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format(`link`,e,s.default.sources.USER)),this.quill.root.scrollTop=t;break;case`video`:e=T(e);case`formula`:if(!e)break;var n=this.quill.getSelection(!0);if(n!=null){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute(`data-mode`),e,s.default.sources.USER),this.root.getAttribute(`data-mode`)===`formula`&&this.quill.insertText(r+1,` `,s.default.sources.USER),this.quill.setSelection(r+2,s.default.sources.USER)}break;default:}this.textbox.value=``,this.hide()}}]),t}(p.default);function T(e){var t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?(t[1]||`https`)+`://www.youtube.com/embed/`+t[2]+`?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||`https`)+`://player.vimeo.com/video/`+t[2]+`/`:e}function E(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(function(t){var r=document.createElement(`option`);t===n?r.setAttribute(`selected`,`selected`):r.setAttribute(`value`,t),e.appendChild(r)})}t.BaseTooltip=w,t.default=C}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){var e=[...arguments];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,t==null?this.tail==null?(e.prev=null,this.head=this.tail=e):(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),--this.length)},e.prototype.iterator=function(e){return e===void 0&&(e=this.head),function(){var t=e;return e!=null&&(e=e.next),t}},e.prototype.find=function(e,t){t===void 0&&(t=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(es?n(o,e-s,Math.min(t,s+l-e)):n(o,0,Math.min(l,e+t-s)),s+=l}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}()}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(17),a=n(1),o={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=100;t.default=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,o),n.attach(),n}return t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),t===0&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,i){this.update(),e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;t===void 0&&(t=[]),n===void 0&&(n={}),e.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)t.push(o.pop());for(var c=function(e,t){t===void 0&&(t=!0),!(e==null||e===r)&&e.domNode.parentNode!=null&&(e.domNode[a.DATA_KEY].mutations??(e.domNode[a.DATA_KEY].mutations=[]),t&&c(e.parent))},l=function(e){e.domNode[a.DATA_KEY]==null||e.domNode[a.DATA_KEY].mutations==null||(e instanceof i.default&&e.children.forEach(l),e.optimize(n))},u=t,d=0;u.length>0;d+=1){if(d>=s)throw Error(`[Parchment] Maximum optimize iterations reached`);for(u.forEach(function(e){var t=a.find(e.target,!0);t!=null&&(t.domNode===e.target&&(e.type===`childList`?(c(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);c(t,!1),t instanceof i.default&&t.children.forEach(function(e){c(e,!1)})})):e.type===`attributes`&&c(t.prev)),c(t))}),this.children.forEach(l),u=[].slice.call(this.observer.takeRecords()),o=u.slice();o.length>0;)t.push(o.pop())}},t.prototype.update=function(t,n){var r=this;n===void 0&&(n={}),t||=this.observer.takeRecords(),t.map(function(e){var t=a.find(e.target,!0);return t==null?null:t.domNode[a.DATA_KEY].mutations==null?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){e==null||e===r||e.domNode[a.DATA_KEY]==null||e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),this.domNode[a.DATA_KEY].mutations!=null&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName=`scroll`,t.defaultChild=`block`,t.scope=a.Scope.BLOCK_BLOT,t.tagName=`DIV`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(18),a=n(1);function o(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var a=this;n===this.statics.blotName&&!r?(this.children.forEach(function(e){e instanceof i.default||(e=e.wrap(t.blotName,!0)),a.attributes.copy(e)}),this.unwrap()):e.prototype.format.call(this,n,r)},t.prototype.formatAt=function(t,n,r,i){this.formats()[r]!=null||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(Object.keys(r).length===0)return this.unwrap();var i=this.next;i instanceof t&&i.prev===this&&o(r,i.formats())&&(i.moveChildren(this),i.remove())},t.blotName=`inline`,t.scope=a.Scope.INLINE_BLOT,t.tagName=`SPAN`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(18),a=n(1);t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(n){var r=a.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){a.query(n,a.Scope.BLOCK)!=null&&(n===this.statics.blotName&&!r?this.replaceWith(t.blotName):e.prototype.format.call(this,n,r))},t.prototype.formatAt=function(t,n,r,i){a.query(r,a.Scope.BLOCK)==null?e.prototype.formatAt.call(this,t,n,r,i):this.format(r,i)},t.prototype.insertAt=function(t,n,r){if(r==null||a.query(n,a.Scope.INLINE)!=null)e.prototype.insertAt.call(this,t,n,r);else{var i=this.split(t),o=a.create(n,r);i.parent.insertBefore(o,i)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName=`block`,t.scope=a.Scope.BLOCK_BLOT,t.tagName=`P`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0}),t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,i){t===0&&n===this.length()?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(19),a=n(1);t.default=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){r==null?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return t===void 0&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(t===void 0&&(t=!1),!t){if(e===0)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return e.type===`characterData`&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName=`text`,t.scope=a.Scope.INLINE_BLOT,t}(i.default)}),(function(e,t,n){var r=document.createElement(`div`);if(r.classList.toggle(`test-class`,!1),r.classList.contains(`test-class`)){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:i.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t||=0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();(typeof t!=`number`||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,`find`,{value:function(e){if(this===null)throw TypeError(`Array.prototype.find called on null or undefined`);if(typeof e!=`function`)throw TypeError(`predicate must be a function`);for(var t=Object(this),n=t.length>>>0,r=arguments[1],i,a=0;at.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!=-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length==1)return[[n,e],[r,t]];var f=d(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;fi)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E==-y||E!=y&&d[w-1]i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2=e.length?[o,s,c,d,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,d,f,p;e.length>t.length?(c=s[0],d=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],d=s[3]);var m=s[4];return[c,d,f,p,m]}function f(e){e.push([i,``]);for(var t=0,a=0,o=0,s=``,c=``,d;t1?(a!==0&&o!==0&&(d=l(c,s),d!==0&&(t-a-o>0&&e[t-a-o-1][0]==i?e[t-a-o-1][1]+=c.substring(0,d):(e.splice(0,0,[i,c.substring(0,d)]),t++),c=c.substring(d),s=s.substring(d)),d=u(c,s),d!==0&&(e[t][1]=c.substring(c.length-d)+e[t][1],c=c.substring(0,c.length-d),s=s.substring(0,s.length-d))),a===0?e.splice(t-o,a+o,[r,c]):o===0?e.splice(t-a,a+o,[n,s]):e.splice(t-a-o,a+o,[n,s],[r,c]),t=t-a-o+(a?1:0)+(o?1:0)+1):t!==0&&e[t-1][0]==i?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,o=0,a=0,s=``,c=``;break}e[e.length-1][1]===``&&e.pop();var p=!1;for(t=1;t0&&r.splice(a+2,0,[s[0],c]),_(r,a,3)}else return e}function g(e){for(var t=!1,a=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},o=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319},s=2;s0&&c.push(e[s]);return c}function _(e,t,n){for(var r=t+n-1;r>=0&&r>=t-1;r--)if(r+1\r?\n +\<`),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[m.default.blotName]){var n=this.container.innerText;return this.container.innerHTML=``,new s.default().insert(n,b({},m.default.blotName,t[m.default.blotName]))}var r=i(this.prepareMatching(),2),a=r[0],o=r[1],c=P(this.container,a,o);return M(c,` `)&&c.ops[c.ops.length-1].attributes==null&&(c=c.compose(new s.default().retain(c.length()-1).delete(1))),w.log(`convert`,this.container.innerHTML,c),this.container.innerHTML=``,c}},{key:`dangerouslyPasteHTML`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.default.sources.API;if(typeof e==`string`)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,l.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents(new s.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),l.default.sources.SILENT)}}},{key:`onPaste`,value:function(e){var t=this;if(!(e.defaultPrevented||!this.quill.isEnabled())){var n=this.quill.getSelection(),r=new s.default().retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,l.default.sources.USER),t.quill.setSelection(r.length()-n.length,l.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=i,t.quill.focus()},1)}}},{key:`prepareMatching`,value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(r){var a=i(r,2),o=a[0],s=a[1];switch(o){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:t.push(s);break;default:[].forEach.call(e.container.querySelectorAll(o),function(e){e[T]=e[T]||[],e[T].push(s)});break}}),[t,n]}}]),t}(d.default);k.DEFAULTS={matchers:[],matchVisual:!0};function A(e,t,n){return(t===void 0?`undefined`:r(t))===`object`?Object.keys(t).reduce(function(e,n){return A(e,n,t[n])},e):e.reduce(function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,o.default)({},b({},t,n),r.attributes))},new s.default)}function j(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t=`__ql-computed-style`;return e[t]||(e[t]=window.getComputedStyle(e))}function M(e,t){for(var n=``,r=e.ops.length-1;r>=0&&n.length-1}function P(e,t,n){return e.nodeType===e.TEXT_NODE?n.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(r,i){var a=P(i,t,n);return i.nodeType===e.ELEMENT_NODE&&(a=t.reduce(function(e,t){return t(i,e)},a),a=(i[T]||[]).reduce(function(e,t){return t(i,e)},a)),r.concat(a)},new s.default):new s.default}function F(e,t,n){return A(n,e,!0)}function I(e,t){var n=c.default.Attributor.Attribute.keys(e),r=c.default.Attributor.Class.keys(e),i=c.default.Attributor.Style.keys(e),a={};return n.concat(r).concat(i).forEach(function(t){var n=c.default.query(t,c.default.Scope.ATTRIBUTE);n!=null&&(a[n.attrName]=n.value(e),a[n.attrName])||(n=D[t],n!=null&&(n.attrName===t||n.keyName===t)&&(a[n.attrName]=n.value(e)||void 0),n=O[t],n!=null&&(n.attrName===t||n.keyName===t)&&(n=O[t],a[n.attrName]=n.value(e)||void 0))}),Object.keys(a).length>0&&(t=A(t,a)),t}function ee(e,t){var n=c.default.query(e);if(n==null)return t;if(n.prototype instanceof c.default.Embed){var r={},i=n.value(e);i!=null&&(r[n.blotName]=i,t=new s.default().insert(r,n.formats(e)))}else typeof n.formats==`function`&&(t=A(t,n.blotName,n.formats(e)));return t}function te(e,t){return M(t,` `)||t.insert(` `),t}function L(){return new s.default}function ne(e,t){var n=c.default.query(e);if(n==null||n.blotName!==`list-item`||!M(t,` `))return t;for(var r=-1,i=e.parentNode;!i.classList.contains(`ql-clipboard`);)(c.default.query(i)||{}).blotName===`list`&&(r+=1),i=i.parentNode;return r<=0?t:t.compose(new s.default().retain(t.length()-1).retain(1,{indent:r}))}function R(e,t){return M(t,` `)||(N(e)||t.length()>0&&e.nextSibling&&N(e.nextSibling))&&t.insert(` `),t}function re(e,t){if(N(e)&&e.nextElementSibling!=null&&!M(t,` `)){var n=e.offsetHeight+parseFloat(j(e).marginTop)+parseFloat(j(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+n*1.5&&t.insert(` `)}return t}function ie(e,t){var n={},r=e.style||{};return r.fontStyle&&j(e).fontStyle===`italic`&&(n.italic=!0),r.fontWeight&&(j(e).fontWeight.startsWith(`bold`)||parseInt(j(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=A(t,n)),parseFloat(r.textIndent||0)>0&&(t=new s.default().insert(` `).concat(t)),t}function z(e,t){var n=e.data;if(e.parentNode.tagName===`O:P`)return t.insert(n.trim());if(n.trim().length===0&&e.parentNode.classList.contains(`ql-clipboard`))return t;if(!j(e.parentNode).whiteSpace.startsWith(`pre`)){var r=function(e,t){return t=t.replace(/[^\u00a0]/g,``),t.length<1&&e?` `:t};n=n.replace(/\r\n/g,` `).replace(/\n/g,` `),n=n.replace(/\s\s+/g,r.bind(r,!0)),(e.previousSibling==null&&N(e.parentNode)||e.previousSibling!=null&&N(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(e.nextSibling==null&&N(e.parentNode)||e.nextSibling!=null&&N(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}t.default=k,t.matchAttributor=I,t.matchBlot=ee,t.matchNewline=R,t.matchSpacing=re,t.matchText=z}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;n `}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;nr.right&&(a=r.right-i.right,this.root.style.left=t+a+`px`),i.leftr.bottom){var o=i.bottom-i.top,s=e.bottom-e.top+o;this.root.style.top=n-s+`px`,this.root.classList.add(`ql-flip`)}return a}},{key:`show`,value:function(){this.root.classList.remove(`ql-editing`),this.root.classList.remove(`ql-hidden`)}}]),e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=function(){function e(e,t){for(var n=0;n`,``,``,``].join(``),t.default=v}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=F(n(29)),i=n(36),a=n(38),o=n(64),s=F(n(65)),c=F(n(66)),l=n(67),u=F(l),d=n(37),f=n(26),p=n(39),m=n(40),h=F(n(56)),g=F(n(68)),_=F(n(27)),v=F(n(69)),y=F(n(70)),b=F(n(71)),x=F(n(72)),S=F(n(73)),C=n(13),w=F(C),T=F(n(74)),E=F(n(75)),D=F(n(57)),O=F(n(41)),k=F(n(28)),A=F(n(59)),j=F(n(60)),M=F(n(61)),N=F(n(108)),P=F(n(62));function F(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":f.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":p.FontClass,"attributors/class/size":m.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":f.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":p.FontStyle,"attributors/style/size":m.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":o.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":f.ColorStyle,"formats/font":p.FontClass,"formats/size":m.SizeClass,"formats/blockquote":s.default,"formats/code-block":w.default,"formats/header":c.default,"formats/list":u.default,"formats/bold":h.default,"formats/code":C.Code,"formats/italic":g.default,"formats/link":_.default,"formats/script":v.default,"formats/strike":y.default,"formats/underline":b.default,"formats/image":x.default,"formats/video":S.default,"formats/list/item":l.ListItem,"modules/formula":T.default,"modules/syntax":E.default,"modules/toolbar":D.default,"themes/bubble":N.default,"themes/snow":P.default,"ui/icons":O.default,"ui/picker":k.default,"ui/icon-picker":j.default,"ui/color-picker":A.default,"ui/tooltip":M.default},!0),t.default=r.default}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.IndentClass=void 0;var r=function(){function e(e,t){for(var n=0;n0&&this.children.tail.format(e,t)}},{key:`formats`,value:function(){return l({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:`insertBefore`,value:function(e,n){if(e instanceof p)i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n);else{var r=n==null?this.length():n.offset(this),a=this.split(r);a.parent.insertBefore(e,a)}}},{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e);var n=this.next;n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute(`data-checked`)===this.domNode.getAttribute(`data-checked`)&&(n.moveChildren(this),n.remove())}},{key:`replace`,value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=a.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replace`,this).call(this,e)}}]),t}(s.default);m.blotName=`list`,m.scope=a.default.Scope.BLOCK_BLOT,m.tagName=[`OL`,`UL`],m.defaultChild=`list-item`,m.allowedChildren=[p],t.ListItem=p,t.default=m}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(56));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default);c.blotName=`italic`,c.tagName=[`EM`,`I`],t.default=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}],[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return typeof e==`string`&&n.setAttribute(`src`,this.sanitize(e)),n}},{key:`formats`,value:function(e){return d.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:`match`,value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:`sanitize`,value:function(e){return(0,o.sanitize)(e,[`http`,`https`,`data`])?e:`//:0`}},{key:`value`,value:function(e){return e.getAttribute(`src`)}}]),t}(a.default.Embed);f.blotName=`image`,f.tagName=`IMG`,t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}],[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return n.setAttribute(`frameborder`,`0`),n.setAttribute(`allowfullscreen`,!0),n.setAttribute(`src`,this.sanitize(e)),n}},{key:`formats`,value:function(e){return d.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:`sanitize`,value:function(e){return o.default.sanitize(e)}},{key:`value`,value:function(e){return e.getAttribute(`src`)}}]),t}(a.BlockEmbed);f.blotName=`video`,f.className=`ql-video`,f.tagName=`IFRAME`,t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(e,t){for(var n=0;n0||this.cachedText==null)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(c.default);p.className=`ql-syntax`;var m=new a.default.Attributor.Class(`token`,`hljs`,{scope:a.default.Scope.INLINE}),h=function(e){f(t,e),r(t,null,[{key:`register`,value:function(){o.default.register(m,!0),o.default.register(p,!0)}}]);function t(e,n){u(this,t);var r=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(typeof r.options.highlight!=`function`)throw Error(`Syntax module requires highlight.js. Please include the library on the page before Quill.`);var i=null;return r.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i),i=setTimeout(function(){r.highlight(),i=null},r.options.interval)}),r.highlight(),r}return r(t,[{key:`highlight`,value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(o.default.sources.SILENT),t!=null&&this.quill.setSelection(t,o.default.sources.SILENT)}}}]),t}(s.default);h.DEFAULTS={highlight:function(){return window.hljs==null?null:function(e){return window.hljs.highlightAuto(e).value}}(),interval:1e3},t.CodeBlock=p,t.CodeToken=m,t.default=h}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t){e.exports=` `}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},i=function(){function e(e,t){for(var n=0;n0&&i===o.default.sources.USER){r.show(),r.root.style.left=`0px`,r.root.style.width=``,r.root.style.width=r.root.offsetWidth+`px`;var a=r.quill.getLines(t.index,t.length);if(a.length===1)r.position(r.quill.getBounds(t));else{var s=a[a.length-1],c=r.quill.getIndex(s),u=Math.min(s.length()-1,t.index+t.length-c),d=r.quill.getBounds(new l.Range(c,u));r.position(d)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return i(t,[{key:`listen`,value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`listen`,this).call(this),this.root.querySelector(`.ql-close`).addEventListener(`click`,function(){e.root.classList.remove(`ql-editing`)}),this.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains(`ql-hidden`)){var t=e.quill.getSelection();t!=null&&e.position(e.quill.getBounds(t))}},1)})}},{key:`cancel`,value:function(){this.show()}},{key:`position`,value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`position`,this).call(this,e),i=this.root.querySelector(`.ql-tooltip-arrow`);if(i.style.marginLeft=``,n===0)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+`px`}}]),t}(s.BaseTooltip);_.TEMPLATE=[``,`
`,``,``,`
`].join(``),t.BubbleTooltip=_,t.default=g}),(function(e,t,n){e.exports=n(63)})]).default})})),T=e(((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r){if(e===t)return e?[[i,e]]:[];if(n!=null){var a=y(e,t,n);if(a)return a}var s=l(e,t),c=e.substring(0,s);e=e.substring(s),t=t.substring(s),s=u(e,t);var d=e.substring(e.length-s);e=e.substring(0,e.length-s),t=t.substring(0,t.length-s);var p=o(e,t);return c&&p.unshift([i,c]),d&&p.push([i,d]),f(p,r),p}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var f=d(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;fi)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2=e.length?[o,s,c,d,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,d,f,p;e.length>t.length?(c=s[0],d=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],d=s[3]);var m=s[4];return[c,d,f,p,m]}function f(e,t){e.push([i,``]);for(var a=0,o=0,s=0,c=``,d=``,p;a=0&&g(e[m][1])){var _=e[m][1].slice(-1);if(e[m][1]=e[m][1].slice(0,-1),c=_+c,d=_+d,!e[m][1]){e.splice(m,1),a--;var v=m-1;e[v]&&e[v][0]===r&&(s++,d=e[v][1]+d,v--),e[v]&&e[v][0]===n&&(o++,c=e[v][1]+c,v--),m=v}}if(h(e[a][1])){var _=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=_,d+=_}}if(a0||d.length>0){c.length>0&&d.length>0&&(p=l(d,c),p!==0&&(m>=0?e[m][1]+=d.substring(0,p):(e.splice(0,0,[i,d.substring(0,p)]),a++),d=d.substring(p),c=c.substring(p)),p=u(d,c),p!==0&&(e[a][1]=d.substring(d.length-p)+e[a][1],d=d.substring(0,d.length-p),c=c.substring(0,c.length-p)));var y=s+o;c.length===0&&d.length===0?(e.splice(a-y,y),a-=y):c.length===0?(e.splice(a-y,y,[r,d]),a=a-y+1):d.length===0?(e.splice(a-y,y,[n,c]),a=a-y+1):(e.splice(a-y,y,[n,c],[r,d]),a=a-y+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c=``,d=``;break}}e[e.length-1][1]===``&&e.pop();var b=!1;for(a=1;a=55296&&e<=56319}function m(e){return e>=56320&&e<=57343}function h(e){return m(e.charCodeAt(0))}function g(e){return p(e.charCodeAt(e.length-1))}function _(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}function v(e,t,a,o){return g(e)||h(o)?null:_([[i,e],[n,t],[r,a],[i,o]])}function y(e,t,n){var r=typeof n==`number`?{index:n,length:0}:n.oldRange,i=typeof n==`number`?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),y=f.slice(m);return v(h,_,y,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var b=s,f=t.slice(0,b),p=t.slice(b);if(f!==c)break editAfter;var x=Math.min(a-b,o-b),S=l.slice(l.length-x),C=p.slice(p.length-x);if(S!==C)break editAfter;var _=l.slice(0,l.length-x),y=p.slice(0,p.length-x);return v(c,_,y,S)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),S=e.slice(r.index+r.length),m=h.length,x=S.length;if(o{var n=200,r=`__lodash_hash_undefined__`,i=9007199254740991,a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object GeneratorFunction]`,f=`[object Map]`,p=`[object Number]`,m=`[object Object]`,h=`[object Promise]`,g=`[object RegExp]`,_=`[object Set]`,v=`[object String]`,y=`[object Symbol]`,b=`[object WeakMap]`,x=`[object ArrayBuffer]`,S=`[object DataView]`,C=`[object Float32Array]`,w=`[object Float64Array]`,T=`[object Int8Array]`,E=`[object Int16Array]`,D=`[object Int32Array]`,O=`[object Uint8Array]`,k=`[object Uint8ClampedArray]`,A=`[object Uint16Array]`,j=`[object Uint32Array]`,M=/[\\^$.*+?()[\]{}|]/g,N=/\w*$/,P=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,I={};I[a]=I[o]=I[x]=I[S]=I[s]=I[c]=I[C]=I[w]=I[T]=I[E]=I[D]=I[f]=I[p]=I[m]=I[g]=I[_]=I[v]=I[y]=I[O]=I[k]=I[A]=I[j]=!0,I[l]=I[u]=I[b]=!1;var ee=typeof global==`object`&&global&&global.Object===Object&&global,te=typeof self==`object`&&self&&self.Object===Object&&self,L=ee||te||Function(`return this`)(),ne=typeof e==`object`&&e&&!e.nodeType&&e,R=ne&&typeof t==`object`&&t&&!t.nodeType&&t,re=R&&R.exports===ne;function ie(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function ae(e,t){for(var n=-1,r=e?e.length:0;++n-1}function Qe(e,t){var n=this.__data__,r=dt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}W.prototype.clear=Je,W.prototype.delete=Ye,W.prototype.get=Xe,W.prototype.has=Ze,W.prototype.set=Qe;function G(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=i}function $(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function Kt(e){return!!e&&typeof e==`object`}function qt(e){return Vt(e)?lt(e):_t(e)}function Jt(){return[]}function Yt(){return!1}t.exports=Lt})),D=e(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=1,a=2,o=9007199254740991,s=`[object Arguments]`,c=`[object Array]`,l=`[object AsyncFunction]`,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Function]`,m=`[object GeneratorFunction]`,h=`[object Map]`,g=`[object Number]`,_=`[object Null]`,v=`[object Object]`,y=`[object Promise]`,b=`[object Proxy]`,x=`[object RegExp]`,S=`[object Set]`,C=`[object String]`,w=`[object Symbol]`,T=`[object Undefined]`,E=`[object WeakMap]`,D=`[object ArrayBuffer]`,O=`[object DataView]`,k=`[object Float32Array]`,A=`[object Float64Array]`,j=`[object Int8Array]`,M=`[object Int16Array]`,N=`[object Int32Array]`,P=`[object Uint8Array]`,F=`[object Uint8ClampedArray]`,I=`[object Uint16Array]`,ee=`[object Uint32Array]`,te=/[\\^$.*+?()[\]{}|]/g,L=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,R={};R[k]=R[A]=R[j]=R[M]=R[N]=R[P]=R[F]=R[I]=R[ee]=!0,R[s]=R[c]=R[D]=R[u]=R[O]=R[d]=R[f]=R[p]=R[h]=R[g]=R[v]=R[x]=R[S]=R[C]=R[E]=!1;var re=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,z=re||ie||Function(`return this`)(),ae=typeof e==`object`&&e&&!e.nodeType&&e,oe=ae&&typeof t==`object`&&t&&!t.nodeType&&t,se=oe&&oe.exports===ae,ce=se&&re.process,le=function(){try{return ce&&ce.binding&&ce.binding(`util`)}catch{}}(),ue=le&&le.isTypedArray;function de(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n-1}function rt(e,t){var n=this.__data__,r=vt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}G.prototype.clear=$e,G.prototype.delete=et,G.prototype.get=tt,G.prototype.has=nt,G.prototype.set=rt;function K(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=n&a?new lt:void 0;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Gt(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function $(e){return typeof e==`object`&&!!e}var Kt=ue?he(ue):Tt;function qt(e){return Bt(e)?_t(e):Et(e)}function Jt(){return[]}function Yt(){return!1}t.exports=Ht})),O=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});var n=t(E()),r=t(D()),i;(function(e){function t(e,t,r){e===void 0&&(e={}),t===void 0&&(t={}),typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var i=n.default(t);for(var a in r||(i=Object.keys(i).reduce(function(e,t){return i[t]!=null&&(e[t]=i[t]),e},{})),e)e[a]!==void 0&&t[a]===void 0&&(i[a]=e[a]);return Object.keys(i).length>0?i:void 0}e.compose=t;function i(e,t){e===void 0&&(e={}),t===void 0&&(t={}),typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r.default(e[i],t[i])||(n[i]=t[i]===void 0?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0}e.diff=i;function a(e,t){e===void 0&&(e={}),t===void 0&&(t={}),e||={};var n=Object.keys(t).reduce(function(n,r){return t[r]!==e[r]&&e[r]!==void 0&&(n[r]=t[r]),n},{});return Object.keys(e).reduce(function(n,r){return e[r]!==t[r]&&t[r]===void 0&&(n[r]=null),n},n)}e.invert=a;function o(e,t,n){if(n===void 0&&(n=!1),typeof e!=`object`)return t;if(typeof t==`object`){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return e[r]===void 0&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}e.transform=o})(i||={}),e.default=i})),k=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});var n=t(A());e.default=function(){function e(e){this.ops=e,this.index=0,this.offset=0}return e.prototype.hasNext=function(){return this.peekLength()<1/0},e.prototype.next=function(e){e||=1/0;var t=this.ops[this.index];if(t){var r=this.offset,i=n.default.length(t);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete==`number`)return{delete:e};var a={};return t.attributes&&(a.attributes=t.attributes),typeof t.retain==`number`?a.retain=e:typeof t.insert==`string`?a.insert=t.insert.substr(r,e):a.insert=t.insert,a}else return{retain:1/0}},e.prototype.peek=function(){return this.ops[this.index]},e.prototype.peekLength=function(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0},e.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete==`number`?`delete`:typeof this.ops[this.index].retain==`number`?`retain`:`insert`:`retain`},e.prototype.rest=function(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)},e}()})),A=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});var n=t(k()),r;(function(e){function t(e){return new n.default(e)}e.iterator=t;function r(e){return typeof e.delete==`number`?e.delete:typeof e.retain==`number`?e.retain:typeof e.insert==`string`?e.insert.length:1}e.length=r})(r||={}),e.default=r})),j=e(((e,t)=>{var n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r=n(T()),i=n(E()),a=n(D()),o=n(O()),s=n(A()),c=`\0`;t.exports=function(){function e(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}return e.prototype.insert=function(e,t){var n={};return typeof e==`string`&&e.length===0?this:(n.insert=e,typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},e.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},e.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},e.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=i.default(e),typeof n==`object`){if(typeof e.delete==`number`&&typeof n.delete==`number`)return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete==`number`&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!=`object`))return this.ops.unshift(e),this;if(a.default(e.attributes,n.attributes)){if(typeof e.insert==`string`&&typeof n.insert==`string`)return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain==`number`&&typeof n.retain==`number`)return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},e.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},e.prototype.filter=function(e){return this.ops.filter(e)},e.prototype.forEach=function(e){this.ops.forEach(e)},e.prototype.map=function(e){return this.ops.map(e)},e.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},e.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},e.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+s.default.length(t):t.delete?e-t.delete:e},0)},e.prototype.length=function(){return this.reduce(function(e,t){return e+s.default.length(t)},0)},e.prototype.slice=function(t,n){t===void 0&&(t=0),n===void 0&&(n=1/0);for(var r=[],i=s.default.iterator(this.ops),a=0;a0&&r.next(c.retain-l)}for(var u=new e(i);n.hasNext()||r.hasNext();)if(r.peekType()===`insert`)u.push(r.next());else if(n.peekType()===`delete`)u.push(n.next());else{var d=Math.min(n.peekLength(),r.peekLength()),f=n.next(d),p=r.next(d);if(typeof p.retain==`number`){var m={};typeof f.retain==`number`?m.retain=d:m.insert=f.insert;var h=o.default.compose(f.attributes,p.attributes,typeof f.retain==`number`);if(h&&(m.attributes=h),u.push(m),!r.hasNext()&&a.default(u.ops[u.ops.length-1],m)){var g=new e(n.rest());return u.concat(g).chop()}}else typeof p.delete==`number`&&typeof f.retain==`number`&&u.push(p)}return u.chop()},e.prototype.concat=function(t){var n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n},e.prototype.diff=function(t,n){if(this.ops===t.ops)return new e;var i=[this,t].map(function(e){return e.map(function(n){if(n.insert!=null)return typeof n.insert==`string`?n.insert:c;throw Error(`diff() called `+(e===t?`on`:`with`)+` non-document`)}).join(``)}),l=new e,u=r.default(i[0],i[1],n),d=s.default.iterator(this.ops),f=s.default.iterator(t.ops);return u.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.default.INSERT:n=Math.min(f.peekLength(),t),l.push(f.next(n));break;case r.default.DELETE:n=Math.min(t,d.peekLength()),d.next(n),l.delete(n);break;case r.default.EQUAL:n=Math.min(d.peekLength(),f.peekLength(),t);var i=d.next(n),s=f.next(n);a.default(i.insert,s.insert)?l.retain(n,o.default.diff(i.attributes,s.attributes)):l.push(s).delete(n);break}t-=n}}),l.chop()},e.prototype.eachLine=function(t,n){n===void 0&&(n=` `);for(var r=s.default.iterator(this.ops),i=new e,a=0;r.hasNext();){if(r.peekType()!==`insert`)return;var o=r.peek(),c=s.default.length(o)-r.peekLength(),l=typeof o.insert==`string`?o.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)},e.prototype.invert=function(t){var n=new e;return this.reduce(function(e,r){if(r.insert)n.delete(s.default.length(r));else if(r.retain&&r.attributes==null)return n.retain(r.retain),e+r.retain;else if(r.delete||r.retain&&r.attributes){var i=r.delete||r.retain;return t.slice(e,e+i).forEach(function(e){r.delete?n.push(e):r.retain&&r.attributes&&n.retain(s.default.length(e),o.default.invert(r.attributes,e.attributes))}),e+i}return e},0),n.chop()},e.prototype.transform=function(t,n){if(n===void 0&&(n=!1),n=!!n,typeof t==`number`)return this.transformPosition(t,n);for(var r=t,i=s.default.iterator(this.ops),a=s.default.iterator(r.ops),c=new e;i.hasNext()||a.hasNext();)if(i.peekType()===`insert`&&(n||a.peekType()!==`insert`))c.retain(s.default.length(i.next()));else if(a.peekType()===`insert`)c.push(a.next());else{var l=Math.min(i.peekLength(),a.peekLength()),u=i.next(l),d=a.next(l);if(u.delete)continue;d.delete?c.push(d):c.retain(l,o.default.transform(u.attributes,d.attributes,n))}return c.chop()},e.prototype.transformPosition=function(e,t){t===void 0&&(t=!1),t=!!t;for(var n=s.default.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}else a===`insert`&&(r[`delta`,`html`,`text`].includes(e)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:`snow`,validator:e=>[`snow`,`bubble`,``].includes(e)},toolbar:{type:[String,Array,Object],required:!1,validator:e=>typeof e==`string`&&e!==``?e.charAt(0)===`#`?!0:Object.keys(P).indexOf(e)!==-1:!0},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:[`textChange`,`selectionChange`,`editorChange`,`update:content`,`focus`,`blur`,`ready`],setup:(e,t)=>{l(()=>{o()}),i(()=>{n=null});let n,r,a=h(),o=()=>{var i;if(a.value){if(r=s(),e.modules)if(Array.isArray(e.modules))for(let t of e.modules)M.default.register(`modules/${t.name}`,t.module);else M.default.register(`modules/${e.modules.name}`,e.modules.module);n=new M.default(a.value,r),w(e.content),n.on(`text-change`,m),n.on(`selection-change`,_),n.on(`editor-change`,v),e.theme!==`bubble`&&a.value.classList.remove(`ql-bubble`),e.theme!==`snow`&&a.value.classList.remove(`ql-snow`),(i=n.getModule(`toolbar`))==null||i.container.addEventListener(`mousedown`,e=>{e.preventDefault()}),t.emit(`ready`,n)}},s=()=>{let t={};if(e.theme!==``&&(t.theme=e.theme),e.readOnly&&(t.readOnly=e.readOnly),e.placeholder&&(t.placeholder=e.placeholder),e.toolbar&&e.toolbar!==``&&(t.modules={toolbar:(()=>{if(typeof e.toolbar==`object`)return e.toolbar;if(typeof e.toolbar==`string`)return e.toolbar.charAt(0)===`#`?e.toolbar:P[e.toolbar]})()}),e.modules){let n=(()=>{let t={};if(Array.isArray(e.modules))for(let n of e.modules)t[n.name]=n.options??{};else t[e.modules.name]=e.modules.options??{};return t})();t.modules=Object.assign({},t.modules,n)}return Object.assign({},e.globalOptions,e.options,t)},c=e=>typeof e==`object`&&e?e.slice():e,d=e=>Object.values(e.ops).some(e=>!e.retain||Object.keys(e).length!==1),f,p=e=>{if(typeof f==typeof e){if(e===f)return!0;if(typeof e==`object`&&e&&typeof f==`object`&&f)return!d(f.diff(e))}return!1},m=(n,r,i)=>{f=c(C()),p(e.content)||t.emit(`update:content`,f),t.emit(`textChange`,{delta:n,oldContents:r,source:i})},g=h(),_=(e,r,i)=>{g.value=!!n?.hasFocus(),t.emit(`selectionChange`,{range:e,oldRange:r,source:i})};y(g,e=>{e?t.emit(`focus`,a):t.emit(`blur`,a)});let v=(...e)=>{e[0]===`text-change`&&t.emit(`editorChange`,{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),e[0]===`selection-change`&&t.emit(`editorChange`,{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},b=()=>a.value,x=()=>n?.getModule(`toolbar`)?.container,S=()=>{if(n)return n;throw`The quill editor hasn't been instantiated yet, make sure to call this method when the editor ready or use v-on:ready="onReady(quill)" event instead.`},C=(t,r)=>e.contentType===`html`?D():e.contentType===`text`?T(t,r):n?.getContents(t,r),w=(t,r=`api`)=>{let i=t||(e.contentType===`delta`?new N.default:``);e.contentType===`html`?O(i):e.contentType===`text`?E(i,r):n?.setContents(i,r),f=c(i)},T=(e,t)=>n?.getText(e,t)??``,E=(e,t=`api`)=>{n?.setText(e,t)},D=()=>n?.root.innerHTML??``,O=e=>{n&&(n.root.innerHTML=e)};return y(()=>e.content,e=>{if(!n||!e||p(e))return;let t=n.getSelection();t&&u(()=>n?.setSelection(t)),w(e)},{deep:!0}),y(()=>e.enable,e=>{n&&n.enable(e)}),{editor:a,getEditor:b,getToolbar:x,getQuill:S,getContents:C,setContents:w,getHTML:D,setHTML:O,pasteHTML:(e,t=`api`)=>{let r=n?.clipboard.convert(e);r&&n?.setContents(r,t)},focus:()=>{n?.focus()},getText:T,setText:E,reinit:()=>{u(()=>{var e;!t.slots.toolbar&&n&&((e=n.getModule(`toolbar`))==null||e.container.remove()),o()})}}},render(){var e;return[(e=this.$slots).toolbar?.call(e),a(`div`,{ref:`editor`,...this.$attrs})]}});function I(e){let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function ee(e){if(!e?.trim())return``;if(typeof document>`u`)return e;let t=document.createElement(`div`);t.innerHTML=e,t.querySelectorAll(`*`).forEach(e=>{e.removeAttribute(`style`),e.removeAttribute(`class`)}),t.querySelectorAll(`font`).forEach(e=>I(e));let n=0;for(;n<5;){let e=t.querySelectorAll(`span`),r=!1;if(e.forEach(e=>{e.attributes.length===0&&(I(e),r=!0)}),!r)break;n++}return t.innerHTML}var te={class:`rich-editor-field`},L=C(S({__name:`RichEditorField`,props:o({editorOptions:{},fieldKey:{},minHeight:{default:180}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){t(e=>({v100fcf4a:a.value}));let r=s(e,`modelValue`),i=e,a=_(()=>`${i.minHeight}px`),o=h(!1),l=h(0),u=h(``);function S(){o.value?(r.value=u.value,l.value+=1,o.value=!1):(u.value=r.value||``,o.value=!0)}function C(){let e=ee(r.value||``);r.value=e,u.value=e,l.value+=1,n.success(`已清除样式`)}return y(()=>i.fieldKey,(e,t)=>{t!==void 0&&(o.value=!1,u.value=``,l.value+=1)}),(t,n)=>{let i=d(`a-button`),a=d(`a-space`),s=d(`a-textarea`);return c(),v(`div`,te,[x(a,{style:{"margin-bottom":`8px`,"flex-wrap":`wrap`}},{default:f(()=>[x(i,{size:`small`,onClick:S},{default:f(()=>[p(g(o.value?`返回可视化`:`查看源代码`),1)]),_:1}),x(i,{size:`small`,onClick:C},{default:f(()=>[...n[2]||=[p(`一键清除样式`,-1)]]),_:1})]),_:1}),o.value?(c(),m(s,{key:0,modelValue:u.value,"onUpdate:modelValue":n[0]||=e=>u.value=e,"auto-size":{minRows:14,maxRows:32},placeholder:`HTML 源代码`,style:{"font-family":`ui-monospace, monospace`,"font-size":`12px`}},null,8,[`modelValue`])):(c(),m(b(F),{key:`${e.fieldKey}-${l.value}`,content:r.value,"onUpdate:content":n[1]||=e=>r.value=e,"content-type":`html`,theme:`snow`,options:e.editorOptions},null,8,[`content`,`options`]))])}}}),[[`__scopeId`,`data-v-881023d4`]]);export{L as t};