index.Dty-PGhI.js 192 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. var fl=Object.defineProperty;var pl=(r,t,e)=>t in r?fl(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var S=(r,t,e)=>pl(r,typeof t!="symbol"?t+"":t,e);import{a as gl,aH as ml,r as ns,_ as bl,w as yl,q as vl,Z as El,aj as It,c as Nl,o as Al,b as vt,S as _,K as V,u as wl,P as Wr}from"./vue.D1BjjNmv.js";import{G as xl,A as Tl,a as ql}from"./api.BJHbL4UW.js";import{c as Yt,g as qi,$ as Cr,a0 as Ce,a1 as Jt,E as Fs}from"./index.DJ0_GVki.js";import{g as Ll}from"./pcaData.5HEg6BqW.js";import{_ as _l}from"./_plugin-vue_export-helper.DlAUqK2U.js";var O=(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))(O||{});class Mt{constructor(t,e,s={}){this.attrName=t,this.keyName=e;const n=O.TYPE&O.ATTRIBUTE;this.scope=s.scope!=null?s.scope&O.LEVEL|n:O.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 Oe extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const Li=class fr{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{return null}return this.find(s,e)}return null}create(t,e,s){const n=this.query(e);if(n==null)throw new Oe(`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 fr.blots.set(a.domNode,a),a}find(t,e=!1){return fr.find(t,e)}query(t,e=O.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&O.LEVEL&O.BLOCK?s=this.types.block:t&O.LEVEL&O.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&O.LEVEL&s.scope&&e&O.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 Oe("Invalid definition");if(s&&e.blotName==="abstract")throw new Oe("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})}};Li.blots=new WeakMap;let Re=Li;function Yr(r,t){return(r.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class Sl extends Mt{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){Yr(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(Yr(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Tt=Sl;function nr(r){const t=r.split("-"),e=t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return t[0]+e}class kl extends Mt{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[nr(this.keyName)]=e,!0):!1}remove(t){t.style[nr(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[nr(this.keyName)];return this.canAdd(t,e)?e:""}}const te=kl;class Cl{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=Re.find(this.domNode);if(t==null)return;const e=Mt.keys(this.domNode),s=Tt.keys(this.domNode),n=te.keys(this.domNode);e.concat(s).concat(n).forEach(i=>{const o=t.scroll.query(i,O.ATTRIBUTE);o instanceof Mt&&(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 tn=Cl,_i=class{constructor(t,e){this.scroll=t,this.domNode=e,Re.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new Oe("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),Re.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,O.BLOT)!=null&&n)i.wrap(s,n);else if(this.scroll.query(s,O.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 Oe(`Cannot wrap ${t}`);return s.appendChild(this),s}};_i.blotName="abstract";let Si=_i;const ki=class extends Si{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}}};ki.scope=O.INLINE_BLOT;let Ol=ki;const et=Ol;class Il{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 Xr(r,t){const e=t.find(r);if(e)return e;try{return t.create(r)}catch{const s=t.create(O.INLINE);return Array.from(r.childNodes).forEach(n=>{s.domNode.appendChild(n)}),r.parentNode&&r.parentNode.replaceChild(s.domNode,r),s.attach(),s}}const Ci=class Wt extends Si{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,Wt.uiClass&&this.uiNode.classList.add(Wt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Il,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=Xr(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof Oe)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 Wt?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 Wt&&(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===O.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof Wt?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 Wt?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 Wt&&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=Xr(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Ci.uiClass="";let Rl=Ci;const wt=Rl;function Bl(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 Te=class qe extends wt{static create(t){return super.create(t)}static formats(t,e){const s=e.query(qe.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 tn(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(s=>{s instanceof qe||(s=s.wrap(qe.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(t,O.INLINE);if(s==null)return;s instanceof Mt?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,O.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 qe&&s.prev===this&&Bl(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 qe&&this.attributes.move(s),s}};Te.allowedChildren=[Te,et],Te.blotName="inline",Te.scope=O.INLINE_BLOT,Te.tagName="SPAN";let Ml=Te;const Or=Ml,Le=class pr extends wt{static create(t){return super.create(t)}static formats(t,e){const s=e.query(pr.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 tn(this.domNode)}format(t,e){const s=this.scroll.query(t,O.BLOCK);s!=null&&(s instanceof Mt?this.attributes.attribute(s,e):t===this.statics.blotName&&!e?this.replaceWith(pr.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,O.BLOCK)!=null?this.format(s,n):super.formatAt(t,e,s,n)}insertAt(t,e,s){if(s==null||this.scroll.query(e,O.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()}};Le.blotName="block",Le.scope=O.BLOCK_BLOT,Le.tagName="P",Le.allowedChildren=[Or,Le,et];let Dl=Le;const cs=Dl,gr=class extends wt{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())}};gr.blotName="container",gr.scope=O.BLOCK_BLOT;let Ul=gr;const en=Ul;class jl extends et{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 at=jl,Pl={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},$l=100,_e=class extends wt{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,Pl),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=O.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 wt&&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>=$l)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const p=this.find(h.target,!0);p!=null&&(p.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(b=>{const f=this.find(b,!1);i(f,!1),f instanceof wt&&f.children.forEach(g=>{i(g,!1)})})):h.type==="attributes"&&i(p.prev)),i(p))}),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)}};_e.blotName="scroll",_e.defaultChild=cs,_e.allowedChildren=[cs,en],_e.scope=O.BLOCK_BLOT,_e.tagName="DIV";let Hl=_e;const Ir=Hl,mr=class Oi extends et{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 Oi&&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}};mr.blotName="text",mr.scope=O.INLINE_BLOT;let Fl=mr;const Xs=Fl,Vl=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Mt,AttributorStore:tn,BlockBlot:cs,ClassAttributor:Tt,ContainerBlot:en,EmbedBlot:at,InlineBlot:Or,LeafBlot:et,ParentBlot:wt,Registry:Re,Scope:O,ScrollBlot:Ir,StyleAttributor:te,TextBlot:Xs},Symbol.toStringTag,{value:"Module"}));var br={exports:{}},ot=-1,rt=1,G=0;function us(r,t,e,s,n){if(r===t)return r?[[G,r]]:[];if(e!=null){var i=Jl(r,t,e);if(i)return i}var o=Rr(r,t),a=r.substring(0,o);r=r.substring(o),t=t.substring(o),o=sn(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=zl(r,t);return a&&h.unshift([G,a]),u&&h.push([G,u]),Br(h,n),s&&Zl(h),h}function zl(r,t){var e;if(!r)return[[rt,t]];if(!t)return[[ot,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=[[rt,s.substring(0,i)],[G,n],[rt,s.substring(i+n.length)]],r.length>t.length&&(e[0][0]=e[2][0]=ot),e;if(n.length===1)return[[ot,r],[rt,t]];var o=Gl(r,t);if(o){var a=o[0],u=o[1],h=o[2],p=o[3],b=o[4],f=us(a,h),g=us(u,p);return f.concat([[G,b]],g)}return Kl(r,t)}function Kl(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 p=e-s,b=p%2!==0,f=0,g=0,m=0,v=0,E=0;E<n;E++){for(var N=-E+f;N<=E-g;N+=2){var q=i+N,w;N===-E||N!==E&&a[q-1]<a[q+1]?w=a[q+1]:w=a[q-1]+1;for(var x=w-N;w<e&&x<s&&r.charAt(w)===t.charAt(x);)w++,x++;if(a[q]=w,w>e)g+=2;else if(x>s)f+=2;else if(b){var T=i+p-N;if(T>=0&&T<o&&u[T]!==-1){var I=e-u[T];if(w>=I)return Qr(r,t,w,x)}}}for(var R=-E+m;R<=E-v;R+=2){var T=i+R,I;R===-E||R!==E&&u[T-1]<u[T+1]?I=u[T+1]:I=u[T-1]+1;for(var L=I-R;I<e&&L<s&&r.charAt(e-I-1)===t.charAt(s-L-1);)I++,L++;if(u[T]=I,I>e)v+=2;else if(L>s)m+=2;else if(!b){var q=i+p-R;if(q>=0&&q<o&&a[q]!==-1){var w=a[q],x=i+w-q;if(I=e-I,w>=I)return Qr(r,t,w,x)}}}}return[[ot,r],[rt,t]]}function Qr(r,t,e,s){var n=r.substring(0,e),i=t.substring(0,s),o=r.substring(e),a=t.substring(s),u=us(n,i),h=us(o,a);return u.concat(h)}function Rr(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 Ii(r.charCodeAt(n-1))&&n--,n}function Jr(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 sn(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 Ri(r.charCodeAt(r.length-n))&&n--,n}function Gl(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(g,m,v){for(var E=g.substring(v,v+Math.floor(g.length/4)),N=-1,q="",w,x,T,I;(N=m.indexOf(E,N+1))!==-1;){var R=Rr(g.substring(v),m.substring(N)),L=sn(g.substring(0,v),m.substring(0,N));q.length<L+R&&(q=m.substring(N-L,N)+m.substring(N,N+R),w=g.substring(0,v-L),x=g.substring(v+R),T=m.substring(0,N-L),I=m.substring(N+R))}return q.length*2>=g.length?[w,x,T,I,q]: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,p,b;r.length>t.length?(u=a[0],h=a[1],p=a[2],b=a[3]):(p=a[0],b=a[1],u=a[2],h=a[3]);var f=a[4];return[u,h,p,b,f]}function Zl(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]==G?(e[s++]=i,o=u,a=h,u=0,h=0,n=r[i][1]):(r[i][0]==rt?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,[ot,n]),r[e[s-1]+1][0]=rt,s--,s--,i=s>0?e[s-1]:-1,o=0,a=0,u=0,h=0,n=null,t=!0)),i++;for(t&&Br(r),Xl(r),i=1;i<r.length;){if(r[i-1][0]==ot&&r[i][0]==rt){var p=r[i-1][1],b=r[i][1],f=Jr(p,b),g=Jr(b,p);f>=g?(f>=p.length/2||f>=b.length/2)&&(r.splice(i,0,[G,b.substring(0,f)]),r[i-1][1]=p.substring(0,p.length-f),r[i+1][1]=b.substring(f),i++):(g>=p.length/2||g>=b.length/2)&&(r.splice(i,0,[G,p.substring(0,g)]),r[i-1][0]=rt,r[i-1][1]=b.substring(0,b.length-g),r[i+1][0]=ot,r[i+1][1]=p.substring(g),i++),i++}i++}}var ti=/[^a-zA-Z0-9]/,ei=/\s/,si=/[\r\n]/,Wl=/\n\r?\n$/,Yl=/^\r?\n\r?\n/;function Xl(r){function t(g,m){if(!g||!m)return 6;var v=g.charAt(g.length-1),E=m.charAt(0),N=v.match(ti),q=E.match(ti),w=N&&v.match(ei),x=q&&E.match(ei),T=w&&v.match(si),I=x&&E.match(si),R=T&&g.match(Wl),L=I&&m.match(Yl);return R||L?5:T||I?4:N&&!w&&x?3:w||x?2:N||q?1:0}for(var e=1;e<r.length-1;){if(r[e-1][0]==G&&r[e+1][0]==G){var s=r[e-1][1],n=r[e][1],i=r[e+1][1],o=sn(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,p=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 f=t(s,n)+t(n,i);f>=b&&(b=f,u=s,h=n,p=i)}r[e-1][1]!=u&&(u?r[e-1][1]=u:(r.splice(e-1,1),e--),r[e][1]=h,p?r[e+1][1]=p:(r.splice(e+1,1),e--))}e++}}function Br(r,t){r.push([G,""]);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 rt:n++,o+=r[e][1],e++;break;case ot:s++,i+=r[e][1],e++;break;case G:var u=e-n-s-1;if(t){if(u>=0&&Mi(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 p=u-1;r[p]&&r[p][0]===rt&&(n++,o=r[p][1]+o,p--),r[p]&&r[p][0]===ot&&(s++,i=r[p][1]+i,p--),u=p}}if(Bi(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=Rr(o,i),a!==0&&(u>=0?r[u][1]+=o.substring(0,a):(r.splice(0,0,[G,o.substring(0,a)]),e++),o=o.substring(a),i=i.substring(a)),a=sn(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,[rt,o]),e=e-b+1):o.length===0?(r.splice(e-b,b,[ot,i]),e=e-b+1):(r.splice(e-b,b,[ot,i],[rt,o]),e=e-b+2)}e!==0&&r[e-1][0]===G?(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 f=!1;for(e=1;e<r.length-1;)r[e-1][0]===G&&r[e+1][0]===G&&(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),f=!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),f=!0)),e++;f&&Br(r,t)}function Ii(r){return r>=55296&&r<=56319}function Ri(r){return r>=56320&&r<=57343}function Bi(r){return Ri(r.charCodeAt(0))}function Mi(r){return Ii(r.charCodeAt(r.length-1))}function Ql(r){for(var t=[],e=0;e<r.length;e++)r[e][1].length>0&&t.push(r[e]);return t}function rr(r,t,e,s){return Mi(r)||Bi(s)?null:Ql([[G,r],[ot,t],[rt,e],[G,s]])}function Jl(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),p=n?n.index:null;t:{var b=a+o-i;if(p!==null&&p!==b||b<0||b>o)break t;var f=t.slice(0,b),g=t.slice(b);if(g!==h)break t;var m=Math.min(a,b),v=u.slice(0,m),E=f.slice(0,m);if(v!==E)break t;var N=u.slice(m),q=f.slice(m);return rr(v,N,q,h)}t:{if(p!==null&&p!==a)break t;var w=a,f=t.slice(0,w),g=t.slice(w);if(f!==u)break t;var x=Math.min(i-w,o-w),T=h.slice(h.length-x),I=g.slice(g.length-x);if(T!==I)break t;var N=h.slice(0,h.length-x),q=g.slice(0,g.length-x);return rr(u,N,q,T)}}if(s.length>0&&n&&n.length===0)t:{var v=r.slice(0,s.index),T=r.slice(s.index+s.length),m=v.length,x=T.length;if(o<m+x)break t;var E=t.slice(0,m),I=t.slice(o-x);if(v!==E||T!==I)break t;var N=r.slice(m,i-x),q=t.slice(m,o-x);return rr(v,N,q,T)}return null}function nn(r,t,e,s){return us(r,t,e,s,!0)}nn.INSERT=rt;nn.DELETE=ot;nn.EQUAL=G;var to=nn,Qs={exports:{}};Qs.exports;(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]",p="[object Function]",b="[object GeneratorFunction]",f="[object Map]",g="[object Number]",m="[object Object]",v="[object Promise]",E="[object RegExp]",N="[object Set]",q="[object String]",w="[object Symbol]",x="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",R="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",X="[object Int16Array]",Ut="[object Int32Array]",_t="[object Uint8Array]",de="[object Uint8ClampedArray]",fe="[object Uint16Array]",U="[object Uint32Array]",cn=/[\\^$.*+?()[\]{}|]/g,un=/\w*$/,hn=/^\[object .+?Constructor\]$/,dn=/^(?:0|[1-9]\d*)$/,$={};$[i]=$[o]=$[T]=$[I]=$[a]=$[u]=$[R]=$[L]=$[F]=$[X]=$[Ut]=$[f]=$[g]=$[m]=$[E]=$[N]=$[q]=$[w]=$[_t]=$[de]=$[fe]=$[U]=!0,$[h]=$[p]=$[x]=!1;var fn=typeof Yt=="object"&&Yt&&Yt.Object===Object&&Yt,pn=typeof self=="object"&&self&&self.Object===Object&&self,gt=fn||pn||Function("return this")(),ys=t&&!t.nodeType&&t,H=ys&&!0&&r&&!r.nodeType&&r,vs=H&&H.exports===ys;function gn(l,c){return l.set(c[0],c[1]),l}function mt(l,c){return l.add(c),l}function Es(l,c){for(var d=-1,y=l?l.length:0;++d<y&&c(l[d],d,l)!==!1;);return l}function Ns(l,c){for(var d=-1,y=c.length,M=l.length;++d<y;)l[M+d]=c[d];return l}function Ue(l,c,d,y){for(var M=-1,B=l?l.length:0;++M<B;)d=c(d,l[M],M,l);return d}function je(l,c){for(var d=-1,y=Array(l);++d<l;)y[d]=c(d);return y}function As(l,c){return l==null?void 0:l[c]}function Pe(l){var c=!1;if(l!=null&&typeof l.toString!="function")try{c=!!(l+"")}catch{}return c}function ws(l){var c=-1,d=Array(l.size);return l.forEach(function(y,M){d[++c]=[M,y]}),d}function $e(l,c){return function(d){return l(c(d))}}function xs(l){var c=-1,d=Array(l.size);return l.forEach(function(y){d[++c]=y}),d}var mn=Array.prototype,bn=Function.prototype,pe=Object.prototype,He=gt["__core-js_shared__"],Ts=function(){var l=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),qs=bn.toString,St=pe.hasOwnProperty,ge=pe.toString,yn=RegExp("^"+qs.call(St).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=vs?gt.Buffer:void 0,me=gt.Symbol,Fe=gt.Uint8Array,ct=$e(Object.getPrototypeOf,Object),Ls=Object.create,_s=pe.propertyIsEnumerable,vn=mn.splice,Ve=Object.getOwnPropertySymbols,be=ee?ee.isBuffer:void 0,Ss=$e(Object.keys,Object),ye=yt(gt,"DataView"),se=yt(gt,"Map"),bt=yt(gt,"Promise"),ve=yt(gt,"Set"),ze=yt(gt,"WeakMap"),ne=yt(Object,"create"),Ke=nt(ye),re=nt(se),Ge=nt(bt),Ze=nt(ve),We=nt(ze),Gt=me?me.prototype:void 0,ks=Gt?Gt.valueOf:void 0;function jt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function En(){this.__data__=ne?ne(null):{}}function Nn(l){return this.has(l)&&delete this.__data__[l]}function An(l){var c=this.__data__;if(ne){var d=c[l];return d===s?void 0:d}return St.call(c,l)?c[l]:void 0}function Cs(l){var c=this.__data__;return ne?c[l]!==void 0:St.call(c,l)}function Ye(l,c){var d=this.__data__;return d[l]=ne&&c===void 0?s:c,this}jt.prototype.clear=En,jt.prototype.delete=Nn,jt.prototype.get=An,jt.prototype.has=Cs,jt.prototype.set=Ye;function Z(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function wn(){this.__data__=[]}function xn(l){var c=this.__data__,d=Ne(c,l);if(d<0)return!1;var y=c.length-1;return d==y?c.pop():vn.call(c,d,1),!0}function Tn(l){var c=this.__data__,d=Ne(c,l);return d<0?void 0:c[d][1]}function qn(l){return Ne(this.__data__,l)>-1}function Ln(l,c){var d=this.__data__,y=Ne(d,l);return y<0?d.push([l,c]):d[y][1]=c,this}Z.prototype.clear=wn,Z.prototype.delete=xn,Z.prototype.get=Tn,Z.prototype.has=qn,Z.prototype.set=Ln;function Q(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function _n(){this.__data__={hash:new jt,map:new(se||Z),string:new jt}}function Sn(l){return le(this,l).delete(l)}function kn(l){return le(this,l).get(l)}function Cn(l){return le(this,l).has(l)}function On(l,c){return le(this,l).set(l,c),this}Q.prototype.clear=_n,Q.prototype.delete=Sn,Q.prototype.get=kn,Q.prototype.has=Cn,Q.prototype.set=On;function it(l){this.__data__=new Z(l)}function In(){this.__data__=new Z}function Rn(l){return this.__data__.delete(l)}function Bn(l){return this.__data__.get(l)}function Mn(l){return this.__data__.has(l)}function Dn(l,c){var d=this.__data__;if(d instanceof Z){var y=d.__data__;if(!se||y.length<e-1)return y.push([l,c]),this;d=this.__data__=new Q(y)}return d.set(l,c),this}it.prototype.clear=In,it.prototype.delete=Rn,it.prototype.get=Bn,it.prototype.has=Mn,it.prototype.set=Dn;function Ee(l,c){var d=ts(l)||we(l)?je(l.length,String):[],y=d.length,M=!!y;for(var B in l)St.call(l,B)&&!(M&&(B=="length"||Xn(B,y)))&&d.push(B);return d}function Os(l,c,d){var y=l[c];(!(St.call(l,c)&&Ds(y,d))||d===void 0&&!(c in l))&&(l[c]=d)}function Ne(l,c){for(var d=l.length;d--;)if(Ds(l[d][0],c))return d;return-1}function kt(l,c){return l&&Je(c,ss(c),l)}function Xe(l,c,d,y,M,B,j){var D;if(y&&(D=B?y(l,M,B,j):y(l)),D!==void 0)return D;if(!Ot(l))return l;var z=ts(l);if(z){if(D=Wn(l),!c)return Kn(l,D)}else{var P=$t(l),J=P==p||P==b;if(Us(l))return Ae(l,c);if(P==m||P==i||J&&!B){if(Pe(l))return B?l:{};if(D=Ct(J?{}:l),!c)return Gn(l,kt(D,l))}else{if(!$[P])return B?l:{};D=Yn(l,P,Xe,c)}}j||(j=new it);var lt=j.get(l);if(lt)return lt;if(j.set(l,D),!z)var K=d?Zn(l):ss(l);return Es(K||l,function(tt,W){K&&(W=tt,tt=l[W]),Os(D,W,Xe(tt,c,d,y,W,l,j))}),D}function Un(l){return Ot(l)?Ls(l):{}}function jn(l,c,d){var y=c(l);return ts(l)?y:Ns(y,d(l))}function Pn(l){return ge.call(l)}function $n(l){if(!Ot(l)||Jn(l))return!1;var c=es(l)||Pe(l)?yn:hn;return c.test(nt(l))}function Hn(l){if(!Bs(l))return Ss(l);var c=[];for(var d in Object(l))St.call(l,d)&&d!="constructor"&&c.push(d);return c}function Ae(l,c){if(c)return l.slice();var d=new l.constructor(l.length);return l.copy(d),d}function Qe(l){var c=new l.constructor(l.byteLength);return new Fe(c).set(new Fe(l)),c}function ie(l,c){var d=c?Qe(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.byteLength)}function Is(l,c,d){var y=c?d(ws(l),!0):ws(l);return Ue(y,gn,new l.constructor)}function Rs(l){var c=new l.constructor(l.source,un.exec(l));return c.lastIndex=l.lastIndex,c}function Fn(l,c,d){var y=c?d(xs(l),!0):xs(l);return Ue(y,mt,new l.constructor)}function Vn(l){return ks?Object(ks.call(l)):{}}function zn(l,c){var d=c?Qe(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.length)}function Kn(l,c){var d=-1,y=l.length;for(c||(c=Array(y));++d<y;)c[d]=l[d];return c}function Je(l,c,d,y){d||(d={});for(var M=-1,B=c.length;++M<B;){var j=c[M],D=void 0;Os(d,j,D===void 0?l[j]:D)}return d}function Gn(l,c){return Je(l,Pt(l),c)}function Zn(l){return jn(l,ss,Pt)}function le(l,c){var d=l.__data__;return Qn(c)?d[typeof c=="string"?"string":"hash"]:d.map}function yt(l,c){var d=As(l,c);return $n(d)?d:void 0}var Pt=Ve?$e(Ve,Object):er,$t=Pn;(ye&&$t(new ye(new ArrayBuffer(1)))!=I||se&&$t(new se)!=f||bt&&$t(bt.resolve())!=v||ve&&$t(new ve)!=N||ze&&$t(new ze)!=x)&&($t=function(l){var c=ge.call(l),d=c==m?l.constructor:void 0,y=d?nt(d):void 0;if(y)switch(y){case Ke:return I;case re:return f;case Ge:return v;case Ze:return N;case We:return x}return c});function Wn(l){var c=l.length,d=l.constructor(c);return c&&typeof l[0]=="string"&&St.call(l,"index")&&(d.index=l.index,d.input=l.input),d}function Ct(l){return typeof l.constructor=="function"&&!Bs(l)?Un(ct(l)):{}}function Yn(l,c,d,y){var M=l.constructor;switch(c){case T:return Qe(l);case a:case u:return new M(+l);case I:return ie(l,y);case R:case L:case F:case X:case Ut:case _t:case de:case fe:case U:return zn(l,y);case f:return Is(l,y,d);case g:case q:return new M(l);case E:return Rs(l);case N:return Fn(l,y,d);case w:return Vn(l)}}function Xn(l,c){return c=c??n,!!c&&(typeof l=="number"||dn.test(l))&&l>-1&&l%1==0&&l<c}function Qn(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function Jn(l){return!!Ts&&Ts in l}function Bs(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||pe;return l===d}function nt(l){if(l!=null){try{return qs.call(l)}catch{}try{return l+""}catch{}}return""}function Ms(l){return Xe(l,!0,!0)}function Ds(l,c){return l===c||l!==l&&c!==c}function we(l){return tr(l)&&St.call(l,"callee")&&(!_s.call(l,"callee")||ge.call(l)==i)}var ts=Array.isArray;function xe(l){return l!=null&&js(l.length)&&!es(l)}function tr(l){return Ps(l)&&xe(l)}var Us=be||sr;function es(l){var c=Ot(l)?ge.call(l):"";return c==p||c==b}function js(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=n}function Ot(l){var c=typeof l;return!!l&&(c=="object"||c=="function")}function Ps(l){return!!l&&typeof l=="object"}function ss(l){return xe(l)?Ee(l):Hn(l)}function er(){return[]}function sr(){return!1}r.exports=Ms})(Qs,Qs.exports);var Di=Qs.exports,Js={exports:{}};Js.exports;(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]",p="[object Boolean]",b="[object Date]",f="[object Error]",g="[object Function]",m="[object GeneratorFunction]",v="[object Map]",E="[object Number]",N="[object Null]",q="[object Object]",w="[object Promise]",x="[object Proxy]",T="[object RegExp]",I="[object Set]",R="[object String]",L="[object Symbol]",F="[object Undefined]",X="[object WeakMap]",Ut="[object ArrayBuffer]",_t="[object DataView]",de="[object Float32Array]",fe="[object Float64Array]",U="[object Int8Array]",cn="[object Int16Array]",un="[object Int32Array]",hn="[object Uint8Array]",dn="[object Uint8ClampedArray]",$="[object Uint16Array]",fn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,gt=/^\[object .+?Constructor\]$/,ys=/^(?:0|[1-9]\d*)$/,H={};H[de]=H[fe]=H[U]=H[cn]=H[un]=H[hn]=H[dn]=H[$]=H[fn]=!0,H[a]=H[u]=H[Ut]=H[p]=H[_t]=H[b]=H[f]=H[g]=H[v]=H[E]=H[q]=H[T]=H[I]=H[R]=H[X]=!1;var vs=typeof Yt=="object"&&Yt&&Yt.Object===Object&&Yt,gn=typeof self=="object"&&self&&self.Object===Object&&self,mt=vs||gn||Function("return this")(),Es=t&&!t.nodeType&&t,Ns=Es&&!0&&r&&!r.nodeType&&r,Ue=Ns&&Ns.exports===Es,je=Ue&&vs.process,As=function(){try{return je&&je.binding&&je.binding("util")}catch{}}(),Pe=As&&As.isTypedArray;function ws(l,c){for(var d=-1,y=l==null?0:l.length,M=0,B=[];++d<y;){var j=l[d];c(j,d,l)&&(B[M++]=j)}return B}function $e(l,c){for(var d=-1,y=c.length,M=l.length;++d<y;)l[M+d]=c[d];return l}function xs(l,c){for(var d=-1,y=l==null?0:l.length;++d<y;)if(c(l[d],d,l))return!0;return!1}function mn(l,c){for(var d=-1,y=Array(l);++d<l;)y[d]=c(d);return y}function bn(l){return function(c){return l(c)}}function pe(l,c){return l.has(c)}function He(l,c){return l==null?void 0:l[c]}function Ts(l){var c=-1,d=Array(l.size);return l.forEach(function(y,M){d[++c]=[M,y]}),d}function qs(l,c){return function(d){return l(c(d))}}function St(l){var c=-1,d=Array(l.size);return l.forEach(function(y){d[++c]=y}),d}var ge=Array.prototype,yn=Function.prototype,ee=Object.prototype,me=mt["__core-js_shared__"],Fe=yn.toString,ct=ee.hasOwnProperty,Ls=function(){var l=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),_s=ee.toString,vn=RegExp("^"+Fe.call(ct).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=Ue?mt.Buffer:void 0,be=mt.Symbol,Ss=mt.Uint8Array,ye=ee.propertyIsEnumerable,se=ge.splice,bt=be?be.toStringTag:void 0,ve=Object.getOwnPropertySymbols,ze=Ve?Ve.isBuffer:void 0,ne=qs(Object.keys,Object),Ke=Pt(mt,"DataView"),re=Pt(mt,"Map"),Ge=Pt(mt,"Promise"),Ze=Pt(mt,"Set"),We=Pt(mt,"WeakMap"),Gt=Pt(Object,"create"),ks=nt(Ke),jt=nt(re),En=nt(Ge),Nn=nt(Ze),An=nt(We),Cs=be?be.prototype:void 0,Ye=Cs?Cs.valueOf:void 0;function Z(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function wn(){this.__data__=Gt?Gt(null):{},this.size=0}function xn(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}function Tn(l){var c=this.__data__;if(Gt){var d=c[l];return d===s?void 0:d}return ct.call(c,l)?c[l]:void 0}function qn(l){var c=this.__data__;return Gt?c[l]!==void 0:ct.call(c,l)}function Ln(l,c){var d=this.__data__;return this.size+=this.has(l)?0:1,d[l]=Gt&&c===void 0?s:c,this}Z.prototype.clear=wn,Z.prototype.delete=xn,Z.prototype.get=Tn,Z.prototype.has=qn,Z.prototype.set=Ln;function Q(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function _n(){this.__data__=[],this.size=0}function Sn(l){var c=this.__data__,d=Ae(c,l);if(d<0)return!1;var y=c.length-1;return d==y?c.pop():se.call(c,d,1),--this.size,!0}function kn(l){var c=this.__data__,d=Ae(c,l);return d<0?void 0:c[d][1]}function Cn(l){return Ae(this.__data__,l)>-1}function On(l,c){var d=this.__data__,y=Ae(d,l);return y<0?(++this.size,d.push([l,c])):d[y][1]=c,this}Q.prototype.clear=_n,Q.prototype.delete=Sn,Q.prototype.get=kn,Q.prototype.has=Cn,Q.prototype.set=On;function it(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var y=l[c];this.set(y[0],y[1])}}function In(){this.size=0,this.__data__={hash:new Z,map:new(re||Q),string:new Z}}function Rn(l){var c=yt(this,l).delete(l);return this.size-=c?1:0,c}function Bn(l){return yt(this,l).get(l)}function Mn(l){return yt(this,l).has(l)}function Dn(l,c){var d=yt(this,l),y=d.size;return d.set(l,c),this.size+=d.size==y?0:1,this}it.prototype.clear=In,it.prototype.delete=Rn,it.prototype.get=Bn,it.prototype.has=Mn,it.prototype.set=Dn;function Ee(l){var c=-1,d=l==null?0:l.length;for(this.__data__=new it;++c<d;)this.add(l[c])}function Os(l){return this.__data__.set(l,s),this}function Ne(l){return this.__data__.has(l)}Ee.prototype.add=Ee.prototype.push=Os,Ee.prototype.has=Ne;function kt(l){var c=this.__data__=new Q(l);this.size=c.size}function Xe(){this.__data__=new Q,this.size=0}function Un(l){var c=this.__data__,d=c.delete(l);return this.size=c.size,d}function jn(l){return this.__data__.get(l)}function Pn(l){return this.__data__.has(l)}function $n(l,c){var d=this.__data__;if(d instanceof Q){var y=d.__data__;if(!re||y.length<e-1)return y.push([l,c]),this.size=++d.size,this;d=this.__data__=new it(y)}return d.set(l,c),this.size=d.size,this}kt.prototype.clear=Xe,kt.prototype.delete=Un,kt.prototype.get=jn,kt.prototype.has=Pn,kt.prototype.set=$n;function Hn(l,c){var d=we(l),y=!d&&Ds(l),M=!d&&!y&&xe(l),B=!d&&!y&&!M&&Ps(l),j=d||y||M||B,D=j?mn(l.length,String):[],z=D.length;for(var P in l)ct.call(l,P)&&!(j&&(P=="length"||M&&(P=="offset"||P=="parent")||B&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Yn(P,z)))&&D.push(P);return D}function Ae(l,c){for(var d=l.length;d--;)if(Ms(l[d][0],c))return d;return-1}function Qe(l,c,d){var y=c(l);return we(l)?y:$e(y,d(l))}function ie(l){return l==null?l===void 0?F:N:bt&&bt in Object(l)?$t(l):Bs(l)}function Is(l){return Ot(l)&&ie(l)==a}function Rs(l,c,d,y,M){return l===c?!0:l==null||c==null||!Ot(l)&&!Ot(c)?l!==l&&c!==c:Fn(l,c,d,y,Rs,M)}function Fn(l,c,d,y,M,B){var j=we(l),D=we(c),z=j?u:Ct(l),P=D?u:Ct(c);z=z==a?q:z,P=P==a?q:P;var J=z==q,lt=P==q,K=z==P;if(K&&xe(l)){if(!xe(c))return!1;j=!0,J=!1}if(K&&!J)return B||(B=new kt),j||Ps(l)?Je(l,c,d,y,M,B):Gn(l,c,z,d,y,M,B);if(!(d&n)){var tt=J&&ct.call(l,"__wrapped__"),W=lt&&ct.call(c,"__wrapped__");if(tt||W){var Zt=tt?l.value():l,Ht=W?c.value():c;return B||(B=new kt),M(Zt,Ht,d,y,B)}}return K?(B||(B=new kt),Zn(l,c,d,y,M,B)):!1}function Vn(l){if(!js(l)||Qn(l))return!1;var c=Us(l)?vn:gt;return c.test(nt(l))}function zn(l){return Ot(l)&&es(l.length)&&!!H[ie(l)]}function Kn(l){if(!Jn(l))return ne(l);var c=[];for(var d in Object(l))ct.call(l,d)&&d!="constructor"&&c.push(d);return c}function Je(l,c,d,y,M,B){var j=d&n,D=l.length,z=c.length;if(D!=z&&!(j&&z>D))return!1;var P=B.get(l);if(P&&B.get(c))return P==c;var J=-1,lt=!0,K=d&i?new Ee:void 0;for(B.set(l,c),B.set(c,l);++J<D;){var tt=l[J],W=c[J];if(y)var Zt=j?y(W,tt,J,c,l,B):y(tt,W,J,l,c,B);if(Zt!==void 0){if(Zt)continue;lt=!1;break}if(K){if(!xs(c,function(Ht,oe){if(!pe(K,oe)&&(tt===Ht||M(tt,Ht,d,y,B)))return K.push(oe)})){lt=!1;break}}else if(!(tt===W||M(tt,W,d,y,B))){lt=!1;break}}return B.delete(l),B.delete(c),lt}function Gn(l,c,d,y,M,B,j){switch(d){case _t:if(l.byteLength!=c.byteLength||l.byteOffset!=c.byteOffset)return!1;l=l.buffer,c=c.buffer;case Ut:return!(l.byteLength!=c.byteLength||!B(new Ss(l),new Ss(c)));case p:case b:case E:return Ms(+l,+c);case f:return l.name==c.name&&l.message==c.message;case T:case R:return l==c+"";case v:var D=Ts;case I:var z=y&n;if(D||(D=St),l.size!=c.size&&!z)return!1;var P=j.get(l);if(P)return P==c;y|=i,j.set(l,c);var J=Je(D(l),D(c),y,M,B,j);return j.delete(l),J;case L:if(Ye)return Ye.call(l)==Ye.call(c)}return!1}function Zn(l,c,d,y,M,B){var j=d&n,D=le(l),z=D.length,P=le(c),J=P.length;if(z!=J&&!j)return!1;for(var lt=z;lt--;){var K=D[lt];if(!(j?K in c:ct.call(c,K)))return!1}var tt=B.get(l);if(tt&&B.get(c))return tt==c;var W=!0;B.set(l,c),B.set(c,l);for(var Zt=j;++lt<z;){K=D[lt];var Ht=l[K],oe=c[K];if(y)var Zr=j?y(oe,Ht,K,c,l,B):y(Ht,oe,K,l,c,B);if(!(Zr===void 0?Ht===oe||M(Ht,oe,d,y,B):Zr)){W=!1;break}Zt||(Zt=K=="constructor")}if(W&&!Zt){var $s=l.constructor,Hs=c.constructor;$s!=Hs&&"constructor"in l&&"constructor"in c&&!(typeof $s=="function"&&$s instanceof $s&&typeof Hs=="function"&&Hs instanceof Hs)&&(W=!1)}return B.delete(l),B.delete(c),W}function le(l){return Qe(l,ss,Wn)}function yt(l,c){var d=l.__data__;return Xn(c)?d[typeof c=="string"?"string":"hash"]:d.map}function Pt(l,c){var d=He(l,c);return Vn(d)?d:void 0}function $t(l){var c=ct.call(l,bt),d=l[bt];try{l[bt]=void 0;var y=!0}catch{}var M=_s.call(l);return y&&(c?l[bt]=d:delete l[bt]),M}var Wn=ve?function(l){return l==null?[]:(l=Object(l),ws(ve(l),function(c){return ye.call(l,c)}))}:er,Ct=ie;(Ke&&Ct(new Ke(new ArrayBuffer(1)))!=_t||re&&Ct(new re)!=v||Ge&&Ct(Ge.resolve())!=w||Ze&&Ct(new Ze)!=I||We&&Ct(new We)!=X)&&(Ct=function(l){var c=ie(l),d=c==q?l.constructor:void 0,y=d?nt(d):"";if(y)switch(y){case ks:return _t;case jt:return v;case En:return w;case Nn:return I;case An:return X}return c});function Yn(l,c){return c=c??o,!!c&&(typeof l=="number"||ys.test(l))&&l>-1&&l%1==0&&l<c}function Xn(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function Qn(l){return!!Ls&&Ls in l}function Jn(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||ee;return l===d}function Bs(l){return _s.call(l)}function nt(l){if(l!=null){try{return Fe.call(l)}catch{}try{return l+""}catch{}}return""}function Ms(l,c){return l===c||l!==l&&c!==c}var Ds=Is(function(){return arguments}())?Is:function(l){return Ot(l)&&ct.call(l,"callee")&&!ye.call(l,"callee")},we=Array.isArray;function ts(l){return l!=null&&es(l.length)&&!Us(l)}var xe=ze||sr;function tr(l,c){return Rs(l,c)}function Us(l){if(!js(l))return!1;var c=ie(l);return c==g||c==m||c==h||c==x}function es(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function js(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}function Ot(l){return l!=null&&typeof l=="object"}var Ps=Pe?bn(Pe):zn;function ss(l){return ts(l)?Hn(l):Kn(l)}function er(){return[]}function sr(){return!1}r.exports=tr})(Js,Js.exports);var Ui=Js.exports,Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});const eo=Di,so=Ui;var yr;(function(r){function t(i={},o={},a=!1){typeof i!="object"&&(i={}),typeof o!="object"&&(o={});let u=eo(o);a||(u=Object.keys(u).reduce((h,p)=>(u[p]!=null&&(h[p]=u[p]),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)=>(so(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,p)=>(i[p]===void 0&&(h[p]=o[p]),h),{});return Object.keys(u).length>0?u:void 0}r.transform=n})(yr||(yr={}));Mr.default=yr;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});var vr;(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})(vr||(vr={}));rn.default=vr;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});const ni=rn;class no{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=ni.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]?ni.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[]}}Dr.default=no;(function(r,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=to,s=Di,n=Ui,i=Mr;t.AttributeMap=i.default;const o=rn;t.Op=o.default;const a=Dr;t.OpIterator=a.default;const u="\0",h=(b,f)=>{if(typeof b!="object"||b===null)throw new Error(`cannot retain a ${typeof b}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const g=Object.keys(b)[0];if(!g||g!==Object.keys(f)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(f)[0]}`);return[g,b[g],f[g]]};class p{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,g){this.handlers[f]=g}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const g=this.handlers[f];if(!g)throw new Error(`no handlers for embed type "${f}"`);return g}insert(f,g){const m={};return typeof f=="string"&&f.length===0?this:(m.insert=f,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(m.attributes=g),this.push(m))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,g){if(typeof f=="number"&&f<=0)return this;const m={retain:f};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(m.attributes=g),this.push(m)}push(f){let g=this.ops.length,m=this.ops[g-1];if(f=s(f),typeof m=="object"){if(typeof f.delete=="number"&&typeof m.delete=="number")return this.ops[g-1]={delete:m.delete+f.delete},this;if(typeof m.delete=="number"&&f.insert!=null&&(g-=1,m=this.ops[g-1],typeof m!="object"))return this.ops.unshift(f),this;if(n(f.attributes,m.attributes)){if(typeof f.insert=="string"&&typeof m.insert=="string")return this.ops[g-1]={insert:m.insert+f.insert},typeof f.attributes=="object"&&(this.ops[g-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof m.retain=="number")return this.ops[g-1]={retain:m.retain+f.retain},typeof f.attributes=="object"&&(this.ops[g-1].attributes=f.attributes),this}}return g===this.ops.length?this.ops.push(f):this.ops.splice(g,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const g=[],m=[];return this.forEach(v=>{(f(v)?g:m).push(v)}),[g,m]}reduce(f,g){return this.ops.reduce(f,g)}changeLength(){return this.reduce((f,g)=>g.insert?f+o.default.length(g):g.delete?f-g.delete:f,0)}length(){return this.reduce((f,g)=>f+o.default.length(g),0)}slice(f=0,g=1/0){const m=[],v=new a.default(this.ops);let E=0;for(;E<g&&v.hasNext();){let N;E<f?N=v.next(f-E):(N=v.next(g-E),m.push(N)),E+=o.default.length(N)}return new p(m)}compose(f){const g=new a.default(this.ops),m=new a.default(f.ops),v=[],E=m.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){let q=E.retain;for(;g.peekType()==="insert"&&g.peekLength()<=q;)q-=g.peekLength(),v.push(g.next());E.retain-q>0&&m.next(E.retain-q)}const N=new p(v);for(;g.hasNext()||m.hasNext();)if(m.peekType()==="insert")N.push(m.next());else if(g.peekType()==="delete")N.push(g.next());else{const q=Math.min(g.peekLength(),m.peekLength()),w=g.next(q),x=m.next(q);if(x.retain){const T={};if(typeof w.retain=="number")T.retain=typeof x.retain=="number"?q:x.retain;else if(typeof x.retain=="number")w.retain==null?T.insert=w.insert:T.retain=w.retain;else{const R=w.retain==null?"insert":"retain",[L,F,X]=h(w[R],x.retain),Ut=p.getHandler(L);T[R]={[L]:Ut.compose(F,X,R==="retain")}}const I=i.default.compose(w.attributes,x.attributes,typeof w.retain=="number");if(I&&(T.attributes=I),N.push(T),!m.hasNext()&&n(N.ops[N.ops.length-1],T)){const R=new p(g.rest());return N.concat(R).chop()}}else typeof x.delete=="number"&&(typeof w.retain=="number"||typeof w.retain=="object"&&w.retain!==null)&&N.push(x)}return N.chop()}concat(f){const g=new p(this.ops.slice());return f.ops.length>0&&(g.push(f.ops[0]),g.ops=g.ops.concat(f.ops.slice(1))),g}diff(f,g){if(this.ops===f.ops)return new p;const m=[this,f].map(w=>w.map(x=>{if(x.insert!=null)return typeof x.insert=="string"?x.insert:u;const T=w===f?"on":"with";throw new Error("diff() called "+T+" non-document")}).join("")),v=new p,E=e(m[0],m[1],g,!0),N=new a.default(this.ops),q=new a.default(f.ops);return E.forEach(w=>{let x=w[1].length;for(;x>0;){let T=0;switch(w[0]){case e.INSERT:T=Math.min(q.peekLength(),x),v.push(q.next(T));break;case e.DELETE:T=Math.min(x,N.peekLength()),N.next(T),v.delete(T);break;case e.EQUAL:T=Math.min(N.peekLength(),q.peekLength(),x);const I=N.next(T),R=q.next(T);n(I.insert,R.insert)?v.retain(T,i.default.diff(I.attributes,R.attributes)):v.push(R).delete(T);break}x-=T}}),v.chop()}eachLine(f,g=`
  2. `){const m=new a.default(this.ops);let v=new p,E=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const N=m.peek(),q=o.default.length(N)-m.peekLength(),w=typeof N.insert=="string"?N.insert.indexOf(g,q)-q:-1;if(w<0)v.push(m.next());else if(w>0)v.push(m.next(w));else{if(f(v,m.next(1).attributes||{},E)===!1)return;E+=1,v=new p}}v.length()>0&&f(v,{},E)}invert(f){const g=new p;return this.reduce((m,v)=>{if(v.insert)g.delete(o.default.length(v));else{if(typeof v.retain=="number"&&v.attributes==null)return g.retain(v.retain),m+v.retain;if(v.delete||typeof v.retain=="number"){const E=v.delete||v.retain;return f.slice(m,m+E).forEach(q=>{v.delete?g.push(q):v.retain&&v.attributes&&g.retain(o.default.length(q),i.default.invert(v.attributes,q.attributes))}),m+E}else if(typeof v.retain=="object"&&v.retain!==null){const E=f.slice(m,m+1),N=new a.default(E.ops).next(),[q,w,x]=h(v.retain,N.insert),T=p.getHandler(q);return g.retain({[q]:T.invert(w,x)},i.default.invert(v.attributes,N.attributes)),m+1}}return m},0),g.chop()}transform(f,g=!1){if(g=!!g,typeof f=="number")return this.transformPosition(f,g);const m=f,v=new a.default(this.ops),E=new a.default(m.ops),N=new p;for(;v.hasNext()||E.hasNext();)if(v.peekType()==="insert"&&(g||E.peekType()!=="insert"))N.retain(o.default.length(v.next()));else if(E.peekType()==="insert")N.push(E.next());else{const q=Math.min(v.peekLength(),E.peekLength()),w=v.next(q),x=E.next(q);if(w.delete)continue;if(x.delete)N.push(x);else{const T=w.retain,I=x.retain;let R=typeof I=="object"&&I!==null?I:q;if(typeof T=="object"&&T!==null&&typeof I=="object"&&I!==null){const L=Object.keys(T)[0];if(L===Object.keys(I)[0]){const F=p.getHandler(L);F&&(R={[L]:F.transform(T[L],I[L],g)})}}N.retain(R,i.default.transform(w.attributes,x.attributes,g))}}return N.chop()}transformPosition(f,g=!1){g=!!g;const m=new a.default(this.ops);let v=0;for(;m.hasNext()&&v<=f;){const E=m.peekLength(),N=m.peekType();if(m.next(),N==="delete"){f-=Math.min(E,f-v);continue}else N==="insert"&&(v<f||!g)&&(f+=E);v+=E}return f}}p.Op=o.default,p.OpIterator=a.default,p.AttributeMap=i.default,p.handlers={},t.default=p,r.exports=p,r.exports.default=p})(br,br.exports);var pt=br.exports;const C=qi(pt);class qt extends at{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}qt.blotName="break";qt.tagName="BR";let xt=class extends Xs{};const ro={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ln(r){return r.replace(/[&<>"']/g,t=>ro[t])}const Rt=class Rt extends Or{static compare(t,e){const s=Rt.order.indexOf(t),n=Rt.order.indexOf(e);return s>=0||n>=0?s-n:t===e?0:t<e?-1:1}formatAt(t,e,s,n){if(Rt.compare(this.statics.blotName,s)<0&&this.scroll.query(s,O.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 Rt&&Rt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};S(Rt,"allowedChildren",[Rt,qt,at,xt]),S(Rt,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Dt=Rt;const ri=1;class Y extends cs{constructor(){super(...arguments);S(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=ji(this)),this.cache.delta}deleteAt(e,s){super.deleteAt(e,s),this.cache={}}formatAt(e,s,n,i){s<=0||(this.scroll.query(n,O.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(`
  3. `),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 qt&&n.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+ri),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()-ri)){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}}Y.blotName="block";Y.tagName="P";Y.defaultChild=qt;Y.allowedChildren=[qt,Dt,at,xt];class ft extends at{attach(){super.attach(),this.attributes=new tn(this.domNode)}delta(){return new C().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const s=this.scroll.query(t,O.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(`
  4. `),i=n.pop(),o=n.map(u=>{const h=this.scroll.create(Y.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)}}ft.scope=O.BLOCK_BLOT;function ji(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(et).reduce((e,s)=>s.length()===0?e:e.insert(s.value(),ht(s,{},t)),new C).insert(`
  5. `,ht(r))}function ht(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:ht(r.parent,t,e)}const ut=class ut extends at{static value(){}constructor(t,e,s){super(t,e),this.selection=s,this.textNode=document.createTextNode(ut.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!==O.BLOCK_BLOT;)n+=s.offset(s.parent),s=s.parent;s!=null&&(this.savedLength=ut.CONTENTS.length,s.optimize(),s.formatAt(n,ut.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 xt?this.prev:null,s=e?e.length():0,n=this.next instanceof xt?this.next:null,i=n?n.text:"",{textNode:o}=this,a=o.data.split(ut.CONTENTS).join("");o.data=ut.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=(f,g)=>e&&f===e.domNode?g:f===o?s+g-1:n&&f===n.domNode?s+a.length+g:null,p=h(t.start.node,t.start.offset),b=h(t.end.node,t.end.offset);if(p!==null&&b!==null)return{startNode:u.domNode,startOffset:p,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=ut.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};S(ut,"blotName","cursor"),S(ut,"className","ql-cursor"),S(ut,"tagName","span"),S(ut,"CONTENTS","\uFEFF");let Be=ut;var Pi={exports:{}};(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,p){this.fn=u,this.context=h,this.once=p||!1}function i(u,h,p,b,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var g=new n(p,b||u,f),m=e?e+h:h;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],g]:u._events[m].push(g):(u._events[m]=g,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=[],p,b;if(this._eventsCount===0)return h;for(b in p=this._events)t.call(p,b)&&h.push(e?b.slice(1):b);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},a.prototype.listeners=function(h){var p=e?e+h:h,b=this._events[p];if(!b)return[];if(b.fn)return[b.fn];for(var f=0,g=b.length,m=new Array(g);f<g;f++)m[f]=b[f].fn;return m},a.prototype.listenerCount=function(h){var p=e?e+h:h,b=this._events[p];return b?b.fn?1:b.length:0},a.prototype.emit=function(h,p,b,f,g,m){var v=e?e+h:h;if(!this._events[v])return!1;var E=this._events[v],N=arguments.length,q,w;if(E.fn){switch(E.once&&this.removeListener(h,E.fn,void 0,!0),N){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,p),!0;case 3:return E.fn.call(E.context,p,b),!0;case 4:return E.fn.call(E.context,p,b,f),!0;case 5:return E.fn.call(E.context,p,b,f,g),!0;case 6:return E.fn.call(E.context,p,b,f,g,m),!0}for(w=1,q=new Array(N-1);w<N;w++)q[w-1]=arguments[w];E.fn.apply(E.context,q)}else{var x=E.length,T;for(w=0;w<x;w++)switch(E[w].once&&this.removeListener(h,E[w].fn,void 0,!0),N){case 1:E[w].fn.call(E[w].context);break;case 2:E[w].fn.call(E[w].context,p);break;case 3:E[w].fn.call(E[w].context,p,b);break;case 4:E[w].fn.call(E[w].context,p,b,f);break;default:if(!q)for(T=1,q=new Array(N-1);T<N;T++)q[T-1]=arguments[T];E[w].fn.apply(E[w].context,q)}}return!0},a.prototype.on=function(h,p,b){return i(this,h,p,b,!1)},a.prototype.once=function(h,p,b){return i(this,h,p,b,!0)},a.prototype.removeListener=function(h,p,b,f){var g=e?e+h:h;if(!this._events[g])return this;if(!p)return o(this,g),this;var m=this._events[g];if(m.fn)m.fn===p&&(!f||m.once)&&(!b||m.context===b)&&o(this,g);else{for(var v=0,E=[],N=m.length;v<N;v++)(m[v].fn!==p||f&&!m[v].once||b&&m[v].context!==b)&&E.push(m[v]);E.length?this._events[g]=E.length===1?E[0]:E:o(this,g)}return this},a.prototype.removeAllListeners=function(h){var p;return h?(p=e?e+h:h,this._events[p]&&o(this,p)):(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})(Pi);var io=Pi.exports;const lo=qi(io),Er=new WeakMap,Nr=["error","warn","log","info"];let Ar="warn";function $i(r){if(Ar&&Nr.indexOf(r)<=Nr.indexOf(Ar)){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 Kt(r){return Nr.reduce((t,e)=>(t[e]=$i.bind(console,e,r),t),{})}Kt.level=r=>{Ar=r};$i.level=Kt.level;const ir=Kt("quill:events"),oo=["selectionchange","mousedown","mouseup","click"];oo.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=Er.get(n);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class k extends lo{constructor(){super(),this.domListeners={},this.on("error",ir.error)}emit(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return ir.log.call(ir,...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})}}S(k,"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"}),S(k,"sources",{API:"api",SILENT:"silent",USER:"user"});const lr=Kt("quill:selection");class ae{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class ao{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 ae(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,k.sources.USER),1)}),this.emitter.on(k.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const s=this.getNativeRange();s!=null&&s.start.node!==this.cursor.textNode&&this.emitter.once(k.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?k.sources.SILENT:n)}catch{}})}),this.emitter.on(k.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(k.sources.SILENT)}}),this.update(k.sources.SILENT)}handleComposition(){this.emitter.on(k.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(k.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(k.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,O.BLOCK))){if(s.start.node!==this.cursor.textNode){const n=this.scroll.find(s.start.node,!1);if(n==null)return;if(n instanceof et){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[p]=this.scroll.leaf(t+1);if(p){const[b]=this.scroll.line(t),[f]=this.scroll.line(t+1);b===f&&(i=p,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 lr.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&&or(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),p=h.offset(this.scroll);return u===0?p:h instanceof et?p+h.index(a,u):p+h.length()}),n=Math.min(Math.max(...s),this.scroll.length()-1),i=Math.min(n,...s);return new ae(i,n-i)}normalizeNative(t){if(!or(this.root,t.startContainer)||!t.collapsed&&!or(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(lr.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]:k.sources.API;if(typeof e=="string"&&(s=e,e=!1),lr.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]:k.sources.USER;const e=this.lastRange,[s,n]=this.getRange();if(this.lastRange=s,this.lastNative=n,this.lastRange!=null&&(this.savedRange=this.lastRange),!Cr(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=[k.events.SELECTION_CHANGE,Ce(this.lastRange),Ce(e),t];this.emitter.emit(k.events.EDITOR_CHANGE,...i),t!==k.sources.SILENT&&this.emitter.emit(...i)}}}function or(r,t){try{t.parentNode}catch{return!1}return r.contains(t)}const co=/^[ -~]*$/;class uo{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const s=ii(t),n=new C;return fo(s.ops.slice()).reduce((o,a)=>{const u=pt.Op.length(a);let h=a.attributes||{},p=!1,b=!1;if(a.insert!=null){if(n.retain(u),typeof a.insert=="string"){const m=a.insert;b=!m.endsWith(`
  6. `)&&(e<=o||!!this.scroll.descendant(ft,o)[0]),this.scroll.insertAt(o,m);const[v,E]=this.scroll.line(o);let N=Jt({},ht(v));if(v instanceof Y){const[q]=v.descendant(et,E);q&&(N=Jt(N,ht(q)))}h=pt.AttributeMap.diff(N,h)||{}}else if(typeof a.insert=="object"){const m=Object.keys(a.insert)[0];if(m==null)return o;const v=this.scroll.query(m,O.INLINE)!=null;if(v)(e<=o||this.scroll.descendant(ft,o)[0])&&(b=!0);else if(o>0){const[E,N]=this.scroll.descendant(et,o-1);E instanceof xt?E.value()[N]!==`
  7. `&&(p=!0):E instanceof at&&E.statics.scope===O.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(o,m,a.insert[m]),v){const[E]=this.scroll.descendant(et,o);if(E){const N=Jt({},ht(E));h=pt.AttributeMap.diff(N,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 f=p?1:0,g=b?1:0;return e+=f+g,n.retain(f),n.delete(g),o+u+f+g},0),n.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+pt.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 C().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 C().retain(t).retain(e,Ce(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 C().retain(t).retain(e,Ce(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 C)}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 Y?s.push(u):u instanceof et&&n.push(u)}):(s=this.scroll.lines(t,e),n=this.scroll.descendants(et,t,e));const[i,o]=[s,n].map(a=>{const u=a.shift();if(u==null)return{};let h=ht(u);for(;Object.keys(h).length>0;){const p=a.shift();if(p==null)return h;h=ho(ht(p),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)?hs(s,n,e,!0):hs(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=ii(e),n=new C().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 C().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,`
  8. `).replace(/\r/g,`
  9. `),this.scroll.insertAt(t,e),Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e.length,n,s[n])}),this.update(new C().retain(t).insert(e,Ce(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)!==Y.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof qt}removeFormat(t,e){const s=this.getText(t,e),[n,i]=this.scroll.line(t+e);let o=0,a=new C;n!=null&&(o=n.length()-i,a=n.delta().slice(i,i+o-1).insert(`
  10. `));const h=this.getContents(t,e+o).diff(new C().insert(s).concat(a)),p=new C().retain(t).concat(h);return this.applyDelta(p)}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(co)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=ht(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(Be.CONTENTS,""),h=new C().insert(u),p=new C().insert(i.value()),b=s&&{oldRange:li(s.oldRange,-a),newRange:li(s.newRange,-a)};t=new C().retain(a).concat(h.diff(p,b)).reduce((g,m)=>m.insert?g.insert(m.insert,o):g.push(m),new C),this.delta=n.compose(t)}else this.delta=this.getDelta(),(!t||!Cr(n.compose(t),this.delta))&&(t=n.diff(this.delta,s));return t}}function Se(r,t,e){if(r.length===0){const[g]=ar(e.pop());return t<=0?`</li></${g}>`:`</li></${g}>${Se([],t-1,e)}`}const[{child:s,offset:n,length:i,indent:o,type:a},...u]=r,[h,p]=ar(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${p}>${hs(s,n,i)}${Se(u,o,e)}`:`<${h}><li>${Se(r,t+1,e)}`;const b=e[e.length-1];if(o===t&&a===b)return`</li><li${p}>${hs(s,n,i)}${Se(u,o,e)}`;const[f]=ar(e.pop());return`</li></${f}>${Se(r,t-1,e)}`}function hs(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 xt)return ln(r.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(r instanceof wt){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(p,b,f)=>{const g="formats"in p&&typeof p.formats=="function"?p.formats():{};h.push({child:p,offset:b,length:f,indent:g.indent||0,type:g.list})}),Se(h,-1,[])}const n=[];if(r.children.forEachAt(t,e,(h,p,b)=>{n.push(hs(h,p,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 ho(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 ar(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 ii(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const s=e.insert.replace(/\r\n/g,`
  11. `).replace(/\r/g,`
  12. `);return t.insert(s,e.attributes)}return t.push(e)},new C)}function li(r,t){let{index:e,length:s}=r;return new ae(e+t,s)}function fo(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
  13. `).forEach((n,i)=>{i&&t.push({insert:`
  14. `,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}class Lt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}S(Lt,"DEFAULTS",{});const Vs="\uFEFF";class Ur extends at{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(Vs),this.rightGuard=document.createTextNode(Vs),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(Vs).join("");if(t===this.leftGuard)if(this.prev instanceof xt){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 xt?(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=Vs,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 po{constructor(t,e){S(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 Ur)&&(this.emitter.emit(k.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(k.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(k.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(k.events.COMPOSITION_END,t),this.isComposing=!1}}const os=class os{constructor(t,e){S(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]}};S(os,"DEFAULTS",{modules:{}}),S(os,"themes",{default:os});let Me=os;const go=r=>r.parentElement||r.getRootNode().host||null,mo=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}},zs=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},oi=(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,bo=(r,t)=>{var i,o,a;const e=r.ownerDocument;let s=t,n=r;for(;n;){const u=n===e.body,h=u?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??e.documentElement.clientHeight,left:0}:mo(n),p=getComputedStyle(n),b=oi(s.left,s.right,h.left,h.right,zs(p.scrollPaddingLeft),zs(p.scrollPaddingRight)),f=oi(s.top,s.bottom,h.top,h.bottom,zs(p.scrollPaddingTop),zs(p.scrollPaddingBottom));if(b||f)if(u)(a=e.defaultView)==null||a.scrollBy(b,f);else{const{scrollLeft:g,scrollTop:m}=n;f&&(n.scrollTop+=f),b&&(n.scrollLeft+=b);const v=n.scrollLeft-g,E=n.scrollTop-m;s={left:s.left-v,top:s.top-E,right:s.right-v,bottom:s.bottom-E}}n=u||p.position==="fixed"?null:go(n)}},yo=100,vo=["block","break","cursor","inline","scroll","text"],Eo=(r,t,e)=>{const s=new Re;return vo.forEach(n=>{const i=t.query(n);i&&s.register(i)}),r.forEach(n=>{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?i.requiredContainer??null:null,o+=1,o>yo){e.error(`Cycle detected in registering blot requiredContainer: "${n}"`);break}}),s},Ie=Kt("quill"),Ks=new Re;wt.uiClass="ql-ui";const Nt=class Nt{static debug(t){t===!0&&(t="log"),Kt.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Er.get(t)||Ks.find(t,e)}static import(t){return this.imports[t]==null&&Ie.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&&Ie.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&Ks.register(e),typeof e.register=="function"&&e.register(Ks)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=No(t,e),this.container=this.options.container,this.container==null){Ie.error("Invalid Quill container",t);return}this.options.debug&&Nt.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Er.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new k;const n=Ir.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 uo(this.scroll),this.selection=new ao(this.scroll,this.emitter),this.composition=new po(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(k.events.EDITOR_CHANGE,o=>{o===k.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(k.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Et.call(this,()=>this.editor.update(null,a,p),o)}),this.emitter.on(k.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Et.call(this,()=>{const b=new C().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(b,[],p)},Nt.sources.USER)}),s){const o=this.clipboard.convert({html:`${s}<p><br></p>`,text:`
  15. `});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]=Ft(t,e,s),Et.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]:k.sources.API;return Et.call(this,()=>{const n=this.getSelection(!0);let i=new C;if(n==null)return i;if(this.scroll.query(t,O.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,k.sources.SILENT),i},s)}formatLine(t,e,s,n,i){let o;return[t,e,o,i]=Ft(t,e,s,n,i),Et.call(this,()=>this.editor.formatLine(t,e,o),i,t,0)}formatText(t,e,s,n,i){let o;return[t,e,o,i]=Ft(t,e,s,n,i),Et.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]=Ft(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??this.getLength()-t),[t,e]=Ft(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??this.getLength()-t),[t,e]=Ft(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]:Nt.sources.API;return Et.call(this,()=>this.editor.insertEmbed(t,e,s),n,t)}insertText(t,e,s,n,i){let o;return[t,,o,i]=Ft(t,0,s,n,i),Et.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]=Ft(t,e,s),Et.call(this,()=>this.editor.removeFormat(t,e),s,t)}scrollRectIntoView(t){bo(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]:k.sources.API;return Et.call(this,()=>{t=new C(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||Nt.sources.API):([t,e,,s]=Ft(t,e,s),this.selection.setRange(new ae(Math.max(0,t),e),s),s!==k.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k.sources.API;const s=new C().insert(t);return this.setContents(s,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k.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]:k.sources.API;return Et.call(this,()=>(t=new C(t),this.editor.applyDelta(t)),e,!0)}};S(Nt,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ks,theme:"default"}),S(Nt,"events",k.events),S(Nt,"sources",k.sources),S(Nt,"version","2.0.3"),S(Nt,"imports",{delta:C,parchment:Vl,"core/module":Lt,"core/theme":Me});let A=Nt;function ai(r){return typeof r=="string"?document.querySelector(r):r}function cr(r){return Object.entries(r??{}).reduce((t,e)=>{let[s,n]=e;return{...t,[s]:n===!0?{}:n}},{})}function ci(r){return Object.fromEntries(Object.entries(r).filter(t=>t[1]!==void 0))}function No(r,t){const e=ai(r);if(!e)throw new Error("Invalid Quill container");const n=!t.theme||t.theme===A.DEFAULTS.theme?Me:A.import(`themes/${t.theme}`);if(!n)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=A.DEFAULTS,{modules:a,...u}=n.DEFAULTS;let h=cr(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const p=Jt({},cr(i),cr(a),h),b={...o,...ci(u),...ci(t)};let f=t.registry;return f?t.formats&&Ie.warn('Ignoring "formats" option because "registry" is specified'):f=t.formats?Eo(t.formats,b.registry,Ie):b.registry,{...b,registry:f,container:e,theme:n,modules:Object.entries(p).reduce((g,m)=>{let[v,E]=m;if(!E)return g;const N=A.import(`modules/${v}`);return N==null?(Ie.error(`Cannot load ${v} module. Are you sure you registered it?`),g):{...g,[v]:Jt({},N.DEFAULTS||{},E)}},{}),bounds:ai(b.bounds)}}function Et(r,t,e,s){if(!this.isEnabled()&&t===k.sources.USER&&!this.allowReadOnlyEdits)return new C;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=ui(n,o,t):s!==0&&(n=ui(n,e,s,t)),this.setSelection(n,k.sources.SILENT)),o.length()>0){const a=[k.events.TEXT_CHANGE,o,i,t];this.emitter.emit(k.events.EDITOR_CHANGE,...a),t!==k.sources.SILENT&&this.emitter.emit(...a)}return o}function Ft(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||k.sources.API,[r,t,i,n]}function ui(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!==k.sources.USER)):[i,o]=[r.index,r.index+r.length].map(a=>a<t||a===t&&s===k.sources.USER?a:n>=0?a+n:Math.max(t,a+n)),new ae(i,o-i)}class ce extends en{}function hi(r){return r instanceof Y||r instanceof ft}function di(r){return typeof r.updateContent=="function"}class ke extends Ir{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(k.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(k.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(k.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 ft||i instanceof ft){this.optimize();return}const o=i.children.head instanceof qt?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,O.BLOCK)==null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n),s==null&&e.endsWith(`
  16. `)?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===O.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 C().insert(`
  17. `))),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(ft,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new C().insert({[i.key]:i.value});ur(this,t,h);const p=i.type==="block"?1:0,b=t+h.length()+p;u&&this.insertAt(b-1,`
  18. `);const f=ht(this.line(t)[0]),g=pt.AttributeMap.diff(f,i.attributes)||{};Object.keys(g).forEach(m=>{this.formatAt(b-1,1,m,g[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);ur(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(p=>{h.format(p,u.attributes[p])})}})),n.type==="block"&&n.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();ur(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 et?[s,n]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(hi,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,p,b)=>{hi(h)?a.push(h):h instanceof en&&(a=a.concat(s(h,p,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(k.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=k.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&&!di(i)}),t.length>0&&this.emitter.emit(k.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(k.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,s){const[n]=this.descendant(i=>i instanceof ft,t);n&&n.statics.blotName===e&&di(n)&&n.updateContent(s)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let s=new C;return t.forEach(n=>{const i=n==null?void 0:n.insert;if(i)if(typeof i=="string"){const o=i.split(`
  19. `);o.slice(0,-1).forEach(u=>{s.insert(u,n.attributes),e.push({type:"block",delta:s,attributes:n.attributes??{}}),s=new C});const a=o[o.length-1];a&&s.insert(a,n.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,O.INLINE)?s.push(n):(s.length()&&e.push({type:"block",delta:s,attributes:{}}),s=new C,e.push({type:"blockEmbed",key:o,value:i[o],attributes:n.attributes??{}}))}}),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,O.BLOCK&O.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}}S(ke,"blotName","scroll"),S(ke,"className","ql-editor"),S(ke,"tagName","DIV"),S(ke,"defaultChild",Y),S(ke,"allowedChildren",[Y,ft,ce]);function ur(r,t,e){e.reduce((s,n)=>{const i=pt.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(et,s),h=ht(u);o=pt.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,O.INLINE)!=null){const[h]=r.descendant(et,s),p=ht(h);o=pt.AttributeMap.diff(p,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(s,i,a,o[a])}),s+i},t)}const jr={scope:O.BLOCK,whitelist:["right","center","justify"]},Ao=new Mt("align","align",jr),Hi=new Tt("align","ql-align",jr),Fi=new te("align","text-align",jr);class Vi extends te{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 wo=new Tt("color","ql-color",{scope:O.INLINE}),Pr=new Vi("color","color",{scope:O.INLINE}),xo=new Tt("background","ql-bg",{scope:O.INLINE}),$r=new Vi("background","background-color",{scope:O.INLINE});class ue extends ce{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(`
  20. `).slice(t,t+e)}html(t,e){return`<pre>
  21. ${ln(this.code(t,e))}
  22. </pre>`}}class st extends Y{static register(){A.register(ue)}}S(st,"TAB"," ");class Hr extends Dt{}Hr.blotName="code";Hr.tagName="CODE";st.blotName="code-block";st.className="ql-code-block";st.tagName="DIV";ue.blotName="code-block-container";ue.className="ql-code-block-container";ue.tagName="DIV";ue.allowedChildren=[st];st.allowedChildren=[xt,qt,Be];st.requiredContainer=ue;const Fr={scope:O.BLOCK,whitelist:["rtl"]},zi=new Mt("direction","dir",Fr),Ki=new Tt("direction","ql-direction",Fr),Gi=new te("direction","direction",Fr),Zi={scope:O.INLINE,whitelist:["serif","monospace"]},Wi=new Tt("font","ql-font",Zi);class To extends te{value(t){return super.value(t).replace(/["']/g,"")}}const Yi=new To("font","font-family",Zi),Xi=new Tt("size","ql-size",{scope:O.INLINE,whitelist:["small","large","huge"]}),Qi=new te("size","font-size",{scope:O.INLINE,whitelist:["10px","18px","32px"]}),qo=Kt("quill:keyboard"),Lo=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class on extends Lt{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=So(t);if(n==null){qo.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(N=>on.match(t,N));if(n.length===0)return;const i=A.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,p]=this.quill.getLeaf(o.index),[b,f]=o.length===0?[h,p]:this.quill.getLeaf(o.index+o.length),g=h instanceof Xs?h.value().slice(0,p):"",m=b instanceof Xs?b.value().slice(f):"",v={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:g,suffix:m,event:t};n.some(N=>{if(N.collapsed!=null&&N.collapsed!==v.collapsed||N.empty!=null&&N.empty!==v.empty||N.offset!=null&&N.offset!==v.offset)return!1;if(Array.isArray(N.format)){if(N.format.every(q=>v.format[q]==null))return!1}else if(typeof N.format=="object"&&!Object.keys(N.format).every(q=>N.format[q]===!0?v.format[q]!=null:N.format[q]===!1?v.format[q]==null:Cr(N.format[q],v.format[q])))return!1;return N.prefix!=null&&!N.prefix.test(v.prefix)||N.suffix!=null&&!N.suffix.test(v.suffix)?!1:N.handler.call(this,o,v,N)!==!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 C().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(),p=this.quill.getFormat(t.index-1,1);if(n=pt.AttributeMap.diff(h,p)||{},Object.keys(n).length>0){const b=new C().retain(t.index+i.length()-2).retain(1,n);o=o.compose(b)}}}this.quill.updateContents(o,A.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 C().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=pt.AttributeMap.diff(u,h)||{},Object.keys(n).length>0&&(o=o.retain(a.length()-1).retain(1,n))}}this.quill.updateContents(o,A.sources.USER),this.quill.focus()}handleDeleteRange(t){Vr({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,O.BLOCK)&&!Array.isArray(e.format[o])&&(i[o]=e.format[o]),i),{}),n=new C().retain(t.index).delete(t.length).insert(`
  23. `,s);this.quill.updateContents(n,A.sources.USER),this.quill.setSelection(t.index+1,A.sources.SILENT),this.quill.focus()}}const _o={bindings:{bold:hr("bold"),italic:hr("italic"),underline:hr("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",A.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",A.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",A.sources.USER):t.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":fi(!0),"outdent code-block":fi(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,A.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new C().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.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,A.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 C().retain(r.index).insert(`
  24. `,s).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(n,A.sources.USER),this.quill.setSelection(r.index+1,A.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 C().retain(r.index).insert(`
  25. `,t.format).retain(e.length()-s-1).retain(1,{header:null});this.quill.updateContents(n,A.sources.USER),this.quill.setSelection(r.index+1,A.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=ko(e,s,n,i);if(o==null)return;let a=e.offset();if(o<0){const u=new C().retain(a).insert(`
  26. `);this.quill.updateContents(u,A.sources.USER),this.quill.setSelection(r.index+1,r.length,A.sources.SILENT)}else if(o>0){a+=e.length();const u=new C().retain(a).insert(`
  27. `);this.quill.updateContents(u,A.sources.USER),this.quill.setSelection(a,A.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,A.sources.USER):this.quill.setSelection(n+s.length(),A.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," ",A.sources.USER),this.quill.history.cutoff();const o=new C().retain(r.index-n).delete(e+1).retain(s.length()-2-n).retain(1,{list:i});return this.quill.updateContents(o,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,A.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 C().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(r.index-1,A.sources.SILENT),!1}return!0}},"embed left":Gs("ArrowLeft",!1),"embed left shift":Gs("ArrowLeft",!0),"embed right":Gs("ArrowRight",!1),"embed right shift":Gs("ArrowRight",!0),"table down":pi(!1),"table up":pi(!0)}};on.DEFAULTS=_o;function fi(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,A.sources.USER),this.quill.setSelection(t.index+i.length,A.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,p)=>{r?(h.insertAt(0,i),p===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),p===0?a-=i.length:u-=i.length)}),this.quill.update(A.sources.USER),this.quill.setSelection(a,u,A.sources.SILENT)}}}function Gs(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 at?(r==="ArrowLeft"?t?this.quill.setSelection(s.index-1,s.length+1,A.sources.USER):this.quill.setSelection(s.index-1,A.sources.USER):t?this.quill.setSelection(s.index,s.length+1,A.sources.USER):this.quill.setSelection(s.index+s.length+1,A.sources.USER),!1):!0}}}function hr(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],A.sources.USER)}}}function pi(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,A.sources.USER)}}else{const o=n.table()[s];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,A.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function So(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=Ce(r);else return null;return r.shortKey&&(r[Lo]=r.shortKey,delete r.shortKey),r}function Vr(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=pt.AttributeMap.diff(o,i)||{}}t.deleteText(e,A.sources.USER),Object.keys(n).length>0&&t.formatLine(e.index,1,n,A.sources.USER),t.setSelection(e.index,A.sources.SILENT)}function ko(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 Co=/font-weight:\s*normal/,Oo=["P","OL","UL"],gi=r=>r&&Oo.includes(r.tagName),Io=r=>{Array.from(r.querySelectorAll("br")).filter(t=>gi(t.previousElementSibling)&&gi(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},Ro=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(Co)}).forEach(t=>{var s;const e=r.createDocumentFragment();e.append(...t.childNodes),(s=t.parentNode)==null||s.replaceChild(e,t)})};function Bo(r){r.querySelector('[id^="docs-internal-guid-"]')&&(Ro(r),Io(r))}const Mo=/\bmso-list:[^;]*ignore/i,Do=/\bmso-list:[^;]*\bl(\d+)/i,Uo=/\bmso-list:[^;]*\blevel(\d+)/i,jo=(r,t)=>{const e=r.getAttribute("style"),s=e==null?void 0:e.match(Do);if(!s)return null;const n=Number(s[1]),i=e==null?void 0:e.match(Uo),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}},Po=r=>{var o,a;const t=Array.from(r.querySelectorAll("[style*=mso-list]")),e=[],s=[];t.forEach(u=>{(u.getAttribute("style")||"").match(Mo)?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=>jo(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 p=document.createElement("ul");u.forEach(g=>{const m=document.createElement("li");m.setAttribute("data-list",g.type),g.indent>1&&m.setAttribute("class",`ql-indent-${g.indent-1}`),m.innerHTML=g.element.innerHTML,p.appendChild(m)});const b=(a=u[0])==null?void 0:a.element,{parentNode:f}=b??{};b&&(f==null||f.replaceChild(p,b)),u.slice(1).forEach(g=>{let{element:m}=g;f==null||f.removeChild(m)})}};function $o(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Po(r)}const Ho=[$o,Bo],Fo=r=>{r.documentElement&&Ho.forEach(t=>{t(r)})},Vo=Kt("quill:clipboard"),zo=[[Node.TEXT_NODE,na],[Node.TEXT_NODE,bi],["br",Yo],[Node.ELEMENT_NODE,bi],[Node.ELEMENT_NODE,Wo],[Node.ELEMENT_NODE,Zo],[Node.ELEMENT_NODE,ea],["li",Jo],["ol, ul",ta],["pre",Xo],["tr",sa],["b",dr("bold")],["i",dr("italic")],["strike",dr("strike")],["style",Qo]],Ko=[Ao,zi].reduce((r,t)=>(r[t.keyName]=t,r),{}),mi=[Fi,$r,Pr,Gi,Yi,Qi].reduce((r,t)=>(r[t.keyName]=t,r),{});class Ji extends Lt{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",s=>this.onCaptureCopy(s,!1)),this.quill.root.addEventListener("cut",s=>this.onCaptureCopy(s,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],zo.concat(this.options.matchers??[]).forEach(s=>{let[n,i]=s;this.addMatcher(n,i)})}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[st.blotName])return new C().insert(s||"",{[st.blotName]:n[st.blotName]});if(!e)return new C().insert(s||"",n);const i=this.convertHTML(e);return ps(i,`
  28. `)&&(i.ops[i.ops.length-1].attributes==null||n.table)?i.compose(new C().retain(i.length()-1).delete(1)):i}normalizeHTML(t){Fo(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 zr(this.quill.scroll,s,i,o,n)}dangerouslyPasteHTML(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof t=="string"){const n=this.convert({html:t,text:""});this.quill.setContents(n,e),this.quill.setSelection(0,A.sources.SILENT)}else{const n=this.convert({html:e,text:""});this.quill.updateContents(new C().retain(t).concat(n),s),this.quill.setSelection(t+n.length(),A.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&&Vr({range:s,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
  29. `)}onCapturePaste(t){var o,a,u,h,p;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&&((p=b.body.firstElementChild)==null?void 0:p.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);Vo.log("onPaste",o,{text:s,html:n});const a=new C().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,A.sources.USER),this.quill.setSelection(a.length()-t.length,A.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]}}S(Ji,"DEFAULTS",{matchers:[]});function he(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 C):r}function ps(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 Xt(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);return e&&e.prototype instanceof at?!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 Go(r,t){return r.previousElementSibling&&r.nextElementSibling&&!Xt(r.previousElementSibling,t)&&!Xt(r.nextElementSibling,t)}const Zs=new WeakMap;function tl(r){return r==null?!1:(Zs.has(r)||(r.tagName==="PRE"?Zs.set(r,!0):Zs.set(r,tl(r.parentNode))),Zs.get(r))}function zr(r,t,e,s,n){return t.nodeType===t.TEXT_NODE?s.reduce((i,o)=>o(t,i,r),new C):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=zr(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 C):new C}function dr(r){return(t,e,s)=>he(e,r,!0,s)}function Zo(r,t,e){const s=Mt.keys(r),n=Tt.keys(r),i=te.keys(r),o={};return s.concat(n).concat(i).forEach(a=>{let u=e.query(a,O.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=Ko[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=mi[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=mi[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,p]=u;return he(a,h,p,e)},t)}function Wo(r,t,e){const s=e.query(r);if(s==null)return t;if(s.prototype instanceof at){const n={},i=s.value(r);if(i!=null)return n[s.blotName]=i,new C().insert(n,s.formats(r,e))}else if(s.prototype instanceof cs&&!ps(t,`
  30. `)&&t.insert(`
  31. `),"blotName"in s&&"formats"in s&&typeof s.formats=="function")return he(t,s.blotName,s.formats(r,e),e);return t}function Yo(r,t){return ps(t,`
  32. `)||t.insert(`
  33. `),t}function Xo(r,t,e){const s=e.query("code-block"),n=s&&"formats"in s&&typeof s.formats=="function"?s.formats(r,e):!0;return he(t,"code-block",n,e)}function Qo(){return new C}function Jo(r,t,e){const s=e.query(r);if(s==null||s.blotName!=="list"||!ps(t,`
  34. `))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 C)}function ta(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"),he(t,"list",n,e)}function bi(r,t,e){if(!ps(t,`
  35. `)){if(Xt(r,e)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return t.insert(`
  36. `);if(t.length()>0&&r.nextSibling){let s=r.nextSibling;for(;s!=null;){if(Xt(s,e))return t.insert(`
  37. `);const n=e.query(s);if(n&&n.prototype instanceof ft)return t.insert(`
  38. `);s=s.firstChild}}}return t}function ea(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 he(o,u,h,e)},t),parseFloat(n.textIndent||0)>0?new C().insert(" ").concat(t):t}function sa(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 he(t,"table",a,e)}return t}function na(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(!tl(r)){if(s.trim().length===0&&s.includes(`
  39. `)&&!Go(r,e))return t;s=s.replace(/[^\S\u00a0]/g," "),s=s.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&Xt(r.parentElement,e)||r.previousSibling instanceof Element&&Xt(r.previousSibling,e))&&(s=s.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&Xt(r.parentElement,e)||r.nextSibling instanceof Element&&Xt(r.nextSibling,e))&&(s=s.replace(/ $/,"")),s=s.replaceAll(" "," ")}return t.insert(s)}class el extends Lt{constructor(e,s){super(e,s);S(this,"lastRecorded",0);S(this,"ignoreChange",!1);S(this,"stack",{undo:[],redo:[]});S(this,"currentRange",null);this.quill.on(A.events.EDITOR_CHANGE,(n,i,o,a)=>{n===A.events.SELECTION_CHANGE?i&&a!==A.sources.SILENT&&(this.currentRange=i):n===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=wr(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:wr(n.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,A.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){yi(this.stack.undo,e),yi(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,A.sources.USER);else{const s=ia(this.quill.scroll,e.delta);this.quill.setSelection(s,A.sources.USER)}}}S(el,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function yi(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&&wr(n.range,e)},e=n.delta.transform(e),r[s].delta.length()===0&&r.splice(s,1)}}function ra(r,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
  40. `):e.attributes!=null?Object.keys(e.attributes).some(s=>r.query(s,O.BLOCK)!=null):!1}function ia(r,t){const e=t.reduce((n,i)=>n+(i.delete||0),0);let s=t.length()-e;return ra(r,t)&&(s-=1),s}function wr(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 sl extends Lt{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)}}sl.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 C().retain(r.index).delete(r.length));this.quill.updateContents(n,k.sources.USER),this.quill.setSelection(r.index+s.length,k.sources.SILENT)})}};const la=["insertText","insertReplacementText"];class oa extends Lt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",s=>{this.handleBeforeInput(s)}),/Android/i.test(navigator.userAgent)||t.on(A.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Vr({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 C().retain(t.index).insert(e,s),A.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,A.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!la.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const s=aa(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 aa(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 ca=/Mac/i.test(navigator.platform),ua=100,ha=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||ca&&r.key==="a"&&r.ctrlKey===!0);class da extends Lt{constructor(e,s){super(e,s);S(this,"isListening",!1);S(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 wt)||!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),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&ha(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+ua,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 wt)||!n.uiNode)return;const i=document.createRange();i.setStartAfter(n.uiNode),i.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(i)}}A.register({"blots/block":Y,"blots/block/embed":ft,"blots/break":qt,"blots/container":ce,"blots/cursor":Be,"blots/embed":Ur,"blots/inline":Dt,"blots/scroll":ke,"blots/text":xt,"modules/clipboard":Ji,"modules/history":el,"modules/keyboard":on,"modules/uploader":sl,"modules/input":oa,"modules/uiNode":da});class fa extends Tt{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 pa=new fa("indent","ql-indent",{scope:O.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class xr extends Y{}S(xr,"blotName","blockquote"),S(xr,"tagName","blockquote");class Tr extends Y{static formats(t){return this.tagName.indexOf(t.tagName)+1}}S(Tr,"blotName","header"),S(Tr,"tagName",["H1","H2","H3","H4","H5","H6"]);class gs extends ce{}gs.blotName="list-container";gs.tagName="OL";class ms extends Y{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(){A.register(gs)}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)}}ms.blotName="list";ms.tagName="LI";gs.allowedChildren=[ms];ms.requiredContainer=gs;class ds extends Dt{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)}}S(ds,"blotName","bold"),S(ds,"tagName",["STRONG","B"]);class qr extends ds{}S(qr,"blotName","italic"),S(qr,"tagName",["EM","I"]);class Qt extends Dt{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 nl(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))}}S(Qt,"blotName","link"),S(Qt,"tagName","A"),S(Qt,"SANITIZED_URL","about:blank"),S(Qt,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function nl(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 Lr extends Dt{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"}}S(Lr,"blotName","script"),S(Lr,"tagName",["SUB","SUP"]);class _r extends ds{}S(_r,"blotName","strike"),S(_r,"tagName",["S","STRIKE"]);class Sr extends Dt{}S(Sr,"blotName","underline"),S(Sr,"tagName","U");class Ws extends Ur{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>`}}S(Ws,"blotName","formula"),S(Ws,"className","ql-formula"),S(Ws,"tagName","SPAN");const vi=["alt","height","width"];class kr extends at{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return vi.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 nl(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){vi.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}S(kr,"blotName","image"),S(kr,"tagName","IMG");const Ei=["height","width"];class Ys extends ft{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 Ei.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static sanitize(t){return Qt.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Ei.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>`}}S(Ys,"blotName","video"),S(Ys,"className","ql-video"),S(Ys,"tagName","IFRAME");const is=new Tt("code-token","hljs",{scope:O.INLINE});class Vt extends Dt{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(st.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,s){super(t,e,s),is.add(this.domNode,s)}format(t,e){t!==Vt.blotName?super.format(t,e):e?is.add(this.domNode,e):(is.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),is.value(this.domNode)||this.unwrap()}}Vt.blotName="code-token";Vt.className="ql-token";class dt extends st{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(),Vt.blotName,!1),super.replaceWith(t,e)}}class ls extends ue{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===dt.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(t,e)}))}formatAt(t,e,s,n){s===dt.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(`
  41. `)}
  42. `,i=dt.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(ji(h,!1)),new C),a=t(n,i);o.diff(a).reduce((u,h)=>{let{retain:p,attributes:b}=h;return p?(b&&Object.keys(b).forEach(f=>{[dt.blotName,Vt.blotName].includes(f)&&this.formatAt(u,p,f,b[f])}),u+p):u},0)}this.cachedText=n,this.forceNext=!1}}html(t,e){const[s]=this.children.find(t);return`<pre data-language="${s?dt.formats(s.domNode):"plain"}">
  43. ${ln(this.code(t,e))}
  44. </pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=dt.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}ls.allowedChildren=[dt];dt.requiredContainer=ls;dt.allowedChildren=[Vt,Be,xt,qt];const ga=(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 rl extends Lt{static register(){A.register(Vt,!0),A.register(dt,!0),A.register(ls,!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(A.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof ls))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(dt.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=dt.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(A.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(A.sources.USER);const s=this.quill.getSelection();(t==null?this.quill.scroll.descendants(ls):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(A.sources.SILENT),s!=null&&this.quill.setSelection(s,A.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 ln(t).split(`
  45. `).reduce((n,i,o)=>(o!==0&&n.insert(`
  46. `,{[st.blotName]:e}),n.insert(i)),new C);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(st.className),s.innerHTML=ga(this.options.hljs,e,t),zr(this.quill.scroll,s,[(n,i)=>{const o=is.value(n);return o?i.compose(new C().retain(i.length(),{[Vt.blotName]:o})):i}],[(n,i)=>n.data.split(`
  47. `).reduce((o,a,u)=>(u!==0&&o.insert(`
  48. `,{[st.blotName]:e}),o.insert(a)),i)],new WeakMap)}}rl.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 as=class as extends Y{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Kr()),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===as.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()}};S(as,"blotName","table"),S(as,"tagName","TD");let At=as;class zt extends ce{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}}S(zt,"blotName","table-row"),S(zt,"tagName","TR");class Bt extends ce{}S(Bt,"blotName","table-body"),S(Bt,"tagName","TBODY");class De extends ce{balanceCells(){const t=this.descendants(zt),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=At.formats(s.children.head.domNode));const i=this.scroll.create(At.blotName,n);s.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Bt);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(Bt);e==null||e.children.head==null||e.children.forEach(s=>{const n=s.children.at(t),i=At.formats(s.children.head.domNode),o=this.scroll.create(At.blotName,i);s.insertBefore(o,n)})}insertRow(t){const[e]=this.descendant(Bt);if(e==null||e.children.head==null)return;const s=Kr(),n=this.scroll.create(zt.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create(At.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)}}S(De,"blotName","table-container"),S(De,"tagName","TABLE");De.allowedChildren=[Bt];Bt.requiredContainer=De;Bt.allowedChildren=[zt];zt.requiredContainer=Bt;zt.allowedChildren=[At];At.requiredContainer=zt;function Kr(){return`row-${Math.random().toString(36).slice(2,6)}`}class ma extends Lt{static register(){A.register(At),A.register(zt),A.register(Bt),A.register(De)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(De).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(e,A.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!==At.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(A.sources.USER);let a=n.rowOffset();t===0&&(a+=1),this.quill.setSelection(e.index+a,e.length,A.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(A.sources.USER),t>0?this.quill.setSelection(e,A.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,A.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(`
  49. `).join("");return i.insert(o,{table:Kr()})},new C().retain(s.index));this.quill.updateContents(n,A.sources.USER),this.quill.setSelection(s.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,(s,n,i)=>{i===A.sources.USER&&this.balanceTables()}),!0):!1)})}}const Ni=Kt("quill:toolbar");class Gr extends Lt{constructor(t,e){var s,n;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),ba(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)){Ni.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(A.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){Ni.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 at){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new C().retain(o.index).delete(o.length).insert({[e]:i}),A.sources.USER)}else this.quill.format(e,i,A.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())}})}}Gr.DEFAULTS={};function Ai(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 ba(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")Ai(s,n);else{const i=Object.keys(n)[0],o=n[i];Array.isArray(o)?ya(s,i,o):Ai(s,i,o)}}),r.appendChild(s)})}function ya(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)}Gr.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,O.INLINE)!=null&&this.quill.format(e,!1,A.sources.USER)})}else this.quill.removeFormat(r.index,r.length,A.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",A.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",r,A.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,A.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,A.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,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",r,A.sources.USER)}}};const va='<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>',Ea='<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>',Na='<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>',Aa='<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>',wa='<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>',xa='<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>',Ta='<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>',qa='<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>',wi='<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>',La='<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>',_a='<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>',Sa='<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>',ka='<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>',Ca='<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>',Oa='<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>',Ia='<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>',Ra='<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>',Ba='<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>',Ma='<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>',Da='<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>',Ua='<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>',ja='<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>',Pa='<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>',$a='<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>',Ha='<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>',Fa='<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>',Va='<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>',za='<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>',Ka='<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>',Ga='<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>',Za='<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>',Wa='<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>',Ya='<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>',fs={align:{"":va,center:Ea,right:Na,justify:Aa},background:wa,blockquote:xa,bold:Ta,clean:qa,code:wi,"code-block":wi,color:La,direction:{"":_a,rtl:Sa},formula:ka,header:{1:Ca,2:Oa,3:Ia,4:Ra,5:Ba,6:Ma},italic:Da,image:Ua,indent:{"+1":ja,"-1":Pa},link:$a,list:{bullet:Ha,check:Fa,ordered:Va},script:{sub:za,super:Ka},strike:Ga,table:Za,underline:Wa,video:Ya},Xa='<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 xi=0;function Ti(r,t){r.setAttribute(t,`${r.getAttribute(t)!=="true"}`)}class an{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"),Ti(this.label,"aria-expanded"),Ti(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=Xa,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-${xi}`,xi+=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 il extends an{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 ll extends an{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 Qa=r=>{const{overflowY:t}=getComputedStyle(r,null);return t!=="visible"&&t!=="clip"};class ol{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Qa(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 Ja=[!1,"center","right","justify"],tc=["#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"],ec=[!1,"serif","monospace"],sc=["1","2","3",!1],nc=["small",!1,"large","huge"];class bs extends Me{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&&rs(n,Ja),typeof e.align=="object"))return new ll(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&&rs(n,tc,i==="background"?"#ffffff":"#000000"),new il(n,e[i])}return n.querySelector("option")==null&&(n.classList.contains("ql-font")?rs(n,ec):n.classList.contains("ql-header")?rs(n,sc):n.classList.contains("ql-size")&&rs(n,nc)),new an(n)});const s=()=>{this.pickers.forEach(n=>{n.update()})};this.quill.on(k.events.EDITOR_CHANGE,s)}}bs.DEFAULTS=Jt({},Me.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 al extends ol{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,k.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,k.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=rc(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,k.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(s+1," ",k.sources.USER),this.quill.setSelection(s+2,k.sources.USER)}break}}this.textbox.value="",this.hide()}}function rc(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 rs(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 ic=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class cl extends al{constructor(t,e){super(t,e),this.quill.on(k.events.EDITOR_CHANGE,(s,n,i,o)=>{if(s===k.events.SELECTION_CHANGE)if(n!=null&&n.length>0&&o===k.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),p=Math.min(u.length()-1,n.index+n.length-h),b=this.quill.getBounds(new ae(h,p));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(k.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}}S(cl,"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 ul extends bs{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=ic),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new cl(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),fs),this.buildPickers(t.container.querySelectorAll("select"),fs))}}ul.DEFAULTS=Jt({},bs.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const lc=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class hl extends al{constructor(){super(...arguments);S(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,k.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(k.events.SELECTION_CHANGE,(e,s,n)=>{if(e!=null){if(e.length===0&&n===k.sources.USER){const[i,o]=this.quill.scroll.descendant(Qt,e.index);if(i!=null){this.linkRange=new ae(e.index-o,i.length());const a=Qt.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")}}S(hl,"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 dl extends bs{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=lc),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"),fs),this.buildPickers(t.container.querySelectorAll("select"),fs),this.tooltip=new hl(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)}))}}dl.DEFAULTS=Jt({},bs.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,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":zi,"attributors/class/align":Hi,"attributors/class/background":xo,"attributors/class/color":wo,"attributors/class/direction":Ki,"attributors/class/font":Wi,"attributors/class/size":Xi,"attributors/style/align":Fi,"attributors/style/background":$r,"attributors/style/color":Pr,"attributors/style/direction":Gi,"attributors/style/font":Yi,"attributors/style/size":Qi},!0);A.register({"formats/align":Hi,"formats/direction":Ki,"formats/indent":pa,"formats/background":$r,"formats/color":Pr,"formats/font":Wi,"formats/size":Xi,"formats/blockquote":xr,"formats/code-block":st,"formats/header":Tr,"formats/list":ms,"formats/bold":ds,"formats/code":Hr,"formats/italic":qr,"formats/link":Qt,"formats/script":Lr,"formats/strike":_r,"formats/underline":Sr,"formats/formula":Ws,"formats/image":kr,"formats/video":Ys,"modules/syntax":rl,"modules/table":ma,"modules/toolbar":Gr,"themes/bubble":ul,"themes/snow":dl,"ui/icons":fs,"ui/picker":an,"ui/icon-picker":ll,"ui/color-picker":il,"ui/tooltip":ol},!0);const oc={class:"position-create-container"},ac={class:"header-container"},cc={class:"salary-range-container"},uc={class:"job-conditions-container"},hc={class:"editor-container"},dc={class:"editor-container"},fc=gl({__name:"index",setup(r){const t=(w,x)=>{let T=null;return(...I)=>{T&&clearTimeout(T),T=setTimeout(()=>{w(...I)},x)}},e=ml(),s=ns(),n=bl({title:"",job_category:"",job_type_display:"",city:"",location:[],location_names:[],address_detail:"",benefits:[],requirements:"",job_type:0,salary_type:"月薪",start_salary:"",end_salary:"",work_experience_required:"",education_required:"",salary_range:"",department:"",end_date:"",description:"",province:"",district:"",location_str:"",status:0,competency_tags:[]}),i={title:[{required:!0,message:"职位名称必填",trigger:"blur"}],job_category:[{required:!0,message:"职位类别必填",trigger:"change"}],job_type_display:[{required:!0,message:"职位性质必填",trigger:"change"}],location:[{required:!0,message:"工作地点必填",trigger:"change"}],department:[{required:!0,message:"所属部门必填",trigger:"blur"}],job_type:[{required:!0,message:"职位状态必填",trigger:"change"}],end_date:[{required:!0,message:"截止日期必填",trigger:"change"}],requirements:[{required:!0,message:"职位要求必填",trigger:"blur"}],description:[{required:!0,message:"职位描述必填",trigger:"blur"}],salary_range:[{required:!0,message:"请完整填写薪资类型、起始薪资和最高薪资",trigger:"blur"}]},o=ns(null),a=ns(null);let u=null,h=null;const p=Ll(),b=w=>{if(console.log("地址选择变化:",w),w&&Array.isArray(w)&&w.length>0){const[x,T,I]=w,R=p.find(X=>X.code===x);let L,F;R&&R.children&&(L=R.children.find(X=>X.code===T),L&&L.children&&(F=L.children.find(X=>X.code===I))),n.location_names=[(R==null?void 0:R.name)||"",(L==null?void 0:L.name)||"",(F==null?void 0:F.name)||""].filter(Boolean),n.province=(R==null?void 0:R.name)||"",n.city=(L==null?void 0:L.name)||"",n.district=(F==null?void 0:F.name)||"",n.location_str=n.location_names.join("/")}else n.location_names=[],n.province="",n.city="",n.district="",n.location_str=""},f=()=>{n.salary_type&&n.start_salary&&n.end_salary?n.salary_range=`${n.salary_type} ${n.start_salary}-${n.end_salary}`:n.salary_range=""},m=t(async()=>{if(!(!n.title||!n.work_experience_required||!n.education_required||!n.salary_range))try{const w=await ql({position_title:n.title,experience_req:n.work_experience_required,education_req:n.education_required,salary_range:n.salary_range,tenant_id:1});if(w.code===2e3&&w.data){const x=`
  50. <ul>
  51. ${w.data.responsibilities.map(T=>`<li>${T}</li>`).join(`
  52. `)}
  53. </ul>
  54. <p><strong>经验要求:</strong>${w.data.experience}</p>
  55. <p><strong>学历要求:</strong>${w.data.education}</p>
  56. <ul>
  57. ${w.data.skills.map(T=>`<li>${T}</li>`).join(`
  58. `)}
  59. </ul>
  60. <ul>
  61. ${w.data.qualities.map(T=>`<li>${T}</li>`).join(`
  62. `)}
  63. </ul>
  64. <ul>
  65. ${w.data.bonus.map(T=>`<li>${T}</li>`).join(`
  66. `)}
  67. </ul>`;h&&(h.clipboard.dangerouslyPasteHTML(x),n.description=x)}}catch(w){console.error("生成职位描述失败:",w),Fs.error("生成职位描述失败,请稍后重试")}},1e3);yl(()=>[n.title,n.work_experience_required,n.education_required,n.salary_range],()=>{m()},{deep:!0});const v=ns([]);ns({});const E=async()=>{try{const w=await xl({page:1,pageSize:1e3});console.log("response",w),v.value=w.data.items}catch(w){console.error("获取胜任力标签失败:",w),Fs.error("获取胜任力标签失败")}};vl(()=>{o.value&&(u=new A(o.value,{theme:"snow",modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]]},placeholder:"请输入职位要求"}),n.requirements&&u.clipboard.dangerouslyPasteHTML(n.requirements),u.on("text-change",()=>{n.requirements=u.root.innerHTML})),a.value&&(h=new A(a.value,{theme:"snow",modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]]},placeholder:"请输入职位描述"}),n.description&&h.clipboard.dangerouslyPasteHTML(n.description),h.on("text-change",()=>{n.description=h.root.innerHTML})),E()}),El(()=>{u=null,h=null});const N=()=>{e.push("/position/list")},q=async()=>{s.value&&(u&&(n.requirements=u.root.innerHTML),h&&(n.description=h.root.innerHTML),f(),await s.value.validate(async(w,x)=>{if(w)try{const T={...n};T.location_names.length>0&&(T.province=T.location_names[0],T.city=T.location_names[1]||"",T.district=T.location_names[2]||"",T.location=T.location_names,T.location_str=T.location_names.join("/")),delete T.location_names;const I=await Tl(T);Fs.success("职位添加成功"),e.push(`/position/detail?id=${I.data.id}`)}catch(T){console.error("保存失败:",T),Fs.error("保存失败,请重试")}else console.log("验证失败:",x)}))};return(w,x)=>{const T=It("page-header"),I=It("el-input"),R=It("el-form-item"),L=It("el-option"),F=It("el-select"),X=It("el-cascader"),Ut=It("el-date-picker"),_t=It("el-button"),de=It("el-form"),fe=It("el-card");return Al(),Nl("div",oc,[vt("div",ac,[_(T,{title:"新增职位",onBack:N})]),_(fe,{class:"form-card"},{default:V(()=>[x[17]||(x[17]=vt("div",{class:"section-title"},[vt("div",{class:"section-line"}),vt("span",null,"职位详情")],-1)),_(de,{ref_key:"formRef",ref:s,model:n,rules:i,"label-width":"120px","label-position":"right"},{default:V(()=>[_(R,{label:"职位名称",prop:"title"},{default:V(()=>[_(I,{modelValue:n.title,"onUpdate:modelValue":x[0]||(x[0]=U=>n.title=U),placeholder:"请输入职位名称",maxlength:"20","show-word-limit":""},null,8,["modelValue"])]),_:1}),_(R,{label:"职位类别",prop:"job_category"},{default:V(()=>[_(F,{modelValue:n.job_category,"onUpdate:modelValue":x[1]||(x[1]=U=>n.job_category=U),placeholder:"请选择职位类别"},{default:V(()=>[_(L,{label:"技术",value:"技术"}),_(L,{label:"产品",value:"产品"}),_(L,{label:"设计",value:"设计"}),_(L,{label:"运营",value:"运营"}),_(L,{label:"市场",value:"市场"}),_(L,{label:"销售",value:"销售"}),_(L,{label:"行政",value:"行政"}),_(L,{label:"财务",value:"财务"}),_(L,{label:"人力资源",value:"人力资源"}),_(L,{label:"法务",value:"法务"}),_(L,{label:"其他",value:"其他"})]),_:1},8,["modelValue"])]),_:1}),_(R,{label:"职位性质",prop:"job_type_display"},{default:V(()=>[_(F,{modelValue:n.job_type_display,"onUpdate:modelValue":x[2]||(x[2]=U=>n.job_type_display=U),placeholder:"请选择职位性质"},{default:V(()=>[_(L,{label:"全职",value:"全职"}),_(L,{label:"兼职",value:"兼职"}),_(L,{label:"实习",value:"实习"}),_(L,{label:"其他",value:"其他"})]),_:1},8,["modelValue"])]),_:1}),_(R,{label:"工作地点",prop:"location"},{default:V(()=>[_(X,{modelValue:n.location,"onUpdate:modelValue":x[3]||(x[3]=U=>n.location=U),options:wl(p),props:{expandTrigger:"hover",checkStrictly:!1,value:"code",label:"name"},style:{width:"100%"},placeholder:"请选择工作地点",clearable:"",onChange:b},null,8,["modelValue","options"])]),_:1}),_(R,{label:"门牌号码",prop:"address_detail"},{default:V(()=>[_(I,{modelValue:n.address_detail,"onUpdate:modelValue":x[4]||(x[4]=U=>n.address_detail=U),placeholder:"请输入详细地址"},null,8,["modelValue"])]),_:1}),_(R,{label:"福利待遇",prop:"benefits"},{default:V(()=>[_(F,{modelValue:n.benefits,"onUpdate:modelValue":x[5]||(x[5]=U=>n.benefits=U),placeholder:"请选择福利待遇",multiple:""},{default:V(()=>[_(L,{label:"五险一金",value:"五险一金"}),_(L,{label:"年终奖",value:"年终奖"}),_(L,{label:"带薪年假",value:"带薪年假"}),_(L,{label:"定期体检",value:"定期体检"}),_(L,{label:"节日福利",value:"节日福利"}),_(L,{label:"员工旅游",value:"员工旅游"}),_(L,{label:"弹性工作",value:"弹性工作"}),_(L,{label:"免费班车",value:"免费班车"}),_(L,{label:"餐补",value:"餐补"}),_(L,{label:"交通补贴",value:"交通补贴"})]),_:1},8,["modelValue"])]),_:1}),_(R,{label:"职位薪资",prop:"salary_range"},{default:V(()=>[vt("div",cc,[_(F,{modelValue:n.salary_type,"onUpdate:modelValue":x[6]||(x[6]=U=>n.salary_type=U),placeholder:"薪资类型",class:"salary-type-select",onChange:f},{default:V(()=>[_(L,{label:"月薪",value:"月薪"}),_(L,{label:"年薪",value:"年薪"}),_(L,{label:"日薪",value:"日薪"}),_(L,{label:"时薪",value:"时薪"})]),_:1},8,["modelValue"]),_(I,{modelValue:n.start_salary,"onUpdate:modelValue":x[7]||(x[7]=U=>n.start_salary=U),placeholder:"起始薪资",class:"salary-input",type:"number",min:"0",onInput:f},null,8,["modelValue"]),x[14]||(x[14]=vt("span",{class:"salary-separator"},"-",-1)),_(I,{modelValue:n.end_salary,"onUpdate:modelValue":x[8]||(x[8]=U=>n.end_salary=U),placeholder:"最高薪资",class:"salary-input",type:"number",min:"0",onInput:f},null,8,["modelValue"])])]),_:1}),_(R,{label:"职位条件"},{default:V(()=>[vt("div",uc,[_(F,{modelValue:n.work_experience_required,"onUpdate:modelValue":x[9]||(x[9]=U=>n.work_experience_required=U),placeholder:"工作经验",class:"condition-select"},{default:V(()=>[_(L,{label:"不限",value:"不限"}),_(L,{label:"应届毕业生",value:"应届毕业生"}),_(L,{label:"1年以下",value:"1年以下"}),_(L,{label:"1-3年",value:"1-3年"}),_(L,{label:"3-5年",value:"3-5年"}),_(L,{label:"5-10年",value:"5-10年"}),_(L,{label:"10年以上",value:"10年以上"})]),_:1},8,["modelValue"]),_(F,{modelValue:n.education_required,"onUpdate:modelValue":x[10]||(x[10]=U=>n.education_required=U),placeholder:"学历要求",class:"condition-select"},{default:V(()=>[_(L,{label:"不限",value:"不限"}),_(L,{label:"高中",value:"高中"}),_(L,{label:"大专",value:"大专"}),_(L,{label:"本科",value:"本科"}),_(L,{label:"硕士",value:"硕士"}),_(L,{label:"博士",value:"博士"})]),_:1},8,["modelValue"])])]),_:1}),_(R,{label:"所属部门",prop:"department"},{default:V(()=>[_(I,{modelValue:n.department,"onUpdate:modelValue":x[11]||(x[11]=U=>n.department=U),placeholder:"请输入所属部门"},null,8,["modelValue"])]),_:1}),_(R,{label:"职位状态",prop:"job_type"},{default:V(()=>[_(F,{modelValue:n.job_type,"onUpdate:modelValue":x[12]||(x[12]=U=>n.job_type=U),placeholder:"请选择职位状态"},{default:V(()=>[_(L,{label:"未发布",value:0}),_(L,{label:"已发布",value:1})]),_:1},8,["modelValue"])]),_:1}),_(R,{label:"截止日期",prop:"end_date"},{default:V(()=>[_(Ut,{modelValue:n.end_date,"onUpdate:modelValue":x[13]||(x[13]=U=>n.end_date=U),type:"datetime",placeholder:"请选择截止日期","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue"])]),_:1}),_(R,{label:"职位要求",prop:"requirements"},{default:V(()=>[vt("div",hc,[vt("div",{ref_key:"quillEditor",ref:o,class:"quill-editor"},null,512)])]),_:1}),_(R,{label:"职位描述",prop:"description"},{default:V(()=>[vt("div",dc,[vt("div",{ref_key:"descriptionEditor",ref:a,class:"quill-editor"},null,512)])]),_:1}),_(R,null,{default:V(()=>[_(_t,{type:"primary",onClick:q},{default:V(()=>x[15]||(x[15]=[Wr("保存")])),_:1}),_(_t,{onClick:N},{default:V(()=>x[16]||(x[16]=[Wr("取消")])),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}}),Tc=_l(fc,[["__scopeId","data-v-5e631863"]]);export{Tc as default};