You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
249 KiB

3 weeks ago
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.
4 weeks ago
`;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`&&(r<e||!t)&&(e+=i);r+=i}return e},e.exports=c}),(function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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=d(n(3)),o=d(n(2)),s=d(n(0)),c=d(n(16)),l=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(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 m(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 h=1,g=function(e){m(t,e);function t(){return f(this,t),p(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`attach`,value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`attach`,this).call(this),this.attributes=new s.default.Attributor.Store(this.domNode)}},{key:`delta`,value:function(){return new o.default().insert(this.value(),(0,a.default)(this.formats(),this.attributes.values()))}},{key:`format`,value:function(e,t){var n=s.default.query(e,s.default.Scope.BLOCK_ATTRI
`)){var a=s.default.create(_.blotName);this.parent.insertBefore(a,e===0?this:this.next),a.insertAt(0,n.slice(0,-1))}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r)}}]),t}(s.default.Embed);g.scope=s.default.Scope.BLOCK_BLOT;var _=function(e){m(t,e);function t(e){f(this,t);var n=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return r(t,[{key:`delta`,value:function(){return this.cache.delta??(this.cache.delta=this.descendants(s.default.Leaf).reduce(function(e,t){return t.length()===0?e:e.insert(t.value(),v(t))},new o.default).insert(`
`,v(this))),this.cache.delta}},{key:`deleteAt`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`deleteAt`,this).call(this,e,n),this.cache={}}},{key:`formatAt`,value:function(e,n,r,a){n<=0||(s.default.query(r,s.default.Scope.BLOCK)?e+n===this.length()&&this.format(r,a):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`formatAt`,this).call(this,e,Math.min(n,this.length()-e-1),r,a),this.cache={})}},{key:`insertAt`,value:function(e,n,r){if(r!=null)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r);if(n.length!==0){var a=n.split(`
`),o=a.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});var s=this;a.reduce(function(e,t){return s=s.split(e,!0),s.insertAt(0,t),t.length},e+o.length)}}},{key:`insertBefore`,value:function(e,n){var r=this.children.head;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n),r instanceof c.default&&r.remove(),this.cache={}}},{key:`length`,value:function(){return this.cache.length??(this.cache.length=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`length`,this).call(this)+h),this.cache.length}},{key:`moveChildren`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`moveChildren`,this).call(this,e,n),this.cache={}}},{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e),this.cache={}}},{key:`path`,value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`path`,this).call(this,e,!0)}},{key:`removeChild`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`removeChild`,this).call(this,e),this.cache={}}},{key:`split`,value:function(e){var n=arguments.length>1&&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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n(50);var o=g(n(2)),s=g(n(14)),c=g(n(8)),l=g(n(9)),u=g(n(0)),d=n(15),f=g(d),p=g(n(3)),m=g(n(10)),h=g(n(34));function g(e){return e&&e.__esModule?e:{default:e}}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var y=(0,m.default)(`quill`),b=function(){a(e,null,[{key:`debug`,value:function(e){e===!0&&(e=`log`),m.default.level(e)}},{key:`find`,value:function(e){return e.__quill||u.default.find(e)}},{key:`import`,value:function(e){return this.imports[e]??y.error(`Cannot import `+e+`. Are you sure it was registered?`),this.imports[e]}},{key:`register`,value:function(e,t){var n=this,r=arguments.length>2&&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.i
`&&(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<t||e===t&&r===c.default.sources.USER?e:n>=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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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(`valu
`)&&(t=t.slice(0,-1)),t.split(`
`).reduce(function(t,n){return t.insert(n).insert(`
`,e.formats())},new o.default)}},{key:`format`,value:function(e,n){if(!(e===this.statics.blotName&&n)){var i=r(this.descendant(u.default,this.length()-1),1)[0];i?.deleteAt(i.length()-1,1),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}},{key:`formatAt`,value:function(e,n,r,i){if(n!==0&&!(s.default.query(r,s.default.Scope.BLOCK)==null||r===this.statics.blotName&&i===this.statics.formats(this.domNode))){var a=this.newlineIndex(e);if(!(a<0||a>=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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=_(n(2)),s=_(n(20)),c=_(n(0)),l=_(n(13)),u=_(n(24)),d=n(4),f=_(d),p=_(n(16)),m=_(n(21)),h=_(n(11)),g=_(n(3));function _(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var b=/^[ -~]*$/,x=function(){function e(t){y(this,e),this.scroll=t,this.delta=this.getDelta()}return a(e,[{key:`applyDelta`,value:function(e){var t=this,n=!1;this.scroll.update();var a=this.scroll.length();return this.scroll.batchStart(),e=C(e),e.reduce(function(e,o){var l=o.retain||o.delete||o.insert.length||1,u=o.attributes||{};if(o.insert!=null){if(typeof o.insert==`string`){var p=o.insert;p.endsWith(`
`)&&n&&(n=!1,p=p.slice(0,-1)),e>=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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=u(n(0)),o=u(n(21)),s=u(n(11)),c=u(n(8)),l=u(n(10));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var p=(0,l.default)(`quill:selection`),m=function e(t){var n=arguments.length>1&&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)r
`)&&(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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=h(n(21)),s=h(n(11)),c=h(n(3)),l=h(n(2)),u=h(n(20)),d=h(n(0)),f=h(n(5)),p=h(n(10)),m=h(n(9));function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function v(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 y(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 b=(0,p.default)(`quill:keyboard`),x=/Mac/i.test(navigator.platform)?`metaKey`:`ctrlKey`,S=function(e){y(t,e),a(t,null,[{key:`match`,value:function(e,t){return t=A(t),[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`].some(function(n){return!!t[n]!==e[n]&&t[n]!==null})?!1:t.key===(e.w
`,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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(0)),s=c(n(7));function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function u(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 d(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 f=function(e){d(t,e),a(t,null,[{key:`value`,value:function(){}}]);function t(e,n){l(this,t);var r=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.selection=n,r.textNode=document.createTextNode(t.CONTENTS),r.domNode.appendChild(r.textNode),r._length=0,r}return a(t,[{key:`detach`,value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:`format`,value:function(e,n){if(this._length!==0)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n);for(var r=this,a=0;r!=null&&r.statics.scope!==o.default.Scope.BLOCK_BLOT;)a+=r.offset(r.parent),r=r.parent;r!=null&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(a,t.CONTENTS.length,e,n),this._length=0)}},{key:`index`,value:function(e,n){return e===this.textNode?0:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`index`,this).call(this,e,n)}},{key:`length`,value:function(){return this._length}},{key:`position`,value:function(){return[this.textNode,this.textNode.data.length]}},{key:`remove`,value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`remove`,this).call(this),this.parent=null}},{key:`restore`,value:function(){if(!(this.selection.composing||this.parent==null)){var e=this.textNode,n=this.selection.getNativeRange(),i=void 0,a=void 0,c=void 0;if(n!=null&&n.start.node===e&&n.end.node===e){var l=[e,n.start.offset,n.end.offset];i=l[0],a=l[1],c=l[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.text
3 weeks ago
`)}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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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=m(n(3)),o=m(n(2)),s=m(n(8)),c=m(n(23)),l=m(n(34)),u=m(n(59)),d=m(n(60)),f=m(n(28)),p=m(n(61));function m(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function g(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 _(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 v=[!1,`center`,`right`,`justify`],y=`#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466`.split(`.`),b=[!1,`serif`,`monospace`],x=[`1`,`2`,`3`,!1],S=[`small`,!1,`large`,`huge`],C=function(e){_(t,e);function t(e,n){h(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM(`click`,document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener(`click`,t);r.tooltip!=null&&!r.tooltip.root.contains(n.target)&&document.activeElement!==r.tooltip.textbox&&!r.quill.hasFocus()&&r.tooltip.hide(),r.pickers!=null&&r.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),r}return r(t,[{key:`addModule`,value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`addModule`,this).call(this,e);return e===`toolbar`&&this.extendToolbar(n),n}},{key:`buildButtons`,value:function(e,t){e.forEach(function(e){(e.getAttribute(`class`)||``).split(/\s+/).forEach(function(n){if(n.startsWith(`ql-`)&&(n=n.slice(3),t[n]!=null))if(n===`direction`)e.innerHTML=t[n][``]+t[n].rtl;else if(typeof t[n]==`string`)e.innerHTML=t[n];else{var r=e.value||``;r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}})})}},{key:`buildPickers`,value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains(`ql-align`))return e.querySelector(`option`)??E(e,v),new d.default(e,t.align);if(e.classList.contains(`ql-background`)||e.classList.contains(`ql-color`)){var n=e.classList.contains(`ql-background`)?`background`:`color`;return e.querySelector(`option`)??E(e,y,n===`background`?`#ffffff`:`#000000`),new u.default(e,t[n])}else return e.querySelector(`option`)??(e.classList.contains(`ql-font`)?E(e,b):e.classList.contains(`ql-header`)?E(e,x):e.classList.contains(`ql-size`)&&E(e,S)),new f.default(e)}),this.quill.on(s.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(l.default);C.DEFAULTS=(0,a.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit(`formula`)},image:function(){var e=this,t=this.container.querySelector(`input.ql-image[type=file]`);t??(t=document.createElement(`input`),t.setAttribute(`type`,`file`),t.setAttribute(`accept`,`image/png, image/gif, image/jpeg, image/bmp, image/x-icon`),t.classList.add(`ql-image`),t.addEventListener(`change`,function(){if(t.files!=null&&t.fi
`)&&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<t.length;--r){var i=e.ops[r];if(typeof i.insert!=`string`)break;n=i.insert+n}return n.slice(-1*t.length)===t}function N(e){if(e.childNodes.length===0)return!1;var t=j(e);return[`block`,`list-item`].indexOf(t.display)>-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,`
4 weeks ago
`)||t.insert(`
3 weeks ago
`),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,`
4 weeks ago
`)||(N(e)||t.length()>0&&e.nextSibling&&N(e.nextSibling))&&t.insert(`
3 weeks ago
`),t}function re(e,t){if(N(e)&&e.nextElementSibling!=null&&!M(t,`
4 weeks ago
`)){var n=e.offsetHeight+parseFloat(j(e).marginTop)+parseFloat(j(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+n*1.5&&t.insert(`
3 weeks ago
`)}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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(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 l(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 u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:`create`,value:function(){return i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this)}},{key:`formats`,value:function(){return!0}}]),t}(a.default);u.blotName=`bold`,u.tagName=[`STRONG`,`B`],t.default=u}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.addControls=t.default=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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=u(n(2)),o=u(n(0)),s=u(n(5)),c=u(n(10)),l=u(n(9));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(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 m(e,t){if(typeof t!=
`);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<e||!t)&&(e+=i);r+=i}return e},e.Op=s.default,e.AttributeMap=o.default,e}()})),M=r(w()),N=r(j()),P={essential:[[{header:[1,2,3,4,5,6,!1]}],[`bold`,`italic`,`underline`],[{list:`ordered`},{list:`bullet`},{align:[]}],[`blockquote`,`code-block`,`link`],[{color:[]},`clean`]],minimal:[[{header:1},{header:2}],[`bold`,`italic`,`underline`],[{list:`ordered`},{list:`bullet`},{align:[]}]],full:[[`bold`,`italic`,`underline`,`strike`],[`blockquote`,`code-block`],[{header:1},{header:2}],[{list:`ordered`},{list:`bullet`}],[{script:`sub`},{script:`super`}],[{indent:`-1`},{indent:`+1`}],[{direction:`rtl`}],[{size:[`small`,!1,`large`,`huge`]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],[`link`,`video`,`image`],[`clean`]]},F=S({name:`QuillEditor`,inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:`delta`,validator:e=>[`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.
4 weeks ago
make sure to call this method when the editor ready
3 weeks ago
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};