!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Quill")):"function"==typeof define&&define.amd?define(["Quill"],t):"object"==typeof exports?exports.QuillBlotFormatter=t(require("Quill")):e.QuillBlotFormatter=t(e.Quill)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.onClick=function(){n.hide()},this.quill=t,this.options=(0,l.default)(s.default,r,{arrayMerge:p}),this.currentSpec=null,this.actions=[],this.overlay=document.createElement("div"),this.overlay.classList.add(this.options.overlay.className),this.options.overlay.style&&Object.assign(this.overlay.style,this.options.overlay.style),document.execCommand("enableObjectResizing",!1,"false"),this.quill.root.parentNode.style.position=this.quill.root.parentNode.style.position||"relative",this.quill.root.addEventListener("click",this.onClick),this.specs=this.options.specs.map(function(e){return new e(n)}),this.specs.forEach(function(e){return e.init()})}return i(e,[{key:"show",value:function(e){this.currentSpec=e,this.currentSpec.setSelection(),this.setUserSelect("none"),this.quill.root.parentNode.appendChild(this.overlay),this.repositionOverlay(),this.createActions(e)}},{key:"hide",value:function(){this.currentSpec&&(this.currentSpec.onHide(),this.currentSpec=null,this.quill.root.parentNode.removeChild(this.overlay),this.overlay.style.setProperty("display","none"),this.setUserSelect(""),this.destroyActions())}},{key:"update",value:function(){this.repositionOverlay(),this.actions.forEach(function(e){return e.onUpdate()})}},{key:"createActions",value:function(e){var t=this;this.actions=e.getActions().map(function(e){var n=new e(t);return n.onCreate(),n})}},{key:"destroyActions",value:function(){this.actions.forEach(function(e){return e.onDestroy()}),this.actions=[]}},{key:"repositionOverlay",value:function(){if(this.currentSpec){var e=this.currentSpec.getOverlayElement();if(e){var t=this.quill.root.parentNode,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",left:n.left-r.left-1+t.scrollLeft+"px",top:n.top-r.top+t.scrollTop+"px",width:n.width+"px",height:n.height+"px"})}}}},{key:"setUserSelect",value:function(e){var t=this;["userSelect","mozUserSelect","webkitUserSelect","msUserSelect"].forEach(function(n){t.quill.root.style.setProperty(n,e),document.documentElement&&document.documentElement.style.setProperty(n,e)})}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n\n \n \n \n \n ',center:'\n \n \n \n \n \n ',right:'\n \n \n \n \n \n '},toolbar:{allowDeselect:!0,mainClassName:"blot-formatter__toolbar",mainStyle:{position:"absolute",top:"-12px",right:"0",left:"0",height:"0",minWidth:"100px",font:"12px/1.0 Arial, Helvetica, sans-serif",textAlign:"center",color:"#333",boxSizing:"border-box",cursor:"default",zIndex:"1"},buttonClassName:"blot-formatter__toolbar-button",addButtonSelectStyle:!0,buttonStyle:{display:"inline-block",width:"24px",height:"24px",background:"white",border:"1px solid #999",verticalAlign:"middle"},svgStyle:{display:"inline-block",width:"24px",height:"24px",background:"white",border:"1px solid #999",verticalAlign:"middle"}}},resize:{handleClassName:"blot-formatter__resize-handle",handleStyle:{position:"absolute",height:"12px",width:"12px",backgroundColor:"white",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80"}}};t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n0&&(e.style.borderLeftWidth="0")),n.options.align.toolbar.svgStyle&&Object.assign(e.children[0].style,n.options.align.toolbar.svgStyle)}},{key:"addButtons",value:function(e,t,n){var r=this;n.getAlignments().forEach(function(o,i){var a=document.createElement("span");a.classList.add(e.options.align.toolbar.buttonClassName),a.innerHTML=o.icon,a.addEventListener("click",function(){r.onButtonClick(a,e,o,n)}),r.preselectButton(a,o,e,n),r.addButtonStyle(a,i,e),r.buttons.push(a),t.appendChild(a)})}},{key:"preselectButton",value:function(e,t,n,r){if(n.currentSpec){var o=n.currentSpec.getTargetElement();o&&r.isAligned(o,t)&&this.selectButton(n,e)}}},{key:"onButtonClick",value:function(e,t,n,r){if(t.currentSpec){var o=t.currentSpec.getTargetElement();o&&this.clickButton(e,o,t,n,r)}}},{key:"clickButton",value:function(e,t,n,r,o){var i=this;this.buttons.forEach(function(e){i.deselectButton(n,e)}),o.isAligned(t,r)?n.options.align.toolbar.allowDeselect?o.clear(t):this.selectButton(n,e):(this.selectButton(n,e),r.apply(t)),n.update()}},{key:"selectButton",value:function(e,t){t.classList.add("is-selected"),e.options.align.toolbar.addButtonSelectStyle&&t.style.setProperty("filter","invert(20%)")}},{key:"deselectButton",value:function(e,t){t.classList.remove("is-selected"),e.options.align.toolbar.addButtonSelectStyle&&t.style.removeProperty("filter")}}]),e}());t.default=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n