worker-base-6b335af3.js 21 KB

12345678
  1. import{c as _}from"./index-63ed8a66.js";function $(a,h){for(var m=0;m<h.length;m++){const c=h[m];if(typeof c!="string"&&!Array.isArray(c)){for(const l in c)if(l!=="default"&&!(l in a)){const r=Object.getOwnPropertyDescriptor(c,l);r&&Object.defineProperty(a,l,r.get?r:{enumerable:!0,get:()=>c[l]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var L={};(function(a){if(typeof a.window<"u"&&a.document||a.require&&a.define)return;a.console||(a.console=function(){var l=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:l})},a.console.error=a.console.warn=a.console.log=a.console.trace=a.console),a.window=a,a.ace=a,a.onerror=function(l,r,t,n,i){postMessage({type:"error",data:{message:l,data:i&&i.data,file:r,line:t,col:n,stack:i&&i.stack}})},a.normalizeModule=function(l,r){if(r.indexOf("!")!==-1){var t=r.split("!");return a.normalizeModule(l,t[0])+"!"+a.normalizeModule(l,t[1])}if(r.charAt(0)=="."){var n=l.split("/").slice(0,-1).join("/");for(r=(n?n+"/":"")+r;r.indexOf(".")!==-1&&i!=r;){var i=r;r=r.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return r},a.require=function(r,t){if(t||(t=r,r=null),!t.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");t=a.normalizeModule(r,t);var n=a.require.modules[t];if(n)return n.initialized||(n.initialized=!0,n.exports=n.factory().exports),n.exports;if(!a.require.tlns)return console.log("unable to load "+t);var i=h(t,a.require.tlns);return i.slice(-3)!=".js"&&(i+=".js"),a.require.id=t,a.require.modules[t]={},importScripts(i),a.require(r,t)};function h(l,r){for(var t=l,n="";t;){var i=r[t];if(typeof i=="string")return i+n;if(i)return i.location.replace(/\/*$/,"/")+(n||i.main||i.name);if(i===!1)return"";var o=t.lastIndexOf("/");if(o===-1)break;n=t.substr(o)+n,t=t.slice(0,o)}return l}a.require.modules={},a.require.tlns={},a.define=function(l,r,t){if(arguments.length==2?(t=r,typeof l!="string"&&(r=l,l=a.require.id)):arguments.length==1&&(t=l,r=[],l=a.require.id),typeof t!="function"){a.require.modules[l]={exports:t,initialized:!0};return}r.length||(r=["require","exports","module"]);var n=function(i){return a.require(l,i)};a.require.modules[l]={exports:{},factory:function(){var i=this,o=t.apply(this,r.slice(0,t.length).map(function(e){switch(e){case"require":return n;case"exports":return i.exports;case"module":return i;default:return n(e)}}));return o&&(i.exports=o),i}}},a.define.amd={},a.require.tlns={},a.initBaseUrls=function(r){for(var t in r)this.require.tlns[t]=r[t]},a.initSender=function(){var r=a.require("ace/lib/event_emitter").EventEmitter,t=a.require("ace/lib/oop"),n=function(){};return function(){t.implement(this,r),this.callback=function(i,o){postMessage({type:"call",id:o,data:i})},this.emit=function(i,o){postMessage({type:"event",name:i,data:o})}}.call(n.prototype),new n};var m=a.main=null,c=a.sender=null;a.onmessage=function(l){var r=l.data;if(r.event&&c)c._signal(r.event,r.data);else if(r.command)if(m[r.command])m[r.command].apply(m,r.args);else if(a[r.command])a[r.command].apply(a,r.args);else throw new Error("Unknown command:"+r.command);else if(r.init){a.initBaseUrls(r.tlns),c=a.sender=a.initSender();var t=this.require(r.module)[r.classname];m=a.main=new t(c)}}})(_);ace.define("ace/lib/oop",[],function(a,h,m){h.inherits=function(c,l){c.super_=l,c.prototype=Object.create(l.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})},h.mixin=function(c,l){for(var r in l)c[r]=l[r];return c},h.implement=function(c,l){h.mixin(c,l)}});ace.define("ace/apply_delta",[],function(a,h,m){h.applyDelta=function(c,l,r){var t=l.start.row,n=l.start.column,i=c[t]||"";switch(l.action){case"insert":var o=l.lines;if(o.length===1)c[t]=i.substring(0,n)+l.lines[0]+i.substring(n);else{var e=[t,1].concat(l.lines);c.splice.apply(c,e),c[t]=i.substring(0,n)+c[t],c[t+l.lines.length-1]+=i.substring(n)}break;case"remove":var s=l.end.column,u=l.end.row;t===u?c[t]=i.substring(0,n)+i.substring(s):c.splice(t,u-t+1,i.substring(0,n)+c[u].substring(s));break}}});ace.define("ace/lib/event_emitter",[],function(a,h,m){var c={},l=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};c._emit=c._dispatchEvent=function(t,n){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[t]||[],o=this._defaultHandlers[t];if(!(!i.length&&!o)){(typeof n!="object"||!n)&&(n={}),n.type||(n.type=t),n.stopPropagation||(n.stopPropagation=l),n.preventDefault||(n.preventDefault=r),i=i.slice();for(var e=0;e<i.length&&(i[e](n,this),!n.propagationStopped);e++);if(o&&!n.defaultPrevented)return o(n,this)}},c._signal=function(t,n){var i=(this._eventRegistry||{})[t];if(i){i=i.slice();for(var o=0;o<i.length;o++)i[o](n,this)}},c.once=function(t,n){var i=this;if(this.on(t,function o(){i.off(t,o),n.apply(null,arguments)}),!n)return new Promise(function(o){n=o})},c.setDefaultHandler=function(t,n){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[t]){var o=i[t],e=i._disabled_[t];e||(i._disabled_[t]=e=[]),e.push(o);var s=e.indexOf(n);s!=-1&&e.splice(s,1)}i[t]=n},c.removeDefaultHandler=function(t,n){var i=this._defaultHandlers;if(i){var o=i._disabled_[t];if(i[t]==n)o&&this.setDefaultHandler(t,o.pop());else if(o){var e=o.indexOf(n);e!=-1&&o.splice(e,1)}}},c.on=c.addEventListener=function(t,n,i){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[t];return o||(o=this._eventRegistry[t]=[]),o.indexOf(n)==-1&&o[i?"unshift":"push"](n),n},c.off=c.removeListener=c.removeEventListener=function(t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[t];if(i){var o=i.indexOf(n);o!==-1&&i.splice(o,1)}},c.removeAllListeners=function(t){t||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[t]=void 0),this._defaultHandlers&&(this._defaultHandlers[t]=void 0)},h.EventEmitter=c});ace.define("ace/range",[],function(a,h,m){var c=function(r,t){return r.row-t.row||r.column-t.column},l=function(){function r(t,n,i,o){this.start={row:t,column:n},this.end={row:i,column:o}}return r.prototype.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},r.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},r.prototype.contains=function(t,n){return this.compare(t,n)==0},r.prototype.compareRange=function(t){var n,i=t.end,o=t.start;return n=this.compare(i.row,i.column),n==1?(n=this.compare(o.row,o.column),n==1?2:n==0?1:0):n==-1?-2:(n=this.compare(o.row,o.column),n==-1?-1:n==1?42:0)},r.prototype.comparePoint=function(t){return this.compare(t.row,t.column)},r.prototype.containsRange=function(t){return this.comparePoint(t.start)==0&&this.comparePoint(t.end)==0},r.prototype.intersects=function(t){var n=this.compareRange(t);return n==-1||n==0||n==1},r.prototype.isEnd=function(t,n){return this.end.row==t&&this.end.column==n},r.prototype.isStart=function(t,n){return this.start.row==t&&this.start.column==n},r.prototype.setStart=function(t,n){typeof t=="object"?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=n)},r.prototype.setEnd=function(t,n){typeof t=="object"?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=n)},r.prototype.inside=function(t,n){return this.compare(t,n)==0?!(this.isEnd(t,n)||this.isStart(t,n)):!1},r.prototype.insideStart=function(t,n){return this.compare(t,n)==0?!this.isEnd(t,n):!1},r.prototype.insideEnd=function(t,n){return this.compare(t,n)==0?!this.isStart(t,n):!1},r.prototype.compare=function(t,n){return!this.isMultiLine()&&t===this.start.row?n<this.start.column?-1:n>this.end.column?1:0:t<this.start.row?-1:t>this.end.row?1:this.start.row===t?n>=this.start.column?0:-1:this.end.row===t?n<=this.end.column?0:1:0},r.prototype.compareStart=function(t,n){return this.start.row==t&&this.start.column==n?-1:this.compare(t,n)},r.prototype.compareEnd=function(t,n){return this.end.row==t&&this.end.column==n?1:this.compare(t,n)},r.prototype.compareInside=function(t,n){return this.end.row==t&&this.end.column==n?1:this.start.row==t&&this.start.column==n?-1:this.compare(t,n)},r.prototype.clipRows=function(t,n){if(this.end.row>n)var i={row:n+1,column:0};else if(this.end.row<t)var i={row:t,column:0};if(this.start.row>n)var o={row:n+1,column:0};else if(this.start.row<t)var o={row:t,column:0};return r.fromPoints(o||this.start,i||this.end)},r.prototype.extend=function(t,n){var i=this.compare(t,n);if(i==0)return this;if(i==-1)var o={row:t,column:n};else var e={row:t,column:n};return r.fromPoints(o||this.start,e||this.end)},r.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},r.prototype.isMultiLine=function(){return this.start.row!==this.end.row},r.prototype.clone=function(){return r.fromPoints(this.start,this.end)},r.prototype.collapseRows=function(){return this.end.column==0?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},r.prototype.toScreenRange=function(t){var n=t.documentToScreenPosition(this.start),i=t.documentToScreenPosition(this.end);return new r(n.row,n.column,i.row,i.column)},r.prototype.moveBy=function(t,n){this.start.row+=t,this.start.column+=n,this.end.row+=t,this.end.column+=n},r}();l.fromPoints=function(r,t){return new l(r.row,r.column,t.row,t.column)},l.comparePoints=c,l.comparePoints=function(r,t){return r.row-t.row||r.column-t.column},h.Range=l});ace.define("ace/anchor",[],function(a,h,m){var c=a("./lib/oop"),l=a("./lib/event_emitter").EventEmitter,r=function(){function i(o,e,s){this.$onChange=this.onChange.bind(this),this.attach(o),typeof s>"u"?this.setPosition(e.row,e.column):this.setPosition(e,s)}return i.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},i.prototype.getDocument=function(){return this.document},i.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var e=n(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},i.prototype.setPosition=function(o,e,s){var u;if(s?u={row:o,column:e}:u=this.$clipPositionToDocument(o,e),!(this.row==u.row&&this.column==u.column)){var f={row:this.row,column:this.column};this.row=u.row,this.column=u.column,this._signal("change",{old:f,value:u})}},i.prototype.detach=function(){this.document.off("change",this.$onChange)},i.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},i.prototype.$clipPositionToDocument=function(o,e){var s={};return o>=this.document.getLength()?(s.row=Math.max(0,this.document.getLength()-1),s.column=this.document.getLine(s.row).length):o<0?(s.row=0,s.column=0):(s.row=o,s.column=Math.min(this.document.getLine(s.row).length,Math.max(0,e))),e<0&&(s.column=0),s},i}();r.prototype.$insertRight=!1,c.implement(r.prototype,l);function t(i,o,e){var s=e?i.column<=o.column:i.column<o.column;return i.row<o.row||i.row==o.row&&s}function n(i,o,e){var s=i.action=="insert",u=(s?1:-1)*(i.end.row-i.start.row),f=(s?1:-1)*(i.end.column-i.start.column),p=i.start,g=s?p:i.end;return t(o,p,e)?{row:o.row,column:o.column}:t(g,o,!e)?{row:o.row+u,column:o.column+(o.row==g.row?f:0)}:{row:p.row,column:p.column}}h.Anchor=r});ace.define("ace/document",[],function(a,h,m){var c=a("./lib/oop"),l=a("./apply_delta").applyDelta,r=a("./lib/event_emitter").EventEmitter,t=a("./range").Range,n=a("./anchor").Anchor,i=function(){function o(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return o.prototype.setValue=function(e){var s=this.getLength()-1;this.remove(new t(0,0,s,this.getLine(s).length)),this.insert({row:0,column:0},e||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(e,s){return new n(this,e,s)},o.prototype.$detectNewLine=function(e){var s=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=s?s[1]:`
  2. `,this._signal("changeNewLineMode")},o.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
  3. `;case"unix":return`
  4. `;default:return this.$autoNewLine||`
  5. `}},o.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(e){return e==`\r
  6. `||e=="\r"||e==`
  7. `},o.prototype.getLine=function(e){return this.$lines[e]||""},o.prototype.getLines=function(e,s){return this.$lines.slice(e,s+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(e){var s;if(e.start.row===e.end.row)s=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{s=this.getLines(e.start.row,e.end.row),s[0]=(s[0]||"").substring(e.start.column);var u=s.length-1;e.end.row-e.start.row==u&&(s[u]=s[u].substring(0,e.end.column))}return s},o.prototype.insertLines=function(e,s){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,s)},o.prototype.removeLines=function(e,s){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,s)},o.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},o.prototype.insert=function(e,s){return this.getLength()<=1&&this.$detectNewLine(s),this.insertMergedLines(e,this.$split(s))},o.prototype.insertInLine=function(e,s){var u=this.clippedPos(e.row,e.column),f=this.pos(e.row,e.column+s.length);return this.applyDelta({start:u,end:f,action:"insert",lines:[s]},!0),this.clonePos(f)},o.prototype.clippedPos=function(e,s){var u=this.getLength();e===void 0?e=u:e<0?e=0:e>=u&&(e=u-1,s=void 0);var f=this.getLine(e);return s==null&&(s=f.length),s=Math.min(Math.max(s,0),f.length),{row:e,column:s}},o.prototype.clonePos=function(e){return{row:e.row,column:e.column}},o.prototype.pos=function(e,s){return{row:e,column:s}},o.prototype.$clipPosition=function(e){var s=this.getLength();return e.row>=s?(e.row=Math.max(0,s-1),e.column=this.getLine(s-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},o.prototype.insertFullLines=function(e,s){e=Math.min(Math.max(e,0),this.getLength());var u=0;e<this.getLength()?(s=s.concat([""]),u=0):(s=[""].concat(s),e--,u=this.$lines[e].length),this.insertMergedLines({row:e,column:u},s)},o.prototype.insertMergedLines=function(e,s){var u=this.clippedPos(e.row,e.column),f={row:u.row+s.length-1,column:(s.length==1?u.column:0)+s[s.length-1].length};return this.applyDelta({start:u,end:f,action:"insert",lines:s}),this.clonePos(f)},o.prototype.remove=function(e){var s=this.clippedPos(e.start.row,e.start.column),u=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:s,end:u,action:"remove",lines:this.getLinesForRange({start:s,end:u})}),this.clonePos(s)},o.prototype.removeInLine=function(e,s,u){var f=this.clippedPos(e,s),p=this.clippedPos(e,u);return this.applyDelta({start:f,end:p,action:"remove",lines:this.getLinesForRange({start:f,end:p})},!0),this.clonePos(f)},o.prototype.removeFullLines=function(e,s){e=Math.min(Math.max(0,e),this.getLength()-1),s=Math.min(Math.max(0,s),this.getLength()-1);var u=s==this.getLength()-1&&e>0,f=s<this.getLength()-1,p=u?e-1:e,g=u?this.getLine(p).length:0,v=f?s+1:s,d=f?0:this.getLine(v).length,y=new t(p,g,v,d),P=this.$lines.slice(e,s+1);return this.applyDelta({start:y.start,end:y.end,action:"remove",lines:this.getLinesForRange(y)}),P},o.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(e,s){if(e instanceof t||(e=t.fromPoints(e.start,e.end)),s.length===0&&e.isEmpty())return e.start;if(s==this.getTextRange(e))return e.end;this.remove(e);var u;return s?u=this.insert(e.start,s):u=e.start,u},o.prototype.applyDeltas=function(e){for(var s=0;s<e.length;s++)this.applyDelta(e[s])},o.prototype.revertDeltas=function(e){for(var s=e.length-1;s>=0;s--)this.revertDelta(e[s])},o.prototype.applyDelta=function(e,s){var u=e.action=="insert";(u?e.lines.length<=1&&!e.lines[0]:!t.comparePoints(e.start,e.end))||(u&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(l(this.$lines,e,s),this._signal("change",e)))},o.prototype.$safeApplyDelta=function(e){var s=this.$lines.length;(e.action=="remove"&&e.start.row<s&&e.end.row<s||e.action=="insert"&&e.start.row<=s)&&this.applyDelta(e)},o.prototype.$splitAndapplyLargeDelta=function(e,s){for(var u=e.lines,f=u.length-s+1,p=e.start.row,g=e.start.column,v=0,d=0;v<f;v=d){d+=s-1;var y=u.slice(v,d);y.push(""),this.applyDelta({start:this.pos(p+v,g),end:this.pos(p+d,g=0),action:e.action,lines:y},!0)}e.lines=u.slice(v),e.start.row=p+v,e.start.column=g,this.applyDelta(e,!0)},o.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},o.prototype.indexToPosition=function(e,s){for(var u=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,p=s||0,g=u.length;p<g;p++)if(e-=u[p].length+f,e<0)return{row:p,column:e+u[p].length+f};return{row:g-1,column:e+u[g-1].length+f}},o.prototype.positionToIndex=function(e,s){for(var u=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,p=0,g=Math.min(e.row,u.length),v=s||0;v<g;++v)p+=u[v].length+f;return p+e.column},o.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},o}();i.prototype.$autoNewLine="",i.prototype.$newLineMode="auto",c.implement(i.prototype,r),h.Document=i});ace.define("ace/lib/lang",[],function(a,h,m){h.last=function(r){return r[r.length-1]},h.stringReverse=function(r){return r.split("").reverse().join("")},h.stringRepeat=function(r,t){for(var n="";t>0;)t&1&&(n+=r),(t>>=1)&&(r+=r);return n};var c=/^\s\s*/,l=/\s\s*$/;h.stringTrimLeft=function(r){return r.replace(c,"")},h.stringTrimRight=function(r){return r.replace(l,"")},h.copyObject=function(r){var t={};for(var n in r)t[n]=r[n];return t},h.copyArray=function(r){for(var t=[],n=0,i=r.length;n<i;n++)r[n]&&typeof r[n]=="object"?t[n]=this.copyObject(r[n]):t[n]=r[n];return t},h.deepCopy=function r(t){if(typeof t!="object"||!t)return t;var n;if(Array.isArray(t)){n=[];for(var i=0;i<t.length;i++)n[i]=r(t[i]);return n}if(Object.prototype.toString.call(t)!=="[object Object]")return t;n={};for(var i in t)n[i]=r(t[i]);return n},h.arrayToMap=function(r){for(var t={},n=0;n<r.length;n++)t[r[n]]=1;return t},h.createMap=function(r){var t=Object.create(null);for(var n in r)t[n]=r[n];return t},h.arrayRemove=function(r,t){for(var n=0;n<=r.length;n++)t===r[n]&&r.splice(n,1)},h.escapeRegExp=function(r){return r.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},h.escapeHTML=function(r){return(""+r).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},h.getMatchOffsets=function(r,t){var n=[];return r.replace(t,function(i){n.push({offset:arguments[arguments.length-2],length:i.length})}),n},h.deferredCall=function(r){var t=null,n=function(){t=null,r()},i=function(o){return i.cancel(),t=setTimeout(n,o||0),i};return i.schedule=i,i.call=function(){return this.cancel(),r(),i},i.cancel=function(){return clearTimeout(t),t=null,i},i.isPending=function(){return t},i},h.delayedCall=function(r,t){var n=null,i=function(){n=null,r()},o=function(e){n==null&&(n=setTimeout(i,e||t))};return o.delay=function(e){n&&clearTimeout(n),n=setTimeout(i,e||t)},o.schedule=o,o.call=function(){this.cancel(),r()},o.cancel=function(){n&&clearTimeout(n),n=null},o.isPending=function(){return n},o}});ace.define("ace/worker/mirror",[],function(a,h,m){var c=a("../document").Document,l=a("../lib/lang"),r=h.Mirror=function(t){this.sender=t;var n=this.doc=new c(""),i=this.deferredUpdate=l.delayedCall(this.onUpdate.bind(this)),o=this;t.on("change",function(e){var s=e.data;if(s[0].start)n.applyDeltas(s);else for(var u=0;u<s.length;u+=2){var f,p;if(Array.isArray(s[u+1])?f={action:"insert",start:s[u],lines:s[u+1]}:f={action:"remove",start:s[u],end:s[u+1]},(f.action=="insert"?f.start:f.end).row>=n.$lines.length)throw p=new Error("Invalid delta"),p.data={path:o.$path,linesLength:n.$lines.length,start:f.start,end:f.end},p;n.applyDelta(f,!0)}if(o.$timeout)return i.schedule(o.$timeout);o.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(t){this.$timeout=t},this.setValue=function(t){this.doc.setValue(t),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(t){this.sender.callback(this.doc.getValue(),t)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(r.prototype)});const w=$({__proto__:null,default:L},[L]);export{w};
  8. //# sourceMappingURL=worker-base-6b335af3.js.map