goview_vue/dist/assets/editor.worker-bdd90286.js

7 lines
167 KiB
JavaScript
Raw Normal View History

2023-06-06 11:55:37 +08:00
(function(){"use strict";class yn{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?new Error(t.message+`
`+t.stack):t},0)}}emit(t){this.listeners.forEach(r=>{r(t)})}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const kn=new yn;function Mn(e){Rn(e)||kn.onUnexpectedError(e)}function it(e){if(e instanceof Error){let{name:t,message:r}=e;const s=e.stacktrace||e.stack;return{$isError:!0,name:t,message:r,stack:s}}return e}const Me="Canceled";function Rn(e){return e instanceof Pn?!0:e instanceof Error&&e.name===Me&&e.message===Me}class Pn extends Error{constructor(){super(Me),this.name=this.message}}function Dn(e){const t=this;let r=!1,s;return function(){return r||(r=!0,s=e.apply(t,arguments)),s}}var Re;(function(e){function t(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=t;const r=Object.freeze([]);function s(){return r}e.empty=s;function*i(w){yield w}e.single=i;function a(w){return w||r}e.from=a;function o(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=o;function l(w){return w[Symbol.iterator]().next().value}e.first=l;function u(w,p){for(const g of w)if(p(g))return!0;return!1}e.some=u;function c(w,p){for(const g of w)if(p(g))return g}e.find=c;function*f(w,p){for(const g of w)p(g)&&(yield g)}e.filter=f;function*h(w,p){let g=0;for(const m of w)yield p(m,g++)}e.map=h;function*d(...w){for(const p of w)for(const g of p)yield g}e.concat=d;function*_(w){for(const p of w)for(const g of p)yield g}e.concatNested=_;function S(w,p,g){let m=g;for(const L of w)m=p(m,L);return m}e.reduce=S;function*v(w,p,g=w.length){for(p<0&&(p+=w.length),g<0?g+=w.length:g>w.length&&(g=w.length);p<g;p++)yield w[p]}e.slice=v;function M(w,p=Number.POSITIVE_INFINITY){const g=[];if(p===0)return[g,w];const m=w[Symbol.iterator]();for(let L=0;L<p;L++){const C=m.next();if(C.done)return[g,e.empty()];g.push(C.value)}return[g,{[Symbol.iterator](){return m}}]}e.consume=M;function P(w,p,g=(m,L)=>m===L){const m=w[Symbol.iterator](),L=p[Symbol.iterator]();for(;;){const C=m.next(),b=L.next();if(C.done!==b.done)return!1;if(C.done)return!0;if(!g(C.value,b.value))return!1}}e.equals=P})(Re||(Re={}));function a1(e){return e}function o1(e,t){}class Fn extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`),this.errors=t}}function at(e){if(Re.is(e)){let t=[];for(const r of e)if(r)try{r.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new Fn(t);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Vn(...e){return be(()=>at(e))}function be(e){return{dispose:Dn(()=>{e()})}}class se{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{at(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?se.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}se.DISABLE_DISPOSED_WARNING=!1;class Pe{constructor(){this._store=new se,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}Pe.None=Object.freeze({dispose(){}});class xn{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1}set(t){let r=t;return this.unset=()=>r=void 0,this.isset=()=>r!==void 0,this.dispose=()=>{r&&(r(),r=void 0)},this}}class D{constructor(t){this.element=t,this.next=D.Undefined,this.prev=D.Undefined}}D.Undefined=new D(void 0);class ot{constructor(){this._first=D.Undefined,this._last=D.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===D.Undefined}clear(){let t=this._first;for(;t!==D.Undefined;){const r=t.next;t.prev=D.Undefined,t.next=D.Undefined,t=r}this._first=D.Undefined,this._last=D.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}
`).slice(2).join(`
`))}}class qn{constructor(t,r,s){this.callback=t,this.callbackThis=r,this.stack=s,this.subscription=new xn}invoke(t){this.callback.call(this.callbackThis,t)}}class j{constructor(t){var r;this._disposed=!1,this._options=t,this._leakageMon=void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new pe(this._options._profName):void 0}dispose(){var t,r,s,i;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(r=this._options)===null||r===void 0?void 0:r.onLastListenerRemove)===null||s===void 0||s.call(r),(i=this._leakageMon)===null||i===void 0||i.dispose())}get event(){return this._event||(this._event=(t,r,s)=>{var i,a,o;this._listeners||(this._listeners=new ot);const l=this._listeners.isEmpty();l&&(!((i=this._options)===null||i===void 0)&&i.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this);let u,c;this._leakageMon&&this._listeners.size>=30&&(c=Ue.create(),u=this._leakageMon.check(c,this._listeners.size+1));const f=new qn(t,r,c),h=this._listeners.push(f);l&&(!((a=this._options)===null||a===void 0)&&a.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),!((o=this._options)===null||o===void 0)&&o.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,r);const d=f.subscription.set(()=>{u&&u(),this._disposed||(h(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return s instanceof se?s.add(d):Array.isArray(s)&&s.push(d),d}),this._event}fire(t){var r,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ot);for(let i of this._listeners)this._deliveryQueue.push([i,t]);for((r=this._perfMon)===null||r===void 0||r.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,a]=this._deliveryQueue.shift();try{i.invoke(a)}catch(o){Mn(o)}}(s=this._perfMon)===null||s===void 0||s.stop()}}}function Hn(e){let t=[],r=Object.getPrototypeOf(e);for(;Object.prototype!==r;)t=t.concat(Object.getOwnPropertyNames(r)),r=Object.getPrototypeOf(r);return t}function Te(e){const t=[];for(const r of Hn(e))typeof e[r]=="function"&&t.push(r);return t}function Wn(e,t){const r=i=>function(){const a=Array.prototype.slice.call(arguments,0);return t(i,a)};let s={};for(const i of e)s[i]=r(i);return s}function $n(e,t="Unreachable"){throw new Error(t)}class zn{constructor(t){this.computeFn=t,this.lastCache=void 0,this.lastArgKey=void 0}get(t){const r=JSON.stringify(t);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this.computeFn(t)),this.lastCache}}class ct{constructor(t){this.executor=t,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(t){this._error=t}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var ut;function Gn(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function On(e){return e.split(/\r\n|\r|\n/)}function jn(e){for(let t=0,r=e.length;t<r;t++){const s=e.charCodeAt(t);if(s!==32&&s!==9)return t}return-1}function Zn(e,t=e.length-1){for(let r=t;r>=0;r--){const s=e.charCodeAt(r);if(s!==32&&s!==9)return r}return-1}function ht(e){return e>=65&&e<=90}function Ie(e){return 55296<=e&&e<=56319}function Yn(e){return 56320<=e&&e<=57343}function Xn(e,t){return(e-55296<<10)+(t-56320)+65536}function Qn(e,t,r){const s=e.charCodeAt(r);if(Ie(s)&&r+1<t){const i=e.charCodeAt(r+1);if(Yn(i))return Xn(s,i)}return s}const Jn=/^[\t\n\r\x20-\x7E]*$/;function Kn(e){return Jn.test(e)}class ${constructor(t){this.confusableDictionary=t}static getInstance(t){return $.cache.get(Array.from(t))}static getLocales(){return $._locales.getValue()}isAmbiguous(t){return this.confusableDictionary.has(t)}getPrimaryConfusable(t){return this.confusableDictionary.get(t)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}ut=$,$.ambiguousCharacterData=new ct(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,6
`||e===" "}var re=function(e,t,r,s){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(f){try{c(s.next(f))}catch(h){o(h)}}function u(f){try{c(s.throw(f))}catch(h){o(h)}}function c(f){f.done?a(f.value):i(f.value).then(l,u)}c((s=s.apply(e,t||[])).next())})};class t1 extends Rr{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(t){return this._lines[t-1]}getWordAtPosition(t,r){const s=Oe(t.column,Fr(r),this._lines[t.lineNumber-1],0);return s?new V(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):null}words(t){const r=this._lines,s=this._wordenize.bind(this);let i=0,a="",o=0,l=[];return{*[Symbol.iterator](){for(;;)if(o<l.length){const u=a.substring(l[o].start,l[o].end);o+=1,yield u}else if(i<r.length)a=r[i],l=s(a,t),o=0,i+=1;else break}}}getLineWords(t,r){const s=this._lines[t-1],i=this._wordenize(s,r),a=[];for(const o of i)a.push({word:s.substring(o.start,o.end),startColumn:o.start+1,endColumn:o.end+1});return a}_wordenize(t,r){const s=[];let i;for(r.lastIndex=0;(i=r.exec(t))&&i[0].length!==0;)s.push({start:i.index,end:i.index+i[0].length});return s}getValueInRange(t){if(t=this._validateRange(t),t.startLineNumber===t.endLineNumber)return this._lines[t.startLineNumber-1].substring(t.startColumn-1,t.endColumn-1);const r=this._eol,s=t.startLineNumber-1,i=t.endLineNumber-1,a=[];a.push(this._lines[s].substring(t.startColumn-1));for(let o=s+1;o<i;o++)a.push(this._lines[o]);return a.push(this._lines[i].substring(0,t.endColumn-1)),a.join(r)}offsetAt(t){return t=this._validatePosition(t),this._ensureLineStarts(),this._lineStarts.getPrefixSum(t.lineNumber-2)+(t.column-1)}positionAt(t){t=Math.floor(t),t=Math.max(0,t),this._ensureLineStarts();const r=this._lineStarts.getIndexOf(t),s=this._lines[r.index].length;return{lineNumber:1+r.index,column:1+Math.min(r.remainder,s)}}_validateRange(t){const r=this._validatePosition({lineNumber:t.startLineNumber,column:t.startColumn}),s=this._validatePosition({lineNumber:t.endLineNumber,column:t.endColumn});return r.lineNumber!==t.startLineNumber||r.column!==t.startColumn||s.lineNumber!==t.endLineNumber||s.column!==t.endColumn?{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:s.lineNumber,endColumn:s.column}:t}_validatePosition(t){if(!H.isIPosition(t))throw new Error("bad position");let{lineNumber:r,column:s}=t,i=!1;if(r<1)r=1,s=1,i=!0;else if(r>this._lines.length)r=this._lines.length,s=this._lines[r-1].length+1,i=!0;else{const a=this._lines[r-1].length+1;s<1?(s=1,i=!0):s>a&&(s=a,i=!0)}return i?{lineNumber:r,column:s}:t}}class ue{constructor(t,r){this._host=t,this._models=Object.create(null),this._foreignModuleFactory=r,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(t){return this._models[t]}_getModels(){const t=[];return Object.keys(this._models).forEach(r=>t.push(this._models[r])),t}acceptNewModel(t){this._models[t.url]=new t1(ne.parse(t.url),t.lines,t.EOL,t.versionId)}acceptModelChanged(t,r){if(!this._models[t])return;this._models[t].onEvents(r)}acceptRemovedModel(t){this._models[t]&&delete this._models[t]}computeUnicodeHighlights(t,r,s){return re(this,void 0,void 0,function*(){const i=this._getModel(t);return i?Kr.computeUnicodeHighlights(i,r,s):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(t,r,s,i){return re(this,void 0,void 0,function*(){const a=this._getModel(t),o=this._getModel(r);if(!a||!o)return null;const l=a.getLinesContent(),u=o.getLinesContent(),f=new yr(l,u,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:s,shouldMakePrettyDiff:!0,maxComputationTime:i}).computeDiff(),h=f.changes.length>0?!1:this._modelsAreIdentical(a,o);return{quitEarly:f.quitEarly,identical:h,changes:f.changes}})}_modelsAreIdentical(t,r){const s=t.getLineCount(),i=r.getLineCount();if(s!==i)return!1;for(let a=1;a<=s;a++){const o=t.getLineContent(a),l=r.getLine