Files
red-valley/resources/luxu_admin/web/assets/editor.worker-DbHhxjrf.js

13 lines
228 KiB
JavaScript
Raw Normal View History

2026-03-29 21:41:17 +03:00
(function(){"use strict";class Lr{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Me.isErrorNoTelemetry(e)?new Me(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const vr=new Lr;function We(t){Nr(t)||vr.onUnexpectedError(t)}function hn(t){if(t instanceof Error){const{name:e,message:n}=t,s=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:s,noTelemetry:Me.isErrorNoTelemetry(t)}}return t}const Rt="Canceled";function Nr(t){return t instanceof Sr?!0:t instanceof Error&&t.name===Rt&&t.message===Rt}class Sr extends Error{constructor(){super(Rt),this.name=this.message}}class Me extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Me)return e;const n=new Me;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class se extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,se.prototype)}}function Cr(t,e){const n=this;let s=!1,r;return function(){return s||(s=!0,r=t.apply(n,arguments)),r}}var tt;(function(t){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}t.is=e;const n=Object.freeze([]);function s(){return n}t.empty=s;function*r(y){yield y}t.single=r;function i(y){return e(y)?y:r(y)}t.wrap=i;function o(y){return y||n}t.from=o;function*l(y){for(let b=y.length-1;b>=0;b--)yield y[b]}t.reverse=l;function u(y){return!y||y[Symbol.iterator]().next().done===!0}t.isEmpty=u;function c(y){return y[Symbol.iterator]().next().value}t.first=c;function f(y,b){let w=0;for(const C of y)if(b(C,w++))return!0;return!1}t.some=f;function h(y,b){for(const w of y)if(b(w))return w}t.find=h;function*m(y,b){for(const w of y)b(w)&&(yield w)}t.filter=m;function*d(y,b){let w=0;for(const C of y)yield b(C,w++)}t.map=d;function*g(y,b){let w=0;for(const C of y)yield*b(C,w++)}t.flatMap=g;function*p(...y){for(const b of y)yield*b}t.concat=p;function _(y,b,w){let C=w;for(const R of y)C=b(C,R);return C}t.reduce=_;function*L(y,b,w=y.length){for(b<0&&(b+=y.length),w<0?w+=y.length:w>y.length&&(w=y.length);b<w;b++)yield y[b]}t.slice=L;function N(y,b=Number.POSITIVE_INFINITY){const w=[];if(b===0)return[w,y];const C=y[Symbol.iterator]();for(let R=0;R<b;R++){const B=C.next();if(B.done)return[w,t.empty()];w.push(B.value)}return[w,{[Symbol.iterator](){return C}}]}t.consume=N;async function v(y){const b=[];for await(const w of y)b.push(w);return Promise.resolve(b)}t.asyncToArray=v})(tt||(tt={}));function h1(t){return t}function f1(t,e){}function fn(t){if(tt.is(t)){const e=[];for(const n of t)if(n)try{n.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Ar(...t){return nt(()=>fn(t))}function nt(t){return{dispose:Cr(()=>{t()})}}class ze{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{fn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ze.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(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}class st{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new ze,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}class ${static{this.Undefined=new $(void 0)}constructor(e){this.element=e,this.next=$.Undefined,this.prev=$.Undefined}}class Rr{constructor(){this._first=$.Undefined,this._last=$.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first
`).slice(2).join(`
`))}}class kr extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}}class Pr extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}}class kt{constructor(e){this.value=e}}const Fr=2;class oe{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Et(e?.onListenerError??We,this._options?.leakWarningThreshold??Mr):void 0,this._perfMon=this._options?._profName?new at(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);const u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new Pr(`${l}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||We)(c),st.None}if(this._disposed)return st.None;n&&(e=e.bind(n));const r=new kt(e);let i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Mt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof kt?(this._deliveryQueue??=new Dr,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;const o=nt(()=>{i?.(),this._removeListener(r)});return s instanceof ze?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,s=n.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[s]=void 0;const r=this._deliveryQueue.current===this;if(this._size*Fr<=n.length){let i=0;for(let o=0;o<n.length;o++)n[o]?n[i++]=n[o]:r&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=i}}_deliver(e,n){if(!e)return;const s=this._options?.onListenerError||We;if(!s){e.value(n);return}try{e.value(n)}catch(r){s(r)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof kt)this._deliver(this._listeners,e);else{const n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class Dr{constructor(){this.i=-1,this.end=0}enqueue(e,n,s){this.i=0,this.end=s,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function Tr(){return globalThis._VSCODE_NLS_MESSAGES}function mn(){return globalThis._VSCODE_NLS_LANGUAGE}const Vr=mn()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function dn(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(s,r)=>{const i=r[0],o=e[i];let l=s;return typeof o=="string"?l=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(l=String(o)),l}),Vr&&(n=""+n.replace(/[aouei]/g,"$&$&")+""),n}function z(t,e,...n){return dn(typeof t=="number"?Ir(t,e):e,n)}function Ir(t,e){const n=Tr()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const ke="en";let Pt=!1,Ft=!1,Dt=!1,gn=!1,Tt=!1,ot,Vt=ke,pn=ke,Br,ge;const pe=g
`||t===" "}class _t{constructor(e,n,s){this.changes=e,this.moves=n,this.hitTimeout=s}}class ma{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}class I{static addRange(e,n){let s=0;for(;s<n.length&&n[s].endExclusive<e.start;)s++;let r=s;for(;r<n.length&&n[r].start<=e.endExclusive;)r++;if(s===r)n.splice(s,0,e);else{const i=Math.min(e.start,n[s].start),o=Math.max(e.endExclusive,n[r-1].endExclusive);n.splice(s,r-s,new I(i,o))}}static tryCreate(e,n){if(!(e>n))return new I(e,n)}static ofLength(e){return new I(0,e)}static ofStartAndLength(e,n){return new I(e,e+n)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new se(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new I(this.start+e,this.endExclusive+e)}deltaStart(e){return new I(this.start+e,this.endExclusive)}deltaEnd(e){return new I(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new I(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),s=Math.min(this.endExclusive,e.endExclusive);if(n<=s)return new I(n,s)}intersects(e){const n=Math.max(this.start,e.start),s=Math.min(this.endExclusive,e.endExclusive);return n<s}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new se(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new se(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}}function Ie(t,e){const n=Xe(t,e);return n===-1?void 0:t[n]}function Xe(t,e,n=0,s=t.length){let r=n,i=s;for(;r<i;){const o=Math.floor((r+i)/2);e(t[o])?r=o+1:i=o}return r-1}function da(t,e){const n=tn(t,e);return n===t.length?void 0:t[n]}function tn(t,e,n=0,s=t.length){let r=n,i=s;for(;r<i;){const o=Math.floor((r+i)/2);e(t[o])?i=o:r=o+1}return r}class xt{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(xt.assertInvariants){if(this._prevFindLastPredicate){for(const s of this._array)if(this._prevFindLastPredicate(s)&&!e(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=Xe(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}}class D{static fromRangeInclusive(e){return new D(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let n=new de(e[0].slice());for(let s=1;s<e.length;s++)n=n.getUnion(new de(e[s].slice()));return n.ranges}static join(e){if(e.length===0)throw new se("lineRanges cannot be empty");let n=e[0].startLineNumber,s=e[0].endLineNumberExclusive;for(let r=1;r<e.length;r++)n=Math.min(n,e[r].startLineNumber),s=Math.max(s,e[r].endLineNumberExclusive);return new D(n,s)}static ofLength(e,n){return new D(e,e+n)}static deserialize(e){return new D(e[0],e[1])}constructor(e,n){if(e>n)throw new se(`startLineNumber ${e} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=e,this.endLineNumberExclusive=n}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new D(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new D(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new D(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.
`?(n++,s=0):s++;return new Be(n,s)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new k(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new k(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new U(e.lineNumber,e.column+this.columnCount):new U(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class ga{constructor(e,n){this.range=e,this.text=n}toSingleEditOperation(){return{range:this.range,text:this.text}}}class le{static inverse(e,n,s){const r=[];let i=1,o=1;for(const u of e){const c=new le(new D(i,u.original.startLineNumber),new D(o,u.modified.startLineNumber));c.modified.isEmpty||r.push(c),i=u.original.endLineNumberExclusive,o=u.modified.endLineNumberExclusive}const l=new le(new D(i,n+1),new D(o,s+1));return l.modified.isEmpty||r.push(l),r}static clip(e,n,s){const r=[];for(const i of e){const o=i.original.intersect(n),l=i.modified.intersect(s);o&&!o.isEmpty&&l&&!l.isEmpty&&r.push(new le(o,l))}return r}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new le(this.modified,this.original)}join(e){return new le(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new he(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new se("not a valid diff");return new he(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new he(new k(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new k(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(er(this.original.endLineNumberExclusive,e)&&er(this.modified.endLineNumberExclusive,n))return new he(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new he(k.fromPositions(new U(this.original.startLineNumber,1),qe(new U(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),k.fromPositions(new U(this.modified.startLineNumber,1),qe(new U(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new he(k.fromPositions(qe(new U(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),qe(new U(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),k.fromPositions(qe(new U(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),qe(new U(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new se}}function qe(t,e){if(t.lineNumber<1)return new U(1,1);if(t.lineNumber>e.length)return new U(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new U(t.lineNumber,n.length+1):t}function er(t,e){return t>=1&&t<=e.length}class ye extends le{static fromRangeMappings(e){const n=D.join(e.map(r=>D.fromRangeInclusive(r.originalRange))),s=D.join(e.map(r=>D.fromRangeInclusive(r.modifiedRange)));return new ye(n,s,e)}constructor(e,n,s){super(e,n),this.innerChanges=s}flip(){return new ye(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new ye(this.original,this.modified,[this.toRangeMapping()])}}class he{static assertSorted(e){for(let n=1;n<e.length;n++){const s=e[n-1],r=e[n];if(!(s.originalRange.getEndPosition().isBeforeOrEqual(r.originalRange.getSta
`);this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=r}computeSimilarity(e){let n=0;const s=Math.max(this.histogram.length,e.histogram.length);for(let r=0;r<s;r++)n+=Math.abs((this.histogram[r]??0)-(e.histogram[r]??0));return 1-n/(this.totalCount+e.totalCount)}}class Ra{compute(e,n,s=Ye.instance,r){if(e.length===0||n.length===0)return _e.trivial(e,n);const i=new an(e.length,n.length),o=new an(e.length,n.length),l=new an(e.length,n.length);for(let g=0;g<e.length;g++)for(let p=0;p<n.length;p++){if(!s.isValid())return _e.trivialTimedOut(e,n);const _=g===0?0:i.get(g-1,p),L=p===0?0:i.get(g,p-1);let N;e.getElement(g)===n.getElement(p)?(g===0||p===0?N=0:N=i.get(g-1,p-1),g>0&&p>0&&o.get(g-1,p-1)===3&&(N+=l.get(g-1,p-1)),N+=r?r(g,p):1):N=-1;const v=Math.max(_,L,N);if(v===N){const y=g>0&&p>0?l.get(g-1,p-1):0;l.set(g,p,y+1),o.set(g,p,3)}else v===_?(l.set(g,p,0),o.set(g,p,1)):v===L&&(l.set(g,p,0),o.set(g,p,2));i.set(g,p,v)}const u=[];let c=e.length,f=n.length;function h(g,p){(g+1!==c||p+1!==f)&&u.push(new G(new I(g+1,c),new I(p+1,f))),c=g,f=p}let m=e.length-1,d=n.length-1;for(;m>=0&&d>=0;)o.get(m,d)===3?(h(m,d),m--,d--):o.get(m,d)===1?m--:d--;return h(-1,-1),u.reverse(),new _e(u,!1)}}class rr{compute(e,n,s=Ye.instance){if(e.length===0||n.length===0)return _e.trivial(e,n);const r=e,i=n;function o(p,_){for(;p<r.length&&_<i.length&&r.getElement(p)===i.getElement(_);)p++,_++;return p}let l=0;const u=new Ea;u.set(0,o(0,0));const c=new Ma;c.set(0,u.get(0)===0?null:new ir(null,0,0,u.get(0)));let f=0;e:for(;;){if(l++,!s.isValid())return _e.trivialTimedOut(r,i);const p=-Math.min(l,i.length+l%2),_=Math.min(l,r.length+l%2);for(f=p;f<=_;f+=2){const L=f===_?-1:u.get(f+1),N=f===p?-1:u.get(f-1)+1,v=Math.min(Math.max(L,N),r.length),y=v-f;if(v>r.length||y>i.length)continue;const b=o(v,y);u.set(f,b);const w=v===L?c.get(f+1):c.get(f-1);if(c.set(f,b!==v?new ir(w,v,y,b-v):w),u.get(f)===r.length&&u.get(f)-f===i.length)break e}}let h=c.get(f);const m=[];let d=r.length,g=i.length;for(;;){const p=h?h.x+h.length:0,_=h?h.y+h.length:0;if((p!==d||_!==g)&&m.push(new G(new I(p,d),new I(_,g))),!h)break;d=h.x,g=h.y,h=h.prev}return m.reverse(),new _e(m,!1)}}class ir{constructor(e,n,s,r){this.prev=e,this.x=n,this.y=s,this.length=r}}class Ea{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const s=this.negativeArr;this.negativeArr=new Int32Array(s.length*2),this.negativeArr.set(s)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const s=this.positiveArr;this.positiveArr=new Int32Array(s.length*2),this.positiveArr.set(s)}this.positiveArr[e]=n}}}class Ma{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class Nt{constructor(e,n,s){this.lines=e,this.range=n,this.considerWhitespaceChanges=s,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let r=this.range.startLineNumber;r<=this.range.endLineNumber;r++){let i=e[r-1],o=0;r===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,i=i.substring(o)),this.lineStartOffsets.push(o);let l=0;if(!s){const c=i.trimStart();l=i.length-c.length,i=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);const u=r===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-l,i.length):i.length;for(let c=0;c<u;c++)this.elements.push(i.charCodeAt(c));r<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new I(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=or(e>0?this.elements[e-1]:-1),s=or(e<this.e
`).length>=15&&Fa(h,d=>d.length>=2)>=2}),o=Ia(t,o),o}function Fa(t,e){let n=0;for(const s of t)e(s)&&n++;return n}function Da(t,e,n,s){const r=[],i=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Je(u.original,e,u)),o=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Je(u.modified,n,u))),l=new Set;for(const u of i){let c=-1,f;for(const h of o){const m=u.computeSimilarity(h);m>c&&(c=m,f=h)}if(c>.9&&f&&(o.delete(f),r.push(new le(u.range,f.range)),l.add(u.source),l.add(f.source)),!s.isValid())return{moves:r,excludedChanges:l}}return{moves:r,excludedChanges:l}}function Ta(t,e,n,s,r,i){const o=[],l=new ea;for(const m of t)for(let d=m.original.startLineNumber;d<m.original.endLineNumberExclusive-2;d++){const g=`${e[d-1]}:${e[d+1-1]}:${e[d+2-1]}`;l.add(g,{range:new D(d,d+3)})}const u=[];t.sort(wt(m=>m.modified.startLineNumber,Lt));for(const m of t){let d=[];for(let g=m.modified.startLineNumber;g<m.modified.endLineNumberExclusive-2;g++){const p=`${n[g-1]}:${n[g+1-1]}:${n[g+2-1]}`,_=new D(g,g+3),L=[];l.forEach(p,({range:N})=>{for(const y of d)if(y.originalLineRange.endLineNumberExclusive+1===N.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){y.originalLineRange=new D(y.originalLineRange.startLineNumber,N.endLineNumberExclusive),y.modifiedLineRange=new D(y.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),L.push(y);return}const v={modifiedLineRange:_,originalLineRange:N};u.push(v),L.push(v)}),d=L}if(!i.isValid())return[]}u.sort(Ca(wt(m=>m.modifiedLineRange.length,Lt)));const c=new de,f=new de;for(const m of u){const d=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,g=c.subtractFrom(m.modifiedLineRange),p=f.subtractFrom(m.originalLineRange).getWithDelta(d),_=g.getIntersection(p);for(const L of _.ranges){if(L.length<3)continue;const N=L,v=L.delta(-d);o.push(new le(v,N)),c.addRange(N),f.addRange(v)}}o.sort(wt(m=>m.original.startLineNumber,Lt));const h=new xt(t);for(let m=0;m<o.length;m++){const d=o[m],g=h.findLastMonotonous(w=>w.original.startLineNumber<=d.original.startLineNumber),p=Ie(t,w=>w.modified.startLineNumber<=d.modified.startLineNumber),_=Math.max(d.original.startLineNumber-g.original.startLineNumber,d.modified.startLineNumber-p.modified.startLineNumber),L=h.findLastMonotonous(w=>w.original.startLineNumber<d.original.endLineNumberExclusive),N=Ie(t,w=>w.modified.startLineNumber<d.modified.endLineNumberExclusive),v=Math.max(L.original.endLineNumberExclusive-d.original.endLineNumberExclusive,N.modified.endLineNumberExclusive-d.modified.endLineNumberExclusive);let y;for(y=0;y<_;y++){const w=d.original.startLineNumber-y-1,C=d.modified.startLineNumber-y-1;if(w>s.length||C>r.length||c.contains(C)||f.contains(w)||!lr(s[w-1],r[C-1],i))break}y>0&&(f.addRange(new D(d.original.startLineNumber-y,d.original.startLineNumber)),c.addRange(new D(d.modified.startLineNumber-y,d.modified.startLineNumber)));let b;for(b=0;b<v;b++){const w=d.original.endLineNumberExclusive+b,C=d.modified.endLineNumberExclusive+b;if(w>s.length||C>r.length||c.contains(C)||f.contains(w)||!lr(s[w-1],r[C-1],i))break}b>0&&(f.addRange(new D(d.original.endLineNumberExclusive,d.original.endLineNumberExclusive+b)),c.addRange(new D(d.modified.endLineNumberExclusive,d.modified.endLineNumberExclusive+b))),(y>0||b>0)&&(o[m]=new le(new D(d.original.startLineNumber-y,d.original.endLineNumberExclusive+b),new D(d.modified.startLineNumber-y,d.modified.endLineNumberExclusive+b)))}return o}function lr(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const r=new rr().compute(new Nt([t],new k(1,1,1,t.length),!1),new Nt([e],new k(1,1,1,e.length),!1),n);let i=0;const o=G.invert(r.diffs,t.length);for(const f of o)f.seq1Range.forEach(h=>{on(t.charCodeAt(h))||i++});function l(f){let h=0;for(let m=0;m<t.length;m++)on(f.charCodeAt(m))||h++;return h}const u=l(t.length>e.length?t:e);return i/u>.6&&u>10}function Va(t){if(t.length===0)return t;t.sort(wt(n=>n.original.startLineNumber,Lt));const e=[t[0]];for(let n=1;n<t.length;n++){const s=e[e.length-
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function mr(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===32||t.charCodeAt(e)===9);)e++;return e}class za{constructor(){this.dynamicProgrammingDiffing=new Ra,this.myersDiffingAlgorithm=new rr}computeDiff(e,n,s){if(e.length<=1&&wa(e,n,(b,w)=>b===w))return new _t([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new _t([new ye(new D(1,e.length+1),new D(1,n.length+1),[new he(new k(1,1,e.length,e[e.length-1].length+1),new k(1,1,n.length,n[n.length-1].length+1))])],[],!1);const r=s.maxComputationTimeMs===0?Ye.instance:new Aa(s.maxComputationTimeMs),i=!s.ignoreTrimWhitespace,o=new Map;function l(b){let w=o.get(b);return w===void 0&&(w=o.size,o.set(b,w)),w}const u=e.map(b=>l(b.trim())),c=n.map(b=>l(b.trim())),f=new fr(u,e),h=new fr(c,n),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,r,(b,w)=>e[b]===n[w]?n[w].length===0?.1:1+Math.log(1+n[w].length):.99):this.myersDiffingAlgorithm.compute(f,h,r);let d=m.diffs,g=m.hitTimeout;d=ur(f,h,d),d=$a(f,h,d);const p=[],_=b=>{if(i)for(let w=0;w<b;w++){const C=L+w,R=N+w;if(e[C]!==n[R]){const B=this.refineDiff(e,n,new G(new I(C,C+1),new I(R,R+1)),r,i);for(const Q of B.mappings)p.push(Q);B.hitTimeout&&(g=!0)}}};let L=0,N=0;for(const b of d){yt(()=>b.seq1Range.start-L===b.seq2Range.start-N);const w=b.seq1Range.start-L;_(w),L=b.seq1Range.endExclusive,N=b.seq2Range.endExclusive;const C=this.refineDiff(e,n,b,r,i);C.hitTimeout&&(g=!0);for(const R of C.mappings)p.push(R)}_(e.length-L);const v=dr(p,e,n);let y=[];return s.computeMoves&&(y=this.computeMoves(v,e,n,u,c,r,i)),yt(()=>{function b(C,R){if(C.lineNumber<1||C.lineNumber>R.length)return!1;const B=R[C.lineNumber-1];return!(C.column<1||C.column>B.length+1)}function w(C,R){return!(C.startLineNumber<1||C.startLineNumber>R.length+1||C.endLineNumberExclusive<1||C.endLineNumberExclusive>R.length+1)}for(const C of v){if(!C.innerChanges)return!1;for(const R of C.innerChanges)if(!(b(R.modifiedRange.getStartPosition(),n)&&b(R.modifiedRange.getEndPosition(),n)&&b(R.originalRange.getStartPosition(),e)&&b(R.originalRange.getEndPosition(),e)))return!1;if(!w(C.modified,n)||!w(C.original,e))return!1}return!0}),new _t(v,y,g)}computeMoves(e,n,s,r,i,o,l){return Pa(e,n,s,r,i,o).map(f=>{const h=this.refineDiff(n,s,new G(f.original.toOffsetRange(),f.modified.toOffsetRange()),o,l),m=dr(h.mappings,n,s,!0);return new ma(f,m)})}refineDiff(e,n,s,r,i){const l=Ga(s).toRangeMapping2(e,n),u=new Nt(e,l.originalRange,i),c=new Nt(n,l.modifiedRange,i),f=u.length+c.length<500?this.dynamicProgrammingDiffing.compute(u,c,r):this.myersDiffingAlgorithm.compute(u,c,r);let h=f.diffs;return h=ur(u,c,h),h=Ua(u,c,h),h=qa(u,c,h),h=Wa(u,c,h),{mappings:h.map(d=>new he(u.translateRange(d.seq1Range),c.translateRange(d.seq2Range))),hitTimeout:f.hitTimeout}}}function dr(t,e,n,s=!1){const r=[];for(const i of La(t.map(o=>Oa(o,e,n)),(o,l)=>o.original.overlapOrTouch(l.original)||o.modified.overlapOrTouch(l.modified))){const o=i[0],l=i[i.length-1];r.push(new ye(o.original.join(l.original),o.modified.join(l.modified),i.map(u=>u.innerChanges[0])))}return yt(()=>!s&&r.length>0&&(r[0].modified.startLineNumber!==r[0].original.startLineNumber||n.length-r[r.length-1].modified.endLineNumberExclusive!==e.length-r[r.length-1].original.endLineNumberExclusive)?!1:Xs(r,(i,o)=>o.original.startLineNumber-i.original.endLineNumberExclusive===o.modified.startLineNumber-i.modified.endLineNumberExclusive&&i.original.endLineNumberExclusive<o.original.startLineNumber&&i.modified.endLineNumberExclusive<o.modified.startLineNumber)),r}function Oa(t,e,n){let s=0,r=0;t.modifiedRange.endColumn===1&&t.originalRange.endColumn===1&&t.originalRange.startLineNumber+s<=t.originalRange.endLineNumber&&t.modifiedRange.startLineNumber+s<=t.modifiedRange.endLineNumber&&(r=-1),t.modifiedRange.startColumn-1>=n[t.modifiedRange.startLineNumber-1].length&&t.originalRange.startColumn-1>=e[t.originalRange.startLineNumber-1].length&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+r&&t.modifiedRange.startLineNumber<=t.modi