cc-viewer 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -644,7 +644,7 @@ void main() {
644
644
 
645
645
  `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},tfe=new efe;function pb(e){nfe(e)||tfe.onUnexpectedError(e)}var jy="Canceled";function nfe(e){return e instanceof rfe?!0:e instanceof Error&&e.name===jy&&e.message===jy}var rfe=class extends Error{constructor(){super(jy),this.name=this.message}},bk=class Fy extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Fy)return t;let n=new Fy;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function ife(e,t){let n=this,r=!1,i;return function(){return r||(r=!0,t||(i=e.apply(n,arguments))),i}}var ofe;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function r(o){return o>0}e.isGreaterThan=r;function i(o){return o===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ofe||(ofe={}));var OO;(e=>{function t(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(k){yield k}e.single=i;function o(k){return t(k)?k:i(k)}e.wrap=o;function s(k){return k||n}e.from=s;function*a(k){for(let $=k.length-1;$>=0;$--)yield k[$]}e.reverse=a;function l(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(k){return k[Symbol.iterator]().next().value}e.first=c;function h(k,$){let R=0;for(let I of k)if($(I,R++))return!0;return!1}e.some=h;function m(k,$){for(let R of k)if($(R))return R}e.find=m;function*p(k,$){for(let R of k)$(R)&&(yield R)}e.filter=p;function*g(k,$){let R=0;for(let I of k)yield $(I,R++)}e.map=g;function*v(k,$){let R=0;for(let I of k)yield*$(I,R++)}e.flatMap=v;function*_(...k){for(let $ of k)yield*$}e.concat=_;function b(k,$,R){let I=R;for(let P of k)I=$(I,P);return I}e.reduce=b;function*C(k,$,R=k.length){for($<0&&($+=k.length),R<0?R+=k.length:R>k.length&&(R=k.length);$<R;$++)yield k[$]}e.slice=C;function x(k,$=Number.POSITIVE_INFINITY){let R=[];if($===0)return[R,k];let I=k[Symbol.iterator]();for(let P=0;P<$;P++){let M=I.next();if(M.done)return[R,e.empty()];R.push(M.value)}return[R,{[Symbol.iterator](){return I}}]}e.consume=x;async function w(k){let $=[];for await(let R of k)$.push(R);return Promise.resolve($)}e.asyncToArray=w})(OO||(OO={}));function MO(e){if(OO.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function sfe(...e){return IO(()=>MO(e))}function IO(e){return{dispose:ife(()=>{e()})}}var PO=class LO{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{MO(this._toDispose)}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?LO.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}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};PO.DISABLE_DISPOSED_WARNING=!1;var PC=PO,ig=class{constructor(){this._store=new PC,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)}};ig.None=Object.freeze({dispose(){}});var afe=globalThis.performance&&typeof globalThis.performance.now=="function",lfe=class AO{static create(t){return new AO(t)}constructor(t){this._now=afe&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},cfe;(e=>{e.None=()=>ig.None;function t(T,O){return m(T,()=>{},0,void 0,!0,void 0,O)}e.defer=t;function n(T){return(O,N=null,A)=>{let B=!1,D;return D=T(j=>{if(!B)return D?D.dispose():B=!0,O.call(N,j)},null,A),B&&D.dispose(),D}}e.once=n;function r(T,O,N){return c((A,B=null,D)=>T(j=>A.call(B,O(j)),null,D),N)}e.map=r;function i(T,O,N){return c((A,B=null,D)=>T(j=>{O(j),A.call(B,j)},null,D),N)}e.forEach=i;function o(T,O,N){return c((A,B=null,D)=>T(j=>O(j)&&A.call(B,j),null,D),N)}e.filter=o;function s(T){return T}e.signal=s;function a(...T){return(O,N=null,A)=>{let B=sfe(...T.map(D=>D(j=>O.call(N,j))));return h(B,A)}}e.any=a;function l(T,O,N,A){let B=N;return r(T,D=>(B=O(B,D),B),A)}e.reduce=l;function c(T,O){let N,A={onWillAddFirstListener(){N=T(B.fire,B)},onDidRemoveLastListener(){N==null||N.dispose()}},B=new il(A);return O==null||O.add(B),B.event}function h(T,O){return O instanceof Array?O.push(T):O&&O.add(T),T}function m(T,O,N=100,A=!1,B=!1,D,j){let W,K,V,U=0,q,Y={leakWarningThreshold:D,onWillAddFirstListener(){W=T(ee=>{U++,K=O(K,ee),A&&!V&&(Z.fire(K),K=void 0),q=()=>{let se=K;K=void 0,V=void 0,(!A||U>1)&&Z.fire(se),U=0},typeof N=="number"?(clearTimeout(V),V=setTimeout(q,N)):V===void 0&&(V=0,queueMicrotask(q))})},onWillRemoveListener(){B&&U>0&&(q==null||q())},onDidRemoveLastListener(){q=void 0,W.dispose()}},Z=new il(Y);return j==null||j.add(Z),Z.event}e.debounce=m;function p(T,O=0,N){return e.debounce(T,(A,B)=>A?(A.push(B),A):[B],O,void 0,!0,void 0,N)}e.accumulate=p;function g(T,O=(A,B)=>A===B,N){let A=!0,B;return o(T,D=>{let j=A||!O(D,B);return A=!1,B=D,j},N)}e.latch=g;function v(T,O,N){return[e.filter(T,O,N),e.filter(T,A=>!O(A),N)]}e.split=v;function _(T,O=!1,N=[],A){let B=N.slice(),D=T(K=>{B?B.push(K):W.fire(K)});A&&A.add(D);let j=()=>{B==null||B.forEach(K=>W.fire(K)),B=null},W=new il({onWillAddFirstListener(){D||(D=T(K=>W.fire(K)),A&&A.add(D))},onDidAddFirstListener(){B&&(O?setTimeout(j):j())},onDidRemoveLastListener(){D&&D.dispose(),D=null}});return A&&A.add(W),W.event}e.buffer=_;function b(T,O){return(N,A,B)=>{let D=O(new x);return T(function(j){let W=D.evaluate(j);W!==C&&N.call(A,W)},void 0,B)}}e.chain=b;let C=Symbol("HaltChainable");class x{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(N=>(O(N),N)),this}filter(O){return this.steps.push(N=>O(N)?N:C),this}reduce(O,N){let A=N;return this.steps.push(B=>(A=O(A,B),A)),this}latch(O=(N,A)=>N===A){let N=!0,A;return this.steps.push(B=>{let D=N||!O(B,A);return N=!1,A=B,D?B:C}),this}evaluate(O){for(let N of this.steps)if(O=N(O),O===C)break;return O}}function w(T,O,N=A=>A){let A=(...W)=>j.fire(N(...W)),B=()=>T.on(O,A),D=()=>T.removeListener(O,A),j=new il({onWillAddFirstListener:B,onDidRemoveLastListener:D});return j.event}e.fromNodeEventEmitter=w;function k(T,O,N=A=>A){let A=(...W)=>j.fire(N(...W)),B=()=>T.addEventListener(O,A),D=()=>T.removeEventListener(O,A),j=new il({onWillAddFirstListener:B,onDidRemoveLastListener:D});return j.event}e.fromDOMEventEmitter=k;function $(T){return new Promise(O=>n(T)(O))}e.toPromise=$;function R(T){let O=new il;return T.then(N=>{O.fire(N)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}e.fromPromise=R;function I(T,O){return T(N=>O.fire(N))}e.forward=I;function P(T,O,N){return O(N),T(A=>O(A))}e.runAndSubscribe=P;class M{constructor(O,N){this._observable=O,this._counter=0,this._hasChanged=!1;let A={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new il(A),N&&N.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,N){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function z(T,O){return new M(T,O).emitter.event}e.fromObservable=z;function F(T){return(O,N,A)=>{let B=0,D=!1,j={beginUpdate(){B++},endUpdate(){B--,B===0&&(T.reportChanges(),D&&(D=!1,O.call(N)))},handlePossibleChange(){},handleChange(){D=!0}};T.addObserver(j),T.reportChanges();let W={dispose(){T.removeObserver(j)}};return A instanceof PC?A.add(W):Array.isArray(A)&&A.push(W),W}}e.fromObservableLight=F})(cfe||(cfe={}));var Hy=class Wy{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Wy._idPool++}`,Wy.all.add(this)}start(t){this._stopWatch=new lfe,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Hy.all=new Set,Hy._idPool=0;var ufe=Hy,dfe=-1,BO=class DO{constructor(t,n,r=(DO._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[o,s]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${s}):`;console.warn(a),console.warn(o);let l=new mfe(a,o);this._errorHandler(l)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,i]of this._stacks)(!t||n<i)&&(t=[r,i],n=i);return t}};BO._idPool=1;var hfe=BO,ffe=class zO{constructor(t){this.value=t}static create(){let t=new Error;return new zO(t.stack??"")}print(){console.warn(this.value.split(`
646
646
  `).slice(2).join(`
647
- `))}},mfe=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},pfe=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},gfe=0,gb=class{constructor(e){this.value=e,this.id=gfe++}},vfe=2,bfe,il=class{constructor(e){var t,n,r,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new hfe((e==null?void 0:e.onListenerError)??pb,((n=this._options)==null?void 0:n.leakWarningThreshold)??dfe):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new ufe(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var s,a,l,c,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new pfe(`${m}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((s=this._options)==null?void 0:s.onListenerError)||pb)(g),ig.None}if(this._disposed)return ig.None;t&&(e=e.bind(t));let r=new gb(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=ffe.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof gb?(this._deliveryQueue??(this._deliveryQueue=new _fe),this._listeners=[this._listeners,r]):this._listeners.push(r):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=r,(h=(c=this._options)==null?void 0:c.onDidAddFirstListener)==null||h.call(c,this)),this._size++;let o=IO(()=>{i==null||i(),this._removeListener(r)});return n instanceof PC?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var i,o,s,a;if((o=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||o.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(s=this._options)==null?void 0:s.onDidRemoveLastListener)==null||a.call(s,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-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--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*vfe<=t.length){let l=0;for(let c=0;c<t.length;c++)t[c]?t[l++]=t[c]:r&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=l}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||pb;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,i;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof gb)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},_fe=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},og=class fp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new il,this.onChange=this._onChange.event;let t=new Jhe;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let o=0;o<i;++o){let s=t.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=i)return n+this.wcwidth(s);let c=t.charCodeAt(o);56320<=c&&c<=57343?s=(s-55296)*1024+c-56320+65536:n+=this.wcwidth(c)}let a=this.charProperties(s,r),l=fp.extractWidth(a);fp.extractShouldJoin(a)&&(l-=fp.extractWidth(r)),n+=l,r=a}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},vb=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],yfe=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],bb=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Sfe=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],ba;function _k(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var Cfe=class{constructor(){if(this.version="11",!ba){ba=new Uint8Array(65536),ba.fill(1),ba[0]=0,ba.fill(0,1,32),ba.fill(0,127,160);for(let e=0;e<vb.length;++e)ba.fill(0,vb[e][0],vb[e][1]+1);for(let e=0;e<bb.length;++e)ba.fill(2,bb[e][0],bb[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ba[e]:_k(e,yfe)?0:_k(e,Sfe)?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let i=og.extractWidth(t);i===0?r=!1:i>n&&(n=i)}return og.createPropertyValue(0,n,r)}},xfe=class{activate(e){e.unicode.register(new Cfe)}dispose(){}};const wfe="_terminalPanel_jipsg_1",Efe="_terminalContainer_jipsg_8",kfe="_virtualKeybar_jipsg_16",$fe="_virtualKey_jipsg_16",Rfe="_virtualKeyPressed_jipsg_47",ru={terminalPanel:wfe,terminalContainer:Efe,virtualKeybar:kfe,virtualKey:$fe,virtualKeyPressed:Rfe},Tfe=[{label:"↑",seq:"\x1B[A"},{label:"↓",seq:"\x1B[B"},{label:"←",seq:"\x1B[D"},{label:"→",seq:"\x1B[C"},{label:"Enter",seq:"\r"},{label:"Tab",seq:" "},{label:"Esc",seq:"\x1B"},{label:"Ctrl+C",seq:""}];class jO extends te.Component{constructor(n){super(n);It(this,"handleVirtualKey",n=>{var r;this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:n})),oi||(r=this.terminal)==null||r.focus()});It(this,"_vkTouchStart",n=>{const r=n.touches[0];this._vkStartX=r.clientX,this._vkStartY=r.clientY,this._vkMoved=!1,this._vkTarget=n.currentTarget,this._vkTarget.classList.add(ru.virtualKeyPressed)});It(this,"_vkTouchMove",n=>{if(this._vkMoved)return;const r=n.touches[0],i=r.clientX-this._vkStartX,o=r.clientY-this._vkStartY;i*i+o*o>64&&(this._vkMoved=!0)});It(this,"_vkTouchEnd",(n,r)=>{var i;r.preventDefault(),(i=this._vkTarget)==null||i.classList.remove(ru.virtualKeyPressed),this._vkTarget=null,this._vkMoved||this.handleVirtualKey(n)});this.containerRef=te.createRef(),this.terminal=null,this.fitAddon=null,this.ws=null,this.resizeObserver=null}componentDidMount(){this.initTerminal(),this.connectWebSocket(),this.setupResizeObserver()}componentWillUnmount(){this._stopMobileMomentum&&this._stopMobileMomentum(),this._writeTimer&&cancelAnimationFrame(this._writeTimer),this.ws&&(this.ws.close(),this.ws=null),this._resizeDebounceTimer&&clearTimeout(this._resizeDebounceTimer),this._webglRecoveryTimer&&clearTimeout(this._webglRecoveryTimer),this.resizeObserver&&this.resizeObserver.disconnect(),this.webglAddon&&(this.webglAddon.dispose(),this.webglAddon=null),this.terminal&&this.terminal.dispose()}initTerminal(){this.terminal=new sde({cursorBlink:!oi,fontSize:oi?11:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},allowProposedApi:!0,scrollback:oi?2e3:5e3,smoothScrollDuration:0,scrollOnUserInput:!0}),this.fitAddon=new cde,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new Yhe);const n=new xfe;this.terminal.loadAddon(n),this.terminal.unicode.activeVersion="11",this.terminal.open(this.containerRef.current),this._loadWebglAddon(!1),this._writeBuffer="",this._writeTimer=null,requestAnimationFrame(oi?()=>{this._mobileFixedResize()}:()=>{this.fitAddon.fit(),this.terminal.focus()}),this.terminal.onData(r=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r}))}),oi&&this._setupMobileTouchScroll()}_setupMobileTouchScroll(){var v;const n=(v=this.containerRef.current)==null?void 0:v.querySelector(".xterm-screen");if(!n)return;const r=this.terminal,i=()=>{var b,C,x,w;const _=(w=(x=(C=(b=r._core)==null?void 0:b._renderService)==null?void 0:C.dimensions)==null?void 0:x.css)==null?void 0:w.cell;return(_==null?void 0:_.height)||15};let o=0,s=0,a=null,l=0,c=0,h=null,m=[];const p=()=>{a&&(cancelAnimationFrame(a),a=null),h&&(cancelAnimationFrame(h),h=null),c=0,l=0},g=()=>{if(h=null,c===0)return;l+=c,c=0;const _=i(),b=Math.trunc(l/_);b!==0&&(r.scrollLines(b),l-=b*_)};n.addEventListener("touchstart",_=>{p(),_.touches.length===1&&(o=_.touches[0].clientY,s=performance.now(),m=[])},{passive:!0}),n.addEventListener("touchmove",_=>{if(_.touches.length!==1)return;const b=_.touches[0].clientY,C=performance.now(),x=C-s,w=o-b;if(x>0){const k=w/x*16;for(m.push({v:k,t:C});m.length>0&&C-m[0].t>100;)m.shift()}c+=w,h||(h=requestAnimationFrame(g)),o=b,s=C},{passive:!0}),n.addEventListener("touchend",()=>{if(h&&(cancelAnimationFrame(h),h=null),c!==0){l+=c,c=0;const w=i(),k=Math.trunc(l/w);k!==0&&r.scrollLines(k),l=0}let _=0;if(m.length>=2){let w=0,k=0;const $=m[m.length-1].t;for(const R of m){const I=Math.max(0,1-($-R.t)/100);k+=R.v*I,w+=I}_=w>0?k/w:0}if(m=[],Math.abs(_)<.5)return;const b=.95;let C=0;const x=()=>{if(Math.abs(_)<.3){const $=i(),R=Math.round(C/$);R!==0&&r.scrollLines(R),a=null;return}C+=_;const w=i(),k=Math.trunc(C/w);k!==0&&(r.scrollLines(k),C-=k*w),_*=b,a=requestAnimationFrame(x)};a=requestAnimationFrame(x)},{passive:!0}),this._stopMobileMomentum=p}connectWebSocket(){const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this.ws=new WebSocket(r),this.ws.onmessage=i=>{try{const o=JSON.parse(i.data);o.type==="data"?this._throttledWrite(o.data):o.type==="exit"?(this._flushWrite(),this.terminal.write(`\r
647
+ `))}},mfe=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},pfe=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},gfe=0,gb=class{constructor(e){this.value=e,this.id=gfe++}},vfe=2,bfe,il=class{constructor(e){var t,n,r,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new hfe((e==null?void 0:e.onListenerError)??pb,((n=this._options)==null?void 0:n.leakWarningThreshold)??dfe):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new ufe(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var s,a,l,c,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new pfe(`${m}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((s=this._options)==null?void 0:s.onListenerError)||pb)(g),ig.None}if(this._disposed)return ig.None;t&&(e=e.bind(t));let r=new gb(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=ffe.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof gb?(this._deliveryQueue??(this._deliveryQueue=new _fe),this._listeners=[this._listeners,r]):this._listeners.push(r):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=r,(h=(c=this._options)==null?void 0:c.onDidAddFirstListener)==null||h.call(c,this)),this._size++;let o=IO(()=>{i==null||i(),this._removeListener(r)});return n instanceof PC?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var i,o,s,a;if((o=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||o.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(s=this._options)==null?void 0:s.onDidRemoveLastListener)==null||a.call(s,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-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--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*vfe<=t.length){let l=0;for(let c=0;c<t.length;c++)t[c]?t[l++]=t[c]:r&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=l}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||pb;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,i;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof gb)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},_fe=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},og=class fp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new il,this.onChange=this._onChange.event;let t=new Jhe;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let o=0;o<i;++o){let s=t.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=i)return n+this.wcwidth(s);let c=t.charCodeAt(o);56320<=c&&c<=57343?s=(s-55296)*1024+c-56320+65536:n+=this.wcwidth(c)}let a=this.charProperties(s,r),l=fp.extractWidth(a);fp.extractShouldJoin(a)&&(l-=fp.extractWidth(r)),n+=l,r=a}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},vb=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],yfe=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],bb=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Sfe=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],ba;function _k(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var Cfe=class{constructor(){if(this.version="11",!ba){ba=new Uint8Array(65536),ba.fill(1),ba[0]=0,ba.fill(0,1,32),ba.fill(0,127,160);for(let e=0;e<vb.length;++e)ba.fill(0,vb[e][0],vb[e][1]+1);for(let e=0;e<bb.length;++e)ba.fill(2,bb[e][0],bb[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ba[e]:_k(e,yfe)?0:_k(e,Sfe)?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let i=og.extractWidth(t);i===0?r=!1:i>n&&(n=i)}return og.createPropertyValue(0,n,r)}},xfe=class{activate(e){e.unicode.register(new Cfe)}dispose(){}};const wfe="_terminalPanel_jipsg_1",Efe="_terminalContainer_jipsg_8",kfe="_virtualKeybar_jipsg_16",$fe="_virtualKey_jipsg_16",Rfe="_virtualKeyPressed_jipsg_47",ru={terminalPanel:wfe,terminalContainer:Efe,virtualKeybar:kfe,virtualKey:$fe,virtualKeyPressed:Rfe},Tfe=[{label:"↑",seq:"\x1B[A"},{label:"↓",seq:"\x1B[B"},{label:"←",seq:"\x1B[D"},{label:"→",seq:"\x1B[C"},{label:"Enter",seq:"\r"},{label:"Tab",seq:" "},{label:"Esc",seq:"\x1B"},{label:"Ctrl+C",seq:""}];class jO extends te.Component{constructor(n){super(n);It(this,"handleVirtualKey",n=>{var r,i;if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:n})),oi){const o=(r=this.containerRef.current)==null?void 0:r.querySelector(".xterm-helper-textarea");o&&o.blur()}else(i=this.terminal)==null||i.focus()});It(this,"_vkTouchStart",n=>{n.preventDefault();const r=n.touches[0];this._vkStartX=r.clientX,this._vkStartY=r.clientY,this._vkMoved=!1,this._vkTarget=n.currentTarget,this._vkTarget.classList.add(ru.virtualKeyPressed)});It(this,"_vkTouchMove",n=>{if(this._vkMoved)return;const r=n.touches[0],i=r.clientX-this._vkStartX,o=r.clientY-this._vkStartY;i*i+o*o>64&&(this._vkMoved=!0)});It(this,"_vkTouchEnd",(n,r)=>{var i;r.preventDefault(),(i=this._vkTarget)==null||i.classList.remove(ru.virtualKeyPressed),this._vkTarget=null,this._vkMoved||this.handleVirtualKey(n)});this.containerRef=te.createRef(),this.terminal=null,this.fitAddon=null,this.ws=null,this.resizeObserver=null}componentDidMount(){this.initTerminal(),this.connectWebSocket(),this.setupResizeObserver()}componentWillUnmount(){this._stopMobileMomentum&&this._stopMobileMomentum(),this._writeTimer&&cancelAnimationFrame(this._writeTimer),this.ws&&(this.ws.close(),this.ws=null),this._resizeDebounceTimer&&clearTimeout(this._resizeDebounceTimer),this._webglRecoveryTimer&&clearTimeout(this._webglRecoveryTimer),this.resizeObserver&&this.resizeObserver.disconnect(),this.webglAddon&&(this.webglAddon.dispose(),this.webglAddon=null),this.terminal&&this.terminal.dispose()}initTerminal(){this.terminal=new sde({cursorBlink:!oi,fontSize:oi?11:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},allowProposedApi:!0,scrollback:oi?2e3:5e3,smoothScrollDuration:0,scrollOnUserInput:!0}),this.fitAddon=new cde,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new Yhe);const n=new xfe;this.terminal.loadAddon(n),this.terminal.unicode.activeVersion="11",this.terminal.open(this.containerRef.current),this._loadWebglAddon(!1),this._writeBuffer="",this._writeTimer=null,requestAnimationFrame(oi?()=>{this._mobileFixedResize()}:()=>{this.fitAddon.fit(),this.terminal.focus()}),this.terminal.onData(r=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r}))}),oi&&this._setupMobileTouchScroll()}_setupMobileTouchScroll(){var v;const n=(v=this.containerRef.current)==null?void 0:v.querySelector(".xterm-screen");if(!n)return;const r=this.terminal,i=()=>{var b,C,x,w;const _=(w=(x=(C=(b=r._core)==null?void 0:b._renderService)==null?void 0:C.dimensions)==null?void 0:x.css)==null?void 0:w.cell;return(_==null?void 0:_.height)||15};let o=0,s=0,a=null,l=0,c=0,h=null,m=[];const p=()=>{a&&(cancelAnimationFrame(a),a=null),h&&(cancelAnimationFrame(h),h=null),c=0,l=0},g=()=>{if(h=null,c===0)return;l+=c,c=0;const _=i(),b=Math.trunc(l/_);b!==0&&(r.scrollLines(b),l-=b*_)};n.addEventListener("touchstart",_=>{p(),_.touches.length===1&&(o=_.touches[0].clientY,s=performance.now(),m=[])},{passive:!0}),n.addEventListener("touchmove",_=>{if(_.touches.length!==1)return;const b=_.touches[0].clientY,C=performance.now(),x=C-s,w=o-b;if(x>0){const k=w/x*16;for(m.push({v:k,t:C});m.length>0&&C-m[0].t>100;)m.shift()}c+=w,h||(h=requestAnimationFrame(g)),o=b,s=C},{passive:!0}),n.addEventListener("touchend",()=>{if(h&&(cancelAnimationFrame(h),h=null),c!==0){l+=c,c=0;const w=i(),k=Math.trunc(l/w);k!==0&&r.scrollLines(k),l=0}let _=0;if(m.length>=2){let w=0,k=0;const $=m[m.length-1].t;for(const R of m){const I=Math.max(0,1-($-R.t)/100);k+=R.v*I,w+=I}_=w>0?k/w:0}if(m=[],Math.abs(_)<.5)return;const b=.95;let C=0;const x=()=>{if(Math.abs(_)<.3){const $=i(),R=Math.round(C/$);R!==0&&r.scrollLines(R),a=null;return}C+=_;const w=i(),k=Math.trunc(C/w);k!==0&&(r.scrollLines(k),C-=k*w),_*=b,a=requestAnimationFrame(x)};a=requestAnimationFrame(x)},{passive:!0}),this._stopMobileMomentum=p}connectWebSocket(){const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this.ws=new WebSocket(r),this.ws.onmessage=i=>{try{const o=JSON.parse(i.data);o.type==="data"?this._throttledWrite(o.data):o.type==="exit"?(this._flushWrite(),this.terminal.write(`\r
648
648
  \x1B[33m${me("ui.terminal.exited",{code:o.exitCode??"?"})}\x1B[0m\r
649
649
  `)):o.type==="state"&&!o.running&&o.exitCode!==null&&(this._flushWrite(),this.terminal.write(`\x1B[33m${me("ui.terminal.exited",{code:o.exitCode})}\x1B[0m\r
650
650
  `))}catch{}},this.ws.onclose=()=>{setTimeout(()=>{var i;this.containerRef.current&&((i=this.terminal)==null||i.reset(),this.connectWebSocket())},2e3)},this.ws.onopen=()=>{this.sendResize()}}sendResize(){if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.terminal){const n={type:"resize",cols:this.terminal.cols,rows:this.terminal.rows};oi&&(n.mobile=!0),this.ws.send(JSON.stringify(n))}}setupResizeObserver(){oi||(this.resizeObserver=new ResizeObserver(()=>{this._resizeDebounceTimer&&clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=setTimeout(()=>{if(this._resizeDebounceTimer=null,this.fitAddon&&this.containerRef.current)try{this.fitAddon.fit(),this.sendResize()}catch{}},150)}),this.containerRef.current&&this.resizeObserver.observe(this.containerRef.current))}_loadWebglAddon(n){try{this.webglAddon=new Vhe,this.webglAddon.onContextLoss(()=>{var r;(r=this.webglAddon)==null||r.dispose(),this.webglAddon=null,n||(this._webglRecoveryTimer=setTimeout(()=>{this._webglRecoveryTimer=null,this._loadWebglAddon(!0)},1e3))}),this.terminal.loadAddon(this.webglAddon)}catch{this.webglAddon=null}}_mobileFixedResize(){var g,v,_,b;if(!this.terminal)return;const n=(b=(_=(v=(g=this.terminal._core)==null?void 0:g._renderService)==null?void 0:v.dimensions)==null?void 0:_.css)==null?void 0:b.cell;if(!n||!n.width||!n.height){setTimeout(()=>this._mobileFixedResize(),50);return}const r=60,i=16,o=8,s=40,a=52,l=window.innerWidth-i,c=window.innerHeight-s-a-o,h=this.terminal.options.fontSize,m=n.width,p=Math.floor(h*l/(r*m)*10)/10;this.terminal.options.fontSize=p,requestAnimationFrame(()=>{var k,$,R,I;const C=(I=(R=($=(k=this.terminal._core)==null?void 0:k._renderService)==null?void 0:$.dimensions)==null?void 0:R.css)==null?void 0:I.cell,x=(C==null?void 0:C.height)||n.height,w=Math.max(5,Math.min(Math.floor(c/x),100));this.terminal.resize(r,w),this.sendResize()})}_throttledWrite(n){this._writeBuffer+=n,this._writeTimer||(this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()}))}_flushWrite(){if(this._writeTimer&&(cancelAnimationFrame(this._writeTimer),this._writeTimer=null),!this._writeBuffer||!this.terminal)return;const n=32768;if(this._writeBuffer.length<=n){const r=this._writeBuffer;this._writeBuffer="",this.terminal.write(r)}else{const r=this._writeBuffer.slice(0,n);this._writeBuffer=this._writeBuffer.slice(n),this.terminal.write(r),this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()})}}render(){return S.jsxs("div",{className:ru.terminalPanel,children:[S.jsx("div",{ref:this.containerRef,className:ru.terminalContainer}),oi&&S.jsx("div",{className:ru.virtualKeybar,children:Tfe.map(n=>S.jsx("button",{className:ru.virtualKey,onTouchStart:this._vkTouchStart,onTouchMove:this._vkTouchMove,onTouchEnd:r=>this._vkTouchEnd(n.seq,r),children:n.label},n.label))})]})}}const Nfe="_fileExplorer_dbq1c_1",Ofe="_header_dbq1c_12",Mfe="_headerTitle_dbq1c_21",Ife="_collapseBtn_dbq1c_29",Pfe="_treeContainer_dbq1c_48",Lfe="_treeItem_dbq1c_54",Afe="_treeItemSelected_dbq1c_70",Bfe="_arrow_dbq1c_74",Dfe="_icon_dbq1c_83",zfe="_fileName_dbq1c_93",jfe="_loading_dbq1c_98",Ffe="_error_dbq1c_104",Hfe="_treeItemGitIgnored_dbq1c_110",ro={fileExplorer:Nfe,header:Ofe,headerTitle:Mfe,collapseBtn:Ife,treeContainer:Pfe,treeItem:Lfe,treeItemSelected:Afe,arrow:Bfe,icon:Dfe,fileName:zfe,loading:jfe,error:Ffe,treeItemGitIgnored:Hfe},Wfe={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",less:"#a86fd9",html:"#e34c26",htm:"#e34c26",xml:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584",rb:"#cc342d",java:"#b07219",c:"#555",cpp:"#f34b7d",h:"#555",sh:"#4eaa25",bash:"#4eaa25",zsh:"#4eaa25",yml:"#cb171e",yaml:"#cb171e",toml:"#999",svg:"#e34c26",png:"#a86fd9",jpg:"#a86fd9",jpeg:"#a86fd9",gif:"#a86fd9",ico:"#a86fd9",webp:"#a86fd9"};function Vfe(e,t){if(t==="directory")return S.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:S.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})});const n=e.includes(".")?e.split(".").pop().toLowerCase():"",r=Wfe[n]||"#888";return S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"1.5",children:[S.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),S.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function FO({item:e,path:t,depth:n,onFileClick:r,expandedPaths:i,onToggleExpand:o,currentFile:s}){const[a,l]=d.useState(null),[c,h]=d.useState(!1),[m,p]=d.useState(null),g=t?`${t}/${e.name}`:e.name,v=i.has(g),_=e.gitIgnored||!1,b=d.useCallback(async()=>{h(!0),p(null);try{const k=await fetch(Bn(`/api/files?path=${encodeURIComponent(g)}`));if(!k.ok)throw new Error("Failed");const $=await k.json();l($)}catch{p("Error")}finally{h(!1)}},[g]);d.useEffect(()=>{e.type==="directory"&&v&&a===null&&!c&&b()},[]);const C=d.useCallback(async()=>{if(e.type!=="directory"){r&&r(g);return}if(v){o(g);return}a===null&&await b(),o(g)},[v,a,g,e,r,o,b]),x=e.type==="directory",w=!x&&s&&s===g;return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:`${ro.treeItem}${w?" "+ro.treeItemSelected:""}${_?" "+ro.treeItemGitIgnored:""}`,style:{paddingLeft:8+n*16},onClick:C,children:[S.jsx("span",{className:ro.arrow,children:x?S.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:v?"rotate(90deg)":"none",transition:"transform 0.15s"},children:S.jsx("polyline",{points:"9 6 15 12 9 18"})}):""}),S.jsx("span",{className:ro.icon,children:Vfe(e.name,e.type)}),S.jsx("span",{className:ro.fileName,children:e.name})]}),v&&c&&S.jsx("div",{className:ro.loading,style:{paddingLeft:24+n*16},children:"..."}),v&&m&&S.jsx("div",{className:ro.error,style:{paddingLeft:24+n*16},children:m}),v&&a&&a.map(k=>S.jsx(FO,{item:k,path:g,depth:n+1,onFileClick:r,expandedPaths:i,onToggleExpand:o,currentFile:s},k.name))]})}function Kfe({onClose:e,onFileClick:t,expandedPaths:n,onToggleExpand:r,currentFile:i}){const[o,s]=d.useState(null),[a,l]=d.useState(null),c=d.useRef(!0),h=d.useRef(null),m=d.useRef(null);return d.useCallback(()=>{c.current&&fetch(Bn("/api/files?path=")).then(p=>p.ok?p.json():Promise.reject()).then(p=>{c.current&&s(p)}).catch(()=>{c.current&&l("Failed to load")})},[]),d.useEffect(()=>{c.current=!0,fetch(Bn("/api/files?path=")).then(v=>v.ok?v.json():Promise.reject()).then(v=>{c.current&&s(v)}).catch(()=>{c.current&&l("Failed to load")});const g=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;try{h.current=new WebSocket(g),h.current.onmessage=v=>{try{JSON.parse(v.data).type==="file-change"&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c.current&&fetch(Bn("/api/files?path=")).then(b=>b.ok?b.json():Promise.reject()).then(b=>{c.current&&s(b)}).catch(()=>{c.current&&l("Failed to load")})},300))}catch(_){console.error("[FileExplorer] Failed to parse WebSocket message:",_)}},h.current.onerror=v=>{console.error("[FileExplorer] WebSocket error:",v)},h.current.onclose=()=>{console.log("[FileExplorer] WebSocket closed, reconnecting in 2s..."),setTimeout(()=>{if(c.current){const v=new WebSocket(g);v.onmessage=h.current.onmessage,v.onerror=h.current.onerror,v.onclose=h.current.onclose,h.current=v}},2e3)}}catch(v){console.error("[FileExplorer] Failed to create WebSocket:",v)}return()=>{c.current=!1,h.current&&(h.current.close(),h.current=null),m.current&&(clearTimeout(m.current),m.current=null)}},[]),S.jsxs("div",{className:ro.fileExplorer,children:[S.jsxs("div",{className:ro.header,children:[S.jsx("span",{className:ro.headerTitle,children:me("ui.fileExplorer")}),S.jsx("button",{className:ro.collapseBtn,onClick:e,title:"Close",children:S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S.jsx("polyline",{points:"11 17 6 12 11 7"}),S.jsx("polyline",{points:"18 17 13 12 18 7"})]})})]}),S.jsxs("div",{className:ro.treeContainer,children:[a&&S.jsx("div",{className:ro.error,children:a}),!o&&!a&&S.jsx("div",{className:ro.loading,children:"Loading..."}),o&&o.map(p=>S.jsx(FO,{item:p,path:"",depth:0,onFileClick:t,expandedPaths:n,onToggleExpand:r,currentFile:i},p.name))]})]})}var _b,yk;function Ufe(){if(yk)return _b;yk=1;function e(ce){return ce instanceof Map?ce.clear=ce.delete=ce.set=function(){throw new Error("map is read-only")}:ce instanceof Set&&(ce.add=ce.clear=ce.delete=function(){throw new Error("set is read-only")}),Object.freeze(ce),Object.getOwnPropertyNames(ce).forEach($e=>{const Be=ce[$e],lt=typeof Be;(lt==="object"||lt==="function")&&!Object.isFrozen(Be)&&e(Be)}),ce}class t{constructor($e){$e.data===void 0&&($e.data={}),this.data=$e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ce){return ce.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(ce,...$e){const Be=Object.create(null);for(const lt in ce)Be[lt]=ce[lt];return $e.forEach(function(lt){for(const $t in lt)Be[$t]=lt[$t]}),Be}const i="</span>",o=ce=>!!ce.scope,s=(ce,{prefix:$e})=>{if(ce.startsWith("language:"))return ce.replace("language:","language-");if(ce.includes(".")){const Be=ce.split(".");return[`${$e}${Be.shift()}`,...Be.map((lt,$t)=>`${lt}${"_".repeat($t+1)}`)].join(" ")}return`${$e}${ce}`};class a{constructor($e,Be){this.buffer="",this.classPrefix=Be.classPrefix,$e.walk(this)}addText($e){this.buffer+=n($e)}openNode($e){if(!o($e))return;const Be=s($e.scope,{prefix:this.classPrefix});this.span(Be)}closeNode($e){o($e)&&(this.buffer+=i)}value(){return this.buffer}span($e){this.buffer+=`<span class="${$e}">`}}const l=(ce={})=>{const $e={children:[]};return Object.assign($e,ce),$e};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($e){this.top.children.push($e)}openNode($e){const Be=l({scope:$e});this.add(Be),this.stack.push(Be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($e){return this.constructor._walk($e,this.rootNode)}static _walk($e,Be){return typeof Be=="string"?$e.addText(Be):Be.children&&($e.openNode(Be),Be.children.forEach(lt=>this._walk($e,lt)),$e.closeNode(Be)),$e}static _collapse($e){typeof $e!="string"&&$e.children&&($e.children.every(Be=>typeof Be=="string")?$e.children=[$e.children.join("")]:$e.children.forEach(Be=>{c._collapse(Be)}))}}class h extends c{constructor($e){super(),this.options=$e}addText($e){$e!==""&&this.add($e)}startScope($e){this.openNode($e)}endScope(){this.closeNode()}__addSublanguage($e,Be){const lt=$e.root;Be&&(lt.scope=`language:${Be}`),this.add(lt)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(ce){return ce?typeof ce=="string"?ce:ce.source:null}function p(ce){return _("(?=",ce,")")}function g(ce){return _("(?:",ce,")*")}function v(ce){return _("(?:",ce,")?")}function _(...ce){return ce.map(Be=>m(Be)).join("")}function b(ce){const $e=ce[ce.length-1];return typeof $e=="object"&&$e.constructor===Object?(ce.splice(ce.length-1,1),$e):{}}function C(...ce){return"("+(b(ce).capture?"":"?:")+ce.map(lt=>m(lt)).join("|")+")"}function x(ce){return new RegExp(ce.toString()+"|").exec("").length-1}function w(ce,$e){const Be=ce&&ce.exec($e);return Be&&Be.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $(ce,{joinWith:$e}){let Be=0;return ce.map(lt=>{Be+=1;const $t=Be;let Ye=m(lt),Fe="";for(;Ye.length>0;){const De=k.exec(Ye);if(!De){Fe+=Ye;break}Fe+=Ye.substring(0,De.index),Ye=Ye.substring(De.index+De[0].length),De[0][0]==="\\"&&De[1]?Fe+="\\"+String(Number(De[1])+$t):(Fe+=De[0],De[0]==="("&&Be++)}return Fe}).map(lt=>`(${lt})`).join($e)}const R=/\b\B/,I="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",M="\\b\\d+(\\.\\d+)?",z="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",T="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",O=(ce={})=>{const $e=/^#![ ]*\//;return ce.binary&&(ce.begin=_($e,/.*\b/,ce.binary,/\b.*/)),r({scope:"meta",begin:$e,end:/$/,relevance:0,"on:begin":(Be,lt)=>{Be.index!==0&&lt.ignoreMatch()}},ce)},N={begin:"\\\\[\\s\\S]",relevance:0},A={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},D={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},j=function(ce,$e,Be={}){const lt=r({scope:"comment",begin:ce,end:$e,contains:[]},Be);lt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const $t=C("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return lt.contains.push({begin:_(/[ ]+/,"(",$t,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),lt},W=j("//","$"),K=j("/\\*","\\*/"),V=j("#","$"),U={scope:"number",begin:M,relevance:0},q={scope:"number",begin:z,relevance:0},Y={scope:"number",begin:F,relevance:0},Z={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]},ee={scope:"title",begin:I,relevance:0},se={scope:"title",begin:P,relevance:0},re={begin:"\\.\\s*"+P,relevance:0};var ye=Object.freeze({__proto__:null,APOS_STRING_MODE:A,BACKSLASH_ESCAPE:N,BINARY_NUMBER_MODE:Y,BINARY_NUMBER_RE:F,COMMENT:j,C_BLOCK_COMMENT_MODE:K,C_LINE_COMMENT_MODE:W,C_NUMBER_MODE:q,C_NUMBER_RE:z,END_SAME_AS_BEGIN:function(ce){return Object.assign(ce,{"on:begin":($e,Be)=>{Be.data._beginMatch=$e[1]},"on:end":($e,Be)=>{Be.data._beginMatch!==$e[1]&&Be.ignoreMatch()}})},HASH_COMMENT_MODE:V,IDENT_RE:I,MATCH_NOTHING_RE:R,METHOD_GUARD:re,NUMBER_MODE:U,NUMBER_RE:M,PHRASAL_WORDS_MODE:D,QUOTE_STRING_MODE:B,REGEXP_MODE:Z,RE_STARTERS_RE:T,SHEBANG:O,TITLE_MODE:ee,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:se});function he(ce,$e){ce.input[ce.index-1]==="."&&$e.ignoreMatch()}function le(ce,$e){ce.className!==void 0&&(ce.scope=ce.className,delete ce.className)}function pe(ce,$e){$e&&ce.beginKeywords&&(ce.begin="\\b("+ce.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ce.__beforeBegin=he,ce.keywords=ce.keywords||ce.beginKeywords,delete ce.beginKeywords,ce.relevance===void 0&&(ce.relevance=0))}function oe(ce,$e){Array.isArray(ce.illegal)&&(ce.illegal=C(...ce.illegal))}function ue(ce,$e){if(ce.match){if(ce.begin||ce.end)throw new Error("begin & end are not supported with match");ce.begin=ce.match,delete ce.match}}function ie(ce,$e){ce.relevance===void 0&&(ce.relevance=1)}const be=(ce,$e)=>{if(!ce.beforeMatch)return;if(ce.starts)throw new Error("beforeMatch cannot be used with starts");const Be=Object.assign({},ce);Object.keys(ce).forEach(lt=>{delete ce[lt]}),ce.keywords=Be.keywords,ce.begin=_(Be.beforeMatch,p(Be.begin)),ce.starts={relevance:0,contains:[Object.assign(Be,{endsParent:!0})]},ce.relevance=0,delete Be.beforeMatch},Ee=["of","and","for","in","not","or","if","then","parent","list","value"],Me="keyword";function Ie(ce,$e,Be=Me){const lt=Object.create(null);return typeof ce=="string"?$t(Be,ce.split(" ")):Array.isArray(ce)?$t(Be,ce):Object.keys(ce).forEach(function(Ye){Object.assign(lt,Ie(ce[Ye],$e,Ye))}),lt;function $t(Ye,Fe){$e&&(Fe=Fe.map(De=>De.toLowerCase())),Fe.forEach(function(De){const Ne=De.split("|");lt[Ne[0]]=[Ye,ge(Ne[0],Ne[1])]})}}function ge(ce,$e){return $e?Number($e):xe(ce)?0:1}function xe(ce){return Ee.includes(ce.toLowerCase())}const Ce={},we=ce=>{console.error(ce)},We=(ce,...$e)=>{console.log(`WARN: ${ce}`,...$e)},qe=(ce,$e)=>{Ce[`${ce}/${$e}`]||(console.log(`Deprecated as of ${ce}. ${$e}`),Ce[`${ce}/${$e}`]=!0)},dt=new Error;function ot(ce,$e,{key:Be}){let lt=0;const $t=ce[Be],Ye={},Fe={};for(let De=1;De<=$e.length;De++)Fe[De+lt]=$t[De],Ye[De+lt]=!0,lt+=x($e[De-1]);ce[Be]=Fe,ce[Be]._emit=Ye,ce[Be]._multi=!0}function et(ce){if(Array.isArray(ce.begin)){if(ce.skip||ce.excludeBegin||ce.returnBegin)throw we("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),dt;if(typeof ce.beginScope!="object"||ce.beginScope===null)throw we("beginScope must be object"),dt;ot(ce,ce.begin,{key:"beginScope"}),ce.begin=$(ce.begin,{joinWith:""})}}function st(ce){if(Array.isArray(ce.end)){if(ce.skip||ce.excludeEnd||ce.returnEnd)throw we("skip, excludeEnd, returnEnd not compatible with endScope: {}"),dt;if(typeof ce.endScope!="object"||ce.endScope===null)throw we("endScope must be object"),dt;ot(ce,ce.end,{key:"endScope"}),ce.end=$(ce.end,{joinWith:""})}}function Ae(ce){ce.scope&&typeof ce.scope=="object"&&ce.scope!==null&&(ce.beginScope=ce.scope,delete ce.scope)}function Le(ce){Ae(ce),typeof ce.beginScope=="string"&&(ce.beginScope={_wrap:ce.beginScope}),typeof ce.endScope=="string"&&(ce.endScope={_wrap:ce.endScope}),et(ce),st(ce)}function Ge(ce){function $e(Fe,De){return new RegExp(m(Fe),"m"+(ce.case_insensitive?"i":"")+(ce.unicodeRegex?"u":"")+(De?"g":""))}class Be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(De,Ne){Ne.position=this.position++,this.matchIndexes[this.matchAt]=Ne,this.regexes.push([Ne,De]),this.matchAt+=x(De)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const De=this.regexes.map(Ne=>Ne[1]);this.matcherRe=$e($(De,{joinWith:"|"}),!0),this.lastIndex=0}exec(De){this.matcherRe.lastIndex=this.lastIndex;const Ne=this.matcherRe.exec(De);if(!Ne)return null;const je=Ne.findIndex((Qe,Ct)=>Ct>0&&Qe!==void 0),Pe=this.matchIndexes[je];return Ne.splice(0,je),Object.assign(Ne,Pe)}}class lt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(De){if(this.multiRegexes[De])return this.multiRegexes[De];const Ne=new Be;return this.rules.slice(De).forEach(([je,Pe])=>Ne.addRule(je,Pe)),Ne.compile(),this.multiRegexes[De]=Ne,Ne}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(De,Ne){this.rules.push([De,Ne]),Ne.type==="begin"&&this.count++}exec(De){const Ne=this.getMatcher(this.regexIndex);Ne.lastIndex=this.lastIndex;let je=Ne.exec(De);if(this.resumingScanAtSamePosition()&&!(je&&je.index===this.lastIndex)){const Pe=this.getMatcher(0);Pe.lastIndex=this.lastIndex+1,je=Pe.exec(De)}return je&&(this.regexIndex+=je.position+1,this.regexIndex===this.count&&this.considerAll()),je}}function $t(Fe){const De=new lt;return Fe.contains.forEach(Ne=>De.addRule(Ne.begin,{rule:Ne,type:"begin"})),Fe.terminatorEnd&&De.addRule(Fe.terminatorEnd,{type:"end"}),Fe.illegal&&De.addRule(Fe.illegal,{type:"illegal"}),De}function Ye(Fe,De){const Ne=Fe;if(Fe.isCompiled)return Ne;[le,ue,Le,be].forEach(Pe=>Pe(Fe,De)),ce.compilerExtensions.forEach(Pe=>Pe(Fe,De)),Fe.__beforeBegin=null,[pe,oe,ie].forEach(Pe=>Pe(Fe,De)),Fe.isCompiled=!0;let je=null;return typeof Fe.keywords=="object"&&Fe.keywords.$pattern&&(Fe.keywords=Object.assign({},Fe.keywords),je=Fe.keywords.$pattern,delete Fe.keywords.$pattern),je=je||/\w+/,Fe.keywords&&(Fe.keywords=Ie(Fe.keywords,ce.case_insensitive)),Ne.keywordPatternRe=$e(je,!0),De&&(Fe.begin||(Fe.begin=/\B|\b/),Ne.beginRe=$e(Ne.begin),!Fe.end&&!Fe.endsWithParent&&(Fe.end=/\B|\b/),Fe.end&&(Ne.endRe=$e(Ne.end)),Ne.terminatorEnd=m(Ne.end)||"",Fe.endsWithParent&&De.terminatorEnd&&(Ne.terminatorEnd+=(Fe.end?"|":"")+De.terminatorEnd)),Fe.illegal&&(Ne.illegalRe=$e(Fe.illegal)),Fe.contains||(Fe.contains=[]),Fe.contains=[].concat(...Fe.contains.map(function(Pe){return tt(Pe==="self"?Fe:Pe)})),Fe.contains.forEach(function(Pe){Ye(Pe,Ne)}),Fe.starts&&Ye(Fe.starts,De),Ne.matcher=$t(Ne),Ne}if(ce.compilerExtensions||(ce.compilerExtensions=[]),ce.contains&&ce.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ce.classNameAliases=r(ce.classNameAliases||{}),Ye(ce)}function Ke(ce){return ce?ce.endsWithParent||Ke(ce.starts):!1}function tt(ce){return ce.variants&&!ce.cachedVariants&&(ce.cachedVariants=ce.variants.map(function($e){return r(ce,{variants:null},$e)})),ce.cachedVariants?ce.cachedVariants:Ke(ce)?r(ce,{starts:ce.starts?r(ce.starts):null}):Object.isFrozen(ce)?r(ce):ce}var He="11.11.1";class Je extends Error{constructor($e,Be){super($e),this.name="HTMLInjectionError",this.html=Be}}const ht=n,bt=r,Zt=Symbol("nomatch"),Qt=7,jt=function(ce){const $e=Object.create(null),Be=Object.create(null),lt=[];let $t=!0;const Ye="Could not find the language '{}', did you forget to load/include a language module?",Fe={disableAutodetect:!0,name:"Plain text",contains:[]};let De={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function Ne(ke){return De.noHighlightRe.test(ke)}function je(ke){let Ue=ke.className+" ";Ue+=ke.parentNode?ke.parentNode.className:"";const ft=De.languageDetectRe.exec(Ue);if(ft){const Ut=Ze(ft[1]);return Ut||(We(Ye.replace("{}",ft[1])),We("Falling back to no-highlight mode for this block.",ke)),Ut?ft[1]:"no-highlight"}return Ue.split(/\s+/).find(Ut=>Ne(Ut)||Ze(Ut))}function Pe(ke,Ue,ft){let Ut="",_n="";typeof Ue=="object"?(Ut=ke,ft=Ue.ignoreIllegals,_n=Ue.language):(qe("10.7.0","highlight(lang, code, ...args) has been deprecated."),qe("10.7.0",`Please use highlight(code, options) instead.
package/dist/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>Claude Code Viewer</title>
7
7
  <link rel="icon" href="/favicon.ico?v=1">
8
8
  <link rel="shortcut icon" href="/favicon.ico?v=1">
9
- <script type="module" crossorigin src="/assets/index-B_PWewSO.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-CDCylIQw.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-DanT_EUs.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
6
  "main": "server.js",