import{Q as m}from"./quill.b985c8ce.js";function b(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(e){return typeof e}:b=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(o)}function M(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function L(o,e){for(var t=0;to.length)&&(e=o.length);for(var t=0,n=new Array(e);t=o.length?{done:!0}:{done:!1,value:o[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,r=!1,a;return{s:function(){t=t.call(o)},n:function(){var l=t.next();return s=l.done,l},e:function(l){r=!0,a=l},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(r)throw a}}}}var f={TAB:9,ENTER:13,ESCAPE:27,UP:38,DOWN:40};function D(o,e,t){var n=o;return Object.keys(e).forEach(function(i){t.indexOf(i)>-1?n.dataset[i]=e[i]:delete n.dataset[i]}),n}function R(o,e){return e.reduce(function(t,n){var i=o.lastIndexOf(n);return i>t.mentionCharIndex?{mentionChar:n,mentionCharIndex:i}:{mentionChar:t.mentionChar,mentionCharIndex:t.mentionCharIndex}},{mentionChar:null,mentionCharIndex:-1})}function q(o,e){return e.test(o)}function V(o,e,t){return o>-1?!(t&&!(o===0||!!e[o-1].match(/\s/g))):!1}function Q(o){return b(o)!=="object"||o===null?o:JSON.parse(JSON.stringify(o))}var W=m.import("blots/embed"),I=function(o){P(t,o);var e=_(t);function t(n,i){var s;return M(this,t),s=e.call(this,n,i),T(E(s),"hoverHandler",void 0),T(E(s),"hoverHandler",void 0),s.clickHandler=null,s.hoverHandler=null,s.mounted=!1,s}return S(t,[{key:"update",value:function(i,s){var r=this;if(t.isAndroid()){var a=N(i),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;if(!(u.type==="attributes"&&u.attributeName==="contenteditable")){setTimeout(function(){return r.remove()},0);return}}}catch(h){a.e(h)}finally{a.f()}}else i.forEach(function(h){if(h.type==="characterData"&&(h.target===r.leftGuard||h.target===r.rightGuard)){var d=r.restore(h.target);d&&(s.range=d)}})}},{key:"attach",value:function(){g(p(t.prototype),"attach",this).call(this),this.mounted||(this.mounted=!0,this.clickHandler=this.getClickHandler(),this.hoverHandler=this.getHoverHandler(),this.domNode.addEventListener("click",this.clickHandler,!1),this.domNode.addEventListener("mouseenter",this.hoverHandler,!1))}},{key:"detach",value:function(){g(p(t.prototype),"detach",this).call(this),this.mounted=!1,this.clickHandler&&(this.domNode.removeEventListener("click",this.clickHandler),this.clickHandler=null)}},{key:"getClickHandler",value:function(){var i=this;return function(s){var r=i.buildEvent("mention-clicked",s);window.dispatchEvent(r),s.preventDefault()}}},{key:"getHoverHandler",value:function(){var i=this;return function(s){var r=i.buildEvent("mention-hovered",s);window.dispatchEvent(r),s.preventDefault()}}},{key:"buildEvent",value:function(i,s){var r=new Event(i,{bubbles:!0,cancelable:!0});return r.value=x({},this.domNode.dataset),r.event=s,r}}],[{key:"create",value:function(i){var s=g(p(t),"create",this).call(this),r=document.createElement("span");if(r.className="ql-mention-denotation-char",r.innerHTML=i.denotationChar,s.appendChild(r),s.innerHTML+=i.value,t.isAndroid()){var a=document.createElement("span");a.innerHTML=" ",a.setAttribute("style","display: inline-block; height: 1px; width: 1px; overflow: hidden; "),s.appendChild(a)}return t.setDataValues(s,i)}},{key:"setDataValues",value:function(i,s){setTimeout(function(){t.isAndroid()?i.getElementsByTagName("span")[0].setAttribute("contenteditable","inherit"):t.isChrome()&&i.getElementsByTagName("span")[0].parentNode.setAttribute("contenteditable","false")},0);var r=i;return Object.keys(s).forEach(function(a){r.dataset[a]=s[a]}),r}},{key:"value",value:function(i){return i.dataset}},{key:"isAndroid",value:function(){var i=typeof window!="undefined"&&window.navigator.userAgent.toLowerCase();return i&&i.indexOf("android")>0}},{key:"isChrome",value:function(){var i=typeof window!="undefined"&&window.navigator.userAgent.toLowerCase();return i.match(/Chrome/i)+""=="chrome"}}]),t}(W);I.blotName="mention";I.tagName="span";I.className="mention";m.register(I);var U=function(){function o(e,t){var n=this;M(this,o),this.isOpen=!1,this.itemIndex=0,this.mentionCharPos=null,this.cursorPos=null,this.values=[],this.suspendMouseEnter=!1,this.existingSourceExecutionToken=null,this.quill=e,this.options={source:null,renderItem:function(l){return"".concat(l.value)},renderLoading:function(){return null},onSelect:function(l,u){u(l)},mentionDenotationChars:["@"],showDenotationChar:!0,allowedChars:/^[a-zA-Z0-9_]*$/,minChars:0,maxChars:31,offsetTop:2,offsetLeft:0,isolateCharacter:!1,fixMentionsToQuill:!1,positioningStrategy:"normal",defaultMenuOrientation:"bottom",blotName:"mention",dataAttributes:["id","value","denotationChar","link","target","disabled"],linkTarget:"_blank",onOpen:function(){return!0},onBeforeClose:function(){return!0},onClose:function(){return!0},listItemClass:"ql-mention-list-item",mentionContainerClass:"ql-mention-list-container",mentionListClass:"ql-mention-list",spaceAfterInsert:!0,selectKeys:[f.ENTER]},x(this.options,t,{dataAttributes:Array.isArray(t.dataAttributes)?this.options.dataAttributes.concat(t.dataAttributes):this.options.dataAttributes}),this.mentionContainer=document.createElement("div"),this.mentionContainer.className=this.options.mentionContainerClass?this.options.mentionContainerClass:"",this.mentionContainer.style.cssText="display: none; position: absolute;",this.mentionContainer.onmousemove=this.onContainerMouseMove.bind(this),this.options.fixMentionsToQuill&&(this.mentionContainer.style.width="auto"),this.mentionList=document.createElement("ul"),this.mentionList.id="quill-mention-list",e.root.setAttribute("aria-owns","quill-mention-list"),this.mentionList.className=this.options.mentionListClass?this.options.mentionListClass:"",this.mentionContainer.appendChild(this.mentionList),e.on("text-change",this.onTextChange.bind(this)),e.on("selection-change",this.onSelectionChange.bind(this)),e.container.addEventListener("paste",function(){setTimeout(function(){var a=e.getSelection();n.onSelectionChange(a)})}),e.keyboard.addBinding({key:f.TAB},this.selectHandler.bind(this)),e.keyboard.bindings[f.TAB].unshift(e.keyboard.bindings[f.TAB].pop());var i=N(this.options.selectKeys),s;try{for(i.s();!(s=i.n()).done;){var r=s.value;e.keyboard.addBinding({key:r},this.selectHandler.bind(this))}}catch(a){i.e(a)}finally{i.f()}e.keyboard.bindings[f.ENTER].unshift(e.keyboard.bindings[f.ENTER].pop()),e.keyboard.addBinding({key:f.ESCAPE},this.escapeHandler.bind(this)),e.keyboard.addBinding({key:f.UP},this.upHandler.bind(this)),e.keyboard.addBinding({key:f.DOWN},this.downHandler.bind(this))}return S(o,[{key:"selectHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.selectItem(),!1):!0}},{key:"escapeHandler",value:function(){return this.isOpen?(this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.hideMentionList(),!1):!0}},{key:"upHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.prevItem(),!1):!0}},{key:"downHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.nextItem(),!1):!0}},{key:"showMentionList",value:function(){this.options.positioningStrategy==="fixed"?document.body.appendChild(this.mentionContainer):this.quill.container.appendChild(this.mentionContainer),this.mentionContainer.style.visibility="hidden",this.mentionContainer.style.display="",this.mentionContainer.scrollTop=0,this.setMentionContainerPosition(),this.setIsOpen(!0)}},{key:"hideMentionList",value:function(){this.options.onBeforeClose(),this.mentionContainer.style.display="none",this.mentionContainer.remove(),this.setIsOpen(!1),this.quill.root.removeAttribute("aria-activedescendant")}},{key:"highlightItem",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=0;na-i&&(this.mentionContainer.scrollTop+=s-a+i)}}},{key:"getItemData",value:function(){var t=this.mentionList.childNodes[this.itemIndex].dataset.link,n=typeof t!="undefined",i=this.mentionList.childNodes[this.itemIndex].dataset.target;return n&&(this.mentionList.childNodes[this.itemIndex].dataset.value='