Files
chuanggao-website/client/dist/assets/RichEditor-DD1hYfzj.js

55 lines
251 KiB
JavaScript
Raw Normal View History

2026-05-12 16:53:18 +08:00
import{$ as Gn,a0 as Tt,d as Vn,a1 as ir,o as or,a2 as ar,w as Ln,r as Fn,a3 as Un,g as lr,b as ur,m as sr,p as fr,n as cr,q as hr,_ as dr}from"./index-eVF4AHSu.js";var Zn={exports:{}};/*!
* Quill Editor v1.3.7
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/(function(R,U){(function(p,c){R.exports=c()})(typeof self<"u"?self:Tt,function(){return function(m){var p={};function c(E){if(p[E])return p[E].exports;var b=p[E]={i:E,l:!1,exports:{}};return m[E].call(b.exports,b,b.exports,c),b.l=!0,b.exports}return c.m=m,c.c=p,c.d=function(E,b,_){c.o(E,b)||Object.defineProperty(E,b,{configurable:!1,enumerable:!0,get:_})},c.n=function(E){var b=E&&E.__esModule?function(){return E.default}:function(){return E};return c.d(b,"a",b),b},c.o=function(E,b){return Object.prototype.hasOwnProperty.call(E,b)},c.p="",c(c.s=109)}([function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0});var E=c(17),b=c(18),_=c(19),y=c(45),g=c(46),h=c(47),o=c(48),t=c(49),e=c(12),s=c(32),l=c(33),u=c(31),r=c(1),i={Scope:r.Scope,create:r.create,find:r.find,query:r.query,register:r.register,Container:E.default,Format:b.default,Leaf:_.default,Embed:o.default,Scroll:y.default,Block:h.default,Inline:g.default,Text:t.default,Attributor:{Attribute:e.default,Class:s.default,Style:l.default,Store:u.default}};p.default=i},function(m,p,c){var E=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var f in i)i.hasOwnProperty(f)&&(r[f]=i[f])};return function(r,i){u(r,i);function f(){this.constructor=r}r.prototype=i===null?Object.create(i):(f.prototype=i.prototype,new f)}}();Object.defineProperty(p,"__esModule",{value:!0});var b=function(u){E(r,u);function r(i){var f=this;return i="[Parchment] "+i,f=u.call(this,i)||this,f.message=i,f.name=f.constructor.name,f}return r}(Error);p.ParchmentError=b;var _={},y={},g={},h={};p.DATA_KEY="__blot";var o;(function(u){u[u.TYPE=3]="TYPE",u[u.LEVEL=12]="LEVEL",u[u.ATTRIBUTE=13]="ATTRIBUTE",u[u.BLOT=14]="BLOT",u[u.INLINE=7]="INLINE",u[u.BLOCK=11]="BLOCK",u[u.BLOCK_BLOT=10]="BLOCK_BLOT",u[u.INLINE_BLOT=6]="INLINE_BLOT",u[u.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",u[u.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",u[u.ANY=15]="ANY"})(o=p.Scope||(p.Scope={}));function t(u,r){var i=s(u);if(i==null)throw new b("Unable to create "+u+" blot");var f=i,n=u instanceof Node||u.nodeType===Node.TEXT_NODE?u:f.create(r);return new f(n,r)}p.create=t;function e(u,r){return r===void 0&&(r=!1),u==null?null:u[p.DATA_KEY]!=null?u[p.DATA_KEY].blot:r?e(u.parentNode,r):null}p.find=e;function s(u,r){r===void 0&&(r=o.ANY);var i;if(typeof u=="string")i=h[u]||_[u];else if(u instanceof Text||u.nodeType===Node.TEXT_NODE)i=h.text;else if(typeof u=="number")u&o.LEVEL&o.BLOCK?i=h.block:u&o.LEVEL&o.INLINE&&(i=h.inline);else if(u instanceof HTMLElement){var f=(u.getAttribute("class")||"").split(/\s+/);for(var n in f)if(i=y[f[n]],i)break;i=i||g[u.tagName]}return i==null?null:r&o.LEVEL&i.scope&&r&o.TYPE&i.scope?i:null}p.query=s;function l(){for(var u=[],r=0;r<arguments.length;r++)u[r]=arguments[r];if(u.length>1)return u.map(function(n){return l(n)});var i=u[0];if(typeof i.blotName!="string"&&typeof i.attrName!="string")throw new b("Invalid definition");if(i.blotName==="abstract")throw new b("Cannot register abstract class");if(h[i.blotName||i.attrName]=i,typeof i.keyName=="string")_[i.keyName]=i;else if(i.className!=null&&(y[i.className]=i),i.tagName!=null){Array.isArray(i.tagName)?i.tagName=i.tagName.map(function(n){return n.toUpperCase()}):i.tagName=i.tagName.toUpperCase();var f=Array.isArray(i.tagName)?i.tagName:[i.tagName];f.forEach(function(n){(g[n]==null||i.className==null)&&(g[n]=i)})}return i}p.register=l},function(m,p,c){var E=c(51),b=c(11),_=c(3),y=c(20),g="\0",h=function(o){Array.isArray(o)?this.ops=o:o!=null&&Array.isArray(o.ops)?this.ops=o.ops:this.ops=[]};h.prototype.insert=function(o,t){var e={};return o.length===0?this:(e.insert=o,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e))},h.prototype.delete=function(o){return o<=0?this:this.push({delete:o})},h.prototype.retain=function(o,t){if(o<=0)return this;var e={retain:o};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e)},h.prototype.push=function(o){var t=this.ops.length,e=this.ops[t-1];if(o=_(!0,{},o),typeof
`;for(var e=y.iterator(this.ops),s=new h,l=0;e.hasNext();){if(e.peekType()!=="insert")return;var u=e.peek(),r=y.length(u)-e.peekLength(),i=typeof u.insert=="string"?u.insert.indexOf(t,r)-r:-1;if(i<0)s.push(e.next());else if(i>0)s.push(e.next(i));else{if(o(s,e.next(1).attributes||{},l)===!1)return;l+=1,s=new h}}s.length()>0&&o(s,{},l)},h.prototype.transform=function(o,t){if(t=!!t,typeof o=="number")return this.transformPosition(o,t);for(var e=y.iterator(this.ops),s=y.iterator(o.ops),l=new h;e.hasNext()||s.hasNext();)if(e.peekType()==="insert"&&(t||s.peekType()!=="insert"))l.retain(y.length(e.next()));else if(s.peekType()==="insert")l.push(s.next());else{var u=Math.min(e.peekLength(),s.peekLength()),r=e.next(u),i=s.next(u);if(r.delete)continue;i.delete?l.push(i):l.retain(u,y.attributes.transform(r.attributes,i.attributes,t))}return l.chop()},h.prototype.transformPosition=function(o,t){t=!!t;for(var e=y.iterator(this.ops),s=0;e.hasNext()&&s<=o;){var l=e.peekLength(),u=e.peekType();if(e.next(),u==="delete"){o-=Math.min(l,o-s);continue}else u==="insert"&&(s<o||!t)&&(o+=l);s+=l}return o},m.exports=h},function(m,p){var c=Object.prototype.hasOwnProperty,E=Object.prototype.toString,b=Object.defineProperty,_=Object.getOwnPropertyDescriptor,y=function(e){return typeof Array.isArray=="function"?Array.isArray(e):E.call(e)==="[object Array]"},g=function(e){if(!e||E.call(e)!=="[object Object]")return!1;var s=c.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&c.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!s&&!l)return!1;var u;for(u in e);return typeof u>"u"||c.call(e,u)},h=function(e,s){b&&s.name==="__proto__"?b(e,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):e[s.name]=s.newValue},o=function(e,s){if(s==="__proto__")if(c.call(e,s)){if(_)return _(e,s).value}else return;return e[s]};m.exports=function t(){var e,s,l,u,r,i,f=arguments[0],n=1,d=arguments.length,k=!1;for(typeof f=="boolean"&&(k=f,f=arguments[1]||{},n=2),(f==null||typeof f!="object"&&typeof f!="function")&&(f={});n<d;++n)if(e=arguments[n],e!=null)for(s in e)l=o(f,s),u=o(e,s),f!==u&&(k&&u&&(g(u)||(r=y(u)))?(r?(r=!1,i=l&&y(l)?l:[]):i=l&&g(l)?l:{},h(f,{name:s,newValue:t(k,i,u)})):typeof u<"u"&&h(f,{name:s,newValue:u}));return f}},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BlockEmbed=p.bubbleFormats=void 0;var E=function(){function v(O,N){for(var L=0;L<N.length;L++){var D=N[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,N,L){return N&&v(O.prototype,N),L&&v(O,L),O}}(),b=function v(O,N,L){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,N);if(D===void 0){var z=Object.getPrototypeOf(O);return z===null?void 0:v(z,N,L)}else{if("value"in D)return D.value;var $=D.get;return $===void 0?void 0:$.call(L)}},_=c(3),y=f(_),g=c(2),h=f(g),o=c(0),t=f(o),e=c(16),s=f(e),l=c(6),u=f(l),r=c(7),i=f(r);function f(v){return v&&v.__esModule?v:{default:v}}function n(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function d(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:v}function k(v,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);v.prototype=Object.create(O&&O.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(v,O):v.__proto__=O)}var w=1,T=function(v){k(O,v);function O(){return n(this,O),d(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return E(O,[{key:"attach",value:function(){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"attach",this).call(this),this.attributes=new t.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,y.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(L,D){var z=t.defaul
`)){var $=t.default.create(P.blotName);this.parent.insertBefore($,L===0?this:this.next),$.insertAt(0,D.slice(0,-1))}else b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,L,D,z)}}]),O}(t.default.Embed);T.scope=t.default.Scope.BLOCK_BLOT;var P=function(v){k(O,v);function O(N){n(this,O);var L=d(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N));return L.cache={},L}return E(O,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(t.default.Leaf).reduce(function(L,D){return D.length()===0?L:L.insert(D.value(),A(D))},new h.default).insert(`
`,A(this))),this.cache.delta}},{key:"deleteAt",value:function(L,D){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,L,D),this.cache={}}},{key:"formatAt",value:function(L,D,z,$){D<=0||(t.default.query(z,t.default.Scope.BLOCK)?L+D===this.length()&&this.format(z,$):b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,L,Math.min(D,this.length()-L-1),z,$),this.cache={})}},{key:"insertAt",value:function(L,D,z){if(z!=null)return b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,L,D,z);if(D.length!==0){var $=D.split(`
`),J=$.shift();J.length>0&&(L<this.length()-1||this.children.tail==null?b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(L,this.length()-1),J):this.children.tail.insertAt(this.children.tail.length(),J),this.cache={});var H=this;$.reduce(function(j,S){return H=H.split(j,!0),H.insertAt(0,S),S.length},L+J.length)}}},{key:"insertBefore",value:function(L,D){var z=this.children.head;b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,L,D),z instanceof s.default&&z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+w),this.cache.length}},{key:"moveChildren",value:function(L,D){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,L,D),this.cache={}}},{key:"optimize",value:function(L){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,L),this.cache={}}},{key:"path",value:function(L){return b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,L,!0)}},{key:"removeChild",value:function(L){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"removeChild",this).call(this,L),this.cache={}}},{key:"split",value:function(L){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D&&(L===0||L>=this.length()-w)){var z=this.clone();return L===0?(this.parent.insertBefore(z,this),this):(this.parent.insertBefore(z,this.next),z)}else{var $=b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,L,D);return this.cache={},$}}}]),O}(t.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[u.default,t.default.Embed,i.default];function A(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v==null||(typeof v.formats=="function"&&(O=(0,y.default)(O,v.formats())),v.parent==null||v.parent.blotName=="scroll"||v.parent.statics.scope!==v.statics.scope)?O:A(v.parent,O)}p.bubbleFormats=A,p.BlockEmbed=T,p.default=P},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.overload=p.expandConfig=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,K=!1,C=void 0;try{for(var q=j[Symbol.iterator](),F;!(M=(F=q.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(G){K=!0,C=G}finally{try{!M&&q.return&&q.return()}finally{if(K)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}();c(50);var y=c(2),g=A(y),h=c(14),o=A(h),t=c(8),e=A(t),s=c(9),l=A(s),u=c(0),r=A(u),i=c(15),f=A(i),n=c(3),d=A(n),k=c(10),w=A(k),T=c(34),P=A(T);function A(H){return H&&H.__esModule?H:{default:H}}function v(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function O(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var N=(0,w.default)("quill"),L=function(){_(H,null,[{key:"debug",value:function(S){S===!0&&(S="log"),w.default.level(S)}},{key:"find",value:function(S){return S.__quill||r.default.find(S)}},{key:"import",value:function(S){return this.imports[S]==null&&N.error("Cannot import "+S+". Are you sure it was registered?"),this.imports[S]}},{key:"register",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof S!="string"){var C=S.attrName||S.blotName;typeof C=="string"?this.register("formats/"+C,S,I):Object.keys(S).forE
`&&(I.editor.deleteText(I.getLength()-1,1),q.delete(1));var G=C.compose(q);return G},M)}},{key:"setSelection",value:function(S,I,M){if(S==null)this.selection.setRange(null,I||H.sources.API);else{var K=$(S,I,M),C=b(K,4);S=C[0],I=C[1],M=C[3],this.selection.setRange(new i.Range(S,I),M),M!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API,M=new g.default().insert(S);return this.setContents(M,I)}},{key:"update",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.default.sources.USER,I=this.scroll.update(S);return this.selection.update(S),I}},{key:"updateContents",value:function(S){var I=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return z.call(this,function(){return S=new g.default(S),I.editor.applyDelta(S,M)},M,!0)}}]),H}();L.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},L.events=e.default.events,L.sources=e.default.sources,L.version="1.3.7",L.imports={delta:g.default,parchment:r.default,"core/module":l.default,"core/theme":P.default};function D(H,j){if(j=(0,d.default)(!0,{container:H,modules:{clipboard:!0,keyboard:!0,history:!0}},j),!j.theme||j.theme===L.DEFAULTS.theme)j.theme=P.default;else if(j.theme=L.import("themes/"+j.theme),j.theme==null)throw new Error("Invalid theme "+j.theme+". Did you register it?");var S=(0,d.default)(!0,{},j.theme.DEFAULTS);[S,j].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(C){K.modules[C]===!0&&(K.modules[C]={})})});var I=Object.keys(S.modules).concat(Object.keys(j.modules)),M=I.reduce(function(K,C){var q=L.import("modules/"+C);return q==null?N.error("Cannot load "+C+" module. Are you sure you registered it?"):K[C]=q.DEFAULTS||{},K},{});return j.modules!=null&&j.modules.toolbar&&j.modules.toolbar.constructor!==Object&&(j.modules.toolbar={container:j.modules.toolbar}),j=(0,d.default)(!0,{},L.DEFAULTS,{modules:M},S,j),["bounds","container","scrollingContainer"].forEach(function(K){typeof j[K]=="string"&&(j[K]=document.querySelector(j[K]))}),j.modules=Object.keys(j.modules).reduce(function(K,C){return j.modules[C]&&(K[C]=j.modules[C]),K},{}),j}function z(H,j,S,I){if(this.options.strict&&!this.isEnabled()&&j===e.default.sources.USER)return new g.default;var M=S==null?null:this.getSelection(),K=this.editor.delta,C=H();if(M!=null&&(S===!0&&(S=M.index),I==null?M=J(M,C,j):I!==0&&(M=J(M,S,I,j)),this.setSelection(M,e.default.sources.SILENT)),C.length()>0){var q,F=[e.default.events.TEXT_CHANGE,C,K,j];if((q=this.emitter).emit.apply(q,[e.default.events.EDITOR_CHANGE].concat(F)),j!==e.default.sources.SILENT){var G;(G=this.emitter).emit.apply(G,F)}}return C}function $(H,j,S,I,M){var K={};return typeof H.index=="number"&&typeof H.length=="number"?typeof j!="number"?(M=I,I=S,S=j,j=H.length,H=H.index):(j=H.length,H=H.index):typeof j!="number"&&(M=I,I=S,S=j,j=0),(typeof S>"u"?"undefined":E(S))==="object"?(K=S,M=I):typeof S=="string"&&(I!=null?K[S]=I:M=S),M=M||e.default.sources.API,[H,j,K,M]}function J(H,j,S,I){if(H==null)return null;var M=void 0,K=void 0;if(j instanceof g.default){var C=[H.index,H.index+H.length].map(function(V){return j.transformPosition(V,I!==e.default.sources.USER)}),q=b(C,2);M=q[0],K=q[1]}else{var F=[H.index,H.index+H.length].map(function(V){return V<j||V===j&&I===e.default.sources.USER?V:S>=0?V+S:Math.max(j,V+S)}),G=b(F,2);M=G[0],K=G[1]}return new i.Range(M,K-M)}p.expandConfig=D,p.overload=$,p.default=L},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function u(r,i){for(var f=0;f<i.length;f++){var n=i[f];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(r,i,f){return i&&u(r.prototype,i),f&&u(r,f),r}}(),b=function u(r,i,f){r===null&&(r=Function.prototype);var n=Object.getOwnPropertyDescriptor(r,i);if(n===void 0){var d=Object.getPrototypeOf(r);return d=
`)&&(O=O.slice(0,-1)),O.split(`
`).reduce(function(N,L){return N.insert(L).insert(`
`,v.formats())},new g.default)}},{key:"format",value:function(v,O){if(!(v===this.statics.blotName&&O)){var N=this.descendant(r.default,this.length()-1),L=E(N,1),D=L[0];D!=null&&D.deleteAt(D.length()-1,1),_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,v,O)}}},{key:"formatAt",value:function(v,O,N,L){if(O!==0&&!(o.default.query(N,o.default.Scope.BLOCK)==null||N===this.statics.blotName&&L===this.statics.formats(this.domNode))){var D=this.newlineIndex(v);if(!(D<0||D>=v+O)){var z=this.newlineIndex(v,!0)+1,$=D-z+1,J=this.isolate(z,$),H=J.next;J.format(N,L),H instanceof P&&H.formatAt(0,v-z+O-$,N,L)}}}},{key:"insertAt",value:function(v,O,N){if(N==null){var L=this.descendant(r.default,v),D=E(L,2),z=D[0],$=D[1];z.insertAt($,O)}}},{key:"length",value:function(){var v=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
`)?v:v+1}},{key:"newlineIndex",value:function(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,v).lastIndexOf(`
`);var N=this.domNode.textContent.slice(v).indexOf(`
`);return N>-1?v+N:-1}},{key:"optimize",value:function(v){this.domNode.textContent.endsWith(`
`)||this.appendChild(o.default.create("text",`
`)),_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,v);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===O.statics.formats(O.domNode)&&(O.optimize(v),O.moveChildren(this),O.remove())}},{key:"replace",value:function(v){_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,v),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(O){var N=o.default.find(O);N==null?O.parentNode.removeChild(O):N instanceof o.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(v){var O=_(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,v);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),P}(e.default);w.blotName="code-block",w.tagName="PRE",w.TAB=" ",p.Code=k,p.default=w},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0});var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,K=!1,C=void 0;try{for(var q=j[Symbol.iterator](),F;!(M=(F=q.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(G){K=!0,C=G}finally{try{!M&&q.return&&q.return()}finally{if(K)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}(),y=c(2),g=O(y),h=c(20),o=O(h),t=c(0),e=O(t),s=c(13),l=O(s),u=c(24),r=O(u),i=c(4),f=O(i),n=c(16),d=O(n),k=c(21),w=O(k),T=c(11),P=O(T),A=c(3),v=O(A);function O(H){return H&&H.__esModule?H:{default:H}}function N(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function L(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var D=/^[ -~]*$/,z=function(){function H(j){L(this,H),this.scroll=j,this.delta=this.getDelta()}return _(H,[{key:"applyDelta",value:function(S){var I=this,M=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),S=J(S),S.reduce(function(C,q){var F=q.retain||q.delete||q.insert.length||1,G=q.attributes||{};if(q.insert!=null){if(typeof q.insert=="string"){var V=q.insert;V.endsWith(`
`)&&M&&(M=!1,V=V.slice(0,-1)),C>=K&&!V.endsWith(`
`)&&(M=!0),I.scroll.insertAt(C,V);var X=I.scroll.line(C),nt=b(X,2),it=nt[0],at=nt[1],ft=(0,v.default)({},(0,i.bubbleFormats)(it));if(it instanceof f.default){var ct=it.descendant(e.default.Leaf,at),mt=b(ct,1),gt=mt[0];ft=(0,v.default)(ft,(0,i.bubbleFormats)(gt))}G=o.default.attributes.diff(ft,G)||{}}else if(E(q.insert)==="object"){var Z=Object.keys(q.insert)[0];if(Z==null)return C;I.scroll.insertAt(C,Z,q.insert[Z])}K+=F}return Object.keys(G).forEach(function(Y){I.scroll.formatAt(C,F,Y,G[Y])}),C+F},0),S.reduce(function(C,q){return typeof q.delete=="number"?(I.scroll.deleteAt(C,q.delete),C):C+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(S)}},{key:"deleteText",value:function(S,I){return this.scroll.deleteAt(S,I),this.update(new g.default().retain(S).delete(I))}},{key:"formatLine",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(C){if(!(M.scroll.whitelist!=null&&!M.scroll.whitelist[C])){var q=M.scroll.lines(S,Math.max(I,1)),F=I;q.forEach(function(G){var V=G.length();if(!(G instanceof l.default))G.format(C,K[C]);else{var X=S-G.offset(M.scroll),nt=G.newlineIndex(X+F)-X+1;G.formatAt(X,nt,C,K[C])}F-=V})}}),this.scroll.optimize(),this.update(new g.default().retain(S).retain(I,(0,w.default)(K)))}},{key:"formatText",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(C){M.scroll.formatAt(S,I,C,K[C])}),this.update(new g.default().retain(S).retain(I,(0,w.default)(K)))}},{key:"getContents",value:function(S,I){return this.delta.slice(S,S+I)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(S,I){return S.concat(I.delta())},new g.default)}},{key:"getFormat",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=[],K=[];I===0?this.scroll.path(S).forEach(function(q){var F=b(q,1),G=F[0];G instanceof f.default?M.push(G):G instanceof e.default.Leaf&&K.push(G)}):(M=this.scroll.lines(S,I),K=this.scroll.descendants(e.default.Leaf,S,I));var C=[M,K].map(function(q){if(q.length===0)return{};for(var F=(0,i.bubbleFormats)(q.shift());Object.keys(F).length>0;){var G=q.shift();if(G==null)return F;F=$((0,i.bubbleFormats)(G),F)}return F});return v.default.apply(v.default,C)}},{key:"getText",value:function(S,I){return this.getContents(S,I).filter(function(M){return typeof M.insert=="string"}).map(function(M){return M.insert}).join("")}},{key:"insertEmbed",value:function(S,I,M){return this.scroll.insertAt(S,I,M),this.update(new g.default().retain(S).insert(N({},I,M)))}},{key:"insertText",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return I=I.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(S,I),Object.keys(K).forEach(function(C){M.scroll.formatAt(S,I.length,C,K[C])}),this.update(new g.default().retain(S).insert(I,(0,w.default)(K)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var S=this.scroll.children.head;return S.statics.blotName!==f.default.blotName||S.children.length>1?!1:S.children.head instanceof d.default}},{key:"removeFormat",value:function(S,I){var M=this.getText(S,I),K=this.scroll.line(S+I),C=b(K,2),q=C[0],F=C[1],G=0,V=new g.default;q!=null&&(q instanceof l.default?G=q.newlineIndex(F)-F+1:G=q.length()-F,V=q.delta().slice(F,F+G-1).insert(`
`));var X=this.getContents(S,I+G),nt=X.diff(new g.default().insert(M).concat(V)),it=new g.default().retain(S).concat(nt);return this.applyDelta(it)}},{key:"update",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(I.length===1&&I[0].type==="characterData"&&I[0].target.data.match(D)&&e.default.find(I[0].target)){var C=e.default.find(I[0].target),q=(0,i.bubbleFormats)(C),F=C.offset(this.scroll),G=I[0].oldValue.replace(r.default.CONTENTS,""),V=new g.default().insert(G),X=new g.default().insert(C.value()),nt=new g.default().retain(F).concat(V.diff(X,M));S=nt.reduce(function(it,at){return at.insert?it.insert(at.insert,q):it.push(at)},new g.default),this.delta=K.compose(S)}else this.delta=this.getDelta(),(!S||!(0,P.default)(K.compose(S),this.delta))&&(S=K.diff(this.delta,M));return S}}]),H}();function $(H,j){return Object.keys(j).reduce(function(S,I){return H[I]==null||(j[I]===H[I]?S[I]=j[I]:Array.isArray(j[I])?j[I].indexOf(H[I])<0&&(S[I]=j[I].concat([H[I]])):S[I]=[j[I],H[I]]),S},{})}function J(H){return H.reduce(function(j,S){if(S.insert===1){var I=(0,w.default)(S.attributes);return delete I.image,j.insert({image:S.attributes.image},I)}if(S.attributes!=null&&(S.attributes.list===!0||S.attributes.bullet===!0)&&(S=(0,w.default)(S),S.attributes.list?S.attributes.list="ordered":(S.attributes.list="bullet",delete S.attributes.bullet)),typeof S.insert=="string"){var M=S.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return j.insert(M,S.attributes)}return j.push(S)},new g.default)}p.default=z},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.Range=void 0;var E=function(){function T(P,A){var v=[],O=!0,N=!1,L=void 0;try{for(var D=P[Symbol.iterator](),z;!(O=(z=D.next()).done)&&(v.push(z.value),!(A&&v.length===A));O=!0);}catch($){N=!0,L=$}finally{try{!O&&D.return&&D.return()}finally{if(N)throw L}}return v}return function(P,A){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return T(P,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function T(P,A){for(var v=0;v<A.length;v++){var O=A[v];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(P,O.key,O)}}return function(P,A,v){return A&&T(P.prototype,A),v&&T(P,v),P}}(),_=c(0),y=r(_),g=c(21),h=r(g),o=c(11),t=r(o),e=c(8),s=r(e),l=c(10),u=r(l);function r(T){return T&&T.__esModule?T:{default:T}}function i(T){if(Array.isArray(T)){for(var P=0,A=Array(T.length);P<T.length;P++)A[P]=T[P];return A}else return Array.from(T)}function f(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}var n=(0,u.default)("quill:selection"),d=function T(P){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;f(this,T),this.index=P,this.length=A},k=function(){function T(P,A){var v=this;f(this,T),this.emitter=A,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=y.default.create("cursor",this),this.lastRange=this.savedRange=new d(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){v.mouseDown||setTimeout(v.update.bind(v,s.default.sources.USER),1)}),this.emitter.on(s.default.events.EDITOR_CHANGE,function(O,N){O===s.default.events.TEXT_CHANGE&&N.length()>0&&v.update(s.default.sources.SILENT)}),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,function(){if(v.hasFocus()){var O=v.getNativeRange();O!=null&&O.start.node!==v.cursor.textNode&&v.emitter.once(s.default.events.SCROLL_UPDATE,function(){try{v.setNativeRange(O.start.node,O.start.offset,O.end.node,O.end.offset)}catch{}})}}),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,function(O,N){if(N.range){var L=N.range,D=L.startNode,z=L.startOffset,$=L.endNode,J=L.endOffset;v.setNativeRange(D,z,$,J)}}),this.update(s.default.sources.SILENT)}return b(T,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var v=A.cursor.restore();if(!v)return;setTimeout(function(){A.setNativeRange(v.startNode,v.startOffset,v.endNode,v.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(s.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,v){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var O=this.getNativeRange();if(!(O==null||!O.native.collapsed||y.default.query(A,y.default.Scope.BLOCK))){if(O.start.node!==this.cursor.textNode){var N=y.default.find(O.start.node,!1);if(N==null)return;if(N instanceof y.default.Leaf){var L=N.split(O.start.offset);N.parent.insertBefore(this.cursor,L)}else N.insertBefore(this.cursor,O.start.node);this.cursor.attach()}this.cursor.format(A,v),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=this.scroll.length();A=Math.min(A,O-1),v=Math.min(A+v,O-1)-A;var N=void 0,L=this.scroll.leaf(A),D=E(L,2),z=D[0],$=D[1];if(z==null)return null;var J=z.position($,!0),H=E(J,2);N=H[0],$=H[1];var j=document.createRange();if(v>0){j.setStart(N,$);var S=this.scroll.leaf(A+
`)&&(L=L.slice(0,-1)),z.insertAt(0,L,D)}else{var $=g.default.create(L,D);this.appendChild($)}else _(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,N,L,D);this.optimize()}}},{key:"insertBefore",value:function(N,L){if(N.statics.scope===g.default.Scope.INLINE_BLOT){var D=g.default.create(this.statics.defaultChild);D.appendChild(N),N=D}_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,N,L)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(T,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,D=function z($,J,H){var j=[],S=H;return $.children.forEachAt(J,H,function(I,M,K){T(I)?j.push(I):I instanceof g.default.Container&&(j=j.concat(z(I,M,S))),S-=K}),j};return D(this,N,L)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,N,L),N.length>0&&this.emitter.emit(o.default.events.SCROLL_OPTIMIZE,N,L))}},{key:"path",value:function(N){return _(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var L=o.default.sources.USER;typeof N=="string"&&(L=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(o.default.events.SCROLL_BEFORE_UPDATE,L,N),_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(o.default.events.SCROLL_UPDATE,L,N)}}}]),v}(g.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[e.default,t.BlockEmbed,f.default],p.default=P},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.SHORTKEY=p.default=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},b=function(){function q(F,G){var V=[],X=!0,nt=!1,it=void 0;try{for(var at=F[Symbol.iterator](),ft;!(X=(ft=at.next()).done)&&(V.push(ft.value),!(G&&V.length===G));X=!0);}catch(ct){nt=!0,it=ct}finally{try{!X&&at.return&&at.return()}finally{if(nt)throw it}}return V}return function(F,G){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return q(F,G);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function q(F,G){for(var V=0;V<G.length;V++){var X=G[V];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(F,X.key,X)}}return function(F,G,V){return G&&q(F.prototype,G),V&&q(F,V),F}}(),y=c(21),g=A(y),h=c(11),o=A(h),t=c(3),e=A(t),s=c(2),l=A(s),u=c(20),r=A(u),i=c(0),f=A(i),n=c(5),d=A(n),k=c(10),w=A(k),T=c(9),P=A(T);function A(q){return q&&q.__esModule?q:{default:q}}function v(q,F,G){return F in q?Object.defineProperty(q,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):q[F]=G,q}function O(q,F){if(!(q instanceof F))throw new TypeError("Cannot call a class as a function")}function N(q,F){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:q}function L(q,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);q.prototype=Object.create(F&&F.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(q,F):q.__proto__=F)}var D=(0,w.default)("quill:keyboard"),z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",$=function(q){L(F,q),_(F,null,[{key:"match",value:function(V,X){return X=C(X),["altKey","ctrlKey","metaKey","shiftKey"
`,it).retain(X.length()-nt-1).retain(1,{list:"unchecked"});this.quill.updateContents(at,d.default.sources.USER),this.quill.setSelection(F.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:$.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,G){var V=this.quill.getLine(F.index),X=b(V,2),nt=X[0],it=X[1],at=new l.default().retain(F.index).insert(`
`,G.format).retain(nt.length()-it-1).retain(1,{header:null});this.quill.updateContents(at,d.default.sources.USER),this.quill.setSelection(F.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,G){var V=G.prefix.length,X=this.quill.getLine(F.index),nt=b(X,2),it=nt[0],at=nt[1];if(at>V)return!0;var ft=void 0;switch(G.prefix.trim()){case"[]":case"[ ]":ft="unchecked";break;case"[x]":ft="checked";break;case"-":case"*":ft="bullet";break;default:ft="ordered"}this.quill.insertText(F.index," ",d.default.sources.USER),this.quill.history.cutoff();var ct=new l.default().retain(F.index-at).delete(V+1).retain(it.length()-2-at).retain(1,{list:ft});this.quill.updateContents(ct,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-V,d.default.sources.SILENT)}},"code exit":{key:$.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var G=this.quill.getLine(F.index),V=b(G,2),X=V[0],nt=V[1],it=new l.default().retain(F.index+X.length()-nt-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(it,d.default.sources.USER)}},"embed left":J($.keys.LEFT,!1),"embed left shift":J($.keys.LEFT,!0),"embed right":J($.keys.RIGHT,!1),"embed right shift":J($.keys.RIGHT,!0)}};function J(q,F){var G,V=q===$.keys.LEFT?"prefix":"suffix";return G={key:q,shiftKey:F,altKey:null},v(G,V,/^$/),v(G,"handler",function(nt){var it=nt.index;q===$.keys.RIGHT&&(it+=nt.length+1);var at=this.quill.getLeaf(it),ft=b(at,1),ct=ft[0];return ct instanceof f.default.Embed?(q===$.keys.LEFT?F?this.quill.setSelection(nt.index-1,nt.length+1,d.default.sources.USER):this.quill.setSelection(nt.index-1,d.default.sources.USER):F?this.quill.setSelection(nt.index,nt.length+1,d.default.sources.USER):this.quill.setSelection(nt.index+nt.length+1,d.default.sources.USER),!1):!0}),G}function H(q,F){if(!(q.index===0||this.quill.getLength()<=1)){var G=this.quill.getLine(q.index),V=b(G,1),X=V[0],nt={};if(F.offset===0){var it=this.quill.getLine(q.index-1),at=b(it,1),ft=at[0];if(ft!=null&&ft.length()>1){var ct=X.formats(),mt=this.quill.getFormat(q.index-1,1);nt=r.default.attributes.diff(ct,mt)||{}}}var gt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.prefix)?2:1;this.quill.deleteText(q.index-gt,gt,d.default.sources.USER),Object.keys(nt).length>0&&this.quill.formatLine(q.index-gt,gt,nt,d.default.sources.USER),this.quill.focus()}}function j(q,F){var G=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!(q.index>=this.quill.getLength()-G)){var V={},X=0,nt=this.quill.getLine(q.index),it=b(nt,1),at=it[0];if(F.offset>=at.length()-1){var ft=this.quill.getLine(q.index+1),ct=b(ft,1),mt=ct[0];if(mt){var gt=at.formats(),Z=this.quill.getFormat(q.index,1);V=r.default.attributes.diff(gt,Z)||{},X=mt.length()}}this.quill.deleteText(q.index,G,d.default.sources.USER),Object.keys(V).length>0&&this.quill.formatLine(q.index+X-1,G,V,d.default.sources.USER)}}function S(q){var F=this.quill.getLines(q),G={};if(F.length>1){var V=F[0].formats(),X=F[F.length-1].formats();G=r.default.attributes.diff(X,V)||{}}this.quill.deleteText(q,d.default.sources.USER),Object.keys(G).length>0&&this.quill.formatLine(q.index,1,G,d.default.sources.USER),this.quill.setSelection(q.index,d.default.sources.SILENT),this.quill.focus()}function I(q,F){var G=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var V=Object.keys(F.format).reduce(function(X,nt){return f.default.query(nt,f.default.Scope.BLOCK)&&!Array.isArray(F.format[nt])&&(X[nt]=F.format[nt]),X},{});this.quill.insertText(q.index,`
`,V,d.default.sources.USER),this.quill.setSelection(q.index+1,d.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(X){V[X]==null&&(Array.isArray(F.format[X])||X!=="link"&&G.quill.format(X,F.format[X],d.default.sources.USER))})}function M(q){return{key:$.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(G){var V=f.default.query("code-block"),X=G.index,nt=G.length,it=this.quill.scroll.descendant(V,X),at=b(it,2),ft=at[0],ct=at[1];if(ft!=null){var mt=this.quill.getIndex(ft),gt=ft.newlineIndex(ct,!0)+1,Z=ft.newlineIndex(mt+ct+nt),Y=ft.domNode.textContent.slice(gt,Z).split(`
`);ct=0,Y.forEach(function(tt,et){q?(ft.insertAt(gt+ct,V.TAB),ct+=V.TAB.length,et===0?X+=V.TAB.length:nt+=V.TAB.length):tt.startsWith(V.TAB)&&(ft.deleteAt(gt+ct,V.TAB.length),ct-=V.TAB.length,et===0?X-=V.TAB.length:nt-=V.TAB.length),ct+=tt.length+1}),this.quill.update(d.default.sources.USER),this.quill.setSelection(X,nt,d.default.sources.SILENT)}}}}function K(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(G,V){this.quill.format(q,!V.format[q],d.default.sources.USER)}}}function C(q){if(typeof q=="string"||typeof q=="number")return C({key:q});if((typeof q>"u"?"undefined":E(q))==="object"&&(q=(0,g.default)(q,!1)),typeof q.key=="string")if($.keys[q.key.toUpperCase()]!=null)q.key=$.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[z]=q.shortKey,delete q.shortKey),q}p.default=$,p.SHORTKEY=z},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function r(i,f){var n=[],d=!0,k=!1,w=void 0;try{for(var T=i[Symbol.iterator](),P;!(d=(P=T.next()).done)&&(n.push(P.value),!(f&&n.length===f));d=!0);}catch(A){k=!0,w=A}finally{try{!d&&T.return&&T.return()}finally{if(k)throw w}}return n}return function(i,f){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return r(i,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function r(i,f,n){i===null&&(i=Function.prototype);var d=Object.getOwnPropertyDescriptor(i,f);if(d===void 0){var k=Object.getPrototypeOf(i);return k===null?void 0:r(k,f,n)}else{if("value"in d)return d.value;var w=d.get;return w===void 0?void 0:w.call(n)}},_=function(){function r(i,f){for(var n=0;n<f.length;n++){var d=f[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}return function(i,f,n){return f&&r(i.prototype,f),n&&r(i,n),i}}(),y=c(0),g=t(y),h=c(7),o=t(h);function t(r){return r&&r.__esModule?r:{default:r}}function e(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}function s(r,i){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:r}function l(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(r,i):r.__proto__=i)}var u=function(r){l(i,r),_(i,null,[{key:"value",value:function(){}}]);function i(f,n){e(this,i);var d=s(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,f));return d.selection=n,d.textNode=document.createTextNode(i.CONTENTS),d.domNode.appendChild(d.textNode),d._length=0,d}return _(i,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(n,d){if(this._length!==0)return b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"format",this).call(this,n,d);for(var k=this,w=0;k!=null&&k.statics.scope!==g.default.Scope.BLOCK_BLOT;)w+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=i.CONTENTS.length,k.optimize(),k.formatAt(w,i.CONTENTS.length,n,d),this._length=0)}},{key:"index",value:function(n,d){return n===this.textNode?0:b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"index",this).call(this,n,d)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var n=this.textNode,d=this.selection.getNativeRange(),k=void 0,w=void 0,T=void 0;if(d!=null&&d.start.node===n&&d.end.node===n){var P=[n,d.start.offset,d.end.offset];k=P[0],w=P[1],T=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNod
`):n.attributes!=null?Object.keys(n.attributes).some(function(d){return _.default.query(d,_.default.Scope.BLOCK)!=null}):!1}function i(f){var n=f.reduce(function(k,w){return k+=w.delete||0,k},0),d=f.length()-n;return r(f)&&(d-=1),d}p.default=u,p.getLastChangeIndex=i},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BaseTooltip=void 0;var E=function(){function I(M,K){for(var C=0;C<K.length;C++){var q=K[C];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(M,q.key,q)}}return function(M,K,C){return K&&I(M.prototype,K),C&&I(M,C),M}}(),b=function I(M,K,C){M===null&&(M=Function.prototype);var q=Object.getOwnPropertyDescriptor(M,K);if(q===void 0){var F=Object.getPrototypeOf(M);return F===null?void 0:I(F,K,C)}else{if("value"in q)return q.value;var G=q.get;return G===void 0?void 0:G.call(C)}},_=c(3),y=P(_),g=c(2),h=P(g),o=c(8),t=P(o),e=c(23),s=P(e),l=c(34),u=P(l),r=c(59),i=P(r),f=c(60),n=P(f),d=c(28),k=P(d),w=c(61),T=P(w);function P(I){return I&&I.__esModule?I:{default:I}}function A(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function v(I,M){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:I}function O(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(I,M):I.__proto__=M)}var N=[!1,"center","right","justify"],L=["#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"],D=[!1,"serif","monospace"],z=["1","2","3",!1],$=["small",!1,"large","huge"],J=function(I){O(M,I);function M(K,C){A(this,M);var q=v(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,K,C)),F=function G(V){if(!document.body.contains(K.root))return document.body.removeEventListener("click",G);q.tooltip!=null&&!q.tooltip.root.contains(V.target)&&document.activeElement!==q.tooltip.textbox&&!q.quill.hasFocus()&&q.tooltip.hide(),q.pickers!=null&&q.pickers.forEach(function(X){X.container.contains(V.target)||X.close()})};return K.emitter.listenDOM("click",document.body,F),q}return E(M,[{key:"addModule",value:function(C){var q=b(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"addModule",this).call(this,C);return C==="toolbar"&&this.extendToolbar(q),q}},{key:"buildButtons",value:function(C,q){C.forEach(function(F){var G=F.getAttribute("class")||"";G.split(/\s+/).forEach(function(V){if(V.startsWith("ql-")&&(V=V.slice(3),q[V]!=null))if(V==="direction")F.innerHTML=q[V][""]+q[V].rtl;else if(typeof q[V]=="string")F.innerHTML=q[V];else{var X=F.value||"";X!=null&&q[V][X]&&(F.innerHTML=q[V][X])}})})}},{key:"buildPickers",value:function(C,q){var F=this;this.pickers=C.map(function(V){if(V.classList.contains("ql-align"))return V.querySelector("option")==null&&S(V,N),new n.default(V,q.align);if(V.classList.contains("ql-background")||V.classList.contains("ql-color")){var X=V.classList.contains("ql-background")?"background":"color";return V.querySelector("option")==null&&S(V,L,X==="background"?"#ffffff":"#000000"),new i.default(V,q[X])}else return V.querySelector("option")==null&&(V.classList.contains("ql-font")?S(V,D):V.classList.contains("ql-header")?S(V,z):V.classList.contains("ql-size")&&S(V,$)),new k.default(V)});var G=function(){F.pickers.forEach(function(X){X.update()})};this.quill.on(t.default.events.EDITOR_CHANGE,G)}}]),M}(u.default);J.DEFAULTS=(0,y.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var M=this,K=this.container.querySelector("input.ql-i
`)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new o.default().retain(pt.length()-1).delete(1))),$.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(et,Q){var ut=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.default.sources.API;if(typeof et=="string")this.quill.setContents(this.convert(et),Q),this.quill.setSelection(0,l.default.sources.SILENT);else{var ot=this.convert(Q);this.quill.updateContents(new o.default().retain(et).concat(ot),ut),this.quill.setSelection(et+ot.length(),l.default.sources.SILENT)}}},{key:"onPaste",value:function(et){var Q=this;if(!(et.defaultPrevented||!this.quill.isEnabled())){var ut=this.quill.getSelection(),ot=new o.default().retain(ut.index),lt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){ot=ot.concat(Q.convert()).delete(ut.length),Q.quill.updateContents(ot,l.default.sources.USER),Q.quill.setSelection(ot.length()-ut.length,l.default.sources.SILENT),Q.quill.scrollingContainer.scrollTop=lt,Q.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var et=this,Q=[],ut=[];return this.matchers.forEach(function(ot){var lt=b(ot,2),kt=lt[0],Ot=lt[1];switch(kt){case Node.TEXT_NODE:ut.push(Ot);break;case Node.ELEMENT_NODE:Q.push(Ot);break;default:[].forEach.call(et.container.querySelectorAll(kt),function(pt){pt[J]=pt[J]||[],pt[J].push(Ot)});break}}),[Q,ut]}}]),Y}(f.default);I.DEFAULTS={matchers:[],matchVisual:!0};function M(Z,Y,tt){return(typeof Y>"u"?"undefined":E(Y))==="object"?Object.keys(Y).reduce(function(et,Q){return M(et,Q,Y[Q])},Z):Z.reduce(function(et,Q){return Q.attributes&&Q.attributes[Y]?et.push(Q):et.insert(Q.insert,(0,g.default)({},N({},Y,tt),Q.attributes))},new o.default)}function K(Z){if(Z.nodeType!==Node.ELEMENT_NODE)return{};var Y="__ql-computed-style";return Z[Y]||(Z[Y]=window.getComputedStyle(Z))}function C(Z,Y){for(var tt="",et=Z.ops.length-1;et>=0&&tt.length<Y.length;--et){var Q=Z.ops[et];if(typeof Q.insert!="string")break;tt=Q.insert+tt}return tt.slice(-1*Y.length)===Y}function q(Z){if(Z.childNodes.length===0)return!1;var Y=K(Z);return["block","list-item"].indexOf(Y.display)>-1}function F(Z,Y,tt){return Z.nodeType===Z.TEXT_NODE?tt.reduce(function(et,Q){return Q(Z,et)},new o.default):Z.nodeType===Z.ELEMENT_NODE?[].reduce.call(Z.childNodes||[],function(et,Q){var ut=F(Q,Y,tt);return Q.nodeType===Z.ELEMENT_NODE&&(ut=Y.reduce(function(ot,lt){return lt(Q,ot)},ut),ut=(Q[J]||[]).reduce(function(ot,lt){return lt(Q,ot)},ut)),et.concat(ut)},new o.default):new o.default}function G(Z,Y,tt){return M(tt,Z,!0)}function V(Z,Y){var tt=e.default.Attributor.Attribute.keys(Z),et=e.default.Attributor.Class.keys(Z),Q=e.default.Attributor.Style.keys(Z),ut={};return tt.concat(et).concat(Q).forEach(function(ot){var lt=e.default.query(ot,e.default.Scope.ATTRIBUTE);lt!=null&&(ut[lt.attrName]=lt.value(Z),ut[lt.attrName])||(lt=j[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(ut[lt.attrName]=lt.value(Z)||void 0),lt=S[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(lt=S[ot],ut[lt.attrName]=lt.value(Z)||void 0))}),Object.keys(ut).length>0&&(Y=M(Y,ut)),Y}function X(Z,Y){var tt=e.default.query(Z);if(tt==null)return Y;if(tt.prototype instanceof e.default.Embed){var et={},Q=tt.value(Z);Q!=null&&(et[tt.blotName]=Q,Y=new o.default().insert(et,tt.formats(Z)))}else typeof tt.formats=="function"&&(Y=M(Y,tt.blotName,tt.formats(Z)));return Y}function nt(Z,Y){return C(Y,`
`)||Y.insert(`
`),Y}function it(){return new o.default}function at(Z,Y){var tt=e.default.query(Z);if(tt==null||tt.blotName!=="list-item"||!C(Y,`
`))return Y;for(var et=-1,Q=Z.parentNode;!Q.classList.contains("ql-clipboard");)(e.default.query(Q)||{}).blotName==="list"&&(et+=1),Q=Q.parentNode;return et<=0?Y:Y.compose(new o.default().retain(Y.length()-1).retain(1,{indent:et}))}function ft(Z,Y){return C(Y,`
`)||(q(Z)||Y.length()>0&&Z.nextSibling&&q(Z.nextSibling))&&Y.insert(`
`),Y}function ct(Z,Y){if(q(Z)&&Z.nextElementSibling!=null&&!C(Y,`
`)){var tt=Z.offsetHeight+parseFloat(K(Z).marginTop)+parseFloat(K(Z).marginBottom);Z.nextElementSibling.offsetTop>Z.offsetTop+tt*1.5&&Y.insert(`
`)}return Y}function mt(Z,Y){var tt={},et=Z.style||{};return et.fontStyle&&K(Z).fontStyle==="italic"&&(tt.italic=!0),et.fontWeight&&(K(Z).fontWeight.startsWith("bold")||parseInt(K(Z).fontWeight)>=700)&&(tt.bold=!0),Object.keys(tt).length>0&&(Y=M(Y,tt)),parseFloat(et.textIndent||0)>0&&(Y=new o.default().insert(" ").concat(Y)),Y}function gt(Z,Y){var tt=Z.data;if(Z.parentNode.tagName==="O:P")return Y.insert(tt.trim());if(tt.trim().length===0&&Z.parentNode.classList.contains("ql-clipboard"))return Y;if(!K(Z.parentNode).whiteSpace.startsWith("pre")){var et=function(ut,ot){return ot=ot.replace(/[^\u00a0]/g,""),ot.length<1&&ut?" ":ot};tt=tt.replace(/\r\n/g," ").replace(/\n/g," "),tt=tt.replace(/\s\s+/g,et.bind(et,!0)),(Z.previousSibling==null&&q(Z.parentNode)||Z.previousSibling!=null&&q(Z.previousSibling))&&(tt=tt.replace(/^\s+/,et.bind(et,!1))),(Z.nextSibling==null&&q(Z.parentNode)||Z.nextSibling!=null&&q(Z.nextSibling))&&(tt=tt.replace(/\s+$/,et.bind(et,!1)))}return Y.insert(tt)}p.default=I,p.matchAttributor=V,p.matchBlot=X,p.matchNewline=ft,p.matchSpacing=ct,p.matchText=gt},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function s(l,u){for(var r=0;r<u.length;r++){var i=u[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,u,r){return u&&s(l.prototype,u),r&&s(l,r),l}}(),b=function s(l,u,r){l===null&&(l=Function.prototype);var i=Object.getOwnPropertyDescriptor(l,u);if(i===void 0){var f=Object.getPrototypeOf(l);return f===null?void 0:s(f,u,r)}else{if("value"in i)return i.value;var n=i.get;return n===void 0?void 0:n.call(r)}},_=c(6),y=g(_);function g(s){return s&&s.__esModule?s:{default:s}}function h(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}function o(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:s}function t(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}var e=function(s){t(l,s);function l(){return h(this,l),o(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return E(l,[{key:"optimize",value:function(r){b(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"optimize",this).call(this,r),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return b(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),l}(y.default);e.blotName="bold",e.tagName=["STRONG","B"],p.default=e},function(m,p,c){Object.defineProperty(p,"__esModule",{value:!0}),p.addControls=p.default=void 0;var E=function(){function v(O,N){var L=[],D=!0,z=!1,$=void 0;try{for(var J=O[Symbol.iterator](),H;!(D=(H=J.next()).done)&&(L.push(H.value),!(N&&L.length===N));D=!0);}catch(j){z=!0,$=j}finally{try{!D&&J.return&&J.return()}finally{if(z)throw $}}return L}return function(O,N){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return v(O,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function v(O,N){for(var L=0;L<N.length;L++){var D=N[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,N,L){return N&&v(O.prototype,N),L&&v(O,L),O}}(),_=c(2),y=r(_),g=c(0),h=r(g),o=c(5),t=r(o),e=c(10),s=r(e),l=c(9),u=r(l);function r(v){return v&&v.__esModule?v:{default:v}}function i(v,O,N){return O in v?Object.defineProperty(v,O,{value:N,enumerable:!0,configurable:!0,writable:!0}):v[O]=N,v}function f(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function n(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&
`);for(var p=wt.default.iterator(this.ops),c=new R,E=0;p.hasNext();){if(p.peekType()!=="insert")return;var b=p.peek(),_=wt.default.length(b)-p.peekLength(),y=typeof b.insert=="string"?b.insert.indexOf(m,_)-_:-1;if(y<0)c.push(p.next());else if(y>0)c.push(p.next(y));else{if(U(c,p.next(1).attributes||{},E)===!1)return;E+=1,c=new R}}c.length()>0&&U(c,{},E)},R.prototype.invert=function(U){var m=new R;return this.reduce(function(p,c){if(c.insert)m.delete(wt.default.length(c));else{if(c.retain&&c.attributes==null)return m.retain(c.retain),p+c.retain;if(c.delete||c.retain&&c.attributes){var E=c.delete||c.retain,b=U.slice(p,p+E);return b.forEach(function(_){c.delete?m.push(_):c.retain&&c.attributes&&m.retain(wt.default.length(_),Ee.default.invert(c.attributes,_.attributes))}),p+E}}return p},0),m.chop()},R.prototype.transform=function(U,m){if(m===void 0&&(m=!1),m=!!m,typeof U=="number")return this.transformPosition(U,m);for(var p=U,c=wt.default.iterator(this.ops),E=wt.default.iterator(p.ops),b=new R;c.hasNext()||E.hasNext();)if(c.peekType()==="insert"&&(m||E.peekType()!=="insert"))b.retain(wt.default.length(c.next()));else if(E.peekType()==="insert")b.push(E.next());else{var _=Math.min(c.peekLength(),E.peekLength()),y=c.next(_),g=E.next(_);if(y.delete)continue;g.delete?b.push(g):b.retain(_,Ee.default.transform(y.attributes,g.attributes,m))}return b.chop()},R.prototype.transformPosition=function(U,m){m===void 0&&(m=!1),m=!!m;for(var p=wt.default.iterator(this.ops),c=0;p.hasNext()&&c<=U;){var E=p.peekLength(),b=p.peekType();if(p.next(),b==="delete"){U-=Math.min(E,U-c);continue}else b==="insert"&&(c<U||!m)&&(U+=E);c+=E}return U},R.Op=wt.default,R.AttributeMap=Ee.default,R}(),Nr=kr;const Sr=Gn(Nr);/*!
* VueQuill @vueup/vue-quill v1.2.0
* https://vueup.github.io/vue-quill/
*
* Includes quill v1.3.7
* https://quilljs.com/
*
* Copyright (c) 2023 Ahmad Luthfi Masruri
* Released under the MIT license
* Date: 2023-05-12T08:44:03.742Z
*/const $n={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"]]},xr=Vn({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:"delta",validator:R=>["delta","html","text"].includes(R)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:R=>["snow","bubble",""].includes(R)},toolbar:{type:[String,Array,Object],required:!1,validator:R=>typeof R=="string"&&R!==""?R.charAt(0)==="#"?!0:Object.keys($n).indexOf(R)!==-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:(R,U)=>{or(()=>{E()}),ar(()=>{m=null});let m,p;const c=Fn(),E=()=>{var v;if(c.value){if(p=b(),R.modules)if(Array.isArray(R.modules))for(const O of R.modules)qn.register(`modules/${O.name}`,O.module);else qn.register(`modules/${R.modules.name}`,R.modules.module);m=new qn(c.value,p),f(R.content),m.on("text-change",o),m.on("selection-change",e),m.on("editor-change",s),R.theme!=="bubble"&&c.value.classList.remove("ql-bubble"),R.theme!=="snow"&&c.value.classList.remove("ql-snow"),(v=m.getModule("toolbar"))===null||v===void 0||v.container.addEventListener("mousedown",O=>{O.preventDefault()}),U.emit("ready",m)}},b=()=>{const v={};if(R.theme!==""&&(v.theme=R.theme),R.readOnly&&(v.readOnly=R.readOnly),R.placeholder&&(v.placeholder=R.placeholder),R.toolbar&&R.toolbar!==""&&(v.modules={toolbar:(()=>{if(typeof R.toolbar=="object")return R.toolbar;if(typeof R.toolbar=="string")return R.toolbar.charAt(0)==="#"?R.toolbar:$n[R.toolbar]})()}),R.modules){const O=(()=>{var N,L;const D={};if(Array.isArray(R.modules))for(const z of R.modules)D[z.name]=(N=z.options)!==null&&N!==void 0?N:{};else D[R.modules.name]=(L=R.modules.options)!==null&&L!==void 0?L:{};return D})();v.modules=Object.assign({},v.modules,O)}return Object.assign({},R.globalOptions,R.options,v)},_=v=>typeof v=="object"&&v?v.slice():v,y=v=>Object.values(v.ops).some(O=>!O.retain||Object.keys(O).length!==1);let g;const h=v=>{if(typeof g==typeof v){if(v===g)return!0;if(typeof v=="object"&&v&&typeof g=="object"&&g)return!y(g.diff(v))}return!1},o=(v,O,N)=>{g=_(i()),h(R.content)||U.emit("update:content",g),U.emit("textChange",{delta:v,oldContents:O,source:N})},t=Fn(),e=(v,O,N)=>{t.value=!!(m!=null&&m.hasFocus()),U.emit("selectionChange",{range:v,oldRange:O,source:N})};Ln(t,v=>{v?U.emit("focus",c):U.emit("blur",c)});const s=(...v)=>{v[0]==="text-change"&&U.emit("editorChange",{name:v[0],delta:v[1],oldContents:v[2],source:v[3]}),v[0]==="selection-change"&&U.emit("editorChange",{name:v[0],range:v[1],oldRange:v[2],source:v[3]})},l=()=>c.value,u=()=>{var v;return(v=m==null?void 0:m.getModule("toolbar"))===null||v===void 0?void 0:v.container},r=()=>{if(m)return m;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.`},i=(v,O)=>R.contentType==="html"?k():R.contentType==="text"?n(v,O):m==null?void 0:m.getContents(v,O),f=(v,O="api")=>{const N=v||(R.contentType==="delta"?new Sr:"");R.contentType==="html"?w(N):R.contentType==="text"?d(N,O):m==null||m.setContents(N,O),g=_(N)},n=(v,O)=>{var N;return(N=m==null?void 0:m.getText(v,O))!==null&&N!==void 0?N:""},d=(v,O="api")=>{m==null||m.setText(v,O)},k=()=>{var v;return(v=m==null?void 0:m.root.innerHTML)!==null&&v!==void 0?v:""},w=v=>{m&&(m.root.innerHTML=v)},T=(v,O="api")=>{const N=m==null?void 0:m.clipboard.convert(v);N&&(m==null||m.setContents(N,O))},P=()=>{m==null||m.focus()},A=()=>{Un(()=>{var v;!U.slots.toolbar&&m&&((v=m.getModule("toolbar"))===null||v===void 0||v.container.remove()),E()})};return Ln(()=>R.content,v=>{if(!m||!v||h(v))return;const O=m.getSelection();O&&Un(()=>m==null?void 0:m.setSelection(O)),f(v)},{deep:!0}),Ln(()=>R.enable,v=>{m&&m.enable(v)}),{editor:c,getEditor:l,getToolbar:u,getQuill:r,getContents:i,setContents:f,getHTML:k,setHTML:w,pasteHTML:T,focus:P,getText:n,setText:d,reinit:A}},render(){var R,U;return[(U=(R=this.$slots).toolbar)===null||U===void 0?void 0:U.call(R),ir("div",{ref:"editor",...this.$attrs})]}}),Pr={class:"rich-editor"},Lr=Vn({__name:"RichEditor",props:{modelValue:{},placeholder:{default:"请输入内容..."},height:{default:400}},emits:["update:modelValue"],setup(R,{emit:U}){hr(c=>({dc423754:c.height-42+"px"}));const m=U;function p(c){m("update:modelValue",c)}return(c,E)=>(lr(),ur("div",Pr,[sr(fr(xr),{content:R.modelValue,"content-type":"html",options:{theme:"snow",placeholder:R.placeholder,modules:{toolbar:[["bold","italic","underline","strike"],[{header:[1,2,3,!1]}],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]}],["blockquote","code-block"],[{align:[]}],["link","image"],["clean"]]}},style:cr({height:R.height+"px"}),"onUpdate:content":p},null,8,["content","options","style"])]))}}),Rr=dr(Lr,[["__scopeId","data-v-1f87405b"]]);export{Rr as R};