diff --git a/mailboxes/quill/quill.min.js.gz b/mailboxes/quill/quill.min.js.gz deleted file mode 100644 index 6e573011f..000000000 Binary files a/mailboxes/quill/quill.min.js.gz and /dev/null differ diff --git a/mailboxes/reply_mail.cgi b/mailboxes/reply_mail.cgi index ec36be2a4..e9d0f651e 100755 --- a/mailboxes/reply_mail.cgi +++ b/mailboxes/reply_mail.cgi @@ -496,8 +496,8 @@ EOF my $ts = &get_webmin_version(); $ts =~ s/[.-]+//g; $html_editor_load_scripts = < - + + EOF } # HTML editor init diff --git a/mailboxes/quill/quill.min.css b/unauthenticated/css/quill.min.css similarity index 100% rename from mailboxes/quill/quill.min.css rename to unauthenticated/css/quill.min.css diff --git a/mailboxes/quill/quill.min.css.gz b/unauthenticated/css/quill.min.css.gz similarity index 98% rename from mailboxes/quill/quill.min.css.gz rename to unauthenticated/css/quill.min.css.gz index 632ee195e..a3bdb0f84 100644 Binary files a/mailboxes/quill/quill.min.css.gz and b/unauthenticated/css/quill.min.css.gz differ diff --git a/mailboxes/quill/quill.min.js b/unauthenticated/js/quill.min.js similarity index 69% rename from mailboxes/quill/quill.min.js rename to unauthenticated/js/quill.min.js index 869383d81..a04b1d557 100644 --- a/mailboxes/quill/quill.min.js +++ b/unauthenticated/js/quill.min.js @@ -5,32 +5,7 @@ * Copyright 2013 salesforce.com * Licensed under BSD 3-Clause (https://github.com/quilljs/quill/blob/develop/LICENSE) */ -(function e(t,r){if(typeof exports==="object"&&typeof module==="object")module.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof exports==="object")exports["Quill"]=r();else t["Quill"]=r()})(typeof self!=="undefined"?self:this,function(){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:n})}};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=109)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(17);var i=r(18);var o=r(19);var a=r(45);var l=r(46);var u=r(47);var s=r(48);var f=r(49);var c=r(12);var d=r(32);var p=r(33);var h=r(31);var v=r(1);var y={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:n.default,Format:i.default,Leaf:o.default,Embed:s.default,Scroll:a.default,Block:u.default,Inline:l.default,Text:f.default,Attributor:{Attribute:c.default,Class:d.default,Style:p.default,Store:h.default}};t.default=y},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=function(e){n(t,e);function t(t){var r=this;t="[Parchment] "+t;r=e.call(this,t)||this;r.message=t;r.name=r.constructor.name;return r}return t}(Error);t.ParchmentError=i;var o={};var a={};var l={};var u={};t.DATA_KEY="__blot";var s;(function(e){e[e["TYPE"]=3]="TYPE";e[e["LEVEL"]=12]="LEVEL";e[e["ATTRIBUTE"]=13]="ATTRIBUTE";e[e["BLOT"]=14]="BLOT";e[e["INLINE"]=7]="INLINE";e[e["BLOCK"]=11]="BLOCK";e[e["BLOCK_BLOT"]=10]="BLOCK_BLOT";e[e["INLINE_BLOT"]=6]="INLINE_BLOT";e[e["BLOCK_ATTRIBUTE"]=9]="BLOCK_ATTRIBUTE";e[e["INLINE_ATTRIBUTE"]=5]="INLINE_ATTRIBUTE";e[e["ANY"]=15]="ANY"})(s=t.Scope||(t.Scope={}));function f(e,t){var r=d(e);if(r==null){throw new i("Unable to create "+e+" blot")}var n=r;var o=e instanceof Node||e["nodeType"]===Node.TEXT_NODE?e:n.create(t);return new n(o,t)}t.create=f;function c(e,r){if(r===void 0){r=false}if(e==null)return null;if(e[t.DATA_KEY]!=null)return e[t.DATA_KEY].blot;if(r)return c(e.parentNode,r);return null}t.find=c;function d(e,t){if(t===void 0){t=s.ANY}var r;if(typeof e==="string"){r=u[e]||o[e]}else if(e instanceof Text||e["nodeType"]===Node.TEXT_NODE){r=u["text"]}else if(typeof e==="number"){if(e&s.LEVEL&s.BLOCK){r=u["block"]}else if(e&s.LEVEL&s.INLINE){r=u["inline"]}}else if(e instanceof HTMLElement){var n=(e.getAttribute("class")||"").split(/\s+/);for(var i in n){r=a[n[i]];if(r)break}r=r||l[e.tagName]}if(r==null)return null;if(t&s.LEVEL&r.scope&&t&s.TYPE&r.scope)return r;return null}t.query=d;function p(){var e=[];for(var t=0;t1){return e.map(function(e){return p(e)})}var r=e[0];if(typeof r.blotName!=="string"&&typeof r.attrName!=="string"){throw new i("Invalid definition")}else if(r.blotName==="abstract"){throw new i("Cannot register abstract class")}u[r.blotName||r.attrName]=r;if(typeof r.keyName==="string"){o[r.keyName]=r}else{if(r.className!=null){a[r.className]=r}if(r.tagName!=null){if(Array.isArray(r.tagName)){r.tagName=r.tagName.map(function(e){return e.toUpperCase()})}else{r.tagName=r.tagName.toUpperCase()}var n=Array.isArray(r.tagName)?r.tagName:[r.tagName];n.forEach(function(e){if(l[e]==null||r.className==null){l[e]=r}})}}return r}t.register=p},function(e,t,r){var n=r(51);var i=r(11);var o=r(3);var a=r(20);var l=String.fromCharCode(0);var u=function(e){if(Array.isArray(e)){this.ops=e}else if(e!=null&&Array.isArray(e.ops)){this.ops=e.ops}else{this.ops=[]}};u.prototype.insert=function(e,t){var r={};if(e.length===0)return this;r.insert=e;if(t!=null&&typeof t==="object"&&Object.keys(t).length>0){r.attributes=t}return this.push(r)};u.prototype["delete"]=function(e){if(e<=0)return this;return this.push({delete:e})};u.prototype.retain=function(e,t){if(e<=0)return this;var r={retain:e};if(t!=null&&typeof t==="object"&&Object.keys(t).length>0){r.attributes=t}return this.push(r)};u.prototype.push=function(e){var t=this.ops.length;var r=this.ops[t-1];e=o(true,{},e);if(typeof r==="object"){if(typeof e["delete"]==="number"&&typeof r["delete"]==="number"){this.ops[t-1]={delete:r["delete"]+e["delete"]};return this}if(typeof r["delete"]==="number"&&e.insert!=null){t-=1;r=this.ops[t-1];if(typeof r!=="object"){this.ops.unshift(e);return this}}if(i(e.attributes,r.attributes)){if(typeof e.insert==="string"&&typeof r.insert==="string"){this.ops[t-1]={insert:r.insert+e.insert};if(typeof e.attributes==="object")this.ops[t-1].attributes=e.attributes;return this}else if(typeof e.retain==="number"&&typeof r.retain==="number"){this.ops[t-1]={retain:r.retain+e.retain};if(typeof e.attributes==="object")this.ops[t-1].attributes=e.attributes;return this}}}if(t===this.ops.length){this.ops.push(e)}else{this.ops.splice(t,0,e)}return this};u.prototype.chop=function(){var e=this.ops[this.ops.length-1];if(e&&e.retain&&!e.attributes){this.ops.pop()}return this};u.prototype.filter=function(e){return this.ops.filter(e)};u.prototype.forEach=function(e){this.ops.forEach(e)};u.prototype.map=function(e){return this.ops.map(e)};u.prototype.partition=function(e){var t=[],r=[];this.forEach(function(n){var i=e(n)?t:r;i.push(n)});return[t,r]};u.prototype.reduce=function(e,t){return this.ops.reduce(e,t)};u.prototype.changeLength=function(){return this.reduce(function(e,t){if(t.insert){return e+a.length(t)}else if(t.delete){return e-t.delete}return e},0)};u.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)};u.prototype.slice=function(e,t){e=e||0;if(typeof t!=="number")t=Infinity;var r=[];var n=a.iterator(this.ops);var i=0;while(i0){r.next(o.retain-l)}}var s=new u(n);while(t.hasNext()||r.hasNext()){if(r.peekType()==="insert"){s.push(r.next())}else if(t.peekType()==="delete"){s.push(t.next())}else{var f=Math.min(t.peekLength(),r.peekLength());var c=t.next(f);var d=r.next(f);if(typeof d.retain==="number"){var p={};if(typeof c.retain==="number"){p.retain=f}else{p.insert=c.insert}var h=a.attributes.compose(c.attributes,d.attributes,typeof c.retain==="number");if(h)p.attributes=h;s.push(p);if(!r.hasNext()&&i(s.ops[s.ops.length-1],p)){var v=new u(t.rest());return s.concat(v).chop()}}else if(typeof d["delete"]==="number"&&typeof c.retain==="number"){s.push(d)}}}return s.chop()};u.prototype.concat=function(e){var t=new u(this.ops.slice());if(e.ops.length>0){t.push(e.ops[0]);t.ops=t.ops.concat(e.ops.slice(1))}return t};u.prototype.diff=function(e,t){if(this.ops===e.ops){return new u}var r=[this,e].map(function(t){return t.map(function(r){if(r.insert!=null){return typeof r.insert==="string"?r.insert:l}var n=t===e?"on":"with";throw new Error("diff() called "+n+" non-document")}).join("")});var o=new u;var s=n(r[0],r[1],t);var f=a.iterator(this.ops);var c=a.iterator(e.ops);s.forEach(function(e){var t=e[1].length;while(t>0){var r=0;switch(e[0]){case n.INSERT:r=Math.min(c.peekLength(),t);o.push(c.next(r));break;case n.DELETE:r=Math.min(t,f.peekLength());f.next(r);o["delete"](r);break;case n.EQUAL:r=Math.min(f.peekLength(),c.peekLength(),t);var l=f.next(r);var u=c.next(r);if(i(l.insert,u.insert)){o.retain(r,a.attributes.diff(l.attributes,u.attributes))}else{o.push(u)["delete"](r)}break}t-=r}});return o.chop()};u.prototype.eachLine=function(e,t){t=t||"\n";var r=a.iterator(this.ops);var n=new u;var i=0;while(r.hasNext()){if(r.peekType()!=="insert")return;var o=r.peek();var l=a.length(o)-r.peekLength();var s=typeof o.insert==="string"?o.insert.indexOf(t,l)-l:-1;if(s<0){n.push(r.next())}else if(s>0){n.push(r.next(s))}else{if(e(n,r.next(1).attributes||{},i)===false){return}i+=1;n=new u}}if(n.length()>0){e(n,{},i)}};u.prototype.transform=function(e,t){t=!!t;if(typeof e==="number"){return this.transformPosition(e,t)}var r=a.iterator(this.ops);var n=a.iterator(e.ops);var i=new u;while(r.hasNext()||n.hasNext()){if(r.peekType()==="insert"&&(t||n.peekType()!=="insert")){i.retain(a.length(r.next()))}else if(n.peekType()==="insert"){i.push(n.next())}else{var o=Math.min(r.peekLength(),n.peekLength());var l=r.next(o);var s=n.next(o);if(l["delete"]){continue}else if(s["delete"]){i.push(s)}else{i.retain(o,a.attributes.transform(l.attributes,s.attributes,t))}}}return i.chop()};u.prototype.transformPosition=function(e,t){t=!!t;var r=a.iterator(this.ops);var n=0;while(r.hasNext()&&n<=e){var i=r.peekLength();var o=r.peekType();r.next();if(o==="delete"){e-=Math.min(i,e-n);continue}else if(o==="insert"&&(n0){if(r1&&arguments[1]!==undefined?arguments[1]:false;if(n&&(r===0||r>=this.length()-O)){var o=this.clone();if(r===0){this.parent.insertBefore(o,this);return this}else{this.parent.insertBefore(o,this.next);return o}}else{var a=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,r,n);this.cache={};return a}}}]);return t}(f.default.Block);w.blotName="block";w.tagName="P";w.defaultChild="break";w.allowedChildren=[h.default,f.default.Embed,y.default];function k(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(e==null)return t;if(typeof e.formats==="function"){t=(0,a.default)(t,e.formats())}if(e.parent==null||e.parent.blotName=="scroll"||e.parent.statics.scope!==e.statics.scope){return t}return k(e.parent,t)}t.bubbleFormats=k;t.BlockEmbed=x;t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.overload=t.expandConfig=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:false;if(typeof t!=="string"){var o=t.attrName||t.blotName;if(typeof o==="string"){this.register("formats/"+o,t,r)}else{Object.keys(t).forEach(function(e){n.register(e,t[e],r)})}}else{if(this.imports[t]!=null&&!i){A.warn("Overwriting "+t+" with",r)}this.imports[t]=r;if((t.startsWith("blots/")||t.startsWith("formats/"))&&r.blotName!=="abstract"){v.default.register(r)}else if(t.startsWith("modules")&&typeof r.register==="function"){r.register()}}}}]);function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};j(this,e);this.options=q(t,n);this.container=this.options.container;if(this.container==null){return A.error("Invalid Quill container",t)}if(this.options.debug){e.debug(this.options.debug)}var i=this.container.innerHTML.trim();this.container.classList.add("ql-container");this.container.innerHTML="";this.container.__quill=this;this.root=this.addContainer("ql-editor");this.root.classList.add("ql-blank");this.root.setAttribute("data-gramm",false);this.scrollingContainer=this.options.scrollingContainer||this.root;this.emitter=new c.default;this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats});this.editor=new s.default(this.scroll);this.selection=new b.default(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.theme.init();this.emitter.on(c.default.events.EDITOR_CHANGE,function(e){if(e===c.default.events.TEXT_CHANGE){r.root.classList.toggle("ql-blank",r.editor.isBlank())}});this.emitter.on(c.default.events.SCROLL_UPDATE,function(e,t){var n=r.selection.lastRange;var i=n&&n.length===0?n.index:undefined;T.call(r,function(){return r.editor.update(null,t,i)},e)});var o=this.clipboard.convert("
"+i+"


");this.setContents(o);this.history.clear();if(this.options.placeholder){this.root.setAttribute("data-placeholder",this.options.placeholder)}if(this.options.readOnly){this.disable()}}o(e,[{key:"addContainer",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(typeof t==="string"){var n=t;t=document.createElement("div");t.classList.add(n)}this.container.insertBefore(t,r);return t}},{key:"blur",value:function e(){this.selection.setRange(null)}},{key:"deleteText",value:function e(t,r,n){var o=this;var a=S(t,r,n);var l=i(a,4);t=l[0];r=l[1];n=l[3];return T.call(this,function(){return o.editor.deleteText(t,r)},n,t,-1*r)}},{key:"disable",value:function e(){this.enable(false)}},{key:"enable",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.scroll.enable(t);this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function e(){var t=this.scrollingContainer.scrollTop;this.selection.focus();this.scrollingContainer.scrollTop=t;this.scrollIntoView()}},{key:"format",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:c.default.sources.API;return T.call(this,function(){var e=n.getSelection(true);var i=new l.default;if(e==null){return i}else if(v.default.query(t,v.default.Scope.BLOCK)){i=n.editor.formatLine(e.index,e.length,E({},t,r))}else if(e.length===0){n.selection.format(t,r);return i}else{i=n.editor.formatText(e.index,e.length,E({},t,r))}n.setSelection(e,c.default.sources.SILENT);return i},i)}},{key:"formatLine",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,r,n,o,a);var f=i(s,4);t=f[0];r=f[1];u=f[2];a=f[3];return T.call(this,function(){return l.editor.formatLine(t,r,u)},a,t,0)}},{key:"formatText",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,r,n,o,a);var f=i(s,4);t=f[0];r=f[1];u=f[2];a=f[3];return T.call(this,function(){return l.editor.formatText(t,r,u)},a,t,0)}},{key:"getBounds",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=void 0;if(typeof t==="number"){n=this.selection.getBounds(t,r)}else{n=this.selection.getBounds(t.index,t.length)}var i=this.container.getBoundingClientRect();return{bottom:n.bottom-i.top,height:n.height,left:n.left-i.left,right:n.right-i.left,top:n.top-i.top,width:n.width}}},{key:"getContents",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;var n=S(t,r);var o=i(n,2);t=o[0];r=o[1];return this.editor.getContents(t,r)}},{key:"getFormat",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getSelection(true);var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(typeof t==="number"){return this.editor.getFormat(t,r)}else{return this.editor.getFormat(t.index,t.length)}}},{key:"getIndex",value:function e(t){return t.offset(this.scroll)}},{key:"getLength",value:function e(){return this.scroll.length()}},{key:"getLeaf",value:function e(t){return this.scroll.leaf(t)}},{key:"getLine",value:function e(t){return this.scroll.line(t)}},{key:"getLines",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;if(typeof t!=="number"){return this.scroll.lines(t.index,t.length)}else{return this.scroll.lines(t,r)}}},{key:"getModule",value:function e(t){return this.theme.modules[t]}},{key:"getSelection",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t)this.focus();this.update();return this.selection.getRange()[0]}},{key:"getText",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;var n=S(t,r);var o=i(n,2);t=o[0];r=o[1];return this.editor.getText(t,r)}},{key:"hasFocus",value:function e(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function t(r,n,i){var o=this;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:e.sources.API;return T.call(this,function(){return o.editor.insertEmbed(r,n,i)},a,r)}},{key:"insertText",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,0,n,o,a);var f=i(s,4);t=f[0];u=f[2];a=f[3];return T.call(this,function(){return l.editor.insertText(t,r,u)},a,t,r.length)}},{key:"isEnabled",value:function e(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function e(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function e(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function e(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function e(t,r,n){this.clipboard.dangerouslyPasteHTML(t,r,n)}},{key:"removeFormat",value:function e(t,r,n){var o=this;var a=S(t,r,n);var l=i(a,4);t=l[0];r=l[1];n=l[3];return T.call(this,function(){return o.editor.removeFormat(t,r)},n,t)}},{key:"scrollIntoView",value:function e(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;return T.call(this,function(){t=new l.default(t);var e=r.getLength();var n=r.editor.deleteText(0,e);var i=r.editor.applyDelta(t);var o=i.ops[i.ops.length-1];if(o!=null&&typeof o.insert==="string"&&o.insert[o.insert.length-1]==="\n"){r.editor.deleteText(r.getLength()-1,1);i.delete(1)}var a=n.compose(i);return a},n)}},{key:"setSelection",value:function t(r,n,o){if(r==null){this.selection.setRange(null,n||e.sources.API)}else{var a=S(r,n,o);var l=i(a,4);r=l[0];n=l[1];o=l[3];this.selection.setRange(new y.Range(r,n),o);if(o!==c.default.sources.SILENT){this.selection.scrollIntoView(this.scrollingContainer)}}}},{key:"setText",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;var n=(new l.default).insert(t);return this.setContents(n,r)}},{key:"update",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c.default.sources.USER;var r=this.scroll.update(t);this.selection.update(t);return r}},{key:"updateContents",value:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;return T.call(this,function(){t=new l.default(t);return r.editor.applyDelta(t,n)},n,true)}}]);return e}();N.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:false,scrollingContainer:null,strict:true,theme:"default"};N.events=c.default.events;N.sources=c.default.sources;N.version=false?"dev":"1.3.7";N.imports={delta:l.default,parchment:v.default,"core/module":p.default,"core/theme":w.default};function q(e,t){t=(0,m.default)(true,{container:e,modules:{clipboard:true,keyboard:true,history:true}},t);if(!t.theme||t.theme===N.DEFAULTS.theme){t.theme=w.default}else{t.theme=N.import("themes/"+t.theme);if(t.theme==null){throw new Error("Invalid theme "+t.theme+". Did you register it?")}}var r=(0,m.default)(true,{},t.theme.DEFAULTS);[r,t].forEach(function(e){e.modules=e.modules||{};Object.keys(e.modules).forEach(function(t){if(e.modules[t]===true){e.modules[t]={}}})});var n=Object.keys(r.modules).concat(Object.keys(t.modules));var i=n.reduce(function(e,t){var r=N.import("modules/"+t);if(r==null){A.error("Cannot load "+t+" module. Are you sure you registered it?")}else{e[t]=r.DEFAULTS||{}}return e},{});if(t.modules!=null&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object){t.modules.toolbar={container:t.modules.toolbar}}t=(0,m.default)(true,{},N.DEFAULTS,{modules:i},r,t);["bounds","container","scrollingContainer"].forEach(function(e){if(typeof t[e]==="string"){t[e]=document.querySelector(t[e])}});t.modules=Object.keys(t.modules).reduce(function(e,r){if(t.modules[r]){e[r]=t.modules[r]}return e},{});return t}function T(e,t,r,n){if(this.options.strict&&!this.isEnabled()&&t===c.default.sources.USER){return new l.default}var i=r==null?null:this.getSelection();var o=this.editor.delta;var a=e();if(i!=null){if(r===true)r=i.index;if(n==null){i=P(i,a,t)}else if(n!==0){i=P(i,r,n,t)}this.setSelection(i,c.default.sources.SILENT)}if(a.length()>0){var u;var s=[c.default.events.TEXT_CHANGE,a,o,t];(u=this.emitter).emit.apply(u,[c.default.events.EDITOR_CHANGE].concat(s));if(t!==c.default.sources.SILENT){var f;(f=this.emitter).emit.apply(f,s)}}return a}function S(e,t,r,i,o){var a={};if(typeof e.index==="number"&&typeof e.length==="number"){if(typeof t!=="number"){o=i,i=r,r=t,t=e.length,e=e.index}else{t=e.length,e=e.index}}else if(typeof t!=="number"){o=i,i=r,r=t,t=0}if((typeof r==="undefined"?"undefined":n(r))==="object"){a=r;o=i}else if(typeof r==="string"){if(i!=null){a[r]=i}else{o=r}}o=o||c.default.sources.API;return[e,t,a,o]}function P(e,t,r,n){if(e==null)return null;var o=void 0,a=void 0;if(t instanceof l.default){var u=[e.index,e.index+e.length].map(function(e){return t.transformPosition(e,n!==c.default.sources.USER)});var s=i(u,2);o=s[0];a=s[1]}else{var f=[e.index,e.index+e.length].map(function(e){if(e=0){return e+r}else{return Math.max(t,e+r)}});var d=i(f,2);o=d[0];a=d[1]}return new y.Range(o,a-o)}t.expandConfig=q;t.overload=S;t.default=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n);n.wrap(this)}}}],[{key:"compare",value:function e(r,n){var i=t.order.indexOf(r);var o=t.order.indexOf(n);if(i>=0||o>=0){return i-o}else if(r===n){return 0}else if(r1?r-1:0),i=1;i1&&arguments[1]!==undefined?arguments[1]:{};n(this,e);this.quill=t;this.options=r};i.DEFAULTS={};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=["error","warn","log","info"];var i="warn";function o(e){if(n.indexOf(e)<=n.indexOf(i)){var t;for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a0&&typeof e[0]!=="number")return false;return true}function s(e,t,r){var s,f;if(l(e)||l(t))return false;if(e.prototype!==t.prototype)return false;if(o(e)){if(!o(t)){return false}e=n.call(e);t=n.call(t);return a(e,t,r)}if(u(e)){if(!u(t)){return false}if(e.length!==t.length)return false;for(s=0;s=0;s--){if(c[s]!=d[s])return false}for(s=c.length-1;s>=0;s--){f=c[s];if(!a(e[f],t[f],r))return false}return typeof e===typeof t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(1);var i=function(){function e(e,t,r){if(r===void 0){r={}}this.attrName=e;this.keyName=t;var i=n.Scope.TYPE&n.Scope.ATTRIBUTE;if(r.scope!=null){this.scope=r.scope&n.Scope.LEVEL|i}else{this.scope=n.Scope.ATTRIBUTE}if(r.whitelist!=null)this.whitelist=r.whitelist}e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})};e.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;e.setAttribute(this.keyName,t);return true};e.prototype.canAdd=function(e,t){var r=n.query(e,n.Scope.BLOT&(this.scope|n.Scope.TYPE));if(r==null)return false;if(this.whitelist==null)return true;if(typeof t==="string"){return this.whitelist.indexOf(t.replace(/["']/g,""))>-1}else{return this.whitelist.indexOf(t)>-1}};e.prototype.remove=function(e){e.removeAttribute(this.keyName)};e.prototype.value=function(e){var t=e.getAttribute(this.keyName);if(this.canAdd(e,t)&&t){return t}return""};return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.Code=undefined;var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function(){function e(e,t){for(var r=0;r=r+n)return;var l=this.newlineIndex(r,true)+1;var u=a-l+1;var f=this.isolate(l,u);var c=f.next;f.format(i,o);if(c instanceof t){c.formatAt(0,r-l+n-u,i,o)}}},{key:"insertAt",value:function e(t,r,i){if(i!=null)return;var o=this.descendant(v.default,t),a=n(o,2),l=a[0],u=a[1];l.insertAt(u,r)}},{key:"length",value:function e(){var e=this.domNode.textContent.length;if(!this.domNode.textContent.endsWith("\n")){return e+1}return e}},{key:"newlineIndex",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!r){var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}else{return this.domNode.textContent.slice(0,t).lastIndexOf("\n")}}},{key:"optimize",value:function e(r){if(!this.domNode.textContent.endsWith("\n")){this.appendChild(s.default.create("text","\n"))}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r);var n=this.next;if(n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)){n.optimize(r);n.moveChildren(this);n.remove()}}},{key:"replace",value:function e(r){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,r);[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=s.default.find(e);if(t==null){e.parentNode.removeChild(e)}else if(t instanceof s.default.Embed){t.remove()}else{t.unwrap()}})}}],[{key:"create",value:function e(r){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);n.setAttribute("spellcheck",false);return n}},{key:"formats",value:function e(){return true}}]);return t}(c.default);O.blotName="code-block";O.tagName="PRE";O.TAB=" ";t.Code=_;t.default=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r=a&&!f.endsWith("\n")){o=true}r.scroll.insertAt(e,f);var d=r.scroll.line(e),p=i(d,2),h=p[0],v=p[1];var g=(0,E.default)({},(0,y.bubbleFormats)(h));if(h instanceof b.default){var m=h.descendant(c.default.Leaf,v),_=i(m,1),O=_[0];g=(0,E.default)(g,(0,y.bubbleFormats)(O))}u=s.default.attributes.diff(g,u)||{}}else if(n(t.insert)==="object"){var x=Object.keys(t.insert)[0];if(x==null)return e;r.scroll.insertAt(e,x,t.insert[x])}a+=l}Object.keys(u).forEach(function(t){r.scroll.formatAt(e,l,t,u[t])});return e+l},0);t.reduce(function(e,t){if(typeof t.delete==="number"){r.scroll.deleteAt(e,t.delete);return e}return e+(t.retain||t.insert.length||1)},0);this.scroll.batchEnd();return this.update(t)}},{key:"deleteText",value:function e(t,r){this.scroll.deleteAt(t,r);return this.update((new l.default).retain(t).delete(r))}},{key:"formatLine",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.scroll.update();Object.keys(i).forEach(function(e){if(n.scroll.whitelist!=null&&!n.scroll.whitelist[e])return;var o=n.scroll.lines(t,Math.max(r,1));var a=r;o.forEach(function(r){var o=r.length();if(!(r instanceof p.default)){r.format(e,i[e])}else{var l=t-r.offset(n.scroll);var u=r.newlineIndex(l+a)-l+1;r.formatAt(l,u,e,i[e])}a-=o})});this.scroll.optimize();return this.update((new l.default).retain(t).retain(r,(0,O.default)(i)))}},{key:"formatText",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};Object.keys(i).forEach(function(e){n.scroll.formatAt(t,r,e,i[e])});return this.update((new l.default).retain(t).retain(r,(0,O.default)(i)))}},{key:"getContents",value:function e(t,r){return this.delta.slice(t,t+r)}},{key:"getDelta",value:function e(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new l.default)}},{key:"getFormat",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=[],o=[];if(r===0){this.scroll.path(t).forEach(function(e){var t=i(e,1),r=t[0];if(r instanceof b.default){n.push(r)}else if(r instanceof c.default.Leaf){o.push(r)}})}else{n=this.scroll.lines(t,r);o=this.scroll.descendants(c.default.Leaf,t,r)}var a=[n,o].map(function(e){if(e.length===0)return{};var t=(0,y.bubbleFormats)(e.shift());while(Object.keys(t).length>0){var r=e.shift();if(r==null)return t;t=S((0,y.bubbleFormats)(r),t)}return t});return E.default.apply(E.default,a)}},{key:"getText",value:function e(t,r){return this.getContents(t,r).filter(function(e){return typeof e.insert==="string"}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function e(t,r,n){this.scroll.insertAt(t,r,n);return this.update((new l.default).retain(t).insert(A({},r,n)))}},{key:"insertText",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};r=r.replace(/\r\n/g,"\n").replace(/\r/g,"\n");this.scroll.insertAt(t,r);Object.keys(i).forEach(function(e){n.scroll.formatAt(t,r.length,e,i[e])});return this.update((new l.default).retain(t).insert(r,(0,O.default)(i)))}},{key:"isBlank",value:function e(){if(this.scroll.children.length==0)return true;if(this.scroll.children.length>1)return false;var t=this.scroll.children.head;if(t.statics.blotName!==b.default.blotName)return false;if(t.children.length>1)return false;return t.children.head instanceof m.default}},{key:"removeFormat",value:function e(t,r){var n=this.getText(t,r);var o=this.scroll.line(t+r),a=i(o,2),u=a[0],s=a[1];var f=0,c=new l.default;if(u!=null){if(!(u instanceof p.default)){f=u.length()-s}else{f=u.newlineIndex(s)-s+1}c=u.delta().slice(s,s+f-1).insert("\n")}var d=this.getContents(t,r+f);var h=d.diff((new l.default).insert(n).concat(c));var v=(new l.default).retain(t).concat(h);return this.applyDelta(v)}},{key:"update",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;var i=this.delta;if(r.length===1&&r[0].type==="characterData"&&r[0].target.data.match(q)&&c.default.find(r[0].target)){var o=c.default.find(r[0].target);var a=(0,y.bubbleFormats)(o);var u=o.offset(this.scroll);var s=r[0].oldValue.replace(v.default.CONTENTS,"");var f=(new l.default).insert(s);var d=(new l.default).insert(o.value());var p=(new l.default).retain(u).concat(f.diff(d,n));t=p.reduce(function(e,t){if(t.insert){return e.insert(t.insert,a)}else{return e.push(t)}},new l.default);this.delta=i.compose(t)}else{this.delta=this.getDelta();if(!t||!(0,w.default)(i.compose(t),this.delta)){t=i.diff(this.delta,n)}}return t}}]);return e}();function S(e,t){return Object.keys(t).reduce(function(r,n){if(e[n]==null)return r;if(t[n]===e[n]){r[n]=t[n]}else if(Array.isArray(t[n])){if(t[n].indexOf(e[n])<0){r[n]=t[n].concat([e[n]])}}else{r[n]=[t[n],e[n]]}return r},{})}function P(e){return e.reduce(function(e,t){if(t.insert===1){var r=(0,O.default)(t.attributes);delete r["image"];return e.insert({image:t.attributes.image},r)}if(t.attributes!=null&&(t.attributes.list===true||t.attributes.bullet===true)){t=(0,O.default)(t);if(t.attributes.list){t.attributes.list="ordered"}else{t.attributes.list="bullet";delete t.attributes.bullet}}if(typeof t.insert==="string"){var n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)},new l.default)}t.default=T},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.Range=undefined;var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:0;b(this,e);this.index=t;this.length=r};var _=function(){function e(t,r){var n=this;b(this,e);this.emitter=r;this.scroll=t;this.composing=false;this.mouseDown=false;this.root=this.scroll.domNode;this.cursor=a.default.create("cursor",this);this.lastRange=this.savedRange=new m(0,0);this.handleComposition();this.handleDragging();this.emitter.listenDOM("selectionchange",document,function(){if(!n.mouseDown){setTimeout(n.update.bind(n,d.default.sources.USER),1)}});this.emitter.on(d.default.events.EDITOR_CHANGE,function(e,t){if(e===d.default.events.TEXT_CHANGE&&t.length()>0){n.update(d.default.sources.SILENT)}});this.emitter.on(d.default.events.SCROLL_BEFORE_UPDATE,function(){if(!n.hasFocus())return;var e=n.getNativeRange();if(e==null)return;if(e.start.node===n.cursor.textNode)return;n.emitter.once(d.default.events.SCROLL_UPDATE,function(){try{n.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})});this.emitter.on(d.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var r=t.range,i=r.startNode,o=r.startOffset,a=r.endNode,l=r.endOffset;n.setNativeRange(i,o,a,l)}});this.update(d.default.sources.SILENT)}i(e,[{key:"handleComposition",value:function e(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=true});this.root.addEventListener("compositionend",function(){t.composing=false;if(t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function e(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=true});this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=false;t.update(d.default.sources.USER)})}},{key:"focus",value:function e(){if(this.hasFocus())return;this.root.focus();this.setRange(this.savedRange)}},{key:"format",value:function e(t,r){if(this.scroll.whitelist!=null&&!this.scroll.whitelist[t])return;this.scroll.update();var n=this.getNativeRange();if(n==null||!n.native.collapsed||a.default.query(t,a.default.Scope.BLOCK))return;if(n.start.node!==this.cursor.textNode){var i=a.default.find(n.start.node,false);if(i==null)return;if(i instanceof a.default.Leaf){var o=i.split(n.start.offset);i.parent.insertBefore(this.cursor,o)}else{i.insertBefore(this.cursor,n.start.node)}this.cursor.attach()}this.cursor.format(t,r);this.scroll.optimize();this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length);this.update()}},{key:"getBounds",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=this.scroll.length();t=Math.min(t,i-1);r=Math.min(t+r,i-1)-t;var o=void 0,a=this.scroll.leaf(t),l=n(a,2),u=l[0],s=l[1];if(u==null)return null;var f=u.position(s,true);var c=n(f,2);o=c[0];s=c[1];var d=document.createRange();if(r>0){d.setStart(o,s);var p=this.scroll.leaf(t+r);var h=n(p,2);u=h[0];s=h[1];if(u==null)return null;var v=u.position(s,true);var y=n(v,2);o=y[0];s=y[1];d.setEnd(o,s);return d.getBoundingClientRect()}else{var b="left";var g=void 0;if(o instanceof Text){if(s0)b="right"}return{bottom:g.top+g.height,height:g.height,left:g[b],right:g[b],top:g.top,width:0}}}},{key:"getNativeRange",value:function e(){var t=document.getSelection();if(t==null||t.rangeCount<=0)return null;var r=t.getRangeAt(0);if(r==null)return null;var n=this.normalizeNative(r);g.info("getNativeRange",n);return n}},{key:"getRange",value:function e(){var t=this.getNativeRange();if(t==null)return[null,null];var r=this.normalizedToRange(t);return[r,t]}},{key:"hasFocus",value:function e(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function e(t){var r=this;var i=[[t.start.node,t.start.offset]];if(!t.native.collapsed){i.push([t.end.node,t.end.offset])}var o=i.map(function(e){var t=n(e,2),i=t[0],o=t[1];var l=a.default.find(i,true);var u=l.offset(r.scroll);if(o===0){return u}else if(l instanceof a.default.Container){return u+l.length()}else{return u+l.index(i,o)}});var l=Math.min(Math.max.apply(Math,y(o)),this.scroll.length()-1);var u=Math.min.apply(Math,[l].concat(y(o)));return new m(u,l-u)}},{key:"normalizeNative",value:function e(t){if(!O(this.root,t.startContainer)||!t.collapsed&&!O(this.root,t.endContainer)){return null}var r={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};[r.start,r.end].forEach(function(e){var t=e.node,r=e.offset;while(!(t instanceof Text)&&t.childNodes.length>0){if(t.childNodes.length>r){t=t.childNodes[r];r=0}else if(t.childNodes.length===r){t=t.lastChild;r=t instanceof Text?t.data.length:t.childNodes.length+1}else{break}}e.node=t,e.offset=r});return r}},{key:"rangeToNative",value:function e(t){var r=this;var i=t.collapsed?[t.index]:[t.index,t.index+t.length];var o=[];var a=this.scroll.length();i.forEach(function(e,t){e=Math.min(a-1,e);var i=void 0,l=r.scroll.leaf(e),u=n(l,2),s=u[0],f=u[1];var c=s.position(f,t!==0);var d=n(c,2);i=d[0];f=d[1];o.push(i,f)});if(o.length<2){o=o.concat(o)}return o}},{key:"scrollIntoView",value:function e(t){var r=this.lastRange;if(r==null)return;var i=this.getBounds(r.index,r.length);if(i==null)return;var o=this.scroll.length()-1;var a=this.scroll.line(Math.min(r.index,o)),l=n(a,1),u=l[0];var s=u;if(r.length>0){var f=this.scroll.line(Math.min(r.index+r.length,o));var c=n(f,1);s=c[0]}if(u==null||s==null)return;var d=t.getBoundingClientRect();if(i.topd.bottom){t.scrollTop+=i.bottom-d.bottom}}},{key:"setNativeRange",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:r;var o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;g.info("setNativeRange",t,r,n,i);if(t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null)){return}var a=document.getSelection();if(a==null)return;if(t!=null){if(!this.hasFocus())this.root.focus();var l=(this.getNativeRange()||{}).native;if(l==null||o||t!==l.startContainer||r!==l.startOffset||n!==l.endContainer||i!==l.endOffset){if(t.tagName=="BR"){r=[].indexOf.call(t.parentNode.childNodes,t);t=t.parentNode}if(n.tagName=="BR"){i=[].indexOf.call(n.parentNode.childNodes,n);n=n.parentNode}var u=document.createRange();u.setStart(t,r);u.setEnd(n,i);a.removeAllRanges();a.addRange(u)}}else{a.removeAllRanges();this.root.blur();document.body.focus()}}},{key:"setRange",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:d.default.sources.API;if(typeof r==="string"){n=r;r=false}g.info("setRange",t);if(t!=null){var i=this.rangeToNative(t);this.setNativeRange.apply(this,y(i).concat([r]))}else{this.setNativeRange(null)}this.update(n)}},{key:"update",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:d.default.sources.USER;var r=this.lastRange;var i=this.getRange(),o=n(i,2),a=o[0],l=o[1];this.lastRange=a;if(this.lastRange!=null){this.savedRange=this.lastRange}if(!(0,f.default)(r,this.lastRange)){var s;if(!this.composing&&l!=null&&l.native.collapsed&&l.start.node!==this.cursor.textNode){this.cursor.restore()}var c=[d.default.events.SELECTION_CHANGE,(0,u.default)(this.lastRange),(0,u.default)(r),t];(s=this.emitter).emit.apply(s,[d.default.events.EDITOR_CHANGE].concat(c));if(t!==d.default.sources.SILENT){var p;(p=this.emitter).emit.apply(p,c)}}}}]);return e}();function O(e,t){try{t.parentNode}catch(e){return false}if(t instanceof Text){t=t.parentNode}return e.contains(t)}t.Range=m;t.default=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r0)r+=1;return[this.parent.domNode,r]};t.prototype.value=function(){var e;return e={},e[this.statics.blotName]=this.statics.value(this.domNode)||true,e};t.scope=o.Scope.INLINE_BLOT;return t}(i.default);t.default=a},function(e,t,r){var n=r(11);var i=r(3);var o={attributes:{compose:function(e,t,r){if(typeof e!=="object")e={};if(typeof t!=="object")t={};var n=i(true,{},t);if(!r){n=Object.keys(n).reduce(function(e,t){if(n[t]!=null){e[t]=n[t]}return e},{})}for(var o in e){if(e[o]!==undefined&&t[o]===undefined){n[o]=e[o]}}return Object.keys(n).length>0?n:undefined},diff:function(e,t){if(typeof e!=="object")e={};if(typeof t!=="object")t={};var r=Object.keys(e).concat(Object.keys(t)).reduce(function(r,i){if(!n(e[i],t[i])){r[i]=t[i]===undefined?null:t[i]}return r},{});return Object.keys(r).length>0?r:undefined},transform:function(e,t,r){if(typeof e!=="object")return t;if(typeof t!=="object")return undefined;if(!r)return t;var n=Object.keys(t).reduce(function(r,n){if(e[n]===undefined)r[n]=t[n];return r},{});return Object.keys(n).length>0?n:undefined}},iterator:function(e){return new a(e)},length:function(e){if(typeof e["delete"]==="number"){return e["delete"]}else if(typeof e.retain==="number"){return e.retain}else{return typeof e.insert==="string"?e.insert.length:1}}};function a(e){this.ops=e;this.index=0;this.offset=0}a.prototype.hasNext=function(){return this.peekLength()=n-r){e=n-r;this.index+=1;this.offset=0}else{this.offset+=e}if(typeof t["delete"]==="number"){return{delete:e}}else{var i={};if(t.attributes){i.attributes=t.attributes}if(typeof t.retain==="number"){i.retain=e}else if(typeof t.insert==="string"){i.insert=t.insert.substr(r,e)}else{i.insert=t.insert}return i}}else{return{retain:Infinity}}};a.prototype.peek=function(){return this.ops[this.index]};a.prototype.peekLength=function(){if(this.ops[this.index]){return o.length(this.ops[this.index])-this.offset}else{return Infinity}};a.prototype.peekType=function(){if(this.ops[this.index]){if(typeof this.ops[this.index]["delete"]==="number"){return"delete"}else if(typeof this.ops[this.index].retain==="number"){return"retain"}else{return"insert"}}return"retain"};a.prototype.rest=function(){if(!this.hasNext()){return[]}else if(this.offset===0){return this.ops.slice(this.index)}else{var e=this.offset;var t=this.index;var r=this.next();var n=this.ops.slice(this.index);this.offset=e;this.index=t;return[r].concat(n)}};e.exports=o},function(e,t){var r=function(){"use strict";function e(e,t){return t!=null&&e instanceof t}var t;try{t=Map}catch(e){t=function(){}}var r;try{r=Set}catch(e){r=function(){}}var n;try{n=Promise}catch(e){n=function(){}}function i(o,a,l,u,f){if(typeof a==="object"){l=a.depth;u=a.prototype;f=a.includeNonEnumerable;a=a.circular}var c=[];var d=[];var p=typeof Buffer!="undefined";if(typeof a=="undefined")a=true;if(typeof l=="undefined")l=Infinity;function h(o,l){if(o===null)return null;if(l===0)return o;var v;var y;if(typeof o!="object"){return o}if(e(o,t)){v=new t}else if(e(o,r)){v=new r}else if(e(o,n)){v=new n(function(e,t){o.then(function(t){e(h(t,l-1))},function(e){t(h(e,l-1))})})}else if(i.__isArray(o)){v=[]}else if(i.__isRegExp(o)){v=new RegExp(o.source,s(o));if(o.lastIndex)v.lastIndex=o.lastIndex}else if(i.__isDate(o)){v=new Date(o.getTime())}else if(p&&Buffer.isBuffer(o)){if(Buffer.allocUnsafe){v=Buffer.allocUnsafe(o.length)}else{v=new Buffer(o.length)}o.copy(v);return v}else if(e(o,Error)){v=Object.create(o)}else{if(typeof u=="undefined"){y=Object.getPrototypeOf(o);v=Object.create(y)}else{v=Object.create(u);y=u}}if(a){var b=c.indexOf(o);if(b!=-1){return d[b]}c.push(o);d.push(v)}if(e(o,t)){o.forEach(function(e,t){var r=h(t,l-1);var n=h(e,l-1);v.set(r,n)})}if(e(o,r)){o.forEach(function(e){var t=h(e,l-1);v.add(t)})}for(var g in o){var m;if(y){m=Object.getOwnPropertyDescriptor(y,g)}if(m&&m.set==null){continue}v[g]=h(o[g],l-1)}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(o);for(var g=0;g<_.length;g++){var O=_[g];var x=Object.getOwnPropertyDescriptor(o,O);if(x&&!x.enumerable&&!f){continue}v[O]=h(o[O],l-1);if(!x.enumerable){Object.defineProperty(v,O,{enumerable:false})}}}if(f){var w=Object.getOwnPropertyNames(o);for(var g=0;g0){if(u instanceof f.BlockEmbed||h instanceof f.BlockEmbed){this.optimize();return}if(u instanceof v.default){var y=u.newlineIndex(u.length(),true);if(y>-1){u=u.split(y+1);if(u===h){this.optimize();return}}}else if(h instanceof v.default){var b=h.newlineIndex(0);if(b>-1){h.split(b+1)}}var g=h.children.head instanceof p.default?null:h.children.head;u.moveChildren(h,g);u.remove()}this.optimize()}},{key:"enable",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function e(r,n,i,a){if(this.whitelist!=null&&!this.whitelist[i])return;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,r,n,i,a);this.optimize()}},{key:"insertAt",value:function e(r,n,i){if(i!=null&&this.whitelist!=null&&!this.whitelist[n])return;if(r>=this.length()){if(i==null||l.default.query(n,l.default.Scope.BLOCK)==null){var a=l.default.create(this.statics.defaultChild);this.appendChild(a);if(i==null&&n.endsWith("\n")){n=n.slice(0,-1)}a.insertAt(0,n,i)}else{var u=l.default.create(n,i);this.appendChild(u)}}else{o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,r,n,i)}this.optimize()}},{key:"insertBefore",value:function e(r,n){if(r.statics.scope===l.default.Scope.INLINE_BLOT){var i=l.default.create(this.statics.defaultChild);i.appendChild(r);r=i}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,r,n)}},{key:"leaf",value:function e(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function e(t){if(t===this.length()){return this.line(t-1)}return this.descendant(x,t)}},{key:"lines",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;var n=function e(t,r,n){var i=[],o=n;t.children.forEachAt(r,n,function(t,r,n){if(x(t)){i.push(t)}else if(t instanceof l.default.Container){i=i.concat(e(t,r,o))}o-=n});return i};return n(this,t,r)}},{key:"optimize",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.batch)return;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r,n);if(r.length>0){this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,r,n)}}},{key:"path",value:function e(r){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,r).slice(1)}},{key:"update",value:function e(r){if(this.batch){if(Array.isArray(r)){this.batch=this.batch.concat(r)}return}var n=s.default.sources.USER;if(typeof r==="string"){n=r}if(!Array.isArray(r)){r=this.observer.takeRecords()}if(r.length>0){this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,r)}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,r.concat([]));if(r.length>0){this.emitter.emit(s.default.events.SCROLL_UPDATE,n,r)}}}]);return t}(l.default.Scroll);w.blotName="scroll";w.className="ql-editor";w.tagName="DIV";w.defaultChild="block";w.allowedChildren=[c.default,f.BlockEmbed,b.default];t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SHORTKEY=t.default=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=D(t);if(i==null||i.key==null){return q.warn("Attempted to add invalid keyboard binding",i)}if(typeof r==="function"){r={handler:r}}if(typeof n==="function"){n={handler:n}}i=(0,c.default)(i,r,n);this.bindings[i.key]=this.bindings[i.key]||[];this.bindings[i.key].push(i)}},{key:"listen",value:function e(){var r=this;this.quill.root.addEventListener("keydown",function(e){if(e.defaultPrevented)return;var o=e.which||e.keyCode;var a=(r.bindings[o]||[]).filter(function(r){return t.match(e,r)});if(a.length===0)return;var l=r.quill.getSelection();if(l==null||!r.quill.hasFocus())return;var u=r.quill.getLine(l.index),f=i(u,2),c=f[0],d=f[1];var p=r.quill.getLeaf(l.index),h=i(p,2),v=h[0],y=h[1];var g=l.length===0?[v,y]:r.quill.getLeaf(l.index+l.length),m=i(g,2),_=m[0],O=m[1];var x=v instanceof b.default.Text?v.value().slice(0,y):"";var w=_ instanceof b.default.Text?_.value().slice(O):"";var k={collapsed:l.length===0,empty:l.length===0&&c.length()<=1,format:r.quill.getFormat(l),offset:d,prefix:x,suffix:w};var E=a.some(function(e){if(e.collapsed!=null&&e.collapsed!==k.collapsed)return false;if(e.empty!=null&&e.empty!==k.empty)return false;if(e.offset!=null&&e.offset!==k.offset)return false;if(Array.isArray(e.format)){if(e.format.every(function(e){return k.format[e]==null})){return false}}else if(n(e.format)==="object"){if(!Object.keys(e.format).every(function(t){if(e.format[t]===true)return k.format[t]!=null;if(e.format[t]===false)return k.format[t]==null;return(0,s.default)(e.format[t],k.format[t])})){return false}}if(e.prefix!=null&&!e.prefix.test(k.prefix))return false;if(e.suffix!=null&&!e.suffix.test(k.suffix))return false;return e.handler.call(r,l,k)!==true});if(E){e.preventDefault()}})}}]);return t}(w.default);S.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};S.DEFAULTS={bindings:{bold:B("bold"),italic:B("italic"),underline:B("underline"),indent:{key:S.keys.TAB,format:["blockquote","indent","list"],handler:function e(t,r){if(r.collapsed&&r.offset!==0)return true;this.quill.format("indent","+1",m.default.sources.USER)}},outdent:{key:S.keys.TAB,shiftKey:true,format:["blockquote","indent","list"],handler:function e(t,r){if(r.collapsed&&r.offset!==0)return true;this.quill.format("indent","-1",m.default.sources.USER)}},"outdent backspace":{key:S.keys.BACKSPACE,collapsed:true,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function e(t,r){if(r.format.indent!=null){this.quill.format("indent","-1",m.default.sources.USER)}else if(r.format.list!=null){this.quill.format("list",false,m.default.sources.USER)}}},"indent code-block":I(true),"outdent code-block":I(false),"remove tab":{key:S.keys.TAB,shiftKey:true,collapsed:true,prefix:/\t$/,handler:function e(t){this.quill.deleteText(t.index-1,1,m.default.sources.USER)}},tab:{key:S.keys.TAB,handler:function e(t){this.quill.history.cutoff();var r=(new p.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(r,m.default.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index+1,m.default.sources.SILENT)}},"list empty enter":{key:S.keys.ENTER,collapsed:true,format:["list"],empty:true,handler:function e(t,r){this.quill.format("list",false,m.default.sources.USER);if(r.format.indent){this.quill.format("indent",false,m.default.sources.USER)}}},"checklist enter":{key:S.keys.ENTER,collapsed:true,format:{list:"checked"},handler:function e(t){var r=this.quill.getLine(t.index),n=i(r,2),o=n[0],a=n[1];var l=(0,c.default)({},o.formats(),{list:"checked"});var u=(new p.default).retain(t.index).insert("\n",l).retain(o.length()-a-1).retain(1,{list:"unchecked"});this.quill.updateContents(u,m.default.sources.USER);this.quill.setSelection(t.index+1,m.default.sources.SILENT);this.quill.scrollIntoView()}},"header enter":{key:S.keys.ENTER,collapsed:true,format:["header"],suffix:/^$/,handler:function e(t,r){var n=this.quill.getLine(t.index),o=i(n,2),a=o[0],l=o[1];var u=(new p.default).retain(t.index).insert("\n",r.format).retain(a.length()-l-1).retain(1,{header:null});this.quill.updateContents(u,m.default.sources.USER);this.quill.setSelection(t.index+1,m.default.sources.SILENT);this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:true,format:{list:false},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function e(t,r){var n=r.prefix.length;var o=this.quill.getLine(t.index),a=i(o,2),l=a[0],u=a[1];if(u>n)return true;var s=void 0;switch(r.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",m.default.sources.USER);this.quill.history.cutoff();var f=(new p.default).retain(t.index-u).delete(n+1).retain(l.length()-2-u).retain(1,{list:s});this.quill.updateContents(f,m.default.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index-n,m.default.sources.SILENT)}},"code exit":{key:S.keys.ENTER,collapsed:true,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function e(t){var r=this.quill.getLine(t.index),n=i(r,2),o=n[0],a=n[1];var l=(new p.default).retain(t.index+o.length()-a-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(l,m.default.sources.USER)}},"embed left":P(S.keys.LEFT,false),"embed left shift":P(S.keys.LEFT,true),"embed right":P(S.keys.RIGHT,false),"embed right shift":P(S.keys.RIGHT,true)}};function P(e,t){var r;var n=e===S.keys.LEFT?"prefix":"suffix";return r={key:e,shiftKey:t,altKey:null},E(r,n,/^$/),E(r,"handler",function r(n){var o=n.index;if(e===S.keys.RIGHT){o+=n.length+1}var a=this.quill.getLeaf(o),l=i(a,1),u=l[0];if(!(u instanceof b.default.Embed))return true;if(e===S.keys.LEFT){if(t){this.quill.setSelection(n.index-1,n.length+1,m.default.sources.USER)}else{this.quill.setSelection(n.index-1,m.default.sources.USER)}}else{if(t){this.quill.setSelection(n.index,n.length+1,m.default.sources.USER)}else{this.quill.setSelection(n.index+n.length+1,m.default.sources.USER)}}return false}),r}function C(e,t){if(e.index===0||this.quill.getLength()<=1)return;var r=this.quill.getLine(e.index),n=i(r,1),o=n[0];var a={};if(t.offset===0){var l=this.quill.getLine(e.index-1),u=i(l,1),s=u[0];if(s!=null&&s.length()>1){var f=o.formats();var c=this.quill.getFormat(e.index-1,1);a=v.default.attributes.diff(f,c)||{}}}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-d,d,m.default.sources.USER);if(Object.keys(a).length>0){this.quill.formatLine(e.index-d,d,a,m.default.sources.USER)}this.quill.focus()}function L(e,t){var r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;var n={},o=0;var a=this.quill.getLine(e.index),l=i(a,1),u=l[0];if(t.offset>=u.length()-1){var s=this.quill.getLine(e.index+1),f=i(s,1),c=f[0];if(c){var d=u.formats();var p=this.quill.getFormat(e.index,1);n=v.default.attributes.diff(d,p)||{};o=c.length()}}this.quill.deleteText(e.index,r,m.default.sources.USER);if(Object.keys(n).length>0){this.quill.formatLine(e.index+o-1,r,n,m.default.sources.USER)}}function M(e){var t=this.quill.getLines(e);var r={};if(t.length>1){var n=t[0].formats();var i=t[t.length-1].formats();r=v.default.attributes.diff(i,n)||{}}this.quill.deleteText(e,m.default.sources.USER);if(Object.keys(r).length>0){this.quill.formatLine(e.index,1,r,m.default.sources.USER)}this.quill.setSelection(e.index,m.default.sources.SILENT);this.quill.focus()}function R(e,t){var r=this;if(e.length>0){this.quill.scroll.deleteAt(e.index,e.length)}var n=Object.keys(t.format).reduce(function(e,r){if(b.default.query(r,b.default.Scope.BLOCK)&&!Array.isArray(t.format[r])){e[r]=t.format[r]}return e},{});this.quill.insertText(e.index,"\n",n,m.default.sources.USER);this.quill.setSelection(e.index+1,m.default.sources.SILENT);this.quill.focus();Object.keys(t.format).forEach(function(e){if(n[e]!=null)return;if(Array.isArray(t.format[e]))return;if(e==="link")return;r.quill.format(e,t.format[e],m.default.sources.USER)})}function I(e){return{key:S.keys.TAB,shiftKey:!e,format:{"code-block":true},handler:function t(r){var n=b.default.query("code-block");var o=r.index,a=r.length;var l=this.quill.scroll.descendant(n,o),u=i(l,2),s=u[0],f=u[1];if(s==null)return;var c=this.quill.getIndex(s);var d=s.newlineIndex(f,true)+1;var p=s.newlineIndex(c+f+a);var h=s.domNode.textContent.slice(d,p).split("\n");f=0;h.forEach(function(t,r){if(e){s.insertAt(d+f,n.TAB);f+=n.TAB.length;if(r===0){o+=n.TAB.length}else{a+=n.TAB.length}}else if(t.startsWith(n.TAB)){s.deleteAt(d+f,n.TAB.length);f-=n.TAB.length;if(r===0){o-=n.TAB.length}else{a-=n.TAB.length}}f+=t.length+1});this.quill.update(m.default.sources.USER);this.quill.setSelection(o,a,m.default.sources.SILENT)}}}function B(e){return{key:e[0].toUpperCase(),shortKey:true,handler:function t(r,n){this.quill.format(e,!n.format[e],m.default.sources.USER)}}}function D(e){if(typeof e==="string"||typeof e==="number"){return D({key:e})}if((typeof e==="undefined"?"undefined":n(e))==="object"){e=(0,l.default)(e,false)}if(typeof e.key==="string"){if(S.keys[e.key.toUpperCase()]!=null){e.key=S.keys[e.key.toUpperCase()]}else if(e.key.length===1){e.key=e.key.toUpperCase().charCodeAt(0)}else{return null}}if(e.shortKey){e[T]=e.shortKey;delete e.shortKey}return e}t.default=S;t.SHORTKEY=T},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var o=function(){function e(e,t){for(var r=0;r-1}t.default=c;t.sanitize=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:false;var i=this.container.querySelector(".ql-selected");if(t===i)return;if(i!=null){i.classList.remove("ql-selected")}if(t==null)return;t.classList.add("ql-selected");this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t);if(t.hasAttribute("data-value")){this.label.setAttribute("data-value",t.getAttribute("data-value"))}else{this.label.removeAttribute("data-value")}if(t.hasAttribute("data-label")){this.label.setAttribute("data-label",t.getAttribute("data-label"))}else{this.label.removeAttribute("data-label")}if(r){if(typeof Event==="function"){this.select.dispatchEvent(new Event("change"))}else if((typeof Event==="undefined"?"undefined":n(Event))==="object"){var o=document.createEvent("Event");o.initEvent("change",true,true);this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function e(){var t=void 0;if(this.select.selectedIndex>-1){var r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex];this.selectItem(r)}else{this.selectItem(null)}var n=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]);return e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(0);var i=q(n);var o=r(5);var a=q(o);var l=r(4);var u=q(l);var s=r(16);var f=q(s);var c=r(25);var d=q(c);var p=r(24);var h=q(p);var v=r(35);var y=q(v);var b=r(6);var g=q(b);var m=r(22);var _=q(m);var O=r(7);var x=q(O);var w=r(55);var k=q(w);var E=r(42);var j=q(E);var A=r(23);var N=q(A);function q(e){return e&&e.__esModule?e:{default:e}}a.default.register({"blots/block":u.default,"blots/block/embed":l.BlockEmbed,"blots/break":f.default,"blots/container":d.default,"blots/cursor":h.default,"blots/embed":y.default,"blots/inline":g.default,"blots/scroll":_.default,"blots/text":x.default,"modules/clipboard":k.default,"modules/history":j.default,"modules/keyboard":N.default});i.default.register(u.default,f.default,h.default,g.default,_.default,x.default);t.default=a.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(1);var i=function(){function e(e){this.domNode=e;this.domNode[n.DATA_KEY]={blot:this}}Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:true,configurable:true});e.create=function(e){if(this.tagName==null){throw new n.ParchmentError("Blot definition missing tagName")}var t;if(Array.isArray(this.tagName)){if(typeof e==="string"){e=e.toUpperCase();if(parseInt(e).toString()===e){e=parseInt(e)}}if(typeof e==="number"){t=document.createElement(this.tagName[e-1])}else if(this.tagName.indexOf(e)>-1){t=document.createElement(e)}else{t=document.createElement(this.tagName[0])}}else{t=document.createElement(this.tagName)}if(this.className){t.classList.add(this.className)}return t};e.prototype.attach=function(){if(this.parent!=null){this.scroll=this.parent.scroll}};e.prototype.clone=function(){var e=this.domNode.cloneNode(false);return n.create(e)};e.prototype.detach=function(){if(this.parent!=null)this.parent.removeChild(this);delete this.domNode[n.DATA_KEY]};e.prototype.deleteAt=function(e,t){var r=this.isolate(e,t);r.remove()};e.prototype.formatAt=function(e,t,r,i){var o=this.isolate(e,t);if(n.query(r,n.Scope.BLOT)!=null&&i){o.wrap(r,i)}else if(n.query(r,n.Scope.ATTRIBUTE)!=null){var a=n.create(this.statics.scope);o.wrap(a);a.format(r,i)}};e.prototype.insertAt=function(e,t,r){var i=r==null?n.create("text",t):n.create(t,r);var o=this.split(e);this.parent.insertBefore(i,o)};e.prototype.insertInto=function(e,t){if(t===void 0){t=null}if(this.parent!=null){this.parent.children.remove(this)}var r=null;e.children.insertBefore(this,t);if(t!=null){r=t.domNode}if(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=r){e.domNode.insertBefore(this.domNode,r)}this.parent=e;this.attach()};e.prototype.isolate=function(e,t){var r=this.split(e);r.split(t);return r};e.prototype.length=function(){return 1};e.prototype.offset=function(e){if(e===void 0){e=this.parent}if(this.parent==null||this==e)return 0;return this.parent.children.offset(this)+this.parent.offset(e)};e.prototype.optimize=function(e){if(this.domNode[n.DATA_KEY]!=null){delete this.domNode[n.DATA_KEY].mutations}};e.prototype.remove=function(){if(this.domNode.parentNode!=null){this.domNode.parentNode.removeChild(this.domNode)}this.detach()};e.prototype.replace=function(e){if(e.parent==null)return;e.parent.insertBefore(this,e.next);e.remove()};e.prototype.replaceWith=function(e,t){var r=typeof e==="string"?n.create(e,t):e;r.replace(this);return r};e.prototype.split=function(e,t){return e===0?this:this.next};e.prototype.update=function(e,t){};e.prototype.wrap=function(e,t){var r=typeof e==="string"?n.create(e,t):e;if(this.parent!=null){this.parent.insertBefore(r,this.next)}r.appendChild(this);return r};e.blotName="abstract";return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(12);var i=r(32);var o=r(33);var a=r(1);var l=function(){function e(e){this.attributes={};this.domNode=e;this.build()}e.prototype.attribute=function(e,t){if(t){if(e.add(this.domNode,t)){if(e.value(this.domNode)!=null){this.attributes[e.attrName]=e}else{delete this.attributes[e.attrName]}}}else{e.remove(this.domNode);delete this.attributes[e.attrName]}};e.prototype.build=function(){var e=this;this.attributes={};var t=n.default.keys(this.domNode);var r=i.default.keys(this.domNode);var l=o.default.keys(this.domNode);t.concat(r).concat(l).forEach(function(t){var r=a.query(t,a.Scope.ATTRIBUTE);if(r instanceof n.default){e.attributes[r.attrName]=r}})};e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(r){var n=t.attributes[r].value(t.domNode);e.format(r,n)})};e.prototype.move=function(e){var t=this;this.copy(e);Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)});this.attributes={}};e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,r){t[r]=e.attributes[r].value(e.domNode);return t},{})};return e}();t.default=l},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(12);function o(e,t){var r=e.getAttribute("class")||"";return r.split(/\s+/).filter(function(e){return e.indexOf(t+"-")===0})}var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})};t.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;this.remove(e);e.classList.add(this.keyName+"-"+t);return true};t.prototype.remove=function(e){var t=o(e,this.keyName);t.forEach(function(t){e.classList.remove(t)});if(e.classList.length===0){e.removeAttribute("class")}};t.prototype.value=function(e){var t=o(e,this.keyName)[0]||"";var r=t.slice(this.keyName.length+1);return this.canAdd(e,r)?r:""};return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(12);function o(e){var t=e.split("-");var r=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+r}var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){var t=e.split(":");return t[0].trim()})};t.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;e.style[o(this.keyName)]=t;return true};t.prototype.remove=function(e){e.style[o(this.keyName)]="";if(!e.getAttribute("style")){e.removeAttribute("style")}};t.prototype.value=function(e){var t=e.style[o(this.keyName)];return this.canAdd(e,t)?t:""};return t}(i.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;ri&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo);t=o.redo.compose(t)}else{this.lastRecorded=i}this.stack.undo.push({redo:t,undo:n});if(this.stack.undo.length>this.options.maxStack){this.stack.undo.shift()}}},{key:"redo",value:function e(){this.change("redo","undo")}},{key:"transform",value:function e(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,true);e.redo=t.transform(e.redo,true)});this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,true);e.redo=t.transform(e.redo,true)})}},{key:"undo",value:function e(){this.change("undo","redo")}}]);return t}(s.default);h.DEFAULTS={delay:1e3,maxStack:100,userOnly:false};function v(e){var t=e.ops[e.ops.length-1];if(t==null)return false;if(t.insert!=null){return typeof t.insert==="string"&&t.insert.endsWith("\n")}if(t.attributes!=null){return Object.keys(t.attributes).some(function(e){return o.default.query(e,o.default.Scope.BLOCK)!=null})}return false}function y(e){var t=e.reduce(function(e,t){e+=t.delete||0;return e},0);var r=e.length()-t;if(v(e)){r-=1}return r}t.default=h;t.getLastChangeIndex=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.BaseTooltip=undefined;var n=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:"link";var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.root.classList.remove("ql-hidden");this.root.classList.add("ql-editing");if(r!=null){this.textbox.value=r}else if(t!==this.root.getAttribute("data-mode")){this.textbox.value=""}this.position(this.quill.getBounds(this.quill.selection.savedRange));this.textbox.select();this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||"");this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function e(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus();this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function e(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var r=this.quill.root.scrollTop;if(this.linkRange){this.quill.formatText(this.linkRange,"link",t,f.default.sources.USER);delete this.linkRange}else{this.restoreFocus();this.quill.format("link",t,f.default.sources.USER)}this.quill.root.scrollTop=r;break}case"video":{t=L(t)}case"formula":{if(!t)break;var n=this.quill.getSelection(true);if(n!=null){var i=n.index+n.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,f.default.sources.USER);if(this.root.getAttribute("data-mode")==="formula"){this.quill.insertText(i+1," ",f.default.sources.USER)}this.quill.setSelection(i+2,f.default.sources.USER)}break}default:}this.textbox.value="";this.hide()}}]);return t}(x.default);function L(e){var t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t){return(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0"}if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)){return(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/"}return e}function M(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;t.forEach(function(t){var n=document.createElement("option");if(t===r){n.setAttribute("selected","selected")}else{n.setAttribute("value",t)}e.appendChild(n)})}t.BaseTooltip=C;t.default=P},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){this.head=this.tail=null;this.length=0}e.prototype.append=function(){var e=[];for(var t=0;t1){this.append.apply(this,e.slice(1))}};e.prototype.contains=function(e){var t,r=this.iterator();while(t=r()){if(t===e)return true}return false};e.prototype.insertBefore=function(e,t){if(!e)return;e.next=t;if(t!=null){e.prev=t.prev;if(t.prev!=null){t.prev.next=e}t.prev=e;if(t===this.head){this.head=e}}else if(this.tail!=null){this.tail.next=e;e.prev=this.tail;this.tail=e}else{e.prev=null;this.head=this.tail=e}this.length+=1};e.prototype.offset=function(e){var t=0,r=this.head;while(r!=null){if(r===e)return t;t+=r.length();r=r.next}return-1};e.prototype.remove=function(e){if(!this.contains(e))return;if(e.prev!=null)e.prev.next=e.next;if(e.next!=null)e.next.prev=e.prev;if(e===this.head)this.head=e.next;if(e===this.tail)this.tail=e.prev;this.length-=1};e.prototype.iterator=function(e){if(e===void 0){e=this.head}return function(){var t=e;if(e!=null)e=e.next;return t}};e.prototype.find=function(e,t){if(t===void 0){t=false}var r,n=this.iterator();while(r=n()){var i=r.length();if(el){r(a,e-l,Math.min(t,l+s-e))}else{r(a,0,Math.min(s,e+t-l))}l+=s}};e.prototype.map=function(e){return this.reduce(function(t,r){t.push(e(r));return t},[])};e.prototype.reduce=function(e,t){var r,n=this.iterator();while(r=n()){t=e(t,r)}return t};return e}();t.default=n},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(17);var o=r(1);var a={attributes:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true};var l=100;var u=function(e){n(t,e);function t(t){var r=e.call(this,t)||this;r.scroll=r;r.observer=new MutationObserver(function(e){r.update(e)});r.observer.observe(r.domNode,a);r.attach();return r}t.prototype.detach=function(){e.prototype.detach.call(this);this.observer.disconnect()};t.prototype.deleteAt=function(t,r){this.update();if(t===0&&r===this.length()){this.children.forEach(function(e){e.remove()})}else{e.prototype.deleteAt.call(this,t,r)}};t.prototype.formatAt=function(t,r,n,i){this.update();e.prototype.formatAt.call(this,t,r,n,i)};t.prototype.insertAt=function(t,r,n){this.update();e.prototype.insertAt.call(this,t,r,n)};t.prototype.optimize=function(t,r){var n=this;if(t===void 0){t=[]}if(r===void 0){r={}}e.prototype.optimize.call(this,r);var a=[].slice.call(this.observer.takeRecords());while(a.length>0)t.push(a.pop());var u=function(e,t){if(t===void 0){t=true}if(e==null||e===n)return;if(e.domNode.parentNode==null)return;if(e.domNode[o.DATA_KEY].mutations==null){e.domNode[o.DATA_KEY].mutations=[]}if(t)u(e.parent)};var s=function(e){if(e.domNode[o.DATA_KEY]==null||e.domNode[o.DATA_KEY].mutations==null){return}if(e instanceof i.default){e.children.forEach(s)}e.optimize(r)};var f=t;for(var c=0;f.length>0;c+=1){if(c>=l){throw new Error("[Parchment] Maximum optimize iterations reached")}f.forEach(function(e){var t=o.find(e.target,true);if(t==null)return;if(t.domNode===e.target){if(e.type==="childList"){u(o.find(e.previousSibling,false));[].forEach.call(e.addedNodes,function(e){var t=o.find(e,false);u(t,false);if(t instanceof i.default){t.children.forEach(function(e){u(e,false)})}})}else if(e.type==="attributes"){u(t.prev)}}u(t)});this.children.forEach(s);f=[].slice.call(this.observer.takeRecords());a=f.slice();while(a.length>0)t.push(a.pop())}};t.prototype.update=function(t,r){var n=this;if(r===void 0){r={}}t=t||this.observer.takeRecords();t.map(function(e){var t=o.find(e.target,true);if(t==null)return null;if(t.domNode[o.DATA_KEY].mutations==null){t.domNode[o.DATA_KEY].mutations=[e];return t}else{t.domNode[o.DATA_KEY].mutations.push(e);return null}}).forEach(function(e){if(e==null||e===n||e.domNode[o.DATA_KEY]==null)return;e.update(e.domNode[o.DATA_KEY].mutations||[],r)});if(this.domNode[o.DATA_KEY].mutations!=null){e.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,r)}this.optimize(t,r)};t.blotName="scroll";t.defaultChild="block";t.scope=o.Scope.BLOCK_BLOT;t.tagName="DIV";return t}(i.default);t.default=u},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(18);var o=r(1);function a(e,t){if(Object.keys(e).length!==Object.keys(t).length)return false;for(var r in e){if(e[r]!==t[r])return false}return true}var l=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(r){if(r.tagName===t.tagName)return undefined;return e.formats.call(this,r)};t.prototype.format=function(r,n){var o=this;if(r===this.statics.blotName&&!n){this.children.forEach(function(e){if(!(e instanceof i.default)){e=e.wrap(t.blotName,true)}o.attributes.copy(e)});this.unwrap()}else{e.prototype.format.call(this,r,n)}};t.prototype.formatAt=function(t,r,n,i){if(this.formats()[n]!=null||o.query(n,o.Scope.ATTRIBUTE)){var a=this.isolate(t,r);a.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.optimize=function(r){e.prototype.optimize.call(this,r);var n=this.formats();if(Object.keys(n).length===0){return this.unwrap()}var i=this.next;if(i instanceof t&&i.prev===this&&a(n,i.formats())){i.moveChildren(this);i.remove()}};t.blotName="inline";t.scope=o.Scope.INLINE_BLOT;t.tagName="SPAN";return t}(i.default);t.default=l},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(18);var o=r(1);var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(r){var n=o.query(t.blotName).tagName;if(r.tagName===n)return undefined;return e.formats.call(this,r)};t.prototype.format=function(r,n){if(o.query(r,o.Scope.BLOCK)==null){return}else if(r===this.statics.blotName&&!n){this.replaceWith(t.blotName)}else{e.prototype.format.call(this,r,n)}};t.prototype.formatAt=function(t,r,n,i){if(o.query(n,o.Scope.BLOCK)!=null){this.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.insertAt=function(t,r,n){if(n==null||o.query(r,o.Scope.INLINE)!=null){e.prototype.insertAt.call(this,t,r,n)}else{var i=this.split(t);var a=o.create(r,n);i.parent.insertBefore(a,i)}};t.prototype.update=function(t,r){if(navigator.userAgent.match(/Trident/)){this.build()}else{e.prototype.update.call(this,t,r)}};t.blotName="block";t.scope=o.Scope.BLOCK_BLOT;t.tagName="P";return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(19);var o=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(e){return undefined};t.prototype.format=function(t,r){e.prototype.formatAt.call(this,0,this.length(),t,r)};t.prototype.formatAt=function(t,r,n,i){if(t===0&&r===this.length()){this.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.formats=function(){return this.statics.formats(this.domNode)};return t}(i.default);t.default=o},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(19);var o=r(1);var a=function(e){n(t,e);function t(t){var r=e.call(this,t)||this;r.text=r.statics.value(r.domNode);return r}t.create=function(e){return document.createTextNode(e)};t.value=function(e){var t=e.data;if(t["normalize"])t=t["normalize"]();return t};t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)};t.prototype.index=function(e,t){if(this.domNode===e){return t}return-1};t.prototype.insertAt=function(t,r,n){if(n==null){this.text=this.text.slice(0,t)+r+this.text.slice(t);this.domNode.data=this.text}else{e.prototype.insertAt.call(this,t,r,n)}};t.prototype.length=function(){return this.text.length};t.prototype.optimize=function(r){e.prototype.optimize.call(this,r);this.text=this.statics.value(this.domNode);if(this.text.length===0){this.remove()}else if(this.next instanceof t&&this.next.prev===this){this.insertAt(this.length(),this.next.value());this.next.remove()}};t.prototype.position=function(e,t){if(t===void 0){t=false}return[this.domNode,e]};t.prototype.split=function(e,t){if(t===void 0){t=false}if(!t){if(e===0)return this;if(e===this.length())return this.next}var r=o.create(this.domNode.splitText(e));this.parent.insertBefore(r,this.next);this.text=this.statics.value(this.domNode);return r};t.prototype.update=function(e,t){var r=this;if(e.some(function(e){return e.type==="characterData"&&e.target===r.domNode})){this.text=this.statics.value(this.domNode)}};t.prototype.value=function(){return this.text};t.blotName="text";t.scope=o.Scope.INLINE_BLOT;return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=document.createElement("div");n.classList.toggle("test-class",false);if(n.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){if(arguments.length>1&&!this.contains(e)===!t){return t}else{return i.call(this,e)}}}if(!String.prototype.startsWith){String.prototype.startsWith=function(e,t){t=t||0;return this.substr(t,e.length)===e}}if(!String.prototype.endsWith){String.prototype.endsWith=function(e,t){var r=this.toString();if(typeof t!=="number"||!isFinite(t)||Math.floor(t)!==t||t>r.length){t=r.length}t-=e.length;var n=r.indexOf(e,t);return n!==-1&&n===t}}if(!Array.prototype.find){Object.defineProperty(Array.prototype,"find",{value:function e(t){if(this===null){throw new TypeError("Array.prototype.find called on null or undefined")}if(typeof t!=="function"){throw new TypeError("predicate must be a function")}var r=Object(this);var n=r.length>>>0;var i=arguments[1];var e;for(var o=0;ot.length?e:t;var s=e.length>t.length?t:e;var f=u.indexOf(s);if(f!=-1){a=[[n,u.substring(0,f)],[i,s],[n,u.substring(f+s.length)]];if(e.length>t.length){a[0][0]=a[2][0]=r}return a}if(s.length==1){return[[r,e],[n,t]]}var d=c(e,t);if(d){var p=d[0];var h=d[1];var v=d[2];var y=d[3];var b=d[4];var g=o(p,v);var m=o(h,y);return g.concat([[i,b]],m)}return l(e,t)}function l(e,t){var i=e.length;var o=t.length;var a=Math.ceil((i+o)/2);var l=a;var s=2*a;var f=new Array(s);var c=new Array(s);for(var d=0;di){y+=2}else if(w>o){v+=2}else if(h){var k=l+p-_;if(k>=0&&k=E){return u(e,t,x,w)}}}}for(var j=-m+b;j<=m-g;j+=2){var k=l+j;var E;if(j==-m||j!=m&&c[k-1]i){g+=2}else if(A>o){b+=2}else if(!h){var O=l+p-j;if(O>=0&&O=E){return u(e,t,x,w)}}}}}return[[r,e],[n,t]]}function u(e,t,r,n){var i=e.substring(0,r);var a=t.substring(0,n);var l=e.substring(r);var u=t.substring(n);var s=o(i,a);var f=o(l,u);return s.concat(f)}function s(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0)){return 0}var r=0;var n=Math.min(e.length,t.length);var i=n;var o=0;while(rt.length?e:t;var n=e.length>t.length?t:e;if(r.length<4||n.length*2=e.length){return[a,l,u,c,o]}else{return null}}var o=i(r,n,Math.ceil(r.length/4));var a=i(r,n,Math.ceil(r.length/2));var l;if(!o&&!a){return null}else if(!a){l=o}else if(!o){l=a}else{l=o[4].length>a[4].length?o:a}var u,c,d,p;if(e.length>t.length){u=l[0];c=l[1];d=l[2];p=l[3]}else{d=l[0];p=l[1];u=l[2];c=l[3]}var h=l[4];return[u,c,d,p,h]}function d(e){e.push([i,""]);var t=0;var o=0;var a=0;var l="";var u="";var c;while(t1){if(o!==0&&a!==0){c=s(u,l);if(c!==0){if(t-o-a>0&&e[t-o-a-1][0]==i){e[t-o-a-1][1]+=u.substring(0,c)}else{e.splice(0,0,[i,u.substring(0,c)]);t++}u=u.substring(c);l=l.substring(c)}c=f(u,l);if(c!==0){e[t][1]=u.substring(u.length-c)+e[t][1];u=u.substring(0,u.length-c);l=l.substring(0,l.length-c)}}if(o===0){e.splice(t-a,o+a,[n,u])}else if(a===0){e.splice(t-o,o+a,[r,l])}else{e.splice(t-o-a,o+a,[r,l],[n,u])}t=t-o-a+(o?1:0)+(a?1:0)+1}else if(t!==0&&e[t-1][0]==i){e[t-1][1]+=e[t][1];e.splice(t,1)}else{t++}a=0;o=0;l="";u="";break}}if(e[e.length-1][1]===""){e.pop()}var p=false;t=1;while(t0){n.splice(o+2,0,[l[0],u])}return b(n,o,3)}else{return e}}}function y(e){var t=false;var o=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343};var a=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319};for(var l=2;l0){u.push(e[l])}}return u}function b(e,t,r){for(var n=t+r-1;n>=0&&n>=t-1;n--){if(n+1\r?\n +\<");return this.convert()}var r=this.quill.getFormat(this.quill.selection.savedRange.index);if(r[O.default.blotName]){var n=this.container.innerText;this.container.innerHTML="";return(new s.default).insert(n,A({},O.default.blotName,r[O.default.blotName]))}var o=this.prepareMatching(),a=i(o,2),l=a[0],u=a[1];var f=F(this.container,l,u);if(D(f,"\n")&&f.ops[f.ops.length-1].attributes==null){f=f.compose((new s.default).retain(f.length()-1).delete(1))}S.log("convert",this.container.innerHTML,f);this.container.innerHTML="";return f}},{key:"dangerouslyPasteHTML",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:p.default.sources.API;if(typeof t==="string"){this.quill.setContents(this.convert(t),r);this.quill.setSelection(0,p.default.sources.SILENT)}else{var i=this.convert(r);this.quill.updateContents((new s.default).retain(t).concat(i),n);this.quill.setSelection(t+i.length(),p.default.sources.SILENT)}}},{key:"onPaste",value:function e(t){var r=this;if(t.defaultPrevented||!this.quill.isEnabled())return;var n=this.quill.getSelection();var i=(new s.default).retain(n.index);var o=this.quill.scrollingContainer.scrollTop;this.container.focus();this.quill.selection.update(p.default.sources.SILENT);setTimeout(function(){i=i.concat(r.convert()).delete(n.length);r.quill.updateContents(i,p.default.sources.USER);r.quill.setSelection(i.length()-n.length,p.default.sources.SILENT);r.quill.scrollingContainer.scrollTop=o;r.quill.focus()},1)}},{key:"prepareMatching",value:function e(){var t=this;var r=[],n=[];this.matchers.forEach(function(e){var o=i(e,2),a=o[0],l=o[1];switch(a){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:[].forEach.call(t.container.querySelectorAll(a),function(e){e[P]=e[P]||[];e[P].push(l)});break}});return[r,n]}}]);return t}(b.default);R.DEFAULTS={matchers:[],matchVisual:true};function I(e,t,r){if((typeof t==="undefined"?"undefined":n(t))==="object"){return Object.keys(t).reduce(function(e,r){return I(e,r,t[r])},e)}else{return e.reduce(function(e,n){if(n.attributes&&n.attributes[t]){return e.push(n)}else{return e.insert(n.insert,(0,l.default)({},A({},t,r),n.attributes))}},new s.default)}}function B(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function D(e,t){var r="";for(var n=e.ops.length-1;n>=0&&r.length-1}function F(e,t,r){if(e.nodeType===e.TEXT_NODE){return r.reduce(function(t,r){return r(e,t)},new s.default)}else if(e.nodeType===e.ELEMENT_NODE){return[].reduce.call(e.childNodes||[],function(n,i){var o=F(i,t,r);if(i.nodeType===e.ELEMENT_NODE){o=t.reduce(function(e,t){return t(i,e)},o);o=(i[P]||[]).reduce(function(e,t){return t(i,e)},o)}return n.concat(o)},new s.default)}else{return new s.default}}function z(e,t,r){return I(r,e,true)}function H(e,t){var r=c.default.Attributor.Attribute.keys(e);var n=c.default.Attributor.Class.keys(e);var i=c.default.Attributor.Style.keys(e);var o={};r.concat(n).concat(i).forEach(function(t){var r=c.default.query(t,c.default.Scope.ATTRIBUTE);if(r!=null){o[r.attrName]=r.value(e);if(o[r.attrName])return}r=L[t];if(r!=null&&(r.attrName===t||r.keyName===t)){o[r.attrName]=r.value(e)||undefined}r=M[t];if(r!=null&&(r.attrName===t||r.keyName===t)){r=M[t];o[r.attrName]=r.value(e)||undefined}});if(Object.keys(o).length>0){t=I(t,o)}return t}function K(e,t){var r=c.default.query(e);if(r==null)return t;if(r.prototype instanceof c.default.Embed){var n={};var i=r.value(e);if(i!=null){n[r.blotName]=i;t=(new s.default).insert(n,r.formats(e))}}else if(typeof r.formats==="function"){t=I(t,r.blotName,r.formats(e))}return t}function V(e,t){if(!D(t,"\n")){t.insert("\n")}return t}function W(){return new s.default}function Z(e,t){var r=c.default.query(e);if(r==null||r.blotName!=="list-item"||!D(t,"\n")){return t}var n=-1,i=e.parentNode;while(!i.classList.contains("ql-clipboard")){if((c.default.query(i)||{}).blotName==="list"){n+=1}i=i.parentNode}if(n<=0)return t;return t.compose((new s.default).retain(t.length()-1).retain(1,{indent:n}))}function G(e,t){if(!D(t,"\n")){if(U(e)||t.length()>0&&e.nextSibling&&U(e.nextSibling)){t.insert("\n")}}return t}function Y(e,t){if(U(e)&&e.nextElementSibling!=null&&!D(t,"\n\n")){var r=e.offsetHeight+parseFloat(B(e).marginTop)+parseFloat(B(e).marginBottom);if(e.nextElementSibling.offsetTop>e.offsetTop+r*1.5){t.insert("\n")}}return t}function $(e,t){var r={};var n=e.style||{};if(n.fontStyle&&B(e).fontStyle==="italic"){r.italic=true}if(n.fontWeight&&(B(e).fontWeight.startsWith("bold")||parseInt(B(e).fontWeight)>=700)){r.bold=true}if(Object.keys(r).length>0){t=I(t,r)}if(parseFloat(n.textIndent||0)>0){t=(new s.default).insert("\t").concat(t)}return t}function X(e,t){var r=e.data;if(e.parentNode.tagName==="O:P"){return t.insert(r.trim())}if(r.trim().length===0&&e.parentNode.classList.contains("ql-clipboard")){return t}if(!B(e.parentNode).whiteSpace.startsWith("pre")){var n=function e(t,r){r=r.replace(/[^\u00a0]/g,"");return r.length<1&&t?" ":r};r=r.replace(/\r\n/g," ").replace(/\n/g," ");r=r.replace(/\s\s+/g,n.bind(n,true));if(e.previousSibling==null&&U(e.parentNode)||e.previousSibling!=null&&U(e.previousSibling)){r=r.replace(/^\s+/,n.bind(n,false))}if(e.nextSibling==null&&U(e.parentNode)||e.nextSibling!=null&&U(e.nextSibling)){r=r.replace(/\s+$/,n.bind(n,false))}}return t.insert(r)}t.default=R;t.matchAttributor=H;t.matchBlot=K;t.matchNewline=G;t.matchSpacing=Y;t.matchText=X},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r '},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;rt.left?-10:10;var i=t.bottom+this.quill.root.scrollTop;this.root.style.left=r+n+"px";this.root.style.top=i+"px";this.root.classList.remove("ql-flip");var o=this.boundsContainer.getBoundingClientRect();var a=this.root.getBoundingClientRect();var l=0;if(a.right>o.right){l=o.right-a.right;this.root.style.left=r+l+"px"}if(a.lefto.bottom){var u=a.bottom-a.top;var s=t.bottom-t.top+u;this.root.style.top=i-s+"px";this.root.classList.add("ql-flip")}return l}},{key:"show",value:function e(){this.root.classList.remove("ql-editing");this.root.classList.remove("ql-hidden")}}]);return e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var o=function(){function e(e,t){for(var r=0;r','','',''].join("");t.default=x},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(29);var i=re(n);var o=r(36);var a=r(38);var l=r(64);var u=r(65);var s=re(u);var f=r(66);var c=re(f);var d=r(67);var p=re(d);var h=r(37);var v=r(26);var y=r(39);var b=r(40);var g=r(56);var m=re(g);var _=r(68);var O=re(_);var x=r(27);var w=re(x);var k=r(69);var E=re(k);var j=r(70);var A=re(j);var N=r(71);var q=re(N);var T=r(72);var S=re(T);var P=r(73);var C=re(P);var L=r(13);var M=re(L);var R=r(74);var I=re(R);var B=r(75);var D=re(B);var U=r(57);var F=re(U);var z=r(41);var H=re(z);var K=r(28);var V=re(K);var W=r(59);var Z=re(W);var G=r(60);var Y=re(G);var $=r(61);var X=re($);var Q=r(108);var J=re(Q);var ee=r(62);var te=re(ee);function re(e){return e&&e.__esModule?e:{default:e}}i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":b.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":b.SizeStyle},true);i.default.register({"formats/align":o.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":l.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":y.FontClass,"formats/size":b.SizeClass,"formats/blockquote":s.default,"formats/code-block":M.default,"formats/header":c.default,"formats/list":p.default,"formats/bold":m.default,"formats/code":L.Code,"formats/italic":O.default,"formats/link":w.default,"formats/script":E.default,"formats/strike":A.default,"formats/underline":q.default,"formats/image":S.default,"formats/video":C.default,"formats/list/item":d.ListItem,"modules/formula":I.default,"modules/syntax":D.default,"modules/toolbar":F.default,"themes/bubble":J.default,"themes/snow":te.default,"ui/icons":H.default,"ui/picker":V.default,"ui/icon-picker":Y.default,"ui/color-picker":Z.default,"ui/tooltip":X.default},true);t.default=i.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.IndentClass=undefined;var n=function(){function e(e,t){for(var r=0;r0){this.children.tail.format(t,r)}}},{key:"formats",value:function e(){return d({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function e(r,n){if(r instanceof y){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,r,n)}else{var o=n==null?this.length():n.offset(this);var a=this.split(o);a.parent.insertBefore(r,a)}}},{key:"optimize",value:function e(r){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r);var n=this.next;if(n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")){n.moveChildren(this);n.remove()}}},{key:"replace",value:function e(r){if(r.statics.blotName!==this.statics.blotName){var n=a.default.create(this.statics.defaultChild);r.moveChildren(n);this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,r)}}]);return t}(f.default);b.blotName="list";b.scope=a.default.Scope.BLOCK_BLOT;b.tagName=["OL","UL"];b.defaultChild="list-item";b.allowedChildren=[y];t.ListItem=y;t.default=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(56);var i=o(n);function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function l(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function u(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var s=function(e){u(t,e);function t(){a(this,t);return l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(i.default);s.blotName="italic";s.tagName=["EM","I"];t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r-1){if(n){this.domNode.setAttribute(r,n)}else{this.domNode.removeAttribute(r)}}else{i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,r,n)}}}],[{key:"create",value:function e(r){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);if(typeof r==="string"){n.setAttribute("src",this.sanitize(r))}return n}},{key:"formats",value:function e(t){return d.reduce(function(e,r){if(t.hasAttribute(r)){e[r]=t.getAttribute(r)}return e},{})}},{key:"match",value:function e(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function e(t){return(0,l.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function e(t){return t.getAttribute("src")}}]);return t}(a.default.Embed);p.blotName="image";p.tagName="IMG";t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r-1){if(n){this.domNode.setAttribute(r,n)}else{this.domNode.removeAttribute(r)}}else{i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,r,n)}}}],[{key:"create",value:function e(r){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);n.setAttribute("frameborder","0");n.setAttribute("allowfullscreen",true);n.setAttribute("src",this.sanitize(r));return n}},{key:"formats",value:function e(t){return d.reduce(function(e,r){if(t.hasAttribute(r)){e[r]=t.getAttribute(r)}return e},{})}},{key:"sanitize",value:function e(t){return l.default.sanitize(t)}},{key:"value",value:function e(t){return t.getAttribute("src")}}]);return t}(o.BlockEmbed);p.blotName="video";p.className="ql-video";p.tagName="IFRAME";t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.FormulaBlot=undefined;var n=function(){function e(e,t){for(var r=0;r0||this.cachedText==null){this.domNode.innerHTML=t(r);this.domNode.normalize();this.attach()}this.cachedText=r}}}]);return t}(d.default);b.className="ql-syntax";var g=new a.default.Attributor.Class("token","hljs",{scope:a.default.Scope.INLINE});var m=function(e){y(t,e);n(t,null,[{key:"register",value:function e(){u.default.register(g,true);u.default.register(b,true)}}]);function t(e,r){h(this,t);var n=v(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));if(typeof n.options.highlight!=="function"){throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.")}var i=null;n.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i);i=setTimeout(function(){n.highlight();i=null},n.options.interval)});n.highlight();return n}n(t,[{key:"highlight",value:function e(){var t=this;if(this.quill.selection.composing)return;this.quill.update(u.default.sources.USER);var r=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)});this.quill.update(u.default.sources.SILENT);if(r!=null){this.quill.setSelection(r,u.default.sources.SILENT)}}}]);return t}(f.default);m.DEFAULTS={highlight:function(){if(window.hljs==null)return null;return function(e){var t=window.hljs.highlightAuto(e);return t.value}}(),interval:1e3};t.CodeBlock=b;t.CodeToken=g;t.default=m},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.BubbleTooltip=undefined;var n=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var i=function(){function e(e,t){for(var r=0;r0&&i===u.default.sources.USER){n.show();n.root.style.left="0px";n.root.style.width="";n.root.style.width=n.root.offsetWidth+"px";var o=n.quill.getLines(t.index,t.length);if(o.length===1){n.position(n.quill.getBounds(t))}else{var a=o[o.length-1];var l=n.quill.getIndex(a);var s=Math.min(a.length()-1,t.index+t.length-l);var f=n.quill.getBounds(new c.Range(l,s));n.position(f)}}else if(document.activeElement!==n.textbox&&n.quill.hasFocus()){n.hide()}});return n}i(t,[{key:"listen",value:function e(){var r=this;n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this);this.root.querySelector(".ql-close").addEventListener("click",function(){r.root.classList.remove("ql-editing")});this.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(r.root.classList.contains("ql-hidden"))return;var e=r.quill.getSelection();if(e!=null){r.position(r.quill.getBounds(e))}},1)})}},{key:"cancel",value:function e(){this.show()}},{key:"position",value:function e(r){var i=n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,r);var o=this.root.querySelector(".ql-tooltip-arrow");o.style.marginLeft="";if(i===0)return i;o.style.marginLeft=-1*i-o.offsetWidth/2+"px"}}]);return t}(s.BaseTooltip);_.TEMPLATE=['','
','','',"
"].join("");t.BubbleTooltip=_;t.default=m},function(e,t,r){e.exports=r(63)}])["default"]}); +(function e(t,r){if(typeof exports==="object"&&typeof module==="object")module.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof exports==="object")exports["Quill"]=r();else t["Quill"]=r()})(typeof self!=="undefined"?self:this,function(){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:n})}};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=109)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(17);var i=r(18);var o=r(19);var a=r(45);var l=r(46);var u=r(47);var s=r(48);var f=r(49);var c=r(12);var d=r(32);var p=r(33);var h=r(31);var v=r(1);var y={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:n.default,Format:i.default,Leaf:o.default,Embed:s.default,Scroll:a.default,Block:u.default,Inline:l.default,Text:f.default,Attributor:{Attribute:c.default,Class:d.default,Style:p.default,Store:h.default}};t.default=y},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=function(e){n(t,e);function t(t){var r=this;t="[Parchment] "+t;r=e.call(this,t)||this;r.message=t;r.name=r.constructor.name;return r}return t}(Error);t.ParchmentError=i;var o={};var a={};var l={};var u={};t.DATA_KEY="__blot";var s;(function(e){e[e["TYPE"]=3]="TYPE";e[e["LEVEL"]=12]="LEVEL";e[e["ATTRIBUTE"]=13]="ATTRIBUTE";e[e["BLOT"]=14]="BLOT";e[e["INLINE"]=7]="INLINE";e[e["BLOCK"]=11]="BLOCK";e[e["BLOCK_BLOT"]=10]="BLOCK_BLOT";e[e["INLINE_BLOT"]=6]="INLINE_BLOT";e[e["BLOCK_ATTRIBUTE"]=9]="BLOCK_ATTRIBUTE";e[e["INLINE_ATTRIBUTE"]=5]="INLINE_ATTRIBUTE";e[e["ANY"]=15]="ANY"})(s=t.Scope||(t.Scope={}));function f(e,t){var r=d(e);if(r==null){throw new i("Unable to create "+e+" blot")}var n=r;var o=e instanceof Node||e["nodeType"]===Node.TEXT_NODE?e:n.create(t);return new n(o,t)}t.create=f;function c(e,r){if(r===void 0){r=false}if(e==null)return null;if(e[t.DATA_KEY]!=null)return e[t.DATA_KEY].blot;if(r)return c(e.parentNode,r);return null}t.find=c;function d(e,t){if(t===void 0){t=s.ANY}var r;if(typeof e==="string"){r=u[e]||o[e]}else if(e instanceof Text||e["nodeType"]===Node.TEXT_NODE){r=u["text"]}else if(typeof e==="number"){if(e&s.LEVEL&s.BLOCK){r=u["block"]}else if(e&s.LEVEL&s.INLINE){r=u["inline"]}}else if(e instanceof HTMLElement){var n=(e.getAttribute("class")||"").split(/\s+/);for(var i in n){r=a[n[i]];if(r)break}r=r||l[e.tagName]}if(r==null)return null;if(t&s.LEVEL&r.scope&&t&s.TYPE&r.scope)return r;return null}t.query=d;function p(){var e=[];for(var t=0;t1){return e.map(function(e){return p(e)})}var r=e[0];if(typeof r.blotName!=="string"&&typeof r.attrName!=="string"){throw new i("Invalid definition")}else if(r.blotName==="abstract"){throw new i("Cannot register abstract class")}u[r.blotName||r.attrName]=r;if(typeof r.keyName==="string"){o[r.keyName]=r}else{if(r.className!=null){a[r.className]=r}if(r.tagName!=null){if(Array.isArray(r.tagName)){r.tagName=r.tagName.map(function(e){return e.toUpperCase()})}else{r.tagName=r.tagName.toUpperCase()}var n=Array.isArray(r.tagName)?r.tagName:[r.tagName];n.forEach(function(e){if(l[e]==null||r.className==null){l[e]=r}})}}return r}t.register=p},function(e,t,r){var n=r(51);var i=r(11);var o=r(3);var a=r(20);var l=String.fromCharCode(0);var u=function(e){if(Array.isArray(e)){this.ops=e}else if(e!=null&&Array.isArray(e.ops)){this.ops=e.ops}else{this.ops=[]}};u.prototype.insert=function(e,t){var r={};if(e.length===0)return this;r.insert=e;if(t!=null&&typeof t==="object"&&Object.keys(t).length>0){r.attributes=t}return this.push(r)};u.prototype["delete"]=function(e){if(e<=0)return this;return this.push({delete:e})};u.prototype.retain=function(e,t){if(e<=0)return this;var r={retain:e};if(t!=null&&typeof t==="object"&&Object.keys(t).length>0){r.attributes=t}return this.push(r)};u.prototype.push=function(e){var t=this.ops.length;var r=this.ops[t-1];e=o(true,{},e);if(typeof r==="object"){if(typeof e["delete"]==="number"&&typeof r["delete"]==="number"){this.ops[t-1]={delete:r["delete"]+e["delete"]};return this}if(typeof r["delete"]==="number"&&e.insert!=null){t-=1;r=this.ops[t-1];if(typeof r!=="object"){this.ops.unshift(e);return this}}if(i(e.attributes,r.attributes)){if(typeof e.insert==="string"&&typeof r.insert==="string"){this.ops[t-1]={insert:r.insert+e.insert};if(typeof e.attributes==="object")this.ops[t-1].attributes=e.attributes;return this}else if(typeof e.retain==="number"&&typeof r.retain==="number"){this.ops[t-1]={retain:r.retain+e.retain};if(typeof e.attributes==="object")this.ops[t-1].attributes=e.attributes;return this}}}if(t===this.ops.length){this.ops.push(e)}else{this.ops.splice(t,0,e)}return this};u.prototype.chop=function(){var e=this.ops[this.ops.length-1];if(e&&e.retain&&!e.attributes){this.ops.pop()}return this};u.prototype.filter=function(e){return this.ops.filter(e)};u.prototype.forEach=function(e){this.ops.forEach(e)};u.prototype.map=function(e){return this.ops.map(e)};u.prototype.partition=function(e){var t=[],r=[];this.forEach(function(n){var i=e(n)?t:r;i.push(n)});return[t,r]};u.prototype.reduce=function(e,t){return this.ops.reduce(e,t)};u.prototype.changeLength=function(){return this.reduce(function(e,t){if(t.insert){return e+a.length(t)}else if(t.delete){return e-t.delete}return e},0)};u.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)};u.prototype.slice=function(e,t){e=e||0;if(typeof t!=="number")t=Infinity;var r=[];var n=a.iterator(this.ops);var i=0;while(i0){r.next(o.retain-l)}}var s=new u(n);while(t.hasNext()||r.hasNext()){if(r.peekType()==="insert"){s.push(r.next())}else if(t.peekType()==="delete"){s.push(t.next())}else{var f=Math.min(t.peekLength(),r.peekLength());var c=t.next(f);var d=r.next(f);if(typeof d.retain==="number"){var p={};if(typeof c.retain==="number"){p.retain=f}else{p.insert=c.insert}var h=a.attributes.compose(c.attributes,d.attributes,typeof c.retain==="number");if(h)p.attributes=h;s.push(p);if(!r.hasNext()&&i(s.ops[s.ops.length-1],p)){var v=new u(t.rest());return s.concat(v).chop()}}else if(typeof d["delete"]==="number"&&typeof c.retain==="number"){s.push(d)}}}return s.chop()};u.prototype.concat=function(e){var t=new u(this.ops.slice());if(e.ops.length>0){t.push(e.ops[0]);t.ops=t.ops.concat(e.ops.slice(1))}return t};u.prototype.diff=function(e,t){if(this.ops===e.ops){return new u}var r=[this,e].map(function(t){return t.map(function(r){if(r.insert!=null){return typeof r.insert==="string"?r.insert:l}var n=t===e?"on":"with";throw new Error("diff() called "+n+" non-document")}).join("")});var o=new u;var s=n(r[0],r[1],t);var f=a.iterator(this.ops);var c=a.iterator(e.ops);s.forEach(function(e){var t=e[1].length;while(t>0){var r=0;switch(e[0]){case n.INSERT:r=Math.min(c.peekLength(),t);o.push(c.next(r));break;case n.DELETE:r=Math.min(t,f.peekLength());f.next(r);o["delete"](r);break;case n.EQUAL:r=Math.min(f.peekLength(),c.peekLength(),t);var l=f.next(r);var u=c.next(r);if(i(l.insert,u.insert)){o.retain(r,a.attributes.diff(l.attributes,u.attributes))}else{o.push(u)["delete"](r)}break}t-=r}});return o.chop()};u.prototype.eachLine=function(e,t){t=t||"\n";var r=a.iterator(this.ops);var n=new u;var i=0;while(r.hasNext()){if(r.peekType()!=="insert")return;var o=r.peek();var l=a.length(o)-r.peekLength();var s=typeof o.insert==="string"?o.insert.indexOf(t,l)-l:-1;if(s<0){n.push(r.next())}else if(s>0){n.push(r.next(s))}else{if(e(n,r.next(1).attributes||{},i)===false){return}i+=1;n=new u}}if(n.length()>0){e(n,{},i)}};u.prototype.transform=function(e,t){t=!!t;if(typeof e==="number"){return this.transformPosition(e,t)}var r=a.iterator(this.ops);var n=a.iterator(e.ops);var i=new u;while(r.hasNext()||n.hasNext()){if(r.peekType()==="insert"&&(t||n.peekType()!=="insert")){i.retain(a.length(r.next()))}else if(n.peekType()==="insert"){i.push(n.next())}else{var o=Math.min(r.peekLength(),n.peekLength());var l=r.next(o);var s=n.next(o);if(l["delete"]){continue}else if(s["delete"]){i.push(s)}else{i.retain(o,a.attributes.transform(l.attributes,s.attributes,t))}}}return i.chop()};u.prototype.transformPosition=function(e,t){t=!!t;var r=a.iterator(this.ops);var n=0;while(r.hasNext()&&n<=e){var i=r.peekLength();var o=r.peekType();r.next();if(o==="delete"){e-=Math.min(i,e-n);continue}else if(o==="insert"&&(n0){if(r1&&arguments[1]!==undefined?arguments[1]:false;if(n&&(r===0||r>=this.length()-O)){var o=this.clone();if(r===0){this.parent.insertBefore(o,this);return this}else{this.parent.insertBefore(o,this.next);return o}}else{var a=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,r,n);this.cache={};return a}}}]);return t}(f.default.Block);w.blotName="block";w.tagName="P";w.defaultChild="break";w.allowedChildren=[h.default,f.default.Embed,y.default];function k(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(e==null)return t;if(typeof e.formats==="function"){t=(0,a.default)(t,e.formats())}if(e.parent==null||e.parent.blotName=="scroll"||e.parent.statics.scope!==e.statics.scope){return t}return k(e.parent,t)}t.bubbleFormats=k;t.BlockEmbed=x;t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.overload=t.expandConfig=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:false;if(typeof t!=="string"){var o=t.attrName||t.blotName;if(typeof o==="string"){this.register("formats/"+o,t,r)}else{Object.keys(t).forEach(function(e){n.register(e,t[e],r)})}}else{if(this.imports[t]!=null&&!i){A.warn("Overwriting "+t+" with",r)}this.imports[t]=r;if((t.startsWith("blots/")||t.startsWith("formats/"))&&r.blotName!=="abstract"){v.default.register(r)}else if(t.startsWith("modules")&&typeof r.register==="function"){r.register()}}}}]);function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};j(this,e);this.options=q(t,n);this.container=this.options.container;if(this.container==null){return A.error("Invalid Quill container",t)}if(this.options.debug){e.debug(this.options.debug)}var i=this.container.innerHTML.trim();this.container.classList.add("ql-container");this.container.innerHTML="";this.container.__quill=this;this.root=this.addContainer("ql-editor");this.root.classList.add("ql-blank");this.root.setAttribute("data-gramm",false);this.scrollingContainer=this.options.scrollingContainer||this.root;this.emitter=new c.default;this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats});this.editor=new s.default(this.scroll);this.selection=new b.default(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.theme.init();this.emitter.on(c.default.events.EDITOR_CHANGE,function(e){if(e===c.default.events.TEXT_CHANGE){r.root.classList.toggle("ql-blank",r.editor.isBlank())}});this.emitter.on(c.default.events.SCROLL_UPDATE,function(e,t){var n=r.selection.lastRange;var i=n&&n.length===0?n.index:undefined;T.call(r,function(){return r.editor.update(null,t,i)},e)});var o=this.clipboard.convert("
"+i+"


");this.setContents(o);this.history.clear();if(this.options.placeholder){this.root.setAttribute("data-placeholder",this.options.placeholder)}if(this.options.readOnly){this.disable()}}o(e,[{key:"addContainer",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(typeof t==="string"){var n=t;t=document.createElement("div");t.classList.add(n)}this.container.insertBefore(t,r);return t}},{key:"blur",value:function e(){this.selection.setRange(null)}},{key:"deleteText",value:function e(t,r,n){var o=this;var a=S(t,r,n);var l=i(a,4);t=l[0];r=l[1];n=l[3];return T.call(this,function(){return o.editor.deleteText(t,r)},n,t,-1*r)}},{key:"disable",value:function e(){this.enable(false)}},{key:"enable",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.scroll.enable(t);this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function e(){var t=this.scrollingContainer.scrollTop;this.selection.focus();this.scrollingContainer.scrollTop=t;this.scrollIntoView()}},{key:"format",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:c.default.sources.API;return T.call(this,function(){var e=n.getSelection(true);var i=new l.default;if(e==null){return i}else if(v.default.query(t,v.default.Scope.BLOCK)){i=n.editor.formatLine(e.index,e.length,E({},t,r))}else if(e.length===0){n.selection.format(t,r);return i}else{i=n.editor.formatText(e.index,e.length,E({},t,r))}n.setSelection(e,c.default.sources.SILENT);return i},i)}},{key:"formatLine",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,r,n,o,a);var f=i(s,4);t=f[0];r=f[1];u=f[2];a=f[3];return T.call(this,function(){return l.editor.formatLine(t,r,u)},a,t,0)}},{key:"formatText",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,r,n,o,a);var f=i(s,4);t=f[0];r=f[1];u=f[2];a=f[3];return T.call(this,function(){return l.editor.formatText(t,r,u)},a,t,0)}},{key:"getBounds",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=void 0;if(typeof t==="number"){n=this.selection.getBounds(t,r)}else{n=this.selection.getBounds(t.index,t.length)}var i=this.container.getBoundingClientRect();return{bottom:n.bottom-i.top,height:n.height,left:n.left-i.left,right:n.right-i.left,top:n.top-i.top,width:n.width}}},{key:"getContents",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;var n=S(t,r);var o=i(n,2);t=o[0];r=o[1];return this.editor.getContents(t,r)}},{key:"getFormat",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getSelection(true);var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(typeof t==="number"){return this.editor.getFormat(t,r)}else{return this.editor.getFormat(t.index,t.length)}}},{key:"getIndex",value:function e(t){return t.offset(this.scroll)}},{key:"getLength",value:function e(){return this.scroll.length()}},{key:"getLeaf",value:function e(t){return this.scroll.leaf(t)}},{key:"getLine",value:function e(t){return this.scroll.line(t)}},{key:"getLines",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;if(typeof t!=="number"){return this.scroll.lines(t.index,t.length)}else{return this.scroll.lines(t,r)}}},{key:"getModule",value:function e(t){return this.theme.modules[t]}},{key:"getSelection",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t)this.focus();this.update();return this.selection.getRange()[0]}},{key:"getText",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;var n=S(t,r);var o=i(n,2);t=o[0];r=o[1];return this.editor.getText(t,r)}},{key:"hasFocus",value:function e(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function t(r,n,i){var o=this;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:e.sources.API;return T.call(this,function(){return o.editor.insertEmbed(r,n,i)},a,r)}},{key:"insertText",value:function e(t,r,n,o,a){var l=this;var u=void 0;var s=S(t,0,n,o,a);var f=i(s,4);t=f[0];u=f[2];a=f[3];return T.call(this,function(){return l.editor.insertText(t,r,u)},a,t,r.length)}},{key:"isEnabled",value:function e(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function e(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function e(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function e(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function e(t,r,n){this.clipboard.dangerouslyPasteHTML(t,r,n)}},{key:"removeFormat",value:function e(t,r,n){var o=this;var a=S(t,r,n);var l=i(a,4);t=l[0];r=l[1];n=l[3];return T.call(this,function(){return o.editor.removeFormat(t,r)},n,t)}},{key:"scrollIntoView",value:function e(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;return T.call(this,function(){t=new l.default(t);var e=r.getLength();var n=r.editor.deleteText(0,e);var i=r.editor.applyDelta(t);var o=i.ops[i.ops.length-1];if(o!=null&&typeof o.insert==="string"&&o.insert[o.insert.length-1]==="\n"){r.editor.deleteText(r.getLength()-1,1);i.delete(1)}var a=n.compose(i);return a},n)}},{key:"setSelection",value:function t(r,n,o){if(r==null){this.selection.setRange(null,n||e.sources.API)}else{var a=S(r,n,o);var l=i(a,4);r=l[0];n=l[1];o=l[3];this.selection.setRange(new y.Range(r,n),o);if(o!==c.default.sources.SILENT){this.selection.scrollIntoView(this.scrollingContainer)}}}},{key:"setText",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;var n=(new l.default).insert(t);return this.setContents(n,r)}},{key:"update",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c.default.sources.USER;var r=this.scroll.update(t);this.selection.update(t);return r}},{key:"updateContents",value:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c.default.sources.API;return T.call(this,function(){t=new l.default(t);return r.editor.applyDelta(t,n)},n,true)}}]);return e}();N.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:false,scrollingContainer:null,strict:true,theme:"default"};N.events=c.default.events;N.sources=c.default.sources;N.version=false?"dev":"1.3.7";N.imports={delta:l.default,parchment:v.default,"core/module":p.default,"core/theme":w.default};function q(e,t){t=(0,m.default)(true,{container:e,modules:{clipboard:true,keyboard:true,history:true}},t);if(!t.theme||t.theme===N.DEFAULTS.theme){t.theme=w.default}else{t.theme=N.import("themes/"+t.theme);if(t.theme==null){throw new Error("Invalid theme "+t.theme+". Did you register it?")}}var r=(0,m.default)(true,{},t.theme.DEFAULTS);[r,t].forEach(function(e){e.modules=e.modules||{};Object.keys(e.modules).forEach(function(t){if(e.modules[t]===true){e.modules[t]={}}})});var n=Object.keys(r.modules).concat(Object.keys(t.modules));var i=n.reduce(function(e,t){var r=N.import("modules/"+t);if(r==null){A.error("Cannot load "+t+" module. Are you sure you registered it?")}else{e[t]=r.DEFAULTS||{}}return e},{});if(t.modules!=null&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object){t.modules.toolbar={container:t.modules.toolbar}}t=(0,m.default)(true,{},N.DEFAULTS,{modules:i},r,t);["bounds","container","scrollingContainer"].forEach(function(e){if(typeof t[e]==="string"){t[e]=document.querySelector(t[e])}});t.modules=Object.keys(t.modules).reduce(function(e,r){if(t.modules[r]){e[r]=t.modules[r]}return e},{});return t}function T(e,t,r,n){if(this.options.strict&&!this.isEnabled()&&t===c.default.sources.USER){return new l.default}var i=r==null?null:this.getSelection();var o=this.editor.delta;var a=e();if(i!=null){if(r===true)r=i.index;if(n==null){i=P(i,a,t)}else if(n!==0){i=P(i,r,n,t)}this.setSelection(i,c.default.sources.SILENT)}if(a.length()>0){var u;var s=[c.default.events.TEXT_CHANGE,a,o,t];(u=this.emitter).emit.apply(u,[c.default.events.EDITOR_CHANGE].concat(s));if(t!==c.default.sources.SILENT){var f;(f=this.emitter).emit.apply(f,s)}}return a}function S(e,t,r,i,o){var a={};if(typeof e.index==="number"&&typeof e.length==="number"){if(typeof t!=="number"){o=i,i=r,r=t,t=e.length,e=e.index}else{t=e.length,e=e.index}}else if(typeof t!=="number"){o=i,i=r,r=t,t=0}if((typeof r==="undefined"?"undefined":n(r))==="object"){a=r;o=i}else if(typeof r==="string"){if(i!=null){a[r]=i}else{o=r}}o=o||c.default.sources.API;return[e,t,a,o]}function P(e,t,r,n){if(e==null)return null;var o=void 0,a=void 0;if(t instanceof l.default){var u=[e.index,e.index+e.length].map(function(e){return t.transformPosition(e,n!==c.default.sources.USER)});var s=i(u,2);o=s[0];a=s[1]}else{var f=[e.index,e.index+e.length].map(function(e){if(e=0){return e+r}else{return Math.max(t,e+r)}});var d=i(f,2);o=d[0];a=d[1]}return new y.Range(o,a-o)}t.expandConfig=q;t.overload=S;t.default=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n);n.wrap(this)}}}],[{key:"compare",value:function e(r,n){var i=t.order.indexOf(r);var o=t.order.indexOf(n);if(i>=0||o>=0){return i-o}else if(r===n){return 0}else if(r1?r-1:0),i=1;i1&&arguments[1]!==undefined?arguments[1]:{};n(this,e);this.quill=t;this.options=r};i.DEFAULTS={};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=["error","warn","log","info"];var i="warn";function o(e){if(n.indexOf(e)<=n.indexOf(i)){var t;for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a0&&typeof e[0]!=="number")return false;return true}function s(e,t,r){var s,f;if(l(e)||l(t))return false;if(e.prototype!==t.prototype)return false;if(o(e)){if(!o(t)){return false}e=n.call(e);t=n.call(t);return a(e,t,r)}if(u(e)){if(!u(t)){return false}if(e.length!==t.length)return false;for(s=0;s=0;s--){if(c[s]!=d[s])return false}for(s=c.length-1;s>=0;s--){f=c[s];if(!a(e[f],t[f],r))return false}return typeof e===typeof t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(1);var i=function(){function e(e,t,r){if(r===void 0){r={}}this.attrName=e;this.keyName=t;var i=n.Scope.TYPE&n.Scope.ATTRIBUTE;if(r.scope!=null){this.scope=r.scope&n.Scope.LEVEL|i}else{this.scope=n.Scope.ATTRIBUTE}if(r.whitelist!=null)this.whitelist=r.whitelist}e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})};e.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;e.setAttribute(this.keyName,t);return true};e.prototype.canAdd=function(e,t){var r=n.query(e,n.Scope.BLOT&(this.scope|n.Scope.TYPE));if(r==null)return false;if(this.whitelist==null)return true;if(typeof t==="string"){return this.whitelist.indexOf(t.replace(/["']/g,""))>-1}else{return this.whitelist.indexOf(t)>-1}};e.prototype.remove=function(e){e.removeAttribute(this.keyName)};e.prototype.value=function(e){var t=e.getAttribute(this.keyName);if(this.canAdd(e,t)&&t){return t}return""};return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.Code=undefined;var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function(){function e(e,t){for(var r=0;r=r+n)return;var l=this.newlineIndex(r,true)+1;var u=a-l+1;var f=this.isolate(l,u);var c=f.next;f.format(i,o);if(c instanceof t){c.formatAt(0,r-l+n-u,i,o)}}},{key:"insertAt",value:function e(t,r,i){if(i!=null)return;var o=this.descendant(v.default,t),a=n(o,2),l=a[0],u=a[1];l.insertAt(u,r)}},{key:"length",value:function e(){var e=this.domNode.textContent.length;if(!this.domNode.textContent.endsWith("\n")){return e+1}return e}},{key:"newlineIndex",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!r){var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}else{return this.domNode.textContent.slice(0,t).lastIndexOf("\n")}}},{key:"optimize",value:function e(r){if(!this.domNode.textContent.endsWith("\n")){this.appendChild(s.default.create("text","\n"))}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r);var n=this.next;if(n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)){n.optimize(r);n.moveChildren(this);n.remove()}}},{key:"replace",value:function e(r){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,r);[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=s.default.find(e);if(t==null){e.parentNode.removeChild(e)}else if(t instanceof s.default.Embed){t.remove()}else{t.unwrap()}})}}],[{key:"create",value:function e(r){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);n.setAttribute("spellcheck",false);return n}},{key:"formats",value:function e(){return true}}]);return t}(c.default);O.blotName="code-block";O.tagName="PRE";O.TAB=" ";t.Code=_;t.default=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r=a&&!f.endsWith("\n")){o=true}r.scroll.insertAt(e,f);var d=r.scroll.line(e),p=i(d,2),h=p[0],v=p[1];var g=(0,E.default)({},(0,y.bubbleFormats)(h));if(h instanceof b.default){var m=h.descendant(c.default.Leaf,v),_=i(m,1),O=_[0];g=(0,E.default)(g,(0,y.bubbleFormats)(O))}u=s.default.attributes.diff(g,u)||{}}else if(n(t.insert)==="object"){var x=Object.keys(t.insert)[0];if(x==null)return e;r.scroll.insertAt(e,x,t.insert[x])}a+=l}Object.keys(u).forEach(function(t){r.scroll.formatAt(e,l,t,u[t])});return e+l},0);t.reduce(function(e,t){if(typeof t.delete==="number"){r.scroll.deleteAt(e,t.delete);return e}return e+(t.retain||t.insert.length||1)},0);this.scroll.batchEnd();return this.update(t)}},{key:"deleteText",value:function e(t,r){this.scroll.deleteAt(t,r);return this.update((new l.default).retain(t).delete(r))}},{key:"formatLine",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.scroll.update();Object.keys(i).forEach(function(e){if(n.scroll.whitelist!=null&&!n.scroll.whitelist[e])return;var o=n.scroll.lines(t,Math.max(r,1));var a=r;o.forEach(function(r){var o=r.length();if(!(r instanceof p.default)){r.format(e,i[e])}else{var l=t-r.offset(n.scroll);var u=r.newlineIndex(l+a)-l+1;r.formatAt(l,u,e,i[e])}a-=o})});this.scroll.optimize();return this.update((new l.default).retain(t).retain(r,(0,O.default)(i)))}},{key:"formatText",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};Object.keys(i).forEach(function(e){n.scroll.formatAt(t,r,e,i[e])});return this.update((new l.default).retain(t).retain(r,(0,O.default)(i)))}},{key:"getContents",value:function e(t,r){return this.delta.slice(t,t+r)}},{key:"getDelta",value:function e(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new l.default)}},{key:"getFormat",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=[],o=[];if(r===0){this.scroll.path(t).forEach(function(e){var t=i(e,1),r=t[0];if(r instanceof b.default){n.push(r)}else if(r instanceof c.default.Leaf){o.push(r)}})}else{n=this.scroll.lines(t,r);o=this.scroll.descendants(c.default.Leaf,t,r)}var a=[n,o].map(function(e){if(e.length===0)return{};var t=(0,y.bubbleFormats)(e.shift());while(Object.keys(t).length>0){var r=e.shift();if(r==null)return t;t=S((0,y.bubbleFormats)(r),t)}return t});return E.default.apply(E.default,a)}},{key:"getText",value:function e(t,r){return this.getContents(t,r).filter(function(e){return typeof e.insert==="string"}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function e(t,r,n){this.scroll.insertAt(t,r,n);return this.update((new l.default).retain(t).insert(A({},r,n)))}},{key:"insertText",value:function e(t,r){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};r=r.replace(/\r\n/g,"\n").replace(/\r/g,"\n");this.scroll.insertAt(t,r);Object.keys(i).forEach(function(e){n.scroll.formatAt(t,r.length,e,i[e])});return this.update((new l.default).retain(t).insert(r,(0,O.default)(i)))}},{key:"isBlank",value:function e(){if(this.scroll.children.length==0)return true;if(this.scroll.children.length>1)return false;var t=this.scroll.children.head;if(t.statics.blotName!==b.default.blotName)return false;if(t.children.length>1)return false;return t.children.head instanceof m.default}},{key:"removeFormat",value:function e(t,r){var n=this.getText(t,r);var o=this.scroll.line(t+r),a=i(o,2),u=a[0],s=a[1];var f=0,c=new l.default;if(u!=null){if(!(u instanceof p.default)){f=u.length()-s}else{f=u.newlineIndex(s)-s+1}c=u.delta().slice(s,s+f-1).insert("\n")}var d=this.getContents(t,r+f);var h=d.diff((new l.default).insert(n).concat(c));var v=(new l.default).retain(t).concat(h);return this.applyDelta(v)}},{key:"update",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;var i=this.delta;if(r.length===1&&r[0].type==="characterData"&&r[0].target.data.match(q)&&c.default.find(r[0].target)){var o=c.default.find(r[0].target);var a=(0,y.bubbleFormats)(o);var u=o.offset(this.scroll);var s=r[0].oldValue.replace(v.default.CONTENTS,"");var f=(new l.default).insert(s);var d=(new l.default).insert(o.value());var p=(new l.default).retain(u).concat(f.diff(d,n));t=p.reduce(function(e,t){if(t.insert){return e.insert(t.insert,a)}else{return e.push(t)}},new l.default);this.delta=i.compose(t)}else{this.delta=this.getDelta();if(!t||!(0,w.default)(i.compose(t),this.delta)){t=i.diff(this.delta,n)}}return t}}]);return e}();function S(e,t){return Object.keys(t).reduce(function(r,n){if(e[n]==null)return r;if(t[n]===e[n]){r[n]=t[n]}else if(Array.isArray(t[n])){if(t[n].indexOf(e[n])<0){r[n]=t[n].concat([e[n]])}}else{r[n]=[t[n],e[n]]}return r},{})}function P(e){return e.reduce(function(e,t){if(t.insert===1){var r=(0,O.default)(t.attributes);delete r["image"];return e.insert({image:t.attributes.image},r)}if(t.attributes!=null&&(t.attributes.list===true||t.attributes.bullet===true)){t=(0,O.default)(t);if(t.attributes.list){t.attributes.list="ordered"}else{t.attributes.list="bullet";delete t.attributes.bullet}}if(typeof t.insert==="string"){var n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)},new l.default)}t.default=T},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.Range=undefined;var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:0;b(this,e);this.index=t;this.length=r};var _=function(){function e(t,r){var n=this;b(this,e);this.emitter=r;this.scroll=t;this.composing=false;this.mouseDown=false;this.root=this.scroll.domNode;this.cursor=a.default.create("cursor",this);this.lastRange=this.savedRange=new m(0,0);this.handleComposition();this.handleDragging();this.emitter.listenDOM("selectionchange",document,function(){if(!n.mouseDown){setTimeout(n.update.bind(n,d.default.sources.USER),1)}});this.emitter.on(d.default.events.EDITOR_CHANGE,function(e,t){if(e===d.default.events.TEXT_CHANGE&&t.length()>0){n.update(d.default.sources.SILENT)}});this.emitter.on(d.default.events.SCROLL_BEFORE_UPDATE,function(){if(!n.hasFocus())return;var e=n.getNativeRange();if(e==null)return;if(e.start.node===n.cursor.textNode)return;n.emitter.once(d.default.events.SCROLL_UPDATE,function(){try{n.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})});this.emitter.on(d.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var r=t.range,i=r.startNode,o=r.startOffset,a=r.endNode,l=r.endOffset;n.setNativeRange(i,o,a,l)}});this.update(d.default.sources.SILENT)}i(e,[{key:"handleComposition",value:function e(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=true});this.root.addEventListener("compositionend",function(){t.composing=false;if(t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function e(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=true});this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=false;t.update(d.default.sources.USER)})}},{key:"focus",value:function e(){if(this.hasFocus())return;this.root.focus();this.setRange(this.savedRange)}},{key:"format",value:function e(t,r){if(this.scroll.whitelist!=null&&!this.scroll.whitelist[t])return;this.scroll.update();var n=this.getNativeRange();if(n==null||!n.native.collapsed||a.default.query(t,a.default.Scope.BLOCK))return;if(n.start.node!==this.cursor.textNode){var i=a.default.find(n.start.node,false);if(i==null)return;if(i instanceof a.default.Leaf){var o=i.split(n.start.offset);i.parent.insertBefore(this.cursor,o)}else{i.insertBefore(this.cursor,n.start.node)}this.cursor.attach()}this.cursor.format(t,r);this.scroll.optimize();this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length);this.update()}},{key:"getBounds",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=this.scroll.length();t=Math.min(t,i-1);r=Math.min(t+r,i-1)-t;var o=void 0,a=this.scroll.leaf(t),l=n(a,2),u=l[0],s=l[1];if(u==null)return null;var f=u.position(s,true);var c=n(f,2);o=c[0];s=c[1];var d=document.createRange();if(r>0){d.setStart(o,s);var p=this.scroll.leaf(t+r);var h=n(p,2);u=h[0];s=h[1];if(u==null)return null;var v=u.position(s,true);var y=n(v,2);o=y[0];s=y[1];d.setEnd(o,s);return d.getBoundingClientRect()}else{var b="left";var g=void 0;if(o instanceof Text){if(s0)b="right"}return{bottom:g.top+g.height,height:g.height,left:g[b],right:g[b],top:g.top,width:0}}}},{key:"getNativeRange",value:function e(){var t=document.getSelection();if(t==null||t.rangeCount<=0)return null;var r=t.getRangeAt(0);if(r==null)return null;var n=this.normalizeNative(r);g.info("getNativeRange",n);return n}},{key:"getRange",value:function e(){var t=this.getNativeRange();if(t==null)return[null,null];var r=this.normalizedToRange(t);return[r,t]}},{key:"hasFocus",value:function e(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function e(t){var r=this;var i=[[t.start.node,t.start.offset]];if(!t.native.collapsed){i.push([t.end.node,t.end.offset])}var o=i.map(function(e){var t=n(e,2),i=t[0],o=t[1];var l=a.default.find(i,true);var u=l.offset(r.scroll);if(o===0){return u}else if(l instanceof a.default.Container){return u+l.length()}else{return u+l.index(i,o)}});var l=Math.min(Math.max.apply(Math,y(o)),this.scroll.length()-1);var u=Math.min.apply(Math,[l].concat(y(o)));return new m(u,l-u)}},{key:"normalizeNative",value:function e(t){if(!O(this.root,t.startContainer)||!t.collapsed&&!O(this.root,t.endContainer)){return null}var r={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};[r.start,r.end].forEach(function(e){var t=e.node,r=e.offset;while(!(t instanceof Text)&&t.childNodes.length>0){if(t.childNodes.length>r){t=t.childNodes[r];r=0}else if(t.childNodes.length===r){t=t.lastChild;r=t instanceof Text?t.data.length:t.childNodes.length+1}else{break}}e.node=t,e.offset=r});return r}},{key:"rangeToNative",value:function e(t){var r=this;var i=t.collapsed?[t.index]:[t.index,t.index+t.length];var o=[];var a=this.scroll.length();i.forEach(function(e,t){e=Math.min(a-1,e);var i=void 0,l=r.scroll.leaf(e),u=n(l,2),s=u[0],f=u[1];var c=s.position(f,t!==0);var d=n(c,2);i=d[0];f=d[1];o.push(i,f)});if(o.length<2){o=o.concat(o)}return o}},{key:"scrollIntoView",value:function e(t){var r=this.lastRange;if(r==null)return;var i=this.getBounds(r.index,r.length);if(i==null)return;var o=this.scroll.length()-1;var a=this.scroll.line(Math.min(r.index,o)),l=n(a,1),u=l[0];var s=u;if(r.length>0){var f=this.scroll.line(Math.min(r.index+r.length,o));var c=n(f,1);s=c[0]}if(u==null||s==null)return;var d=t.getBoundingClientRect();if(i.topd.bottom){t.scrollTop+=i.bottom-d.bottom}}},{key:"setNativeRange",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:r;var o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;g.info("setNativeRange",t,r,n,i);if(t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null)){return}var a=document.getSelection();if(a==null)return;if(t!=null){if(!this.hasFocus())this.root.focus();var l=(this.getNativeRange()||{}).native;if(l==null||o||t!==l.startContainer||r!==l.startOffset||n!==l.endContainer||i!==l.endOffset){if(t.tagName=="BR"){r=[].indexOf.call(t.parentNode.childNodes,t);t=t.parentNode}if(n.tagName=="BR"){i=[].indexOf.call(n.parentNode.childNodes,n);n=n.parentNode}var u=document.createRange();u.setStart(t,r);u.setEnd(n,i);a.removeAllRanges();a.addRange(u)}}else{a.removeAllRanges();this.root.blur();document.body.focus()}}},{key:"setRange",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:d.default.sources.API;if(typeof r==="string"){n=r;r=false}g.info("setRange",t);if(t!=null){var i=this.rangeToNative(t);this.setNativeRange.apply(this,y(i).concat([r]))}else{this.setNativeRange(null)}this.update(n)}},{key:"update",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:d.default.sources.USER;var r=this.lastRange;var i=this.getRange(),o=n(i,2),a=o[0],l=o[1];this.lastRange=a;if(this.lastRange!=null){this.savedRange=this.lastRange}if(!(0,f.default)(r,this.lastRange)){var s;if(!this.composing&&l!=null&&l.native.collapsed&&l.start.node!==this.cursor.textNode){this.cursor.restore()}var c=[d.default.events.SELECTION_CHANGE,(0,u.default)(this.lastRange),(0,u.default)(r),t];(s=this.emitter).emit.apply(s,[d.default.events.EDITOR_CHANGE].concat(c));if(t!==d.default.sources.SILENT){var p;(p=this.emitter).emit.apply(p,c)}}}}]);return e}();function O(e,t){try{t.parentNode}catch(e){return false}if(t instanceof Text){t=t.parentNode}return e.contains(t)}t.Range=m;t.default=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r0)r+=1;return[this.parent.domNode,r]};t.prototype.value=function(){var e;return e={},e[this.statics.blotName]=this.statics.value(this.domNode)||true,e};t.scope=o.Scope.INLINE_BLOT;return t}(i.default);t.default=a},function(e,t,r){var n=r(11);var i=r(3);var o={attributes:{compose:function(e,t,r){if(typeof e!=="object")e={};if(typeof t!=="object")t={};var n=i(true,{},t);if(!r){n=Object.keys(n).reduce(function(e,t){if(n[t]!=null){e[t]=n[t]}return e},{})}for(var o in e){if(e[o]!==undefined&&t[o]===undefined){n[o]=e[o]}}return Object.keys(n).length>0?n:undefined},diff:function(e,t){if(typeof e!=="object")e={};if(typeof t!=="object")t={};var r=Object.keys(e).concat(Object.keys(t)).reduce(function(r,i){if(!n(e[i],t[i])){r[i]=t[i]===undefined?null:t[i]}return r},{});return Object.keys(r).length>0?r:undefined},transform:function(e,t,r){if(typeof e!=="object")return t;if(typeof t!=="object")return undefined;if(!r)return t;var n=Object.keys(t).reduce(function(r,n){if(e[n]===undefined)r[n]=t[n];return r},{});return Object.keys(n).length>0?n:undefined}},iterator:function(e){return new a(e)},length:function(e){if(typeof e["delete"]==="number"){return e["delete"]}else if(typeof e.retain==="number"){return e.retain}else{return typeof e.insert==="string"?e.insert.length:1}}};function a(e){this.ops=e;this.index=0;this.offset=0}a.prototype.hasNext=function(){return this.peekLength()=n-r){e=n-r;this.index+=1;this.offset=0}else{this.offset+=e}if(typeof t["delete"]==="number"){return{delete:e}}else{var i={};if(t.attributes){i.attributes=t.attributes}if(typeof t.retain==="number"){i.retain=e}else if(typeof t.insert==="string"){i.insert=t.insert.substr(r,e)}else{i.insert=t.insert}return i}}else{return{retain:Infinity}}};a.prototype.peek=function(){return this.ops[this.index]};a.prototype.peekLength=function(){if(this.ops[this.index]){return o.length(this.ops[this.index])-this.offset}else{return Infinity}};a.prototype.peekType=function(){if(this.ops[this.index]){if(typeof this.ops[this.index]["delete"]==="number"){return"delete"}else if(typeof this.ops[this.index].retain==="number"){return"retain"}else{return"insert"}}return"retain"};a.prototype.rest=function(){if(!this.hasNext()){return[]}else if(this.offset===0){return this.ops.slice(this.index)}else{var e=this.offset;var t=this.index;var r=this.next();var n=this.ops.slice(this.index);this.offset=e;this.index=t;return[r].concat(n)}};e.exports=o},function(e,t){var r=function(){"use strict";function e(e,t){return t!=null&&e instanceof t}var t;try{t=Map}catch(e){t=function(){}}var r;try{r=Set}catch(e){r=function(){}}var n;try{n=Promise}catch(e){n=function(){}}function i(o,a,l,u,f){if(typeof a==="object"){l=a.depth;u=a.prototype;f=a.includeNonEnumerable;a=a.circular}var c=[];var d=[];var p=typeof Buffer!="undefined";if(typeof a=="undefined")a=true;if(typeof l=="undefined")l=Infinity;function h(o,l){if(o===null)return null;if(l===0)return o;var v;var y;if(typeof o!="object"){return o}if(e(o,t)){v=new t}else if(e(o,r)){v=new r}else if(e(o,n)){v=new n(function(e,t){o.then(function(t){e(h(t,l-1))},function(e){t(h(e,l-1))})})}else if(i.__isArray(o)){v=[]}else if(i.__isRegExp(o)){v=new RegExp(o.source,s(o));if(o.lastIndex)v.lastIndex=o.lastIndex}else if(i.__isDate(o)){v=new Date(o.getTime())}else if(p&&Buffer.isBuffer(o)){if(Buffer.allocUnsafe){v=Buffer.allocUnsafe(o.length)}else{v=new Buffer(o.length)}o.copy(v);return v}else if(e(o,Error)){v=Object.create(o)}else{if(typeof u=="undefined"){y=Object.getPrototypeOf(o);v=Object.create(y)}else{v=Object.create(u);y=u}}if(a){var b=c.indexOf(o);if(b!=-1){return d[b]}c.push(o);d.push(v)}if(e(o,t)){o.forEach(function(e,t){var r=h(t,l-1);var n=h(e,l-1);v.set(r,n)})}if(e(o,r)){o.forEach(function(e){var t=h(e,l-1);v.add(t)})}for(var g in o){var m;if(y){m=Object.getOwnPropertyDescriptor(y,g)}if(m&&m.set==null){continue}v[g]=h(o[g],l-1)}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(o);for(var g=0;g<_.length;g++){var O=_[g];var x=Object.getOwnPropertyDescriptor(o,O);if(x&&!x.enumerable&&!f){continue}v[O]=h(o[O],l-1);if(!x.enumerable){Object.defineProperty(v,O,{enumerable:false})}}}if(f){var w=Object.getOwnPropertyNames(o);for(var g=0;g0){if(u instanceof f.BlockEmbed||h instanceof f.BlockEmbed){this.optimize();return}if(u instanceof v.default){var y=u.newlineIndex(u.length(),true);if(y>-1){u=u.split(y+1);if(u===h){this.optimize();return}}}else if(h instanceof v.default){var b=h.newlineIndex(0);if(b>-1){h.split(b+1)}}var g=h.children.head instanceof p.default?null:h.children.head;u.moveChildren(h,g);u.remove()}this.optimize()}},{key:"enable",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function e(r,n,i,a){if(this.whitelist!=null&&!this.whitelist[i])return;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,r,n,i,a);this.optimize()}},{key:"insertAt",value:function e(r,n,i){if(i!=null&&this.whitelist!=null&&!this.whitelist[n])return;if(r>=this.length()){if(i==null||l.default.query(n,l.default.Scope.BLOCK)==null){var a=l.default.create(this.statics.defaultChild);this.appendChild(a);if(i==null&&n.endsWith("\n")){n=n.slice(0,-1)}a.insertAt(0,n,i)}else{var u=l.default.create(n,i);this.appendChild(u)}}else{o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,r,n,i)}this.optimize()}},{key:"insertBefore",value:function e(r,n){if(r.statics.scope===l.default.Scope.INLINE_BLOT){var i=l.default.create(this.statics.defaultChild);i.appendChild(r);r=i}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,r,n)}},{key:"leaf",value:function e(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function e(t){if(t===this.length()){return this.line(t-1)}return this.descendant(x,t)}},{key:"lines",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;var n=function e(t,r,n){var i=[],o=n;t.children.forEachAt(r,n,function(t,r,n){if(x(t)){i.push(t)}else if(t instanceof l.default.Container){i=i.concat(e(t,r,o))}o-=n});return i};return n(this,t,r)}},{key:"optimize",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.batch)return;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r,n);if(r.length>0){this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,r,n)}}},{key:"path",value:function e(r){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,r).slice(1)}},{key:"update",value:function e(r){if(this.batch){if(Array.isArray(r)){this.batch=this.batch.concat(r)}return}var n=s.default.sources.USER;if(typeof r==="string"){n=r}if(!Array.isArray(r)){r=this.observer.takeRecords()}if(r.length>0){this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,r)}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,r.concat([]));if(r.length>0){this.emitter.emit(s.default.events.SCROLL_UPDATE,n,r)}}}]);return t}(l.default.Scroll);w.blotName="scroll";w.className="ql-editor";w.tagName="DIV";w.defaultChild="block";w.allowedChildren=[c.default,f.BlockEmbed,b.default];t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SHORTKEY=t.default=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var o=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=D(t);if(i==null||i.key==null){return q.warn("Attempted to add invalid keyboard binding",i)}if(typeof r==="function"){r={handler:r}}if(typeof n==="function"){n={handler:n}}i=(0,c.default)(i,r,n);this.bindings[i.key]=this.bindings[i.key]||[];this.bindings[i.key].push(i)}},{key:"listen",value:function e(){var r=this;this.quill.root.addEventListener("keydown",function(e){if(e.defaultPrevented)return;var o=e.which||e.keyCode;var a=(r.bindings[o]||[]).filter(function(r){return t.match(e,r)});if(a.length===0)return;var l=r.quill.getSelection();if(l==null||!r.quill.hasFocus())return;var u=r.quill.getLine(l.index),f=i(u,2),c=f[0],d=f[1];var p=r.quill.getLeaf(l.index),h=i(p,2),v=h[0],y=h[1];var g=l.length===0?[v,y]:r.quill.getLeaf(l.index+l.length),m=i(g,2),_=m[0],O=m[1];var x=v instanceof b.default.Text?v.value().slice(0,y):"";var w=_ instanceof b.default.Text?_.value().slice(O):"";var k={collapsed:l.length===0,empty:l.length===0&&c.length()<=1,format:r.quill.getFormat(l),offset:d,prefix:x,suffix:w};var E=a.some(function(e){if(e.collapsed!=null&&e.collapsed!==k.collapsed)return false;if(e.empty!=null&&e.empty!==k.empty)return false;if(e.offset!=null&&e.offset!==k.offset)return false;if(Array.isArray(e.format)){if(e.format.every(function(e){return k.format[e]==null})){return false}}else if(n(e.format)==="object"){if(!Object.keys(e.format).every(function(t){if(e.format[t]===true)return k.format[t]!=null;if(e.format[t]===false)return k.format[t]==null;return(0,s.default)(e.format[t],k.format[t])})){return false}}if(e.prefix!=null&&!e.prefix.test(k.prefix))return false;if(e.suffix!=null&&!e.suffix.test(k.suffix))return false;return e.handler.call(r,l,k)!==true});if(E){e.preventDefault()}})}}]);return t}(w.default);S.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};S.DEFAULTS={bindings:{bold:B("bold"),italic:B("italic"),underline:B("underline"),indent:{key:S.keys.TAB,format:["blockquote","indent","list"],handler:function e(t,r){if(r.collapsed&&r.offset!==0)return true;this.quill.format("indent","+1",m.default.sources.USER)}},outdent:{key:S.keys.TAB,shiftKey:true,format:["blockquote","indent","list"],handler:function e(t,r){if(r.collapsed&&r.offset!==0)return true;this.quill.format("indent","-1",m.default.sources.USER)}},"outdent backspace":{key:S.keys.BACKSPACE,collapsed:true,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function e(t,r){if(r.format.indent!=null){this.quill.format("indent","-1",m.default.sources.USER)}else if(r.format.list!=null){this.quill.format("list",false,m.default.sources.USER)}}},"indent code-block":I(true),"outdent code-block":I(false),"remove tab":{key:S.keys.TAB,shiftKey:true,collapsed:true,prefix:/\t$/,handler:function e(t){this.quill.deleteText(t.index-1,1,m.default.sources.USER)}},tab:{key:S.keys.TAB,handler:function e(t){this.quill.history.cutoff();var r=(new p.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(r,m.default.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index+1,m.default.sources.SILENT)}},"list empty enter":{key:S.keys.ENTER,collapsed:true,format:["list"],empty:true,handler:function e(t,r){this.quill.format("list",false,m.default.sources.USER);if(r.format.indent){this.quill.format("indent",false,m.default.sources.USER)}}},"checklist enter":{key:S.keys.ENTER,collapsed:true,format:{list:"checked"},handler:function e(t){var r=this.quill.getLine(t.index),n=i(r,2),o=n[0],a=n[1];var l=(0,c.default)({},o.formats(),{list:"checked"});var u=(new p.default).retain(t.index).insert("\n",l).retain(o.length()-a-1).retain(1,{list:"unchecked"});this.quill.updateContents(u,m.default.sources.USER);this.quill.setSelection(t.index+1,m.default.sources.SILENT);this.quill.scrollIntoView()}},"header enter":{key:S.keys.ENTER,collapsed:true,format:["header"],suffix:/^$/,handler:function e(t,r){var n=this.quill.getLine(t.index),o=i(n,2),a=o[0],l=o[1];var u=(new p.default).retain(t.index).insert("\n",r.format).retain(a.length()-l-1).retain(1,{header:null});this.quill.updateContents(u,m.default.sources.USER);this.quill.setSelection(t.index+1,m.default.sources.SILENT);this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:true,format:{list:false},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function e(t,r){var n=r.prefix.length;var o=this.quill.getLine(t.index),a=i(o,2),l=a[0],u=a[1];if(u>n)return true;var s=void 0;switch(r.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",m.default.sources.USER);this.quill.history.cutoff();var f=(new p.default).retain(t.index-u).delete(n+1).retain(l.length()-2-u).retain(1,{list:s});this.quill.updateContents(f,m.default.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index-n,m.default.sources.SILENT)}},"code exit":{key:S.keys.ENTER,collapsed:true,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function e(t){var r=this.quill.getLine(t.index),n=i(r,2),o=n[0],a=n[1];var l=(new p.default).retain(t.index+o.length()-a-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(l,m.default.sources.USER)}},"embed left":P(S.keys.LEFT,false),"embed left shift":P(S.keys.LEFT,true),"embed right":P(S.keys.RIGHT,false),"embed right shift":P(S.keys.RIGHT,true)}};function P(e,t){var r;var n=e===S.keys.LEFT?"prefix":"suffix";return r={key:e,shiftKey:t,altKey:null},E(r,n,/^$/),E(r,"handler",function r(n){var o=n.index;if(e===S.keys.RIGHT){o+=n.length+1}var a=this.quill.getLeaf(o),l=i(a,1),u=l[0];if(!(u instanceof b.default.Embed))return true;if(e===S.keys.LEFT){if(t){this.quill.setSelection(n.index-1,n.length+1,m.default.sources.USER)}else{this.quill.setSelection(n.index-1,m.default.sources.USER)}}else{if(t){this.quill.setSelection(n.index,n.length+1,m.default.sources.USER)}else{this.quill.setSelection(n.index+n.length+1,m.default.sources.USER)}}return false}),r}function C(e,t){if(e.index===0||this.quill.getLength()<=1)return;var r=this.quill.getLine(e.index),n=i(r,1),o=n[0];var a={};if(t.offset===0){var l=this.quill.getLine(e.index-1),u=i(l,1),s=u[0];if(s!=null&&s.length()>1){var f=o.formats();var c=this.quill.getFormat(e.index-1,1);a=v.default.attributes.diff(f,c)||{}}}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-d,d,m.default.sources.USER);if(Object.keys(a).length>0){this.quill.formatLine(e.index-d,d,a,m.default.sources.USER)}this.quill.focus()}function L(e,t){var r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;var n={},o=0;var a=this.quill.getLine(e.index),l=i(a,1),u=l[0];if(t.offset>=u.length()-1){var s=this.quill.getLine(e.index+1),f=i(s,1),c=f[0];if(c){var d=u.formats();var p=this.quill.getFormat(e.index,1);n=v.default.attributes.diff(d,p)||{};o=c.length()}}this.quill.deleteText(e.index,r,m.default.sources.USER);if(Object.keys(n).length>0){this.quill.formatLine(e.index+o-1,r,n,m.default.sources.USER)}}function M(e){var t=this.quill.getLines(e);var r={};if(t.length>1){var n=t[0].formats();var i=t[t.length-1].formats();r=v.default.attributes.diff(i,n)||{}}this.quill.deleteText(e,m.default.sources.USER);if(Object.keys(r).length>0){this.quill.formatLine(e.index,1,r,m.default.sources.USER)}this.quill.setSelection(e.index,m.default.sources.SILENT);this.quill.focus()}function R(e,t){var r=this;if(e.length>0){this.quill.scroll.deleteAt(e.index,e.length)}var n=Object.keys(t.format).reduce(function(e,r){if(b.default.query(r,b.default.Scope.BLOCK)&&!Array.isArray(t.format[r])){e[r]=t.format[r]}return e},{});this.quill.insertText(e.index,"\n",n,m.default.sources.USER);this.quill.setSelection(e.index+1,m.default.sources.SILENT);this.quill.focus();Object.keys(t.format).forEach(function(e){if(n[e]!=null)return;if(Array.isArray(t.format[e]))return;if(e==="link")return;r.quill.format(e,t.format[e],m.default.sources.USER)})}function I(e){return{key:S.keys.TAB,shiftKey:!e,format:{"code-block":true},handler:function t(r){var n=b.default.query("code-block");var o=r.index,a=r.length;var l=this.quill.scroll.descendant(n,o),u=i(l,2),s=u[0],f=u[1];if(s==null)return;var c=this.quill.getIndex(s);var d=s.newlineIndex(f,true)+1;var p=s.newlineIndex(c+f+a);var h=s.domNode.textContent.slice(d,p).split("\n");f=0;h.forEach(function(t,r){if(e){s.insertAt(d+f,n.TAB);f+=n.TAB.length;if(r===0){o+=n.TAB.length}else{a+=n.TAB.length}}else if(t.startsWith(n.TAB)){s.deleteAt(d+f,n.TAB.length);f-=n.TAB.length;if(r===0){o-=n.TAB.length}else{a-=n.TAB.length}}f+=t.length+1});this.quill.update(m.default.sources.USER);this.quill.setSelection(o,a,m.default.sources.SILENT)}}}function B(e){return{key:e[0].toUpperCase(),shortKey:true,handler:function t(r,n){this.quill.format(e,!n.format[e],m.default.sources.USER)}}}function D(e){if(typeof e==="string"||typeof e==="number"){return D({key:e})}if((typeof e==="undefined"?"undefined":n(e))==="object"){e=(0,l.default)(e,false)}if(typeof e.key==="string"){if(S.keys[e.key.toUpperCase()]!=null){e.key=S.keys[e.key.toUpperCase()]}else if(e.key.length===1){e.key=e.key.toUpperCase().charCodeAt(0)}else{return null}}if(e.shortKey){e[T]=e.shortKey;delete e.shortKey}return e}t.default=S;t.SHORTKEY=T},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var o=function(){function e(e,t){for(var r=0;r-1}t.default=c;t.sanitize=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){function e(e,t){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:false;var i=this.container.querySelector(".ql-selected");if(t===i)return;if(i!=null){i.classList.remove("ql-selected")}if(t==null)return;t.classList.add("ql-selected");this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t);if(t.hasAttribute("data-value")){this.label.setAttribute("data-value",t.getAttribute("data-value"))}else{this.label.removeAttribute("data-value")}if(t.hasAttribute("data-label")){this.label.setAttribute("data-label",t.getAttribute("data-label"))}else{this.label.removeAttribute("data-label")}if(r){if(typeof Event==="function"){this.select.dispatchEvent(new Event("change"))}else if((typeof Event==="undefined"?"undefined":n(Event))==="object"){var o=document.createEvent("Event");o.initEvent("change",true,true);this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function e(){var t=void 0;if(this.select.selectedIndex>-1){var r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex];this.selectItem(r)}else{this.selectItem(null)}var n=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]);return e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(0);var i=q(n);var o=r(5);var a=q(o);var l=r(4);var u=q(l);var s=r(16);var f=q(s);var c=r(25);var d=q(c);var p=r(24);var h=q(p);var v=r(35);var y=q(v);var b=r(6);var g=q(b);var m=r(22);var _=q(m);var O=r(7);var x=q(O);var w=r(55);var k=q(w);var E=r(42);var j=q(E);var A=r(23);var N=q(A);function q(e){return e&&e.__esModule?e:{default:e}}a.default.register({"blots/block":u.default,"blots/block/embed":l.BlockEmbed,"blots/break":f.default,"blots/container":d.default,"blots/cursor":h.default,"blots/embed":y.default,"blots/inline":g.default,"blots/scroll":_.default,"blots/text":x.default,"modules/clipboard":k.default,"modules/history":j.default,"modules/keyboard":N.default});i.default.register(u.default,f.default,h.default,g.default,_.default,x.default);t.default=a.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(1);var i=function(){function e(e){this.domNode=e;this.domNode[n.DATA_KEY]={blot:this}}Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:true,configurable:true});e.create=function(e){if(this.tagName==null){throw new n.ParchmentError("Blot definition missing tagName")}var t;if(Array.isArray(this.tagName)){if(typeof e==="string"){e=e.toUpperCase();if(parseInt(e).toString()===e){e=parseInt(e)}}if(typeof e==="number"){t=document.createElement(this.tagName[e-1])}else if(this.tagName.indexOf(e)>-1){t=document.createElement(e)}else{t=document.createElement(this.tagName[0])}}else{t=document.createElement(this.tagName)}if(this.className){t.classList.add(this.className)}return t};e.prototype.attach=function(){if(this.parent!=null){this.scroll=this.parent.scroll}};e.prototype.clone=function(){var e=this.domNode.cloneNode(false);return n.create(e)};e.prototype.detach=function(){if(this.parent!=null)this.parent.removeChild(this);delete this.domNode[n.DATA_KEY]};e.prototype.deleteAt=function(e,t){var r=this.isolate(e,t);r.remove()};e.prototype.formatAt=function(e,t,r,i){var o=this.isolate(e,t);if(n.query(r,n.Scope.BLOT)!=null&&i){o.wrap(r,i)}else if(n.query(r,n.Scope.ATTRIBUTE)!=null){var a=n.create(this.statics.scope);o.wrap(a);a.format(r,i)}};e.prototype.insertAt=function(e,t,r){var i=r==null?n.create("text",t):n.create(t,r);var o=this.split(e);this.parent.insertBefore(i,o)};e.prototype.insertInto=function(e,t){if(t===void 0){t=null}if(this.parent!=null){this.parent.children.remove(this)}var r=null;e.children.insertBefore(this,t);if(t!=null){r=t.domNode}if(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=r){e.domNode.insertBefore(this.domNode,r)}this.parent=e;this.attach()};e.prototype.isolate=function(e,t){var r=this.split(e);r.split(t);return r};e.prototype.length=function(){return 1};e.prototype.offset=function(e){if(e===void 0){e=this.parent}if(this.parent==null||this==e)return 0;return this.parent.children.offset(this)+this.parent.offset(e)};e.prototype.optimize=function(e){if(this.domNode[n.DATA_KEY]!=null){delete this.domNode[n.DATA_KEY].mutations}};e.prototype.remove=function(){if(this.domNode.parentNode!=null){this.domNode.parentNode.removeChild(this.domNode)}this.detach()};e.prototype.replace=function(e){if(e.parent==null)return;e.parent.insertBefore(this,e.next);e.remove()};e.prototype.replaceWith=function(e,t){var r=typeof e==="string"?n.create(e,t):e;r.replace(this);return r};e.prototype.split=function(e,t){return e===0?this:this.next};e.prototype.update=function(e,t){};e.prototype.wrap=function(e,t){var r=typeof e==="string"?n.create(e,t):e;if(this.parent!=null){this.parent.insertBefore(r,this.next)}r.appendChild(this);return r};e.blotName="abstract";return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(12);var i=r(32);var o=r(33);var a=r(1);var l=function(){function e(e){this.attributes={};this.domNode=e;this.build()}e.prototype.attribute=function(e,t){if(t){if(e.add(this.domNode,t)){if(e.value(this.domNode)!=null){this.attributes[e.attrName]=e}else{delete this.attributes[e.attrName]}}}else{e.remove(this.domNode);delete this.attributes[e.attrName]}};e.prototype.build=function(){var e=this;this.attributes={};var t=n.default.keys(this.domNode);var r=i.default.keys(this.domNode);var l=o.default.keys(this.domNode);t.concat(r).concat(l).forEach(function(t){var r=a.query(t,a.Scope.ATTRIBUTE);if(r instanceof n.default){e.attributes[r.attrName]=r}})};e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(r){var n=t.attributes[r].value(t.domNode);e.format(r,n)})};e.prototype.move=function(e){var t=this;this.copy(e);Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)});this.attributes={}};e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,r){t[r]=e.attributes[r].value(e.domNode);return t},{})};return e}();t.default=l},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(12);function o(e,t){var r=e.getAttribute("class")||"";return r.split(/\s+/).filter(function(e){return e.indexOf(t+"-")===0})}var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})};t.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;this.remove(e);e.classList.add(this.keyName+"-"+t);return true};t.prototype.remove=function(e){var t=o(e,this.keyName);t.forEach(function(t){e.classList.remove(t)});if(e.classList.length===0){e.removeAttribute("class")}};t.prototype.value=function(e){var t=o(e,this.keyName)[0]||"";var r=t.slice(this.keyName.length+1);return this.canAdd(e,r)?r:""};return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(12);function o(e){var t=e.split("-");var r=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+r}var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){var t=e.split(":");return t[0].trim()})};t.prototype.add=function(e,t){if(!this.canAdd(e,t))return false;e.style[o(this.keyName)]=t;return true};t.prototype.remove=function(e){e.style[o(this.keyName)]="";if(!e.getAttribute("style")){e.removeAttribute("style")}};t.prototype.value=function(e){var t=e.style[o(this.keyName)];return this.canAdd(e,t)?t:""};return t}(i.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;ri&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo);t=o.redo.compose(t)}else{this.lastRecorded=i}this.stack.undo.push({redo:t,undo:n});if(this.stack.undo.length>this.options.maxStack){this.stack.undo.shift()}}},{key:"redo",value:function e(){this.change("redo","undo")}},{key:"transform",value:function e(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,true);e.redo=t.transform(e.redo,true)});this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,true);e.redo=t.transform(e.redo,true)})}},{key:"undo",value:function e(){this.change("undo","redo")}}]);return t}(s.default);h.DEFAULTS={delay:1e3,maxStack:100,userOnly:false};function v(e){var t=e.ops[e.ops.length-1];if(t==null)return false;if(t.insert!=null){return typeof t.insert==="string"&&t.insert.endsWith("\n")}if(t.attributes!=null){return Object.keys(t.attributes).some(function(e){return o.default.query(e,o.default.Scope.BLOCK)!=null})}return false}function y(e){var t=e.reduce(function(e,t){e+=t.delete||0;return e},0);var r=e.length()-t;if(v(e)){r-=1}return r}t.default=h;t.getLastChangeIndex=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.BaseTooltip=undefined;var n=function(){function e(e,t){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:"link";var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.root.classList.remove("ql-hidden");this.root.classList.add("ql-editing");if(r!=null){this.textbox.value=r}else if(t!==this.root.getAttribute("data-mode")){this.textbox.value=""}this.position(this.quill.getBounds(this.quill.selection.savedRange));this.textbox.select();this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||"");this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function e(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus();this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function e(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var r=this.quill.root.scrollTop;if(this.linkRange){this.quill.formatText(this.linkRange,"link",t,f.default.sources.USER);delete this.linkRange}else{this.restoreFocus();this.quill.format("link",t,f.default.sources.USER)}this.quill.root.scrollTop=r;break}case"video":{t=L(t)}case"formula":{if(!t)break;var n=this.quill.getSelection(true);if(n!=null){var i=n.index+n.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,f.default.sources.USER);if(this.root.getAttribute("data-mode")==="formula"){this.quill.insertText(i+1," ",f.default.sources.USER)}this.quill.setSelection(i+2,f.default.sources.USER)}break}default:}this.textbox.value="";this.hide()}}]);return t}(x.default);function L(e){var t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t){return(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0"}if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)){return(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/"}return e}function M(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;t.forEach(function(t){var n=document.createElement("option");if(t===r){n.setAttribute("selected","selected")}else{n.setAttribute("value",t)}e.appendChild(n)})}t.BaseTooltip=C;t.default=P},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){this.head=this.tail=null;this.length=0}e.prototype.append=function(){var e=[];for(var t=0;t1){this.append.apply(this,e.slice(1))}};e.prototype.contains=function(e){var t,r=this.iterator();while(t=r()){if(t===e)return true}return false};e.prototype.insertBefore=function(e,t){if(!e)return;e.next=t;if(t!=null){e.prev=t.prev;if(t.prev!=null){t.prev.next=e}t.prev=e;if(t===this.head){this.head=e}}else if(this.tail!=null){this.tail.next=e;e.prev=this.tail;this.tail=e}else{e.prev=null;this.head=this.tail=e}this.length+=1};e.prototype.offset=function(e){var t=0,r=this.head;while(r!=null){if(r===e)return t;t+=r.length();r=r.next}return-1};e.prototype.remove=function(e){if(!this.contains(e))return;if(e.prev!=null)e.prev.next=e.next;if(e.next!=null)e.next.prev=e.prev;if(e===this.head)this.head=e.next;if(e===this.tail)this.tail=e.prev;this.length-=1};e.prototype.iterator=function(e){if(e===void 0){e=this.head}return function(){var t=e;if(e!=null)e=e.next;return t}};e.prototype.find=function(e,t){if(t===void 0){t=false}var r,n=this.iterator();while(r=n()){var i=r.length();if(el){r(a,e-l,Math.min(t,l+s-e))}else{r(a,0,Math.min(s,e+t-l))}l+=s}};e.prototype.map=function(e){return this.reduce(function(t,r){t.push(e(r));return t},[])};e.prototype.reduce=function(e,t){var r,n=this.iterator();while(r=n()){t=e(t,r)}return t};return e}();t.default=n},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(17);var o=r(1);var a={attributes:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true};var l=100;var u=function(e){n(t,e);function t(t){var r=e.call(this,t)||this;r.scroll=r;r.observer=new MutationObserver(function(e){r.update(e)});r.observer.observe(r.domNode,a);r.attach();return r}t.prototype.detach=function(){e.prototype.detach.call(this);this.observer.disconnect()};t.prototype.deleteAt=function(t,r){this.update();if(t===0&&r===this.length()){this.children.forEach(function(e){e.remove()})}else{e.prototype.deleteAt.call(this,t,r)}};t.prototype.formatAt=function(t,r,n,i){this.update();e.prototype.formatAt.call(this,t,r,n,i)};t.prototype.insertAt=function(t,r,n){this.update();e.prototype.insertAt.call(this,t,r,n)};t.prototype.optimize=function(t,r){var n=this;if(t===void 0){t=[]}if(r===void 0){r={}}e.prototype.optimize.call(this,r);var a=[].slice.call(this.observer.takeRecords());while(a.length>0)t.push(a.pop());var u=function(e,t){if(t===void 0){t=true}if(e==null||e===n)return;if(e.domNode.parentNode==null)return;if(e.domNode[o.DATA_KEY].mutations==null){e.domNode[o.DATA_KEY].mutations=[]}if(t)u(e.parent)};var s=function(e){if(e.domNode[o.DATA_KEY]==null||e.domNode[o.DATA_KEY].mutations==null){return}if(e instanceof i.default){e.children.forEach(s)}e.optimize(r)};var f=t;for(var c=0;f.length>0;c+=1){if(c>=l){throw new Error("[Parchment] Maximum optimize iterations reached")}f.forEach(function(e){var t=o.find(e.target,true);if(t==null)return;if(t.domNode===e.target){if(e.type==="childList"){u(o.find(e.previousSibling,false));[].forEach.call(e.addedNodes,function(e){var t=o.find(e,false);u(t,false);if(t instanceof i.default){t.children.forEach(function(e){u(e,false)})}})}else if(e.type==="attributes"){u(t.prev)}}u(t)});this.children.forEach(s);f=[].slice.call(this.observer.takeRecords());a=f.slice();while(a.length>0)t.push(a.pop())}};t.prototype.update=function(t,r){var n=this;if(r===void 0){r={}}t=t||this.observer.takeRecords();t.map(function(e){var t=o.find(e.target,true);if(t==null)return null;if(t.domNode[o.DATA_KEY].mutations==null){t.domNode[o.DATA_KEY].mutations=[e];return t}else{t.domNode[o.DATA_KEY].mutations.push(e);return null}}).forEach(function(e){if(e==null||e===n||e.domNode[o.DATA_KEY]==null)return;e.update(e.domNode[o.DATA_KEY].mutations||[],r)});if(this.domNode[o.DATA_KEY].mutations!=null){e.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,r)}this.optimize(t,r)};t.blotName="scroll";t.defaultChild="block";t.scope=o.Scope.BLOCK_BLOT;t.tagName="DIV";return t}(i.default);t.default=u},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(18);var o=r(1);function a(e,t){if(Object.keys(e).length!==Object.keys(t).length)return false;for(var r in e){if(e[r]!==t[r])return false}return true}var l=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(r){if(r.tagName===t.tagName)return undefined;return e.formats.call(this,r)};t.prototype.format=function(r,n){var o=this;if(r===this.statics.blotName&&!n){this.children.forEach(function(e){if(!(e instanceof i.default)){e=e.wrap(t.blotName,true)}o.attributes.copy(e)});this.unwrap()}else{e.prototype.format.call(this,r,n)}};t.prototype.formatAt=function(t,r,n,i){if(this.formats()[n]!=null||o.query(n,o.Scope.ATTRIBUTE)){var a=this.isolate(t,r);a.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.optimize=function(r){e.prototype.optimize.call(this,r);var n=this.formats();if(Object.keys(n).length===0){return this.unwrap()}var i=this.next;if(i instanceof t&&i.prev===this&&a(n,i.formats())){i.moveChildren(this);i.remove()}};t.blotName="inline";t.scope=o.Scope.INLINE_BLOT;t.tagName="SPAN";return t}(i.default);t.default=l},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(18);var o=r(1);var a=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(r){var n=o.query(t.blotName).tagName;if(r.tagName===n)return undefined;return e.formats.call(this,r)};t.prototype.format=function(r,n){if(o.query(r,o.Scope.BLOCK)==null){return}else if(r===this.statics.blotName&&!n){this.replaceWith(t.blotName)}else{e.prototype.format.call(this,r,n)}};t.prototype.formatAt=function(t,r,n,i){if(o.query(n,o.Scope.BLOCK)!=null){this.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.insertAt=function(t,r,n){if(n==null||o.query(r,o.Scope.INLINE)!=null){e.prototype.insertAt.call(this,t,r,n)}else{var i=this.split(t);var a=o.create(r,n);i.parent.insertBefore(a,i)}};t.prototype.update=function(t,r){if(navigator.userAgent.match(/Trident/)){this.build()}else{e.prototype.update.call(this,t,r)}};t.blotName="block";t.scope=o.Scope.BLOCK_BLOT;t.tagName="P";return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(19);var o=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.formats=function(e){return undefined};t.prototype.format=function(t,r){e.prototype.formatAt.call(this,0,this.length(),t,r)};t.prototype.formatAt=function(t,r,n,i){if(t===0&&r===this.length()){this.format(n,i)}else{e.prototype.formatAt.call(this,t,r,n,i)}};t.prototype.formats=function(){return this.statics.formats(this.domNode)};return t}(i.default);t.default=o},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:true});var i=r(19);var o=r(1);var a=function(e){n(t,e);function t(t){var r=e.call(this,t)||this;r.text=r.statics.value(r.domNode);return r}t.create=function(e){return document.createTextNode(e)};t.value=function(e){var t=e.data;if(t["normalize"])t=t["normalize"]();return t};t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)};t.prototype.index=function(e,t){if(this.domNode===e){return t}return-1};t.prototype.insertAt=function(t,r,n){if(n==null){this.text=this.text.slice(0,t)+r+this.text.slice(t);this.domNode.data=this.text}else{e.prototype.insertAt.call(this,t,r,n)}};t.prototype.length=function(){return this.text.length};t.prototype.optimize=function(r){e.prototype.optimize.call(this,r);this.text=this.statics.value(this.domNode);if(this.text.length===0){this.remove()}else if(this.next instanceof t&&this.next.prev===this){this.insertAt(this.length(),this.next.value());this.next.remove()}};t.prototype.position=function(e,t){if(t===void 0){t=false}return[this.domNode,e]};t.prototype.split=function(e,t){if(t===void 0){t=false}if(!t){if(e===0)return this;if(e===this.length())return this.next}var r=o.create(this.domNode.splitText(e));this.parent.insertBefore(r,this.next);this.text=this.statics.value(this.domNode);return r};t.prototype.update=function(e,t){var r=this;if(e.some(function(e){return e.type==="characterData"&&e.target===r.domNode})){this.text=this.statics.value(this.domNode)}};t.prototype.value=function(){return this.text};t.blotName="text";t.scope=o.Scope.INLINE_BLOT;return t}(i.default);t.default=a},function(e,t,r){"use strict";var n=document.createElement("div");n.classList.toggle("test-class",false);if(n.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){if(arguments.length>1&&!this.contains(e)===!t){return t}else{return i.call(this,e)}}}if(!String.prototype.startsWith){String.prototype.startsWith=function(e,t){t=t||0;return this.substr(t,e.length)===e}}if(!String.prototype.endsWith){String.prototype.endsWith=function(e,t){var r=this.toString();if(typeof t!=="number"||!isFinite(t)||Math.floor(t)!==t||t>r.length){t=r.length}t-=e.length;var n=r.indexOf(e,t);return n!==-1&&n===t}}if(!Array.prototype.find){Object.defineProperty(Array.prototype,"find",{value:function e(t){if(this===null){throw new TypeError("Array.prototype.find called on null or undefined")}if(typeof t!=="function"){throw new TypeError("predicate must be a function")}var r=Object(this);var n=r.length>>>0;var i=arguments[1];var e;for(var o=0;ot.length?e:t;var s=e.length>t.length?t:e;var f=u.indexOf(s);if(f!=-1){a=[[n,u.substring(0,f)],[i,s],[n,u.substring(f+s.length)]];if(e.length>t.length){a[0][0]=a[2][0]=r}return a}if(s.length==1){return[[r,e],[n,t]]}var d=c(e,t);if(d){var p=d[0];var h=d[1];var v=d[2];var y=d[3];var b=d[4];var g=o(p,v);var m=o(h,y);return g.concat([[i,b]],m)}return l(e,t)}function l(e,t){var i=e.length;var o=t.length;var a=Math.ceil((i+o)/2);var l=a;var s=2*a;var f=new Array(s);var c=new Array(s);for(var d=0;di){y+=2}else if(w>o){v+=2}else if(h){var k=l+p-_;if(k>=0&&k=E){return u(e,t,x,w)}}}}for(var j=-m+b;j<=m-g;j+=2){var k=l+j;var E;if(j==-m||j!=m&&c[k-1]i){g+=2}else if(A>o){b+=2}else if(!h){var O=l+p-j;if(O>=0&&O=E){return u(e,t,x,w)}}}}}return[[r,e],[n,t]]}function u(e,t,r,n){var i=e.substring(0,r);var a=t.substring(0,n);var l=e.substring(r);var u=t.substring(n);var s=o(i,a);var f=o(l,u);return s.concat(f)}function s(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0)){return 0}var r=0;var n=Math.min(e.length,t.length);var i=n;var o=0;while(rt.length?e:t;var n=e.length>t.length?t:e;if(r.length<4||n.length*2=e.length){return[a,l,u,c,o]}else{return null}}var o=i(r,n,Math.ceil(r.length/4));var a=i(r,n,Math.ceil(r.length/2));var l;if(!o&&!a){return null}else if(!a){l=o}else if(!o){l=a}else{l=o[4].length>a[4].length?o:a}var u,c,d,p;if(e.length>t.length){u=l[0];c=l[1];d=l[2];p=l[3]}else{d=l[0];p=l[1];u=l[2];c=l[3]}var h=l[4];return[u,c,d,p,h]}function d(e){e.push([i,""]);var t=0;var o=0;var a=0;var l="";var u="";var c;while(t1){if(o!==0&&a!==0){c=s(u,l);if(c!==0){if(t-o-a>0&&e[t-o-a-1][0]==i){e[t-o-a-1][1]+=u.substring(0,c)}else{e.splice(0,0,[i,u.substring(0,c)]);t++}u=u.substring(c);l=l.substring(c)}c=f(u,l);if(c!==0){e[t][1]=u.substring(u.length-c)+e[t][1];u=u.substring(0,u.length-c);l=l.substring(0,l.length-c)}}if(o===0){e.splice(t-a,o+a,[n,u])}else if(a===0){e.splice(t-o,o+a,[r,l])}else{e.splice(t-o-a,o+a,[r,l],[n,u])}t=t-o-a+(o?1:0)+(a?1:0)+1}else if(t!==0&&e[t-1][0]==i){e[t-1][1]+=e[t][1];e.splice(t,1)}else{t++}a=0;o=0;l="";u="";break}}if(e[e.length-1][1]===""){e.pop()}var p=false;t=1;while(t0){n.splice(o+2,0,[l[0],u])}return b(n,o,3)}else{return e}}}function y(e){var t=false;var o=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343};var a=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319};for(var l=2;l0){u.push(e[l])}}return u}function b(e,t,r){for(var n=t+r-1;n>=0&&n>=t-1;n--){if(n+1\r?\n +\<");return this.convert()}var r=this.quill.getFormat(this.quill.selection.savedRange.index);if(r[O.default.blotName]){var n=this.container.innerText;this.container.innerHTML="";return(new s.default).insert(n,A({},O.default.blotName,r[O.default.blotName]))}var o=this.prepareMatching(),a=i(o,2),l=a[0],u=a[1];var f=F(this.container,l,u);if(D(f,"\n")&&f.ops[f.ops.length-1].attributes==null){f=f.compose((new s.default).retain(f.length()-1).delete(1))}S.log("convert",this.container.innerHTML,f);this.container.innerHTML="";return f}},{key:"dangerouslyPasteHTML",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:p.default.sources.API;if(typeof t==="string"){this.quill.setContents(this.convert(t),r);this.quill.setSelection(0,p.default.sources.SILENT)}else{var i=this.convert(r);this.quill.updateContents((new s.default).retain(t).concat(i),n);this.quill.setSelection(t+i.length(),p.default.sources.SILENT)}}},{key:"onPaste",value:function e(t){var r=this;if(t.defaultPrevented||!this.quill.isEnabled())return;var n=this.quill.getSelection();var i=(new s.default).retain(n.index);var o=this.quill.scrollingContainer.scrollTop;this.container.focus();this.quill.selection.update(p.default.sources.SILENT);setTimeout(function(){i=i.concat(r.convert()).delete(n.length);r.quill.updateContents(i,p.default.sources.USER);r.quill.setSelection(i.length()-n.length,p.default.sources.SILENT);r.quill.scrollingContainer.scrollTop=o;r.quill.focus()},1)}},{key:"prepareMatching",value:function e(){var t=this;var r=[],n=[];this.matchers.forEach(function(e){var o=i(e,2),a=o[0],l=o[1];switch(a){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:[].forEach.call(t.container.querySelectorAll(a),function(e){e[P]=e[P]||[];e[P].push(l)});break}});return[r,n]}}]);return t}(b.default);R.DEFAULTS={matchers:[],matchVisual:true};function I(e,t,r){if((typeof t==="undefined"?"undefined":n(t))==="object"){return Object.keys(t).reduce(function(e,r){return I(e,r,t[r])},e)}else{return e.reduce(function(e,n){if(n.attributes&&n.attributes[t]){return e.push(n)}else{return e.insert(n.insert,(0,l.default)({},A({},t,r),n.attributes))}},new s.default)}}function B(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function D(e,t){var r="";for(var n=e.ops.length-1;n>=0&&r.length-1}function F(e,t,r){if(e.nodeType===e.TEXT_NODE){return r.reduce(function(t,r){return r(e,t)},new s.default)}else if(e.nodeType===e.ELEMENT_NODE){return[].reduce.call(e.childNodes||[],function(n,i){var o=F(i,t,r);if(i.nodeType===e.ELEMENT_NODE){o=t.reduce(function(e,t){return t(i,e)},o);o=(i[P]||[]).reduce(function(e,t){return t(i,e)},o)}return n.concat(o)},new s.default)}else{return new s.default}}function z(e,t,r){return I(r,e,true)}function H(e,t){var r=c.default.Attributor.Attribute.keys(e);var n=c.default.Attributor.Class.keys(e);var i=c.default.Attributor.Style.keys(e);var o={};r.concat(n).concat(i).forEach(function(t){var r=c.default.query(t,c.default.Scope.ATTRIBUTE);if(r!=null){o[r.attrName]=r.value(e);if(o[r.attrName])return}r=L[t];if(r!=null&&(r.attrName===t||r.keyName===t)){o[r.attrName]=r.value(e)||undefined}r=M[t];if(r!=null&&(r.attrName===t||r.keyName===t)){r=M[t];o[r.attrName]=r.value(e)||undefined}});if(Object.keys(o).length>0){t=I(t,o)}return t}function K(e,t){var r=c.default.query(e);if(r==null)return t;if(r.prototype instanceof c.default.Embed){var n={};var i=r.value(e);if(i!=null){n[r.blotName]=i;t=(new s.default).insert(n,r.formats(e))}}else if(typeof r.formats==="function"){t=I(t,r.blotName,r.formats(e))}return t}function V(e,t){if(!D(t,"\n")){t.insert("\n")}return t}function W(){return new s.default}function Z(e,t){var r=c.default.query(e);if(r==null||r.blotName!=="list-item"||!D(t,"\n")){return t}var n=-1,i=e.parentNode;while(!i.classList.contains("ql-clipboard")){if((c.default.query(i)||{}).blotName==="list"){n+=1}i=i.parentNode}if(n<=0)return t;return t.compose((new s.default).retain(t.length()-1).retain(1,{indent:n}))}function G(e,t){if(!D(t,"\n")){if(U(e)||t.length()>0&&e.nextSibling&&U(e.nextSibling)){t.insert("\n")}}return t}function Y(e,t){if(U(e)&&e.nextElementSibling!=null&&!D(t,"\n\n")){var r=e.offsetHeight+parseFloat(B(e).marginTop)+parseFloat(B(e).marginBottom);if(e.nextElementSibling.offsetTop>e.offsetTop+r*1.5){t.insert("\n")}}return t}function $(e,t){var r={};var n=e.style||{};if(n.fontStyle&&B(e).fontStyle==="italic"){r.italic=true}if(n.fontWeight&&(B(e).fontWeight.startsWith("bold")||parseInt(B(e).fontWeight)>=700)){r.bold=true}if(Object.keys(r).length>0){t=I(t,r)}if(parseFloat(n.textIndent||0)>0){t=(new s.default).insert("\t").concat(t)}return t}function X(e,t){var r=e.data;if(e.parentNode.tagName==="O:P"){return t.insert(r.trim())}if(r.trim().length===0&&e.parentNode.classList.contains("ql-clipboard")){return t}if(!B(e.parentNode).whiteSpace.startsWith("pre")){var n=function e(t,r){r=r.replace(/[^\u00a0]/g,"");return r.length<1&&t?" ":r};r=r.replace(/\r\n/g," ").replace(/\n/g," ");r=r.replace(/\s\s+/g,n.bind(n,true));if(e.previousSibling==null&&U(e.parentNode)||e.previousSibling!=null&&U(e.previousSibling)){r=r.replace(/^\s+/,n.bind(n,false))}if(e.nextSibling==null&&U(e.parentNode)||e.nextSibling!=null&&U(e.nextSibling)){r=r.replace(/\s+$/,n.bind(n,false))}}return t.insert(r)}t.default=R;t.matchAttributor=H;t.matchBlot=K;t.matchNewline=G;t.matchSpacing=Y;t.matchText=X},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r '},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;rt.left?-10:10;var i=t.bottom+this.quill.root.scrollTop;this.root.style.left=r+n+"px";this.root.style.top=i+"px";this.root.classList.remove("ql-flip");var o=this.boundsContainer.getBoundingClientRect();var a=this.root.getBoundingClientRect();var l=0;if(a.right>o.right){l=o.right-a.right;this.root.style.left=r+l+"px"}if(a.lefto.bottom){var u=a.bottom-a.top;var s=t.bottom-t.top+u;this.root.style.top=i-s+"px";this.root.classList.add("ql-flip")}return l}},{key:"show",value:function e(){this.root.classList.remove("ql-editing");this.root.classList.remove("ql-hidden")}}]);return e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){var r=[];var n=true;var i=false;var o=undefined;try{for(var a=e[Symbol.iterator](),l;!(n=(l=a.next()).done);n=true){r.push(l.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!n&&a["return"])a["return"]()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var i=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var o=function(){function e(e,t){for(var r=0;r','','',''].join("");t.default=x},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(29);var i=re(n);var o=r(36);var a=r(38);var l=r(64);var u=r(65);var s=re(u);var f=r(66);var c=re(f);var d=r(67);var p=re(d);var h=r(37);var v=r(26);var y=r(39);var b=r(40);var g=r(56);var m=re(g);var _=r(68);var O=re(_);var x=r(27);var w=re(x);var k=r(69);var E=re(k);var j=r(70);var A=re(j);var N=r(71);var q=re(N);var T=r(72);var S=re(T);var P=r(73);var C=re(P);var L=r(13);var M=re(L);var R=r(74);var I=re(R);var B=r(75);var D=re(B);var U=r(57);var F=re(U);var z=r(41);var H=re(z);var K=r(28);var V=re(K);var W=r(59);var Z=re(W);var G=r(60);var Y=re(G);var $=r(61);var X=re($);var Q=r(108);var J=re(Q);var ee=r(62);var te=re(ee);function re(e){return e&&e.__esModule?e:{default:e}}i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":b.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":b.SizeStyle},true);i.default.register({"formats/align":o.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":l.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":y.FontClass,"formats/size":b.SizeClass,"formats/blockquote":s.default,"formats/code-block":M.default,"formats/header":c.default,"formats/list":p.default,"formats/bold":m.default,"formats/code":L.Code,"formats/italic":O.default,"formats/link":w.default,"formats/script":E.default,"formats/strike":A.default,"formats/underline":q.default,"formats/image":S.default,"formats/video":C.default,"formats/list/item":d.ListItem,"modules/formula":I.default,"modules/syntax":D.default,"modules/toolbar":F.default,"themes/bubble":J.default,"themes/snow":te.default,"ui/icons":H.default,"ui/picker":V.default,"ui/icon-picker":Y.default,"ui/color-picker":Z.default,"ui/tooltip":X.default},true);t.default=i.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.IndentClass=undefined;var n=function(){function e(e,t){for(var r=0;r0){this.children.tail.format(t,r)}}},{key:"formats",value:function e(){return d({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function e(r,n){if(r instanceof y){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,r,n)}else{var o=n==null?this.length():n.offset(this);var a=this.split(o);a.parent.insertBefore(r,a)}}},{key:"optimize",value:function e(r){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,r);var n=this.next;if(n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")){n.moveChildren(this);n.remove()}}},{key:"replace",value:function e(r){if(r.statics.blotName!==this.statics.blotName){var n=a.default.create(this.statics.defaultChild);r.moveChildren(n);this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,r)}}]);return t}(f.default);b.blotName="list";b.scope=a.default.Scope.BLOCK_BLOT;b.tagName=["OL","UL"];b.defaultChild="list-item";b.allowedChildren=[y];t.ListItem=y;t.default=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(56);var i=o(n);function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function l(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function u(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var s=function(e){u(t,e);function t(){a(this,t);return l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(i.default);s.blotName="italic";s.tagName=["EM","I"];t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r-1){if(n){this.domNode.setAttribute(r,n)}else{this.domNode.removeAttribute(r)}}else{i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,r,n)}}}],[{key:"create",value:function e(r){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);if(typeof r==="string"){n.setAttribute("src",this.sanitize(r))}return n}},{key:"formats",value:function e(t){return d.reduce(function(e,r){if(t.hasAttribute(r)){e[r]=t.getAttribute(r)}return e},{})}},{key:"match",value:function e(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function e(t){return(0,l.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function e(t){return t.getAttribute("src")}}]);return t}(a.default.Embed);p.blotName="image";p.tagName="IMG";t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e,t){for(var r=0;r-1){if(n){this.domNode.setAttribute(r,n)}else{this.domNode.removeAttribute(r)}}else{i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,r,n)}}}],[{key:"create",value:function e(r){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,r);n.setAttribute("frameborder","0");n.setAttribute("allowfullscreen",true);n.setAttribute("src",this.sanitize(r));return n}},{key:"formats",value:function e(t){return d.reduce(function(e,r){if(t.hasAttribute(r)){e[r]=t.getAttribute(r)}return e},{})}},{key:"sanitize",value:function e(t){return l.default.sanitize(t)}},{key:"value",value:function e(t){return t.getAttribute("src")}}]);return t}(o.BlockEmbed);p.blotName="video";p.className="ql-video";p.tagName="IFRAME";t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.FormulaBlot=undefined;var n=function(){function e(e,t){for(var r=0;r0||this.cachedText==null){this.domNode.innerHTML=t(r);this.domNode.normalize();this.attach()}this.cachedText=r}}}]);return t}(d.default);b.className="ql-syntax";var g=new a.default.Attributor.Class("token","hljs",{scope:a.default.Scope.INLINE});var m=function(e){y(t,e);n(t,null,[{key:"register",value:function e(){u.default.register(g,true);u.default.register(b,true)}}]);function t(e,r){h(this,t);var n=v(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));if(typeof n.options.highlight!=="function"){throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.")}var i=null;n.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i);i=setTimeout(function(){n.highlight();i=null},n.options.interval)});n.highlight();return n}n(t,[{key:"highlight",value:function e(){var t=this;if(this.quill.selection.composing)return;this.quill.update(u.default.sources.USER);var r=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)});this.quill.update(u.default.sources.SILENT);if(r!=null){this.quill.setSelection(r,u.default.sources.SILENT)}}}]);return t}(f.default);m.DEFAULTS={highlight:function(){if(window.hljs==null)return null;return function(e){var t=window.hljs.highlightAuto(e);return t.value}}(),interval:1e3};t.CodeBlock=b;t.CodeToken=g;t.default=m},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=t.BubbleTooltip=undefined;var n=function e(t,r,n){if(t===null)t=Function.prototype;var i=Object.getOwnPropertyDescriptor(t,r);if(i===undefined){var o=Object.getPrototypeOf(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in i){return i.value}else{var a=i.get;if(a===undefined){return undefined}return a.call(n)}};var i=function(){function e(e,t){for(var r=0;r0&&i===u.default.sources.USER){n.show();n.root.style.left="0px";n.root.style.width="";n.root.style.width=n.root.offsetWidth+"px";var o=n.quill.getLines(t.index,t.length);if(o.length===1){n.position(n.quill.getBounds(t))}else{var a=o[o.length-1];var l=n.quill.getIndex(a);var s=Math.min(a.length()-1,t.index+t.length-l);var f=n.quill.getBounds(new c.Range(l,s));n.position(f)}}else if(document.activeElement!==n.textbox&&n.quill.hasFocus()){n.hide()}});return n}i(t,[{key:"listen",value:function e(){var r=this;n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this);this.root.querySelector(".ql-close").addEventListener("click",function(){r.root.classList.remove("ql-editing")});this.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(r.root.classList.contains("ql-hidden"))return;var e=r.quill.getSelection();if(e!=null){r.position(r.quill.getBounds(e))}},1)})}},{key:"cancel",value:function e(){this.show()}},{key:"position",value:function e(r){var i=n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,r);var o=this.root.querySelector(".ql-tooltip-arrow");o.style.marginLeft="";if(i===0)return i;o.style.marginLeft=-1*i-o.offsetWidth/2+"px"}}]);return t}(s.BaseTooltip);_.TEMPLATE=['','
','','',"
"].join("");t.BubbleTooltip=_;t.default=m},function(e,t,r){e.exports=r(63)}])["default"]}); /* * Quill Image Drop v1.0.3 (https://github.com/kensnyder/quill-image-drop-module) * Copyright 2017 Ken Snyder diff --git a/unauthenticated/js/quill.min.js.gz b/unauthenticated/js/quill.min.js.gz new file mode 100644 index 000000000..30b0d3c65 Binary files /dev/null and b/unauthenticated/js/quill.min.js.gz differ