File: /var/www/html/public/static/js/quill-0288a6dd.js
var sl=Object.defineProperty;var nl=(r,t,e)=>t in r?sl(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var T=(r,t,e)=>(nl(r,typeof t!="symbol"?t+"":t,e),e);import{c as $t,a as rl}from"./_commonjsHelpers-87174ba5.js";import{f as wr,m as Gt}from"./merge-f215fb43.js";import{c as Le}from"./cloneDeep-798ec2b8.js";var k=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(k||{});class qt{constructor(t,e,s={}){this.attrName=t,this.keyName=e;const n=k.TYPE&k.ATTRIBUTE;this.scope=s.scope!=null?s.scope&k.LEVEL|n:k.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}static keys(t){return Array.from(t.attributes).map(e=>e.name)}add(t,e){return this.canAdd(t,e)?(t.setAttribute(this.keyName,e),!0):!1}canAdd(t,e){return this.whitelist==null?!0:typeof e=="string"?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class qe extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const vi=class ir{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let s=null;try{s=t.parentNode}catch(n){return null}return this.find(s,e)}return null}create(t,e,s){const n=this.query(e);if(n==null)throw new qe(`Unable to create ${e} blot`);const i=n,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(s),a=new i(t,o,s);return ir.blots.set(a.domNode,a),a}find(t,e=!1){return ir.find(t,e)}query(t,e=k.ANY){let s;return typeof t=="string"?s=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?s=this.types.text:typeof t=="number"?t&k.LEVEL&k.BLOCK?s=this.types.block:t&k.LEVEL&k.INLINE&&(s=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(n=>(s=this.classes[n],!!s)),s=s||this.tags[t.tagName]),s==null?null:"scope"in s&&e&k.LEVEL&s.scope&&e&k.TYPE&s.scope?s:null}register(...t){return t.map(e=>{const s="blotName"in e,n="attrName"in e;if(!s&&!n)throw new qe("Invalid definition");if(s&&e.blotName==="abstract")throw new qe("Cannot register abstract class");const i=s?e.blotName:n?e.attrName:void 0;return this.types[i]=e,n?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):s&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(o=>o.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(o=>{(this.tags[o]==null||e.className==null)&&(this.tags[o]=e)}))),e})}};vi.blots=new WeakMap;let ke=vi;function $r(r,t){return(r.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class il extends qt{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(t,e){return this.canAdd(t,e)?(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0):!1}remove(t){$r(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=($r(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const yt=il;function Wn(r){const t=r.split("-"),e=t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return t[0]+e}class ll extends qt{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Wn(this.keyName)]=e,!0):!1}remove(t){t.style[Wn(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Wn(this.keyName)];return this.canAdd(t,e)?e:""}}const Zt=ll;class ol{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=ke.find(this.domNode);if(t==null)return;const e=qt.keys(this.domNode),s=yt.keys(this.domNode),n=Zt.keys(this.domNode);e.concat(s).concat(n).forEach(i=>{const o=t.scroll.query(i,k.ATTRIBUTE);o instanceof qt&&(this.attributes[o.attrName]=o)})}copy(t){Object.keys(this.attributes).forEach(e=>{const s=this.attributes[e].value(this.domNode);t.format(e,s)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}}const Ks=ol,Ei=class{constructor(t,e){this.scroll=t,this.domNode=e,ke.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new qe("Blot definition missing tagName");let e,s;return Array.isArray(this.tagName)?(typeof t=="string"?(s=t.toUpperCase(),parseInt(s,10).toString()===s&&(s=parseInt(s,10))):typeof t=="number"&&(s=t),typeof s=="number"?e=document.createElement(this.tagName[s-1]):s&&this.tagName.indexOf(s)>-1?e=document.createElement(s):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),ke.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,s,n){const i=this.isolate(t,e);if(this.scroll.query(s,k.BLOT)!=null&&n)i.wrap(s,n);else if(this.scroll.query(s,k.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(s,n)}}insertAt(t,e,s){const n=s==null?this.scroll.create("text",e):this.scroll.create(e,s),i=this.split(t);this.parent.insertBefore(n,i||void 0)}isolate(t,e){const s=this.split(t);if(s==null)throw new Error("Attempt to isolate at end");return s.split(e),s}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const s=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(s,this.next||void 0),this.remove()),s}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const s=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(s,this.next||void 0),typeof s.appendChild!="function")throw new qe(`Cannot wrap ${t}`);return s.appendChild(this),s}};Ei.blotName="abstract";let Ni=Ei;const Ai=class extends Ni{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let s=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(s+=1),[this.parent.domNode,s]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Ai.scope=k.INLINE_BLOT;let al=Ai;const X=al;class cl{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let s=e();for(;s&&t>0;)t-=1,s=e();return s}contains(t){const e=this.iterator();let s=e();for(;s;){if(s===t)return!0;s=e()}return!1}indexOf(t){const e=this.iterator();let s=e(),n=0;for(;s;){if(s===t)return n;n+=1,s=e()}return-1}insertBefore(t,e){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,s=this.head;for(;s!=null;){if(s===t)return e;e+=s.length(),s=s.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return t!=null&&(t=t.next),e}}find(t,e=!1){const s=this.iterator();let n=s();for(;n;){const i=n.length();if(t<i||e&&t===i&&(n.next==null||n.next.length()!==0))return[n,t];t-=i,n=s()}return[null,0]}forEach(t){const e=this.iterator();let s=e();for(;s;)t(s),s=e()}forEachAt(t,e,s){if(e<=0)return;const[n,i]=this.find(t);let o=t-i;const a=this.iterator(n);let u=a();for(;u&&o<t+e;){const h=u.length();t>o?s(u,t-o,Math.min(e,o+h-t)):s(u,0,Math.min(h,t+e-o)),o+=h,u=a()}}map(t){return this.reduce((e,s)=>(e.push(t(s)),e),[])}reduce(t,e){const s=this.iterator();let n=s();for(;n;)e=t(e,n),n=s();return e}}function zr(r,t){const e=t.find(r);if(e)return e;try{return t.create(r)}catch(s){const n=t.create(k.INLINE);return Array.from(r.childNodes).forEach(i=>{n.domNode.appendChild(i)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const wi=class jt extends Ni{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,jt.uiClass&&this.uiNode.classList.add(jt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new cl,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=zr(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof qe)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(s,n,i)=>{s.deleteAt(n,i)})}descendant(t,e=0){const[s,n]=this.children.find(e);return t.blotName==null&&t(s)||t.blotName!=null&&s instanceof t?[s,n]:s instanceof jt?s.descendant(t,n):[null,-1]}descendants(t,e=0,s=Number.MAX_VALUE){let n=[],i=s;return this.children.forEachAt(e,s,(o,a,u)=>{(t.blotName==null&&t(o)||t.blotName!=null&&o instanceof t)&&n.push(o),o instanceof jt&&(n=n.concat(o.descendants(t,a,i))),i-=u}),n}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(s=>e instanceof s)||(e.statics.scope===k.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof jt?e.unwrap():e.remove())})}formatAt(t,e,s,n){this.children.forEachAt(t,e,(i,o,a)=>{i.formatAt(o,a,s,n)})}insertAt(t,e,s){const[n,i]=this.children.find(t);if(n)n.insertAt(i,e,s);else{const o=s==null?this.scroll.create("text",e):this.scroll.create(e,s);this.appendChild(o)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let s=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(s=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==s)&&this.domNode.insertBefore(t.domNode,s),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(s=>{t.insertBefore(s,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,e=!1){const[s,n]=this.children.find(t,e),i=[[this,t]];return s instanceof jt?i.concat(s.path(n,e)):(s!=null&&i.push([s,n]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const s=typeof t=="string"?this.scroll.create(t,e):t;return s instanceof jt&&this.moveChildren(s),super.replaceWith(s)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(t,this.length(),(n,i,o)=>{const a=n.split(i,e);a!=null&&s.appendChild(a)}),s}splitAfter(t){const e=this.clone();for(;t.next!=null;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const s=[],n=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(s.push(...i.addedNodes),n.push(...i.removedNodes))}),n.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),s.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=zr(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};wi.uiClass="";let ul=wi;const mt=ul;function hl(r,t){if(Object.keys(r).length!==Object.keys(t).length)return!1;for(const e in r)if(r[e]!==t[e])return!1;return!0}const ve=class Ee extends mt{static create(t){return super.create(t)}static formats(t,e){const s=e.query(Ee.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Ks(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(s=>{s instanceof Ee||(s=s.wrap(Ee.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(t,k.INLINE);if(s==null)return;s instanceof qt?this.attributes.attribute(s,e):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,s,n){this.formats()[s]!=null||this.scroll.query(s,k.ATTRIBUTE)?this.isolate(t,e).format(s,n):super.formatAt(t,e,s,n)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const s=this.next;s instanceof Ee&&s.prev===this&&hl(e,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,e){const s=super.replaceWith(t,e);return this.attributes.copy(s),s}update(t,e){super.update(t,e),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}wrap(t,e){const s=super.wrap(t,e);return s instanceof Ee&&this.attributes.move(s),s}};ve.allowedChildren=[ve,X],ve.blotName="inline",ve.scope=k.INLINE_BLOT,ve.tagName="SPAN";let fl=ve;const xr=fl,Ne=class lr extends mt{static create(t){return super.create(t)}static formats(t,e){const s=e.query(lr.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Ks(this.domNode)}format(t,e){const s=this.scroll.query(t,k.BLOCK);s!=null&&(s instanceof qt?this.attributes.attribute(s,e):t===this.statics.blotName&&!e?this.replaceWith(lr.blotName):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,s,n){this.scroll.query(s,k.BLOCK)!=null?this.format(s,n):super.formatAt(t,e,s,n)}insertAt(t,e,s){if(s==null||this.scroll.query(e,k.INLINE)!=null)super.insertAt(t,e,s);else{const n=this.split(t);if(n!=null){const i=this.scroll.create(e,s);n.parent.insertBefore(i,n)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const s=super.replaceWith(t,e);return this.attributes.copy(s),s}update(t,e){super.update(t,e),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}};Ne.blotName="block",Ne.scope=k.BLOCK_BLOT,Ne.tagName="P",Ne.allowedChildren=[xr,Ne,X];let dl=Ne;const Je=dl,or=class extends mt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,s,n){super.formatAt(t,e,s,n),this.enforceAllowedChildren()}insertAt(t,e,s){super.insertAt(t,e,s),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};or.blotName="container",or.scope=k.BLOCK_BLOT;let gl=or;const Gs=gl;class pl extends X{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,s,n){t===0&&e===this.length()?this.format(s,n):super.formatAt(t,e,s,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const it=pl,ml={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},bl=100,Ae=class extends mt{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(s=>{this.update(s)}),this.observer.observe(this.domNode,ml),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const s=this.registry.find(t,e);return s?s.scroll===this?s:e?this.find(s.scroll.domNode.parentNode,!0):null:null}query(t,e=k.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&e===this.length()?this.children.forEach(s=>{s.remove()}):super.deleteAt(t,e)}formatAt(t,e,s,n){this.update(),super.formatAt(t,e,s,n)}insertAt(t,e,s){this.update(),super.insertAt(t,e,s)}optimize(t=[],e={}){super.optimize(e);const s=e.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const i=(u,h=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(s.has(u.domNode)||s.set(u.domNode,[]),h&&i(u.parent))},o=u=>{s.has(u.domNode)&&(u instanceof mt&&u.children.forEach(o),s.delete(u.domNode),u.optimize(e))};let a=t;for(let u=0;a.length>0;u+=1){if(u>=bl)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const g=this.find(h.target,!0);g!=null&&(g.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(b=>{const d=this.find(b,!1);i(d,!1),d instanceof mt&&d.children.forEach(p=>{i(p,!1)})})):h.type==="attributes"&&i(g.prev)),i(g))}),this.children.forEach(o),a=Array.from(this.observer.takeRecords()),n=a.slice();n.length>0;)t.push(n.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const s=new WeakMap;t.map(n=>{const i=this.find(n.target,!0);return i==null?null:s.has(i.domNode)?(s.get(i.domNode).push(n),null):(s.set(i.domNode,[n]),i)}).forEach(n=>{n!=null&&n!==this&&s.has(n.domNode)&&n.update(s.get(n.domNode)||[],e)}),e.mutationsMap=s,s.has(this.domNode)&&super.update(s.get(this.domNode),e),this.optimize(t,e)}};Ae.blotName="scroll",Ae.defaultChild=Je,Ae.allowedChildren=[Je,Gs],Ae.scope=k.BLOCK_BLOT,Ae.tagName="DIV";let yl=Ae;const Tr=yl,ar=class xi extends X{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,s){s==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,s)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof xi&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(t,e){t.some(s=>s.type==="characterData"&&s.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ar.blotName="text",ar.scope=k.INLINE_BLOT;let vl=ar;const Vs=vl,El=Object.freeze(Object.defineProperty({__proto__:null,Attributor:qt,AttributorStore:Ks,BlockBlot:Je,ClassAttributor:yt,ContainerBlot:Gs,EmbedBlot:it,InlineBlot:xr,LeafBlot:X,ParentBlot:mt,Registry:ke,Scope:k,ScrollBlot:Tr,StyleAttributor:Zt,TextBlot:Vs},Symbol.toStringTag,{value:"Module"}));var J={},Nl={get exports(){return J},set exports(r){J=r}},rt=-1,tt=1,$=0;function ts(r,t,e,s,n){if(r===t)return r?[[$,r]]:[];if(e!=null){var i=Cl(r,t,e);if(i)return i}var o=Lr(r,t),a=r.substring(0,o);r=r.substring(o),t=t.substring(o),o=Zs(r,t);var u=r.substring(r.length-o);r=r.substring(0,r.length-o),t=t.substring(0,t.length-o);var h=Al(r,t);return a&&h.unshift([$,a]),u&&h.push([$,u]),qr(h,n),s&&Tl(h),h}function Al(r,t){var e;if(!r)return[[tt,t]];if(!t)return[[rt,r]];var s=r.length>t.length?r:t,n=r.length>t.length?t:r,i=s.indexOf(n);if(i!==-1)return e=[[tt,s.substring(0,i)],[$,n],[tt,s.substring(i+n.length)]],r.length>t.length&&(e[0][0]=e[2][0]=rt),e;if(n.length===1)return[[rt,r],[tt,t]];var o=xl(r,t);if(o){var a=o[0],u=o[1],h=o[2],g=o[3],b=o[4],d=ts(a,h),p=ts(u,g);return d.concat([[$,b]],p)}return wl(r,t)}function wl(r,t){for(var e=r.length,s=t.length,n=Math.ceil((e+s)/2),i=n,o=2*n,a=new Array(o),u=new Array(o),h=0;h<o;h++)a[h]=-1,u[h]=-1;a[i+1]=0,u[i+1]=0;for(var g=e-s,b=g%2!==0,d=0,p=0,m=0,N=0,A=0;A<n;A++){for(var E=-A+d;E<=A-p;E+=2){var w=i+E,x;E===-A||E!==A&&a[w-1]<a[w+1]?x=a[w+1]:x=a[w-1]+1;for(var C=x-E;x<e&&C<s&&r.charAt(x)===t.charAt(C);)x++,C++;if(a[w]=x,x>e)p+=2;else if(C>s)d+=2;else if(b){var q=i+g-E;if(q>=0&&q<o&&u[q]!==-1){var _=e-u[q];if(x>=_)return Vr(r,t,x,C)}}}for(var B=-A+m;B<=A-N;B+=2){var q=i+B,_;B===-A||B!==A&&u[q-1]<u[q+1]?_=u[q+1]:_=u[q-1]+1;for(var j=_-B;_<e&&j<s&&r.charAt(e-_-1)===t.charAt(s-j-1);)_++,j++;if(u[q]=_,_>e)N+=2;else if(j>s)m+=2;else if(!b){var w=i+g-B;if(w>=0&&w<o&&a[w]!==-1){var x=a[w],C=i+x-w;if(_=e-_,x>=_)return Vr(r,t,x,C)}}}}return[[rt,r],[tt,t]]}function Vr(r,t,e,s){var n=r.substring(0,e),i=t.substring(0,s),o=r.substring(e),a=t.substring(s),u=ts(n,i),h=ts(o,a);return u.concat(h)}function Lr(r,t){if(!r||!t||r.charAt(0)!==t.charAt(0))return 0;for(var e=0,s=Math.min(r.length,t.length),n=s,i=0;e<n;)r.substring(i,n)==t.substring(i,n)?(e=n,i=e):s=n,n=Math.floor((s-e)/2+e);return Ti(r.charCodeAt(n-1))&&n--,n}function Kr(r,t){var e=r.length,s=t.length;if(e==0||s==0)return 0;e>s?r=r.substring(e-s):e<s&&(t=t.substring(0,e));var n=Math.min(e,s);if(r==t)return n;for(var i=0,o=1;;){var a=r.substring(n-o),u=t.indexOf(a);if(u==-1)return i;o+=u,(u==0||r.substring(n-o)==t.substring(0,o))&&(i=o,o++)}}function Zs(r,t){if(!r||!t||r.slice(-1)!==t.slice(-1))return 0;for(var e=0,s=Math.min(r.length,t.length),n=s,i=0;e<n;)r.substring(r.length-n,r.length-i)==t.substring(t.length-n,t.length-i)?(e=n,i=e):s=n,n=Math.floor((s-e)/2+e);return Li(r.charCodeAt(r.length-n))&&n--,n}function xl(r,t){var e=r.length>t.length?r:t,s=r.length>t.length?t:r;if(e.length<4||s.length*2<e.length)return null;function n(p,m,N){for(var A=p.substring(N,N+Math.floor(p.length/4)),E=-1,w="",x,C,q,_;(E=m.indexOf(A,E+1))!==-1;){var B=Lr(p.substring(N),m.substring(E)),j=Zs(p.substring(0,N),m.substring(0,E));w.length<j+B&&(w=m.substring(E-j,E)+m.substring(E,E+B),x=p.substring(0,N-j),C=p.substring(N+B),q=m.substring(0,E-j),_=m.substring(E+B))}return w.length*2>=p.length?[x,C,q,_,w]:null}var i=n(e,s,Math.ceil(e.length/4)),o=n(e,s,Math.ceil(e.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var u,h,g,b;r.length>t.length?(u=a[0],h=a[1],g=a[2],b=a[3]):(g=a[0],b=a[1],u=a[2],h=a[3]);var d=a[4];return[u,h,g,b,d]}function Tl(r){for(var t=!1,e=[],s=0,n=null,i=0,o=0,a=0,u=0,h=0;i<r.length;)r[i][0]==$?(e[s++]=i,o=u,a=h,u=0,h=0,n=r[i][1]):(r[i][0]==tt?u+=r[i][1].length:h+=r[i][1].length,n&&n.length<=Math.max(o,a)&&n.length<=Math.max(u,h)&&(r.splice(e[s-1],0,[rt,n]),r[e[s-1]+1][0]=tt,s--,s--,i=s>0?e[s-1]:-1,o=0,a=0,u=0,h=0,n=null,t=!0)),i++;for(t&&qr(r),Sl(r),i=1;i<r.length;){if(r[i-1][0]==rt&&r[i][0]==tt){var g=r[i-1][1],b=r[i][1],d=Kr(g,b),p=Kr(b,g);d>=p?(d>=g.length/2||d>=b.length/2)&&(r.splice(i,0,[$,b.substring(0,d)]),r[i-1][1]=g.substring(0,g.length-d),r[i+1][1]=b.substring(d),i++):(p>=g.length/2||p>=b.length/2)&&(r.splice(i,0,[$,g.substring(0,p)]),r[i-1][0]=tt,r[i-1][1]=b.substring(0,b.length-p),r[i+1][0]=rt,r[i+1][1]=g.substring(p),i++),i++}i++}}var Gr=/[^a-zA-Z0-9]/,Zr=/\s/,Wr=/[\r\n]/,Ll=/\n\r?\n$/,ql=/^\r?\n\r?\n/;function Sl(r){function t(p,m){if(!p||!m)return 6;var N=p.charAt(p.length-1),A=m.charAt(0),E=N.match(Gr),w=A.match(Gr),x=E&&N.match(Zr),C=w&&A.match(Zr),q=x&&N.match(Wr),_=C&&A.match(Wr),B=q&&p.match(Ll),j=_&&m.match(ql);return B||j?5:q||_?4:E&&!x&&C?3:x||C?2:E||w?1:0}for(var e=1;e<r.length-1;){if(r[e-1][0]==$&&r[e+1][0]==$){var s=r[e-1][1],n=r[e][1],i=r[e+1][1],o=Zs(s,n);if(o){var a=n.substring(n.length-o);s=s.substring(0,s.length-o),n=a+n.substring(0,n.length-o),i=a+i}for(var u=s,h=n,g=i,b=t(s,n)+t(n,i);n.charAt(0)===i.charAt(0);){s+=n.charAt(0),n=n.substring(1)+i.charAt(0),i=i.substring(1);var d=t(s,n)+t(n,i);d>=b&&(b=d,u=s,h=n,g=i)}r[e-1][1]!=u&&(u?r[e-1][1]=u:(r.splice(e-1,1),e--),r[e][1]=h,g?r[e+1][1]=g:(r.splice(e+1,1),e--))}e++}}function qr(r,t){r.push([$,""]);for(var e=0,s=0,n=0,i="",o="",a;e<r.length;){if(e<r.length-1&&!r[e][1]){r.splice(e,1);continue}switch(r[e][0]){case tt:n++,o+=r[e][1],e++;break;case rt:s++,i+=r[e][1],e++;break;case $:var u=e-n-s-1;if(t){if(u>=0&&Si(r[u][1])){var h=r[u][1].slice(-1);if(r[u][1]=r[u][1].slice(0,-1),i=h+i,o=h+o,!r[u][1]){r.splice(u,1),e--;var g=u-1;r[g]&&r[g][0]===tt&&(n++,o=r[g][1]+o,g--),r[g]&&r[g][0]===rt&&(s++,i=r[g][1]+i,g--),u=g}}if(qi(r[e][1])){var h=r[e][1].charAt(0);r[e][1]=r[e][1].slice(1),i+=h,o+=h}}if(e<r.length-1&&!r[e][1]){r.splice(e,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=Lr(o,i),a!==0&&(u>=0?r[u][1]+=o.substring(0,a):(r.splice(0,0,[$,o.substring(0,a)]),e++),o=o.substring(a),i=i.substring(a)),a=Zs(o,i),a!==0&&(r[e][1]=o.substring(o.length-a)+r[e][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var b=n+s;i.length===0&&o.length===0?(r.splice(e-b,b),e=e-b):i.length===0?(r.splice(e-b,b,[tt,o]),e=e-b+1):o.length===0?(r.splice(e-b,b,[rt,i]),e=e-b+1):(r.splice(e-b,b,[rt,i],[tt,o]),e=e-b+2)}e!==0&&r[e-1][0]===$?(r[e-1][1]+=r[e][1],r.splice(e,1)):e++,n=0,s=0,i="",o="";break}}r[r.length-1][1]===""&&r.pop();var d=!1;for(e=1;e<r.length-1;)r[e-1][0]===$&&r[e+1][0]===$&&(r[e][1].substring(r[e][1].length-r[e-1][1].length)===r[e-1][1]?(r[e][1]=r[e-1][1]+r[e][1].substring(0,r[e][1].length-r[e-1][1].length),r[e+1][1]=r[e-1][1]+r[e+1][1],r.splice(e-1,1),d=!0):r[e][1].substring(0,r[e+1][1].length)==r[e+1][1]&&(r[e-1][1]+=r[e+1][1],r[e][1]=r[e][1].substring(r[e+1][1].length)+r[e+1][1],r.splice(e+1,1),d=!0)),e++;d&&qr(r,t)}function Ti(r){return r>=55296&&r<=56319}function Li(r){return r>=56320&&r<=57343}function qi(r){return Li(r.charCodeAt(0))}function Si(r){return Ti(r.charCodeAt(r.length-1))}function kl(r){for(var t=[],e=0;e<r.length;e++)r[e][1].length>0&&t.push(r[e]);return t}function Xn(r,t,e,s){return Si(r)||qi(s)?null:kl([[$,r],[rt,t],[tt,e],[$,s]])}function Cl(r,t,e){var s=typeof e=="number"?{index:e,length:0}:e.oldRange,n=typeof e=="number"?null:e.newRange,i=r.length,o=t.length;if(s.length===0&&(n===null||n.length===0)){var a=s.index,u=r.slice(0,a),h=r.slice(a),g=n?n.index:null;t:{var b=a+o-i;if(g!==null&&g!==b||b<0||b>o)break t;var d=t.slice(0,b),p=t.slice(b);if(p!==h)break t;var m=Math.min(a,b),N=u.slice(0,m),A=d.slice(0,m);if(N!==A)break t;var E=u.slice(m),w=d.slice(m);return Xn(N,E,w,h)}t:{if(g!==null&&g!==a)break t;var x=a,d=t.slice(0,x),p=t.slice(x);if(d!==u)break t;var C=Math.min(i-x,o-x),q=h.slice(h.length-C),_=p.slice(p.length-C);if(q!==_)break t;var E=h.slice(0,h.length-C),w=p.slice(0,p.length-C);return Xn(u,E,w,q)}}if(s.length>0&&n&&n.length===0){t:{var N=r.slice(0,s.index),q=r.slice(s.index+s.length),m=N.length,C=q.length;if(o<m+C)break t;var A=t.slice(0,m),_=t.slice(o-C);if(N!==A||q!==_)break t;var E=r.slice(m,i-C),w=t.slice(m,o-C);return Xn(N,E,w,q)}}return null}function Ws(r,t,e,s){return ts(r,t,e,s,!0)}Ws.INSERT=tt;Ws.DELETE=rt;Ws.EQUAL=$;var Ol=Ws,es={},_l={get exports(){return es},set exports(r){es=r}};(function(r,t){var e=200,s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",h="[object Error]",g="[object Function]",b="[object GeneratorFunction]",d="[object Map]",p="[object Number]",m="[object Object]",N="[object Promise]",A="[object RegExp]",E="[object Set]",w="[object String]",x="[object Symbol]",C="[object WeakMap]",q="[object ArrayBuffer]",_="[object DataView]",B="[object Float32Array]",j="[object Float64Array]",St="[object Int8Array]",Dt="[object Int16Array]",Wt="[object Int32Array]",Xt="[object Uint8Array]",us="[object Uint8ClampedArray]",hs="[object Uint16Array]",fs="[object Uint32Array]",tn=/[\\^$.*+?()[\]{}|]/g,en=/\w*$/,sn=/^\[object .+?Constructor\]$/,nn=/^(?:0|[1-9]\d*)$/,U={};U[i]=U[o]=U[q]=U[_]=U[a]=U[u]=U[B]=U[j]=U[St]=U[Dt]=U[Wt]=U[d]=U[p]=U[m]=U[A]=U[E]=U[w]=U[x]=U[Xt]=U[us]=U[hs]=U[fs]=!0,U[h]=U[g]=U[C]=!1;var rn=typeof $t=="object"&&$t&&$t.Object===Object&&$t,ln=typeof self=="object"&&self&&self.Object===Object&&self,ht=rn||ln||Function("return this")(),ds=t&&!t.nodeType&&t,P=ds&&!0&&r&&!r.nodeType&&r,gs=P&&P.exports===ds;function on(l,c){return l.set(c[0],c[1]),l}function ft(l,c){return l.add(c),l}function ps(l,c){for(var f=-1,y=l?l.length:0;++f<y&&c(l[f],f,l)!==!1;);return l}function ms(l,c){for(var f=-1,y=c.length,I=l.length;++f<y;)l[I+f]=c[f];return l}function Oe(l,c,f,y){var I=-1,O=l?l.length:0;for(y&&O&&(f=l[++I]);++I<O;)f=c(f,l[I],I,l);return f}function _e(l,c){for(var f=-1,y=Array(l);++f<l;)y[f]=c(f);return y}function bs(l,c){return l==null?void 0:l[c]}function Ie(l){var c=!1;if(l!=null&&typeof l.toString!="function")try{c=!!(l+"")}catch(f){}return c}function ys(l){var c=-1,f=Array(l.size);return l.forEach(function(y,I){f[++c]=[I,y]}),f}function Re(l,c){return function(f){return l(c(f))}}function vs(l){var c=-1,f=Array(l.size);return l.forEach(function(y){f[++c]=y}),f}var an=Array.prototype,cn=Function.prototype,ae=Object.prototype,Be=ht["__core-js_shared__"],Es=function(){var l=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Ns=cn.toString,Nt=ae.hasOwnProperty,ce=ae.toString,un=RegExp("^"+Ns.call(Nt).replace(tn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yt=gs?ht.Buffer:void 0,ue=ht.Symbol,Me=ht.Uint8Array,lt=Re(Object.getPrototypeOf,Object),As=Object.create,ws=ae.propertyIsEnumerable,hn=an.splice,De=Object.getOwnPropertySymbols,he=Yt?Yt.isBuffer:void 0,xs=Re(Object.keys,Object),fe=gt(ht,"DataView"),Qt=gt(ht,"Map"),dt=gt(ht,"Promise"),de=gt(ht,"Set"),Ue=gt(ht,"WeakMap"),Jt=gt(Object,"create"),Pe=Q(fe),te=Q(Qt),je=Q(dt),He=Q(de),Fe=Q(Ue),Ut=ue?ue.prototype:void 0,Ts=Ut?Ut.valueOf:void 0;function kt(l){var c=-1,f=l?l.length:0;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function fn(){this.__data__=Jt?Jt(null):{}}function dn(l){return this.has(l)&&delete this.__data__[l]}function gn(l){var c=this.__data__;if(Jt){var f=c[l];return f===s?void 0:f}return Nt.call(c,l)?c[l]:void 0}function Ls(l){var c=this.__data__;return Jt?c[l]!==void 0:Nt.call(c,l)}function $e(l,c){var f=this.__data__;return f[l]=Jt&&c===void 0?s:c,this}kt.prototype.clear=fn,kt.prototype.delete=dn,kt.prototype.get=gn,kt.prototype.has=Ls,kt.prototype.set=$e;function z(l){var c=-1,f=l?l.length:0;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function pn(){this.__data__=[]}function mn(l){var c=this.__data__,f=pe(c,l);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():hn.call(c,f,1),!0}function bn(l){var c=this.__data__,f=pe(c,l);return f<0?void 0:c[f][1]}function yn(l){return pe(this.__data__,l)>-1}function vn(l,c){var f=this.__data__,y=pe(f,l);return y<0?f.push([l,c]):f[y][1]=c,this}z.prototype.clear=pn,z.prototype.delete=mn,z.prototype.get=bn,z.prototype.has=yn,z.prototype.set=vn;function G(l){var c=-1,f=l?l.length:0;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function En(){this.__data__={hash:new kt,map:new(Qt||z),string:new kt}}function Nn(l){return se(this,l).delete(l)}function An(l){return se(this,l).get(l)}function wn(l){return se(this,l).has(l)}function xn(l,c){return se(this,l).set(l,c),this}G.prototype.clear=En,G.prototype.delete=Nn,G.prototype.get=An,G.prototype.has=wn,G.prototype.set=xn;function et(l){this.__data__=new z(l)}function Tn(){this.__data__=new z}function Ln(l){return this.__data__.delete(l)}function qn(l){return this.__data__.get(l)}function Sn(l){return this.__data__.has(l)}function kn(l,c){var f=this.__data__;if(f instanceof z){var y=f.__data__;if(!Qt||y.length<e-1)return y.push([l,c]),this;f=this.__data__=new G(y)}return f.set(l,c),this}et.prototype.clear=Tn,et.prototype.delete=Ln,et.prototype.get=qn,et.prototype.has=Sn,et.prototype.set=kn;function ge(l,c){var f=Ge(l)||be(l)?_e(l.length,String):[],y=f.length,I=!!y;for(var O in l)(c||Nt.call(l,O))&&!(I&&(O=="length"||$n(O,y)))&&f.push(O);return f}function qs(l,c,f){var y=l[c];(!(Nt.call(l,c)&&_s(y,f))||f===void 0&&!(c in l))&&(l[c]=f)}function pe(l,c){for(var f=l.length;f--;)if(_s(l[f][0],c))return f;return-1}function At(l,c){return l&&Ke(c,We(c),l)}function ze(l,c,f,y,I,O,R){var M;if(y&&(M=O?y(l,I,O,R):y(l)),M!==void 0)return M;if(!xt(l))return l;var H=Ge(l);if(H){if(M=Hn(l),!c)return Un(l,M)}else{var D=Ot(l),Z=D==g||D==b;if(Is(l))return me(l,c);if(D==m||D==i||Z&&!O){if(Ie(l))return O?l:{};if(M=wt(Z?{}:l),!c)return Pn(l,At(M,l))}else{if(!U[D])return O?l:{};M=Fn(l,D,ze,c)}}R||(R=new et);var st=R.get(l);if(st)return st;if(R.set(l,M),!H)var F=f?jn(l):We(l);return ps(F||l,function(W,V){F&&(V=W,W=l[V]),qs(M,V,ze(W,c,f,y,V,l,R))}),M}function Cn(l){return xt(l)?As(l):{}}function On(l,c,f){var y=c(l);return Ge(l)?y:ms(y,f(l))}function _n(l){return ce.call(l)}function In(l){if(!xt(l)||Vn(l))return!1;var c=Ze(l)||Ie(l)?un:sn;return c.test(Q(l))}function Rn(l){if(!Cs(l))return xs(l);var c=[];for(var f in Object(l))Nt.call(l,f)&&f!="constructor"&&c.push(f);return c}function me(l,c){if(c)return l.slice();var f=new l.constructor(l.length);return l.copy(f),f}function Ve(l){var c=new l.constructor(l.byteLength);return new Me(c).set(new Me(l)),c}function ee(l,c){var f=c?Ve(l.buffer):l.buffer;return new l.constructor(f,l.byteOffset,l.byteLength)}function Ss(l,c,f){var y=c?f(ys(l),!0):ys(l);return Oe(y,on,new l.constructor)}function ks(l){var c=new l.constructor(l.source,en.exec(l));return c.lastIndex=l.lastIndex,c}function Bn(l,c,f){var y=c?f(vs(l),!0):vs(l);return Oe(y,ft,new l.constructor)}function Mn(l){return Ts?Object(Ts.call(l)):{}}function Dn(l,c){var f=c?Ve(l.buffer):l.buffer;return new l.constructor(f,l.byteOffset,l.length)}function Un(l,c){var f=-1,y=l.length;for(c||(c=Array(y));++f<y;)c[f]=l[f];return c}function Ke(l,c,f,y){f||(f={});for(var I=-1,O=c.length;++I<O;){var R=c[I],M=y?y(f[R],l[R],R,f,l):void 0;qs(f,R,M===void 0?l[R]:M)}return f}function Pn(l,c){return Ke(l,Ct(l),c)}function jn(l){return On(l,We,Ct)}function se(l,c){var f=l.__data__;return zn(c)?f[typeof c=="string"?"string":"hash"]:f.map}function gt(l,c){var f=bs(l,c);return In(f)?f:void 0}var Ct=De?Re(De,Object):Gn,Ot=_n;(fe&&Ot(new fe(new ArrayBuffer(1)))!=_||Qt&&Ot(new Qt)!=d||dt&&Ot(dt.resolve())!=N||de&&Ot(new de)!=E||Ue&&Ot(new Ue)!=C)&&(Ot=function(l){var c=ce.call(l),f=c==m?l.constructor:void 0,y=f?Q(f):void 0;if(y)switch(y){case Pe:return _;case te:return d;case je:return N;case He:return E;case Fe:return C}return c});function Hn(l){var c=l.length,f=l.constructor(c);return c&&typeof l[0]=="string"&&Nt.call(l,"index")&&(f.index=l.index,f.input=l.input),f}function wt(l){return typeof l.constructor=="function"&&!Cs(l)?Cn(lt(l)):{}}function Fn(l,c,f,y){var I=l.constructor;switch(c){case q:return Ve(l);case a:case u:return new I(+l);case _:return ee(l,y);case B:case j:case St:case Dt:case Wt:case Xt:case us:case hs:case fs:return Dn(l,y);case d:return Ss(l,y,f);case p:case w:return new I(l);case A:return ks(l);case E:return Bn(l,y,f);case x:return Mn(l)}}function $n(l,c){return c=c==null?n:c,!!c&&(typeof l=="number"||nn.test(l))&&l>-1&&l%1==0&&l<c}function zn(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function Vn(l){return!!Es&&Es in l}function Cs(l){var c=l&&l.constructor,f=typeof c=="function"&&c.prototype||ae;return l===f}function Q(l){if(l!=null){try{return Ns.call(l)}catch(c){}try{return l+""}catch(c){}}return""}function Os(l){return ze(l,!0,!0)}function _s(l,c){return l===c||l!==l&&c!==c}function be(l){return Kn(l)&&Nt.call(l,"callee")&&(!ws.call(l,"callee")||ce.call(l)==i)}var Ge=Array.isArray;function ye(l){return l!=null&&Rs(l.length)&&!Ze(l)}function Kn(l){return Bs(l)&&ye(l)}var Is=he||Zn;function Ze(l){var c=xt(l)?ce.call(l):"";return c==g||c==b}function Rs(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=n}function xt(l){var c=typeof l;return!!l&&(c=="object"||c=="function")}function Bs(l){return!!l&&typeof l=="object"}function We(l){return ye(l)?ge(l):Rn(l)}function Gn(){return[]}function Zn(){return!1}r.exports=Os})(_l,es);var ss={},Il={get exports(){return ss},set exports(r){ss=r}};(function(r,t){var e=200,s="__lodash_hash_undefined__",n=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",g="[object Boolean]",b="[object Date]",d="[object Error]",p="[object Function]",m="[object GeneratorFunction]",N="[object Map]",A="[object Number]",E="[object Null]",w="[object Object]",x="[object Promise]",C="[object Proxy]",q="[object RegExp]",_="[object Set]",B="[object String]",j="[object Symbol]",St="[object Undefined]",Dt="[object WeakMap]",Wt="[object ArrayBuffer]",Xt="[object DataView]",us="[object Float32Array]",hs="[object Float64Array]",fs="[object Int8Array]",tn="[object Int16Array]",en="[object Int32Array]",sn="[object Uint8Array]",nn="[object Uint8ClampedArray]",U="[object Uint16Array]",rn="[object Uint32Array]",ln=/[\\^$.*+?()[\]{}|]/g,ht=/^\[object .+?Constructor\]$/,ds=/^(?:0|[1-9]\d*)$/,P={};P[us]=P[hs]=P[fs]=P[tn]=P[en]=P[sn]=P[nn]=P[U]=P[rn]=!0,P[a]=P[u]=P[Wt]=P[g]=P[Xt]=P[b]=P[d]=P[p]=P[N]=P[A]=P[w]=P[q]=P[_]=P[B]=P[Dt]=!1;var gs=typeof $t=="object"&&$t&&$t.Object===Object&&$t,on=typeof self=="object"&&self&&self.Object===Object&&self,ft=gs||on||Function("return this")(),ps=t&&!t.nodeType&&t,ms=ps&&!0&&r&&!r.nodeType&&r,Oe=ms&&ms.exports===ps,_e=Oe&&gs.process,bs=function(){try{return _e&&_e.binding&&_e.binding("util")}catch(l){}}(),Ie=bs&&bs.isTypedArray;function ys(l,c){for(var f=-1,y=l==null?0:l.length,I=0,O=[];++f<y;){var R=l[f];c(R,f,l)&&(O[I++]=R)}return O}function Re(l,c){for(var f=-1,y=c.length,I=l.length;++f<y;)l[I+f]=c[f];return l}function vs(l,c){for(var f=-1,y=l==null?0:l.length;++f<y;)if(c(l[f],f,l))return!0;return!1}function an(l,c){for(var f=-1,y=Array(l);++f<l;)y[f]=c(f);return y}function cn(l){return function(c){return l(c)}}function ae(l,c){return l.has(c)}function Be(l,c){return l==null?void 0:l[c]}function Es(l){var c=-1,f=Array(l.size);return l.forEach(function(y,I){f[++c]=[I,y]}),f}function Ns(l,c){return function(f){return l(c(f))}}function Nt(l){var c=-1,f=Array(l.size);return l.forEach(function(y){f[++c]=y}),f}var ce=Array.prototype,un=Function.prototype,Yt=Object.prototype,ue=ft["__core-js_shared__"],Me=un.toString,lt=Yt.hasOwnProperty,As=function(){var l=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),ws=Yt.toString,hn=RegExp("^"+Me.call(lt).replace(ln,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=Oe?ft.Buffer:void 0,he=ft.Symbol,xs=ft.Uint8Array,fe=Yt.propertyIsEnumerable,Qt=ce.splice,dt=he?he.toStringTag:void 0,de=Object.getOwnPropertySymbols,Ue=De?De.isBuffer:void 0,Jt=Ns(Object.keys,Object),Pe=Ct(ft,"DataView"),te=Ct(ft,"Map"),je=Ct(ft,"Promise"),He=Ct(ft,"Set"),Fe=Ct(ft,"WeakMap"),Ut=Ct(Object,"create"),Ts=Q(Pe),kt=Q(te),fn=Q(je),dn=Q(He),gn=Q(Fe),Ls=he?he.prototype:void 0,$e=Ls?Ls.valueOf:void 0;function z(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function pn(){this.__data__=Ut?Ut(null):{},this.size=0}function mn(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}function bn(l){var c=this.__data__;if(Ut){var f=c[l];return f===s?void 0:f}return lt.call(c,l)?c[l]:void 0}function yn(l){var c=this.__data__;return Ut?c[l]!==void 0:lt.call(c,l)}function vn(l,c){var f=this.__data__;return this.size+=this.has(l)?0:1,f[l]=Ut&&c===void 0?s:c,this}z.prototype.clear=pn,z.prototype.delete=mn,z.prototype.get=bn,z.prototype.has=yn,z.prototype.set=vn;function G(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function En(){this.__data__=[],this.size=0}function Nn(l){var c=this.__data__,f=me(c,l);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():Qt.call(c,f,1),--this.size,!0}function An(l){var c=this.__data__,f=me(c,l);return f<0?void 0:c[f][1]}function wn(l){return me(this.__data__,l)>-1}function xn(l,c){var f=this.__data__,y=me(f,l);return y<0?(++this.size,f.push([l,c])):f[y][1]=c,this}G.prototype.clear=En,G.prototype.delete=Nn,G.prototype.get=An,G.prototype.has=wn,G.prototype.set=xn;function et(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c<f;){var y=l[c];this.set(y[0],y[1])}}function Tn(){this.size=0,this.__data__={hash:new z,map:new(te||G),string:new z}}function Ln(l){var c=gt(this,l).delete(l);return this.size-=c?1:0,c}function qn(l){return gt(this,l).get(l)}function Sn(l){return gt(this,l).has(l)}function kn(l,c){var f=gt(this,l),y=f.size;return f.set(l,c),this.size+=f.size==y?0:1,this}et.prototype.clear=Tn,et.prototype.delete=Ln,et.prototype.get=qn,et.prototype.has=Sn,et.prototype.set=kn;function ge(l){var c=-1,f=l==null?0:l.length;for(this.__data__=new et;++c<f;)this.add(l[c])}function qs(l){return this.__data__.set(l,s),this}function pe(l){return this.__data__.has(l)}ge.prototype.add=ge.prototype.push=qs,ge.prototype.has=pe;function At(l){var c=this.__data__=new G(l);this.size=c.size}function ze(){this.__data__=new G,this.size=0}function Cn(l){var c=this.__data__,f=c.delete(l);return this.size=c.size,f}function On(l){return this.__data__.get(l)}function _n(l){return this.__data__.has(l)}function In(l,c){var f=this.__data__;if(f instanceof G){var y=f.__data__;if(!te||y.length<e-1)return y.push([l,c]),this.size=++f.size,this;f=this.__data__=new et(y)}return f.set(l,c),this.size=f.size,this}At.prototype.clear=ze,At.prototype.delete=Cn,At.prototype.get=On,At.prototype.has=_n,At.prototype.set=In;function Rn(l,c){var f=be(l),y=!f&&_s(l),I=!f&&!y&&ye(l),O=!f&&!y&&!I&&Bs(l),R=f||y||I||O,M=R?an(l.length,String):[],H=M.length;for(var D in l)(c||lt.call(l,D))&&!(R&&(D=="length"||I&&(D=="offset"||D=="parent")||O&&(D=="buffer"||D=="byteLength"||D=="byteOffset")||Fn(D,H)))&&M.push(D);return M}function me(l,c){for(var f=l.length;f--;)if(Os(l[f][0],c))return f;return-1}function Ve(l,c,f){var y=c(l);return be(l)?y:Re(y,f(l))}function ee(l){return l==null?l===void 0?St:E:dt&&dt in Object(l)?Ot(l):Cs(l)}function Ss(l){return xt(l)&&ee(l)==a}function ks(l,c,f,y,I){return l===c?!0:l==null||c==null||!xt(l)&&!xt(c)?l!==l&&c!==c:Bn(l,c,f,y,ks,I)}function Bn(l,c,f,y,I,O){var R=be(l),M=be(c),H=R?u:wt(l),D=M?u:wt(c);H=H==a?w:H,D=D==a?w:D;var Z=H==w,st=D==w,F=H==D;if(F&&ye(l)){if(!ye(c))return!1;R=!0,Z=!1}if(F&&!Z)return O||(O=new At),R||Bs(l)?Ke(l,c,f,y,I,O):Pn(l,c,H,f,y,I,O);if(!(f&n)){var W=Z&<.call(l,"__wrapped__"),V=st&<.call(c,"__wrapped__");if(W||V){var Pt=W?l.value():l,_t=V?c.value():c;return O||(O=new At),I(Pt,_t,f,y,O)}}return F?(O||(O=new At),jn(l,c,f,y,I,O)):!1}function Mn(l){if(!Rs(l)||zn(l))return!1;var c=Is(l)?hn:ht;return c.test(Q(l))}function Dn(l){return xt(l)&&Ze(l.length)&&!!P[ee(l)]}function Un(l){if(!Vn(l))return Jt(l);var c=[];for(var f in Object(l))lt.call(l,f)&&f!="constructor"&&c.push(f);return c}function Ke(l,c,f,y,I,O){var R=f&n,M=l.length,H=c.length;if(M!=H&&!(R&&H>M))return!1;var D=O.get(l);if(D&&O.get(c))return D==c;var Z=-1,st=!0,F=f&i?new ge:void 0;for(O.set(l,c),O.set(c,l);++Z<M;){var W=l[Z],V=c[Z];if(y)var Pt=R?y(V,W,Z,c,l,O):y(W,V,Z,l,c,O);if(Pt!==void 0){if(Pt)continue;st=!1;break}if(F){if(!vs(c,function(_t,ne){if(!ae(F,ne)&&(W===_t||I(W,_t,f,y,O)))return F.push(ne)})){st=!1;break}}else if(!(W===V||I(W,V,f,y,O))){st=!1;break}}return O.delete(l),O.delete(c),st}function Pn(l,c,f,y,I,O,R){switch(f){case Xt:if(l.byteLength!=c.byteLength||l.byteOffset!=c.byteOffset)return!1;l=l.buffer,c=c.buffer;case Wt:return!(l.byteLength!=c.byteLength||!O(new xs(l),new xs(c)));case g:case b:case A:return Os(+l,+c);case d:return l.name==c.name&&l.message==c.message;case q:case B:return l==c+"";case N:var M=Es;case _:var H=y&n;if(M||(M=Nt),l.size!=c.size&&!H)return!1;var D=R.get(l);if(D)return D==c;y|=i,R.set(l,c);var Z=Ke(M(l),M(c),y,I,O,R);return R.delete(l),Z;case j:if($e)return $e.call(l)==$e.call(c)}return!1}function jn(l,c,f,y,I,O){var R=f&n,M=se(l),H=M.length,D=se(c),Z=D.length;if(H!=Z&&!R)return!1;for(var st=H;st--;){var F=M[st];if(!(R?F in c:lt.call(c,F)))return!1}var W=O.get(l);if(W&&O.get(c))return W==c;var V=!0;O.set(l,c),O.set(c,l);for(var Pt=R;++st<H;){F=M[st];var _t=l[F],ne=c[F];if(y)var Fr=R?y(ne,_t,F,c,l,O):y(_t,ne,F,l,c,O);if(!(Fr===void 0?_t===ne||I(_t,ne,f,y,O):Fr)){V=!1;break}Pt||(Pt=F=="constructor")}if(V&&!Pt){var Ms=l.constructor,Ds=c.constructor;Ms!=Ds&&"constructor"in l&&"constructor"in c&&!(typeof Ms=="function"&&Ms instanceof Ms&&typeof Ds=="function"&&Ds instanceof Ds)&&(V=!1)}return O.delete(l),O.delete(c),V}function se(l){return Ve(l,We,Hn)}function gt(l,c){var f=l.__data__;return $n(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Ct(l,c){var f=Be(l,c);return Mn(f)?f:void 0}function Ot(l){var c=lt.call(l,dt),f=l[dt];try{l[dt]=void 0;var y=!0}catch(O){}var I=ws.call(l);return y&&(c?l[dt]=f:delete l[dt]),I}var Hn=de?function(l){return l==null?[]:(l=Object(l),ys(de(l),function(c){return fe.call(l,c)}))}:Gn,wt=ee;(Pe&&wt(new Pe(new ArrayBuffer(1)))!=Xt||te&&wt(new te)!=N||je&&wt(je.resolve())!=x||He&&wt(new He)!=_||Fe&&wt(new Fe)!=Dt)&&(wt=function(l){var c=ee(l),f=c==w?l.constructor:void 0,y=f?Q(f):"";if(y)switch(y){case Ts:return Xt;case kt:return N;case fn:return x;case dn:return _;case gn:return Dt}return c});function Fn(l,c){return c=c==null?o:c,!!c&&(typeof l=="number"||ds.test(l))&&l>-1&&l%1==0&&l<c}function $n(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function zn(l){return!!As&&As in l}function Vn(l){var c=l&&l.constructor,f=typeof c=="function"&&c.prototype||Yt;return l===f}function Cs(l){return ws.call(l)}function Q(l){if(l!=null){try{return Me.call(l)}catch(c){}try{return l+""}catch(c){}}return""}function Os(l,c){return l===c||l!==l&&c!==c}var _s=Ss(function(){return arguments}())?Ss:function(l){return xt(l)&<.call(l,"callee")&&!fe.call(l,"callee")},be=Array.isArray;function Ge(l){return l!=null&&Ze(l.length)&&!Is(l)}var ye=Ue||Zn;function Kn(l,c){return ks(l,c)}function Is(l){if(!Rs(l))return!1;var c=ee(l);return c==p||c==m||c==h||c==C}function Ze(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function Rs(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}function xt(l){return l!=null&&typeof l=="object"}var Bs=Ie?cn(Ie):Dn;function We(l){return Ge(l)?Rn(l):Un(l)}function Gn(){return[]}function Zn(){return!1}r.exports=Kn})(Il,ss);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});const Rl=es,Bl=ss;var cr;(function(r){function t(i={},o={},a=!1){typeof i!="object"&&(i={}),typeof o!="object"&&(o={});let u=Rl(o);a||(u=Object.keys(u).reduce((h,g)=>(u[g]!=null&&(h[g]=u[g]),h),{}));for(const h in i)i[h]!==void 0&&o[h]===void 0&&(u[h]=i[h]);return Object.keys(u).length>0?u:void 0}r.compose=t;function e(i={},o={}){typeof i!="object"&&(i={}),typeof o!="object"&&(o={});const a=Object.keys(i).concat(Object.keys(o)).reduce((u,h)=>(Bl(i[h],o[h])||(u[h]=o[h]===void 0?null:o[h]),u),{});return Object.keys(a).length>0?a:void 0}r.diff=e;function s(i={},o={}){i=i||{};const a=Object.keys(o).reduce((u,h)=>(o[h]!==i[h]&&i[h]!==void 0&&(u[h]=o[h]),u),{});return Object.keys(i).reduce((u,h)=>(i[h]!==o[h]&&o[h]===void 0&&(u[h]=null),u),a)}r.invert=s;function n(i,o,a=!1){if(typeof i!="object")return o;if(typeof o!="object")return;if(!a)return o;const u=Object.keys(o).reduce((h,g)=>(i[g]===void 0&&(h[g]=o[g]),h),{});return Object.keys(u).length>0?u:void 0}r.transform=n})(cr||(cr={}));Sr.default=cr;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});var ur;(function(r){function t(e){return typeof e.delete=="number"?e.delete:typeof e.retain=="number"?e.retain:typeof e.retain=="object"&&e.retain!==null?1:typeof e.insert=="string"?e.insert.length:1}r.length=t})(ur||(ur={}));Xs.default=ur;var kr={};Object.defineProperty(kr,"__esModule",{value:!0});const Xr=Xs;class Ml{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(t){t||(t=1/0);const e=this.ops[this.index];if(e){const s=this.offset,n=Xr.default.length(e);if(t>=n-s?(t=n-s,this.index+=1,this.offset=0):this.offset+=t,typeof e.delete=="number")return{delete:t};{const i={};return e.attributes&&(i.attributes=e.attributes),typeof e.retain=="number"?i.retain=t:typeof e.retain=="object"&&e.retain!==null?i.retain=e.retain:typeof e.insert=="string"?i.insert=e.insert.substr(s,t):i.insert=e.insert,i}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Xr.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?typeof t.delete=="number"?"delete":typeof t.retain=="number"||typeof t.retain=="object"&&t.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const t=this.offset,e=this.index,s=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[s].concat(n)}}else return[]}}kr.default=Ml;(function(r,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Ol,s=es,n=ss,i=Sr;t.AttributeMap=i.default;const o=Xs;t.Op=o.default;const a=kr;t.OpIterator=a.default;const u=String.fromCharCode(0),h=(b,d)=>{if(typeof b!="object"||b===null)throw new Error(`cannot retain a ${typeof b}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const p=Object.keys(b)[0];if(!p||p!==Object.keys(d)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(d)[0]}`);return[p,b[p],d[p]]};class g{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,p){this.handlers[d]=p}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const p=this.handlers[d];if(!p)throw new Error(`no handlers for embed type "${d}"`);return p}insert(d,p){const m={};return typeof d=="string"&&d.length===0?this:(m.insert=d,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,p){if(typeof d=="number"&&d<=0)return this;const m={retain:d};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m)}push(d){let p=this.ops.length,m=this.ops[p-1];if(d=s(d),typeof m=="object"){if(typeof d.delete=="number"&&typeof m.delete=="number")return this.ops[p-1]={delete:m.delete+d.delete},this;if(typeof m.delete=="number"&&d.insert!=null&&(p-=1,m=this.ops[p-1],typeof m!="object"))return this.ops.unshift(d),this;if(n(d.attributes,m.attributes)){if(typeof d.insert=="string"&&typeof m.insert=="string")return this.ops[p-1]={insert:m.insert+d.insert},typeof d.attributes=="object"&&(this.ops[p-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof m.retain=="number")return this.ops[p-1]={retain:m.retain+d.retain},typeof d.attributes=="object"&&(this.ops[p-1].attributes=d.attributes),this}}return p===this.ops.length?this.ops.push(d):this.ops.splice(p,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const p=[],m=[];return this.forEach(N=>{(d(N)?p:m).push(N)}),[p,m]}reduce(d,p){return this.ops.reduce(d,p)}changeLength(){return this.reduce((d,p)=>p.insert?d+o.default.length(p):p.delete?d-p.delete:d,0)}length(){return this.reduce((d,p)=>d+o.default.length(p),0)}slice(d=0,p=1/0){const m=[],N=new a.default(this.ops);let A=0;for(;A<p&&N.hasNext();){let E;A<d?E=N.next(d-A):(E=N.next(p-A),m.push(E)),A+=o.default.length(E)}return new g(m)}compose(d){const p=new a.default(this.ops),m=new a.default(d.ops),N=[],A=m.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let w=A.retain;for(;p.peekType()==="insert"&&p.peekLength()<=w;)w-=p.peekLength(),N.push(p.next());A.retain-w>0&&m.next(A.retain-w)}const E=new g(N);for(;p.hasNext()||m.hasNext();)if(m.peekType()==="insert")E.push(m.next());else if(p.peekType()==="delete")E.push(p.next());else{const w=Math.min(p.peekLength(),m.peekLength()),x=p.next(w),C=m.next(w);if(C.retain){const q={};if(typeof x.retain=="number")q.retain=typeof C.retain=="number"?w:C.retain;else if(typeof C.retain=="number")x.retain==null?q.insert=x.insert:q.retain=x.retain;else{const B=x.retain==null?"insert":"retain",[j,St,Dt]=h(x[B],C.retain),Wt=g.getHandler(j);q[B]={[j]:Wt.compose(St,Dt,B==="retain")}}const _=i.default.compose(x.attributes,C.attributes,typeof x.retain=="number");if(_&&(q.attributes=_),E.push(q),!m.hasNext()&&n(E.ops[E.ops.length-1],q)){const B=new g(p.rest());return E.concat(B).chop()}}else typeof C.delete=="number"&&(typeof x.retain=="number"||typeof x.retain=="object"&&x.retain!==null)&&E.push(C)}return E.chop()}concat(d){const p=new g(this.ops.slice());return d.ops.length>0&&(p.push(d.ops[0]),p.ops=p.ops.concat(d.ops.slice(1))),p}diff(d,p){if(this.ops===d.ops)return new g;const m=[this,d].map(x=>x.map(C=>{if(C.insert!=null)return typeof C.insert=="string"?C.insert:u;const q=x===d?"on":"with";throw new Error("diff() called "+q+" non-document")}).join("")),N=new g,A=e(m[0],m[1],p,!0),E=new a.default(this.ops),w=new a.default(d.ops);return A.forEach(x=>{let C=x[1].length;for(;C>0;){let q=0;switch(x[0]){case e.INSERT:q=Math.min(w.peekLength(),C),N.push(w.next(q));break;case e.DELETE:q=Math.min(C,E.peekLength()),E.next(q),N.delete(q);break;case e.EQUAL:q=Math.min(E.peekLength(),w.peekLength(),C);const _=E.next(q),B=w.next(q);n(_.insert,B.insert)?N.retain(q,i.default.diff(_.attributes,B.attributes)):N.push(B).delete(q);break}C-=q}}),N.chop()}eachLine(d,p=`
`){const m=new a.default(this.ops);let N=new g,A=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const E=m.peek(),w=o.default.length(E)-m.peekLength(),x=typeof E.insert=="string"?E.insert.indexOf(p,w)-w:-1;if(x<0)N.push(m.next());else if(x>0)N.push(m.next(x));else{if(d(N,m.next(1).attributes||{},A)===!1)return;A+=1,N=new g}}N.length()>0&&d(N,{},A)}invert(d){const p=new g;return this.reduce((m,N)=>{if(N.insert)p.delete(o.default.length(N));else{if(typeof N.retain=="number"&&N.attributes==null)return p.retain(N.retain),m+N.retain;if(N.delete||typeof N.retain=="number"){const A=N.delete||N.retain;return d.slice(m,m+A).forEach(w=>{N.delete?p.push(w):N.retain&&N.attributes&&p.retain(o.default.length(w),i.default.invert(N.attributes,w.attributes))}),m+A}else if(typeof N.retain=="object"&&N.retain!==null){const A=d.slice(m,m+1),E=new a.default(A.ops).next(),[w,x,C]=h(N.retain,E.insert),q=g.getHandler(w);return p.retain({[w]:q.invert(x,C)},i.default.invert(N.attributes,E.attributes)),m+1}}return m},0),p.chop()}transform(d,p=!1){if(p=!!p,typeof d=="number")return this.transformPosition(d,p);const m=d,N=new a.default(this.ops),A=new a.default(m.ops),E=new g;for(;N.hasNext()||A.hasNext();)if(N.peekType()==="insert"&&(p||A.peekType()!=="insert"))E.retain(o.default.length(N.next()));else if(A.peekType()==="insert")E.push(A.next());else{const w=Math.min(N.peekLength(),A.peekLength()),x=N.next(w),C=A.next(w);if(x.delete)continue;if(C.delete)E.push(C);else{const q=x.retain,_=C.retain;let B=typeof _=="object"&&_!==null?_:w;if(typeof q=="object"&&q!==null&&typeof _=="object"&&_!==null){const j=Object.keys(q)[0];if(j===Object.keys(_)[0]){const St=g.getHandler(j);St&&(B={[j]:St.transform(q[j],_[j],p)})}}E.retain(B,i.default.transform(x.attributes,C.attributes,p))}}return E.chop()}transformPosition(d,p=!1){p=!!p;const m=new a.default(this.ops);let N=0;for(;m.hasNext()&&N<=d;){const A=m.peekLength(),E=m.peekType();if(m.next(),E==="delete"){d-=Math.min(A,d-N);continue}else E==="insert"&&(N<d||!p)&&(d+=A);N+=A}return d}}g.Op=o.default,g.OpIterator=a.default,g.AttributeMap=i.default,g.handlers={},t.default=g,r.exports=g,r.exports.default=g})(Nl,J);const S=rl(J);class vt extends it{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}vt.blotName="break";vt.tagName="BR";let bt=class extends Vs{};function Ys(r){return r.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}const Ht=class extends xr{static compare(t,e){const s=Ht.order.indexOf(t),n=Ht.order.indexOf(e);return s>=0||n>=0?s-n:t===e?0:t<e?-1:1}formatAt(t,e,s,n){if(Ht.compare(this.statics.blotName,s)<0&&this.scroll.query(s,k.BLOT)){const i=this.isolate(t,e);n&&i.wrap(s,n)}else super.formatAt(t,e,s,n)}optimize(t){if(super.optimize(t),this.parent instanceof Ht&&Ht.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};let ut=Ht;T(ut,"allowedChildren",[Ht,vt,it,bt]),T(ut,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);const Yr=1;class K extends Je{constructor(){super(...arguments);T(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=ki(this)),this.cache.delta}deleteAt(e,s){super.deleteAt(e,s),this.cache={}}formatAt(e,s,n,i){s<=0||(this.scroll.query(n,k.BLOCK)?e+s===this.length()&&this.format(n,i):super.formatAt(e,Math.min(s,this.length()-e-1),n,i),this.cache={})}insertAt(e,s,n){if(n!=null){super.insertAt(e,s,n),this.cache={};return}if(s.length===0)return;const i=s.split(`
`),o=i.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((u,h)=>(a=a.split(u,!0),a.insertAt(0,h),h.length),e+o.length)}insertBefore(e,s){const{head:n}=this.children;super.insertBefore(e,s),n instanceof vt&&n.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Yr),this.cache.length}moveChildren(e,s){super.moveChildren(e,s),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(s&&(e===0||e>=this.length()-Yr)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const n=super.split(e,s);return this.cache={},n}}K.blotName="block";K.tagName="P";K.defaultChild=vt;K.allowedChildren=[vt,ut,it,bt];class ct extends it{attach(){super.attach(),this.attributes=new Ks(this.domNode)}delta(){return new S().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const s=this.scroll.query(t,k.BLOCK_ATTRIBUTE);s!=null&&this.attributes.attribute(s,e)}formatAt(t,e,s,n){this.format(s,n)}insertAt(t,e,s){if(s!=null){super.insertAt(t,e,s);return}const n=e.split(`
`),i=n.pop(),o=n.map(u=>{const h=this.scroll.create(K.blotName);return h.insertAt(0,u),h}),a=this.split(t);o.forEach(u=>{this.parent.insertBefore(u,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}ct.scope=k.BLOCK_BLOT;function ki(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(X).reduce((e,s)=>s.length()===0?e:e.insert(s.value(),ot(s,{},t)),new S).insert(`
`,ot(r))}function ot(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(t={...t,...r.formats()},e&&delete t["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?t:ot(r.parent,t,e)}const Ft=class extends it{static value(){}constructor(t,e,s){super(t,e),this.selection=s,this.textNode=document.createTextNode(Ft.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let s=this,n=0;for(;s!=null&&s.statics.scope!==k.BLOCK_BLOT;)n+=s.offset(s.parent),s=s.parent;s!=null&&(this.savedLength=Ft.CONTENTS.length,s.optimize(),s.formatAt(n,Ft.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof bt?this.prev:null,s=e?e.length():0,n=this.next instanceof bt?this.next:null,i=n?n.text:"",{textNode:o}=this,a=o.data.split(Ft.CONTENTS).join("");o.data=Ft.CONTENTS;let u;if(e)u=e,(a||n)&&(e.insertAt(e.length(),a+i),n&&n.remove());else if(n)u=n,n.insertAt(0,a);else{const h=document.createTextNode(a);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),t){const h=(d,p)=>e&&d===e.domNode?p:d===o?s+p-1:n&&d===n.domNode?s+a.length+p:null,g=h(t.start.node,t.start.offset),b=h(t.end.node,t.end.offset);if(g!==null&&b!==null)return{startNode:u.domNode,startOffset:g,endNode:u.domNode,endOffset:b}}return null}update(t,e){if(t.some(s=>s.type==="characterData"&&s.target===this.textNode)){const s=this.restore();s&&(e.range=s)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=Ft.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};let Tt=Ft;T(Tt,"blotName","cursor"),T(Tt,"className","ql-cursor"),T(Tt,"tagName","span"),T(Tt,"CONTENTS","\uFEFF");var hr={},Dl={get exports(){return hr},set exports(r){hr=r}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function n(u,h,g){this.fn=u,this.context=h,this.once=g||!1}function i(u,h,g,b,d){if(typeof g!="function")throw new TypeError("The listener must be a function");var p=new n(g,b||u,d),m=e?e+h:h;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],p]:u._events[m].push(p):(u._events[m]=p,u._eventsCount++),u}function o(u,h){--u._eventsCount===0?u._events=new s:delete u._events[h]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],g,b;if(this._eventsCount===0)return h;for(b in g=this._events)t.call(g,b)&&h.push(e?b.slice(1):b);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(g)):h},a.prototype.listeners=function(h){var g=e?e+h:h,b=this._events[g];if(!b)return[];if(b.fn)return[b.fn];for(var d=0,p=b.length,m=new Array(p);d<p;d++)m[d]=b[d].fn;return m},a.prototype.listenerCount=function(h){var g=e?e+h:h,b=this._events[g];return b?b.fn?1:b.length:0},a.prototype.emit=function(h,g,b,d,p,m){var N=e?e+h:h;if(!this._events[N])return!1;var A=this._events[N],E=arguments.length,w,x;if(A.fn){switch(A.once&&this.removeListener(h,A.fn,void 0,!0),E){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,g),!0;case 3:return A.fn.call(A.context,g,b),!0;case 4:return A.fn.call(A.context,g,b,d),!0;case 5:return A.fn.call(A.context,g,b,d,p),!0;case 6:return A.fn.call(A.context,g,b,d,p,m),!0}for(x=1,w=new Array(E-1);x<E;x++)w[x-1]=arguments[x];A.fn.apply(A.context,w)}else{var C=A.length,q;for(x=0;x<C;x++)switch(A[x].once&&this.removeListener(h,A[x].fn,void 0,!0),E){case 1:A[x].fn.call(A[x].context);break;case 2:A[x].fn.call(A[x].context,g);break;case 3:A[x].fn.call(A[x].context,g,b);break;case 4:A[x].fn.call(A[x].context,g,b,d);break;default:if(!w)for(q=1,w=new Array(E-1);q<E;q++)w[q-1]=arguments[q];A[x].fn.apply(A[x].context,w)}}return!0},a.prototype.on=function(h,g,b){return i(this,h,g,b,!1)},a.prototype.once=function(h,g,b){return i(this,h,g,b,!0)},a.prototype.removeListener=function(h,g,b,d){var p=e?e+h:h;if(!this._events[p])return this;if(!g)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===g&&(!d||m.once)&&(!b||m.context===b)&&o(this,p);else{for(var N=0,A=[],E=m.length;N<E;N++)(m[N].fn!==g||d&&!m[N].once||b&&m[N].context!==b)&&A.push(m[N]);A.length?this._events[p]=A.length===1?A[0]:A:o(this,p)}return this},a.prototype.removeAllListeners=function(h){var g;return h?(g=e?e+h:h,this._events[g]&&o(this,g)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,r.exports=a})(Dl);const fr=new WeakMap,dr=["error","warn","log","info"];let gr="warn";function Ci(r){if(gr&&dr.indexOf(r)<=dr.indexOf(gr)){for(var t=arguments.length,e=new Array(t>1?t-1:0),s=1;s<t;s++)e[s-1]=arguments[s];console[r](...e)}}function Mt(r){return dr.reduce((t,e)=>(t[e]=Ci.bind(console,e,r),t),{})}Mt.level=r=>{gr=r};Ci.level=Mt.level;const Yn=Mt("quill:events"),Ul=["selectionchange","mousedown","mouseup","click"];Ul.forEach(r=>{document.addEventListener(r,function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];Array.from(document.querySelectorAll(".ql-container")).forEach(n=>{const i=fr.get(n);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class L extends hr{constructor(){super(),this.domListeners={},this.on("error",Yn.error)}emit(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return Yn.log.call(Yn,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];(this.domListeners[t.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(t.target===o||o.contains(t.target))&&a(t,...s)})}listenDOM(t,e,s){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:s})}}T(L,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),T(L,"sources",{API:"api",SILENT:"silent",USER:"user"});const Qn=Mt("quill:selection");class re{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Pl{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new re(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,L.sources.USER),1)}),this.emitter.on(L.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const s=this.getNativeRange();s!=null&&s.start.node!==this.cursor.textNode&&this.emitter.once(L.events.SCROLL_UPDATE,(n,i)=>{try{this.root.contains(s.start.node)&&this.root.contains(s.end.node)&&this.setNativeRange(s.start.node,s.start.offset,s.end.node,s.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?L.sources.SILENT:n)}catch(o){}})}),this.emitter.on(L.events.SCROLL_OPTIMIZE,(s,n)=>{if(n.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=n.range;this.setNativeRange(i,o,a,u),this.update(L.sources.SILENT)}}),this.update(L.sources.SILENT)}handleComposition(){this.emitter.on(L.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(L.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(L.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const s=this.getNativeRange();if(!(s==null||!s.native.collapsed||this.scroll.query(t,k.BLOCK))){if(s.start.node!==this.cursor.textNode){const n=this.scroll.find(s.start.node,!1);if(n==null)return;if(n instanceof X){const i=n.split(s.start.offset);n.parent.insertBefore(this.cursor,i)}else n.insertBefore(this.cursor,s.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const s=this.scroll.length();t=Math.min(t,s-1),e=Math.min(t+e,s-1)-t;let n,[i,o]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&o===i.length()){const[g]=this.scroll.leaf(t+1);if(g){const[b]=this.scroll.line(t),[d]=this.scroll.line(t+1);b===d&&(i=g,o=0)}}[n,o]=i.position(o,!0);const a=document.createRange();if(e>0)return a.setStart(n,o),[i,o]=this.scroll.leaf(t+e),i==null?null:([n,o]=i.position(o,!0),a.setEnd(n,o),a.getBoundingClientRect());let u="left",h;if(n instanceof Text){if(!n.data.length)return null;o<n.data.length?(a.setStart(n,o),a.setEnd(n,o+1)):(a.setStart(n,o-1),a.setEnd(n,o),u="right"),h=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:h.top+h.height,height:h.height,left:h[u],right:h[u],top:h.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const s=this.normalizeNative(e);return Qn.info("getNativeRange",s),s}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Jn(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const s=e.map(o=>{const[a,u]=o,h=this.scroll.find(a,!0),g=h.offset(this.scroll);return u===0?g:h instanceof X?g+h.index(a,u):g+h.length()}),n=Math.min(Math.max(...s),this.scroll.length()-1),i=Math.min(n,...s);return new re(i,n-i)}normalizeNative(t){if(!Jn(this.root,t.startContainer)||!t.collapsed&&!Jn(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(s=>{let{node:n,offset:i}=s;for(;!(n instanceof Text)&&n.childNodes.length>0;)if(n.childNodes.length>i)n=n.childNodes[i],i=0;else if(n.childNodes.length===i)n=n.lastChild,n instanceof Text?i=n.data.length:n.childNodes.length>0?i=n.childNodes.length:i=n.childNodes.length+1;else break;s.node=n,s.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),s=(n,i)=>{n=Math.min(e-1,n);const[o,a]=this.scroll.leaf(n);return o?o.position(a,i):[null,-1]};return[...s(t.index,!1),...s(t.index+t.length,!0)]}setNativeRange(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Qn.info("setNativeRange",t,e,s,n),t!=null&&(this.root.parentNode==null||t.parentNode==null||s.parentNode==null))return;const o=document.getSelection();if(o!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||t!==a.startContainer||e!==a.startOffset||s!==a.endContainer||n!==a.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),s instanceof Element&&s.tagName==="BR"&&(n=Array.from(s.parentNode.childNodes).indexOf(s),s=s.parentNode);const u=document.createRange();u.setStart(t,e),u.setEnd(s,n),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:L.sources.API;if(typeof e=="string"&&(s=e,e=!1),Qn.info("setRange",t),t!=null){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(s)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L.sources.USER;const e=this.lastRange,[s,n]=this.getRange();if(this.lastRange=s,this.lastNative=n,this.lastRange!=null&&(this.savedRange=this.lastRange),!wr(e,this.lastRange)){if(!this.composing&&n!=null&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[L.events.SELECTION_CHANGE,Le(this.lastRange),Le(e),t];this.emitter.emit(L.events.EDITOR_CHANGE,...i),t!==L.sources.SILENT&&this.emitter.emit(...i)}}}function Jn(r,t){try{t.parentNode}catch(e){return!1}return r.contains(t)}const jl=/^[ -~]*$/;class Hl{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const s=Qr(t),n=new S;return $l(s.ops.slice()).reduce((o,a)=>{const u=J.Op.length(a);let h=a.attributes||{},g=!1,b=!1;if(a.insert!=null){if(n.retain(u),typeof a.insert=="string"){const m=a.insert;b=!m.endsWith(`
`)&&(e<=o||!!this.scroll.descendant(ct,o)[0]),this.scroll.insertAt(o,m);const[N,A]=this.scroll.line(o);let E=Gt({},ot(N));if(N instanceof K){const[w]=N.descendant(X,A);w&&(E=Gt(E,ot(w)))}h=J.AttributeMap.diff(E,h)||{}}else if(typeof a.insert=="object"){const m=Object.keys(a.insert)[0];if(m==null)return o;const N=this.scroll.query(m,k.INLINE)!=null;if(N)(e<=o||this.scroll.descendant(ct,o)[0])&&(b=!0);else if(o>0){const[A,E]=this.scroll.descendant(X,o-1);A instanceof bt?A.value()[E]!==`
`&&(g=!0):A instanceof it&&A.statics.scope===k.INLINE_BLOT&&(g=!0)}if(this.scroll.insertAt(o,m,a.insert[m]),N){const[A]=this.scroll.descendant(X,o);if(A){const E=Gt({},ot(A));h=J.AttributeMap.diff(E,h)||{}}}}e+=u}else if(n.push(a),a.retain!==null&&typeof a.retain=="object"){const m=Object.keys(a.retain)[0];if(m==null)return o;this.scroll.updateEmbedAt(o,m,a.retain[m])}Object.keys(h).forEach(m=>{this.scroll.formatAt(o,u,m,h[m])});const d=g?1:0,p=b?1:0;return e+=d+p,n.retain(d),n.delete(p),o+u+d+p},0),n.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+J.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new S().retain(t).delete(e))}formatLine(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(o=>{o.format(i,s[i])})}),this.scroll.optimize();const n=new S().retain(t).retain(e,Le(s));return this.update(n)}formatText(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(s).forEach(i=>{this.scroll.formatAt(t,e,i,s[i])});const n=new S().retain(t).retain(e,Le(s));return this.update(n)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new S)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=[],n=[];e===0?this.scroll.path(t).forEach(a=>{const[u]=a;u instanceof K?s.push(u):u instanceof X&&n.push(u)}):(s=this.scroll.lines(t,e),n=this.scroll.descendants(X,t,e));const[i,o]=[s,n].map(a=>{const u=a.shift();if(u==null)return{};let h=ot(u);for(;Object.keys(h).length>0;){const g=a.shift();if(g==null)return h;h=Fl(ot(g),h)}return h});return{...i,...o}}getHTML(t,e){const[s,n]=this.scroll.line(t);if(s){const i=s.length();return s.length()>=n+e&&!(n===0&&e===i)?ns(s,n,e,!0):ns(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(s=>typeof s.insert=="string").map(s=>s.insert).join("")}insertContents(t,e){const s=Qr(e),n=new S().retain(t).concat(s);return this.scroll.insertContents(t,s),this.update(n)}insertEmbed(t,e,s){return this.scroll.insertAt(t,e,s),this.update(new S().retain(t).insert({[e]:s}))}insertText(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(t,e),Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e.length,n,s[n])}),this.update(new S().retain(t).insert(e,Le(s)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((t==null?void 0:t.statics.blotName)!==K.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof vt}removeFormat(t,e){const s=this.getText(t,e),[n,i]=this.scroll.line(t+e);let o=0,a=new S;n!=null&&(o=n.length()-i,a=n.delta().slice(i,i+o-1).insert(`
`));const h=this.getContents(t,e+o).diff(new S().insert(s).concat(a)),g=new S().retain(t).concat(h);return this.applyDelta(g)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const n=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(jl)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=ot(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(Tt.CONTENTS,""),h=new S().insert(u),g=new S().insert(i.value()),b=s&&{oldRange:Jr(s.oldRange,-a),newRange:Jr(s.newRange,-a)};t=new S().retain(a).concat(h.diff(g,b)).reduce((p,m)=>m.insert?p.insert(m.insert,o):p.push(m),new S),this.delta=n.compose(t)}else this.delta=this.getDelta(),(!t||!wr(n.compose(t),this.delta))&&(t=n.diff(this.delta,s));return t}}function we(r,t,e){if(r.length===0){const[p]=tr(e.pop());return t<=0?`</li></${p}>`:`</li></${p}>${we([],t-1,e)}`}const[{child:s,offset:n,length:i,indent:o,type:a},...u]=r,[h,g]=tr(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${g}>${ns(s,n,i)}${we(u,o,e)}`:`<${h}><li>${we(r,t+1,e)}`;const b=e[e.length-1];if(o===t&&a===b)return`</li><li${g}>${ns(s,n,i)}${we(u,o,e)}`;const[d]=tr(e.pop());return`</li></${d}>${we(r,t-1,e)}`}function ns(r,t,e){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(t,e);if(r instanceof bt)return Ys(r.value().slice(t,t+e));if(r instanceof mt){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(g,b,d)=>{const p="formats"in g&&typeof g.formats=="function"?g.formats():{};h.push({child:g,offset:b,length:d,indent:p.indent||0,type:p.list})}),we(h,-1,[])}const n=[];if(r.children.forEachAt(t,e,(h,g,b)=>{n.push(ns(h,g,b))}),s||r.statics.blotName==="list")return n.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${n.join("")}<${u}`:`${a}>${n.join("")}<${u}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Fl(r,t){return Object.keys(t).reduce((e,s)=>{if(r[s]==null)return e;const n=t[s];return n===r[s]?e[s]=n:Array.isArray(n)?n.indexOf(r[s])<0?e[s]=n.concat([r[s]]):e[s]=n:e[s]=[n,r[s]],e},{})}function tr(r){const t=r==="ordered"?"ol":"ul";switch(r){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Qr(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const s=e.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return t.insert(s,e.attributes)}return t.push(e)},new S)}function Jr(r,t){let{index:e,length:s}=r;return new re(e+t,s)}function $l(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
`).forEach((n,i)=>{i&&t.push({insert:`
`,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}class Et{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}T(Et,"DEFAULTS",{});const Us="\uFEFF";class Cr extends it{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(s=>{this.contentNode.appendChild(s)}),this.leftGuard=document.createTextNode(Us),this.rightGuard=document.createTextNode(Us),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,s;const n=t.data.split(Us).join("");if(t===this.leftGuard)if(this.prev instanceof bt){const i=this.prev.length();this.prev.insertAt(i,n),e={startNode:this.prev.domNode,startOffset:i+n.length}}else s=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(s),this),e={startNode:s,startOffset:n.length};else t===this.rightGuard&&(this.next instanceof bt?(this.next.insertAt(0,n),e={startNode:this.next.domNode,startOffset:n.length}):(s=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(s),this.next),e={startNode:s,startOffset:n.length}));return t.data=Us,e}update(t,e){t.forEach(s=>{if(s.type==="characterData"&&(s.target===this.leftGuard||s.target===this.rightGuard)){const n=this.restore(s.target);n&&(e.range=n)}})}}class zl{constructor(t,e){T(this,"isComposing",!1);this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof Cr)&&(this.emitter.emit(L.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(L.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(L.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(L.events.COMPOSITION_END,t),this.isComposing=!1}}const jr=class{constructor(t,e){T(this,"modules",{});this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}};let zt=jr;T(zt,"DEFAULTS",{modules:{}}),T(zt,"themes",{default:jr});const Vl=r=>r.parentElement||r.getRootNode().host||null,Kl=r=>{const t=r.getBoundingClientRect(),e="offsetWidth"in r&&Math.abs(t.width)/r.offsetWidth||1,s="offsetHeight"in r&&Math.abs(t.height)/r.offsetHeight||1;return{top:t.top,right:t.left+r.clientWidth*e,bottom:t.top+r.clientHeight*s,left:t.left}},Ps=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},ti=(r,t,e,s,n,i)=>r<e&&t>s?0:r<e?-(e-r+n):t>s?t-r>s-e?r+n-e:t-s+i:0,Gl=(r,t)=>{var i,o,a,u,h;const e=r.ownerDocument;let s=t,n=r;for(;n;){const g=n===e.body,b=g?{top:0,right:(o=(i=window.visualViewport)==null?void 0:i.width)!=null?o:e.documentElement.clientWidth,bottom:(u=(a=window.visualViewport)==null?void 0:a.height)!=null?u:e.documentElement.clientHeight,left:0}:Kl(n),d=getComputedStyle(n),p=ti(s.left,s.right,b.left,b.right,Ps(d.scrollPaddingLeft),Ps(d.scrollPaddingRight)),m=ti(s.top,s.bottom,b.top,b.bottom,Ps(d.scrollPaddingTop),Ps(d.scrollPaddingBottom));if(p||m)if(g)(h=e.defaultView)==null||h.scrollBy(p,m);else{const{scrollLeft:N,scrollTop:A}=n;m&&(n.scrollTop+=m),p&&(n.scrollLeft+=p);const E=n.scrollLeft-N,w=n.scrollTop-A;s={left:s.left-E,top:s.top-w,right:s.right-E,bottom:s.bottom-w}}n=g||d.position==="fixed"?null:Vl(n)}},Zl=100,Wl=["block","break","cursor","inline","scroll","text"],Xl=(r,t,e)=>{const s=new ke;return Wl.forEach(n=>{const i=t.query(n);i&&s.register(i)}),r.forEach(n=>{var a;let i=t.query(n);i||e.error(`Cannot register "${n}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(s.register(i),i="blotName"in i&&(a=i.requiredContainer)!=null?a:null,o+=1,o>Zl){e.error(`Cycle detected in registering blot requiredContainer: "${n}"`);break}}),s},Se=Mt("quill"),js=new ke;mt.uiClass="ql-ui";const Te=class{static debug(t){t===!0&&(t="log"),Mt.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return fr.get(t)||js.find(t,e)}static import(t){return this.imports[t]==null&&Se.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),s="attrName"in t?t.attrName:t.blotName;typeof s=="string"?this.register(`formats/${s}`,t,e):Object.keys(t).forEach(n=>{this.register(n,t[n],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],s=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!s&&Se.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&js.register(e),typeof e.register=="function"&&e.register(js)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Yl(t,e),this.container=this.options.container,this.container==null){Se.error("Invalid Quill container",t);return}this.options.debug&&Te.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",fr.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new L;const n=Tr.blotName,i=this.options.registry.query(n);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${n}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Hl(this.scroll),this.selection=new Pl(this.scroll,this.emitter),this.composition=new zl(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(L.events.EDITOR_CHANGE,o=>{o===L.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(L.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),g=u&&h?{oldRange:u,newRange:h}:void 0;pt.call(this,()=>this.editor.update(null,a,g),o)}),this.emitter.on(L.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),g=u&&h?{oldRange:u,newRange:h}:void 0;pt.call(this,()=>{const b=new S().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(b,[],g)},Te.sources.USER)}),s){const o=this.clipboard.convert({html:`${s}<p><br></p>`,text:`
`});this.setContents(o)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const s=t;t=document.createElement("div"),t.classList.add(s)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,s){return[t,e,,s]=It(t,e,s),pt.call(this,()=>this.editor.deleteText(t,e),s,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:L.sources.API;return pt.call(this,()=>{const n=this.getSelection(!0);let i=new S;if(n==null)return i;if(this.scroll.query(t,k.BLOCK))i=this.editor.formatLine(n.index,n.length,{[t]:e});else{if(n.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(n.index,n.length,{[t]:e})}return this.setSelection(n,L.sources.SILENT),i},s)}formatLine(t,e,s,n,i){let o;return[t,e,o,i]=It(t,e,s,n,i),pt.call(this,()=>this.editor.formatLine(t,e,o),i,t,0)}formatText(t,e,s,n,i){let o;return[t,e,o,i]=It(t,e,s,n,i),pt.call(this,()=>this.editor.formatText(t,e,o),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=null;if(typeof t=="number"?s=this.selection.getBounds(t,e):s=this.selection.getBounds(t.index,t.length),!s)return null;const n=this.container.getBoundingClientRect();return{bottom:s.bottom-n.top,height:s.height,left:s.left-n.left,right:s.right-n.left,top:s.top-n.top,width:s.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=It(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e!=null?e:this.getLength()-t),[t,e]=It(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e!=null?e:this.getLength()-t),[t,e]=It(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Te.sources.API;return pt.call(this,()=>this.editor.insertEmbed(t,e,s),n,t)}insertText(t,e,s,n,i){let o;return[t,,o,i]=It(t,0,s,n,i),pt.call(this,()=>this.editor.insertText(t,e,o),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,s){return[t,e,,s]=It(t,e,s),pt.call(this,()=>this.editor.removeFormat(t,e),s,t)}scrollRectIntoView(t){Gl(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L.sources.API;return pt.call(this,()=>{t=new S(t);const s=this.getLength(),n=this.editor.deleteText(0,s),i=this.editor.insertContents(0,t),o=this.editor.deleteText(this.getLength()-1,1);return n.compose(i).compose(o)},e)}setSelection(t,e,s){t==null?this.selection.setRange(null,e||Te.sources.API):([t,e,,s]=It(t,e,s),this.selection.setRange(new re(Math.max(0,t),e),s),s!==L.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L.sources.API;const s=new S().insert(t);return this.setContents(s,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L.sources.API;return pt.call(this,()=>(t=new S(t),this.editor.applyDelta(t)),e,!0)}};let v=Te;T(v,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:js,theme:"default"}),T(v,"events",L.events),T(v,"sources",L.sources),T(v,"version","2.0.2"),T(v,"imports",{delta:S,parchment:El,"core/module":Et,"core/theme":zt});function ei(r){return typeof r=="string"?document.querySelector(r):r}function er(r){return Object.entries(r!=null?r:{}).reduce((t,e)=>{let[s,n]=e;return{...t,[s]:n===!0?{}:n}},{})}function si(r){return Object.fromEntries(Object.entries(r).filter(t=>t[1]!==void 0))}function Yl(r,t){const e=ei(r);if(!e)throw new Error("Invalid Quill container");const n=!t.theme||t.theme===v.DEFAULTS.theme?zt:v.import(`themes/${t.theme}`);if(!n)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=v.DEFAULTS,{modules:a,...u}=n.DEFAULTS;let h=er(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const g=Gt({},er(i),er(a),h),b={...o,...si(u),...si(t)};let d=t.registry;return d?t.formats&&Se.warn('Ignoring "formats" option because "registry" is specified'):d=t.formats?Xl(t.formats,b.registry,Se):b.registry,{...b,registry:d,container:e,theme:n,modules:Object.entries(g).reduce((p,m)=>{let[N,A]=m;if(!A)return p;const E=v.import(`modules/${N}`);return E==null?(Se.error(`Cannot load ${N} module. Are you sure you registered it?`),p):{...p,[N]:Gt({},E.DEFAULTS||{},A)}},{}),bounds:ei(b.bounds)}}function pt(r,t,e,s){if(!this.isEnabled()&&t===L.sources.USER&&!this.allowReadOnlyEdits)return new S;let n=e==null?null:this.getSelection();const i=this.editor.delta,o=r();if(n!=null&&(e===!0&&(e=n.index),s==null?n=ni(n,o,t):s!==0&&(n=ni(n,e,s,t)),this.setSelection(n,L.sources.SILENT)),o.length()>0){const a=[L.events.TEXT_CHANGE,o,i,t];this.emitter.emit(L.events.EDITOR_CHANGE,...a),t!==L.sources.SILENT&&this.emitter.emit(...a)}return o}function It(r,t,e,s,n){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof t!="number"?(n=s,s=e,e=t,t=r.length,r=r.index):(t=r.length,r=r.index):typeof t!="number"&&(n=s,s=e,e=t,t=0),typeof e=="object"?(i=e,n=s):typeof e=="string"&&(s!=null?i[e]=s:n=e),n=n||L.sources.API,[r,t,i,n]}function ni(r,t,e,s){const n=typeof e=="number"?e:0;if(r==null)return null;let i,o;return t&&typeof t.transformPosition=="function"?[i,o]=[r.index,r.index+r.length].map(a=>t.transformPosition(a,s!==L.sources.USER)):[i,o]=[r.index,r.index+r.length].map(a=>a<t||a===t&&s===L.sources.USER?a:n>=0?a+n:Math.max(t,a+n)),new re(i,o-i)}class ie extends Gs{}function ri(r){return r instanceof K||r instanceof ct}function ii(r){return typeof r.updateContent=="function"}class xe extends Tr{constructor(t,e,s){let{emitter:n}=s;super(t,e),this.emitter=n,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(L.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(L.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(L.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[s,n]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&s!==i&&n>0){if(s instanceof ct||i instanceof ct){this.optimize();return}const o=i.children.head instanceof vt?null:i.children.head;s.moveChildren(i,o),s.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,s,n){super.formatAt(t,e,s,n),this.optimize()}insertAt(t,e,s){if(t>=this.length())if(s==null||this.scroll.query(e,k.BLOCK)==null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n),s==null&&e.endsWith(`
`)?n.insertAt(0,e.slice(0,-1),s):n.insertAt(0,e,s)}else{const n=this.scroll.create(e,s);this.appendChild(n)}else super.insertAt(t,e,s);this.optimize()}insertBefore(t,e){if(t.statics.scope===k.INLINE_BLOT){const s=this.scroll.create(this.statics.defaultChild.blotName);s.appendChild(t),super.insertBefore(s,e)}else super.insertBefore(t,e)}insertContents(t,e){const s=this.deltaToRenderBlocks(e.concat(new S().insert(`
`))),n=s.pop();if(n==null)return;this.batchStart();const i=s.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(ct,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new S().insert({[i.key]:i.value});sr(this,t,h);const g=i.type==="block"?1:0,b=t+h.length()+g;u&&this.insertAt(b-1,`
`);const d=ot(this.line(t)[0]),p=J.AttributeMap.diff(d,i.attributes)||{};Object.keys(p).forEach(m=>{this.formatAt(b-1,1,m,p[m])}),t=b}let[o,a]=this.children.find(t);if(s.length&&(o&&(o=o.split(a),a=0),s.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,o||void 0);sr(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(g=>{h.format(g,u.attributes[g])})}})),n.type==="block"&&n.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();sr(this,u,n.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[s,n]=e;return s instanceof X?[s,n]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(ri,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const s=(n,i,o)=>{let a=[],u=o;return n.children.forEachAt(i,o,(h,g,b)=>{ri(h)?a.push(h):h instanceof Gs&&(a=a.concat(s(h,g,u))),u-=b}),a};return s(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(L.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=L.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(s=>{let{target:n}=s;const i=this.find(n,!0);return i&&!ii(i)}),t.length>0&&this.emitter.emit(L.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(L.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,s){const[n]=this.descendant(i=>i instanceof ct,t);n&&n.statics.blotName===e&&ii(n)&&n.updateContent(s)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let s=new S;return t.forEach(n=>{var o;const i=n==null?void 0:n.insert;if(i)if(typeof i=="string"){const a=i.split(`
`);a.slice(0,-1).forEach(h=>{var g;s.insert(h,n.attributes),e.push({type:"block",delta:s,attributes:(g=n.attributes)!=null?g:{}}),s=new S});const u=a[a.length-1];u&&s.insert(u,n.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,k.INLINE)?s.push(n):(s.length()&&e.push({type:"block",delta:s,attributes:{}}),s=new S,e.push({type:"blockEmbed",key:a,value:i[a],attributes:(o=n.attributes)!=null?o:{}}))}}),s.length()&&e.push({type:"block",delta:s,attributes:{}}),e}createBlock(t,e){let s;const n={};Object.entries(t).forEach(a=>{let[u,h]=a;this.query(u,k.BLOCK&k.BLOT)!=null?s=u:n[u]=h});const i=this.create(s||this.statics.defaultChild.blotName,s?t[s]:void 0);this.insertBefore(i,e||void 0);const o=i.length();return Object.entries(n).forEach(a=>{let[u,h]=a;i.formatAt(0,o,u,h)}),i}}T(xe,"blotName","scroll"),T(xe,"className","ql-editor"),T(xe,"tagName","DIV"),T(xe,"defaultChild",K),T(xe,"allowedChildren",[K,ct,ie]);function sr(r,t,e){e.reduce((s,n)=>{const i=J.Op.length(n);let o=n.attributes||{};if(n.insert!=null){if(typeof n.insert=="string"){const a=n.insert;r.insertAt(s,a);const[u]=r.descendant(X,s),h=ot(u);o=J.AttributeMap.diff(h,o)||{}}else if(typeof n.insert=="object"){const a=Object.keys(n.insert)[0];if(a==null)return s;if(r.insertAt(s,a,n.insert[a]),r.scroll.query(a,k.INLINE)!=null){const[h]=r.descendant(X,s),g=ot(h);o=J.AttributeMap.diff(g,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(s,i,a,o[a])}),s+i},t)}const Or={scope:k.BLOCK,whitelist:["right","center","justify"]},Ql=new qt("align","align",Or),Oi=new yt("align","ql-align",Or),_i=new Zt("align","text-align",Or);class Ii extends Zt{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(n=>`00${parseInt(n,10).toString(16)}`.slice(-2)).join("")}`):e}}const Jl=new yt("color","ql-color",{scope:k.INLINE}),_r=new Ii("color","color",{scope:k.INLINE}),to=new yt("background","ql-bg",{scope:k.INLINE}),Ir=new Ii("background","background-color",{scope:k.INLINE});class le extends ie{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(s=>s.length()<=1?"":s.domNode.innerText).join(`
`).slice(t,t+e)}html(t,e){return`<pre>
${Ys(this.code(t,e))}
</pre>`}}class Y extends K{static register(){v.register(le)}}T(Y,"TAB"," ");class Rr extends ut{}Rr.blotName="code";Rr.tagName="CODE";Y.blotName="code-block";Y.className="ql-code-block";Y.tagName="DIV";le.blotName="code-block-container";le.className="ql-code-block-container";le.tagName="DIV";le.allowedChildren=[Y];Y.allowedChildren=[bt,vt,Tt];Y.requiredContainer=le;const Br={scope:k.BLOCK,whitelist:["rtl"]},Ri=new qt("direction","dir",Br),Bi=new yt("direction","ql-direction",Br),Mi=new Zt("direction","direction",Br),Di={scope:k.INLINE,whitelist:["serif","monospace"]},Ui=new yt("font","ql-font",Di);class eo extends Zt{value(t){return super.value(t).replace(/["']/g,"")}}const Pi=new eo("font","font-family",Di),ji=new yt("size","ql-size",{scope:k.INLINE,whitelist:["small","large","huge"]}),Hi=new Zt("size","font-size",{scope:k.INLINE,whitelist:["10px","18px","32px"]}),so=Mt("quill:keyboard"),no=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Qs extends Et{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(s=>!!e[s]!==t[s]&&e[s]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(s=>{this.options.bindings[s]&&this.addBinding(this.options.bindings[s])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=io(t);if(n==null){so.warn("Attempted to add invalid keyboard binding",n);return}typeof e=="function"&&(e={handler:e}),typeof s=="function"&&(s={handler:s}),(Array.isArray(n.key)?n.key:[n.key]).forEach(o=>{const a={...n,key:o,...e,...s};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(E=>Qs.match(t,E));if(n.length===0)return;const i=v.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,u]=this.quill.getLine(o.index),[h,g]=this.quill.getLeaf(o.index),[b,d]=o.length===0?[h,g]:this.quill.getLeaf(o.index+o.length),p=h instanceof Vs?h.value().slice(0,g):"",m=b instanceof Vs?b.value().slice(d):"",N={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:p,suffix:m,event:t};n.some(E=>{if(E.collapsed!=null&&E.collapsed!==N.collapsed||E.empty!=null&&E.empty!==N.empty||E.offset!=null&&E.offset!==N.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(w=>N.format[w]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(w=>E.format[w]===!0?N.format[w]!=null:E.format[w]===!1?N.format[w]==null:wr(E.format[w],N.format[w])))return!1;return E.prefix!=null&&!E.prefix.test(N.prefix)||E.suffix!=null&&!E.suffix.test(N.suffix)?!1:E.handler.call(this,o,N,E)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let n={};const[i]=this.quill.getLine(t.index);let o=new S().retain(t.index-s).delete(s);if(e.offset===0){const[a]=this.quill.getLine(t.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const h=i.formats(),g=this.quill.getFormat(t.index-1,1);if(n=J.AttributeMap.diff(h,g)||{},Object.keys(n).length>0){const b=new S().retain(t.index+i.length()-2).retain(1,n);o=o.compose(b)}}}this.quill.updateContents(o,v.sources.USER),this.quill.focus()}handleDelete(t,e){const s=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-s)return;let n={};const[i]=this.quill.getLine(t.index);let o=new S().retain(t.index).delete(s);if(e.offset>=i.length()-1){const[a]=this.quill.getLine(t.index+1);if(a){const u=i.formats(),h=this.quill.getFormat(t.index,1);n=J.AttributeMap.diff(u,h)||{},Object.keys(n).length>0&&(o=o.retain(a.length()-1).retain(1,n))}}this.quill.updateContents(o,v.sources.USER),this.quill.focus()}handleDeleteRange(t){Mr({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const s=Object.keys(e.format).reduce((i,o)=>(this.quill.scroll.query(o,k.BLOCK)&&!Array.isArray(e.format[o])&&(i[o]=e.format[o]),i),{}),n=new S().retain(t.index).delete(t.length).insert(`
`,s);this.quill.updateContents(n,v.sources.USER),this.quill.setSelection(t.index+1,v.sources.SILENT),this.quill.focus()}}const ro={bindings:{bold:nr("bold"),italic:nr("italic"),underline:nr("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",v.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",v.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,t){t.format.indent!=null?this.quill.format("indent","-1",v.sources.USER):t.format.list!=null&&this.quill.format("list",!1,v.sources.USER)}},"indent code-block":li(!0),"outdent code-block":li(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,v.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new S().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,v.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,v.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,v.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(r.index,r.length,e,v.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[t,e]=this.quill.getLine(r.index),s={...t.formats(),list:"checked"},n=new S().retain(r.index).insert(`
`,s).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(n,v.sources.USER),this.quill.setSelection(r.index+1,v.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,t){const[e,s]=this.quill.getLine(r.index),n=new S().retain(r.index).insert(`
`,t.format).retain(e.length()-s-1).retain(1,{header:null});this.quill.updateContents(n,v.sources.USER),this.quill.setSelection(r.index+1,v.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(r){const t=this.quill.getModule("table");if(t){const[e,s,n,i]=t.getTable(r),o=lo(e,s,n,i);if(o==null)return;let a=e.offset();if(o<0){const u=new S().retain(a).insert(`
`);this.quill.updateContents(u,v.sources.USER),this.quill.setSelection(r.index+1,r.length,v.sources.SILENT)}else if(o>0){a+=e.length();const u=new S().retain(a).insert(`
`);this.quill.updateContents(u,v.sources.USER),this.quill.setSelection(a,v.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,t){const{event:e,line:s}=t,n=s.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(n-1,v.sources.USER):this.quill.setSelection(n+s.length(),v.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[s,n]=this.quill.getLine(r.index);if(n>e)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(r.index," ",v.sources.USER),this.quill.history.cutoff();const o=new S().retain(r.index-n).delete(e+1).retain(s.length()-2-n).retain(1,{list:i});return this.quill.updateContents(o,v.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,v.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[t,e]=this.quill.getLine(r.index);let s=2,n=t;for(;n!=null&&n.length()<=1&&n.formats()["code-block"];)if(n=n.prev,s-=1,s<=0){const i=new S().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,v.sources.USER),this.quill.setSelection(r.index-1,v.sources.SILENT),!1}return!0}},"embed left":Hs("ArrowLeft",!1),"embed left shift":Hs("ArrowLeft",!0),"embed right":Hs("ArrowRight",!1),"embed right shift":Hs("ArrowRight",!0),"table down":oi(!1),"table up":oi(!0)}};Qs.DEFAULTS=ro;function li(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(t,e){let{event:s}=e;const n=this.quill.scroll.query("code-block"),{TAB:i}=n;if(t.length===0&&!s.shiftKey){this.quill.insertText(t.index,i,v.sources.USER),this.quill.setSelection(t.index+i.length,v.sources.SILENT);return}const o=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:u}=t;o.forEach((h,g)=>{r?(h.insertAt(0,i),g===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),g===0?a-=i.length:u-=i.length)}),this.quill.update(v.sources.USER),this.quill.setSelection(a,u,v.sources.SILENT)}}}function Hs(r,t){return{key:r,shiftKey:t,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(s){let{index:n}=s;r==="ArrowRight"&&(n+=s.length+1);const[i]=this.quill.getLeaf(n);return i instanceof it?(r==="ArrowLeft"?t?this.quill.setSelection(s.index-1,s.length+1,v.sources.USER):this.quill.setSelection(s.index-1,v.sources.USER):t?this.quill.setSelection(s.index,s.length+1,v.sources.USER):this.quill.setSelection(s.index+s.length+1,v.sources.USER),!1):!0}}}function nr(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],v.sources.USER)}}}function oi(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const s=r?"prev":"next",n=e.line,i=n.parent[s];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=n;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(e.offset,o.length()-1);this.quill.setSelection(u,0,v.sources.USER)}}else{const o=n.table()[s];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,v.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,v.sources.USER))}return!1}}}function io(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=Le(r);else return null;return r.shortKey&&(r[no]=r.shortKey,delete r.shortKey),r}function Mr(r){let{quill:t,range:e}=r;const s=t.getLines(e);let n={};if(s.length>1){const i=s[0].formats(),o=s[s.length-1].formats();n=J.AttributeMap.diff(o,i)||{}}t.deleteText(e,v.sources.USER),Object.keys(n).length>0&&t.formatLine(e.index,1,n,v.sources.USER),t.setSelection(e.index,v.sources.SILENT)}function lo(r,t,e,s){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?s===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const oo=/font-weight:\s*normal/,ao=["P","OL","UL"],ai=r=>r&&ao.includes(r.tagName),co=r=>{Array.from(r.querySelectorAll("br")).filter(t=>ai(t.previousElementSibling)&&ai(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},uo=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(oo)}).forEach(t=>{var s;const e=r.createDocumentFragment();e.append(...t.childNodes),(s=t.parentNode)==null||s.replaceChild(e,t)})};function ho(r){r.querySelector('[id^="docs-internal-guid-"]')&&(uo(r),co(r))}const fo=/\bmso-list:[^;]*ignore/i,go=/\bmso-list:[^;]*\bl(\d+)/i,po=/\bmso-list:[^;]*\blevel(\d+)/i,mo=(r,t)=>{const e=r.getAttribute("style"),s=e==null?void 0:e.match(go);if(!s)return null;const n=Number(s[1]),i=e==null?void 0:e.match(po),o=i?Number(i[1]):1,a=new RegExp(`@list l${n}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=t.match(a),h=u&&u[1]==="bullet"?"bullet":"ordered";return{id:n,indent:o,type:h,element:r}},bo=r=>{var o,a;const t=Array.from(r.querySelectorAll("[style*=mso-list]")),e=[],s=[];t.forEach(u=>{(u.getAttribute("style")||"").match(fo)?e.push(u):s.push(u)}),e.forEach(u=>{var h;return(h=u.parentNode)==null?void 0:h.removeChild(u)});const n=r.documentElement.innerHTML,i=s.map(u=>mo(u,n)).filter(u=>u);for(;i.length;){const u=[];let h=i.shift();for(;h;)u.push(h),h=i.length&&((o=i[0])==null?void 0:o.element)===h.element.nextElementSibling&&i[0].id===h.id?i.shift():null;const g=document.createElement("ul");u.forEach(p=>{const m=document.createElement("li");m.setAttribute("data-list",p.type),p.indent>1&&m.setAttribute("class",`ql-indent-${p.indent-1}`),m.innerHTML=p.element.innerHTML,g.appendChild(m)});const b=(a=u[0])==null?void 0:a.element,{parentNode:d}=b!=null?b:{};b&&(d==null||d.replaceChild(g,b)),u.slice(1).forEach(p=>{let{element:m}=p;d==null||d.removeChild(m)})}};function yo(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&bo(r)}const vo=[yo,ho],Eo=r=>{r.documentElement&&vo.forEach(t=>{t(r)})},No=Mt("quill:clipboard"),Ao=[[Node.TEXT_NODE,Ro],[Node.TEXT_NODE,ui],["br",qo],[Node.ELEMENT_NODE,ui],[Node.ELEMENT_NODE,Lo],[Node.ELEMENT_NODE,To],[Node.ELEMENT_NODE,_o],["li",Co],["ol, ul",Oo],["pre",So],["tr",Io],["b",rr("bold")],["i",rr("italic")],["strike",rr("strike")],["style",ko]],wo=[Ql,Ri].reduce((r,t)=>(r[t.keyName]=t,r),{}),ci=[_i,Ir,_r,Mi,Pi,Hi].reduce((r,t)=>(r[t.keyName]=t,r),{});class Fi extends Et{constructor(t,e){var s;super(t,e),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Ao.concat((s=this.options.matchers)!=null?s:[]).forEach(n=>{let[i,o]=n;this.addMatcher(i,o)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:s}=t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n[Y.blotName])return new S().insert(s||"",{[Y.blotName]:n[Y.blotName]});if(!e)return new S().insert(s||"",n);const i=this.convertHTML(e);return ls(i,`
`)&&(i.ops[i.ops.length-1].attributes==null||n.table)?i.compose(new S().retain(i.length()-1).delete(1)):i}normalizeHTML(t){Eo(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const s=e.body,n=new WeakMap,[i,o]=this.prepareMatching(s,n);return Dr(this.quill.scroll,s,i,o,n)}dangerouslyPasteHTML(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.sources.API;if(typeof t=="string"){const n=this.convert({html:t,text:""});this.quill.setContents(n,e),this.quill.setSelection(0,v.sources.SILENT)}else{const n=this.convert({html:e,text:""});this.quill.updateContents(new S().retain(t).concat(n),s),this.quill.setSelection(t+n.length(),v.sources.SILENT)}}onCaptureCopy(t){var o,a;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[s]=this.quill.selection.getRange();if(s==null)return;const{html:n,text:i}=this.onCopy(s,e);(o=t.clipboardData)==null||o.setData("text/plain",i),(a=t.clipboardData)==null||a.setData("text/html",n),e&&Mr({range:s,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
`)}onCapturePaste(t){var o,a,u,h,g;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const s=(o=t.clipboardData)==null?void 0:o.getData("text/html");let n=(a=t.clipboardData)==null?void 0:a.getData("text/plain");if(!s&&!n){const b=(u=t.clipboardData)==null?void 0:u.getData("text/uri-list");b&&(n=this.normalizeURIList(b))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!s&&i.length>0){this.quill.uploader.upload(e,i);return}if(s&&i.length>0){const b=new DOMParser().parseFromString(s,"text/html");if(b.body.childElementCount===1&&((g=b.body.firstElementChild)==null?void 0:g.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:s,text:n})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:s,html:n}=e;const i=this.quill.getFormat(t.index),o=this.convert({text:s,html:n},i);No.log("onPaste",o,{text:s,html:n});const a=new S().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,v.sources.USER),this.quill.setSelection(a.length()-t.length,v.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const s=[],n=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:n.push(a);break;case Node.ELEMENT_NODE:s.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(u=>{if(e.has(u)){const h=e.get(u);h==null||h.push(a)}else e.set(u,[a])});break}}),[s,n]}}T(Fi,"DEFAULTS",{matchers:[]});function oe(r,t,e,s){return s.query(t)?r.reduce((n,i)=>{if(!i.insert)return n;if(i.attributes&&i.attributes[t])return n.push(i);const o=e?{[t]:e}:{};return n.insert(i.insert,{...o,...i.attributes})},new S):r}function ls(r,t){let e="";for(let s=r.ops.length-1;s>=0&&e.length<t.length;--s){const n=r.ops[s];if(typeof n.insert!="string")break;e=n.insert+e}return e.slice(-1*t.length)===t}function Vt(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);return e&&e.prototype instanceof it?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(r.tagName.toLowerCase())}function xo(r,t){return r.previousElementSibling&&r.nextElementSibling&&!Vt(r.previousElementSibling,t)&&!Vt(r.nextElementSibling,t)}const Fs=new WeakMap;function $i(r){return r==null?!1:(Fs.has(r)||(r.tagName==="PRE"?Fs.set(r,!0):Fs.set(r,$i(r.parentNode))),Fs.get(r))}function Dr(r,t,e,s,n){return t.nodeType===t.TEXT_NODE?s.reduce((i,o)=>o(t,i,r),new S):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=Dr(r,o,e,s,n);return o.nodeType===t.ELEMENT_NODE&&(a=e.reduce((u,h)=>h(o,u,r),a),a=(n.get(o)||[]).reduce((u,h)=>h(o,u,r),a)),i.concat(a)},new S):new S}function rr(r){return(t,e,s)=>oe(e,r,!0,s)}function To(r,t,e){const s=qt.keys(r),n=yt.keys(r),i=Zt.keys(r),o={};return s.concat(n).concat(i).forEach(a=>{let u=e.query(a,k.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=wo[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=ci[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=ci[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,g]=u;return oe(a,h,g,e)},t)}function Lo(r,t,e){const s=e.query(r);if(s==null)return t;if(s.prototype instanceof it){const n={},i=s.value(r);if(i!=null)return n[s.blotName]=i,new S().insert(n,s.formats(r,e))}else if(s.prototype instanceof Je&&!ls(t,`
`)&&t.insert(`
`),"blotName"in s&&"formats"in s&&typeof s.formats=="function")return oe(t,s.blotName,s.formats(r,e),e);return t}function qo(r,t){return ls(t,`
`)||t.insert(`
`),t}function So(r,t,e){const s=e.query("code-block"),n=s&&"formats"in s&&typeof s.formats=="function"?s.formats(r,e):!0;return oe(t,"code-block",n,e)}function ko(){return new S}function Co(r,t,e){const s=e.query(r);if(s==null||s.blotName!=="list"||!ls(t,`
`))return t;let n=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(n+=1),i=i.parentNode;return n<=0?t:t.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:n,...a.attributes||{}}):o,new S)}function Oo(r,t,e){const s=r;let n=s.tagName==="OL"?"ordered":"bullet";const i=s.getAttribute("data-checked");return i&&(n=i==="true"?"checked":"unchecked"),oe(t,"list",n,e)}function ui(r,t,e){if(!ls(t,`
`)){if(Vt(r,e)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return t.insert(`
`);if(t.length()>0&&r.nextSibling){let s=r.nextSibling;for(;s!=null;){if(Vt(s,e))return t.insert(`
`);const n=e.query(s);if(n&&n.prototype instanceof ct)return t.insert(`
`);s=s.firstChild}}}return t}function _o(r,t,e){var i;const s={},n=r.style||{};return n.fontStyle==="italic"&&(s.italic=!0),n.textDecoration==="underline"&&(s.underline=!0),n.textDecoration==="line-through"&&(s.strike=!0),((i=n.fontWeight)!=null&&i.startsWith("bold")||parseInt(n.fontWeight,10)>=700)&&(s.bold=!0),t=Object.entries(s).reduce((o,a)=>{let[u,h]=a;return oe(o,u,h,e)},t),parseFloat(n.textIndent||0)>0?new S().insert(" ").concat(t):t}function Io(r,t,e){var n,i;const s=((n=r.parentElement)==null?void 0:n.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(s!=null){const a=Array.from(s.querySelectorAll("tr")).indexOf(r)+1;return oe(t,"table",a,e)}return t}function Ro(r,t,e){var n;let s=r.data;if(((n=r.parentElement)==null?void 0:n.tagName)==="O:P")return t.insert(s.trim());if(!$i(r)){if(s.trim().length===0&&s.includes(`
`)&&!xo(r,e))return t;const i=(o,a)=>{const u=a.replace(/[^\u00a0]/g,"");return u.length<1&&o?" ":u};s=s.replace(/\r\n/g," ").replace(/\n/g," "),s=s.replace(/\s\s+/g,i.bind(i,!0)),(r.previousSibling==null&&r.parentElement!=null&&Vt(r.parentElement,e)||r.previousSibling instanceof Element&&Vt(r.previousSibling,e))&&(s=s.replace(/^\s+/,i.bind(i,!1))),(r.nextSibling==null&&r.parentElement!=null&&Vt(r.parentElement,e)||r.nextSibling instanceof Element&&Vt(r.nextSibling,e))&&(s=s.replace(/\s+$/,i.bind(i,!1)))}return t.insert(s)}class zi extends Et{constructor(e,s){super(e,s);T(this,"lastRecorded",0);T(this,"ignoreChange",!1);T(this,"stack",{undo:[],redo:[]});T(this,"currentRange",null);this.quill.on(v.events.EDITOR_CHANGE,(n,i,o,a)=>{n===v.events.SELECTION_CHANGE?i&&a!==v.sources.SILENT&&(this.currentRange=i):n===v.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===v.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=pr(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",n=>{n.inputType==="historyUndo"?(this.undo(),n.preventDefault()):n.inputType==="historyRedo"&&(this.redo(),n.preventDefault())})}change(e,s){if(this.stack[e].length===0)return;const n=this.stack[e].pop();if(!n)return;const i=this.quill.getContents(),o=n.delta.invert(i);this.stack[s].push({delta:o,range:pr(n.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,v.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,s){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(s),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(n=n.compose(a.delta),i=a.range)}else this.lastRecorded=o;n.length()!==0&&(this.stack.undo.push({delta:n,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){hi(this.stack.undo,e),hi(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,v.sources.USER);else{const s=Mo(this.quill.scroll,e.delta);this.quill.setSelection(s,v.sources.USER)}}}T(zi,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function hi(r,t){let e=t;for(let s=r.length-1;s>=0;s-=1){const n=r[s];r[s]={delta:e.transform(n.delta,!0),range:n.range&&pr(n.range,e)},e=n.delta.transform(e),r[s].delta.length()===0&&r.splice(s,1)}}function Bo(r,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
`):e.attributes!=null?Object.keys(e.attributes).some(s=>r.query(s,k.BLOCK)!=null):!1}function Mo(r,t){const e=t.reduce((n,i)=>n+(i.delete||0),0);let s=t.length()-e;return Bo(r,t)&&(s-=1),s}function pr(r,t){if(!r)return r;const e=t.transformPosition(r.index),s=t.transformPosition(r.index+r.length);return{index:e,length:s-e}}class Vi extends Et{constructor(t,e){super(t,e),t.root.addEventListener("drop",s=>{var o;s.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(s.clientX,s.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(s.clientX,s.clientY);n=document.createRange(),n.setStart(a.offsetNode,a.offset),n.setEnd(a.offsetNode,a.offset)}const i=n&&t.selection.normalizeNative(n);if(i){const a=t.selection.normalizedToRange(i);(o=s.dataTransfer)!=null&&o.files&&this.upload(a,s.dataTransfer.files)}})}upload(t,e){const s=[];Array.from(e).forEach(n=>{var i;n&&((i=this.options.mimetypes)!=null&&i.includes(n.type))&&s.push(n)}),s.length>0&&this.options.handler.call(this,t,s)}}Vi.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,t){if(!this.quill.scroll.query("image"))return;const e=t.map(s=>new Promise(n=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.readAsDataURL(s)}));Promise.all(e).then(s=>{const n=s.reduce((i,o)=>i.insert({image:o}),new S().retain(r.index).delete(r.length));this.quill.updateContents(n,L.sources.USER),this.quill.setSelection(r.index+s.length,L.sources.SILENT)})}};const Do=["insertText","insertReplacementText"];class Uo extends Et{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",s=>{this.handleBeforeInput(s)}),/Android/i.test(navigator.userAgent)||t.on(v.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Mr({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const s=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new S().retain(t.index).insert(e,s),v.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,v.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Do.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const s=Po(t);if(s==null)return;const n=this.quill.selection.normalizeNative(e),i=n?this.quill.selection.normalizedToRange(n):null;i&&this.replaceText(i,s)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Po(r){var t;return typeof r.data=="string"?r.data:(t=r.dataTransfer)!=null&&t.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const jo=/Mac/i.test(navigator.platform),Ho=100,Fo=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||jo&&r.key==="a"&&r.ctrlKey===!0);class $o extends Et{constructor(e,s){super(e,s);T(this,"isListening",!1);T(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,s){let{line:n,event:i}=s;if(!(n instanceof mt)||!n.uiNode)return!0;const o=getComputedStyle(n.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),v.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Fo(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Ho,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const s=e.getRangeAt(0);if(s.collapsed!==!0||s.startOffset!==0)return;const n=this.quill.scroll.find(s.startContainer);if(!(n instanceof mt)||!n.uiNode)return;const i=document.createRange();i.setStartAfter(n.uiNode),i.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(i)}}v.register({"blots/block":K,"blots/block/embed":ct,"blots/break":vt,"blots/container":ie,"blots/cursor":Tt,"blots/embed":Cr,"blots/inline":ut,"blots/scroll":xe,"blots/text":bt,"modules/clipboard":Fi,"modules/history":zi,"modules/keyboard":Qs,"modules/uploader":Vi,"modules/input":Uo,"modules/uiNode":$o});class zo extends yt{add(t,e){let s=0;if(e==="+1"||e==="-1"){const n=this.value(t)||0;s=e==="+1"?n+1:n-1}else typeof e=="number"&&(s=e);return s===0?(this.remove(t),!0):super.add(t,s.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const Vo=new zo("indent","ql-indent",{scope:k.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class mr extends K{}T(mr,"blotName","blockquote"),T(mr,"tagName","blockquote");class br extends K{static formats(t){return this.tagName.indexOf(t.tagName)+1}}T(br,"blotName","header"),T(br,"tagName",["H1","H2","H3","H4","H5","H6"]);class os extends ie{}os.blotName="list-container";os.tagName="OL";class as extends K{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){v.register(os)}constructor(t,e){super(t,e);const s=e.ownerDocument.createElement("span"),n=i=>{if(!t.isEnabled())return;const o=this.statics.formats(e,t);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n),this.attachUI(s)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}as.blotName="list";as.tagName="LI";os.allowedChildren=[as];as.requiredContainer=os;class rs extends ut{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}T(rs,"blotName","bold"),T(rs,"tagName",["STRONG","B"]);class yr extends rs{}T(yr,"blotName","italic"),T(yr,"tagName",["EM","I"]);class Kt extends ut{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return Ki(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}T(Kt,"blotName","link"),T(Kt,"tagName","A"),T(Kt,"SANITIZED_URL","about:blank"),T(Kt,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Ki(r,t){const e=document.createElement("a");e.href=r;const s=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(s)>-1}class vr extends ut{static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}T(vr,"blotName","script"),T(vr,"tagName",["SUB","SUP"]);class Er extends rs{}T(Er,"blotName","strike"),T(Er,"tagName",["S","STRIKE"]);class Nr extends ut{}T(Nr,"blotName","underline"),T(Nr,"tagName","U");class $s extends Cr{static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}T($s,"blotName","formula"),T($s,"className","ql-formula"),T($s,"tagName","SPAN");const fi=["alt","height","width"];class Ar extends it{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return fi.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Ki(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){fi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}T(Ar,"blotName","image"),T(Ar,"tagName","IMG");const di=["height","width"];class zs extends ct{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","true"),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return di.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static sanitize(t){return Kt.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){di.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}T(zs,"blotName","video"),T(zs,"className","ql-video"),T(zs,"tagName","IFRAME");const Ye=new yt("code-token","hljs",{scope:k.INLINE});class Rt extends ut{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(Y.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,s){super(t,e,s),Ye.add(this.domNode,s)}format(t,e){t!==Rt.blotName?super.format(t,e):e?Ye.add(this.domNode,e):(Ye.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Ye.value(this.domNode)||this.unwrap()}}Rt.blotName="code-token";Rt.className="ql-token";class at extends Y{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),Rt.blotName,!1),super.replaceWith(t,e)}}class Qe extends le{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===at.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(t,e)}))}formatAt(t,e,s,n){s===at.blotName&&(this.forceNext=!0),super.formatAt(t,e,s,n)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const n=`${Array.from(this.domNode.childNodes).filter(o=>o!==this.uiNode).map(o=>o.textContent).join(`
`)}
`,i=at.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){const o=this.children.reduce((u,h)=>u.concat(ki(h,!1)),new S),a=t(n,i);o.diff(a).reduce((u,h)=>{let{retain:g,attributes:b}=h;return g?(b&&Object.keys(b).forEach(d=>{[at.blotName,Rt.blotName].includes(d)&&this.formatAt(u,g,d,b[d])}),u+g):u},0)}this.cachedText=n,this.forceNext=!1}}html(t,e){const[s]=this.children.find(t);return`<pre data-language="${s?at.formats(s.domNode):"plain"}">
${Ys(this.code(t,e))}
</pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=at.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Qe.allowedChildren=[at];at.requiredContainer=Qe;at.allowedChildren=[Rt,Tt,bt,vt];const Ko=(r,t,e)=>{if(typeof r.versionString=="string"){const s=r.versionString.split(".")[0];if(parseInt(s,10)>=11)return r.highlight(e,{language:t}).value}return r.highlight(t,e).value};class Gi extends Et{static register(){v.register(Rt,!0),v.register(at,!0),v.register(Qe,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((s,n)=>{let{key:i}=n;return s[i]=!0,s},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(v.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Qe))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(s=>{let{key:n,label:i}=s;const o=e.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",n),e.appendChild(o)}),e.addEventListener("change",()=>{t.format(at.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=at.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(v.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(v.sources.USER);const s=this.quill.getSelection();(t==null?this.quill.scroll.descendants(Qe):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(v.sources.SILENT),s!=null&&this.quill.setSelection(s,v.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return Ys(t).split(`
`).reduce((n,i,o)=>(o!==0&&n.insert(`
`,{[Y.blotName]:e}),n.insert(i)),new S);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(Y.className),s.innerHTML=Ko(this.options.hljs,e,t),Dr(this.quill.scroll,s,[(n,i)=>{const o=Ye.value(n);return o?i.compose(new S().retain(i.length(),{[Rt.blotName]:o})):i}],[(n,i)=>n.data.split(`
`).reduce((o,a,u)=>(u!==0&&o.insert(`
`,{[Y.blotName]:e}),o.insert(a)),i)],new WeakMap)}}Gi.DEFAULTS={hljs:(()=>window.hljs)(),interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Hr=class extends K{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Ur()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===Hr.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};let nt=Hr;T(nt,"blotName","table"),T(nt,"tagName","TD");class Bt extends ie{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),s=this.next.children.head.formats(),n=this.next.children.tail.formats();return t.table===e.table&&t.table===s.table&&t.table===n.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const s=e.formats(),n=e.next.formats();if(s.table!==n.table){const i=this.splitAfter(e);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}T(Bt,"blotName","table-row"),T(Bt,"tagName","TR");class Lt extends ie{}T(Lt,"blotName","table-body"),T(Lt,"tagName","TBODY");class Ce extends ie{balanceCells(){const t=this.descendants(Bt),e=t.reduce((s,n)=>Math.max(n.children.length,s),0);t.forEach(s=>{new Array(e-s.children.length).fill(0).forEach(()=>{let n;s.children.head!=null&&(n=nt.formats(s.children.head.domNode));const i=this.scroll.create(nt.blotName,n);s.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Lt);e==null||e.children.head==null||e.children.forEach(s=>{const n=s.children.at(t);n!=null&&n.remove()})}insertColumn(t){const[e]=this.descendant(Lt);e==null||e.children.head==null||e.children.forEach(s=>{const n=s.children.at(t),i=nt.formats(s.children.head.domNode),o=this.scroll.create(nt.blotName,i);s.insertBefore(o,n)})}insertRow(t){const[e]=this.descendant(Lt);if(e==null||e.children.head==null)return;const s=Ur(),n=this.scroll.create(Bt.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create(nt.blotName,s);n.appendChild(o)});const i=e.children.at(t);e.insertBefore(n,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}T(Ce,"blotName","table-container"),T(Ce,"tagName","TABLE");Ce.allowedChildren=[Lt];Lt.requiredContainer=Ce;Lt.allowedChildren=[Bt];Bt.requiredContainer=Lt;Bt.allowedChildren=[nt];nt.requiredContainer=Bt;function Ur(){return`row-${Math.random().toString(36).slice(2,6)}`}class Go extends Et{static register(){v.register(nt),v.register(Bt),v.register(Lt),v.register(Ce)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ce).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(v.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(v.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(v.sources.USER),this.quill.setSelection(e,v.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,s]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==nt.blotName)return[null,null,null,-1];const n=e.parent;return[n.parent.parent,n,e,s]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[s,n,i]=this.getTable(e);if(i==null)return;const o=i.cellOffset();s.insertColumn(o+t),this.quill.update(v.sources.USER);let a=n.rowOffset();t===0&&(a+=1),this.quill.setSelection(e.index+a,e.length,v.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[s,n,i]=this.getTable(e);if(i==null)return;const o=n.rowOffset();s.insertRow(o+t),this.quill.update(v.sources.USER),t>0?this.quill.setSelection(e,v.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,v.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const s=this.quill.getSelection();if(s==null)return;const n=new Array(t).fill(0).reduce(i=>{const o=new Array(e).fill(`
`).join("");return i.insert(o,{table:Ur()})},new S().retain(s.index));this.quill.updateContents(n,v.sources.USER),this.quill.setSelection(s.index,v.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(v.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(v.events.TEXT_CHANGE,(s,n,i)=>{i===v.sources.USER&&this.balanceTables()}),!0):!1)})}}const gi=Mt("quill:toolbar");class Pr extends Et{constructor(t,e){var s,n;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),Zo(i,this.options.container),(n=(s=t.container)==null?void 0:s.parentNode)==null||n.insertBefore(i,t.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){gi.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(v.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(n=>n.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){gi.warn("ignoring attaching to nonexistent format",e,t);return}const s=t.tagName==="SELECT"?"change":"click";t.addEventListener(s,n=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),n.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof it){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new S().retain(o.index).delete(o.length).insert({[e]:i}),v.sources.USER)}else this.quill.format(e,i,v.sources.USER);this.update(o)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(s=>{const[n,i]=s;if(i.tagName==="SELECT"){let o=null;if(t==null)o=null;else if(e[n]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(e[n])){let a=e[n];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=e[n],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=e[n]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}Pr.DEFAULTS={};function pi(r,t,e){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add(`ql-${t}`),s.setAttribute("aria-pressed","false"),e!=null?(s.value=e,s.setAttribute("aria-label",`${t}: ${e}`)):s.setAttribute("aria-label",t),r.appendChild(s)}function Zo(r,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const s=document.createElement("span");s.classList.add("ql-formats"),e.forEach(n=>{if(typeof n=="string")pi(s,n);else{const i=Object.keys(n)[0],o=n[i];Array.isArray(o)?Wo(s,i,o):pi(s,i,o)}}),r.appendChild(s)})}function Wo(r,t,e){const s=document.createElement("select");s.classList.add(`ql-${t}`),e.forEach(n=>{const i=document.createElement("option");n!==!1?i.setAttribute("value",String(n)):i.setAttribute("selected","selected"),s.appendChild(i)}),r.appendChild(s)}Pr.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,k.INLINE)!=null&&this.quill.format(e,!1,v.sources.USER)})}else this.quill.removeFormat(r.index,r.length,v.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",v.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,v.sources.USER),this.quill.format("direction",r,v.sources.USER)},indent(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t),s=parseInt(e.indent||0,10);if(r==="+1"||r==="-1"){let n=r==="+1"?1:-1;e.direction==="rtl"&&(n*=-1),this.quill.format("indent",s+n,v.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,v.sources.USER)},list(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t);r==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,v.sources.USER):this.quill.format("list","unchecked",v.sources.USER):this.quill.format("list",r,v.sources.USER)}}};const Xo='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Yo='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Qo='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Jo='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',ta='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',ea='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',sa='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',na='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',mi='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',ra='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',ia='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',la='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',oa='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',aa='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',ca='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ua='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ha='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',fa='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',da='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',ga='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',pa='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',ma='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',ba='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',ya='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',va='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Ea='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Na='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Aa='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',wa='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',xa='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Ta='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',La='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',qa='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',is={align:{"":Xo,center:Yo,right:Qo,justify:Jo},background:ta,blockquote:ea,bold:sa,clean:na,code:mi,"code-block":mi,color:ra,direction:{"":ia,rtl:la},formula:oa,header:{1:aa,2:ca,3:ua,4:ha,5:fa,6:da},italic:ga,image:pa,indent:{"+1":ma,"-1":ba},link:ya,list:{bullet:va,check:Ea,ordered:Na},script:{sub:Aa,super:wa},strike:xa,table:Ta,underline:La,video:qa},Sa='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let bi=0;function yi(r,t){r.setAttribute(t,`${r.getAttribute(t)!=="true"}`)}class Js{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),yi(this.label,"aria-expanded"),yi(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const s=t.getAttribute("value");return s&&e.setAttribute("data-value",s),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.selectItem(e,!0),n.preventDefault();break;case"Escape":this.escape(),n.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=Sa,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${bi}`,bi+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const s=this.buildItem(e);t.appendChild(s),e.selected===!0&&this.selectItem(s)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=this.container.querySelector(".ql-selected");t!==s&&(s!=null&&s.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const s=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(s)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class Zi extends Js{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(s=>{s.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const s=this.label.querySelector(".ql-color-label"),n=t&&t.getAttribute("data-value")||"";s&&(s.tagName==="line"?s.style.stroke=n:s.style.fill=n)}}class Wi extends Js{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(s=>{s.innerHTML=e[s.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const s=t||this.defaultItem;if(s!=null){if(this.label.innerHTML===s.innerHTML)return;this.label.innerHTML=s.innerHTML}}}const ka=r=>{const{overflowY:t}=getComputedStyle(r,null);return t!=="visible"&&t!=="clip"};class Xi{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,ka(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2,s=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${s}px`,this.root.classList.remove("ql-flip");const n=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>n.right&&(o=n.right-i.right,this.root.style.left=`${e+o}px`),i.left<n.left&&(o=n.left-i.left,this.root.style.left=`${e+o}px`),i.bottom>n.bottom){const a=i.bottom-i.top,u=t.bottom-t.top+a;this.root.style.top=`${s-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Ca=[!1,"center","right","justify"],Oa=["#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"],_a=[!1,"serif","monospace"],Ia=["1","2","3",!1],Ra=["small",!1,"large","huge"];class cs extends zt{constructor(t,e){super(t,e);const s=n=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",s);return}this.tooltip!=null&&!this.tooltip.root.contains(n.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(n.target)||i.close()})};t.emitter.listenDOM("click",document.body,s)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(s=>{(s.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")s.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")s.innerHTML=e[i];else{const o=s.value||"";o!=null&&e[i][o]&&(s.innerHTML=e[i][o])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(n=>{if(n.classList.contains("ql-align")&&(n.querySelector("option")==null&&Xe(n,Ca),typeof e.align=="object"))return new Wi(n,e.align);if(n.classList.contains("ql-background")||n.classList.contains("ql-color")){const i=n.classList.contains("ql-background")?"background":"color";return n.querySelector("option")==null&&Xe(n,Oa,i==="background"?"#ffffff":"#000000"),new Zi(n,e[i])}return n.querySelector("option")==null&&(n.classList.contains("ql-font")?Xe(n,_a):n.classList.contains("ql-header")?Xe(n,Ia):n.classList.contains("ql-size")&&Xe(n,Ra)),new Js(n)});const s=()=>{this.pickers.forEach(n=>{n.update()})};this.quill.on(L.events.EDITOR_CHANGE,s)}}cs.DEFAULTS=Gt({},zt.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Yi extends Xi{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;e!=null?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const s=this.quill.getBounds(this.quill.selection.savedRange);s!=null&&this.position(s),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,L.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,L.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=Ba(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const s=e.index+e.length;this.quill.insertEmbed(s,this.root.getAttribute("data-mode"),t,L.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(s+1," ",L.sources.USER),this.quill.setSelection(s+2,L.sources.USER)}break}}this.textbox.value="",this.hide()}}function Ba(r){let t=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:r}function Xe(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(s=>{const n=document.createElement("option");s===e?n.setAttribute("selected","selected"):n.setAttribute("value",String(s)),r.appendChild(n)})}const Ma=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Qi extends Yi{constructor(t,e){super(t,e),this.quill.on(L.events.EDITOR_CHANGE,(s,n,i,o)=>{if(s===L.events.SELECTION_CHANGE)if(n!=null&&n.length>0&&o===L.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(n.index,n.length);if(a.length===1){const u=this.quill.getBounds(n);u!=null&&this.position(u)}else{const u=a[a.length-1],h=this.quill.getIndex(u),g=Math.min(u.length()-1,n.index+n.length-h),b=this.quill.getBounds(new re(h,g));b!=null&&this.position(b)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(L.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),s=this.root.querySelector(".ql-tooltip-arrow");return s.style.marginLeft="",e!==0&&(s.style.marginLeft=`${-1*e-s.offsetWidth/2}px`),e}}T(Qi,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Ji extends cs{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Ma),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Qi(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),is),this.buildPickers(t.container.querySelectorAll("select"),is))}}Ji.DEFAULTS=Gt({},cs.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,v.sources.USER)}}}}});const Da=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class tl extends Yi{constructor(){super(...arguments);T(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){const s=this.linkRange;this.restoreFocus(),this.quill.formatText(s,"link",!1,L.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(L.events.SELECTION_CHANGE,(e,s,n)=>{if(e!=null){if(e.length===0&&n===L.sources.USER){const[i,o]=this.quill.scroll.descendant(Kt,e.index);if(i!=null){this.linkRange=new re(e.index-o,i.length());const a=Kt.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}T(tl,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class el extends cs{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Da),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),is),this.buildPickers(t.container.querySelectorAll("select"),is),this.tooltip=new tl(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,s)=>{t.handlers.link.call(t,!s.format.link)}))}}el.DEFAULTS=Gt({},cs.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:s}=this.quill.theme;s.edit("link",e)}else this.quill.format("link",!1,v.sources.USER)}}}}});v.register({"attributors/attribute/direction":Ri,"attributors/class/align":Oi,"attributors/class/background":to,"attributors/class/color":Jl,"attributors/class/direction":Bi,"attributors/class/font":Ui,"attributors/class/size":ji,"attributors/style/align":_i,"attributors/style/background":Ir,"attributors/style/color":_r,"attributors/style/direction":Mi,"attributors/style/font":Pi,"attributors/style/size":Hi},!0);v.register({"formats/align":Oi,"formats/direction":Bi,"formats/indent":Vo,"formats/background":Ir,"formats/color":_r,"formats/font":Ui,"formats/size":ji,"formats/blockquote":mr,"formats/code-block":Y,"formats/header":br,"formats/list":as,"formats/bold":rs,"formats/code":Rr,"formats/italic":yr,"formats/link":Kt,"formats/script":vr,"formats/strike":Er,"formats/underline":Nr,"formats/formula":$s,"formats/image":Ar,"formats/video":zs,"modules/syntax":Gi,"modules/table":Go,"modules/toolbar":Pr,"themes/bubble":Ji,"themes/snow":el,"ui/icons":is,"ui/picker":Js,"ui/icon-picker":Wi,"ui/color-picker":Zi,"ui/tooltip":Xi},!0);export{v as Q};