!function t(r,e,n){function i(o,s){if(!e[o]){if(!r[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=e[o]={exports:{}};r[o][0].call(f.exports,function(t){var e=r[o][1][t];return i(e?e:t)},f,f.exports,t,r,e,n)}return e[o].exports}for(var a="function"==typeof require&&require,o=0;o0&&(e.insert=e.insert.join(""),r.push(e),t()),null===i[1]?delete e.attributes[i[0]]:e.attributes[i[0]]=i[1]):e.insert.push(i)}return e.insert.length>0&&(e.insert=e.insert.join(""),r.push(e)),r}},{key:"insert",value:function(t,r){for(var n=0,i={},a=0;a=r)){var o,s,u,f;for(o=0,u=this.valArray[o];t>n&&on&&s=o;u=this.valArray[--f])l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,f,1);else{"string"==typeof u&&s--;var c={};for(f=s,u=this.valArray[f];f>=o;u=this.valArray[--f])u.constructor===Array?void 0===c[u[0]]?(u[1]===i[u[0]]&&l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,f,1),c[u[0]]=u[1]):l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,f,1):"string"==typeof u&&l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,f,1)}}}},{key:"select",value:function(t,r,n,i){if(null==t||null==r||null==n||void 0===i)throw new Error("You must define four parameters");for(var a,o,s=[n,null],u=0,f=0;f=0;v--){var p=y[v];l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,p,1),f>p&&f--,a>p&&a--}if(s[1]!==i&&f=0&&g.constructor===Array;g=this.valArray[--v])g[0]===n&&l(Object.getPrototypeOf(e.prototype),"delete",this).call(this,v,1)}},{key:"bind",value:function(t){function r(t){if(n){n=!1;try{t()}catch(r){throw n=!0,new Error(r)}n=!0}}this.instances.push(t);var e=this,n=!0;t.setContents(this.toOTOps()),t.on("text-change",function(n){r(function(){for(var r,i=0,a=0;ae.length){for(var u=l-e.length,f="";0!==u;)u--,f+="\n";for(r in o.attributes)t.formatText(e.length,e.length+o.retain,r,null);t.insertText(e.length,f,o.attributes),e.insert(e.length,f)}for(r in o.attributes)e.select(i,i+o.retain,r,o.attributes[r]);i=l}}})}),this.observe(function(n){r(function(){for(var r,i,a=0;a=0;u--)r=e.valArray[u],"string"==typeof r?s++:r.constructor===Array&&"undefined"==typeof l[r[0]]&&(l[r[0]]=r[1]);t.insertText(s,o.value,l)}else if(o.value.constructor===Array){i=null;for(var f=o.value,c=0,y=o.index-1;y>=0;y--)if(r=e.valArray[y],r.constructor===Array){if(f[0]===r[0]){i=r[1];break}}else"string"==typeof r&&c++;for(;y>=0;y--)r=e.valArray[y],"string"==typeof r&&c++;if(f[1]===i)return;for(var h=c,v=o.index+1;v=0;b--)if(r=e.valArray[b],r.constructor===Array){if(r[0]===o.value[0]){i=r[1];break}}else"string"==typeof r&&A++;for(;b>=0;r=e.valArray[--b])"string"==typeof r&&A++;var O=A;for(b=o.index;b