package.dist.quill.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quilljs Show documentation
Show all versions of quilljs Show documentation
Cross browser rich text editor
The newest version!
/*! Quill Editor v0.18.1
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.Quill=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g-1?0:-1:a?0:-1}function g(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:fb+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function h(a){var b=-1,c=a.length,d=a[0],e=a[c/2|0],f=a[c-1];if(d&&"object"==typeof d&&e&&"object"==typeof e&&f&&"object"==typeof f)return!1;var h=j();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=j();for(i.array=a,i.cache=h,i.push=g;++be?0:e);++d=gb&&d===e,j=[];if(i){var k=h(b);k?(d=f,b=k):i=!1}for(;++c-1:void 0});return e.pop(),f.pop(),s&&(k(e),k(f)),g}function w(a,b,c,d,e,f){var g=1&b,h=2&b,i=4&b,j=16&b,k=32&b;if(!h&&!E(a))throw new TypeError;j&&!c.length&&(b&=-17,j=c=!1),k&&!d.length&&(b&=-33,k=d=!1);var l=a&&a.__bindData__;if(l&&l!==!0)return l=m(l),l[2]&&(l[2]=m(l[2])),l[3]&&(l[3]=m(l[3])),!g||1&l[1]||(l[4]=e),!g&&1&l[1]&&(b|=8),!i||4&l[1]||(l[5]=f),j&&Ib.apply(l[2]||(l[2]=[]),c),k&&Jb.apply(l[3]||(l[3]=[]),d),l[1]|=b,w.apply(null,l);var n=1==b||17===b?o:s;return n([a,b,c,d,e,f])}function x(){var a=(a=n.indexOf)===R?e:a;return a}function y(a){return"function"==typeof a&&Fb.test(a)}function z(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Eb.call(a)==lb||!1}function A(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=b,b=!1),p(a,b,"function"==typeof c&&r(c,d,1))}function B(a,b){return a?Hb.call(a,b):!1}function C(a){return a&&1===a.nodeType||!1}function D(a,b,c,d){return v(a,b,"function"==typeof c&&r(c,d,2))}function E(a){return"function"==typeof a}function F(a){return!(!a||!wb[typeof a])}function G(a){return"number"==typeof a||a&&"object"==typeof a&&Eb.call(a)==qb||!1}function H(a){return"string"==typeof a||a&&"object"==typeof a&&Eb.call(a)==tb||!1}function I(a,b,c){var d={};if("function"!=typeof b){var e=[];Xb(a,function(a,b){e.push(b)}),e=t(e,u(arguments,!0,!1,1));for(var f=-1,g=e.length;++fc?Ob(0,d+c):c||0}else if(c){var f=U(a,b);return a[f]===b?f:-1}return e(a,b,c)}function S(){for(var a=[],b=-1,c=arguments.length,d=i(),g=x(),j=g===e,m=i();++b=gb&&h(b?a[b]:m)))}var o=a[0],p=-1,q=o?o.length:0,r=[];a:for(;++pe;){var g=e+f>>>1;c(a[g])2?w(a,17,m(arguments,2),null,b):w(a,1,null,null,b)}function W(a){if(!E(a))throw new TypeError;var b=m(arguments,1);return setTimeout(function(){a.apply(bb,b)},1)}function X(a){return w(a,16,m(arguments,1))}function Y(a,b,c){var d=typeof a;if(null==a||"function"==d)return r(a,b,c);if("object"!=d)return _(a);var e=Ub(a),f=e[0],g=a[f];return 1!=e.length||g!==g||F(g)?function(b){for(var c=e.length,d=!1;c--&&(d=v(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Z(a){return a}function $(){}function _(a){return function(b){return b[a]}}function ab(a){var b=++eb;return String(null==a?"":a)+b}var bb,cb=[],db=[],eb=0,fb=+new Date+"",gb=75,hb=40,ib=/\w*$/,jb=/^\s*function[ \n\r\t]+\w/,kb=/\bthis\b/,lb="[object Arguments]",mb="[object Array]",nb="[object Boolean]",ob="[object Date]",pb="[object Function]",qb="[object Number]",rb="[object Object]",sb="[object RegExp]",tb="[object String]",ub={};ub[pb]=!1,ub[lb]=ub[mb]=ub[nb]=ub[ob]=ub[qb]=ub[rb]=ub[sb]=ub[tb]=!0;var vb={configurable:!1,enumerable:!1,value:null,writable:!1},wb={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},xb=wb[typeof window]&&window||this,yb=wb[typeof d]&&d&&!d.nodeType&&d,zb=wb[typeof c]&&c&&!c.nodeType&&c,Ab=zb&&zb.exports===yb&&yb,Bb=wb[typeof b]&&b;!Bb||Bb.global!==Bb&&Bb.window!==Bb||(xb=Bb);var Cb=[],Db=Object.prototype,Eb=Db.toString,Fb=RegExp("^"+String(Eb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Gb=Function.prototype.toString,Hb=Db.hasOwnProperty,Ib=Cb.push,Jb=Cb.unshift,Kb=function(){try{var a={},b=y(b=Object.defineProperty)&&b,c=b(a,a,a)&&b}catch(d){}return c}(),Lb=y(Lb=Object.create)&&Lb,Mb=y(Mb=Array.isArray)&&Mb,Nb=y(Nb=Object.keys)&&Nb,Ob=Math.max,Pb={};Pb[mb]=Array,Pb[nb]=Boolean,Pb[ob]=Date,Pb[pb]=Function,Pb[rb]=Object,Pb[qb]=Number,Pb[sb]=RegExp,Pb[tb]=String;var Qb=n.support={};Qb.funcDecomp=!y(xb.WinRTError)&&kb.test(function(){return this}),Qb.funcNames="string"==typeof Function.name,Lb||(q=function(){function a(){}return function(b){if(F(b)){a.prototype=b;var c=new a;a.prototype=null}return c||xb.Object()}}());var Rb=Kb?function(a,b){vb.value=b,Kb(a,"__bindData__",vb)}:$,Sb=Mb||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Eb.call(a)==mb||!1},Tb=function(a){var b,c=a,d=[];if(!c)return d;if(!wb[typeof a])return d;for(b in c)Hb.call(c,b)&&d.push(b);return d},Ub=Nb?function(a){return F(a)?Nb(a):[]}:Tb,Vb=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=r(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++he;e++)a&&a.push(c._listeners[e]);return[c]}if("*"===o||"**"===o||c[o]){if("*"===o){for(h in c)"_listeners"!==h&&c.hasOwnProperty(h)&&(m=m.concat(f(a,b,c[h],d+1)));return m}if("**"===o){l=d+1===n||d+2===n&&"*"===p,l&&c._listeners&&(m=m.concat(f(a,b,c,n)));for(h in c)"_listeners"!==h&&c.hasOwnProperty(h)&&("*"===h||"**"===h?(c[h]._listeners&&!l&&(m=m.concat(f(a,b,c[h],n))),m=m.concat(f(a,b,c[h],d))):m=m.concat(h===p?f(a,b,c[h],d+2):f(a,b,c[h],d)));return m}m=m.concat(f(a,b,c[o],d+1))}if(i=c["*"],i&&f(a,b,i,d+1),j=c["**"])if(n>d){j._listeners&&f(a,b,j,n);for(h in j)"_listeners"!==h&&j.hasOwnProperty(h)&&(h===p?f(a,b,j[h],d+2):h===o?f(a,b,j[h],d+1):(k={},k[h]=j[h],f(a,b,{"**":k},d+1)))}else j._listeners?f(a,b,j,n):j["*"]&&j["*"]._listeners&&f(a,b,j["*"],n);return m}function g(a,b){a="string"==typeof a?a.split(this.delimiter):a.slice();for(var c=0,d=a.length;d>c+1;c++)if("**"===a[c]&&"**"===a[c+1])return;for(var e=this.listenerTree,f=a.shift();f;){if(e[f]||(e[f]={}),e=e[f],0===a.length){if(e._listeners){if("function"==typeof e._listeners)e._listeners=[e._listeners,b];else if(h(e._listeners)&&(e._listeners.push(b),!e._listeners.warned)){var g=i;"undefined"!=typeof this._events.maxListeners&&(g=this._events.maxListeners),g>0&&e._listeners.length>g&&(e._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",e._listeners.length),console.trace())}}else e._listeners=b;return!0}f=a.shift()}return!0}var h=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},i=10;e.prototype.delimiter=".",e.prototype.setMaxListeners=function(a){this._events||b.call(this),this._events.maxListeners=a,this._conf||(this._conf={}),this._conf.maxListeners=a},e.prototype.event="",e.prototype.once=function(a,b){return this.many(a,1,b),this},e.prototype.many=function(a,b,c){function d(){0===--b&&e.off(a,d),c.apply(this,arguments)}var e=this;if("function"!=typeof c)throw new Error("many only accepts instances of Function");return d._origin=c,this.on(a,d),e},e.prototype.emit=function(){this._events||b.call(this);var a=arguments[0];if("newListener"===a&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var c=arguments.length,d=new Array(c-1),e=1;c>e;e++)d[e-1]=arguments[e];for(e=0,c=this._all.length;c>e;e++)this.event=a,this._all[e].apply(this,d)}if("error"===a&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var g;if(this.wildcard){g=[];var h="string"==typeof a?a.split(this.delimiter):a.slice();f.call(this,g,h,this.listenerTree,0)}else g=this._events[a];if("function"==typeof g){if(this.event=a,1===arguments.length)g.call(this);else if(arguments.length>1)switch(arguments.length){case 2:g.call(this,arguments[1]);break;case 3:g.call(this,arguments[1],arguments[2]);break;default:for(var c=arguments.length,d=new Array(c-1),e=1;c>e;e++)d[e-1]=arguments[e];g.apply(this,d)}return!0}if(g){for(var c=arguments.length,d=new Array(c-1),e=1;c>e;e++)d[e-1]=arguments[e];for(var i=g.slice(),e=0,c=i.length;c>e;e++)this.event=a,i[e].apply(this,d);return i.length>0||!!this._all}return!!this._all},e.prototype.on=function(a,c){if("function"==typeof a)return this.onAny(a),this;if("function"!=typeof c)throw new Error("on only accepts instances of Function");if(this._events||b.call(this),this.emit("newListener",a,c),this.wildcard)return g.call(this,a,c),this;if(this._events[a]){if("function"==typeof this._events[a])this._events[a]=[this._events[a],c];else if(h(this._events[a])&&(this._events[a].push(c),!this._events[a].warned)){var d=i;"undefined"!=typeof this._events.maxListeners&&(d=this._events.maxListeners),d>0&&this._events[a].length>d&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),console.trace())}}else this._events[a]=c;return this},e.prototype.onAny=function(a){if("function"!=typeof a)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(a),this},e.prototype.addListener=e.prototype.on,e.prototype.off=function(a,b){if("function"!=typeof b)throw new Error("removeListener only takes instances of Function");var c,d=[];if(this.wildcard){var e="string"==typeof a?a.split(this.delimiter):a.slice();d=f.call(this,null,e,this.listenerTree,0)}else{if(!this._events[a])return this;c=this._events[a],d.push({_listeners:c})}for(var g=0;gk;k++)if(c[k]===b||c[k].listener&&c[k].listener===b||c[k]._origin&&c[k]._origin===b){j=k;break}if(0>j)continue;return this.wildcard?i._listeners.splice(j,1):this._events[a].splice(j,1),0===c.length&&(this.wildcard?delete i._listeners:delete this._events[a]),this}(c===b||c.listener&&c.listener===b||c._origin&&c._origin===b)&&(this.wildcard?delete i._listeners:delete this._events[a])}return this},e.prototype.offAny=function(a){var b,c=0,d=0;if(a&&this._all&&this._all.length>0){for(b=this._all,c=0,d=b.length;d>c;c++)if(a===b[c])return b.splice(c,1),this}else this._all=[];return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=function(a){if(0===arguments.length)return!this._events||b.call(this),this;if(this.wildcard)for(var c="string"==typeof a?a.split(this.delimiter):a.slice(),d=f.call(this,null,c,this.listenerTree,0),e=0;e0&&(c.attributes=b),this.push(c)},g.prototype["delete"]=function(a){return 0>=a?this:this.push({"delete":a})},g.prototype.retain=function(a,b){if(0>=a)return this;var c={retain:a};return d.object(b)&&Object.keys(b).length>0&&(c.attributes=b),this.push(c)},g.prototype.push=function(a){var b=this.ops.length,c=this.ops[b-1];if(a=e.clone(a),d.object(c)){if(d.number(a["delete"])&&d.number(c["delete"]))return this.ops[b-1]={"delete":c["delete"]+a["delete"]},this;if(d.number(c["delete"])&&(d.string(a.insert)||d.number(a.insert))&&(b-=1,c=this.ops[b-1],!d.object(c)))return this.ops.unshift(a),this;if(d.equal(a.attributes,c.attributes)){if(d.string(a.insert)&&d.string(c.insert))return this.ops[b-1]={insert:c.insert+a.insert},d.object(a.attributes)&&(this.ops[b-1].attributes=a.attributes),this;if(d.number(a.retain)&&d.number(c.retain))return this.ops[b-1]={retain:c.retain+a.retain},d.object(a.attributes)&&(this.ops[b-1].attributes=a.attributes),this}}return this.ops.splice(b,0,a),this},g.prototype.chop=function(){var a=this.ops[this.ops.length-1];return a&&a.retain&&!a.attributes&&this.ops.pop(),this},g.prototype.length=function(){return this.ops.reduce(function(a,b){return a+e.length(b)},0)},g.prototype.slice=function(a,b){a=a||0,d.number(b)||(b=1/0);for(var c=new g,f=e.iterator(this.ops),h=0;b>h&&f.hasNext();){var i;a>h?i=f.next(a-h):(i=f.next(b-a),c.push(i)),h+=e.length(i)}return c},g.prototype.compose=function(a){var b=e.iterator(this.ops),c=e.iterator(a.ops);for(this.ops=[];b.hasNext()||c.hasNext();)if("insert"===c.peekType())this.push(c.next());else if("delete"===b.peekType())this.push(b.next());else{var f=Math.min(b.peekLength(),c.peekLength()),g=b.next(f),h=c.next(f);if(d.number(h.retain)){var i={};d.number(g.retain)?i.retain=f:i.insert=g.insert;var j=e.attributes.compose(g.attributes,h.attributes,d.number(g.retain));j&&(i.attributes=j),this.push(i)}else d.number(h["delete"])&&d.number(g.retain)&&this.push(h)}return this.chop()},g.prototype.diff=function(a){var b=[this.ops,a.ops].map(function(b){return b.map(function(c){if(d.string(c.insert))return c.insert;if(d.number(c.insert))return f;var e=b===a.ops?"on":"with";throw new Error("diff() called "+e+" non-document")}).join("")}),h=c(b[0],b[1]),i=e.iterator(this.ops),j=e.iterator(a.ops),k=new g;return h.forEach(function(a){for(var b=a[1].length;b>0;){var d=0;switch(a[0]){case c.INSERT:d=Math.min(j.peekLength(),b),k.push(j.next(d));break;case c.DELETE:d=Math.min(b,i.peekLength()),i.next(d),k["delete"](d);break;case c.EQUAL:d=Math.min(i.peekLength(),j.peekLength(),b);var f=i.next(d),g=j.next(d);f.insert===g.insert?k.retain(d,e.attributes.diff(f.attributes,g.attributes)):k.push(g)["delete"](d)}b-=d}}),k.chop()},g.prototype.transform=function(a,b){if(b=!!b,d.number(a))return this.transformPosition(a,b);for(var c=e.iterator(this.ops),f=e.iterator(a.ops),h=new g;c.hasNext()||f.hasNext();)if("insert"!==c.peekType()||!b&&"insert"===f.peekType())if("insert"===f.peekType())h.push(f.next());else{var i=Math.min(c.peekLength(),f.peekLength()),j=c.next(i),k=f.next(i);if(j["delete"])continue;k["delete"]?h.push(k):h.retain(i,e.attributes.transform(j.attributes,k.attributes,b))}else h.retain(e.length(c.next()));return h.chop()},g.prototype.transformPosition=function(a,b){b=!!b;for(var c=e.iterator(this.ops),d=0;c.hasNext()&&a>=d;){var f=c.peekLength(),g=c.peekType();c.next(),"delete"!==g?("insert"===g&&(a>d||!b)&&(a+=f),d+=f):a-=Math.min(f,a-d)}return a},b.exports=g},{"./is":6,"./op":7,"fast-diff":9}],6:[function(a,b){b.exports={equal:function(a,b){if(a===b)return!0;if(null==a&&null==b)return!0;if(null==a||null==b)return!1;if(Object.keys(a).length!=Object.keys(b).length)return!1;for(var c in a)if(a[c]!==b[c])return!1;return!0},array:function(a){return Array.isArray(a)},number:function(a){return"number"==typeof a?!0:"object"==typeof a&&"[object Number]"===Object.prototype.toString.call(a)?!0:!1},object:function(a){return a?"function"==typeof a||"object"==typeof a:!1},string:function(a){return"string"==typeof a?!0:"object"==typeof a&&"[object String]"===Object.prototype.toString.call(a)?!0:!1}}},{}],7:[function(a,b){function c(a){this.ops=a,this.index=0,this.offset=0}var d=a("./is"),e={attributes:{clone:function(a,b){return d.object(a)?Object.keys(a).reduce(function(c,d){return void 0===a[d]||null===a[d]&&!b||(c[d]=a[d]),c},{}):{}},compose:function(a,b,c){d.object(a)||(a={}),d.object(b)||(b={});var e=this.clone(b,c);for(var f in a)void 0!==a[f]&&void 0===b[f]&&(e[f]=a[f]);return Object.keys(e).length>0?e:void 0},diff:function(a,b){d.object(a)||(a={}),d.object(b)||(b={});var c=Object.keys(a).concat(Object.keys(b)).reduce(function(c,d){return a[d]!==b[d]&&(c[d]=void 0===b[d]?null:b[d]),c},{});return Object.keys(c).length>0?c:void 0},transform:function(a,b,c){if(!d.object(a))return b;if(!d.object(b))return void 0;if(!c)return b;var e=Object.keys(b).reduce(function(c,d){return void 0===a[d]&&(c[d]=b[d]),c},{});return Object.keys(e).length>0?e:void 0}},clone:function(a){var b=this.attributes.clone(a);return d.object(b.attributes)&&(b.attributes=this.attributes.clone(b.attributes,!0)),b},iterator:function(a){return new c(a)},length:function(a){return d.number(a["delete"])?a["delete"]:d.number(a.retain)?a.retain:d.string(a.insert)?a.insert.length:1}};c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(a){a||(a=1/0);var b=this.ops[this.index];if(b){var c=this.offset,f=e.length(b);if(a>=f-c?(a=f-c,this.index+=1,this.offset=0):this.offset+=a,d.number(b["delete"]))return{"delete":a};var g={};return b.attributes&&(g.attributes=b.attributes),d.number(b.retain)?g.retain=a:g.insert=d.string(b.insert)?b.insert.substr(c,a):b.insert,g}return{retain:1/0}},c.prototype.peekLength=function(){return this.ops[this.index]?e.length(this.ops[this.index])-this.offset:1/0},c.prototype.peekType=function(){return this.ops[this.index]?d.number(this.ops[this.index]["delete"])?"delete":d.number(this.ops[this.index].retain)?"retain":"insert":"retain"},b.exports=e},{"./is":6}],8:[function(a,b){{var c=a("./delta");a("../package.json")}b.exports={Delta:c,name:"rich-text",uri:"http://sharejs.org/types/rich-text/v1",create:function(a){return new c(a)},apply:function(a,b){return a=new c(a),b=new c(b),a.compose(b)},compose:function(a,b){return a=new c(a),b=new c(b),a.compose(b)},diff:function(a,b){return a=new c(a),b=new c(b),a.diff(b)},transform:function(a,b,d){return a=new c(a),b=new c(b),b.transform(a,"left"===d)}}},{"../package.json":10,"./delta":5}],9:[function(a,b){function c(a,b){if(a==b)return a?[[m,a]]:[];var c=g(a,b),e=a.substring(0,c);a=a.substring(c),b=b.substring(c),c=h(a,b);var f=a.substring(a.length-c);a=a.substring(0,a.length-c),b=b.substring(0,b.length-c);var i=d(a,b);return e&&i.unshift([m,e]),f&&i.push([m,f]),j(i),i}function d(a,b){var d;if(!a)return[[l,b]];if(!b)return[[k,a]];var f=a.length>b.length?a:b,g=a.length>b.length?b:a,h=f.indexOf(g);if(-1!=h)return d=[[l,f.substring(0,h)],[m,g],[l,f.substring(h+g.length)]],a.length>b.length&&(d[0][0]=d[2][0]=k),d;if(1==g.length)return[[k,a],[l,b]];var j=i(a,b);if(j){var n=j[0],o=j[1],p=j[2],q=j[3],r=j[4],s=c(n,p),t=c(o,q);return s.concat([[m,r]],t)}return e(a,b)}function e(a,b){for(var c=a.length,d=b.length,e=Math.ceil((c+d)/2),g=e,h=2*e,i=new Array(h),j=new Array(h),m=0;h>m;m++)i[m]=-1,j[m]=-1;i[g+1]=0,j[g+1]=0;for(var n=c-d,o=n%2!=0,p=0,q=0,r=0,s=0,t=0;e>t;t++){for(var u=-t+p;t-q>=u;u+=2){var v,w=g+u;v=u==-t||u!=t&&i[w-1]v&&d>x&&a.charAt(v)==b.charAt(x);)v++,x++;if(i[w]=v,v>c)q+=2;else if(x>d)p+=2;else if(o){var y=g+n-u;if(y>=0&&h>y&&-1!=j[y]){var z=c-j[y];if(v>=z)return f(a,b,v,x)}}}for(var A=-t+r;t-s>=A;A+=2){var z,y=g+A;z=A==-t||A!=t&&j[y-1]z&&d>B&&a.charAt(c-z-1)==b.charAt(d-B-1);)z++,B++;if(j[y]=z,z>c)s+=2;else if(B>d)r+=2;else if(!o){var w=g+n-A;if(w>=0&&h>w&&-1!=i[w]){var v=i[w],x=g+v-w;if(z=c-z,v>=z)return f(a,b,v,x)}}}}return[[k,a],[l,b]]}function f(a,b,d,e){var f=a.substring(0,d),g=b.substring(0,e),h=a.substring(d),i=b.substring(e),j=c(f,g),k=c(h,i);return j.concat(k)}function g(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;e>c;)a.substring(f,e)==b.substring(f,e)?(c=e,f=c):d=e,e=Math.floor((d-c)/2+c);return e}function h(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;e>c;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?(c=e,f=c):d=e,e=Math.floor((d-c)/2+c);return e}function i(a,b){function c(a,b,c){for(var d,e,f,i,j=a.substring(c,c+Math.floor(a.length/4)),k=-1,l="";-1!=(k=b.indexOf(j,k+1));){var m=g(a.substring(c),b.substring(k)),n=h(a.substring(0,c),b.substring(0,k));l.length=a.length?[d,e,f,i,l]:null}var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(d.length<4||2*e.lengthj[4].length?i:j:i;var k,l,m,n;a.length>b.length?(k=f[0],l=f[1],m=f[2],n=f[3]):(m=f[0],n=f[1],k=f[2],l=f[3]);var o=f[4];return[k,l,m,n,o]}function j(a){a.push([m,""]);for(var b,c=0,d=0,e=0,f="",i="";c1?(0!==d&&0!==e&&(b=g(i,f),0!==b&&(c-d-e>0&&a[c-d-e-1][0]==m?a[c-d-e-1][1]+=i.substring(0,b):(a.splice(0,0,[m,i.substring(0,b)]),c++),i=i.substring(b),f=f.substring(b)),b=h(i,f),0!==b&&(a[c][1]=i.substring(i.length-b)+a[c][1],i=i.substring(0,i.length-b),f=f.substring(0,f.length-b))),0===d?a.splice(c-e,d+e,[l,i]):0===e?a.splice(c-d,d+e,[k,f]):a.splice(c-d-e,d+e,[k,f],[l,i]),c=c-d-e+(d?1:0)+(e?1:0)+1):0!==c&&a[c-1][0]==m?(a[c-1][1]+=a[c][1],a.splice(c,1)):c++,e=0,d=0,f="",i=""}""===a[a.length-1][1]&&a.pop();var n=!1;for(c=1;c=0.10"},license:"MIT",scripts:{test:"grunt test"},repository:{type:"git",url:"https://github.com/ottypes/rich-text"},bugs:{url:"https://github.com/ottypes/rich-text/issues"},keywords:["rich text","ot","operational transform","delta"],readme:"# Rich Text [![Build Status](https://travis-ci.org/ottypes/rich-text.svg?branch=master)](http://travis-ci.org/ottypes/rich-text) [![Coverage Status](https://img.shields.io/coveralls/ottypes/rich-text.svg)](https://coveralls.io/r/ottypes/rich-text)\n\nA format for representing rich text documents and changes. It aimes to be intuitive and human readable with the ability to express any change necessary to deal with rich text. A document can also be expressed with this format--as the change from an empty document.\n\n## Quick Example\n\n```js\nvar delta = new Delta([\n { insert: 'Gandalf', attributes: { bold: true } },\n { insert: ' the ' },\n { insert: 'Grey', attributes: { color: '#ccc' } }\n]);\n\n// Keep the first 12 characters, delete the next 4, and insert a white 'White'\nvar death = new Delta().retain(12)\n .delete(4)\n .insert('White', { color: '#fff' });\n// this produces:\n// {\n// ops: [\n// { retain: 12 },\n// { delete: '4 ' },\n// { insert: 'White', attributes: { color: '#fff' } }\n// ]\n// }\n\ndelta.compose(death);\n// delta is now:\n// {\n// ops: [\n// { insert: 'Gandalf ', attributes: { bold: true } },\n// { insert: 'the ' },\n// { insert: 'White', attributes: { color: '#fff' } }\n// ]\n// }\n\n```\n\nThis format is suitable for [Operational Transform](https://en.wikipedia.org/wiki/Operational_transformation) and defines several functions to support this use case.\n\n## Contents\n\n#### [Operations](#operations-1)\n\n- [insert](#insert-operation)\n- [delete](#delete-operation)\n- [retain](#retain-operation)\n\n#### [Deltas](#deltas-1)\n\n- [`constructor`](#constructor)\n- [`insert`](#insert)\n- [`delete`](#delete)\n- [`retain`](#retain)\n- [`length`](#length)\n- [`slice`](#slice)\n- [`compose`](#compose)\n- [`transform`](#transform)\n\n#### [Documents](#documents-1)\n\n- [`diff`](#diff)\n\n\n## Operations\n\nOperations describe a singular change to a document. They can be an [`insert`](#insert-operation), [`delete`](#delete-operation) or [`retain`](#retain-operation). Note operations do not take an index. They always describe the change at the current index. Use retains to \"keep\" or \"skip\" certain parts of the document.\n\n### Insert Operation\n\nInsert operations have an `insert` key defined. A String value represents inserting text. A Number value represents inserting an embed, with the value corresponding to an embed type (such as an image or video).\n\nHere we will use 1 to represent images and 2 to represent videos, but your application can choose whatever mapping is convenient.\n\nIn both cases of text and embeds, an optional `attributes` key can be defined with an Object to describe additonal formatting information. Formats can be changed by the [retain](#retain) operation.\n\n```js\n// Insert a bolded \"Text\"\n{ insert: \"Text\", attributes: { bold: true } }\n\n// Insert a link\n{ insert: \"Google\", attributes: { href: 'https://www.google.com' } }\n\n// Insert an image\n{\n insert: 1,\n attributes: {\n alt: \"Lab Octocat\",\n src: 'https://octodex.github.com/images/labtocat.png'\n }\n}\n\n// Insert a video\n{\n insert: 2,\n attributes: {\n src: \"https://www.youtube.com/watch?v=dMH0bHeiRNg\",\n width: 420,\n height: 315\n }\n}\n```\n\n### Delete Operation\n\nDelete operations have a Number `delete` key defined representing the number of characters to delete. All embeds have a length of 1.\n\n```js\n// Delete the next 10 characters\n{ delete: 10 }\n```\n\n### Retain Operation\n\nRetain operations have a Number `retain` key defined representing the number of characters to keep (other libraries might use the name keep or skip). An optional `attributes` key can be defined with an Object to describe formatting changes to the character range. A value of null in the `attributes` Object represents removal of that key.\n\n*Note: It is not necessary to retain the last characters of a document as this is implied.*\n\n```js\n// Keep the next 5 characters\n{ retain: 5 }\n\n// Keep and bold the next 5 characters\n{ retain: 5, attributes: { bold: true } }\n\n// Keep and unbold the next 5 characters\n// More specifically, remove the bold key in the attributes Object\n// in the next 5 characters\n{ retain: 5, attributes: { bold: null } }\n```\n\n\n## Deltas\n\nA Delta is made up of an array of operations. Unless otherwise specified all methods are self modifying and return `this` for chainability.\n\nAll methods also maintain the property that Deltas are represented in the most compact form. For example two consecutive insert operations of plain text will be merged into one.\n\n---\n\n### constructor\n\nCreates a new Delta object.\n\n#### Methods\n\n- `new Delta()`\n- `new Delta(ops)`\n- `new Delta(delta)`\n\n#### Parameters\n\n- `ops` - Array of operations\n- `delta` - Object with an `ops` key set to an array of operations\n\n*Note: No validity/sanity check is performed when constructed with ops or delta. The new delta's internal ops array will also be assigned to ops or delta.ops without deep copying.*\n\n#### Example\n\n```js\nvar delta = new Delta([\n { insert: 'Hello World' },\n { insert: '!', attributes: { bold: true }}\n]);\n\nvar packet = JSON.stringify(delta);\n\nvar other = new Delta(JSON.parse(packet));\n\nvar chained = new Delta().insert('Hello World').insert('!', { bold: true });\n```\n\n---\n\n### insert()\n\nAppends an insert operation.\n\n#### Methods\n\n- `insert(text, attributes)`\n- `insert(embed, attributes)`\n\n#### Parameters\n\n- `text` - String representing text to insert\n- `embed` - Number representing embed type to insert\n- `attributes` - Optional attributes to apply\n\n#### Example\n\n```js\ndelta.insert('Text', { bold: true, color: '#ccc' });\ndelta.insert(1, { src: 'https://octodex.github.com/images/labtocat.png' });\n```\n\n---\n\n### delete()\n\nAppends a delete operation.\n\n#### Methods\n\n- `delete(length)`\n\n#### Parameters\n\n- `length` - Number of characters to delete\n\n#### Example\n\n```js\ndelta.delete(5);\n```\n\n---\n\n### retain()\n\nAppends a retain operation.\n\n#### Methods\n\n- `retain(length, attributes)`\n\n#### Parameters\n\n- `length` - Number of characters to retain\n- `attributes` - Optional attributes to apply\n\n#### Example\n\n```js\ndelta.retain(4).retain(5, { color: '#0c6' });\n```\n\n---\n\n### length()\n\nReturns length of Delta.\n\n#### Methods\n\n- `length()`\n\n#### Example\n\n```js\nnew Delta().insert('Hello').length(); // Returns 5\n\nnew Delta().insert('A').retain(2).delete(1) // Returns 4\n```\n\n---\n\n### slice()\n\nReturns copy of delta with subset of operations.\n\n#### Methods\n\n- `slice()`\n- `slice(start)`\n- `slice(start, end)`\n\n#### Parameters\n\n- `start` - Start index of subset, defaults to 0\n- `end` - End index of subset, defaults to rest of operations\n\n#### Example\n\n```js\nvar delta = new Delta().insert('Hello', { bold: true }).insert(' World');\n\n// {\n// ops: [\n// { insert: 'Hello', attributes: { bold: true } },\n// { insert: ' World' }\n// ]\n// }\nvar copy = delta.slice();\n\n// { ops: [{ insert: 'World' }] }\nvar world = delta.slice(6);\n\n// { ops: [{ insert: ' ' }] }\nvar space = delta.slice(5, 6);\n```\n\n---\n\n### compose()\n\nCompose with another Delta, i.e. merge the operations of another Delta. This method is self modifying.\n\n#### Methods\n\n- `compose(other)`\n\n#### Parameters\n\n- `other` - Delta to compose\n\n#### Example\n\n```js\nvar a = new Delta().insert('abc');\nvar b = new Delta().retain(1).delete(1);\n\na.compose(b); // a == new Delta().insert('ac');\n```\n\n### transform()\n\nTransform given Delta against own operations.\n\n#### Methods\n\n- `transform(other, priority)`\n- `transform(index)` - Alias for [`transformPosition`](#tranformposition)\n\n#### Parameters\n\n- `other` - Delta to transform\n- `priority` - Boolean used to break ties\n\n#### Returns\n\n- `Delta` - transformed Delta\n\n#### Example\n\n```js\nvar a = new Delta().insert('a');\nvar b = new Delta().insert('b');\n\nb = a.transform(b, true); // new Delta().retain(1).insert('b');\n```\n\n---\n\n### transformPosition()\n\nTransform an index against the delta. Useful for representing cursor/selection positions.\n\n#### Methods\n\n- `transformPosition(index)`\n\n#### Parameters\n\n- `index` - index to transform\n\n#### Returns\n\n- `Number` - transformed index\n\n#### Example\n\n```js\nvar index = 12;\nvar transformedIndex = delta.transformPosition(index);\n```\n\n\n## Documents\n\nA Delta with only insert operations can be used to represent a rich text document. This can be thought of as a Delta applied to an empty document.\n\n---\n\n### diff()\n\nCalculates the difference between two documents expressed as a Delta.\n\n#### Methods\n\n- `diff(other)`\n\n#### Parameters\n\n- `other` - Document Delta to diff against\n\n#### Returns\n\n- `Delta` - difference between the two documents\n\n#### Example\n\n```js\nvar a = new Delta().insert('Hello');\nvar b = new Delta().insert('Hello!');\n\nvar diff = a.diff(b); // { ops: [{ retain: 5 }, { insert: '!' }] }\n```\n",readmeFilename:"README.md",_id:"[email protected]",_from:"rich-text@~1.0.2"}
},{}],11:[function(a,b){b.exports={name:"quilljs",version:"0.18.1",description:"Cross browser rich text editor",author:"Jason Chen ",homepage:"http://quilljs.com",contributors:["Byron Milligan ","Keegan Poppen "],main:"index.js",dependencies:{eventemitter2:"~0.4.13",lodash:"~2.4.1","rich-text":"~1.0.2"},devDependencies:{async:"~0.9.0","coffee-script":"~1.8.0",coffeeify:"~0.7.0",glob:"~4.0.4",grunt:"~0.4.3","grunt-browserify":"~2.1.0","grunt-contrib-clean":"~0.6.0","grunt-contrib-coffee":"~0.12.0","grunt-contrib-compress":"~0.12.0","grunt-contrib-concat":"~0.5.0","grunt-contrib-connect":"~0.8.0","grunt-contrib-copy":"~0.7.0","grunt-contrib-stylus":"~0.18.0","grunt-contrib-uglify":"~0.6.0","grunt-karma":"~0.9.0","grunt-lodash":"~0.3.0","grunt-protractor-runner":"~1.1.0","grunt-sauce-connect-launcher":"~0.3.0",harp:"~0.14.0",istanbul:"~0.3.0",jquery:"~2.1.1",karma:"~0.12.0","karma-chrome-launcher":"~0.1.2","karma-coffee-preprocessor":"~0.2.1","karma-coverage":"~0.2.0","karma-firefox-launcher":"~0.1.3","karma-html2js-preprocessor":"~0.1.0","karma-jasmine":"~0.2.0","karma-phantomjs-launcher":"~0.1.2","karma-safari-launcher":"~0.1.1","karma-sauce-launcher":"~0.2.2","load-grunt-tasks":"~0.6.0",protractor:"~1.3.1",stylus:"~0.49.2",watchify:"~0.10.2"},engines:{node:">=0.10"},license:"BSD-3-Clause",repository:{type:"git",url:"https://github.com/quilljs/quill"},bugs:{url:"https://github.com/quilljs/quill/issues"},scripts:{prepublish:"grunt coffee:quill",postpublish:"grunt clean:coffee",test:"grunt test"},keywords:["editor","rich text","wysiwyg"]}},{}],12:[function(a,b){var c,d,e,f,g,h,i,j;j=a("lodash"),c=a("rich-text").Delta,i=a("../lib/dom"),e=a("./format"),f=a("./line"),g=a("../lib/linked-list"),h=a("../lib/normalizer"),d=function(){function a(a,b){this.root=a,null==b&&(b={}),this.formats={},j.each(b.formats,j.bind(this.addFormat,this)),this.setHTML(this.root.innerHTML)}return a.prototype.addFormat=function(a,b){return j.isObject(b)||(b=e.FORMATS[a]),null!=this.formats[a]&&console.warn("Overwriting format",a,this.formats[a]),this.formats[a]=new e(this.root.ownerDocument,b)},a.prototype.appendLine=function(a){return this.insertLineBefore(a,null)},a.prototype.findLeafAt=function(a,b){var c,d,e;return e=this.findLineAt(a),c=e[0],d=e[1],null!=c?c.findLeafAt(d,b):[null,d]},a.prototype.findLine=function(a){for(var b;null!=a&&null==i.BLOCK_TAGS[a.tagName];)a=a.parentNode;return b=null!=a?this.lineMap[a.id]:null,(null!=b?b.node:void 0)===a?b:null},a.prototype.findLineAt=function(a){var b,c;if(!(this.lines.length>0))return[null,a];if(c=this.toDelta().length(),a===c)return[this.lines.last,this.lines.last.length];if(a>c)return[null,a-c];for(b=this.lines.first;null!=b;){if(a1&&(1===a.length&&i(a.leaves.last.node).remove(),j.each(i(b.node).childNodes(),function(b){return b.tagName!==i.DEFAULT_BREAK_TAG?a.node.appendChild(b):void 0})),this.removeLine(b),a.rebuild()},a.prototype.optimizeLines=function(){return j.each(this.lines.toArray(),function(a){return a.optimize(),!0})},a.prototype.rebuild=function(){var a,b,c;for(b=this.lines.toArray(),a=this.root.firstChild,null!=a&&null!=i.LIST_TAGS[a.tagName]&&(a=a.firstChild),j.each(b,function(b){return function(c){for(var d,e;c.node!==a;){if(c.node.parentNode!==b.root&&(null!=(e=c.node.parentNode)?e.parentNode:void 0)!==b.root)return b.removeLine(c);a=h.normalizeLine(a),d=b.insertLineBefore(a,c),a=i(a).nextLineNode(b.root)}return c.outerHTML!==a.outerHTML&&(c.node=h.normalizeLine(c.node),c.rebuild()),a=i(a).nextLineNode(b.root)}}(this)),c=[];null!=a;)a=h.normalizeLine(a),this.appendLine(a),c.push(a=i(a).nextLineNode(this.root));return c},a.prototype.removeLine=function(a){return null!=a.node.parentNode&&(i.LIST_TAGS[a.node.parentNode.tagName]&&1===a.node.parentNode.childNodes.length?i(a.node.parentNode).remove():i(a.node).remove()),delete this.lineMap[a.id],this.lines.remove(a)},a.prototype.setHTML=function(a){return a=h.stripComments(a),a=h.stripWhitespace(a),this.root.innerHTML=a,this.lines=new g,this.lineMap={},this.rebuild()},a.prototype.splitLine=function(a,b){var c,d,e,f;return b=Math.min(b,a.length-1),f=i(a.node).split(b,!0),c=f[0],d=f[1],a.node=c,a.rebuild(),e=this.insertLineBefore(d,a.next),e.formats=j.clone(a.formats),e.resetContent(),e},a.prototype.toDelta=function(){var a,b;return b=this.lines.toArray(),a=new c,b.forEach(function(b){return b.delta.ops.forEach(function(b){return a.push(b)})}),a},a}(),b.exports=d},{"../lib/dom":21,"../lib/linked-list":22,"../lib/normalizer":23,"./format":14,"./line":16,lodash:"M4+//f","rich-text":4}],13:[function(a,b){var c,d,e,f,g,h,i;i=a("lodash"),h=a("../lib/dom"),c=a("./document"),e=a("./line"),f=a("./renderer"),g=a("./selection"),d=function(){function a(a,b,d){this.iframeContainer=a,this.quill=b,this.options=null!=d?d:{},this.renderer=new f(this.iframeContainer,this.options),h(this.iframeContainer).on("focus",this.focus.bind(this)),this.root=this.renderer.root,this.doc=new c(this.root,this.options),this.delta=this.doc.toDelta(),this.selection=new g(this.doc,this.renderer.iframe,this.quill),this.timer=setInterval(i.bind(this.checkUpdate,this),this.options.pollInterval),this.options.readOnly||this.enable()}return a.sources={API:"api",SILENT:"silent",USER:"user"},a.prototype.disable=function(){return this.enable(!1)},a.prototype.enable=function(a){return null==a&&(a=!0),this.root.setAttribute("contenteditable",a)},a.prototype.applyDelta=function(b,c){var d;return d=this._update(),d&&(b=d.transform(b,!0),d=b.transform(d,!1)),b.ops.length>0&&(b=this._trackDelta(function(a){return function(){var c;return c=0,i.each(b.ops,function(b){return i.isString(b.insert)?(a._insertAt(c,b.insert,b.attributes),c+=b.insert.length):i.isNumber(b.insert)?(a._insertAt(c,h.EMBED_TEXT,b.attributes),c+=1):i.isNumber(b["delete"])?a._deleteAt(c,b["delete"]):i.isNumber(b.retain)?(i.each(b.attributes,function(d,e){return a._formatAt(c,b.retain,e,d)}),c+=b.retain):void 0}),a.selection.shiftAfter(0,0,i.bind(a.doc.optimizeLines,a.doc))}}(this)),this.delta=this.doc.toDelta(),this.innerHTML=this.root.innerHTML,b&&c!==a.sources.SILENT&&this.quill.emit(this.quill.constructor.events.TEXT_CHANGE,b,c)),d&&d.ops.length>0&&c!==a.sources.SILENT?this.quill.emit(this.quill.constructor.events.TEXT_CHANGE,d,a.sources.USER):void 0},a.prototype.checkUpdate=function(b){var c;return null==b&&(b="user"),null==this.renderer.iframe.parentNode||null==this.root.parentNode?clearInterval(this.timer):(c=this._update(),c&&(this.delta.compose(c),this.quill.emit(this.quill.constructor.events.TEXT_CHANGE,c,b)),c&&(b=a.sources.SILENT),this.selection.update(b))},a.prototype.focus=function(){return h.isIE(11)&&this.selection.setRange(this.selection.range),h.isIOS()&&this.renderer.iframe.focus(),this.root.focus()},a.prototype.getDelta=function(){return this.delta},a.prototype._deleteAt=function(a,b){return 0>=b?void 0:this.selection.shiftAfter(a,-1*b,function(c){return function(){var d,e,f,g,h,i,j;for(j=c.doc.findLineAt(a),f=j[0],i=j[1],d=f,g=f.length-i<=b&&i>0;null!=d&&b>0;)h=d.next,e=Math.min(d.length-i,b),0===i&&b>=d.length?c.doc.removeLine(d):d.deleteText(i,e),b-=e,d=h,i=0;return g&&f.next?c.doc.mergeLines(f,f.next):void 0}}(this))},a.prototype._formatAt=function(a,b,c,d){return this.selection.shiftAfter(a,0,function(e){return function(){var f,g,h,i,j;for(i=e.doc.findLineAt(a),g=i[0],h=i[1],j=[];null!=g&&b>0;)f=Math.min(b,g.length-h-1),g.formatText(h,f,c,d),b-=f,b>0&&g.format(c,d),b-=1,h=0,j.push(g=g.next);return j}}(this))},a.prototype._insertAt=function(a,b,c){return null==c&&(c={}),this.selection.shiftAfter(a,b.length,function(d){return function(){var e,f,g,j;return b=b.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),f=b.split("\n"),j=d.doc.findLineAt(a),e=j[0],g=j[1],i.each(f,function(a,b){var j;return null==e||e.length<=g?(b0)&&(e=d.doc.appendLine(d.root.ownerDocument.createElement(h.DEFAULT_BLOCK_TAG)),g=0,e.insertText(g,a,c),e.format(c),j=null):(e.insertText(g,a,c),b0?a:!1)},a}(),b.exports=d},{"../lib/dom":21,"./document":12,"./line":16,"./renderer":17,"./selection":18,lodash:"M4+//f"}],14:[function(a,b){var c,d,e;e=a("lodash"),d=a("../lib/dom"),c=function(){function a(a,b){this.document=a,this.config=b}return a.types={LINE:"line"},a.FORMATS={bold:{tag:"B",prepare:"bold"},italic:{tag:"I",prepare:"italic"},underline:{tag:"U",prepare:"underline"},strike:{tag:"S",prepare:"strikeThrough"},color:{style:"color","default":"rgb(0, 0, 0)",prepare:"foreColor"},background:{style:"backgroundColor","default":"rgb(255, 255, 255)",prepare:"backColor"},font:{style:"fontFamily","default":"'Helvetica', 'Arial', sans-serif",prepare:"fontName"},size:{style:"fontSize","default":"13px",prepare:function(a,b){return a.execCommand("fontSize",!1,d.convertFontSize(b))}},link:{tag:"A",attribute:"href"},image:{tag:"IMG",attribute:"src"},align:{type:a.types.LINE,style:"textAlign","default":"left"},bullet:{type:a.types.LINE,exclude:"list",parentTag:"UL",tag:"LI"},list:{type:a.types.LINE,exclude:"bullet",parentTag:"OL",tag:"LI"}},a.prototype.add=function(b,c){var f,g,h,i,j;return c?this.value(b)===c?b:(e.isString(this.config.parentTag)&&(h=this.document.createElement(this.config.parentTag),d(b).wrap(h),b.parentNode.tagName===(null!=(i=b.parentNode.previousSibling)?i.tagName:void 0)&&d(b.parentNode.previousSibling).merge(b.parentNode),b.parentNode.tagName===(null!=(j=b.parentNode.nextSibling)?j.tagName:void 0)&&d(b.parentNode).merge(b.parentNode.nextSibling)),e.isString(this.config.tag)&&(f=this.document.createElement(this.config.tag),null!=d.VOID_TAGS[f.tagName]?(null!=b.parentNode&&d(b).replace(f),b=f):this.isType(a.types.LINE)?b=d(b).switchTag(this.config.tag):(d(b).wrap(f),b=f)),(e.isString(this.config.style)||e.isString(this.config.attribute)||e.isString(this.config["class"]))&&(e.isString(this.config["class"])&&(b=this.remove(b)),d(b).isTextNode()&&(g=this.document.createElement(d.DEFAULT_INLINE_TAG),d(b).wrap(g),b=g),e.isString(this.config.style)&&c!==this.config["default"]&&(b.style[this.config.style]=c),e.isString(this.config.attribute)&&b.setAttribute(this.config.attribute,c),e.isString(this.config["class"])&&d(b).addClass(this.config["class"]+c)),b):this.remove(b)},a.prototype.isType=function(a){return a===this.config.type},a.prototype.match=function(a){var b,c,f,g,h;if(!d(a).isElement())return!1;if(e.isString(this.config.parentTag)&&(null!=(g=a.parentNode)?g.tagName:void 0)!==this.config.parentTag)return!1;if(e.isString(this.config.tag)&&a.tagName!==this.config.tag)return!1;if(e.isString(this.config.style)&&(!a.style[this.config.style]||a.style[this.config.style]===this.config["default"]))return!1;if(e.isString(this.config.attribute)&&!a.hasAttribute(this.config.attribute))return!1;if(e.isString(this.config["class"])){for(h=d(a).classes(),c=0,f=h.length;f>c;c++)if(b=h[c],0===b.indexOf(this.config["class"]))return!0;return!1}return!0},a.prototype.prepare=function(a){return e.isString(this.config.prepare)?this.document.execCommand(this.config.prepare,!1,a):e.isFunction(this.config.prepare)?this.config.prepare(this.document,a):void 0},a.prototype.remove=function(b){var c,f,g,h;if(!this.match(b))return b;if(e.isString(this.config.style)&&(b.style[this.config.style]="",b.getAttribute("style")||b.removeAttribute("style")),e.isString(this.config.attribute)&&b.removeAttribute(this.config.attribute),e.isString(this.config["class"])){for(h=d(b).classes(),f=0,g=h.length;g>f;f++)c=h[f],0===c.indexOf(this.config["class"])&&d(b).removeClass(c);b.getAttribute("class")||b.removeAttribute("class")}return e.isString(this.config.tag)&&(this.isType(a.types.LINE)?(e.isString(this.config.parentTag)&&(null!=b.previousSibling&&d(b).splitAncestors(b.parentNode.parentNode),null!=b.nextSibling&&d(b.nextSibling).splitAncestors(b.parentNode.parentNode)),b=d(b).switchTag(d.DEFAULT_BLOCK_TAG)):(b=d(b).switchTag(d.DEFAULT_INLINE_TAG),null!=d.EMBED_TAGS[this.config.tag]&&d(b).text(d.EMBED_TEXT))),e.isString(this.config.parentTag)&&d(b.parentNode).unwrap(),b.tagName!==d.DEFAULT_INLINE_TAG||b.hasAttributes()||(b=d(b).unwrap()),b},a.prototype.value=function(a){var b,c,f,g;if(!this.match(a))return void 0;if(e.isString(this.config.attribute))return a.getAttribute(this.config.attribute)||void 0;if(e.isString(this.config.style))return a.style[this.config.style]||void 0;if(e.isString(this.config["class"])){for(g=d(a).classes(),c=0,f=g.length;f>c;c++)if(b=g[c],0===b.indexOf(this.config["class"]))return b.slice(this.config["class"].length)}else if(e.isString(this.config.tag))return!0;return void 0},a}(),b.exports=c},{"../lib/dom":21,lodash:"M4+//f"}],15:[function(a,b){var c,d,e,f,g,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};g=a("lodash"),f=a("../lib/dom"),c=a("./format"),e=a("../lib/linked-list"),d=function(a){function b(a,c){this.node=a,this.formats=g.clone(c),this.id=g.uniqueId(b.ID_PREFIX),this.text=f(this.node).text(),this.length=this.text.length}return i(b,a),b.ID_PREFIX="leaf-",b.isLeafNode=function(a){return f(a).isTextNode()||null==a.firstChild},b.prototype.deleteText=function(a,b){var c;if(b>0)return this.text=this.text.slice(0,a)+this.text.slice(a+b),this.length=this.text.length,null!=f.EMBED_TAGS[this.node.tagName]?(c=this.node.ownerDocument.createTextNode(this.text),this.node=f(this.node).replace(c)):f(this.node).text(this.text)},b.prototype.insertText=function(a,b){var c;return this.text=this.text.slice(0,a)+b+this.text.slice(a),f(this.node).isTextNode()?f(this.node).text(this.text):(c=this.node.ownerDocument.createTextNode(b),this.node.tagName===f.DEFAULT_BREAK_TAG?this.node=f(this.node).replace(c):(this.node.appendChild(c),this.node=c)),this.length=this.text.length},b}(e.Node),b.exports=d},{"../lib/dom":21,"../lib/linked-list":22,"./format":14,lodash:"M4+//f"}],16:[function(a,b){var c,d,e,f,g,h,i,j,k={}.hasOwnProperty,l=function(a,b){function c(){this.constructor=a}for(var d in b)k.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};j=a("lodash"),c=a("rich-text").Delta,i=a("../lib/dom"),d=a("./format"),e=a("./leaf"),f=a("./line"),g=a("../lib/linked-list"),h=a("../lib/normalizer"),f=function(a){function b(a,c){this.doc=a,this.node=c,this.id=j.uniqueId(b.ID_PREFIX),this.formats={},i(this.node).addClass(b.CLASS_NAME),this.rebuild(),b.__super__.constructor.call(this,this.node)}return l(b,a),b.CLASS_NAME="line",b.ID_PREFIX="line-",b.prototype.buildLeaves=function(a,b){return j.each(i(a).childNodes(),function(a){return function(c){var f;return c=h.normalizeNode(c),f=j.clone(b),j.each(a.doc.formats,function(a,b){return!a.isType(d.types.LINE)&&a.match(c)?f[b]=a.value(c):void 0}),e.isLeafNode(c)?a.leaves.append(new e(c,f)):a.buildLeaves(c,f)}}(this))},b.prototype.deleteText=function(a,b){var c,d,e;if(b>0){for(e=this.findLeafAt(a),d=e[0],a=e[1];null!=d&&b>0;)c=Math.min(b,d.length-a),d.deleteText(a,c),b-=c,d=d.next,a=0;return this.rebuild()}},b.prototype.findLeaf=function(a){var b;for(b=this.leaves.first;null!=b;){if(b.node===a)return b;b=b.next}return null},b.prototype.findLeafAt=function(a,b){var c;if(null==b&&(b=!1),a>=this.length-1)return[this.leaves.last,this.leaves.last.length];for(c=this.leaves.first;null!=c;){if(a0;){if(k=g.next,e&&g.formats[c]!==e||!e&&null!=g.formats[c]){if(m=g.node,null!=g.formats[c])for(i(m).splitAncestors(this.node);!f.match(m);)m=m.parentNode;h>0&&(o=i(m).split(h),j=o[0],m=o[1]),g.length>h+b&&(p=i(m).split(b),m=p[0],l=p[1]),f.add(m,e)}b-=g.length-h,h=0,g=k}return this.rebuild()}},b.prototype.insertText=function(a,b,c){var d,e,f,g,h,k,l;return null==c&&(c={}),b.length>0?(k=this.findLeafAt(a),d=k[0],e=k[1],j.isEqual(d.formats,c)?(d.insertText(e,b),this.resetContent()):(g=j.reduce(c,function(a){return function(b,c,d){return a.doc.formats[d].add(b,c)}}(this),this.node.ownerDocument.createTextNode(b)),l=i(d.node).split(e),h=l[0],f=l[1],f&&(f=i(f).splitAncestors(this.node).get()),this.node.insertBefore(g,f),this.rebuild())):void 0},b.prototype.optimize=function(){return h.optimizeLine(this.node),this.rebuild()},b.prototype.rebuild=function(a){return null==a&&(a=!1),!a&&null!=this.outerHTML&&this.outerHTML===this.node.outerHTML&&j.all(this.leaves.toArray(),function(a){return function(b){return i(b.node).isAncestor(a.node)}}(this))?!1:(this.node=h.normalizeNode(this.node),0!==i(this.node).length()||this.node.querySelector(i.DEFAULT_BREAK_TAG)||this.node.appendChild(this.node.ownerDocument.createElement(i.DEFAULT_BREAK_TAG)),this.leaves=new g,this.formats=j.reduce(this.doc.formats,function(a){return function(b,c,e){return c.isType(d.types.LINE)&&(c.match(a.node)?b[e]=c.value(a.node):delete b[e]),b}}(this),this.formats),this.buildLeaves(this.node,{}),this.resetContent(),!0)},b.prototype.resetContent=function(){return this.node.id!==this.id&&(this.node.id=this.id),this.outerHTML=this.node.outerHTML,this.length=1,this.delta=new c,this.leaves.toArray().forEach(function(a){return function(b){return a.length+=b.length,null!=i.EMBED_TAGS[b.node.tagName]?a.delta.insert(1,b.formats):a.delta.insert(b.text,b.formats)}}(this)),this.delta.insert("\n",this.formats)},b}(g.Node),b.exports=f},{"../lib/dom":21,"../lib/linked-list":22,"../lib/normalizer":23,"./format":14,"./leaf":15,"./line":16,lodash:"M4+//f","rich-text":4}],17:[function(a,b){var c,d,e,f,g,h,i;i=a("lodash"),g=a("../lib/dom"),e=a("../lib/normalizer"),c={html:{height:"100%",width:"100%"},body:{"box-sizing":"border-box",cursor:"text","font-family":"'Helvetica', 'Arial', sans-serif","font-size":"13px",height:"100%","line-height":"1.42",margin:"0px","overflow-x":"hidden","overflow-y":"auto",padding:"12px 15px"},".editor-container":{height:"100%",outline:"none",position:"relative","tab-size":"4","white-space":"pre-wrap"},".editor-container div":{margin:"0",padding:"0"},".editor-container a":{"text-decoration":"underline"},".editor-container b":{"font-weight":"bold"},".editor-container i":{"font-style":"italic"},".editor-container s":{"text-decoration":"line-through"},".editor-container u":{"text-decoration":"underline"},".editor-container img":{"max-width":"100%"},".editor-container blockquote":{margin:"0 0 0 2em",padding:"0"},".editor-container ol":{margin:"0 0 0 2em",padding:"0","list-style-type":"decimal"},".editor-container ul":{margin:"0 0 0 2em",padding:"0","list-style-type":"disc"}},d=["decimal","lower-alpha","lower-roman"],h=".editor-container ol > li",i.each([1,2,3,4,5,6,7,8,9],function(a){return h+=" > ol",c[h]={"list-style-type":d[a%3]},h+=" > li"}),g.isIE(10)&&(c[g.DEFAULT_BREAK_TAG]={display:"none"}),f=function(){function a(b,d){var e;this.container=b,this.options=null!=d?d:{},this.container.innerHTML="",e=a.buildFrame(this.container),this.root=e[0],this.iframe=e[1],this.root.setAttribute("id",this.options.id),this.iframe.setAttribute("name",this.options.id),g(this.root).addClass("editor-container"),g(this.container).addClass("ql-container"),g.isIOS()&&g(this.container).styles({overflow:"auto","-webkit-overflow-scrolling":"touch"}),this.addStyles(c),null!=this.options.styles&&i.defer(i.bind(this.addStyles,this,this.options.styles))}return a.objToCss=function(a){return i.map(a,function(a,b){var c;return c=i.map(a,function(a,b){return""+b+": "+a+";"}).join(" "),""+b+" { "+c+" }"}).join("\n")},a.buildFrame=function(a){var b,c,d;return b=a.ownerDocument.createElement("iframe"),g(b).attributes({frameBorder:"0",height:"100%",width:"100%",title:"Quill Rich Text Editor",role:"presentation"}),a.appendChild(b),c=b.contentWindow.document,c.open(),c.write(""),c.close(),d=c.createElement("div"),c.body.appendChild(d),[d,b]},a.prototype.addContainer=function(a,b){var c,d;return null==b&&(b=!1),d=b?this.root:null,c=this.root.ownerDocument.createElement("div"),g(c).addClass(a),this.root.parentNode.insertBefore(c,d),c},a.prototype.addStyles=function(b){var c,d;return"object"==typeof b?(d=this.root.ownerDocument.createElement("style"),d.type="text/css",b=a.objToCss(b),d.appendChild(this.root.ownerDocument.createTextNode(b)),this.root.ownerDocument.head.appendChild(d)):"string"==typeof b?(c=this.root.ownerDocument.createElement("link"),g(c).attributes({type:"text/css",rel:"stylesheet",href:b}),this.root.ownerDocument.head.appendChild(c)):void 0},a}(),b.exports=f},{"../lib/dom":21,"../lib/normalizer":23,lodash:"M4+//f"}],18:[function(a,b){var c,d,e,f,g,h;h=a("lodash"),g=a("../lib/dom"),c=a("./leaf"),d=a("../lib/normalizer"),e=a("../lib/range"),f=function(){function a(a,b,c){this.doc=a,this.iframe=b,this.emitter=c,this.document=this.doc.root.ownerDocument,this.focus=!1,this.range=new e(0,0),this.nullDelay=!1,this.update("silent")}return a.prototype.checkFocus=function(){return this.document.activeElement===this.doc.root&&document.activeElement===this.iframe},a.prototype.getRange=function(a){var b,c,d;return null==a&&(a=!1),this.checkFocus()?(c=this._getNativeRange(),null==c?null:(d=this._positionToIndex(c.startContainer,c.startOffset),b=c.startContainer===c.endContainer&&c.startOffset===c.endOffset?d:this._positionToIndex(c.endContainer,c.endOffset),new e(Math.min(d,b),Math.max(d,b)))):a?this.range:null},a.prototype.preserve=function(a){var b,c,d,e,f,g,h,i,j;return d=this._getNativeRange(),null!=d&&this.checkFocus()?(g=this._encodePosition(d.startContainer,d.startOffset),e=g[0],f=g[1],h=this._encodePosition(d.endContainer,d.endOffset),b=h[0],c=h[1],a(),i=this._decodePosition(e,f),e=i[0],f=i[1],j=this._decodePosition(b,c),b=j[0],c=j[1],this._setNativeRange(e,f,b,c)):a()},a.prototype.setRange=function(a,b){var c,d,e,f,g,h,i;return null!=a?(g=this._indexToPosition(a.start),e=g[0],f=g[1],a.isCollapsed()?(h=[e,f],c=h[0],d=h[1]):(i=this._indexToPosition(a.end),c=i[0],d=i[1]),this._setNativeRange(e,f,c,d)):this._setNativeRange(null),this.update(b)},a.prototype.shiftAfter=function(a,b,c){var d;return d=this.getRange(),c(),null!=d?(d.shift(a,b),this.setRange(d,"silent")):void 0},a.prototype.update=function(a){var b,c,d,f;return c=this.checkFocus(),d=this.getRange(!0),b="silent"!==a&&(!e.compare(d,this.range)||c!==this.focus),f=c?d:null,null!==f||"user"!==a||this.nullDelay?(this.nullDelay=!1,this.range=d,this.focus=c,b?this.emitter.emit(this.emitter.constructor.events.SELECTION_CHANGE,f,a):void 0):this.nullDelay=!0},a.prototype._decodePosition=function(a,b){var c;return g(a).isElement()&&(c=h.indexOf(g(a.parentNode).childNodes(),a),b+=c,a=a.parentNode),[a,b]},a.prototype._encodePosition=function(a,b){for(var c;;){if(g(a).isTextNode()||a.tagName===g.DEFAULT_BREAK_TAG||null!=g.EMBED_TAGS[a.tagName])return[a,b];if(b0&&(a=b.getRangeAt(0),g(a.startContainer).isAncestor(this.doc.root,!0)&&(a.startContainer===a.endContainer||g(a.endContainer).isAncestor(this.doc.root,!0)))?a:null},a.prototype._indexToPosition=function(a){var b,c,d;return 0===this.doc.lines.length?[this.doc.root,0]:(d=this.doc.findLeafAt(a,!0),b=d[0],c=d[1],this._decodePosition(b.node,c))},a.prototype._positionToIndex=function(a,b){var c,d,e,f,g,h;if(h=this._encodePosition(a,b),d=h[0],b=h[1],f=this.doc.findLine(d),null==f)return 0;for(c=f.findLeaf(d),g=0;null!=f.prev;)f=f.prev,g+=f.length;if(null==c)return g;for(e=0;null!=c.prev;)c=c.prev,e+=c.length;return g+e+b},a.prototype._setNativeRange=function(a,b,c,d){var e,f;return(f=this.document.getSelection())?null==a?(f.removeAllRanges(),this.doc.root.blur()):(this.checkFocus()||this.doc.root.focus(),e=this._getNativeRange(),null!=e&&a===e.startContainer&&b===e.startOffset&&c===e.endContainer&&d===e.endOffset||(f.removeAllRanges(),e=this.document.createRange(),e.setStart(a,b),e.setEnd(c,d),f.addRange(e),this.checkFocus())?void 0:this.doc.root.focus()):void 0},a}(),b.exports=f},{"../lib/dom":21,"../lib/normalizer":23,"../lib/range":25,"./leaf":15,lodash:"M4+//f"}],19:[function(a,b){a("./modules/authorship"),a("./modules/image-tooltip"),a("./modules/keyboard"),a("./modules/link-tooltip"),a("./modules/multi-cursor"),a("./modules/paste-manager"),a("./modules/toolbar"),a("./modules/tooltip"),a("./modules/undo-manager"),b.exports=a("./quill")},{"./modules/authorship":26,"./modules/image-tooltip":27,"./modules/keyboard":28,"./modules/link-tooltip":29,"./modules/multi-cursor":30,"./modules/paste-manager":31,"./modules/toolbar":32,"./modules/tooltip":33,"./modules/undo-manager":34,"./quill":35}],20:[function(a,b){var c,d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};e=a("./dom"),d=a("./picker"),c=function(a){function b(){b.__super__.constructor.apply(this,arguments),e(this.container).addClass("ql-color-picker")}return g(b,a),b.prototype.buildItem=function(a,c,d){var e;return e=b.__super__.buildItem.call(this,a,c,d),e.style.backgroundColor=c.value,e},b}(d),b.exports=c},{"./dom":21,"./picker":24}],21:[function(a,b){var c,d,e,f,g,h=function(a,b){return function(){return a.apply(b,arguments)}},i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};g=a("lodash"),f=null,d=function(){function a(a){this.node=a,this.trigger=h(this.trigger,this)}return a.prototype.addClass=function(a){return this.hasClass(a)?void 0:(null!=this.node.classList?this.node.classList.add(a):null!=this.node.className&&(this.node.className=(this.node.className+" "+a).trim()),this)},a.prototype.attributes=function(a){var b,c,d,e,f,h;if(a)return g.each(a,function(a){return function(b,c){return a.node.setAttribute(c,b)}}(this)),this;if(null==this.node.attributes)return{};for(a={},h=this.node.attributes,c=e=0,f=h.length;f>e;c=++e)d=h[c],b=this.node.attributes[c],a[b.name]=b.value;return a},a.prototype.child=function(a){var b,c;for(b=this.node.firstChild,c=e(b).length();null!=b&&!(c>a);)a-=c,b=b.nextSibling,c=e(b).length();return null==b&&(b=this.node.lastChild,a=e(b).length()),[b,a]},a.prototype.childNodes=function(){return g.map(this.node.childNodes)},a.prototype.classes=function(){return this.node.className.split(/\s+/)},a.prototype.descendants=function(){return g.map(this.node.getElementsByTagName("*"))},a.prototype.get=function(){return this.node},a.prototype.hasClass=function(a){return null!=this.node.classList?this.node.classList.contains(a):null!=this.node.className?g.indexOf(this.classes(),a)>-1:!1},a.prototype.isAncestor=function(a,b){var c;if(null==b&&(b=!1),a===this.node)return b;for(c=this.node;c;){if(c===a)return!0;c=c.parentNode}return!1},a.prototype.isElement=function(){var a;return(null!=(a=this.node)?a.nodeType:void 0)===e.ELEMENT_NODE},a.prototype.isTextNode=function(){var a;return(null!=(a=this.node)?a.nodeType:void 0)===e.TEXT_NODE},a.prototype.length=function(){var a;return null==this.node?0:(a=this.text().length,this.isElement()&&(a+=this.node.querySelectorAll(g.keys(e.EMBED_TAGS).join(",")).length),a)},a.prototype.merge=function(a){var b;return b=e(a),this.isElement()?(b.moveChildren(this.node),this.normalize()):this.text(this.text()+b.text()),b.remove(),this},a.prototype.moveChildren=function(a){return g.each(this.childNodes(),function(b){return a.appendChild(b)}),this},a.prototype.nextLineNode=function(a){var b;return b=this.node.nextSibling,null==b&&this.node.parentNode!==a&&(b=this.node.parentNode.nextSibling),null!=b&&null!=e.LIST_TAGS[b.tagName]&&(b=b.firstChild),b},a.prototype.normalize=function(){var a,b,c,d;for(b=this.node.firstChild;null!=b;)d=b.nextSibling,a=e(b),null!=d&&e(d).isTextNode()&&(0===a.text().length?a.remove():a.isTextNode()&&(c=d.nextSibling,a.merge(d),d=c)),b=d;return this},a.prototype.on=function(a,b){return this.node.addEventListener(a,function(c){return function(d){var e,g;return e=!f||"keydown"!==a&&"keyup"!==a?d:f,g=b.call(c.node,e),g||(d.preventDefault(),d.stopPropagation()),g}}(this)),this},a.prototype.remove=function(){var a;return null!=(a=this.node.parentNode)&&a.removeChild(this.node),this.node=null,null},a.prototype.removeClass=function(a){var b;if(this.hasClass(a))return null!=this.node.classList?this.node.classList.remove(a):(null!=this.node.className&&(b=this.classes(),b.splice(g.indexOf(b,a),1),this.node.className=b.join(" ")),this)},a.prototype.replace=function(a){return this.node.parentNode.replaceChild(a,this.node),this.node=a,a},a.prototype.splitAncestors=function(a,b){var c,d,f,g;if(null==b&&(b=!1),this.node===a||this.node.parentNode===a)return this;if(null!=this.node.previousSibling||b){for(f=this.node.parentNode,d=f.cloneNode(!1),f.parentNode.insertBefore(d,f.nextSibling),g=this.node;null!=g;)c=g.nextSibling,d.appendChild(g),g=c;return e(d).splitAncestors(a)}return e(this.node.parentNode).splitAncestors(a)},a.prototype.split=function(a,b){var c,d,f,g,h,i,j,k,l,m;if(null==b&&(b=!1),j=this.length(),a=Math.max(0,a),a=Math.min(a,j),!b&&0===a)return[this.node.previousSibling,this.node,!1];if(!b&&a===j)return[this.node,this.node.nextSibling,!1];if(this.node.nodeType===e.TEXT_NODE)return c=this.node.splitText(a),[this.node,c,!0];for(h=this.node,k=this.node.cloneNode(!1),this.node.parentNode.insertBefore(k,h.nextSibling),l=this.child(a),d=l[0],a=l[1],m=e(d).split(a),f=m[0],g=m[1];null!==g;)i=g.nextSibling,k.appendChild(g),g=i;return[h,k,!0]},a.prototype.styles=function(a,b){var c,d;return null==b&&(b=!1),a?(b||(a=g.defaults(a,this.styles())),d=g.map(a,function(a,b){return""+b+": "+a}).join("; ")+";",this.node.setAttribute("style",d),this):(d=this.node.getAttribute("style")||"",c=g.reduce(d.split(";"),function(a,b){var c,d,e;return e=b.split(":"),c=e[0],d=e[1],c&&d&&(c=c.trim(),d=d.trim(),a[c.toLowerCase()]=d),a},{}))},a.prototype.switchTag=function(a){var b,c;return a=a.toUpperCase(),this.node.tagName===a?this:(c=this.node.ownerDocument.createElement(a),b=this.attributes(),null==e.VOID_TAGS[a]&&this.moveChildren(c),this.replace(c),this.attributes(b).get())
},a.prototype.text=function(a){if(null!=a){switch(this.node.nodeType){case e.ELEMENT_NODE:this.node.textContent=a;break;case e.TEXT_NODE:this.node.data=a}return this}switch(this.node.nodeType){case e.ELEMENT_NODE:return this.node.tagName===e.DEFAULT_BREAK_TAG?"":null!=e.EMBED_TAGS[this.node.tagName]?e.EMBED_TEXT:null!=this.node.textContent?this.node.textContent:"";case e.TEXT_NODE:return this.node.data||"";default:return""}},a.prototype.textNodes=function(){var a,b,c;for(c=this.node.ownerDocument.createTreeWalker(this.node,NodeFilter.SHOW_TEXT,null,!1),b=[];a=c.nextNode();)b.push(a);return b},a.prototype.toggleClass=function(a,b){return null==b&&(b=!this.hasClass(a)),b?this.addClass(a):this.removeClass(a),this},a.prototype.trigger=function(a,b){var c,d,h;return null==b&&(b={}),g.indexOf(["keypress","keydown","keyup"],a)<0?(c=this.node.ownerDocument.createEvent("Event"),c.initEvent(a,b.bubbles,b.cancelable)):(c=this.node.ownerDocument.createEvent("KeyboardEvent"),f=g.clone(b),f.which=g.isNumber(b.key)?b.key:g.isString(b.key)?b.key.toUpperCase().charCodeAt(0):0,e.isIE(10)?(h=[],b.altKey&&h.push("Alt"),b.ctrlKey&&h.push("Control"),b.metaKey&&h.push("Meta"),b.shiftKey&&h.push("Shift"),c.initKeyboardEvent(a,b.bubbles,b.cancelable,this.window(),0,0,h.join(" "),null,null)):(d=g.isFunction(c.initKeyboardEvent)?"initKeyboardEvent":"initKeyEvent",c[d](a,b.bubbles,b.cancelable,this.window(),b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,0))),this.node.dispatchEvent(c),f=null,this},a.prototype.unwrap=function(){var a,b;return b=this.node.firstChild,a=this.node.nextSibling,g.each(this.childNodes(),function(b){return function(c){return b.node.parentNode.insertBefore(c,a)}}(this)),this.remove(),b},a.prototype.window=function(){return this.node.ownerDocument.defaultView||this.node.ownerDocument.parentWindow},a.prototype.wrap=function(a){var b;for(null!=this.node.parentNode&&this.node.parentNode.insertBefore(a,this.node),b=a;null!=b.firstChild;)b=a.firstChild;return b.appendChild(this.node),this},a}(),c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.prototype["default"]=function(){return this.node.querySelector("option[selected]")},b.prototype.option=function(a,b){var c,d,e,f,h,i;if(null==b&&(b=!0),e=g.isElement(a)?a.value:a){for(e=e.replace(/[^\w]+/g,""),i=this.node.children,d=f=0,h=i.length;h>f;d=++f)if(c=i[d],c.value.replace(/[^\w]+/g,"")===e){this.node.selectedIndex=d;break}}else this.node.selectedIndex=-1;return b&&this.trigger("change"),this},b.prototype.reset=function(a){var b;return null==a&&(a=!0),b=this["default"](),null!=b?b.selected=!0:this.node.selectedIndex=0,a&&this.trigger("change"),this},b.prototype.value=function(){return this.node.selectedIndex>-1?this.node.options[this.node.selectedIndex].value:""},b}(d),e=function(a){return"SELECT"===(null!=a?a.tagName:void 0)?new c(a):new d(a)},e=g.extend(e,{ELEMENT_NODE:1,NOBREAK_SPACE:" ",TEXT_NODE:3,ZERO_WIDTH_NOBREAK_SPACE:"",DEFAULT_BLOCK_TAG:"DIV",DEFAULT_BREAK_TAG:"BR",DEFAULT_INLINE_TAG:"SPAN",EMBED_TEXT:"!",FONT_SIZES:{"10px":1,"13px":2,"16px":3,"18px":4,"24px":5,"32px":6,"48px":7},KEYS:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},BLOCK_TAGS:{ADDRESS:"ADDRESS",ARTICLE:"ARTICLE",ASIDE:"ASIDE",AUDIO:"AUDIO",BLOCKQUOTE:"BLOCKQUOTE",CANVAS:"CANVAS",DD:"DD",DIV:"DIV",DL:"DL",FIGCAPTION:"FIGCAPTION",FIGURE:"FIGURE",FOOTER:"FOOTER",FORM:"FORM",H1:"H1",H2:"H2",H3:"H3",H4:"H4",H5:"H5",H6:"H6",HEADER:"HEADER",HGROUP:"HGROUP",LI:"LI",OL:"OL",OUTPUT:"OUTPUT",P:"P",PRE:"PRE",SECTION:"SECTION",TABLE:"TABLE",TBODY:"TBODY",TD:"TD",TFOOT:"TFOOT",TH:"TH",THEAD:"THEAD",TR:"TR",UL:"UL",VIDEO:"VIDEO"},EMBED_TAGS:{IMG:"IMG"},LINE_TAGS:{DIV:"DIV",LI:"LI"},LIST_TAGS:{OL:"OL",UL:"UL"},VOID_TAGS:{AREA:"AREA",BASE:"BASE",BR:"BR",COL:"COL",COMMAND:"COMMAND",EMBED:"EMBED",HR:"HR",IMG:"IMG",INPUT:"INPUT",KEYGEN:"KEYGEN",LINK:"LINK",META:"META",PARAM:"PARAM",SOURCE:"SOURCE",TRACK:"TRACK",WBR:"WBR"},convertFontSize:function(a){var b,c,d,f;g.isString(a)&&a.indexOf("px")>-1?(d=g.keys(e.FONT_SIZES),f=g.values(e.FONT_SIZES)):(f=g.keys(e.FONT_SIZES),d=g.values(e.FONT_SIZES));for(b in d)if(c=d[b],parseInt(a)<=parseInt(c))return f[b];return g.last(f)},isIE:function(a){var b;return b=document.documentMode,b&&a>=b},isIOS:function(){return/iPhone|iPad/i.test(navigator.userAgent)},isMac:function(){return/Mac/i.test(navigator.platform)}}),b.exports=e},{lodash:"M4+//f"}],22:[function(a,b){var c,d;d=function(){function a(a){this.data=a,this.prev=this.next=null}return a}(),c=function(){function a(){this.length=0,this.first=this.last=null}return a.Node=d,a.prototype.append=function(a){return null!=this.first?(a.next=null,this.last.next=a):this.first=a,a.prev=this.last,this.last=a,this.length+=1},a.prototype.insertAfter=function(a,b){return b.prev=a,null!=a?(b.next=a.next,null!=a.next&&(a.next.prev=b),a.next=b,a===this.last&&(this.last=b)):(b.next=this.first,this.first.prev=b,this.first=b),this.length+=1},a.prototype.remove=function(a){return this.length>1?(null!=a.prev&&(a.prev.next=a.next),null!=a.next&&(a.next.prev=a.prev),a===this.first&&(this.first=a.next),a===this.last&&(this.last=a.prev)):this.first=this.last=null,a.prev=a.next=null,this.length-=1},a.prototype.toArray=function(){var a,b;for(a=[],b=this.first;null!=b;)a.push(b),b=b.next;return a},a}(),b.exports=c},{}],23:[function(a,b){var c,d,e;e=a("lodash"),d=a("./dom"),c={ALIASES:{STRONG:"B",EM:"I",DEL:"S",STRIKE:"S"},ATTRIBUTES:{color:"color",face:"fontFamily",size:"fontSize"},STYLES:{"background-color":"background-color",color:"color","font-family":"font-family","font-size":"font-size","text-align":"text-align"},TAGS:{DIV:"DIV",BR:"BR",SPAN:"SPAN",B:"B",I:"I",S:"S",U:"U",A:"A",IMG:"IMG",OL:"OL",UL:"UL",LI:"LI"},handleBreaks:function(a){var b;return b=e.map(a.querySelectorAll(d.DEFAULT_BREAK_TAG)),e.each(b,function(){return function(b){return null==b.nextSibling||d.isIE(10)&&null==b.previousSibling?void 0:d(b.nextSibling).splitAncestors(a.parentNode)}}(this)),a},normalizeLine:function(a){return a=c.wrapInline(a),a=c.handleBreaks(a),a=c.pullBlocks(a),a=c.normalizeNode(a),c.unwrapText(a),null!=a&&null!=d.LIST_TAGS[a.tagName]&&(a=a.firstChild),a},normalizeNode:function(a){return d(a).isTextNode()?a:(e.each(c.ATTRIBUTES,function(b,c){var e;return a.hasAttribute(c)?(e=a.getAttribute(c),"size"===c&&(e=d.convertFontSize(e)),a.style[b]=e,a.removeAttribute(c)):void 0}),c.whitelistStyles(a),c.whitelistTags(a))},optimizeLine:function(a){var b,c,f,g;for(b=d(a).length(),f=d(a).descendants(),g=[];f.length>0;)c=f.pop(),null!=(null!=c?c.parentNode:void 0)&&null==d.EMBED_TAGS[c.tagName]&&(c.tagName===d.DEFAULT_BREAK_TAG?g.push(0!==b?d(c).remove():void 0):0===d(c).length()?(f.push(c.nextSibling),g.push(d(c).unwrap())):null!=c.previousSibling&&c.tagName===c.previousSibling.tagName&&e.isEqual(d(c).attributes(),d(c.previousSibling).attributes())?(f.push(c.firstChild),g.push(d(c.previousSibling).merge(c))):g.push(void 0));return g},pullBlocks:function(a){var b;for(b=a.firstChild;null!=b;){if(null!=d.BLOCK_TAGS[b.tagName]&&"LI"!==b.tagName){null!=b.previousSibling&&d(b).splitAncestors(a.parentNode),null!=b.nextSibling&&d(b.nextSibling).splitAncestors(a.parentNode),null!=d.LIST_TAGS[b.tagName]&&b.firstChild?(d(b.parentNode).unwrap(),null==a.parentNode&&(a=b)):(d(b).unwrap(),c.pullBlocks(a));break}b=b.nextSibling}return a},stripComments:function(a){return a.replace(//g,"")},stripWhitespace:function(a){return a=a.replace(/^\s+/,"").replace(/\s+$/,""),a=a.replace(/^\s+/,"").replace(/\s+$/,""),a=a.replace(/(\r?\n|\r)+/g," "),a=a.replace(/\>\s+\
<")},whitelistStyles:function(a){var b,f;return b=d(a).styles(),f=e.omit(b,function(a,b){return null==c.STYLES[b]}),e.keys(f).length0?d(a).styles(f,!0):a.removeAttribute("style"):void 0},whitelistTags:function(a){return d(a).isElement()?(null!=c.ALIASES[a.tagName]?a=d(a).switchTag(c.ALIASES[a.tagName]):null==c.TAGS[a.tagName]&&(a=null!=d.BLOCK_TAGS[a.tagName]?d(a).switchTag(d.DEFAULT_BLOCK_TAG):a.hasAttributes()||null==a.firstChild?d(a).switchTag(d.DEFAULT_INLINE_TAG):d(a).unwrap()),a):a},wrapInline:function(a){var b,c;if(null!=d.BLOCK_TAGS[a.tagName])return a;for(b=a.ownerDocument.createElement(d.DEFAULT_BLOCK_TAG),a.parentNode.insertBefore(b,a);null!=a&&null==d.BLOCK_TAGS[a.tagName];)c=a.nextSibling,b.appendChild(a),a=c;return b},unwrapText:function(a){var b;return b=e.map(a.querySelectorAll(d.DEFAULT_INLINE_TAG)),e.each(b,function(a){return a.hasAttributes()?void 0:d(a).unwrap()})}},b.exports=c},{"./dom":21,lodash:"M4+//f"}],24:[function(a,b){var c,d,e,f;f=a("lodash"),e=a("./dom"),c=a("./normalizer"),d=function(){function a(a){this.select=a,this.container=this.select.ownerDocument.createElement("span"),this.buildPicker(),e(this.container).addClass("ql-picker"),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),e(this.select.ownerDocument).on("click",function(a){return function(){return a.close(),!0}}(this)),e(this.label).on("click",function(a){return function(){return f.defer(function(){return e(a.container).toggleClass("ql-expanded")}),!1}}(this)),e(this.select).on("change",function(a){return function(){var b,c;return a.select.selectedIndex>-1&&(b=a.container.querySelectorAll(".ql-picker-item")[a.select.selectedIndex],c=a.select.options[a.select.selectedIndex]),a.selectItem(b,!1),e(a.label).toggleClass("ql-active",c!==e(a.select)["default"]())}}(this))}return a.TEMPLATE='',a.prototype.buildItem=function(a,b,c){var d;return d=this.select.ownerDocument.createElement("span"),d.setAttribute("data-value",b.getAttribute("value")),e(d).addClass("ql-picker-item").text(e(b).text()).on("click",function(a){return function(){return a.selectItem(d,!0),a.close()}}(this)),this.select.selectedIndex===c&&this.selectItem(d,!1),d},a.prototype.buildPicker=function(){var b;return f.each(e(this.select).attributes(),function(a){return function(b,c){return a.container.setAttribute(c,b)}}(this)),this.container.innerHTML=c.stripWhitespace(a.TEMPLATE),this.label=this.container.querySelector(".ql-picker-label"),b=this.container.querySelector(".ql-picker-options"),f.each(this.select.options,function(a){return function(c,d){var e;return e=a.buildItem(b,c,d),b.appendChild(e)}}(this))},a.prototype.close=function(){return e(this.container).removeClass("ql-expanded")},a.prototype.selectItem=function(a,b){var c,d;return c=this.container.querySelector(".ql-selected"),null!=c&&e(c).removeClass("ql-selected"),null!=a?(d=a.getAttribute("data-value"),e(a).addClass("ql-selected"),e(this.label).text(e(a).text()),e(this.select).option(d,b),this.label.setAttribute("data-value",d)):(this.label.innerHTML=" ",this.label.removeAttribute("data-value"))},a}(),b.exports=d},{"./dom":21,"./normalizer":23,lodash:"M4+//f"}],25:[function(a,b){var c,d;d=a("lodash"),c=function(){function a(a,b){this.start=a,this.end=b}return a.compare=function(a,b){return a===b?!0:null==a||null==b?!1:a.equals(b)},a.prototype.equals=function(a){return null==a?!1:this.start===a.start&&this.end===a.end},a.prototype.shift=function(a,b){var c;return c=d.map([this.start,this.end],function(c){return a>c?c:b>=0?c+b:Math.max(a,c+b)}),this.start=c[0],this.end=c[1],c},a.prototype.isCollapsed=function(){return this.start===this.end},a}(),b.exports=c},{lodash:"M4+//f"}],26:[function(a,b){var c,d,e,f,g;e=a("../quill"),g=e.require("lodash"),f=e.require("dom"),d=e.require("delta"),c=function(){function a(a,b){this.quill=a,this.options=b,null!=this.options.button&&this.attachButton(this.options.button),this.options.enabled&&this.enable(),this.quill.addFormat("author",{"class":"author-"}),null!=this.options.authorId&&(this.quill.on(this.quill.constructor.events.PRE_EVENT,function(a){return function(b,c,f){var h,i;return b===a.quill.constructor.events.TEXT_CHANGE&&"user"===f?(h=new d,i={author:a.options.authorId},g.each(c.ops,function(b){return null==b["delete"]?null!=b.insert||null!=b.retain&&null!=b.attributes?(b.attributes||(b.attributes={}),b.attributes.author=a.options.authorId,h.retain(b.retain||b.insert.length||1,i)):h.retain(b.retain):void 0}),a.quill.updateContents(h,e.sources.SILENT)):void 0}}(this)),this.addAuthor(this.options.authorId,this.options.color))}return a.DEFAULTS={authorId:null,color:"transparent",enabled:!1},a.prototype.addAuthor=function(a,b){var c;return c={},c[".authorship .author-"+a]={"background-color":""+b},this.quill.addStyles(c)},a.prototype.attachButton=function(a){var b;return b=f(a),b.on("click",function(a){return function(){return b.toggleClass("ql-on"),a.enable($dom.hasClass("ql-on"))}}(this))},a.prototype.enable=function(a){return null==a&&(a=!0),f(this.quill.root).toggleClass("authorship",a)},a.prototype.disable=function(){return this.enable(!1)},a}(),e.registerModule("authorship",c),b.exports=c},{"../quill":35}],27:[function(a,b){var c,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};e=a("../quill"),f=a("./tooltip"),h=e.require("lodash"),g=e.require("dom"),c=e.require("delta"),d=function(a){function b(a,c){this.quill=a,this.options=c,this.options.styles=h.defaults(this.options.styles,f.DEFAULTS.styles),this.options=h.defaults(this.options,f.DEFAULTS),b.__super__.constructor.call(this,this.quill,this.options),this.preview=this.container.querySelector(".preview"),this.textbox=this.container.querySelector(".input"),g(this.container).addClass("image-tooltip-container"),this.initListeners()}return j(b,a),b.DEFAULTS={styles:{".image-tooltip-container":{margin:"25px",padding:"10px",width:"300px"},".image-tooltip-container:after":{clear:"both",content:'""',display:"table"},".image-tooltip-container .preview":{margin:"10px 0px",position:"relative",border:"1px dashed #000",height:"200px"},".image-tooltip-container .preview span":{display:"inline-block",position:"absolute","text-align":"center",top:"40%",width:"100%"},".image-tooltip-container img":{bottom:"0",left:"0",margin:"auto","max-height":"100%","max-width":"100%",position:"absolute",right:"0",top:"0"},".image-tooltip-container .input":{"box-sizing":"border-box",width:"100%"},".image-tooltip-container a":{border:"1px solid black","box-sizing":"border-box",display:"inline-block","float":"left",padding:"5px","text-align":"center",width:"50%"}},template:' Preview Cancel Insert'},b.prototype.initListeners=function(){return g(this.container.querySelector(".insert")).on("click",h.bind(this.insertImage,this)),g(this.container.querySelector(".cancel")).on("click",h.bind(this.hide,this)),g(this.textbox).on("input",h.bind(this._preview,this)),this.initTextbox(this.textbox,this.insertImage,this.hide),this.quill.onModuleLoad("toolbar",function(a){return function(b){return b.initFormat("image",h.bind(a._onToolbar,a))}}(this))},b.prototype.insertImage=function(){var a,b;return b=this._normalizeURL(this.textbox.value),null==this.range&&(this.range=new Range(0,0)),this.range&&(this.preview.innerHTML="Preview",this.textbox.value="",a=this.range.end,this.quill.insertEmbed(a,"image",b,"user"),this.quill.setSelection(a+1,a+1)),this.hide()},b.prototype._onToolbar=function(a,b){return b?(this.textbox.value||(this.textbox.value="http://"),this.show(),this.textbox.focus(),h.defer(function(a){return function(){return a.textbox.setSelectionRange(a.textbox.value.length,a.textbox.value.length)}}(this))):this.quill.deleteText(a,"user")},b.prototype._preview=function(){var a;if(this._matchImageURL(this.textbox.value))return"IMG"===this.preview.firstChild.tagName?this.preview.firstChild.setAttribute("src",this.textbox.value):(a=this.preview.ownerDocument.createElement("img"),a.setAttribute("src",this.textbox.value),this.preview.replaceChild(a,this.preview.firstChild))},b.prototype._matchImageURL=function(a){return/^https?:\/\/.+\.(jp?g|gif|png)$/.test(a)},b.prototype._normalizeURL=function(a){return/^https?:\/\//.test(a)||(a="http://"+a),a},b}(f),e.registerModule("image-tooltip",d),b.exports=d},{"../quill":35,"./tooltip":33}],28:[function(a,b){var c,d,e,f,g;e=a("../quill"),g=e.require("lodash"),f=e.require("dom"),c=e.require("delta"),d=function(){function a(a){this.quill=a,this.hotkeys={},this._initListeners(),this._initHotkeys(),this._initDeletes()}return a.hotkeys={BOLD:{key:"B",metaKey:!0},INDENT:{key:f.KEYS.TAB},ITALIC:{key:"I",metaKey:!0},OUTDENT:{key:f.KEYS.TAB,shiftKey:!0},UNDERLINE:{key:"U",metaKey:!0}},a.prototype.addHotkey=function(a,b){return g.isArray(a)||(a=[a]),g.each(a,function(a){return function(c){var d,e;return c=g.isObject(c)?g.clone(c):{key:c},c.callback=b,d=g.isNumber(c.key)?c.key:c.key.toUpperCase().charCodeAt(0),null==(e=a.hotkeys)[d]&&(e[d]=[]),a.hotkeys[d].push(c)}}(this))},a.prototype.toggleFormat=function(a,b){var c,d,e;return c=a.isCollapsed()?this.quill.getContents(Math.max(0,a.start-1),a.end):this.quill.getContents(a),e=0===c.ops.length||!g.all(c.ops,function(a){var c;return null!=(c=a.attributes)?c[b]:void 0}),a.isCollapsed()?this.quill.prepareFormat(b,e):this.quill.formatText(a,b,e,"user"),d=this.quill.getModule("toolbar"),null!=d?d.setActive(b,e):void 0},a.prototype._initDeletes=function(){return this.addHotkey([f.KEYS.DELETE,f.KEYS.BACKSPACE],function(a){return function(){return a.quill.getLength()>1}}(this))},a.prototype._initHotkeys=function(){return this.addHotkey(a.hotkeys.INDENT,function(a){return function(b){return a._onTab(b,!1),!1}}(this)),this.addHotkey(a.hotkeys.OUTDENT,function(){return function(){return!1}}(this)),g.each(["bold","italic","underline"],function(b){return function(c){return b.addHotkey(a.hotkeys[c.toUpperCase()],function(a){return b.toggleFormat(a,c),!1})}}(this))},a.prototype._initListeners=function(){return f(this.quill.root).on("keydown",function(a){return function(b){var c;return c=!1,g.each(a.hotkeys[b.which],function(d){var e;return e=f.isMac()?b.metaKey:b.metaKey||b.ctrlKey,!!d.metaKey==!!e&&!!d.shiftKey==!!b.shiftKey&&!!d.altKey==!!b.altKey?(c=d.callback(a.quill.getSelection())===!1||c,!0):void 0}),!c}}(this))},a.prototype._onTab=function(a,b){var d;return null==b&&(b=!1),d=(new c).retain(a.start).insert(" ")["delete"](a.end-a.start).retain(this.quill.getLength()-a.end),this.quill.updateContents(d),this.quill.setSelection(a.start+1,a.start+1)},a}(),e.registerModule("keyboard",d),b.exports=d},{"../quill":35}],29:[function(a,b){var c,d,e,f,g,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=a("../quill"),e=a("./tooltip"),g=d.require("lodash"),f=d.require("dom"),c=function(a){function b(a,c){this.quill=a,this.options=c,this.options.styles=g.defaults(this.options.styles,e.DEFAULTS.styles),this.options=g.defaults(this.options,e.DEFAULTS),b.__super__.constructor.call(this,this.quill,this.options),f(this.container).addClass("link-tooltip-container"),this.textbox=this.container.querySelector(".input"),this.link=this.container.querySelector(".url"),this.initListeners()}return i(b,a),b.DEFAULTS={maxLength:50,styles:{".link-tooltip-container":{padding:"5px 10px"},".link-tooltip-container input.input":{width:"170px"},".link-tooltip-container input.input, .link-tooltip-container a.done, .link-tooltip-container.editing a.url, .link-tooltip-container.editing a.change":{display:"none"},".link-tooltip-container.editing input.input, .link-tooltip-container.editing a.done":{display:"inline-block"}},template:'Visit URL: - Change Done'},b.prototype.initListeners=function(){return this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,function(a){return function(b){var c;if(null!=b&&b.isCollapsed())return c=a._findAnchor(b),c?(a.setMode(c.href,!1),a.show(c)):(a.range=null,a.hide())}}(this)),f(this.container.querySelector(".done")).on("click",g.bind(this.saveLink,this)),f(this.container.querySelector(".change")).on("click",function(a){return function(){return a.setMode(a.link.href,!0)}}(this)),this.initTextbox(this.textbox,this.saveLink,this.hide),this.quill.onModuleLoad("toolbar",function(a){return function(b){return b.initFormat("link",g.bind(a._onToolbar,a))}}(this))},b.prototype.saveLink=function(){var a,b;return b=this._normalizeURL(this.textbox.value),null!=this.range&&(this.range.isCollapsed()?(a=this._findAnchor(this.range),null!=a&&(a.href=b)):this.quill.formatText(this.range,"link",b,"user")),this.setMode(b,!1)},b.prototype.setMode=function(a,b){var c;return null==b&&(b=!1),b?(this.textbox.value=a,g.defer(function(b){return function(){return b.textbox.focus(),b.textbox.setSelectionRange(a.length,a.length)}}(this))):(this.link.href=a,c=a.length>this.options.maxLength?a.slice(0,this.options.maxLength)+"...":a,f(this.link).text(c)),f(this.container).toggleClass("editing",b)},b.prototype._findAnchor=function(a){var b,c,d,e;for(e=this.quill.editor.doc.findLeafAt(a.start,!0),b=e[0],d=e[1],null!=b&&(c=b.node);null!=c;){if("A"===c.tagName)return c;c=c.parentNode}return null},b.prototype._onToolbar=function(a,b){var c;if(a&&!a.isCollapsed())return b?(this.setMode(this._suggestURL(a),!0),c=this.quill.editor.selection._getNativeRange(),this.show(c)):this.quill.formatText(a,"link",!1,"user")},b.prototype._normalizeURL=function(a){return/^(https?:\/\/|mailto:)/.test(a)||(a="http://"+a),a},b.prototype._suggestURL=function(a){var b;return b=this.quill.getText(a),this._normalizeURL(b)},b}(e),d.registerModule("link-tooltip",c),b.exports=c},{"../quill":35,"./tooltip":33}],30:[function(a,b){var c,d,e,f,g,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};e=a("../quill"),c=a("eventemitter2").EventEmitter2,g=e.require("lodash"),f=e.require("dom"),d=function(a){function b(a,b){this.quill=a,this.options=b,this.cursors={},this.container=this.quill.addContainer("cursor-container",!0),this.quill.addStyles({".cursor-container":{position:"absolute",left:"0",top:"0","z-index":"1000"},".cursor":{"margin-left":"-1px",position:"absolute"},".cursor-flag":{bottom:"100%",position:"absolute","white-space":"nowrap"},".cursor-name":{display:"inline-block",color:"white",padding:"2px 8px"},".cursor-caret":{height:"100%",position:"absolute",width:"2px"},".cursor.hidden .cursor-flag":{display:"none"},".cursor.top > .cursor-flag":{bottom:"auto",top:"100%"},".cursor.right > .cursor-flag":{right:"-2px"}}),this.quill.on(this.quill.constructor.events.TEXT_CHANGE,g.bind(this._applyDelta,this))}return i(b,a),b.DEFAULTS={template:' ',timeout:2500},b.events={CURSOR_ADDED:"cursor-addded",CURSOR_MOVED:"cursor-moved",CURSOR_REMOVED:"cursor-removed"},b.prototype.clearCursors=function(){return g.each(g.keys(this.cursors),g.bind(this.removeCursor,this)),this.cursors={}},b.prototype.moveCursor=function(a,b){var c;return c=this.cursors[a],c.index=b,f(c.elem).removeClass("hidden"),clearTimeout(c.timer),c.timer=setTimeout(function(){return function(){return f(c.elem).addClass("hidden"),c.timer=null}}(this),this.options.timeout),this._updateCursor(c),c},b.prototype.removeCursor=function(a){var c;return c=this.cursors[a],this.emit(b.events.CURSOR_REMOVED,c),null!=c&&c.elem.parentNode.removeChild(c.elem),delete this.cursors[a]},b.prototype.setCursor=function(a,c,d,e){var f;return null==this.cursors[a]&&(this.cursors[a]=f={userId:a,index:c,color:e,elem:this._buildCursor(d,e)},this.emit(b.events.CURSOR_ADDED,f)),g.defer(function(b){return function(){return b.moveCursor(a,c)}}(this)),this.cursors[a]},b.prototype.shiftCursors=function(a,b,c){return null==c&&(c=null),g.each(this.cursors,function(){return function(d){return d&&(d.index>a||d.userId===c)?d.index+=Math.max(b,a-d.index):void 0}}(this))},b.prototype.update=function(){return g.each(this.cursors,function(a){return function(b){return null!=b?(a._updateCursor(b),!0):void 0}}(this))},b.prototype._applyDelta=function(a){var b;return b=0,g.each(a.ops,function(a){return function(c){var d,e;return d=0,null!=c.insert?(d=c.insert.length||1,a.shiftCursors(b,d,null!=(e=c.attributes)?e.author:void 0)):null!=c["delete"]?a.shiftCursors(b,-1*c["delete"],null):null!=c.retain&&(a.shiftCursors(b,0,null),d=c.retain),b+=d}}(this)),this.update()},b.prototype._buildCursor=function(a,b){var c,d,e,g;return c=this.container.ownerDocument.createElement("span"),f(c).addClass("cursor"),c.innerHTML=this.options.template,e=c.querySelector(".cursor-flag"),g=c.querySelector(".cursor-name"),f(g).text(a),d=c.querySelector(".cursor-caret"),d.style.backgroundColor=g.style.backgroundColor=b,this.container.appendChild(c),c},b.prototype._moveCursor=function(a,c,d){var e,g,h;return null==d&&(d="left"),h=f(c).window(),e=c.getBoundingClientRect(),a.elem.style.top=e.top+h.pageYOffset+"px",a.elem.style.left=e[d]+"px",a.elem.style.height=e.height+"px",g=a.elem.querySelector(".cursor-flag"),f(a.elem).toggleClass("top",parseInt(a.elem.style.top)<=g.offsetHeight).toggleClass("left",parseInt(a.elem.style.left)<=g.offsetWidth).toggleClass("right",this.quill.root.offsetWidth-parseInt(a.elem.style.left)<=g.offsetWidth),this.emit(b.events.CURSOR_MOVED,a)},b.prototype._updateCursor=function(a){var b,c,d,g,h,i,j,k;return this.quill.editor.checkUpdate(),j=this.quill.editor.doc.findLeafAt(a.index,!0),d=j[0],h=j[1],c=this.container.ownerDocument.createElement("span"),null!=d?(k=f(d.node).split(h),g=k[0],i=k[1],b=k[2],f(c).text(f.ZERO_WIDTH_NOBREAK_SPACE),d.node.parentNode.insertBefore(c,i)):(f(c).text(f.NOBREAK_SPACE),this.quill.root.appendChild(c)),this._moveCursor(a,c),f(c).remove(),b&&f(d.node.parentNode).normalize(),this.quill.editor.selection.update(e.sources.SILENT)},b}(c),e.registerModule("multi-cursor",d),b.exports=d},{"../quill":35,eventemitter2:3}],31:[function(a,b){var c,d,e,f,g,h;f=a("../quill"),d=a("../core/document"),h=f.require("lodash"),g=f.require("dom"),c=f.require("delta"),e=function(){function a(a,b){this.quill=a,this.options=b,this.container=this.quill.addContainer("paste-container"),this.container.setAttribute("contenteditable",!0),this.quill.addStyles({".paste-container":{left:"-10000px",position:"absolute",top:"50%"}}),g(this.quill.root).on("paste",h.bind(this._paste,this))}return a.prototype._paste=function(){var a,b,e,f,i,j;return e=this.quill.getLength(),f=this.quill.getSelection(),null!=f?(this.container.innerHTML="",a=g(this.quill.root).window(),b=a.scrollY,i=window.scrollX,j=window.scrollY,this.container.focus(),h.defer(function(e){return function(){var g,h,k,l,m,n,o;return h=new d(e.container,e.quill.options),g=h.toDelta(),k=g.length()-1,g.compose((new c).retain(k)["delete"](1)),f.start>0&&g.ops.unshift({retain:f.start}),g["delete"](f.end-f.start),e.quill.updateContents(g,"user"),e.quill.setSelection(f.start+k,f.start+k),o=e.quill.editor.doc.findLineAt(f.start+k),l=o[0],n=o[1],m=l.node.offsetTop+l.node.offsetHeight,m>b+e.quill.root.offsetHeight&&(b=l.node.offsetTop-e.quill.root.offsetHeight/2),a.scrollTo(0,b),window.scrollTo(i,j)}}(this))):void 0},a}(),f.registerModule("paste-manager",e),b.exports=e},{"../core/document":12,"../quill":35}],32:[function(a,b){var c,d,e,f;c=a("../quill"),f=c.require("lodash"),e=c.require("dom"),d=function(){function a(b,c){if(this.quill=b,this.options=c,null==this.options.container)throw new Error("container required for toolbar",this.options);this.container=f.isString(this.options.container)?document.querySelector(this.options.container):this.options.container,this.inputs={},this.preventUpdate=!1,this.triggering=!1,f.each(this.quill.options.formats,function(b){return function(c){return null==a.formats.TOOLTIP[c]?b.initFormat(c,function(d,e){return b.triggering?void 0:(d.isCollapsed()?b.quill.prepareFormat(c,e):null!=a.formats.LINE[c]?b.quill.formatLine(d,c,e,"user"):b.quill.formatText(d,c,e,"user"),f.defer(function(){return b.updateActive(d,["bullet","list"]),b.setActive(c,e)}))}):void 0}}(this)),this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,function(a){return function(b){return null!=b?a.updateActive(b):void 0}}(this)),this.quill.onModuleLoad("keyboard",function(a){return function(b){return b.addHotkey([e.KEYS.BACKSPACE,e.KEYS.DELETE,e.KEYS.ENTER],function(){return f.defer(f.bind(a.updateActive,a))})}}(this)),e(this.container).addClass("ql-toolbar-container"),e.isIOS()&&e(this.container).addClass("ios"),e.isIE(11)&&e(this.container).on("mousedown",function(){return function(){return!1}}(this))}return a.DEFAULTS={container:null},a.formats={LINE:{align:"align",bullet:"bullet",list:"list"},SELECT:{align:"align",background:"background",color:"color",font:"font",size:"size"},TOGGLE:{bold:"bold",bullet:"bullet",image:"image",italic:"italic",link:"link",list:"list",strike:"strike",underline:"underline"},TOOLTIP:{image:"image",link:"link"}},a.prototype.initFormat=function(b,c){var d,f,g;return g=".ql-"+b,null!=a.formats.SELECT[b]?(g="select"+g,d="change"):d="click",f=this.container.querySelector(g),null!=f?(this.inputs[b]=f,e(f).on(d,function(a){return function(){var b,g;return g="change"===d?e(f).value():!e(f).hasClass("ql-active"),a.preventUpdate=!0,a.quill.focus(),b=a.quill.getSelection(),null!=b&&c(b,g),a.preventUpdate=!1,!0}}(this))):void 0},a.prototype.setActive=function(a,b){var c,d,g,h;return d=this.inputs[a],null!=d?(c=e(d),"SELECT"===d.tagName?(this.triggering=!0,g=c.value(d),null==b&&(b=null!=(h=c["default"]())?h.value:void 0),f.isArray(b)&&(b=""),b!==g&&(null!=b?c.option(b,!1):c.reset(!1)),this.triggering=!1):c.toggleClass("ql-active",b||!1)):void 0},a.prototype.updateActive=function(a,b){var c;return null==b&&(b=null),a||(a=this.quill.getSelection()),null==a||this.preventUpdate?void 0:(c=this._getActive(a),f.each(this.inputs,function(a){return function(d,e){return(!f.isArray(b)||b.indexOf(e)>-1)&&a.setActive(e,c[e]),!0}}(this)))},a.prototype._getActive=function(a){var b,c;return b=this._getLeafActive(a),c=this._getLineActive(a),f.defaults({},b,c)},a.prototype._getLeafActive=function(a){var b,c,d,e,g;return a.isCollapsed()?(g=this.quill.editor.doc.findLineAt(a.start),d=g[0],e=g[1],b=0===e?this.quill.getContents(a.start,a.end+1):this.quill.getContents(a.start-1,a.end)):b=this.quill.getContents(a),c=f.map(b.ops,"attributes"),this._intersectFormats(c)},a.prototype._getLineActive=function(a){var b,c,d,e,g,h;for(c=[],g=this.quill.editor.doc.findLineAt(a.start),b=g[0],e=g[1],h=this.quill.editor.doc.findLineAt(a.end),d=h[0],e=h[1],null!=d&&d===b&&(d=d.next);null!=b&&b!==d;)c.push(f.clone(b.formats)),b=b.next;return this._intersectFormats(c)},a.prototype._intersectFormats=function(b){return f.reduce(b.slice(1),function(b,c){var d,e,g,h,i;return d=f.keys(b),g=f.keys(c),h=f.intersection(d,g),i=f.difference(d,g),e=f.difference(g,d),f.each(h,function(d){if(null!=a.formats.SELECT[d])if(f.isArray(b[d])){if(f.indexOf(b[d],c[d])<0)return b[d].push(c[d])}else if(b[d]!==c[d])return b[d]=[b[d],c[d]]}),f.each(i,function(c){return null!=a.formats.TOGGLE[c]?delete b[c]:null==a.formats.SELECT[c]||f.isArray(b[c])?void 0:b[c]=[b[c]]}),f.each(e,function(d){return null!=a.formats.SELECT[d]?b[d]=[c[d]]:void 0}),b},b[0]||{})},a}(),c.registerModule("toolbar",d),b.exports=d},{"../quill":35}],33:[function(a,b){var c,d,e,f,g;d=a("../quill"),c=a("../lib/normalizer"),g=d.require("lodash"),f=d.require("dom"),e=function(){function a(b,d){this.quill=b,this.options=d,this.quill.addStyles(this.options.styles),this.container=this.quill.addContainer("tooltip"),this.container.innerHTML=c.stripWhitespace(this.options.template),this.container.style.position="absolute",f(this.quill.root).on("focus",g.bind(this.hide,this)),this.hide(),this.quill.on(this.quill.constructor.events.TEXT_CHANGE,function(b){return function(c,d){return"user"===d&&b.container.style.left!==a.HIDE_MARGIN?(b.range=null,b.hide()):void 0
}}(this))}return a.DEFAULTS={offset:10,styles:{".tooltip":{"background-color":"#fff",border:"1px solid #000",top:"0px","white-space":"nowrap","z-index":"2000"},".tooltip a":{cursor:"pointer","text-decoration":"none"}},template:""},a.HIDE_MARGIN="-10000px",a.prototype.initTextbox=function(a,b,c){return f(a).on("keyup",function(a){return function(d){switch(d.which){case f.KEYS.ENTER:return b.call(a);case f.KEYS.ESCAPE:return c.call(a);default:return!0}}}(this))},a.prototype.hide=function(){return this.container.style.left=a.HIDE_MARGIN,this.range&&this.quill.setSelection(this.range),this.range=null},a.prototype.show=function(a){var b,c,d,e,g;return this.range=this.quill.getSelection(),e=this._position(a),b=e[0],c=e[1],g=this._limit(b,c),b=g[0],c=g[1],d=f(this.quill.root).window(),b+=d.pageXOffset,c+=d.pageYOffset,this.container.style.left=""+b+"px",this.container.style.top=""+c+"px",this.container.focus()},a.prototype._getBounds=function(){var a,b,c,d;return a=this.quill.root.getBoundingClientRect(),d=f(this.quill.root).window(),b=d.pageXOffset,c=d.pageYOffset,{left:a.left+b,right:a.right+b,top:a.top+c,bottom:a.bottom+c,width:a.width,height:a.height}},a.prototype._limit=function(a,b){var c,d;return c=this._getBounds(),d=this.container.getBoundingClientRect(),a=Math.min(c.right-d.width,a),a=Math.max(c.left,a),b=Math.min(c.bottom-d.height,b),b=Math.max(c.top,b),[a,b]},a.prototype._position=function(a){var b,c,d,e,f;return e=this.container.getBoundingClientRect(),b=this._getBounds(),null!=a?(d=a.getBoundingClientRect(),c=d.left+d.width/2-e.width/2,f=d.top+d.height+this.options.offset,f+e.height>b.bottom&&(f=d.top-e.height-this.options.offset)):(c=b.left+b.width/2-e.width/2,f=b.top+b.height/2-e.height/2),[c,f]},a}(),d.registerModule("tooltip",e),b.exports=e},{"../lib/normalizer":23,"../quill":35}],34:[function(a,b){var c,d,e,f;d=a("../quill"),f=d.require("lodash"),c=d.require("delta"),e=function(){function a(a,b){this.quill=a,this.options=null!=b?b:{},this.lastRecorded=0,this.emittedDelta=null,this.clear(),this.initListeners()}return a.DEFAULTS={delay:1e3,maxStack:100},a.hotkeys={UNDO:{key:"Z",metaKey:!0},REDO:{key:"Z",metaKey:!0,shiftKey:!0}},a.prototype.initListeners=function(){return this.quill.onModuleLoad("keyboard",function(b){return function(c){return c.addHotkey(a.hotkeys.UNDO,function(){return b.undo(),!1}),c.addHotkey(a.hotkeys.REDO,function(){return b.redo(),!1})}}(this)),this.quill.on(this.quill.constructor.events.TEXT_CHANGE,function(a){return function(b){return f.isEqual(b,a.emittedDelta)?void 0:(a.record(b,a.oldDelta),a.oldDelta=a.quill.getContents())}}(this))},a.prototype.clear=function(){return this.stack={undo:[],redo:[]},this.oldDelta=this.quill.getContents()},a.prototype.record=function(a){var b,c,d,e;if(a.ops.length>0){this.stack.redo=[];try{if(e=this.quill.getContents().diff(this.oldDelta),d=(new Date).getTime(),this.lastRecorded+this.options.delay>d&&this.stack.undo.length>0?(b=this.stack.undo.pop(),e=e.compose(b.undo),a=b.redo.compose(a)):this.lastRecorded=d,this.stack.undo.push({redo:a,undo:e}),this.stack.undo.length>this.options.maxStack)return this.stack.undo.unshift()}catch(f){return c=f,this.clear()}}},a.prototype.redo=function(){return this._change("redo","undo")},a.prototype.undo=function(){return this._change("undo","redo")},a.prototype._getLastChangeIndex=function(a){var b,c;return c=0,b=0,a.ops.forEach(function(a){return null!=a.insert?c=Math.max(b+(a.insert.length||1),c):null!=a["delete"]?c=Math.max(b,c):null!=a.retain?(null!=a.attributes&&(c=Math.max(b+a.retain,c)),b+=a.retain):void 0}),c},a.prototype._change=function(a,b){var c,d;return this.stack[a].length>0?(c=this.stack[a].pop(),this.lastRecorded=0,this.emittedDelta=c[a],this.quill.updateContents(c[a],"user"),this.emittedDelta=null,d=this._getLastChangeIndex(c[a]),this.quill.setSelection(d,d),this.oldDelta=this.quill.getContents(),this.stack[b].push(c)):void 0},a}(),d.registerModule("undo-manager",e),b.exports=e},{"../quill":35}],35:[function(a,b){var c,d,e,f,g,h,i,j,k,l={}.hasOwnProperty,m=function(a,b){function c(){this.constructor=a}for(var d in b)l.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},n=[].slice;k=a("lodash"),j=a("../package.json"),c=a("rich-text").Delta,e=a("eventemitter2").EventEmitter2,i=a("./lib/dom"),d=a("./core/editor"),f=a("./core/format"),h=a("./lib/range"),g=function(a){function b(a,c){var e,f,g;if(null==c&&(c={}),k.isString(a)&&(a=document.querySelector(a)),null==a)throw new Error("Invalid Quill container");if(f=k.defaults(c.modules||{},b.DEFAULTS.modules),e=a.innerHTML,this.options=k.defaults(c,b.DEFAULTS),this.options.modules=f,this.options.id=this.id="quill-"+(b.editors.length+1),this.options.emitter=this,this.modules={},this.editor=new d(a,this,this.options),this.root=this.editor.doc.root,b.editors.push(this),this.setHTML(e,b.sources.SILENT),g=b.themes[this.options.theme],null==g)throw new Error("Cannot load "+this.options.theme+" theme. Are you sure you registered it?");this.theme=new g(this,this.options),k.each(this.options.modules,function(a){return function(b,c){return a.addModule(c,b)}}(this))}return m(b,a),b.version=j.version,b.editors=[],b.modules=[],b.themes=[],b.DEFAULTS={formats:["align","bold","italic","strike","underline","color","background","font","size","link","image","bullet","list"],modules:{keyboard:!0,"paste-manager":!0,"undo-manager":!0},pollInterval:100,readOnly:!1,theme:"default"},b.events={MODULE_INIT:"module-init",POST_EVENT:"post-event",PRE_EVENT:"pre-event",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources=d.sources,b.registerModule=function(a,c){return null!=b.modules[a]&&console.warn("Overwriting "+a+" module"),b.modules[a]=c},b.registerTheme=function(a,c){return null!=b.themes[a]&&console.warn("Overwriting "+a+" theme"),b.themes[a]=c},b.require=function(a){switch(a){case"lodash":return k;case"delta":return c;case"dom":return i;default:return null}},b.prototype.addContainer=function(a,b){return null==b&&(b=!1),this.editor.renderer.addContainer(a,b)},b.prototype.addFormat=function(a,b){return this.editor.doc.addFormat(a,b)},b.prototype.addModule=function(a,c){var d;if(d=b.modules[a],null==d)throw new Error("Cannot load "+a+" module. Are you sure you registered it?");return k.isObject(c)||(c={}),c=k.defaults(c,this.theme.constructor.OPTIONS[a]||{},d.DEFAULTS||{}),this.modules[a]=new d(this,c),this.emit(b.events.MODULE_INIT,a,this.modules[a]),this.modules[a]},b.prototype.addStyles=function(a){return this.editor.renderer.addStyles(a)},b.prototype.deleteText=function(a,d,e){var f,g,h;return null==e&&(e=b.sources.API),h=this._buildParams(a,d,{},e),a=h[0],d=h[1],g=h[2],e=h[3],d>a?(f=(new c).retain(a)["delete"](d-a),this.editor.applyDelta(f,e)):void 0},b.prototype.emit=function(){var a,c;return c=arguments[0],a=2<=arguments.length?n.call(arguments,1):[],b.__super__.emit.apply(this,[b.events.PRE_EVENT,c].concat(n.call(a))),b.__super__.emit.apply(this,[c].concat(n.call(a))),b.__super__.emit.apply(this,[b.events.POST_EVENT,c].concat(n.call(a)))},b.prototype.focus=function(){return this.editor.focus()},b.prototype.formatLine=function(a,b,c,d,e){var f,g,h,i,j;return i=this._buildParams(a,b,c,d,e),a=i[0],b=i[1],f=i[2],e=i[3],j=this.editor.doc.findLineAt(b),g=j[0],h=j[1],null!=g&&(b+=g.length-h),this.formatText(a,b,f,e)},b.prototype.formatText=function(a,b,d,e,f){var g,h,i;return i=this._buildParams(a,b,d,e,f),a=i[0],b=i[1],h=i[2],f=i[3],h=k.reduce(h,function(a){return function(b,c,d){var e;return e=a.editor.doc.formats[d],c&&c!==e.config["default"]||(b[d]=null),b}}(this),h),g=(new c).retain(a).retain(b-a,h),this.editor.applyDelta(g,f)},b.prototype.getContents=function(a,b){return null==a&&(a=0),null==b&&(b=null),k.isObject(a)&&(b=a.end,a=a.start),this.editor.getDelta().slice(a,b)},b.prototype.getHTML=function(){return this.root.innerHTML},b.prototype.getLength=function(){return this.editor.getDelta().length()},b.prototype.getModule=function(a){return this.modules[a]},b.prototype.getSelection=function(){return this.editor.checkUpdate(),this.editor.selection.getRange()},b.prototype.getText=function(a,b){return null==a&&(a=0),null==b&&(b=null),k.map(this.getContents(a,b).ops,function(a){return k.isString(a.insert)?a.insert:""}).join("")},b.prototype.insertEmbed=function(a,b,c,d){return this.insertText(a,i.EMBED_TEXT,b,c,d)},b.prototype.insertText=function(a,b,d,e,f){var g,h,i,j;return j=this._buildParams(a,0,d,e,f),a=j[0],h=j[1],i=j[2],f=j[3],b.length>0?(g=(new c).retain(a).insert(b,i),this.editor.applyDelta(g,f)):void 0},b.prototype.onModuleLoad=function(a,c){return this.modules[a]?c(this.modules[a]):this.on(b.events.MODULE_INIT,function(b,d){return b===a?c(d):void 0})},b.prototype.prepareFormat=function(a,c){var d,e;return d=this.editor.doc.formats[a],null!=d&&(e=this.getSelection(),null!=e?e.isCollapsed():void 0)?d.isType(f.types.LINE)?this.formatLine(e,a,c,b.sources.USER):d.prepare(c):void 0},b.prototype.setContents=function(a,c){return null==c&&(c=b.sources.API),k.isArray(a)&&(a={ops:a}),a.ops.unshift({"delete":this.getLength()}),this.updateContents(a,c)},b.prototype.setHTML=function(a,c){return null==c&&(c=b.sources.API),a||(a="<"+i.DEFAULT_BLOCK_TAG+"><"+i.DEFAULT_BREAK_TAG+">"+i.DEFAULT_BLOCK_TAG+">"),this.editor.doc.setHTML(a),this.editor.checkUpdate(c)},b.prototype.setSelection=function(a,c,d){var e;return null==d&&(d=b.sources.API),k.isNumber(a)&&k.isNumber(c)?e=new h(a,c):(e=a,d=c||d),this.editor.selection.setRange(e,d)},b.prototype.updateContents=function(a,c){return null==c&&(c=b.sources.API),this.editor.applyDelta(a,c)},b.prototype._buildParams=function(){var a,c;return c=1<=arguments.length?n.call(arguments,0):[],k.isObject(c[0])&&c.splice(0,1,c[0].start,c[0].end),k.isString(c[2])&&(a={},a[c[2]]=c[3],c.splice(2,2,a)),null==c[3]&&(c[3]=b.sources.API),c},b}(e),g.registerTheme("default",a("./themes/default")),g.registerTheme("snow",a("./themes/snow")),b.exports=g},{"../package.json":11,"./core/editor":13,"./core/format":14,"./lib/dom":21,"./lib/range":25,"./themes/default":36,"./themes/snow":37,eventemitter2:3,lodash:"M4+//f","rich-text":4}],36:[function(a,b){var c;c=function(){function a(a){this.quill=a,this.editor=this.quill.editor,this.editorContainer=this.editor.root}return a.OPTIONS={},a}(),b.exports=c},{}],37:[function(a,b){var c,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};h=a("lodash"),c=a("../../lib/color-picker"),d=a("../default"),g=a("../../lib/dom"),e=a("../../lib/picker"),f=function(a){function b(a){this.quill=a,b.__super__.constructor.apply(this,arguments),this.quill.addStyles(b.STYLES),this.pickers=[],this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,function(a){return function(b){return null!=b?h.invoke(a.pickers,"close"):void 0}}(this)),g(this.quill.root.ownerDocument.body).addClass("snow"),this.quill.onModuleLoad("multi-cursor",h.bind(this.extendMultiCursor,this)),this.quill.onModuleLoad("toolbar",h.bind(this.extendToolbar,this))}return j(b,a),b.COLORS=["#000000","#e60000","#ff9900","#ffff00","#008A00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],b.OPTIONS={"multi-cursor":{template:' '}},b.STYLES={".snow .image-tooltip-container a":{border:"1px solid #06c"},".snow .image-tooltip-container a.insert":{"background-color":"#06c",color:"#fff"},".snow .cursor-name":{"border-radius":"4px","font-size":"11px","font-family":"Arial","margin-left":"-50%",padding:"4px 10px"},".snow .cursor-triangle":{"border-left":"4px solid transparent","border-right":"4px solid transparent",height:"0px","margin-left":"-3px",width:"0px"},".snow .cursor.left .cursor-name":{"margin-left":"-8px"},".snow .cursor.right .cursor-flag":{right:"auto"},".snow .cursor.right .cursor-name":{"margin-left":"-100%","margin-right":"-8px"},".snow .cursor-triangle.bottom":{"border-top":"4px solid transparent",display:"block","margin-bottom":"-1px"},".snow .cursor-triangle.top":{"border-bottom":"4px solid transparent",display:"none","margin-top":"-1px"},".snow .cursor.top .cursor-triangle.bottom":{display:"none"},".snow .cursor.top .cursor-triangle.top":{display:"block"},".snow a":{color:"#06c"},".snow .tooltip":{border:"1px solid #ccc","box-shadow":"0px 0px 5px #ddd",color:"#222"},".snow .tooltip a":{color:"#06c"},".snow .tooltip .input":{border:"1px solid #ccc",margin:"0px",padding:"5px"},".snow .image-tooltip-container .preview":{"border-color":"#ccc",color:"#ccc"},".snow .link-tooltip-container a, .snow .link-tooltip-container span":{display:"inline-block","line-height":"25px"}},b.prototype.extendMultiCursor=function(a){return a.on(a.constructor.events.CURSOR_ADDED,function(a){var b,c;return b=a.elem.querySelector(".cursor-triangle.bottom"),c=a.elem.querySelector(".cursor-triangle.top"),b.style.borderTopColor=c.style.borderBottomColor=a.color})},b.prototype.extendToolbar=function(a){return h.each(["color","background","font","size","align"],function(b){return function(d){var f,i;if(i=a.container.querySelector(".ql-"+d),null!=i){switch(d){case"font":case"size":case"align":f=new e(i);break;case"color":case"background":f=new c(i),h.each(f.container.querySelectorAll(".ql-picker-item"),function(a,b){return 7>b?g(a).addClass("ql-primary-color"):void 0})}return null!=f?b.pickers.push(f):void 0}}}(this)),h.each(g(a.container).textNodes(),function(a){return 0===g(a).text().trim().length?g(a).remove():void 0})},b}(d),b.exports=f},{"../../lib/color-picker":20,"../../lib/dom":21,"../../lib/picker":24,"../default":36,lodash:"M4+//f"}]},{},[19])(19)});