!function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o=i)throw new Error("Unexpected operation!")}(),o._content.splice(i,0,{id:JSON.stringify(r.id),val:r.content}),t.push({type:"insert",object:o,index:i,value:r.content,length:1})}else{if("Delete"!==r.struct)throw new Error("Unexpected struct!");var a;!function(){var e=JSON.stringify(r.target),n=o._content.findIndex(function(t){return t.id===e});n>=0&&(a=o._content[n].val,o._content.splice(n,1),t.push({type:"delete",object:o,index:n,value:a,length:1}))}()}}o.eventHandler.callEventListeners(t)})}return a(t,[{key:"_destroy",value:function(){this.eventHandler.destroy(),this.eventHandler=null,this._content=null,this._model=null,this.os=null}},{key:"get",value:function(e){if(null==e||"number"!=typeof e)throw new Error("pos must be a number!");return this._content[e].val}},{key:"toArray",value:function(){return this._content.map(function(e){return e.val})}},{key:"push",value:function(e){this.insert(this._content.length,e)}},{key:"insert",value:function(e,t){if("number"!=typeof e)throw new Error("pos must be a number!");if(!(t instanceof Array))throw new Error("contents must be an Array of objects!");if(0!==t.length){if(e>this._content.length||0>e)throw new Error("This position exceeds the range of the array!");for(var n=0===e?null:JSON.parse(this._content[e-1].id),r=[],i=n,a=0;athis._content.length||0>e||0>t)throw new Error("The deletion range exceeds the range of the array!");if(0!==t){for(var n=this.eventHandler,r=e>0?JSON.parse(this._content[e-1].id):null,i=[],a=0;t>a;a++)i.push({target:JSON.parse(this._content[e+a].id),struct:"Delete"});n.awaitAndPrematurelyCall(i),this.os.requestTransaction(regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.applyCreatedOperations(i),"t0",1);case 1:n.awaitedDeletes(i.length,r);case 2:case"end":return e.stop()}},o,this)}))}}},{key:"observe",value:function(e){this.eventHandler.addEventListener(e)}},{key:"unobserve",value:function(e){this.eventHandler.removeEventListener(e)}},{key:"_changed",value:regeneratorRuntime.mark(function n(e,t){var r,i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t.deleted){n.next=13;break}if("Insert"!==t.struct){n.next=12;break}r=t.left;case 3:if(null==r){n.next=11;break}return n.delegateYield(e.getOperation(r),"t0",5);case 5:if(i=n.t0,i.deleted){n.next=8;break}return n.abrupt("break",11);case 8:r=i.left,n.next=3;break;case 11:t.left=r;case 12:this.eventHandler.receivedOp(t);case 13:case"end":return n.stop()}},n,this)})},{key:"length",get:function(){return this._content.length}}]),t}();e.extend("Array",new e.utils.CustomType({name:"Array","class":t,struct:"List",initType:regeneratorRuntime.mark(function n(r,i){var a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.delegateYield(e.Struct.List.map.call(this,i,function(e){return{id:JSON.stringify(e.id),val:e.content}}),"t0",1);case 1:return a=n.t0,n.abrupt("return",new t(r,i.id,a));case 3:case"end":return n.stop()}},n,this)})}))}var a=function(){function e(e,t){for(var n=0;n