-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage-resize.min.js
1 lines (1 loc) · 42.7 KB
/
image-resize.min.js
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ImageResize=e():t.ImageResize=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=40)}([function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){var r=n(23),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(80),i=n(81),s=n(82),u=n(83),a=n(84);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=s,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,e,n){function r(t,e){for(var n=t.length;n--;)if(o(t[n][0],e))return n;return-1}var o=n(8);t.exports=r},function(t,e,n){function r(t){return null==t?void 0===t?a:u:c&&c in Object(t)?i(t):s(t)}var o=n(17),i=n(69),s=n(92),u="[object Null]",a="[object Undefined]",c=o?o.toStringTag:void 0;t.exports=r},function(t,e,n){function r(t,e){var n=t.__data__;return o(e)?n["string"==typeof e?"string":"hash"]:n.map}var o=n(78);t.exports=r},function(t,e,n){var r=n(11),o=r(Object,"create");t.exports=o},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",function(){return o});var o=function t(e){r(this,t),this.onCreate=function(){},this.onDestroy=function(){},this.onUpdate=function(){},this.overlay=e.overlay,this.img=e.img,this.options=e.options,this.requestUpdate=e.onUpdate}},function(t,e,n){function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var o=n(22);t.exports=r},function(t,e,n){function r(t,e){var n=i(t,e);return o(n)?n:void 0}var o=n(53),i=n(70);t.exports=r},function(t,e,n){function r(t){return null!=t&&i(t.length)&&!o(t)}var o=n(13),i=n(31);t.exports=r},function(t,e,n){function r(t){if(!i(t))return!1;var e=o(t);return e==u||e==a||e==s||e==c}var o=n(5),i=n(0),s="[object AsyncFunction]",u="[object Function]",a="[object GeneratorFunction]",c="[object Proxy]";t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){function r(t){return null===t||void 0===t}function o(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,n){var i,l;if(r(t)||r(e))return!1;if(t.prototype!==e.prototype)return!1;if(a(t))return!!a(e)&&(t=s.call(t),e=s.call(e),c(t,e,n));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}try{var f=u(t),p=u(e)}catch(t){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),i=f.length-1;i>=0;i--)if(f[i]!=p[i])return!1;for(i=f.length-1;i>=0;i--)if(l=f[i],!c(t[l],e[l],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,u=n(42),a=n(41),c=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:i(t,e,n))}},function(t,e,n){var r=n(11),o=n(1),i=r(o,"Map");t.exports=i},function(t,e,n){var r=n(1),o=r.Symbol;t.exports=o},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=n},function(t,e,n){function r(t,e,n){(void 0===n||i(t[e],n))&&(void 0!==n||e in t)||o(t,e,n)}var o=n(10),i=n(8);t.exports=r},function(t,e,n){function r(t,e,n,l,f){t!==e&&s(e,function(s,c){if(a(s))f||(f=new o),u(t,e,c,n,r,l,f);else{var p=l?l(t[c],s,c+"",t,e,f):void 0;void 0===p&&(p=s),i(t,c,p)}},c)}var o=n(46),i=n(19),s=n(51),u=n(56),a=n(0),c=n(33);t.exports=r},function(t,e,n){function r(t,e){return s(i(t,e,o),t+"")}var o=n(27),i=n(94),s=n(95);t.exports=r},function(t,e,n){var r=n(11),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(116))},function(t,e,n){var r=n(93),o=r(Object.getPrototypeOf,Object);t.exports=o},function(t,e){function n(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<e}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e){function n(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}var r=Object.prototype;t.exports=n},function(t,e){function n(t){return t}t.exports=n},function(t,e,n){var r=n(52),o=n(2),i=Object.prototype,s=i.hasOwnProperty,u=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return o(t)&&s.call(t,"callee")&&!u.call(t,"callee")};t.exports=a},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){(function(t){var r=n(1),o=n(107),i="object"==typeof e&&e&&!e.nodeType&&e,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=s&&s.exports===i,a=u?r.Buffer:void 0,c=a?a.isBuffer:void 0,l=c||o;t.exports=l}).call(e,n(14)(t))},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e,n){var r=n(54),o=n(59),i=n(91),s=i&&i.isTypedArray,u=s?o(s):r;t.exports=u},function(t,e,n){function r(t){return s(t)?o(t,!0):i(t)}var o=n(48),i=n(55),s=n(12);t.exports=r},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===o.call(t)},s=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e=r.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!n)return!1;var i;for(i in t);return void 0===i||r.call(t,i)};t.exports=function t(){var e,n,r,o,u,a,c=arguments[0],l=1,f=arguments.length,p=!1;for("boolean"==typeof c&&(p=c,c=arguments[1]||{},l=2),(null==c||"object"!=typeof c&&"function"!=typeof c)&&(c={});l<f;++l)if(null!=(e=arguments[l]))for(n in e)r=c[n],o=e[n],c!==o&&(p&&o&&(s(o)||(u=i(o)))?(u?(u=!1,a=r&&i(r)?r:[]):a=r&&s(r)?r:{},c[n]=t(p,a,o)):void 0!==o&&(c[n]=o));return c}},function(t,e,n){"use strict";e.a={modules:["DisplaySize","Toolbar","Resize"],overlayStyles:{position:"absolute",boxSizing:"border-box",border:"1px dashed #444"},handleStyles:{position:"absolute",height:"12px",width:"12px",backgroundColor:"white",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80"},displayStyles:{position:"absolute",font:"12px/1.0 Arial, Helvetica, sans-serif",padding:"4px 8px",textAlign:"center",backgroundColor:"white",color:"#333",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80",cursor:"default"},toolbarStyles:{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"},toolbarButtonStyles:{display:"inline-block",width:"24px",height:"24px",background:"white",border:"1px solid #999",verticalAlign:"middle"},toolbarButtonSvgStyles:{fill:"#444",stroke:"#444",strokeWidth:"2"}}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s=n(9);n.d(e,"a",function(){return u});var u=function(t){function e(){var t,n,i,s;r(this,e);for(var u=arguments.length,a=Array(u),c=0;c<u;c++)a[c]=arguments[c];return n=i=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a))),i.onCreate=function(){i.display=document.createElement("div"),Object.assign(i.display.style,i.options.displayStyles),i.overlay.appendChild(i.display)},i.onDestroy=function(){},i.onUpdate=function(){if(i.display&&i.img){var t=i.getCurrentSize();if(i.display.innerHTML=t.join(" × "),t[0]>120&&t[1]>30)Object.assign(i.display.style,{right:"4px",bottom:"4px",left:"auto"});else{var e=i.display.getBoundingClientRect();Object.assign(i.display.style,{right:"-"+(e.width+4)+"px",bottom:"-"+(e.height+4)+"px",left:"auto"})}}},i.getCurrentSize=function(){return[i.img.width,Math.round(i.img.width/i.img.naturalWidth*i.img.naturalHeight)]},s=n,o(i,s)}return i(e,t),e}(s.a)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s=n(9);n.d(e,"a",function(){return u});var u=function(t){function e(){var t,n,i,s;r(this,e);for(var u=arguments.length,a=Array(u),c=0;c<u;c++)a[c]=arguments[c];return n=i=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a))),i.onCreate=function(){i.boxes=[],i.addBox("nwse-resize"),i.addBox("nesw-resize"),i.addBox("nwse-resize"),i.addBox("nesw-resize"),i.positionBoxes()},i.onDestroy=function(){i.setCursor("")},i.positionBoxes=function(){var t=-parseFloat(i.options.handleStyles.width)/2+"px",e=-parseFloat(i.options.handleStyles.height)/2+"px";[{left:t,top:e},{right:t,top:e},{right:t,bottom:e},{left:t,bottom:e}].forEach(function(t,e){Object.assign(i.boxes[e].style,t)})},i.addBox=function(t){var e=document.createElement("div");Object.assign(e.style,i.options.handleStyles),e.style.cursor=t,e.style.width=i.options.handleStyles.width+"px",e.style.height=i.options.handleStyles.height+"px",e.addEventListener("mousedown",i.handleMousedown,!1),e.addEventListener("touchstart",i.handleMousedown,!1),i.overlay.appendChild(e),i.boxes.push(e)},i.handleMousedown=function(t){i.dragBox=t.target,t.touches?i.dragStartX=t.touches[0].clientX:i.dragStartX=t.clientX,i.preDragWidth=i.img.width||i.img.naturalWidth,i.setCursor(i.dragBox.style.cursor),document.addEventListener("touchend",i.handleMouseup,!1),document.addEventListener("touchmove",i.handleDrag,!1),document.addEventListener("mousemove",i.handleDrag,!1),document.addEventListener("mouseup",i.handleMouseup,!1)},i.handleMouseup=function(){i.setCursor(""),document.addEventListener("touchend",i.handleMouseup,!1),document.addEventListener("touchmove",i.handleDrag,!1),document.removeEventListener("mousemove",i.handleDrag),document.removeEventListener("mouseup",i.handleMouseup)},i.handleDrag=function(t){if(i.img){var e=void 0;e=t.touches?t.touches[0].clientX-i.dragStartX:t.clientX-i.dragStartX,i.dragBox===i.boxes[0]||i.dragBox===i.boxes[3]?i.img.width=Math.round(i.preDragWidth-e):i.img.width=Math.round(i.preDragWidth+e),i.requestUpdate()}},i.setCursor=function(t){[document.body,i.img].forEach(function(e){e.style.cursor=t})},s=n,o(i,s)}return i(e,t),e}(s.a)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s=n(112),u=(n.n(s),n(111)),a=(n.n(u),n(113)),c=(n.n(a),n(115)),l=n.n(c),f=n(114),p=n.n(f),h=n(109),d=(n.n(h),n(9));n.d(e,"a",function(){return b});var y=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),v=window.Quill.imports.parchment.ClassAttributor,g=new v("class","rot"),b=function(t){function e(){var t,n,i,s;r(this,e);for(var u=arguments.length,a=Array(u),c=0;c<u;c++)a[c]=arguments[c];return n=i=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a))),i.rotation=0,i.onCreate=function(){"rot-90rotate"==i.img.classList[0]?i.rotation=90:"rot-180rotate"==i.img.classList[0]?i.rotation=180:"rot-minus90rotate"==i.img.classList[0]&&(i.rotation=-90),i.toolbar=document.createElement("div"),Object.assign(i.toolbar.style,i.options.toolbarStyles),i.overlay.appendChild(i.toolbar),i._definerotations(),i._addToolbarButtons()},i.onDestroy=function(){},i.onUpdate=function(){},i._definerotations=function(){i.rotationvalue="",i.rotations=[{name:"rotate-left",icon:l.a,apply:function(){i.rotationvalue=i._setRotation("left"),g.add(i.img,i.rotationvalue)},isApplied:function(){}},{name:"rotate-right",icon:p.a,apply:function(){i.rotationvalue=i._setRotation("right"),g.add(i.img,i.rotationvalue)},isApplied:function(){}}]},i._addToolbarButtons=function(){var t=[];i.rotations.forEach(function(e,n){var r=document.createElement("span");r.setAttribute("title",e.name),t.push(r),r.innerHTML=e.icon,r.addEventListener("click",function(){e.apply(),i.requestUpdate()}),Object.assign(r.style,i.options.toolbarButtonStyles),n>0&&(r.style.borderLeftWidth="0"),Object.assign(r.children[0].style,i.options.toolbarButtonSvgStyles),e.isApplied()&&i._selectButton(r),i.toolbar.appendChild(r)})},i._selectButton=function(t){"rotate-left"!=t.title&&"rotate-right"!=t.title&&(t.style.filter="invert(20%)")},s=n,o(i,s)}return i(e,t),y(e,[{key:"_setRotation",value:function(t){return 0==this.rotation&&"left"==t?(this.rotation=-90,"minus90rotate"):this.rotation==-90&&"left"==t?(this.rotation=180,"180rotate"):180==this.rotation&&"left"==t?(this.rotation=90,"90rotate"):90==this.rotation&&"left"==t?(this.rotation=0,"zerorotate"):0==this.rotation&&"right"==t?(this.rotation=90,"90rotate"):90==this.rotation&&"right"==t?(this.rotation=180,"180rotate"):180==this.rotation&&"right"==t?(this.rotation=-90,"minus90rotate"):this.rotation==-90&&"right"==t?(this.rotation=0,""):""}},{key:"setUserSelect",value:function(t){var e=this;["userSelect","mozUserSelect","webkitUserSelect","msUserSelect"].forEach(function(n){e.quill.root.style[n]=t,document.documentElement.style[n]=t})}}]),e}(d.a)},function(t,e,n){var r=n(18),o=n(21),i=n(68),s=n(106),u=o(function(t){return t.push(void 0,i),r(s,void 0,t)});t.exports=u},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(39),i=n.n(o),s=n(35),u=n(36),a=n(38),c=n(37),l={DisplaySize:u.a,Toolbar:a.a,Resize:c.a},f=window.Quill.imports.parchment,p=function t(e){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.initializeModules=function(){n.removeModules(),n.modules=n.moduleClasses.map(function(t){return new(l[t]||t)(n)}),n.modules.forEach(function(t){t.onCreate()}),n.onUpdate()},this.onUpdate=function(){n.repositionElements(),n.modules.forEach(function(t){t.onUpdate()})},this.removeModules=function(){n.modules.forEach(function(t){t.onDestroy()}),n.modules=[]},this.handleClick=function(t){if(t.target&&t.target.tagName&&"IMG"===t.target.tagName.toUpperCase()){if(n.img===t.target)return;n.img&&n.hide(),n.show(t.target)}else n.img&&n.hide()},this.show=function(t){n.img=t,n.showOverlay(),n.initializeModules()},this.showOverlay=function(){n.overlay&&n.hideOverlay(),n.setUserSelect(n.img);var t=f.Registry.find(n.img),e=n.quill.getIndex(t);n.quill.setSelection(e,0,"user"),document.addEventListener("keyup",n.checkImage,!0),n.quill.root.addEventListener("input",n.checkImage,!0),document.addEventListener("keydown",n.selectImage,!0),n.quill.on("text-change",n.repositionElements,!0),n.overlay=document.createElement("div"),Object.assign(n.overlay.style,n.options.overlayStyles),n.quill.root.parentNode.appendChild(n.overlay),n.repositionElements()},this.selectImage=function(t){if(n.img){var e=f.Registry.find(n.img),r=n.quill.getIndex(e);n.quill.setSelection(r,1,"user")}},this.hideOverlay=function(){n.overlay&&(n.quill.root.parentNode.removeChild(n.overlay),n.overlay=void 0,document.removeEventListener("keyup",n.checkImage),n.quill.root.removeEventListener("input",n.checkImage),document.removeEventListener("keydown",n.selectImage),n.quill.off("text-change",n.repositionElements),n.setUserSelect(""))},this.repositionElements=function(){if(n.overlay&&n.img){var t=n.quill.root.parentNode,e=n.img.getBoundingClientRect(),r=t.getBoundingClientRect();Object.assign(n.overlay.style,{left:e.left-r.left-1+t.scrollLeft+"px",top:e.top-r.top+t.scrollTop+"px",width:e.width+"px",height:e.height+"px"})}},this.hide=function(){n.hideOverlay(),n.removeModules(),n.img=void 0},this.setUserSelect=function(t){["userSelect","mozUserSelect","webkitUserSelect","msUserSelect"].forEach(function(e){n.quill.root.style[e]=t,document.documentElement.style[e]=t})},this.checkImage=function(t){if(n.img){var e=n;if(setTimeout(function(){e.repositionElements()}),[16,17,18].indexOf(t.keyCode)>=0){var r=f.Registry.find(n.img),o=n.quill.getIndex(r);return void n.quill.setSelection(o,0,"user")}if(46==t.keyCode||8==t.keyCode){var i=window.Quill.find(n.img);i&&i.deleteAt(0)}n.hide()}},this.quill=e;var u=!1;o.modules&&(u=o.modules.slice()),this.options=i()({},o,s.a),u!==!1&&(this.options.modules=u),document.execCommand("enableObjectResizing",!1,"false"),this.quill.root.addEventListener("click",this.handleClick,!1),this.quill.root.parentNode.style.position=this.quill.root.parentNode.style.position||"relative",this.moduleClasses=this.options.modules,this.modules=[]};e.default=p,window.Quill&&window.Quill.register("modules/imageResize",p)},function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=o?n:r,e.supported=n,e.unsupported=r},function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e){function n(t,e,n){if(t==e)return t?[[v,t]]:[];(n<0||t.length<n)&&(n=null);var o=s(t,e),i=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=u(t,e);var a=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var l=r(t,e);return i&&l.unshift([v,i]),a&&l.push([v,a]),c(l),null!=n&&(l=f(l,n)),l=p(l)}function r(t,e){var r;if(!t)return[[y,e]];if(!e)return[[d,t]];var i=t.length>e.length?t:e,s=t.length>e.length?e:t,u=i.indexOf(s);if(u!=-1)return r=[[y,i.substring(0,u)],[v,s],[y,i.substring(u+s.length)]],t.length>e.length&&(r[0][0]=r[2][0]=d),r;if(1==s.length)return[[d,t],[y,e]];var c=a(t,e);if(c){var l=c[0],f=c[1],p=c[2],h=c[3],g=c[4],b=n(l,p),x=n(f,h);return b.concat([[v,g]],x)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),s=o,u=2*o,a=new Array(u),c=new Array(u),l=0;l<u;l++)a[l]=-1,c[l]=-1;a[s+1]=0,c[s+1]=0;for(var f=n-r,p=f%2!=0,h=0,v=0,g=0,b=0,x=0;x<o;x++){for(var m=-x+h;m<=x-v;m+=2){var j,_=s+m;j=m==-x||m!=x&&a[_-1]<a[_+1]?a[_+1]:a[_-1]+1;for(var w=j-m;j<n&&w<r&&t.charAt(j)==e.charAt(w);)j++,w++;if(a[_]=j,j>n)v+=2;else if(w>r)h+=2;else if(p){var O=s+f-m;if(O>=0&&O<u&&c[O]!=-1){var k=n-c[O];if(j>=k)return i(t,e,j,w)}}}for(var E=-x+g;E<=x-b;E+=2){var k,O=s+E;k=E==-x||E!=x&&c[O-1]<c[O+1]?c[O+1]:c[O-1]+1;for(var A=k-E;k<n&&A<r&&t.charAt(n-k-1)==e.charAt(r-A-1);)k++,A++;if(c[O]=k,k>n)b+=2;else if(A>r)g+=2;else if(!p){var _=s+f-E;if(_>=0&&_<u&&a[_]!=-1){var j=a[_],w=s+j-_;if(k=n-k,j>=k)return i(t,e,j,w)}}}}return[[d,t],[y,e]]}function i(t,e,r,o){var i=t.substring(0,r),s=e.substring(0,o),u=t.substring(r),a=e.substring(o),c=n(i,s),l=n(u,a);return c.concat(l)}function s(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n<o;)t.substring(i,o)==e.substring(i,o)?(n=o,i=n):r=o,o=Math.floor((r-n)/2+n);return o}function u(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n<o;)t.substring(t.length-o,t.length-i)==e.substring(e.length-o,e.length-i)?(n=o,i=n):r=o,o=Math.floor((r-n)/2+n);return o}function a(t,e){function n(t,e,n){for(var r,o,i,a,c=t.substring(n,n+Math.floor(t.length/4)),l=-1,f="";(l=e.indexOf(c,l+1))!=-1;){var p=s(t.substring(n),e.substring(l)),h=u(t.substring(0,n),e.substring(0,l));f.length<h+p&&(f=e.substring(l-h,l)+e.substring(l,l+p),r=t.substring(0,n-h),o=t.substring(n+p),i=e.substring(0,l-h),a=e.substring(l+p))}return 2*f.length>=t.length?[r,o,i,a,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.length<r.length)return null;var i,a=n(r,o,Math.ceil(r.length/4)),c=n(r,o,Math.ceil(r.length/2));if(!a&&!c)return null;i=c?a&&a[4].length>c[4].length?a:c:a;var l,f,p,h;return t.length>e.length?(l=i[0],f=i[1],p=i[2],h=i[3]):(p=i[0],h=i[1],l=i[2],f=i[3]),[l,f,p,h,i[4]]}function c(t){t.push([v,""]);for(var e,n=0,r=0,o=0,i="",a="";n<t.length;)switch(t[n][0]){case y:o++,a+=t[n][1],n++;break;case d:r++,i+=t[n][1],n++;break;case v:r+o>1?(0!==r&&0!==o&&(e=s(a,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==v?t[n-r-o-1][1]+=a.substring(0,e):(t.splice(0,0,[v,a.substring(0,e)]),n++),a=a.substring(e),i=i.substring(e)),0!==(e=u(a,i))&&(t[n][1]=a.substring(a.length-e)+t[n][1],a=a.substring(0,a.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[y,a]):0===o?t.splice(n-r,r+o,[d,i]):t.splice(n-r-o,r+o,[d,i],[y,a]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==v?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",a=""}""===t[t.length-1][1]&&t.pop();var l=!1;for(n=1;n<t.length-1;)t[n-1][0]==v&&t[n+1][0]==v&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)==t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),l=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),l=!0)),n++;l&&c(t)}function l(t,e){if(0===e)return[v,t];for(var n=0,r=0;r<t.length;r++){var o=t[r];if(o[0]===d||o[0]===v){var i=n+o[1].length;if(e===i)return[r+1,t];if(e<i){t=t.slice();var s=e-n,u=[o[0],o[1].slice(0,s)],a=[o[0],o[1].slice(s)];return t.splice(r,1,u,a),[r+1,t]}n=i}}throw new Error("cursor_pos is out of bounds!")}function f(t,e){var n=l(t,e),r=n[1],o=n[0],i=r[o],s=r[o+1];if(null==i)return t;if(i[0]!==v)return t;if(null!=s&&i[1]+s[1]===s[1]+i[1])return r.splice(o,2,s,i),h(r,o,2);if(null!=s&&0===s[1].indexOf(i[1])){r.splice(o,2,[s[0],i[1]],[0,i[1]]);var u=s[1].slice(i[1].length);return u.length>0&&r.splice(o+2,0,[s[0],u]),h(r,o,3)}return t}function p(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r<t.length;r+=1)t[r-2][0]===v&&function(t){return t.charCodeAt(t.length-1)>=55296&&t.charCodeAt(t.length-1)<=56319}(t[r-2][1])&&t[r-1][0]===d&&n(t[r-1][1])&&t[r][0]===y&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));if(!e)return t;for(var o=[],r=0;r<t.length;r+=1)t[r][1].length>0&&o.push(t[r]);return o}function h(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1<t.length){var o=t[r],i=t[r+1];o[0]===i[1]&&t.splice(r,2,[o[0],o[1]+i[1]])}return t}var d=-1,y=1,v=0,g=n;g.INSERT=y,g.DELETE=d,g.EQUAL=v,t.exports=g},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(71),i=n(72),s=n(73),u=n(74),a=n(75);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=s,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var o=n(85),i=n(86),s=n(87),u=n(88),a=n(89);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=s,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,e,n){function r(t){var e=this.__data__=new o(t);this.size=e.size}var o=n(3),i=n(97),s=n(98),u=n(99),a=n(100),c=n(101);r.prototype.clear=i,r.prototype.delete=s,r.prototype.get=u,r.prototype.has=a,r.prototype.set=c,t.exports=r},function(t,e,n){var r=n(1),o=r.Uint8Array;t.exports=o},function(t,e,n){function r(t,e){var n=s(t),r=!n&&i(t),l=!n&&!r&&u(t),p=!n&&!r&&!l&&c(t),h=n||r||l||p,d=h?o(t.length,String):[],y=d.length;for(var v in t)!e&&!f.call(t,v)||h&&("length"==v||l&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,y))||d.push(v);return d}var o=n(58),i=n(28),s=n(29),u=n(30),a=n(25),c=n(32),l=Object.prototype,f=l.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e,n){var r=t[e];u.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n)}var o=n(10),i=n(8),s=Object.prototype,u=s.hasOwnProperty;t.exports=r},function(t,e,n){var r=n(0),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e,n){var r=n(67),o=r();t.exports=o},function(t,e,n){function r(t){return i(t)&&o(t)==s}var o=n(5),i=n(2),s="[object Arguments]";t.exports=r},function(t,e,n){function r(t){return!(!s(t)||i(t))&&(o(t)?h:a).test(u(t))}var o=n(13),i=n(79),s=n(0),u=n(102),a=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,f=c.toString,p=l.hasOwnProperty,h=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e,n){function r(t){return s(t)&&i(t.length)&&!!u[o(t)]}var o=n(5),i=n(31),s=n(2),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=r},function(t,e,n){function r(t){if(!o(t))return s(t);var e=i(t),n=[];for(var r in t)("constructor"!=r||!e&&a.call(t,r))&&n.push(r);return n}var o=n(0),i=n(26),s=n(90),u=Object.prototype,a=u.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e,n,r,b,x,m){var j=t[n],_=e[n],w=m.get(_);if(w)return void o(t,n,w);var O=x?x(j,_,n+"",t,e,m):void 0,k=void 0===O;if(k){var E=l(_),A=!E&&p(_),S=!E&&!A&&v(_);O=_,E||A||S?l(j)?O=j:f(j)?O=u(j):A?(k=!1,O=i(_,!0)):S?(k=!1,O=s(_,!0)):O=[]:y(_)||c(_)?(O=j,c(j)?O=g(j):(!d(j)||r&&h(j))&&(O=a(_))):k=!1}k&&(m.set(_,O),b(O,_,r,x,m),m.delete(_)),o(t,n,O)}var o=n(19),i=n(61),s=n(62),u=n(63),a=n(76),c=n(28),l=n(29),f=n(104),p=n(30),h=n(13),d=n(0),y=n(105),v=n(32),g=n(108);t.exports=r},function(t,e,n){var r=n(103),o=n(22),i=n(27),s=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=s},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=n},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e,n){function r(t){var e=new t.constructor(t.byteLength);return new o(e).set(new o(t)),e}var o=n(47);t.exports=r},function(t,e,n){(function(t){function r(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}var o=n(1),i="object"==typeof e&&e&&!e.nodeType&&e,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=s&&s.exports===i,a=u?o.Buffer:void 0,c=a?a.allocUnsafe:void 0;t.exports=r}).call(e,n(14)(t))},function(t,e,n){function r(t,e){var n=e?o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var o=n(60);t.exports=r},function(t,e){function n(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}t.exports=n},function(t,e,n){function r(t,e,n,r){var s=!n;n||(n={});for(var u=-1,a=e.length;++u<a;){var c=e[u],l=r?r(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),s?i(n,c,l):o(n,c,l)}return n}var o=n(49),i=n(10);t.exports=r},function(t,e,n){var r=n(1),o=r["__core-js_shared__"];t.exports=o},function(t,e,n){function r(t){return o(function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,u&&i(n[0],n[1],u)&&(s=o<3?void 0:s,o=1),e=Object(e);++r<o;){var a=n[r];a&&t(e,a,r,s)}return e})}var o=n(21),i=n(77);t.exports=r},function(t,e){function n(t){return function(e,n,r){for(var o=-1,i=Object(e),s=r(e),u=s.length;u--;){var a=s[t?u:++o];if(n(i[a],a,i)===!1)break}return e}}t.exports=n},function(t,e,n){function r(t,e,n,s,u,a){return i(t)&&i(e)&&(a.set(e,t),o(t,e,void 0,r,a),a.delete(e)),t}var o=n(20),i=n(0);t.exports=r},function(t,e,n){function r(t){var e=s.call(t,a),n=t[a];try{t[a]=void 0}catch(t){}var r=u.call(t);return e?t[a]=n:delete t[a],r}var o=n(17),i=Object.prototype,s=i.hasOwnProperty,u=i.toString,a=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t,e){return null==t?void 0:t[e]}t.exports=n},function(t,e,n){function r(){this.__data__=o?o(null):{},this.size=0}var o=n(7);t.exports=r},function(t,e){function n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}t.exports=n},function(t,e,n){function r(t){var e=this.__data__;if(o){var n=e[t];return n===i?void 0:n}return u.call(e,t)?e[t]:void 0}var o=n(7),i="__lodash_hash_undefined__",s=Object.prototype,u=s.hasOwnProperty;t.exports=r},function(t,e,n){function r(t){var e=this.__data__;return o?void 0!==e[t]:s.call(e,t)}var o=n(7),i=Object.prototype,s=i.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=o&&void 0===e?i:e,this}var o=n(7),i="__lodash_hash_undefined__";t.exports=r},function(t,e,n){function r(t){return"function"!=typeof t.constructor||s(t)?{}:o(i(t))}var o=n(50),i=n(24),s=n(26);t.exports=r},function(t,e,n){function r(t,e,n){if(!u(n))return!1;var r=typeof e;return!!("number"==r?i(n)&&s(e,n.length):"string"==r&&e in n)&&o(n[e],t)}var o=n(8),i=n(12),s=n(25),u=n(0);t.exports=r},function(t,e){function n(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=n},function(t,e,n){function r(t){return!!i&&i in t}var o=n(65),i=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,e){function n(){this.__data__=[],this.size=0}t.exports=n},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);return!(n<0)&&(n==e.length-1?e.pop():s.call(e,n,1),--this.size,!0)}var o=n(4),i=Array.prototype,s=i.splice;t.exports=r},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);return n<0?void 0:e[n][1]}var o=n(4);t.exports=r},function(t,e,n){function r(t){return o(this.__data__,t)>-1}var o=n(4);t.exports=r},function(t,e,n){function r(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var o=n(4);t.exports=r},function(t,e,n){function r(){this.size=0,this.__data__={hash:new o,map:new(s||i),string:new o}}var o=n(44),i=n(3),s=n(16);t.exports=r},function(t,e,n){function r(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=n(6);t.exports=r},function(t,e,n){function r(t){return o(this,t).get(t)}var o=n(6);t.exports=r},function(t,e,n){function r(t){return o(this,t).has(t)}var o=n(6);t.exports=r},function(t,e,n){function r(t,e){var n=o(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var o=n(6);t.exports=r},function(t,e){function n(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}t.exports=n},function(t,e,n){(function(t){var r=n(23),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===o,u=s&&r.process,a=function(){try{return u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a}).call(e,n(14)(t))},function(t,e){function n(t){return o.call(t)}var r=Object.prototype,o=r.toString;t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){function r(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var r=arguments,s=-1,u=i(r.length-e,0),a=Array(u);++s<u;)a[s]=r[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=r[s];return c[e]=n(a),o(t,this,c)}}var o=n(18),i=Math.max;t.exports=r},function(t,e,n){var r=n(57),o=n(96),i=o(r);t.exports=i},function(t,e){function n(t){var e=0,n=0;return function(){var s=i(),u=o-(s-n);if(n=s,u>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;t.exports=n},function(t,e,n){function r(){this.__data__=new o,this.size=0}var o=n(3);t.exports=r},function(t,e){function n(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}t.exports=n},function(t,e){function n(t){return this.__data__.get(t)}t.exports=n},function(t,e){function n(t){return this.__data__.has(t)}t.exports=n},function(t,e,n){function r(t,e){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!i||r.length<u-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new s(r)}return n.set(t,e),this.size=n.size,this}var o=n(3),i=n(16),s=n(45),u=200;t.exports=r},function(t,e){function n(t){if(null!=t){try{return o.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var r=Function.prototype,o=r.toString;t.exports=n},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e,n){function r(t){return i(t)&&o(t)}var o=n(12),i=n(2);t.exports=r},function(t,e,n){function r(t){if(!s(t)||o(t)!=u)return!1;var e=i(t);if(null===e)return!0;var n=f.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==p}var o=n(5),i=n(24),s=n(2),u="[object Object]",a=Function.prototype,c=Object.prototype,l=a.toString,f=c.hasOwnProperty,p=l.call(Object);t.exports=r},function(t,e,n){var r=n(20),o=n(66),i=o(function(t,e,n,o){r(t,e,n,o)});t.exports=i},function(t,e){function n(){return!1}t.exports=n},function(t,e,n){function r(t){return o(t,i(t))}var o=n(64),i=n(33);t.exports=r},function(t,e,n){var r=n(43),o=n(15),i=n(34),s=n(110),u=String.fromCharCode(0),a=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};a.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},a.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},a.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},a.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},a.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},a.prototype.filter=function(t){return this.ops.filter(t)},a.prototype.forEach=function(t){this.ops.forEach(t)},a.prototype.map=function(t){return this.ops.map(t)},a.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},a.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},a.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+s.length(e):e.delete?t-e.delete:t},0)},a.prototype.length=function(){return this.reduce(function(t,e){return t+s.length(e)},0)},a.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=s.iterator(this.ops),o=0;o<e&&r.hasNext();){var i;o<t?i=r.next(t-o):(i=r.next(e-o),n.push(i)),o+=s.length(i)}return new a(n)},a.prototype.compose=function(t){for(var e=s.iterator(this.ops),n=s.iterator(t.ops),r=new a;e.hasNext()||n.hasNext();)if("insert"===n.peekType())r.push(n.next());else if("delete"===e.peekType())r.push(e.next());else{var o=Math.min(e.peekLength(),n.peekLength()),i=e.next(o),u=n.next(o);if("number"==typeof u.retain){var c={};"number"==typeof i.retain?c.retain=o:c.insert=i.insert;var l=s.attributes.compose(i.attributes,u.attributes,"number"==typeof i.retain);l&&(c.attributes=l),r.push(c)}else"number"==typeof u.delete&&"number"==typeof i.retain&&r.push(u)}return r.chop()},a.prototype.concat=function(t){var e=new a(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},a.prototype.diff=function(t,e){if(this.ops===t.ops)return new a;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:u;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new a,c=r(n[0],n[1],e),l=s.iterator(this.ops),f=s.iterator(t.ops);return c.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,l.peekLength()),l.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(l.peekLength(),f.peekLength(),e);var u=l.next(n),a=f.next(n);o(u.insert,a.insert)?i.retain(n,s.attributes.diff(u.attributes,a.attributes)):i.push(a).delete(n)}e-=n}}),i.chop()},a.prototype.eachLine=function(t,e){e=e||"\n";for(var n=s.iterator(this.ops),r=new a,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),u=s.length(i)-n.peekLength(),c="string"==typeof i.insert?i.insert.indexOf(e,u)-u:-1;if(c<0)r.push(n.next());else if(c>0)r.push(n.next(c));else{if(t(r,n.next(1).attributes||{},o)===!1)return;o+=1,r=new a}}r.length()>0&&t(r,{},o)},a.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=s.iterator(this.ops),r=s.iterator(t.ops),o=new a;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),u=n.next(i),c=r.next(i);if(u.delete)continue;c.delete?o.push(c):o.retain(i,s.attributes.transform(u.attributes,c.attributes,e))}else o.retain(s.length(n.next()));return o.chop()},a.prototype.transformPosition=function(t,e){e=!!e;for(var n=s.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r<t||!e)&&(t+=o),r+=o):t-=Math.min(o,t-r)}return t},t.exports=a},function(t,e,n){function r(t){this.ops=t,this.index=0,this.offset=0}var o=n(15),i=n(34),s={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{}));for(var o in t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=s.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=s},function(t,e){t.exports='<svg viewbox="0 0 18 18">\n <line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>\n <line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"></line>\n <line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"></line>\n</svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18">\n <line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"></line>\n <line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"></line>\n <line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"></line>\n</svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18">\n <line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>\n <line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"></line>\n <line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"></line>\n</svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18">\n <polygon class="ql-fill ql-stroke" points="12 10 14 12 16 10 12 10"></polygon>\n <path class="ql-stroke" d="M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5"></path>\n</svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18">\n <polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 6 10"></polygon>\n <path class="ql-stroke" d="M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"></path>\n</svg>'},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])});