From 7cfef22bf67f69b72bf9b0ce802534cb73af328e Mon Sep 17 00:00:00 2001 From: Daniel Kim <79390398+sox8502@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:49:13 -0700 Subject: [PATCH] Tour copy and sizing polish (v0.1.69) (#104) * Tour copy and sizing polish Rewritten step descriptions (workspace pitch, prompt examples, worktree framing) with no em dashes and a single colon across the deck. Card sized between the original and the first enlargement: 390px wide, fs-lg title, fs-base body, full-size footer buttons. * Bump version to 0.1.69 --- Cargo.lock | 2 +- Cargo.toml | 2 +- .../{index-DtLrlkjR.js => index-0VEmtFys.js} | 2 +- ...{index-FZ8l5lIQ.css => index-C5oJgTxI.css} | 2 +- ui/dist/index.html | 4 +-- ui/src/components/Tour.tsx | 27 +++++++++---------- ui/src/styles.css | 22 +++++++-------- 7 files changed, 30 insertions(+), 31 deletions(-) rename ui/dist/assets/{index-DtLrlkjR.js => index-0VEmtFys.js} (91%) rename ui/dist/assets/{index-FZ8l5lIQ.css => index-C5oJgTxI.css} (81%) diff --git a/Cargo.lock b/Cargo.lock index 24623b49..8389af45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -928,7 +928,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openresearch-cli" -version = "0.1.68" +version = "0.1.69" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 377a7fd6..cc1f5cf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openresearch-cli" -version = "0.1.68" +version = "0.1.69" edition = "2021" description = "OpenResearch CLI (orx) — Rust port" repository = "https://github.com/alphaXiv/openresearch-cli" diff --git a/ui/dist/assets/index-DtLrlkjR.js b/ui/dist/assets/index-0VEmtFys.js similarity index 91% rename from ui/dist/assets/index-DtLrlkjR.js rename to ui/dist/assets/index-0VEmtFys.js index 7d6cc80d..bff55504 100644 --- a/ui/dist/assets/index-DtLrlkjR.js +++ b/ui/dist/assets/index-0VEmtFys.js @@ -371,7 +371,7 @@ WARNING: This link could potentially be dangerous`)){const y=window.open();if(y) `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,v,_,C){const w={type:0,cancel:!1,key:void 0},S=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:w.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(w.key=f.C0.ESC+w.key);break;case 9:if(d.shiftKey){w.key=f.C0.ESC+"[Z";break}w.key=f.C0.HT,w.cancel=!0;break;case 13:w.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,w.cancel=!0;break;case 27:w.key=f.C0.ESC,d.altKey&&(w.key=f.C0.ESC+f.C0.ESC),w.cancel=!0;break;case 37:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"D",w.key===f.C0.ESC+"[1;3D"&&(w.key=f.C0.ESC+(_?"b":"[1;5D"))):w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"C",w.key===f.C0.ESC+"[1;3C"&&(w.key=f.C0.ESC+(_?"f":"[1;5C"))):w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"A",_||w.key!==f.C0.ESC+"[1;3A"||(w.key=f.C0.ESC+"[1;5A")):w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"B",_||w.key!==f.C0.ESC+"[1;3B"||(w.key=f.C0.ESC+"[1;5B")):w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(w.key=f.C0.ESC+"[2~");break;case 46:w.key=S?f.C0.ESC+"[3;"+(S+1)+"~":f.C0.ESC+"[3~";break;case 36:w.key=S?f.C0.ESC+"[1;"+(S+1)+"H":v?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:w.key=S?f.C0.ESC+"[1;"+(S+1)+"F":v?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?w.type=2:d.ctrlKey?w.key=f.C0.ESC+"[5;"+(S+1)+"~":w.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?w.type=3:d.ctrlKey?w.key=f.C0.ESC+"[6;"+(S+1)+"~":w.key=f.C0.ESC+"[6~";break;case 112:w.key=S?f.C0.ESC+"[1;"+(S+1)+"P":f.C0.ESC+"OP";break;case 113:w.key=S?f.C0.ESC+"[1;"+(S+1)+"Q":f.C0.ESC+"OQ";break;case 114:w.key=S?f.C0.ESC+"[1;"+(S+1)+"R":f.C0.ESC+"OR";break;case 115:w.key=S?f.C0.ESC+"[1;"+(S+1)+"S":f.C0.ESC+"OS";break;case 116:w.key=S?f.C0.ESC+"[15;"+(S+1)+"~":f.C0.ESC+"[15~";break;case 117:w.key=S?f.C0.ESC+"[17;"+(S+1)+"~":f.C0.ESC+"[17~";break;case 118:w.key=S?f.C0.ESC+"[18;"+(S+1)+"~":f.C0.ESC+"[18~";break;case 119:w.key=S?f.C0.ESC+"[19;"+(S+1)+"~":f.C0.ESC+"[19~";break;case 120:w.key=S?f.C0.ESC+"[20;"+(S+1)+"~":f.C0.ESC+"[20~";break;case 121:w.key=S?f.C0.ESC+"[21;"+(S+1)+"~":f.C0.ESC+"[21~";break;case 122:w.key=S?f.C0.ESC+"[23;"+(S+1)+"~":f.C0.ESC+"[23~";break;case 123:w.key=S?f.C0.ESC+"[24;"+(S+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(_&&!C||!d.altKey||d.metaKey)!_||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?w.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(w.key=f.C0.US),d.key==="@"&&(w.key=f.C0.NUL)):d.keyCode===65&&(w.type=1);else{const y=p[d.keyCode],x=y==null?void 0:y[d.shiftKey?1:0];if(x)w.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const b=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(b);d.shiftKey&&(E=E.toUpperCase()),w.key=f.C0.ESC+E}else if(d.keyCode===32)w.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let b=d.code.slice(3,4);d.shiftKey||(b=b.toLowerCase()),w.key=f.C0.ESC+b,w.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?w.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?w.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?w.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?w.key=f.C0.DEL:d.keyCode===219?w.key=f.C0.ESC:d.keyCode===220?w.key=f.C0.FS:d.keyCode===221&&(w.key=f.C0.GS)}return w}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let v=f;v65535?(_-=65536,d+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):d+=String.fromCharCode(_)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,v=0;if(this._interim){const _=c.charCodeAt(v++);56320<=_&&_<=57343?f[d++]=1024*(this._interim-55296)+_-56320+65536:(f[d++]=this._interim,f[d++]=_),this._interim=0}for(let _=v;_=p)return this._interim=C,d;const w=c.charCodeAt(_);56320<=w&&w<=57343?f[d++]=1024*(C-55296)+w-56320+65536:(f[d++]=C,f[d++]=w)}else C!==65279&&(f[d++]=C)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,v,_,C,w=0,S=0,y=0;if(this.interim[0]){let E=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let N,R=0;for(;(N=63&this.interim[++R])&&R<4;)D<<=6,D|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-R;for(;y=p)return 0;if(N=c[y++],(192&N)!=128){y--,E=!0;break}this.interim[R++]=N,D<<=6,D|=63&N}E||(T===2?D<128?y--:f[w++]=D:T===3?D<2048||D>=55296&&D<=57343||D===65279||(f[w++]=D):D<65536||D>1114111||(f[w++]=D)),this.interim.fill(0)}const x=p-4;let b=y;for(;b=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(S=(31&d)<<6|63&v,S<128){b--;continue}f[w++]=S}else if((240&d)==224){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(S=(15&d)<<12|(63&v)<<6|63&_,S<2048||S>=55296&&S<=57343||S===65279)continue;f[w++]=S}else if((248&d)==240){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=_,w;if(C=c[b++],(192&C)!=128){b--;continue}if(S=(7&d)<<18|(63&v)<<12|(63&_)<<6|63&C,S<65536||S>1114111)continue;f[w++]=S}}return w}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let _=0;_w[x][1])return!1;for(;x>=y;)if(S=y+x>>1,C>w[S][1])y=S+1;else{if(!(C=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let w=this.wcwidth(_),S=w===0&&C!==0;if(S){const y=f.UnicodeService.extractWidth(C);y===0?S=!1:y>w&&(w=y)}return f.UnicodeService.createPropertyValue(0,w,S)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const w=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],y=this._action(S,C);if(y){const b=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,v){const _=d.toString(16),C=_.length<2?"0"+_:_;switch(v){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}o.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const _=c.exec(v);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),f.exec(v)&&[3,6,9,12].includes(v.length))){const _=v.length/3,C=[0,0,0];for(let w=0;w<3;++w){const S=parseInt(v.slice(_*w,_*w+_),16);C[w]=_===1?S<<4:_===2?S:_===3?S>>4:S>>8}return C}},o.toRgbString=function(d,v=16){const[_,C,w]=d;return`rgb:${p(_,v)}/${p(C,v)}/${p(w,v)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const S=this._handlers[C];return S.push(w),{dispose:()=>{const y=S.indexOf(w);y!==-1&&S.splice(y,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,S){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(C,w,S);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(C,w,S))}unhook(C,w=!0){if(this._active.length){let S=!1,y=this._active.length-1,x=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,S=w,x=this._stack.fallThrough,this._stack.paused=!1),!x&&S===!1){for(;y>=0&&(S=this._active[y].unhook(C),S!==!0);y--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,S;y--}for(;y>=0;y--)if(S=this._active[y].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const _=new p.Params;_.addParam(0),o.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,w,S){this._hitLimit||(this._data+=(0,f.utf32ToString)(C,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((S=>(this._params=_,this._data="",this._hitLimit=!1,S)));return this._params=_,this._data="",this._hitLimit=!1,w}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),v=c(6351);class _{constructor(y){this.table=new Uint8Array(y)}setDefault(y,x){this.table.fill(y<<4|x)}add(y,x,b,E){this.table[x<<8|y]=b<<4|E}addMany(y,x,b,E){for(let D=0;DT)),x=(R,T)=>y.slice(R,T),b=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const D=x(0,14);let N;for(N in S.setDefault(1,0),S.addMany(b,0,2,0),D)S.addMany([24,26,153,154],N,3,0),S.addMany(x(128,144),N,3,0),S.addMany(x(144,152),N,3,0),S.add(156,N,0,0),S.add(27,N,11,1),S.add(157,N,4,8),S.addMany([152,158,159],N,0,7),S.add(155,N,11,3),S.add(144,N,11,9);return S.addMany(E,0,3,0),S.addMany(E,1,3,1),S.add(127,1,0,1),S.addMany(E,8,0,8),S.addMany(E,3,3,3),S.add(127,3,0,3),S.addMany(E,4,3,4),S.add(127,4,0,4),S.addMany(E,6,3,6),S.addMany(E,5,3,5),S.add(127,5,0,5),S.addMany(E,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(b,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(x(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(b,7,0,7),S.addMany(E,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(x(64,127),3,7,0),S.addMany(x(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(x(48,60),4,8,4),S.addMany(x(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(x(32,64),6,0,6),S.add(127,6,0,6),S.addMany(x(64,127),6,0,0),S.addMany(x(32,48),3,9,5),S.addMany(x(32,48),5,9,5),S.addMany(x(48,64),5,0,6),S.addMany(x(64,127),5,7,0),S.addMany(x(32,48),4,9,5),S.addMany(x(32,48),1,9,2),S.addMany(x(32,48),2,9,2),S.addMany(x(48,127),2,10,0),S.addMany(x(48,80),1,10,0),S.addMany(x(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(x(96,127),1,10,0),S.add(80,1,11,9),S.addMany(E,9,0,9),S.add(127,9,0,9),S.addMany(x(28,32),9,0,9),S.addMany(x(32,48),9,9,12),S.addMany(x(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(E,11,0,11),S.addMany(x(32,128),11,0,11),S.addMany(x(28,32),11,0,11),S.addMany(E,10,0,10),S.add(127,10,0,10),S.addMany(x(28,32),10,0,10),S.addMany(x(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(x(32,48),10,9,12),S.addMany(E,12,0,12),S.add(127,12,0,12),S.addMany(x(28,32),12,0,12),S.addMany(x(32,48),12,9,12),S.addMany(x(48,64),12,0,11),S.addMany(x(64,127),12,12,13),S.addMany(x(64,127),10,12,13),S.addMany(x(64,127),9,12,13),S.addMany(E,13,13,13),S.addMany(b,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(C,0,2,0),S.add(C,8,5,8),S.add(C,6,0,6),S.add(C,11,0,11),S.add(C,13,13,13),S})();class w extends f.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,b,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,b)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,x=[64,126]){let b=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=y.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;DN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=N}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return b<<=8,b|=E,b}identToString(y){const x=[];for(;y;)x.push(String.fromCharCode(255&y)),y>>=8;return x.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,x){const b=this._identifier(y,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(x),{dispose:()=>{const D=E.indexOf(x);D!==-1&&E.splice(D,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,x){this._executeHandlers[y.charCodeAt(0)]=x}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,x){const b=this._identifier(y);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(x),{dispose:()=>{const D=E.indexOf(x);D!==-1&&E.splice(D,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,x){return this._dcsParser.registerHandler(this._identifier(y),x)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,x){return this._oscParser.registerHandler(y,x)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(y,x,b,E,D){this._parseStack.state=y,this._parseStack.handlers=x,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=D}parse(y,x,b){let E,D=0,N=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(D=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(D!==24&&D!==26,b),E)return E;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=y[this._parseStack.chunkPos],E=this._oscParser.end(D!==24&&D!==26,b),E)return E;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=R;T>4){case 2:for(let F=T+1;;++F){if(F>=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingJoinState=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++T47&&D<60);T--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const z=this._escHandlers[this._collect<<8|D];let V=z?z.length-1:-1;for(;V>=0&&(E=z[V](),E!==!0);V--)if(E instanceof Promise)return this._preserveStack(4,z,V,N,T),E;V<0&&this._escHandlerFb(this._collect<<8|D),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|D,this._params);break;case 13:for(let F=T+1;;++F)if(F>=x||(D=y[F])===24||D===26||D===27||D>127&&D=x||(D=y[F])<32||D>127&&D{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,_){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(_),{dispose:()=>{const w=C.indexOf(_);w!==-1&&C.splice(w,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,_,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(v,_,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,_,C))}start(){this.reset(),this._state=1}put(v,_,C){if(this._state!==3){if(this._state===1)for(;_0&&this._put(v,_,C)}}end(v,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,S=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=_,S=this._stack.fallThrough,this._stack.paused=!1),!S&&C===!1){for(;w>=0&&(C=this._active[w].end(v),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,_,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,_,C),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let _=!1;if(this._hitLimit)_=!1;else if(v&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const v=new f;if(!d.length)return v;for(let _=Array.isArray(d[0])?1:0;_256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&d.push(Array.prototype.slice.call(this._subParams,_,C))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,_=255&this._subParamsIdx[d];return _-v>0?this._subParams.subarray(v,_):null}getSubParamsAll(){const d={};for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&(d[v]=this._subParams.slice(_,C))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[v-1];_[v-1]=~C?Math.min(10*C+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const v=this._buffer.lines.get(d);if(v)return new f.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,v){return this._line.translateToString(p,d,v)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class v extends d.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,D=arguments.length,N=D<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var R=S.length-1;R>=0;R--)(E=S[R])&&(N=(D<3?E(N):D>3?E(y,x,N):E(y,x))||N);return D>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),v=c(844),_=c(5295),C=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(S){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(S.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(S,this))}resize(S,y){this.cols=S,this.rows=y,this.buffers.resize(S,y),this._onResize.fire({cols:S,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,y=!1){const x=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===S.fg&&b.getBg(0)===S.bg||(b=x.getBlankLine(S,y),this._cachedBlankLine=b),b.isWrapped=y;const E=x.ybase+x.scrollTop,D=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;D===x.lines.length-1?N?x.lines.recycle().copyFrom(b):x.lines.push(b.clone()):x.lines.splice(D+1,0,b.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=D-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(D,b.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(S,y,x){const b=this.buffer;if(S<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else S+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+S,b.ybase),0),E!==b.ydisp&&(y||this._onScroll.fire(b.ydisp))}};o.BufferService=w=f([p(0,C.IOptionsService)],w)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(b,E,D,N){var R,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,D):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,E,D,N);else for(var B=b.length-1;B>=0;B--)(R=b[B])&&(j=(T<3?R(j):T>3?R(E,D,j):R(E,D))||j);return T>3&&j&&Object.defineProperty(E,D,j),j},p=this&&this.__param||function(b,E){return function(D,N){E(D,N,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),v=c(8460),_=c(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,E){let D=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(D|=64,D|=b.action):(D|=3&b.button,4&b.button&&(D|=64),8&b.button&&(D|=128),b.action===32?D|=32:b.action!==0||E||(D|=3)),D}const S=String.fromCharCode,y={DEFAULT:b=>{const E=[w(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${S(E[0])}${S(E[1])}${S(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${E}`}};let x=o.CoreMouseService=class extends _.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const D of Object.keys(C))this.addProtocol(D,C[D]);for(const D of Object.keys(y))this.addEncoding(D,y[D]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,D){if(D){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,D){var N,R=arguments.length,T=R<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,D);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(R<3?N(T):R>3?N(b,E,T):N(b,E))||T);return R>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,D){b(E,D,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),v=c(8460),_=c(844),C=c(2585),w=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends _.Disposable{constructor(x,b,E){super(),this._bufferService=x,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}reset(){this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}triggerDataEvent(x,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((D=>D.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=y=f([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],y)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),v=c(6106);let _=0,C=0;class w extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const b=new S(x);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,b,E){let D=0,N=0;for(const R of this._decorations.getKeyIterator(b))D=R.options.x??0,N=D+(R.options.width??1),x>=D&&x{_=N.options.x??0,C=_+(N.options.width??1),x>=_&&x{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(..._){this._entries=new Map;for(const[C,w]of _)this.set(C,w)}set(_,C){const w=this._entries.get(_);return this._entries.set(_,C),w}forEach(_){for(const[C,w]of this._entries.entries())_(C,w)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(v,_){this._services.set(v,_)}getService(v){return this._services.get(v)}createInstance(v,..._){const C=(0,p.getServiceDependencies)(v).sort(((y,x)=>y.index-x.index)),w=[];for(const y of C){const x=this._services.get(y.id);if(!x)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${y.id}.`);w.push(x)}const S=C.length>0?C[0].index:_.length;if(_.length!==S)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${S+1} conflicts with ${_.length} static arguments`);return new v(..._,...w)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,D=arguments.length,N=D<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var R=S.length-1;R>=0;R--)(E=S[R])&&(N=(D<3?E(N):D>3?E(y,x,N):E(y,x))||N);return D>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),v=c(2585),_={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,w=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let y=0;yJSON.stringify(N))).join(", ")})`);const D=b.apply(this,E);return C.trace(`GlyphRenderer#${b.name} return`,D),D}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...o.DEFAULT_OPTIONS};for(const y in w)if(y in S)try{const x=w[y];S[y]=this._sanitizeAndValidateOption(y,x)}catch(x){console.error(x)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,S){return this.onOptionChange((y=>{y===w&&S(this.rawOptions[w])}))}onMultipleOptionChange(w,S){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&S()}))}_setupOptions(){const w=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},S=(y,x)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);x=this._sanitizeAndValidateOption(y,x),this.rawOptions[y]!==x&&(this.rawOptions[y]=x,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const x={get:w.bind(this,y),set:S.bind(this,y)};Object.defineProperty(this.options,y,x)}}_sanitizeAndValidateOption(w,S){switch(w){case"cursorStyle":if(S||(S=o.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${w}`);break;case"wordSeparator":S||(S=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=v.includes(S)?S:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${w} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${w} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}o.OptionsService=_},2660:function(u,o,c){var f=this&&this.__decorate||function(_,C,w,S){var y,x=arguments.length,b=x<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,C,w,S);else for(var E=_.length-1;E>=0;E--)(y=_[E])&&(b=(x<3?y(b):x>3?y(C,w,b):y(C,w))||b);return x>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(_,C){return function(w,S){C(w,S,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let v=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const E=C.addMarker(C.ybase+C.y),D={data:_,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(D,E))),this._dataByLinkId.set(D.id,D),D.id}const w=_,S=this._getEntryIdKey(w),y=this._entriesWithId.get(S);if(y)return this.addLineToLink(y.id,C.ybase+C.y),y.id;const x=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(b,x))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(_,C){const w=this._dataByLinkId.get(_);if(w&&w.lines.every((S=>S.line!==C))){const S=this._bufferService.buffer.addMarker(C);w.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(w,S)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const w=_.lines.indexOf(C);w!==-1&&(_.lines.splice(w,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=v=f([p(0,d.IBufferService)],v)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(v,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,S,y){S[c]===S?S[f].push({id:w,index:y}):(S[f]=[{id:w,index:y}],S[c]=S)})(d,v,C)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,w=!1){return(16777215&_)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const _=new p.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,w=0;const S=_.length;for(let y=0;y=S)return C+this.wcwidth(x);const D=_.charCodeAt(y);56320<=D&&D<=57343?x=1024*(x-55296)+D-56320+65536:C+=this.wcwidth(D)}const b=this.charProperties(x,w);let E=d.extractWidth(b);d.extractShouldJoin(b)&&(E-=d.extractWidth(w)),C+=E,w=b}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),v=a(7975),_=a(7090),C=["cols","rows"];class w extends f.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],b=(E,D)=>{this._checkReadonlyOptions(E),this._core.options[E]=D};for(const E in this._core.options){const D={get:x.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,D)}}_checkReadonlyOptions(y){if(C.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const x in y)this._publicOptions[x]=y[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,x=!0){this._core.input(y,x)}resize(y,x){this._verifyIntegers(y,x),this._core.resize(y,x)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,x,b){this._verifyIntegers(y,x,b),this._core.select(y,x,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,x){this._verifyIntegers(y,x),this._core.selectLines(y,x)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,x){this._core.write(y,x)}writeln(y,x){this._core.write(y),this._core.write(`\r `,x)}paste(y){this._core.paste(y)}refresh(y,x){this._verifyIntegers(y,x),this._core.refresh(y,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const x of y)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const x of y)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=w})(),l})()))})(bp)),bp.exports}var UB=$B();function Pb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new UB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new PB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const v=await hT(e,o);if(u)return;if(v.dataBase64&&r.write(Pb(v.dataBase64)),o=v.nextOffset,v.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=QT(e,v=>{if(u)return;const _=Pb(v.dataBase64);!c&&v.offset===o?(r.write(_),o+=_.length):v.offset+_.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),g.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const sa="__uncommitted__";function qB({state:e}){return!e||e.loading?g.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?g.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?g.jsx(zB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):g.jsx(LC,{diff:e.payload.diff}):g.jsx("div",{className:"diff-empty",children:"No changes."})}function VB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?g.jsx(WB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):g.jsx(YB,{experiment:e,project:t})}function WB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=G.useState(null),[u,o]=G.useState(!1),c=G.useRef(null),f=n&&t.find(C=>C.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=C=>{const w=t.findIndex(S=>S.id===C);return w===-1?t.length:t.length-w},v=G.useRef(null);G.useEffect(()=>{if(v.current===null){v.current=new Set(t.map(w=>w.id));return}const C=t.find(w=>!v.current.has(w.id));for(const w of t)v.current.add(w.id);C&&r(C.id)},[t,r]),G.useEffect(()=>{if(!u)return;const C=w=>{var S;(S=c.current)!=null&&S.contains(w.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]);async function _(){if(f){l(null);try{await fx(f.id)}catch(C){l(C instanceof Error?C.message:String(C))}}}return g.jsxs("div",{className:"term-view",children:[g.jsxs("div",{className:"term-bar",children:[g.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),g.jsx("span",{style:{flex:1}}),a&&g.jsx("span",{className:"error",children:a}),p&&g.jsxs("button",{className:"btn sm ghost",onClick:()=>void _(),children:[g.jsx(sN,{size:13}),"Stop"]}),t.length>0&&f&&g.jsxs("div",{className:"run-history",ref:c,children:[g.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(C=>!C),children:[g.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),g.jsx(Ko,{status:f.status}),g.jsx(gs,{size:14,className:"run-picker-chev"})]}),u&&g.jsx("div",{className:"history-menu",children:t.map(C=>g.jsxs("button",{className:`history-item ${C.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(C.id),o(!1)},children:[g.jsxs("span",{className:"run-label",children:["Run ",d(C.id)]}),g.jsx(Ko,{status:C.status}),g.jsx("span",{className:"when",children:Na(C.createdAt)})]},C.id))})]})]}),g.jsx("div",{className:"term-fill",children:f?g.jsx(GB,{runId:f.id},f.id):g.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function YB({experiment:e,project:t}){const[n,r]=G.useState(null),[a,l]=G.useState(null),[u,o]=G.useState(null),[c,f]=G.useState(null),[p,d]=G.useState({}),v=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function _(){l(null);try{const[w,S]=await Promise.all([fT(e.id),Ky(e.projectId)]);r(w),o(S),f(y=>{var b;return y!==null?y:S.diff.trim()!==""&&S.experimentId===e.id?sa:((b=w[0])==null?void 0:b.sha)??null})}catch(w){l(w instanceof Error?w.message:String(w))}}G.useEffect(()=>{n===null&&!a&&_()},[n,a,e.id]),G.useEffect(()=>{const w=setInterval(()=>{Ky(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(w)},[e.projectId]),G.useEffect(()=>{var w;c===sa&&u&&!v&&f(((w=n==null?void 0:n[0])==null?void 0:w.sha)??null)},[c,u,v,n]),G.useEffect(()=>{if(!c||c===sa||p[c])return;const w=c;d(S=>({...S,[w]:{loading:!0}})),dT(e.id,w).then(S=>d(y=>({...y,[w]:{loading:!1,payload:S}}))).catch(S=>d(y=>({...y,[w]:{loading:!1,error:S instanceof Error?S.message:String(S)}})))},[c,p,e.id]);const C=!v&&((n==null?void 0:n.length)??0)===0;return g.jsx("div",{className:"drawer",children:g.jsx("div",{className:"drawer-body",children:g.jsxs("div",{className:"drawer-section",children:[g.jsxs("div",{className:"changes-branch",children:[g.jsx("span",{className:"ctl-label",children:"Branch"}),g.jsx(xO,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?g.jsx("div",{className:"error",children:a}):n===null?g.jsx("div",{className:"changes-note",children:"Loading changes…"}):C?g.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"commit-picker",children:[g.jsx("span",{className:"ctl-label",children:"Commit"}),c===sa&&g.jsx("span",{className:"uncommitted-dot"}),g.jsxs("select",{className:"input sm",value:c??"",onChange:w=>f(w.target.value),children:[v&&g.jsx("option",{value:sa,children:"● Uncommitted changes"}),n.map(w=>g.jsxs("option",{value:w.sha,children:[w.sha.slice(0,7)," — ",w.subject]},w.sha))]}),g.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void _(),children:g.jsx(Mg,{size:14})})]}),g.jsx("div",{style:{marginTop:10},children:c===sa&&u?u.truncated?g.jsxs("div",{className:"truncated-notice",children:[g.jsx("h4",{children:"Diff too large to display"}),g.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):g.jsx(LC,{diff:u.diff}):c?g.jsx(qB,{state:p[c]}):g.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function XB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(!0),[d,v]=G.useState(0),_=/\.(md|mdx|markdown)$/i.test(t),[C,w]=G.useState(!1);G.useEffect(()=>{let y=!1;return p(!0),pT(e,t,{sessionId:n,ref:r}).then(x=>{y||(u(x),c(null))}).catch(x=>{y||c(x.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const S=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return g.jsxs("div",{className:"file-view",children:[g.jsxs("div",{className:"file-view-header",children:[g.jsx(ax,{size:13,style:{flexShrink:0}}),g.jsx("code",{className:"file-view-path",title:t,children:t}),r&&g.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),_&&g.jsx("button",{className:`icon-btn ${C?"active":""}`,"data-tip":C?"Rendered view":"View source","aria-label":C?"Rendered view":"View source",onClick:()=>w(y=>!y),children:g.jsx(nx,{size:13})}),g.jsx("button",{className:"icon-btn","data-tip":"Reload file","aria-label":"Reload file",onClick:()=>v(y=>y+1),children:f?g.jsx("span",{className:"spinner"}):g.jsx(Mg,{size:13})})]}),g.jsx("div",{className:"file-view-body",children:o?g.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?g.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?g.jsx("div",{className:"file-view-note",children:S(l)}):g.jsxs(g.Fragment,{children:[!r&&n&&l.root==="clone"&&g.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),_&&!C?g.jsx("div",{className:"file-view-md",children:g.jsx(Xo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):g.jsx(Ww,{text:l.content,path:t}),l.truncated&&g.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function KB({projectName:e,onHome:t,onCollapse:n}){return g.jsxs("div",{className:"rail-brand",children:[g.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[g.jsx(pu,{size:15}),g.jsx("span",{className:"brand-project",children:e})]}),n&&g.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:g.jsx(lx,{size:15})})]})}function ZB({onDone:e}){const[t,n]=G.useState(0),[r,a]=G.useState(null),[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(null),[d,v]=G.useState(!1),_=w=>{v(!0),Promise.allSettled([Og(w).then(a),vx().then(u),gx().then(c),FT().then(p)]).finally(()=>v(!1))};G.useEffect(()=>_(!1),[]);const C=()=>{$T((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return g.jsx("div",{className:"home onboarding",children:g.jsx("div",{className:"home-inner",children:t===0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 1 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Your coding agents"}),g.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),g.jsx("div",{className:"onb-cards",children:r===null?g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(w=>g.jsx(JB,{h:w},w.id))}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>_(!0),disabled:d,children:[g.jsx(Au,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):t===1?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 2 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),g.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),g.jsx("div",{className:"onb-cards",children:g.jsx(eI,{git:l,onUpdate:u})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[g.jsx(pu,{size:12})," Back"]}),g.jsxs("button",{className:"btn ghost",onClick:()=>_(!1),disabled:d,children:[g.jsx(Au,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):t===2?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 3 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),g.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),g.jsx("div",{className:"onb-cards",children:g.jsx(tI,{dataDir:o,onUpdate:c})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[g.jsx(pu,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 4 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Usage analytics"}),g.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),g.jsx("div",{className:"onb-cards",children:g.jsx(nI,{telemetry:f,onUpdate:p})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[g.jsx(pu,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:C,children:["Create your first project ",g.jsx(Pc,{size:13})]})]})]})})})}function QB(e){return e.agentReady?{cls:"st-done",label:"Connected"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}}function JB({h:e}){var r,a;const t=QB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:e.name}),g.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),g.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>Nu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):g.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function eI({git:e,onUpdate:t}){const[n,r]=G.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"status-badge st-failed",children:[g.jsx("span",{className:"dot"})," not found"]})]}),g.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),g.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"GitHub"}),g.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"Token saved in orx":e.githubTokenSource==="gh"?"Signed in via gh CLI":"Not connected"}),g.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&g.jsxs("div",{className:"onb-card-meta",children:["Set ",g.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&g.jsxs("div",{className:"onb-gh-options",children:[g.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),g.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?g.jsxs(g.Fragment,{children:[g.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),g.jsxs("button",{className:"btn ghost",onClick:a,children:[n?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx(Tg,{size:12}),n?"Copied":"Copy"]}),g.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):g.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",g.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),g.jsx("div",{className:"onb-gh-or",children:"or"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),g.jsx(zw,{onSaved:t})]})]})]})}function tI({dataDir:e,onUpdate:t}){const[n,r]=G.useState(""),[a,l]=G.useState(!1),[u,o]=G.useState(!1),[c,f]=G.useState(null);if(G.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:"status-badge st-done",children:[g.jsx(vn,{size:12,strokeWidth:3})," pinned"]})]}),g.jsxs("div",{className:"onb-card-meta",children:["Set by the ",g.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function v(){if(!(u||!d)){o(!0),f(null);try{t(await ET(p)),l(!1)}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?g.jsx("span",{className:"dot"}):g.jsx(vn,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?g.jsxs(g.Fragment,{children:[g.jsx("input",{className:"mono",type:"text",value:n,onChange:_=>r(_.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&g.jsx("div",{className:"error",style:{marginTop:8},children:c}),g.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[g.jsx("button",{className:"btn primary",onClick:v,disabled:u||!d,children:u?"Saving…":"Use this folder"}),g.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):g.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",g.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function nI({telemetry:e,onUpdate:t}){const[n,r]=G.useState(!1);if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),PT(o).then(t).finally(()=>r(!1)))};return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsxs("div",{children:[g.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),g.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),g.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[g.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?g.jsx(vn,{size:12,strokeWidth:3}):null," On"]}),g.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:g.jsx(vn,{size:12,strokeWidth:3})," Off"]})]})]}),g.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",g.jsx("code",{children:"orx telemetry off"}),"."]}),l&&g.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function eu(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function $b(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function iI(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function rI(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function sI({onCreated:e,onCancel:t}){var $;const[n,r]=G.useState("paper"),[a,l]=G.useState("use"),[u,o]=G.useState(""),[c,f]=G.useState(""),[p,d]=G.useState(!1),[v,_]=G.useState("main"),[C,w]=G.useState(!1),[S,y]=G.useState(null),[x,b]=G.useState(""),[E,D]=G.useState([]),[N,R]=G.useState(!1),[T,j]=G.useState(null),[B,z]=G.useState(!1),[V,F]=G.useState(null),P=G.useRef(0),W=eu(u),q=!!(c.trim()&&(n==="new"||n==="existing"&&W!==null||n==="paper"&&T!==null&&(u.trim()===""||W!==null))),X=Q=>{var re;o(Q),p||f(((re=eu(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++P.current;D([]),R(!1),z(!0),F(null);try{const se=await sT(Q);if(re!==P.current)return;j(se);const Z=se.repoUrl?eu(se.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(se.title??"").trim().slice(0,60))}catch(se){if(re!==P.current)return;F(se instanceof Error?se.message:String(se))}finally{re===P.current&&z(!1)}}function L(){P.current++,j(null),b(""),D([]),F(null),o(""),p||f("")}G.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=iI(Q);if(!re&&Q.length<3){D([]),R(!1);return}const se=++P.current;re||R(!0);const Z=setTimeout(()=>{if(re){K(re);return}rT(Q).then(H=>{se===P.current&&D(H)}).catch(H=>{se===P.current&&(D([]),F(H instanceof Error?H.message:String(H)))}).finally(()=>{se===P.current&&R(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!q||C)){w(!0),y(null);try{const re=await iT(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!W?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:W.owner,githubRepo:W.repo,baselineBranch:v.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){y(re instanceof Error?re.message:String(re))}finally{w(!1)}}}const O=n==="new"||n==="paper"&&!W,U=g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),g.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),g.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${W?`${W.owner}/${W.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),g.jsxs("label",{children:["Branch",g.jsx("input",{value:v,onChange:Q=>_(Q.target.value),placeholder:"main"})]})]})]});return g.jsxs("form",{className:"form",onSubmit:M,children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),g.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),g.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["GitHub repository",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${W?"ok":""}`,children:W?`${W.owner} / ${W.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),U]}),n==="paper"&&(T===null?g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["Paper",g.jsx("input",{value:x,onChange:Q=>b(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint ${V?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":V??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&g.jsx("div",{className:"paper-results",children:E.map(Q=>g.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[g.jsx("span",{className:"title",children:rI(Q.title)}),g.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"paper-pick",children:[g.jsxs("div",{className:"meta",children:[g.jsx("div",{className:"title",children:T.title||T.paperId}),g.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),g.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),g.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${W?"ok":""}`,children:W?`${W.owner} / ${W.repo}`+(T.repoUrl&&(($=eu(T.repoUrl))==null?void 0:$.repo)===W.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),W?U:g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${$b(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${$b(c)} · private`:"a blank private repo is created on your GitHub account"})]}),S&&g.jsx("div",{className:"error",children:S}),g.jsxs("div",{className:"actions",children:[t&&g.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),g.jsx("button",{type:"submit",className:"btn primary",disabled:!q||C,children:C?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Ub({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=G.useState(!1),[u,o]=G.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? -Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await oT(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return g.jsxs("div",{className:"home",children:[g.jsxs("div",{className:"home-inner",children:[g.jsx("div",{className:"home-brand",children:g.jsx(fa,{})}),g.jsxs("div",{className:"home-head",children:[g.jsx("h2",{children:"Projects"}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[g.jsx(Rg,{size:13})," New project"]})]}),g.jsx("div",{className:"home-list",children:e.length===0?g.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>g.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[g.jsx("span",{className:"name",children:f.name}),g.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&g.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),g.jsxs("span",{className:"time",children:["created ",Na(f.createdAt)]}),g.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:g.jsx(jg,{size:14})})]},f.id))})]}),a&&g.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:g.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[g.jsx("h2",{children:"New project"}),g.jsx(sI,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function aI(e){const t=_x(e.backend);return t?[t,yx(e.backend)].filter(Boolean).join(" · "):"—"}function oI({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?g.jsx("div",{className:"empty-state",children:g.jsx("p",{children:"No runs yet."})}):g.jsx("div",{className:"runs-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Run"}),g.jsx("th",{children:"Experiment"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Commit"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Exit"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return g.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[g.jsx("td",{className:"mono",children:Op(o.id)}),g.jsx("td",{className:"mono",children:l.get(o.experimentId)??Op(o.experimentId)}),g.jsx("td",{children:g.jsx(Ko,{status:o.status})}),g.jsx("td",{className:"mono",children:aI(o)}),g.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),g.jsx("td",{children:Na(o.createdAt)}),g.jsx("td",{className:"mono",children:o.exitCode??"—"}),g.jsx("td",{children:g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[g.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:g.jsx(Ku,{size:14})}),c&&g.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}var lI=ex();function cI(e){const[t,n]=G.useState(null),[,r]=G.useState({});return t==null||t.setTracked(e),G.useEffect(()=>{const a=new uI(()=>r({}));return a.setTracked(e),n(a),()=>a.dispose()},[]),(t==null?void 0:t.bounds)??null}var ti,ug,hg,fg;class uI{constructor(t){zy(this,ti);Qr(this,"selectors",new Set);Qr(this,"elements",new Set);Qr(this,"onSizeChange",()=>Jr(this,ti,ug).call(this));Qr(this,"resizeObs",new ResizeObserver(this.onSizeChange));Qr(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Qr(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(u=>!this.selectors.has(u)),a=[...this.selectors].filter(u=>!n.has(u));let l=!1;if(r.length>0){const u=r.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.add(c),this.resizeObs.observe(c)}),l||(l=o.length>0)}if(a.length>0){const u=a.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.delete(c),this.resizeObs.unobserve(c)}),l||(l=o.length>0)}l&&Jr(this,ti,hg).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,a=>`[data-onboarding="${a}"]`).join(",");let r=!1;for(const a of t){for(const l of a.addedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.add(l),this.resizeObs.observe(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.add(u),this.resizeObs.observe(u),r=!0}));for(const l of a.removedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.delete(l),this.resizeObs.unobserve(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u),r=!0}))}r&&Jr(this,ti,ug).call(this)}}ti=new WeakSet,ug=function(){const t=Jr(this,ti,fg).call(this);Jr(this,ti,hg).call(this),t!==Jr(this,ti,fg).call(this)&&this.onBoundsChange()},hg=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,u=>u.getBoundingClientRect()).filter(u=>u.width>0&&u.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(u=>u.left)),r=Math.min(...t.map(u=>u.top)),a=Math.max(...t.map(u=>u.right)),l=Math.max(...t.map(u=>u.bottom));this.bounds={x:n,y:r,width:a-n,height:l-r}},fg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function hI(){const[e,t]=G.useState(0),[n,r]=G.useState(0);return{ref:G.useCallback(l=>{if(!l)return;function u(){t(l.offsetWidth),r(l.offsetHeight)}const o=new ResizeObserver(u),c=new MutationObserver(u);return o.observe(l),c.observe(l,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),u(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const tu=8;function fI(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:a,viewWidth:l},u]=G.useState({viewWidth:0,viewHeight:0});G.useEffect(()=>{function p(){u({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",p),p(),()=>window.removeEventListener("resize",p)},[]);let o=0,c=0,f=0;if(e){const{distance:p}=e;switch(e.anchor){case"left":o=e.x-n-p,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+p,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-n/2,c=e.y+e.height+p;break;case"above":o=e.x+e.width/2-n/2,c=e.y-r-p;break}const d=o,v=c;o=Math.min(Math.max(o,tu),l-n-tu),c=Math.min(Math.max(c,tu),a-r-tu),f=e.anchor==="left"||e.anchor==="right"?v-c:d-o}return{x:o,y:c,arrowAdjustment:f}}const Gb="orx:tour-done",Nr=8,dI=20,Ou=[{focus:null,anchor:null,title:"Welcome to OpenResearch",description:"This is your research workspace: agents on the left, conversation in the middle, experiments on the right. Here's a quick look around — about thirty seconds."},{focus:["composer"],anchor:"above",title:"Talk to your research agent",description:"This is how you communicate with research agents: describe the experiment you want, and the agent plans it, writes the code, and runs it. Type / for skills like /reproduce-paper."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected — Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here; each session keeps its harness for life."},{focus:["nav-files"],anchor:"right",title:"Reports and outputs",description:"The agent writes its reports, figures, and other outputs here — and anything you drop in is visible to it too. Check Files after a run to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Configure compute",description:"This is where compute is configured. Point runs at this machine, Modal, SSH boxes, Kubernetes, or Slurm — set it up once and agents pick the right hardware per run."},{focus:["experiments"],anchor:"left",title:"Follow every experiment",description:"Runs land here as a tree of experiments — branch variants off a baseline, compare results, and open any run's terminal or code changes in a tab."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is its own agent working in its own branch, so you can run several lines of inquiry in parallel. That's the tour — ask for your first experiment whenever you're ready."}];function pI({onClose:e}){const[t,n]=G.useState(0),r=Ou[t],a=cI(r.focus??[]);G.useEffect(()=>{function u(o){o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),e())}return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e]);const l=a?{left:a.x-Nr,top:a.y-Nr,width:a.width+Nr*2,height:a.height+Nr*2}:null;return lI.createPortal(g.jsxs("div",{className:"tour-overlay",children:[l?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"tour-spotlight",style:l}),g.jsx("div",{className:"tour-ring",style:l})]}):g.jsx("div",{className:"tour-dim"}),g.jsx(gI,{step:r,bounds:a,index:t,onBack:()=>n(u=>Math.max(0,u-1)),onNext:()=>t+1>=Ou.length?e():n(t+1),onClose:e})]}),document.body)}function gI({step:e,bounds:t,index:n,onBack:r,onNext:a,onClose:l}){const u=hI(),o=fI(t&&e.anchor?{x:t.x-Nr,y:t.y-Nr,width:t.width+Nr*2,height:t.height+Nr*2,anchor:e.anchor,distance:dI}:null,u),c=e.anchor!=null&&t!=null&&o.x>0,f=n+1===Ou.length;return g.jsxs("div",{ref:u.ref,className:`tour-card ${c?"":"centered"}`,style:c?{left:o.x,top:o.y}:void 0,children:[c&&e.anchor&&g.jsx(mI,{anchor:e.anchor,adjustment:o.arrowAdjustment}),g.jsx("button",{className:"icon-btn tour-close",title:"Skip tour",onClick:l,children:g.jsx(_a,{size:15})}),g.jsx("h3",{children:e.title}),g.jsx("p",{children:e.description}),g.jsxs("div",{className:"tour-footer",children:[g.jsx("div",{className:"tour-footer-side",children:n>0&&g.jsx("button",{className:"btn ghost sm",onClick:r,children:"Back"})}),g.jsxs("span",{className:"tour-count",children:[n+1," / ",Ou.length]}),g.jsx("div",{className:"tour-footer-side end",children:g.jsx("button",{className:"btn primary sm",onClick:a,children:f?"Done":"Next"})})]})]})}function mI({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return g.jsx("div",{className:`tour-arrow ${e}`,style:{translate:n}})}function $t(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function wh(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bu.prototype=wh.prototype={constructor:bu,on:function(e,t){var n=this._,r=_I(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l0)for(var n=new Array(a),r=0,a,l;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vb.hasOwnProperty(t)?{space:Vb[t],local:e}:e}function bI(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===dg&&t.documentElement.namespaceURI===dg?t.createElement(e):t.createElementNS(n,e)}}function SI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BC(e){var t=Ch(e);return(t.local?SI:bI)(t)}function xI(){}function Im(e){return e==null?xI:function(){return this.querySelector(e)}}function wI(e){typeof e!="function"&&(e=Im(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a=b&&(b=x+1);!(D=S[b])&&++b=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function YI(e){e||(e=XI);function t(d,v){return d&&v?e(d.__data__,v.__data__):!d-!v}for(var n=this._groups,r=n.length,a=new Array(r),l=0;lt?1:e>=t?0:NaN}function KI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZI(){return Array.from(this)}function QI(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?c7:typeof t=="function"?h7:u7)(e,t,n??"")):Sa(this.node(),e)}function Sa(e,t){return e.style.getPropertyValue(t)||PC(e).getComputedStyle(e,null).getPropertyValue(t)}function d7(e){return function(){delete this[e]}}function p7(e,t){return function(){this[e]=t}}function g7(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function m7(e,t){return arguments.length>1?this.each((t==null?d7:typeof t=="function"?g7:p7)(e,t)):this.node()[e]}function $C(e){return e.trim().split(/^|\s+/)}function zm(e){return e.classList||new UC(e)}function UC(e){this._node=e,this._names=$C(e.getAttribute("class")||"")}UC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function GC(e,t){for(var n=zm(e),r=-1,a=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function G7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n()=>e;function pg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}pg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function e9(e){return!e.ctrlKey&&!e.button}function t9(){return this.parentNode}function n9(e,t){return t??{x:e.x,y:e.y}}function i9(){return navigator.maxTouchPoints||"ontouchstart"in this}function KC(){var e=e9,t=t9,n=n9,r=i9,a={},l=wh("start","drag","end"),u=0,o,c,f,p,d=0;function v(E){E.on("mousedown.drag",_).filter(r).on("touchstart.drag",S).on("touchmove.drag",y,J7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(E,D){if(!(p||!e.call(this,E,D))){var N=b(this,t.call(this,E,D),E,D,"mouse");N&&(An(E.view).on("mousemove.drag",C,tl).on("mouseup.drag",w,tl),YC(E.view),Sp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function C(E){if(ma(E),!f){var D=E.clientX-o,N=E.clientY-c;f=D*D+N*N>d}a.mouse("drag",E)}function w(E){An(E.view).on("mousemove.drag mouseup.drag",null),XC(E.view,f),ma(E),a.mouse("end",E)}function S(E,D){if(e.call(this,E,D)){var N=E.changedTouches,R=t.call(this,E,D),T=N.length,j,B;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=s9.exec(e))?new mn(t[1],t[2],t[3],1):(t=a9.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=o9.exec(e))?iu(t[1],t[2],t[3],t[4]):(t=l9.exec(e))?iu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=c9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,1):(t=u9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,t[4]):Wb.hasOwnProperty(e)?Kb(Wb[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Kb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function iu(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function d9(e){return e instanceof _l||(e=us(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function gg(e,t,n,r){return arguments.length===1?d9(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hm(mn,gg,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(as(this.r),as(this.g),as(this.b),zu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zb,formatHex:Zb,formatHex8:p9,formatRgb:Qb,toString:Qb}));function Zb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function p9(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qb(){const e=zu(this.opacity);return`${e===1?"rgb(":"rgba("}${as(this.r)}, ${as(this.g)}, ${as(this.b)}${e===1?")":`, ${e})`}`}function zu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function as(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=as(e),(e<16?"0":"")+e.toString(16)}function Jb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function QC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=us(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function g9(e,t,n,r){return arguments.length===1?QC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hm(Kn,g9,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(xp(e>=240?e-240:e+120,a,r),xp(e,a,r),xp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(eS(this.h),ru(this.s),ru(this.l),zu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zu(this.opacity);return`${e===1?"hsl(":"hsla("}${eS(this.h)}, ${ru(this.s)*100}%, ${ru(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eS(e){return e=(e||0)%360,e<0?e+360:e}function ru(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Fm=e=>()=>e;function m9(e,t){return function(n){return e+n*t}}function v9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function _9(e){return(e=+e)==1?JC:function(t,n){return n-t?v9(t,n,e):Fm(isNaN(t)?n:t)}}function JC(e,t){var n=t-e;return n?m9(e,n):Fm(isNaN(e)?t:e)}const Hu=(function e(t){var n=_9(t);function r(a,l){var u=n((a=gg(a)).r,(l=gg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=JC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function y9(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;an&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ui(r,a)})),n=wp.lastIndex;return n180?p+=360:p-f>180&&(f+=360),v.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ui(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,v){f!==p?v.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ui(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,v,_,C){if(f!==d||p!==v){var w=_.push(a(_)+"scale(",null,",",null,")");C.push({i:w-4,x:ui(f,d)},{i:w-2,x:ui(p,v)})}else(d!==1||v!==1)&&_.push(a(_)+"scale("+d+","+v+")")}return function(f,p){var d=[],v=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,v),u(f.rotate,p.rotate,d,v),o(f.skewX,p.skewX,d,v),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,v),f=p=null,function(_){for(var C=-1,w=v.length,S;++C=0&&e._call.call(void 0,t),e=e._next;--xa}function iS(){hs=(Pu=rl.now())+Eh,xa=Io=0;try{L9()}finally{xa=0,B9(),hs=0}}function O9(){var e=rl.now(),t=e-Pu;t>i2&&(Eh-=t,Pu=e)}function B9(){for(var e,t=Fu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Fu=n);zo=e,_g(r)}function _g(e){if(!xa){Io&&(Io=clearTimeout(Io));var t=e-hs;t>24?(e<1/0&&(Io=setTimeout(iS,e-rl.now()-Eh)),Oo&&(Oo=clearInterval(Oo))):(Oo||(Pu=rl.now(),Oo=setInterval(O9,i2)),xa=1,r2(iS))}}function rS(e,t,n){var r=new $u;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var I9=wh("start","end","cancel","interrupt"),z9=[],a2=0,sS=1,yg=2,xu=3,aS=4,bg=5,wu=6;function kh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;H9(e,n,{name:t,index:r,group:a,on:I9,tween:z9,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:a2})}function $m(e,t){var n=ni(e,t);if(n.state>a2)throw new Error("too late; already scheduled");return n}function gi(e,t){var n=ni(e,t);if(n.state>xu)throw new Error("too late; already running");return n}function ni(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function H9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=s2(l,0,n.time);function l(f){n.state=sS,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,v,_;if(n.state!==sS)return c();for(p in r)if(_=r[p],_.name===n.name){if(_.state===xu)return rS(u);_.state===aS?(_.state=wu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[p]):+pyg&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function gz(e,t,n){var r,a,l=pz(t)?$m:gi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function mz(e,t){var n=this._id;return arguments.length<2?ni(this.node(),n).on.on(e):this.each(gz(n,e,t))}function vz(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _z(){return this.on("end.remove",vz(this._id))}function yz(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Im(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u()=>e;function Gz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function $i(e,t,n){this.k=e,this.x=t,this.y=n}$i.prototype={constructor:$i,scale:function(e){return e===1?this:new $i(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $i(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ah=new $i(1,0,0);u2.prototype=$i.prototype;function u2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ah;return e.__zoom}function Cp(e){e.stopImmediatePropagation()}function Bo(e){e.preventDefault(),e.stopImmediatePropagation()}function qz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function oS(){return this.__zoom||Ah}function Wz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function h2(){var e=qz,t=Vz,n=Xz,r=Wz,a=Yz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Su,f=wh("start","zoom","end"),p,d,v,_=500,C=150,w=0,S=10;function y(P){P.property("__zoom",oS).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,W,q,X){var K=P.selection?P.selection():P;K.property("__zoom",oS),P!==K?D(P,W,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},y.scaleBy=function(P,W,q,X){y.scaleTo(P,function(){var K=this.__zoom.k,L=typeof W=="function"?W.apply(this,arguments):W;return K*L},q,X)},y.scaleTo=function(P,W,q,X){y.transform(P,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),U=typeof W=="function"?W.apply(this,arguments):W;return n(b(x(L,U),M,O),K,u)},q,X)},y.translateBy=function(P,W,q,X){y.transform(P,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},y.translateTo=function(P,W,q,X,K){y.transform(P,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(Ah.translate(O[0],O[1]).scale(M.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(P,W){return W=Math.max(l[0],Math.min(l[1],W)),W===P.k?P:new $i(W,P.x,P.y)}function b(P,W,q){var X=W[0]-q[0]*P.k,K=W[1]-q[1]*P.k;return X===P.x&&K===P.y?P:new $i(P.k,X,K)}function E(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function D(P,W,q,X){P.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),U=q==null?E(O):typeof q=="function"?q.apply(K,L):q,$=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof W=="function"?W.apply(K,L):W,se=c(Q.invert(U).concat($/Q.k),re.invert(U).concat($/re.k));return function(Z){if(Z===1)Z=re;else{var H=se(Z),ee=$/H[2];Z=new $i(ee,U[0]-H[0]*ee,U[1]-H[1]*ee)}M.zoom(null,Z)}})}function N(P,W,q){return!q&&P.__zooming||new R(P,W)}function R(P,W){this.that=P,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,W),this.taps=0}R.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,W){return this.mouse&&P!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var W=An(this.that).datum();f.call(P,this.that,new Gz(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:f}),W)}};function T(P,...W){if(!e.apply(this,arguments))return;var q=N(this,W).event(P),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(P);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],Cu(this),q.start()}Bo(P),q.wheel=setTimeout(M,C),q.zoom("mouse",n(b(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(P,...W){if(v||!e.apply(this,arguments))return;var q=P.currentTarget,X=N(this,W,!0).event(P),K=An(P.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),L=Xn(P,q),M=P.clientX,O=P.clientY;YC(P.view),Cp(P),X.mouse=[L,this.__zoom.invert(L)],Cu(this),X.start();function U(Q){if(Bo(Q),!X.moved){var re=Q.clientX-M,se=Q.clientY-O;X.moved=re*re+se*se>w}X.event(Q).zoom("mouse",n(b(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function $(Q){K.on("mousemove.zoom mouseup.zoom",null),XC(Q.view,X.moved),Bo(Q),X.event(Q).end()}}function B(P,...W){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(P.changedTouches?P.changedTouches[0]:P,this),K=q.invert(X),L=q.k*(P.shiftKey?.5:2),M=n(b(x(q,L),X,K),t.apply(this,W),u);Bo(P),o>0?An(this).transition().duration(o).call(D,M,X,P):An(this).call(y.transform,M,X,P)}}function z(P,...W){if(e.apply(this,arguments)){var q=P.touches,X=q.length,K=N(this,W,P.changedTouches.length===X).event(P),L,M,O,U;for(Cp(P),M=0;M`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},sl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],f2=["Enter"," ","Escape"],d2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var wa;(function(e){e.Strict="strict",e.Loose="loose"})(wa||(wa={}));var os;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(os||(os={}));var al;(function(e){e.Partial="partial",e.Full="full"})(al||(al={}));const p2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ar;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ar||(Ar={}));var Uu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Uu||(Uu={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));const lS={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top};function g2(e){return e===null?null:e?"valid":"invalid"}const m2=e=>"id"in e&&"source"in e&&"target"in e,Kz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yl=(e,t=[0,0])=>{const{width:n,height:r}=Yi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},Zz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Gm(a)?a:t.nodeLookup.get(a.id));const o=u?Gu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Th(n)},bl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Nh(n,Gu(a)),r=!0)}),r?Th(n):{x:0,y:0,width:0,height:0}},qm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const v of e.values()){const{measured:_,selectable:C=!0,hidden:w=!1}=v;if(u&&!C||w)continue;const S=_.width??v.width??v.initialWidth??0,y=_.height??v.height??v.initialHeight??0,{x,y:b}=v.internals.positionAbsolute,E=b2(o,c,f,p,x,b,S,y),D=S*y,N=l&&E>0;(!v.internals.handleBounds||N||E>=D||v.dragging)&&d.push(v)}return d},Qz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function eH({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=Jz(e,u),c=bl(o),f=Wm(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function v2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const _=o.measured.width,C=o.measured.height;_&&C&&(d=[[c,f],[c+_,f+C]])}else o&&ds(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const v=ds(d)?fs(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:v.x-c+(u.measured.width??0)*p[0],y:v.y-f+(u.measured.height??0)*p[1]},positionAbsolute:v}}async function tH({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const _=l.has(v.id),C=!_&&v.parentId&&u.find(w=>w.id===v.parentId);(_||C)&&u.push(v)}const o=new Set(t.map(v=>v.id)),c=r.filter(v=>v.deletable!==!1),p=Qz(u,c);for(const v of c)o.has(v.id)&&!p.find(C=>C.id===v.id)&&p.push(v);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const Ca=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fs=(e={x:0,y:0},t,n)=>({x:Ca(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ca(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function _2(e,t,n){const{width:r,height:a}=Yi(n),{x:l,y:u}=n.internals.positionAbsolute;return fs(e,[[l,u],[l+r,u+a]],t)}const cS=(e,t,n)=>en?-Ca(Math.abs(e-n),1,t)/t:0,Vm=(e,t,n=15,r=40)=>{const a=cS(e.x,r,t.width-r)*n,l=cS(e.y,r,t.height-r)*n;return[a,l]},Nh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Sg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Th=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ol=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Gu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},y2=(e,t)=>Th(Nh(Sg(e),Sg(t))),b2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},qu=(e,t)=>b2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),uS=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),S2=(e,t)=>(n,r)=>{},Sl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?Sl(o,u):o},Ea=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function aa(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nH(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=aa(e,n),a=aa(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=aa(e.top??e.y??0,n),a=aa(e.bottom??e.y??0,n),l=aa(e.left??e.x??0,t),u=aa(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iH(e,t,n,r,a,l){const{x:u,y:o}=Ea(e,[t,n,r]),{x:c,y:f}=Ea({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Wm=(e,t,n,r,a,l)=>{const u=nH(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=Ca(f,r,a),d=e.x+e.width/2,v=e.y+e.height/2,_=t/2-d*p,C=n/2-v*p,w=iH(e,_,C,p,t,n),S={left:Math.min(w.left-u.left,0),top:Math.min(w.top-u.top,0),right:Math.min(w.right-u.right,0),bottom:Math.min(w.bottom-u.bottom,0)};return{x:_-S.left+S.right,y:C-S.top+S.bottom,zoom:p}},ll=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ds(e){return e!=null&&e!=="parent"}function Yi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function x2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function w2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function hS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rH(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function sH(e){return{...d2,...e||{}}}function Go(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=xl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?Sl(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Ym=e=>({width:e.offsetWidth,height:e.offsetHeight}),C2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aH=["INPUT","SELECT","TEXTAREA"];function E2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aH.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const k2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=k2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},fS=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Ym(u)}})};function A2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function ou(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function dS({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case je.Left:return[t-ou(t-r,l),n];case je.Right:return[t+ou(r-t,l),n];case je.Top:return[t,n-ou(n-a,l)];case je.Bottom:return[t,n+ou(a-n,l)]}}function N2({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top,curvature:u=.25}){const[o,c]=dS({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=dS({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,v,_,C]=A2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,v,_,C]}function T2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n0}const cH=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,uH=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hH=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||cH;let a;return m2(e)?a={...e}:a={...e,id:r(e)},uH(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function D2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=T2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const pS={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},fH=({source:e,sourcePosition:t=je.Bottom,target:n})=>t===je.Left||t===je.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dH({source:e,sourcePosition:t=je.Bottom,target:n,targetPosition:r=je.Top,center:a,offset:l,stepPosition:u}){const o=pS[t],c=pS[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=fH({source:f,sourcePosition:t,target:p}),v=d.x!==0?"x":"y",_=d[v];let C=[],w,S;const y={x:0,y:0},x={x:0,y:0},[,,b,E]=T2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[v]*c[v]===-1){v==="x"?(w=a.x??f.x+(p.x-f.x)*u,S=a.y??(f.y+p.y)/2):(w=a.x??(f.x+p.x)/2,S=a.y??f.y+(p.y-f.y)*u);const T=[{x:w,y:f.y},{x:w,y:p.y}],j=[{x:f.x,y:S},{x:p.x,y:S}];o[v]===_?C=v==="x"?T:j:C=v==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(v==="x"?C=o.x===_?j:T:C=o.y===_?T:j,t===r){const P=Math.abs(e[v]-n[v]);if(P<=l){const W=Math.min(l-1,l-P);o[v]===_?y[v]=(f[v]>e[v]?-1:1)*W:x[v]=(p[v]>n[v]?-1:1)*W}}if(t!==r){const P=v==="x"?"y":"x",W=o[v]===c[P],q=f[P]>p[P],X=f[P]=F?(w=(B.x+z.x)/2,S=C[0].y):(w=C[0].x,S=(B.y+z.y)/2)}const D={x:f.x+y.x,y:f.y+y.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...D.x!==C[0].x||D.y!==C[0].y?[D]:[],...C,...N.x!==C[C.length-1].x||N.y!==C[C.length-1].y?[N]:[],n],w,S,b,E]}function pH(e,t,n,r){const a=Math.min(gS(e,t)/2,gS(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.xn.id===t):e[0])||null}function wg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mH(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=wg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const R2=1e3,vH=10,Xm={nodeOrigin:[0,0],nodeExtent:sl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_H={...Xm,checkEquality:!0};function Km(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function yH(e,t,n){const r=Km(Xm,n);for(const a of e.values())if(a.parentId)Qm(a,e,t,r);else{const l=yl(a,r.nodeOrigin),u=ds(a.extent)?a.extent:r.nodeExtent,o=fs(l,u,Yi(a));a.internals.positionAbsolute=o}}function bH(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Zm(e){return e==="manual"}function Cg(e,t,n,r={}){var p,d;const a=Km(_H,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Zm(a.zIndexMode)?R2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const v of e){let _=u.get(v.id);if(a.checkEquality&&v===(_==null?void 0:_.internals.userNode))t.set(v.id,_);else{const C=yl(v,a.nodeOrigin),w=ds(v.extent)?v.extent:a.nodeExtent,S=fs(C,w,Yi(v));_={...a.defaults,...v,measured:{width:(p=v.measured)==null?void 0:p.width,height:(d=v.measured)==null?void 0:d.height},internals:{positionAbsolute:S,handleBounds:bH(v,_),z:M2(v,o,a.zIndexMode),userNode:v}},t.set(v.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(c=!1),v.parentId&&Qm(_,t,n,r,l),f||(f=v.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function SH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=Km(Xm,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}SH(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*vH),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Zm(c)?R2:0,{x:v,y:_,z:C}=xH(e,p,u,o,d,c),{positionAbsolute:w}=e.internals,S=v!==w.x||_!==w.y;(S||C!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y:_}:w,z:C}})}function M2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Zm(n)?r:r+(e.selected?t:0)}function xH(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Yi(e),f=yl(e,n),p=ds(e.extent)?fs(f,e.extent,c):f;let d=fs({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=_2(d,c,t));const v=M2(e,a,l),_=t.internals.z??0;return{x:d.x,y:d.y,z:_>=v?_+1:v}}function Jm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??ol(c),p=y2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var b;const p=c.internals.positionAbsolute,d=Yi(c),v=c.origin??r,_=o.x0||C>0||y||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-_+y,y:c.position.y-C+x}}),(b=n.get(f))==null||b.forEach(E=>{e.some(D=>D.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+_,y:E.position.y+C}})})),(d.width0){const _=Jm(v,t,n,a);f.push(..._)}return{changes:f,updatedInternals:c}}async function CH({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function yS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function j2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;yS("source",c,p,e,a,u),yS("target",c,f,e,l,o),t.set(r.id,r)}}function L2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L2(n,t):!1}function bS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function EH(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!L2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function Ep({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function kH({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=Sl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function AH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,v=null,_=!1,C=!1,w=null;function S({noDragClassName:x,handleSelector:b,domNode:E,isSelectable:D,nodeId:N,nodeClickDistance:R=0}){v=An(E);function T({x:V,y:F}){const{nodeLookup:P,nodeExtent:W,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:U}=t();l={x:V,y:F};let $=!1;const Q=o.size>1,re=Q&&W?Sg(bl(o)):null,se=Q&&X?kH({dragItems:o,snapGrid:q,x:V,y:F}):null;for(const[Z,H]of o){if(!P.has(Z))continue;let ee={x:V-H.distance.x,y:F-H.distance.y};X&&(ee=se?{x:Math.round(ee.x+se.x),y:Math.round(ee.y+se.y)}:Sl(ee,q));let ne=null;if(Q&&W&&!H.extent&&re){const{positionAbsolute:ye}=H.internals,Ce=ye.x-re.x+W[0][0],Ee=ye.x+H.measured.width-re.x2+W[1][0],Ne=ye.y-re.y+W[0][1],we=ye.y+H.measured.height-re.y2+W[1][1];ne=[[Ce,Ne],[Ee,we]]}const{position:pe,positionAbsolute:fe}=v2({nodeId:Z,nextPosition:ee,nodeLookup:P,nodeExtent:ne||W,nodeOrigin:K,onError:O});$=$||H.position.x!==pe.x||H.position.y!==pe.y,H.position=pe,H.internals.positionAbsolute=fe}if(C=C||$,!!$&&(U(o,!0),w&&(r||L||!N&&M))){const[Z,H]=Ep({nodeId:N,dragItems:o,nodeLookup:P});r==null||r(w,o,Z,H),L==null||L(w,Z,H),N||M==null||M(w,H)}}async function j(){if(!p)return;const{transform:V,panBy:F,autoPanSpeed:P,autoPanOnNodeDrag:W}=t();if(!W){c=!1,cancelAnimationFrame(u);return}const[q,X]=Vm(f,p,P);(q!==0||X!==0)&&(l.x=(l.x??0)-q/V[2],l.y=(l.y??0)-X/V[2],await F({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(V){var Q;const{nodeLookup:F,multiSelectionActive:P,nodesDraggable:W,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:U}=t();d=!0,(!L||!D)&&!P&&N&&((Q=F.get(N))!=null&&Q.selected||U()),D&&L&&N&&(e==null||e(N));const $=Go(V.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=$,o=EH(F,W,$,N),o.size>0&&(n||M||!N&&O)){const[re,se]=Ep({nodeId:N,dragItems:o,nodeLookup:F});n==null||n(V.sourceEvent,o,re,se),M==null||M(V.sourceEvent,re,se),N||O==null||O(V.sourceEvent,se)}}const z=KC().clickDistance(R).on("start",V=>{const{domNode:F,nodeDragThreshold:P,transform:W,snapGrid:q,snapToGrid:X}=t();p=(F==null?void 0:F.getBoundingClientRect())||null,_=!1,C=!1,w=V.sourceEvent,P===0&&B(V),l=Go(V.sourceEvent,{transform:W,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(V.sourceEvent,p)}).on("drag",V=>{const{autoPanOnNodeDrag:F,transform:P,snapGrid:W,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Go(V.sourceEvent,{transform:P,snapGrid:W,snapToGrid:q,containerBounds:p});if(w=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||N&&!K.has(N))&&(_=!0),!_){if(!c&&F&&d&&(c=!0,j()),!d){const M=Qn(V.sourceEvent,p),O=M.x-f.x,U=M.y-f.y;Math.sqrt(O*O+U*U)>X&&B(V)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(V.sourceEvent,p),T(L))}}).on("end",V=>{if(!d||_){_&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:F,updateNodePositions:P,onNodeDragStop:W,onSelectionDragStop:q}=t();if(C&&(P(o,!1),C=!1),a||W||!N&&q){const[X,K]=Ep({nodeId:N,dragItems:o,nodeLookup:F,dragging:!1});a==null||a(V.sourceEvent,o,X,K),W==null||W(V.sourceEvent,X,K),N||q==null||q(V.sourceEvent,K)}}}).filter(V=>{const F=V.target;return!V.button&&(!x||!bS(F,`.${x}`,E))&&(!b||bS(F,b,E))});v.call(z)}function y(){v==null||v.on(".drag",null)}return{update:S,destroy:y}}function NH(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())qu(a,ol(l))>0&&r.push(l);return r}const TH=250;function DH(e,t,n,r){var o,c;let a=[],l=1/0;const u=NH(e,n,t+TH);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:v,y:_}=ps(f,d,d.position,!0),C=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(_-e.y,2));C>t||(C1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function O2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(v=>v.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ps(u,c,c.position,!0)}:c}function B2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function RH(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const I2=()=>!0;function MH(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:v,cancelConnection:_,onConnectStart:C,onConnect:w,onConnectEnd:S,isValidConnection:y=I2,onReconnectEnd:x,updateConnection:b,getTransform:E,getFromHandle:D,autoPanSpeed:N,dragThreshold:R=1,handleDomNode:T}){const j=C2(e.target);let B=0,z;const{x:V,y:F}=Qn(e),P=B2(l,T),W=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!W||!P)return;const X=O2(a,P,r,c,t);if(!X)return;let K=Qn(e,W),L=!1,M=null,O=!1,U=null;function $(){if(!p||!W)return;const[pe,fe]=Vm(K,W,N);v({x:pe,y:fe}),B=requestAnimationFrame($)}const Q={...X,nodeId:a,type:P,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ps(re,Q,je.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:lS[Q.position],toNode:null,pointer:K};function H(){q=!0,b(Z),C==null||C(e,{nodeId:a,handleId:r,handleType:P})}R===0&&H();function ee(pe){if(!q){const{x:we,y:ft}=Qn(pe),Ct=we-V,st=ft-F;if(!(Ct*Ct+st*st>R*R))return;H()}if(!D()||!Q){ne(pe);return}const fe=E();K=Qn(pe,W),z=DH(xl(K,fe,!1,[1,1]),n,c,Q),L||($(),L=!0);const ye=z2(pe,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:y,doc:j,lib:f,flowId:d,nodeLookup:c});U=ye.handleDomNode,M=ye.connection,O=RH(!!z,ye.isValid);const Ce=c.get(a),Ee=Ce?ps(Ce,Q,je.Left,!0):Z.from,Ne={...Z,from:Ee,isValid:O,to:ye.toHandle&&O?Ea({x:ye.toHandle.x,y:ye.toHandle.y},fe):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:lS[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};b(Ne),Z=Ne}function ne(pe){if(!("touches"in pe&&pe.touches.length>0)){if(q){(z||U)&&M&&O&&(w==null||w(M));const{inProgress:fe,...ye}=Z,Ce={...ye,toPosition:Z.toHandle?Z.toPosition:null};S==null||S(pe,Ce),l&&(x==null||x(pe,Ce))}_(),cancelAnimationFrame(B),L=!1,O=!1,M=null,U=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function z2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=I2,nodeLookup:p}){const d=l==="target",v=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:_,y:C}=Qn(e),w=u.elementFromPoint(_,C),S=w!=null&&w.classList.contains(`${o}-flow__handle`)?w:v,y={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=B2(void 0,S),b=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!b||!x)return y;const R={source:d?b:r,sourceHandle:d?E:a,target:d?r:b,targetHandle:d?a:E};y.connection=R;const j=D&&N&&(n===wa.Strict?d&&x==="source"||!d&&x==="target":b!==r||E!==a);y.isValid=j&&f(R),y.toHandle=O2(b,x,E,p,n,!0)}return y}const Eg={onPointerDown:MH,isValid:z2};function jH({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:v=!0,inversePan:_=!1}){const C=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const E=n(),D=b.sourceEvent.ctrlKey&&ll()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*p,R=E[2]*Math.pow(2,N*D);t.scaleTo(R)};let w=[0,0];const S=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(w=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},y=b=>{const E=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const D=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],N=[D[0]-w[0],D[1]-w[1]];w=D;const R=r()*Math.max(E[2],Math.log(E[2]))*(_?-1:1),T={x:E[0]-N[0]*R,y:E[1]-N[1]*R},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=h2().on("start",S).on("zoom",d?y:null).on("zoom.wheel",v?C:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const Dh=e=>({x:e.x,y:e.y,zoom:e.k}),kp=({x:e,y:t,zoom:n})=>Ah.translate(e,t).scale(n),pa=(e,t)=>e.target.closest(`.${t}`),H2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),LH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ap=(e,t=0,n=LH,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},F2=e=>{const t=e.ctrlKey&&ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function OH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(pa(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const S=Xn(p),y=F2(p),x=d*Math.pow(2,y);r.scaleTo(n,x,S,p);return}const v=p.deltaMode===1?20:1;let _=a===os.Vertical?0:p.deltaX*v,C=a===os.Horizontal?0:p.deltaY*v;!ll()&&p.shiftKey&&a!==os.Vertical&&(_=p.deltaY*v,C=0),r.translateBy(n,-(_/d)*l,-(C/d)*l,{internal:!0});const w=Dh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,w))}}function BH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=pa(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function IH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=Dh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function zH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&H2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,Dh(l.transform)))}}function HH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&H2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=Dh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function FH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var S;const v=e||t,_=n&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(pa(d,`${f}-flow__node`)||pa(d,`${f}-flow__edge`)))return!0;if(!r&&!v&&!a&&!l&&!n||u||p&&!C||pa(d,o)&&C||pa(d,c)&&(!C||a&&C&&!e)||!n&&d.ctrlKey&&C)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!v&&!a&&!_&&C||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&w}}function PH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=h2().scaleExtent([t,n]).translateExtent(r),v=An(e).call(d);x({x:a.x,y:a.y,zoom:Ca(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const _=v.on("wheel.zoom"),C=v.on("dblclick.zoom");d.wheelDelta(F2);async function w(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).transform(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function S({noWheelClassName:z,noPanClassName:V,onPaneContextMenu:F,userSelectionActive:P,panOnScroll:W,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:re,connectionInProgress:se,paneClickDistance:Z,selectionOnDrag:H}){P&&!f.isZoomingOrPanning&&y();const ee=W&&!$&&!P;d.clickDistance(H?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?OH({zoomPanValues:f,noWheelClassName:z,d3Selection:v,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):BH({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:_});v.on("wheel.zoom",ne,{passive:!1});const pe=IH({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",pe);const fe=zH({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!F,onPanZoom:l,onTransformChange:re});d.on("zoom",fe);const ye=HH({zoomPanValues:f,panOnDrag:q,panOnScroll:W,onPaneContextMenu:F,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const Ce=FH({zoomActivationKeyPressed:$,panOnDrag:q,zoomOnScroll:O,panOnScroll:W,zoomOnDoubleClick:U,zoomOnPinch:M,userSelectionActive:P,noPanClassName:V,noWheelClassName:z,lib:Q,connectionInProgress:se});d.filter(Ce),U?v.on("dblclick.zoom",C):v.on("dblclick.zoom",null)}function y(){d.on("zoom",null)}async function x(z,V,F){const P=kp(z),W=d==null?void 0:d.constrain()(P,V,F);return W&&await w(W),W}async function b(z,V){const F=kp(z);return await w(F,V),F}function E(z){if(v){const V=kp(z),F=v.property("__zoom");(F.k!==z.zoom||F.x!==z.x||F.y!==z.y)&&(d==null||d.transform(v,V,null,{sync:!0}))}}function D(){const z=v?u2(v.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleTo(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}async function R(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleBy(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const V=!Zn(z)||z<0?0:z;d==null||d.clickDistance(V)}return{update:S,destroy:y,setViewport:b,setViewportConstrained:x,getViewport:D,scaleTo:N,scaleBy:R,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var ka;(function(e){e.Line="line",e.Handle="handle"})(ka||(ka={}));function $H({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function SS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function Er(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function lu(e,t,n){return Math.max(0,t-e,e-n)}function xS(e,t){return e?!t:t}function UH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,v=p&&d,{xSnapped:_,ySnapped:C}=n,{minWidth:w,maxWidth:S,minHeight:y,maxHeight:x}=r,{x:b,y:E,width:D,height:N,aspectRatio:R}=e;let T=Math.floor(p?_-e.pointerX:0),j=Math.floor(d?C-e.pointerY:0);const B=D+(c?-T:T),z=N+(f?-j:j),V=-l[0]*D,F=-l[1]*N;let P=lu(B,w,S),W=lu(z,y,x);if(u){let K=0,L=0;c&&T<0?K=Er(b+T+V,u[0][0]):!c&&T>0&&(K=kr(b+B+V,u[1][0])),f&&j<0?L=Er(E+j+F,u[0][1]):!f&&j>0&&(L=kr(E+z+F,u[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(o){let K=0,L=0;c&&T>0?K=kr(b+T,o[0][0]):!c&&T<0&&(K=Er(b+B,o[1][0])),f&&j>0?L=kr(E+j,o[0][1]):!f&&j<0&&(L=Er(E+z,o[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(a){if(p){const K=lu(B/R,y,x)*R;if(P=Math.max(P,K),u){let L=0;!c&&!f||c&&!f&&v?L=kr(E+F+B/R,u[1][1])*R:L=Er(E+F+(c?T:-T)/R,u[0][1])*R,P=Math.max(P,L)}if(o){let L=0;!c&&!f||c&&!f&&v?L=Er(E+B/R,o[1][1])*R:L=kr(E+(c?T:-T)/R,o[0][1])*R,P=Math.max(P,L)}}if(d){const K=lu(z*R,w,S)/R;if(W=Math.max(W,K),u){let L=0;!c&&!f||f&&!c&&v?L=kr(b+z*R+V,u[1][0])/R:L=Er(b+(f?j:-j)*R+V,u[0][0])/R,W=Math.max(W,L)}if(o){let L=0;!c&&!f||f&&!c&&v?L=Er(b+z*R,o[1][0])/R:L=kr(b+(f?j:-j)*R,o[0][0])/R,W=Math.max(W,L)}}}j=j+(j<0?W:-W),T=T+(T<0?P:-P),a&&(v?B>z*R?j=(xS(c,f)?-T:T)/R:T=(xS(c,f)?-j:j)*R:p?(j=T/R,f=c):(T=j*R,c=f));const q=c?b+T:b,X=f?E+j:E;return{width:D+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const P2={width:0,height:0,x:0,y:0},GH={...P2,pointerX:0,pointerY:0,aspectRatio:1};function qH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function VH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:SS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:v,onResizeStart:_,onResize:C,onResizeEnd:w,shouldResize:S}){let y={...P2},x={...GH};u={boundaries:p,resizeDirection:v,keepAspectRatio:d,controlDirection:SS(f)};let b,E=null,D=[],N,R,T,j=!1;const B=KC().on("start",z=>{const{nodeLookup:V,transform:F,snapGrid:P,snapToGrid:W,nodeOrigin:q,paneDomNode:X}=n();if(b=V.get(t),!b)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Go(z.sourceEvent,{transform:F,snapGrid:P,snapToGrid:W,containerBounds:E});y={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...y,pointerX:K,pointerY:L,aspectRatio:y.width/y.height},N=void 0,R=ds(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=V.get(b.parentId)),N&&b.extent==="parent"&&(R=[[0,0],[N.measured.width,N.measured.height]]),D=[],T=void 0;for(const[M,O]of V)if(O.parentId===t&&(D.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const U=qH(O,b,O.origin??q);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}_==null||_(z,{...y})}).on("drag",z=>{const{transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:W}=n(),q=Go(z.sourceEvent,{transform:V,snapGrid:F,snapToGrid:P,containerBounds:E}),X=[];if(!b)return;const{x:K,y:L,width:M,height:O}=y,U={},$=b.origin??W,{width:Q,height:re,x:se,y:Z}=UH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,$,R,T),H=Q!==M,ee=re!==O,ne=se!==K&&H,pe=Z!==L&ⅇif(!ne&&!pe&&!H&&!ee)return;if((ne||pe||$[0]===1||$[1]===1)&&(U.x=ne?se:y.x,U.y=pe?Z:y.y,y.x=U.x,y.y=U.y,D.length>0)){const Ee=se-K,Ne=Z-L;for(const we of D)we.position={x:we.position.x-Ee+$[0]*(Q-M),y:we.position.y-Ne+$[1]*(re-O)},X.push(we)}if((H||ee)&&(U.width=H&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:y.width,U.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:y.height,y.width=U.width,y.height=U.height),N&&b.expandParent){const Ee=$[0]*(U.width??0);U.x&&U.x{j&&(w==null||w(z,{...y}),a==null||a({...y}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Np={exports:{}},Tp={},Dp={exports:{}},Rp={};/** +Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await oT(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return g.jsxs("div",{className:"home",children:[g.jsxs("div",{className:"home-inner",children:[g.jsx("div",{className:"home-brand",children:g.jsx(fa,{})}),g.jsxs("div",{className:"home-head",children:[g.jsx("h2",{children:"Projects"}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[g.jsx(Rg,{size:13})," New project"]})]}),g.jsx("div",{className:"home-list",children:e.length===0?g.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>g.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[g.jsx("span",{className:"name",children:f.name}),g.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&g.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),g.jsxs("span",{className:"time",children:["created ",Na(f.createdAt)]}),g.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:g.jsx(jg,{size:14})})]},f.id))})]}),a&&g.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:g.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[g.jsx("h2",{children:"New project"}),g.jsx(sI,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function aI(e){const t=_x(e.backend);return t?[t,yx(e.backend)].filter(Boolean).join(" · "):"—"}function oI({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?g.jsx("div",{className:"empty-state",children:g.jsx("p",{children:"No runs yet."})}):g.jsx("div",{className:"runs-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Run"}),g.jsx("th",{children:"Experiment"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Commit"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Exit"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return g.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[g.jsx("td",{className:"mono",children:Op(o.id)}),g.jsx("td",{className:"mono",children:l.get(o.experimentId)??Op(o.experimentId)}),g.jsx("td",{children:g.jsx(Ko,{status:o.status})}),g.jsx("td",{className:"mono",children:aI(o)}),g.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),g.jsx("td",{children:Na(o.createdAt)}),g.jsx("td",{className:"mono",children:o.exitCode??"—"}),g.jsx("td",{children:g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[g.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:g.jsx(Ku,{size:14})}),c&&g.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}var lI=ex();function cI(e){const[t,n]=G.useState(null),[,r]=G.useState({});return t==null||t.setTracked(e),G.useEffect(()=>{const a=new uI(()=>r({}));return a.setTracked(e),n(a),()=>a.dispose()},[]),(t==null?void 0:t.bounds)??null}var ti,ug,hg,fg;class uI{constructor(t){zy(this,ti);Qr(this,"selectors",new Set);Qr(this,"elements",new Set);Qr(this,"onSizeChange",()=>Jr(this,ti,ug).call(this));Qr(this,"resizeObs",new ResizeObserver(this.onSizeChange));Qr(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Qr(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(u=>!this.selectors.has(u)),a=[...this.selectors].filter(u=>!n.has(u));let l=!1;if(r.length>0){const u=r.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.add(c),this.resizeObs.observe(c)}),l||(l=o.length>0)}if(a.length>0){const u=a.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.delete(c),this.resizeObs.unobserve(c)}),l||(l=o.length>0)}l&&Jr(this,ti,hg).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,a=>`[data-onboarding="${a}"]`).join(",");let r=!1;for(const a of t){for(const l of a.addedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.add(l),this.resizeObs.observe(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.add(u),this.resizeObs.observe(u),r=!0}));for(const l of a.removedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.delete(l),this.resizeObs.unobserve(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u),r=!0}))}r&&Jr(this,ti,ug).call(this)}}ti=new WeakSet,ug=function(){const t=Jr(this,ti,fg).call(this);Jr(this,ti,hg).call(this),t!==Jr(this,ti,fg).call(this)&&this.onBoundsChange()},hg=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,u=>u.getBoundingClientRect()).filter(u=>u.width>0&&u.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(u=>u.left)),r=Math.min(...t.map(u=>u.top)),a=Math.max(...t.map(u=>u.right)),l=Math.max(...t.map(u=>u.bottom));this.bounds={x:n,y:r,width:a-n,height:l-r}},fg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function hI(){const[e,t]=G.useState(0),[n,r]=G.useState(0);return{ref:G.useCallback(l=>{if(!l)return;function u(){t(l.offsetWidth),r(l.offsetHeight)}const o=new ResizeObserver(u),c=new MutationObserver(u);return o.observe(l),c.observe(l,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),u(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const tu=8;function fI(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:a,viewWidth:l},u]=G.useState({viewWidth:0,viewHeight:0});G.useEffect(()=>{function p(){u({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",p),p(),()=>window.removeEventListener("resize",p)},[]);let o=0,c=0,f=0;if(e){const{distance:p}=e;switch(e.anchor){case"left":o=e.x-n-p,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+p,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-n/2,c=e.y+e.height+p;break;case"above":o=e.x+e.width/2-n/2,c=e.y-r-p;break}const d=o,v=c;o=Math.min(Math.max(o,tu),l-n-tu),c=Math.min(Math.max(c,tu),a-r-tu),f=e.anchor==="left"||e.anchor==="right"?v-c:d-o}return{x:o,y:c,arrowAdjustment:f}}const Gb="orx:tour-done",Nr=8,dI=20,Ou=[{focus:null,anchor:null,title:"Welcome to OpenResearch",description:"OpenResearch is your home for autoresearch. Spawn and coordinate research agents in one workspace."},{focus:["composer"],anchor:"above",title:"Talk to your research agent",description:"Prompt your research agents to replicate a paper, create a baseline experiment, run an eval, or investigate any research question. Type / for skills like /reproduce-paper."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected: Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here, and each session keeps its harness."},{focus:["nav-files"],anchor:"right",title:"Reports and outputs",description:"The agent writes its reports, figures, and other outputs here, and anything you drop in is visible to it too. Check Files after a run to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Configure compute",description:"This is where compute is configured. Point runs at this machine, Modal, SSH boxes, Kubernetes, or Slurm. Set it up once and agents pick the right hardware per run."},{focus:["experiments"],anchor:"left",title:"Follow every experiment",description:"Runs land here as a tree of experiments. Branch variants off a baseline, compare results, and open any run's terminal or code changes in a tab."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is its own agent working in its own worktree, so you can run several agents in parallel. Ask for your first experiment whenever you're ready."}];function pI({onClose:e}){const[t,n]=G.useState(0),r=Ou[t],a=cI(r.focus??[]);G.useEffect(()=>{function u(o){o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),e())}return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e]);const l=a?{left:a.x-Nr,top:a.y-Nr,width:a.width+Nr*2,height:a.height+Nr*2}:null;return lI.createPortal(g.jsxs("div",{className:"tour-overlay",children:[l?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"tour-spotlight",style:l}),g.jsx("div",{className:"tour-ring",style:l})]}):g.jsx("div",{className:"tour-dim"}),g.jsx(gI,{step:r,bounds:a,index:t,onBack:()=>n(u=>Math.max(0,u-1)),onNext:()=>t+1>=Ou.length?e():n(t+1),onClose:e})]}),document.body)}function gI({step:e,bounds:t,index:n,onBack:r,onNext:a,onClose:l}){const u=hI(),o=fI(t&&e.anchor?{x:t.x-Nr,y:t.y-Nr,width:t.width+Nr*2,height:t.height+Nr*2,anchor:e.anchor,distance:dI}:null,u),c=e.anchor!=null&&t!=null&&o.x>0,f=n+1===Ou.length;return g.jsxs("div",{ref:u.ref,className:`tour-card ${c?"":"centered"}`,style:c?{left:o.x,top:o.y}:void 0,children:[c&&e.anchor&&g.jsx(mI,{anchor:e.anchor,adjustment:o.arrowAdjustment}),g.jsx("button",{className:"icon-btn tour-close",title:"Skip tour",onClick:l,children:g.jsx(_a,{size:15})}),g.jsx("h3",{children:e.title}),g.jsx("p",{children:e.description}),g.jsxs("div",{className:"tour-footer",children:[g.jsx("div",{className:"tour-footer-side",children:n>0&&g.jsx("button",{className:"btn ghost",onClick:r,children:"Back"})}),g.jsxs("span",{className:"tour-count",children:[n+1," / ",Ou.length]}),g.jsx("div",{className:"tour-footer-side end",children:g.jsx("button",{className:"btn primary",onClick:a,children:f?"Done":"Next"})})]})]})}function mI({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return g.jsx("div",{className:`tour-arrow ${e}`,style:{translate:n}})}function $t(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function wh(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bu.prototype=wh.prototype={constructor:bu,on:function(e,t){var n=this._,r=_I(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l0)for(var n=new Array(a),r=0,a,l;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vb.hasOwnProperty(t)?{space:Vb[t],local:e}:e}function bI(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===dg&&t.documentElement.namespaceURI===dg?t.createElement(e):t.createElementNS(n,e)}}function SI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BC(e){var t=Ch(e);return(t.local?SI:bI)(t)}function xI(){}function Im(e){return e==null?xI:function(){return this.querySelector(e)}}function wI(e){typeof e!="function"&&(e=Im(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a=b&&(b=x+1);!(D=S[b])&&++b=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function YI(e){e||(e=XI);function t(d,v){return d&&v?e(d.__data__,v.__data__):!d-!v}for(var n=this._groups,r=n.length,a=new Array(r),l=0;lt?1:e>=t?0:NaN}function KI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZI(){return Array.from(this)}function QI(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?c7:typeof t=="function"?h7:u7)(e,t,n??"")):Sa(this.node(),e)}function Sa(e,t){return e.style.getPropertyValue(t)||PC(e).getComputedStyle(e,null).getPropertyValue(t)}function d7(e){return function(){delete this[e]}}function p7(e,t){return function(){this[e]=t}}function g7(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function m7(e,t){return arguments.length>1?this.each((t==null?d7:typeof t=="function"?g7:p7)(e,t)):this.node()[e]}function $C(e){return e.trim().split(/^|\s+/)}function zm(e){return e.classList||new UC(e)}function UC(e){this._node=e,this._names=$C(e.getAttribute("class")||"")}UC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function GC(e,t){for(var n=zm(e),r=-1,a=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function G7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n()=>e;function pg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}pg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function e9(e){return!e.ctrlKey&&!e.button}function t9(){return this.parentNode}function n9(e,t){return t??{x:e.x,y:e.y}}function i9(){return navigator.maxTouchPoints||"ontouchstart"in this}function KC(){var e=e9,t=t9,n=n9,r=i9,a={},l=wh("start","drag","end"),u=0,o,c,f,p,d=0;function v(E){E.on("mousedown.drag",_).filter(r).on("touchstart.drag",S).on("touchmove.drag",y,J7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(E,D){if(!(p||!e.call(this,E,D))){var N=b(this,t.call(this,E,D),E,D,"mouse");N&&(An(E.view).on("mousemove.drag",C,tl).on("mouseup.drag",w,tl),YC(E.view),Sp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function C(E){if(ma(E),!f){var D=E.clientX-o,N=E.clientY-c;f=D*D+N*N>d}a.mouse("drag",E)}function w(E){An(E.view).on("mousemove.drag mouseup.drag",null),XC(E.view,f),ma(E),a.mouse("end",E)}function S(E,D){if(e.call(this,E,D)){var N=E.changedTouches,R=t.call(this,E,D),T=N.length,j,B;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=s9.exec(e))?new mn(t[1],t[2],t[3],1):(t=a9.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=o9.exec(e))?iu(t[1],t[2],t[3],t[4]):(t=l9.exec(e))?iu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=c9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,1):(t=u9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,t[4]):Wb.hasOwnProperty(e)?Kb(Wb[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Kb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function iu(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function d9(e){return e instanceof _l||(e=us(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function gg(e,t,n,r){return arguments.length===1?d9(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hm(mn,gg,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(as(this.r),as(this.g),as(this.b),zu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zb,formatHex:Zb,formatHex8:p9,formatRgb:Qb,toString:Qb}));function Zb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function p9(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qb(){const e=zu(this.opacity);return`${e===1?"rgb(":"rgba("}${as(this.r)}, ${as(this.g)}, ${as(this.b)}${e===1?")":`, ${e})`}`}function zu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function as(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=as(e),(e<16?"0":"")+e.toString(16)}function Jb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function QC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=us(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function g9(e,t,n,r){return arguments.length===1?QC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hm(Kn,g9,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(xp(e>=240?e-240:e+120,a,r),xp(e,a,r),xp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(eS(this.h),ru(this.s),ru(this.l),zu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zu(this.opacity);return`${e===1?"hsl(":"hsla("}${eS(this.h)}, ${ru(this.s)*100}%, ${ru(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eS(e){return e=(e||0)%360,e<0?e+360:e}function ru(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Fm=e=>()=>e;function m9(e,t){return function(n){return e+n*t}}function v9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function _9(e){return(e=+e)==1?JC:function(t,n){return n-t?v9(t,n,e):Fm(isNaN(t)?n:t)}}function JC(e,t){var n=t-e;return n?m9(e,n):Fm(isNaN(e)?t:e)}const Hu=(function e(t){var n=_9(t);function r(a,l){var u=n((a=gg(a)).r,(l=gg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=JC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function y9(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;an&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ui(r,a)})),n=wp.lastIndex;return n180?p+=360:p-f>180&&(f+=360),v.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ui(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,v){f!==p?v.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ui(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,v,_,C){if(f!==d||p!==v){var w=_.push(a(_)+"scale(",null,",",null,")");C.push({i:w-4,x:ui(f,d)},{i:w-2,x:ui(p,v)})}else(d!==1||v!==1)&&_.push(a(_)+"scale("+d+","+v+")")}return function(f,p){var d=[],v=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,v),u(f.rotate,p.rotate,d,v),o(f.skewX,p.skewX,d,v),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,v),f=p=null,function(_){for(var C=-1,w=v.length,S;++C=0&&e._call.call(void 0,t),e=e._next;--xa}function iS(){hs=(Pu=rl.now())+Eh,xa=Io=0;try{L9()}finally{xa=0,B9(),hs=0}}function O9(){var e=rl.now(),t=e-Pu;t>i2&&(Eh-=t,Pu=e)}function B9(){for(var e,t=Fu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Fu=n);zo=e,_g(r)}function _g(e){if(!xa){Io&&(Io=clearTimeout(Io));var t=e-hs;t>24?(e<1/0&&(Io=setTimeout(iS,e-rl.now()-Eh)),Oo&&(Oo=clearInterval(Oo))):(Oo||(Pu=rl.now(),Oo=setInterval(O9,i2)),xa=1,r2(iS))}}function rS(e,t,n){var r=new $u;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var I9=wh("start","end","cancel","interrupt"),z9=[],a2=0,sS=1,yg=2,xu=3,aS=4,bg=5,wu=6;function kh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;H9(e,n,{name:t,index:r,group:a,on:I9,tween:z9,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:a2})}function $m(e,t){var n=ni(e,t);if(n.state>a2)throw new Error("too late; already scheduled");return n}function gi(e,t){var n=ni(e,t);if(n.state>xu)throw new Error("too late; already running");return n}function ni(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function H9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=s2(l,0,n.time);function l(f){n.state=sS,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,v,_;if(n.state!==sS)return c();for(p in r)if(_=r[p],_.name===n.name){if(_.state===xu)return rS(u);_.state===aS?(_.state=wu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[p]):+pyg&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function gz(e,t,n){var r,a,l=pz(t)?$m:gi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function mz(e,t){var n=this._id;return arguments.length<2?ni(this.node(),n).on.on(e):this.each(gz(n,e,t))}function vz(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _z(){return this.on("end.remove",vz(this._id))}function yz(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Im(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u()=>e;function Gz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function $i(e,t,n){this.k=e,this.x=t,this.y=n}$i.prototype={constructor:$i,scale:function(e){return e===1?this:new $i(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $i(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ah=new $i(1,0,0);u2.prototype=$i.prototype;function u2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ah;return e.__zoom}function Cp(e){e.stopImmediatePropagation()}function Bo(e){e.preventDefault(),e.stopImmediatePropagation()}function qz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function oS(){return this.__zoom||Ah}function Wz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function h2(){var e=qz,t=Vz,n=Xz,r=Wz,a=Yz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Su,f=wh("start","zoom","end"),p,d,v,_=500,C=150,w=0,S=10;function y(P){P.property("__zoom",oS).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,W,q,X){var K=P.selection?P.selection():P;K.property("__zoom",oS),P!==K?D(P,W,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},y.scaleBy=function(P,W,q,X){y.scaleTo(P,function(){var K=this.__zoom.k,L=typeof W=="function"?W.apply(this,arguments):W;return K*L},q,X)},y.scaleTo=function(P,W,q,X){y.transform(P,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),U=typeof W=="function"?W.apply(this,arguments):W;return n(b(x(L,U),M,O),K,u)},q,X)},y.translateBy=function(P,W,q,X){y.transform(P,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},y.translateTo=function(P,W,q,X,K){y.transform(P,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(Ah.translate(O[0],O[1]).scale(M.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(P,W){return W=Math.max(l[0],Math.min(l[1],W)),W===P.k?P:new $i(W,P.x,P.y)}function b(P,W,q){var X=W[0]-q[0]*P.k,K=W[1]-q[1]*P.k;return X===P.x&&K===P.y?P:new $i(P.k,X,K)}function E(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function D(P,W,q,X){P.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),U=q==null?E(O):typeof q=="function"?q.apply(K,L):q,$=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof W=="function"?W.apply(K,L):W,se=c(Q.invert(U).concat($/Q.k),re.invert(U).concat($/re.k));return function(Z){if(Z===1)Z=re;else{var H=se(Z),ee=$/H[2];Z=new $i(ee,U[0]-H[0]*ee,U[1]-H[1]*ee)}M.zoom(null,Z)}})}function N(P,W,q){return!q&&P.__zooming||new R(P,W)}function R(P,W){this.that=P,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,W),this.taps=0}R.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,W){return this.mouse&&P!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var W=An(this.that).datum();f.call(P,this.that,new Gz(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:f}),W)}};function T(P,...W){if(!e.apply(this,arguments))return;var q=N(this,W).event(P),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(P);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],Cu(this),q.start()}Bo(P),q.wheel=setTimeout(M,C),q.zoom("mouse",n(b(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(P,...W){if(v||!e.apply(this,arguments))return;var q=P.currentTarget,X=N(this,W,!0).event(P),K=An(P.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),L=Xn(P,q),M=P.clientX,O=P.clientY;YC(P.view),Cp(P),X.mouse=[L,this.__zoom.invert(L)],Cu(this),X.start();function U(Q){if(Bo(Q),!X.moved){var re=Q.clientX-M,se=Q.clientY-O;X.moved=re*re+se*se>w}X.event(Q).zoom("mouse",n(b(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function $(Q){K.on("mousemove.zoom mouseup.zoom",null),XC(Q.view,X.moved),Bo(Q),X.event(Q).end()}}function B(P,...W){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(P.changedTouches?P.changedTouches[0]:P,this),K=q.invert(X),L=q.k*(P.shiftKey?.5:2),M=n(b(x(q,L),X,K),t.apply(this,W),u);Bo(P),o>0?An(this).transition().duration(o).call(D,M,X,P):An(this).call(y.transform,M,X,P)}}function z(P,...W){if(e.apply(this,arguments)){var q=P.touches,X=q.length,K=N(this,W,P.changedTouches.length===X).event(P),L,M,O,U;for(Cp(P),M=0;M`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},sl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],f2=["Enter"," ","Escape"],d2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var wa;(function(e){e.Strict="strict",e.Loose="loose"})(wa||(wa={}));var os;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(os||(os={}));var al;(function(e){e.Partial="partial",e.Full="full"})(al||(al={}));const p2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ar;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ar||(Ar={}));var Uu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Uu||(Uu={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));const lS={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top};function g2(e){return e===null?null:e?"valid":"invalid"}const m2=e=>"id"in e&&"source"in e&&"target"in e,Kz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yl=(e,t=[0,0])=>{const{width:n,height:r}=Yi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},Zz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Gm(a)?a:t.nodeLookup.get(a.id));const o=u?Gu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Th(n)},bl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Nh(n,Gu(a)),r=!0)}),r?Th(n):{x:0,y:0,width:0,height:0}},qm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const v of e.values()){const{measured:_,selectable:C=!0,hidden:w=!1}=v;if(u&&!C||w)continue;const S=_.width??v.width??v.initialWidth??0,y=_.height??v.height??v.initialHeight??0,{x,y:b}=v.internals.positionAbsolute,E=b2(o,c,f,p,x,b,S,y),D=S*y,N=l&&E>0;(!v.internals.handleBounds||N||E>=D||v.dragging)&&d.push(v)}return d},Qz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function eH({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=Jz(e,u),c=bl(o),f=Wm(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function v2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const _=o.measured.width,C=o.measured.height;_&&C&&(d=[[c,f],[c+_,f+C]])}else o&&ds(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const v=ds(d)?fs(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:v.x-c+(u.measured.width??0)*p[0],y:v.y-f+(u.measured.height??0)*p[1]},positionAbsolute:v}}async function tH({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const _=l.has(v.id),C=!_&&v.parentId&&u.find(w=>w.id===v.parentId);(_||C)&&u.push(v)}const o=new Set(t.map(v=>v.id)),c=r.filter(v=>v.deletable!==!1),p=Qz(u,c);for(const v of c)o.has(v.id)&&!p.find(C=>C.id===v.id)&&p.push(v);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const Ca=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fs=(e={x:0,y:0},t,n)=>({x:Ca(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ca(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function _2(e,t,n){const{width:r,height:a}=Yi(n),{x:l,y:u}=n.internals.positionAbsolute;return fs(e,[[l,u],[l+r,u+a]],t)}const cS=(e,t,n)=>en?-Ca(Math.abs(e-n),1,t)/t:0,Vm=(e,t,n=15,r=40)=>{const a=cS(e.x,r,t.width-r)*n,l=cS(e.y,r,t.height-r)*n;return[a,l]},Nh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Sg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Th=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ol=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Gu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},y2=(e,t)=>Th(Nh(Sg(e),Sg(t))),b2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},qu=(e,t)=>b2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),uS=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),S2=(e,t)=>(n,r)=>{},Sl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?Sl(o,u):o},Ea=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function aa(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nH(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=aa(e,n),a=aa(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=aa(e.top??e.y??0,n),a=aa(e.bottom??e.y??0,n),l=aa(e.left??e.x??0,t),u=aa(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iH(e,t,n,r,a,l){const{x:u,y:o}=Ea(e,[t,n,r]),{x:c,y:f}=Ea({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Wm=(e,t,n,r,a,l)=>{const u=nH(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=Ca(f,r,a),d=e.x+e.width/2,v=e.y+e.height/2,_=t/2-d*p,C=n/2-v*p,w=iH(e,_,C,p,t,n),S={left:Math.min(w.left-u.left,0),top:Math.min(w.top-u.top,0),right:Math.min(w.right-u.right,0),bottom:Math.min(w.bottom-u.bottom,0)};return{x:_-S.left+S.right,y:C-S.top+S.bottom,zoom:p}},ll=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ds(e){return e!=null&&e!=="parent"}function Yi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function x2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function w2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function hS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rH(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function sH(e){return{...d2,...e||{}}}function Go(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=xl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?Sl(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Ym=e=>({width:e.offsetWidth,height:e.offsetHeight}),C2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aH=["INPUT","SELECT","TEXTAREA"];function E2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aH.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const k2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=k2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},fS=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Ym(u)}})};function A2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function ou(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function dS({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case je.Left:return[t-ou(t-r,l),n];case je.Right:return[t+ou(r-t,l),n];case je.Top:return[t,n-ou(n-a,l)];case je.Bottom:return[t,n+ou(a-n,l)]}}function N2({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top,curvature:u=.25}){const[o,c]=dS({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=dS({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,v,_,C]=A2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,v,_,C]}function T2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n0}const cH=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,uH=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hH=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||cH;let a;return m2(e)?a={...e}:a={...e,id:r(e)},uH(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function D2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=T2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const pS={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},fH=({source:e,sourcePosition:t=je.Bottom,target:n})=>t===je.Left||t===je.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dH({source:e,sourcePosition:t=je.Bottom,target:n,targetPosition:r=je.Top,center:a,offset:l,stepPosition:u}){const o=pS[t],c=pS[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=fH({source:f,sourcePosition:t,target:p}),v=d.x!==0?"x":"y",_=d[v];let C=[],w,S;const y={x:0,y:0},x={x:0,y:0},[,,b,E]=T2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[v]*c[v]===-1){v==="x"?(w=a.x??f.x+(p.x-f.x)*u,S=a.y??(f.y+p.y)/2):(w=a.x??(f.x+p.x)/2,S=a.y??f.y+(p.y-f.y)*u);const T=[{x:w,y:f.y},{x:w,y:p.y}],j=[{x:f.x,y:S},{x:p.x,y:S}];o[v]===_?C=v==="x"?T:j:C=v==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(v==="x"?C=o.x===_?j:T:C=o.y===_?T:j,t===r){const P=Math.abs(e[v]-n[v]);if(P<=l){const W=Math.min(l-1,l-P);o[v]===_?y[v]=(f[v]>e[v]?-1:1)*W:x[v]=(p[v]>n[v]?-1:1)*W}}if(t!==r){const P=v==="x"?"y":"x",W=o[v]===c[P],q=f[P]>p[P],X=f[P]=F?(w=(B.x+z.x)/2,S=C[0].y):(w=C[0].x,S=(B.y+z.y)/2)}const D={x:f.x+y.x,y:f.y+y.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...D.x!==C[0].x||D.y!==C[0].y?[D]:[],...C,...N.x!==C[C.length-1].x||N.y!==C[C.length-1].y?[N]:[],n],w,S,b,E]}function pH(e,t,n,r){const a=Math.min(gS(e,t)/2,gS(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.xn.id===t):e[0])||null}function wg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mH(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=wg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const R2=1e3,vH=10,Xm={nodeOrigin:[0,0],nodeExtent:sl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_H={...Xm,checkEquality:!0};function Km(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function yH(e,t,n){const r=Km(Xm,n);for(const a of e.values())if(a.parentId)Qm(a,e,t,r);else{const l=yl(a,r.nodeOrigin),u=ds(a.extent)?a.extent:r.nodeExtent,o=fs(l,u,Yi(a));a.internals.positionAbsolute=o}}function bH(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Zm(e){return e==="manual"}function Cg(e,t,n,r={}){var p,d;const a=Km(_H,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Zm(a.zIndexMode)?R2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const v of e){let _=u.get(v.id);if(a.checkEquality&&v===(_==null?void 0:_.internals.userNode))t.set(v.id,_);else{const C=yl(v,a.nodeOrigin),w=ds(v.extent)?v.extent:a.nodeExtent,S=fs(C,w,Yi(v));_={...a.defaults,...v,measured:{width:(p=v.measured)==null?void 0:p.width,height:(d=v.measured)==null?void 0:d.height},internals:{positionAbsolute:S,handleBounds:bH(v,_),z:M2(v,o,a.zIndexMode),userNode:v}},t.set(v.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(c=!1),v.parentId&&Qm(_,t,n,r,l),f||(f=v.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function SH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=Km(Xm,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}SH(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*vH),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Zm(c)?R2:0,{x:v,y:_,z:C}=xH(e,p,u,o,d,c),{positionAbsolute:w}=e.internals,S=v!==w.x||_!==w.y;(S||C!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y:_}:w,z:C}})}function M2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Zm(n)?r:r+(e.selected?t:0)}function xH(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Yi(e),f=yl(e,n),p=ds(e.extent)?fs(f,e.extent,c):f;let d=fs({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=_2(d,c,t));const v=M2(e,a,l),_=t.internals.z??0;return{x:d.x,y:d.y,z:_>=v?_+1:v}}function Jm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??ol(c),p=y2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var b;const p=c.internals.positionAbsolute,d=Yi(c),v=c.origin??r,_=o.x0||C>0||y||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-_+y,y:c.position.y-C+x}}),(b=n.get(f))==null||b.forEach(E=>{e.some(D=>D.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+_,y:E.position.y+C}})})),(d.width0){const _=Jm(v,t,n,a);f.push(..._)}return{changes:f,updatedInternals:c}}async function CH({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function yS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function j2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;yS("source",c,p,e,a,u),yS("target",c,f,e,l,o),t.set(r.id,r)}}function L2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L2(n,t):!1}function bS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function EH(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!L2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function Ep({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function kH({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=Sl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function AH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,v=null,_=!1,C=!1,w=null;function S({noDragClassName:x,handleSelector:b,domNode:E,isSelectable:D,nodeId:N,nodeClickDistance:R=0}){v=An(E);function T({x:V,y:F}){const{nodeLookup:P,nodeExtent:W,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:U}=t();l={x:V,y:F};let $=!1;const Q=o.size>1,re=Q&&W?Sg(bl(o)):null,se=Q&&X?kH({dragItems:o,snapGrid:q,x:V,y:F}):null;for(const[Z,H]of o){if(!P.has(Z))continue;let ee={x:V-H.distance.x,y:F-H.distance.y};X&&(ee=se?{x:Math.round(ee.x+se.x),y:Math.round(ee.y+se.y)}:Sl(ee,q));let ne=null;if(Q&&W&&!H.extent&&re){const{positionAbsolute:ye}=H.internals,Ce=ye.x-re.x+W[0][0],Ee=ye.x+H.measured.width-re.x2+W[1][0],Ne=ye.y-re.y+W[0][1],we=ye.y+H.measured.height-re.y2+W[1][1];ne=[[Ce,Ne],[Ee,we]]}const{position:pe,positionAbsolute:fe}=v2({nodeId:Z,nextPosition:ee,nodeLookup:P,nodeExtent:ne||W,nodeOrigin:K,onError:O});$=$||H.position.x!==pe.x||H.position.y!==pe.y,H.position=pe,H.internals.positionAbsolute=fe}if(C=C||$,!!$&&(U(o,!0),w&&(r||L||!N&&M))){const[Z,H]=Ep({nodeId:N,dragItems:o,nodeLookup:P});r==null||r(w,o,Z,H),L==null||L(w,Z,H),N||M==null||M(w,H)}}async function j(){if(!p)return;const{transform:V,panBy:F,autoPanSpeed:P,autoPanOnNodeDrag:W}=t();if(!W){c=!1,cancelAnimationFrame(u);return}const[q,X]=Vm(f,p,P);(q!==0||X!==0)&&(l.x=(l.x??0)-q/V[2],l.y=(l.y??0)-X/V[2],await F({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(V){var Q;const{nodeLookup:F,multiSelectionActive:P,nodesDraggable:W,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:U}=t();d=!0,(!L||!D)&&!P&&N&&((Q=F.get(N))!=null&&Q.selected||U()),D&&L&&N&&(e==null||e(N));const $=Go(V.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=$,o=EH(F,W,$,N),o.size>0&&(n||M||!N&&O)){const[re,se]=Ep({nodeId:N,dragItems:o,nodeLookup:F});n==null||n(V.sourceEvent,o,re,se),M==null||M(V.sourceEvent,re,se),N||O==null||O(V.sourceEvent,se)}}const z=KC().clickDistance(R).on("start",V=>{const{domNode:F,nodeDragThreshold:P,transform:W,snapGrid:q,snapToGrid:X}=t();p=(F==null?void 0:F.getBoundingClientRect())||null,_=!1,C=!1,w=V.sourceEvent,P===0&&B(V),l=Go(V.sourceEvent,{transform:W,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(V.sourceEvent,p)}).on("drag",V=>{const{autoPanOnNodeDrag:F,transform:P,snapGrid:W,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Go(V.sourceEvent,{transform:P,snapGrid:W,snapToGrid:q,containerBounds:p});if(w=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||N&&!K.has(N))&&(_=!0),!_){if(!c&&F&&d&&(c=!0,j()),!d){const M=Qn(V.sourceEvent,p),O=M.x-f.x,U=M.y-f.y;Math.sqrt(O*O+U*U)>X&&B(V)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(V.sourceEvent,p),T(L))}}).on("end",V=>{if(!d||_){_&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:F,updateNodePositions:P,onNodeDragStop:W,onSelectionDragStop:q}=t();if(C&&(P(o,!1),C=!1),a||W||!N&&q){const[X,K]=Ep({nodeId:N,dragItems:o,nodeLookup:F,dragging:!1});a==null||a(V.sourceEvent,o,X,K),W==null||W(V.sourceEvent,X,K),N||q==null||q(V.sourceEvent,K)}}}).filter(V=>{const F=V.target;return!V.button&&(!x||!bS(F,`.${x}`,E))&&(!b||bS(F,b,E))});v.call(z)}function y(){v==null||v.on(".drag",null)}return{update:S,destroy:y}}function NH(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())qu(a,ol(l))>0&&r.push(l);return r}const TH=250;function DH(e,t,n,r){var o,c;let a=[],l=1/0;const u=NH(e,n,t+TH);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:v,y:_}=ps(f,d,d.position,!0),C=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(_-e.y,2));C>t||(C1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function O2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(v=>v.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ps(u,c,c.position,!0)}:c}function B2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function RH(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const I2=()=>!0;function MH(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:v,cancelConnection:_,onConnectStart:C,onConnect:w,onConnectEnd:S,isValidConnection:y=I2,onReconnectEnd:x,updateConnection:b,getTransform:E,getFromHandle:D,autoPanSpeed:N,dragThreshold:R=1,handleDomNode:T}){const j=C2(e.target);let B=0,z;const{x:V,y:F}=Qn(e),P=B2(l,T),W=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!W||!P)return;const X=O2(a,P,r,c,t);if(!X)return;let K=Qn(e,W),L=!1,M=null,O=!1,U=null;function $(){if(!p||!W)return;const[pe,fe]=Vm(K,W,N);v({x:pe,y:fe}),B=requestAnimationFrame($)}const Q={...X,nodeId:a,type:P,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ps(re,Q,je.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:lS[Q.position],toNode:null,pointer:K};function H(){q=!0,b(Z),C==null||C(e,{nodeId:a,handleId:r,handleType:P})}R===0&&H();function ee(pe){if(!q){const{x:we,y:ft}=Qn(pe),Ct=we-V,st=ft-F;if(!(Ct*Ct+st*st>R*R))return;H()}if(!D()||!Q){ne(pe);return}const fe=E();K=Qn(pe,W),z=DH(xl(K,fe,!1,[1,1]),n,c,Q),L||($(),L=!0);const ye=z2(pe,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:y,doc:j,lib:f,flowId:d,nodeLookup:c});U=ye.handleDomNode,M=ye.connection,O=RH(!!z,ye.isValid);const Ce=c.get(a),Ee=Ce?ps(Ce,Q,je.Left,!0):Z.from,Ne={...Z,from:Ee,isValid:O,to:ye.toHandle&&O?Ea({x:ye.toHandle.x,y:ye.toHandle.y},fe):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:lS[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};b(Ne),Z=Ne}function ne(pe){if(!("touches"in pe&&pe.touches.length>0)){if(q){(z||U)&&M&&O&&(w==null||w(M));const{inProgress:fe,...ye}=Z,Ce={...ye,toPosition:Z.toHandle?Z.toPosition:null};S==null||S(pe,Ce),l&&(x==null||x(pe,Ce))}_(),cancelAnimationFrame(B),L=!1,O=!1,M=null,U=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function z2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=I2,nodeLookup:p}){const d=l==="target",v=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:_,y:C}=Qn(e),w=u.elementFromPoint(_,C),S=w!=null&&w.classList.contains(`${o}-flow__handle`)?w:v,y={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=B2(void 0,S),b=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!b||!x)return y;const R={source:d?b:r,sourceHandle:d?E:a,target:d?r:b,targetHandle:d?a:E};y.connection=R;const j=D&&N&&(n===wa.Strict?d&&x==="source"||!d&&x==="target":b!==r||E!==a);y.isValid=j&&f(R),y.toHandle=O2(b,x,E,p,n,!0)}return y}const Eg={onPointerDown:MH,isValid:z2};function jH({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:v=!0,inversePan:_=!1}){const C=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const E=n(),D=b.sourceEvent.ctrlKey&&ll()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*p,R=E[2]*Math.pow(2,N*D);t.scaleTo(R)};let w=[0,0];const S=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(w=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},y=b=>{const E=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const D=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],N=[D[0]-w[0],D[1]-w[1]];w=D;const R=r()*Math.max(E[2],Math.log(E[2]))*(_?-1:1),T={x:E[0]-N[0]*R,y:E[1]-N[1]*R},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=h2().on("start",S).on("zoom",d?y:null).on("zoom.wheel",v?C:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const Dh=e=>({x:e.x,y:e.y,zoom:e.k}),kp=({x:e,y:t,zoom:n})=>Ah.translate(e,t).scale(n),pa=(e,t)=>e.target.closest(`.${t}`),H2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),LH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ap=(e,t=0,n=LH,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},F2=e=>{const t=e.ctrlKey&&ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function OH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(pa(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const S=Xn(p),y=F2(p),x=d*Math.pow(2,y);r.scaleTo(n,x,S,p);return}const v=p.deltaMode===1?20:1;let _=a===os.Vertical?0:p.deltaX*v,C=a===os.Horizontal?0:p.deltaY*v;!ll()&&p.shiftKey&&a!==os.Vertical&&(_=p.deltaY*v,C=0),r.translateBy(n,-(_/d)*l,-(C/d)*l,{internal:!0});const w=Dh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,w))}}function BH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=pa(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function IH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=Dh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function zH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&H2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,Dh(l.transform)))}}function HH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&H2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=Dh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function FH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var S;const v=e||t,_=n&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(pa(d,`${f}-flow__node`)||pa(d,`${f}-flow__edge`)))return!0;if(!r&&!v&&!a&&!l&&!n||u||p&&!C||pa(d,o)&&C||pa(d,c)&&(!C||a&&C&&!e)||!n&&d.ctrlKey&&C)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!v&&!a&&!_&&C||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&w}}function PH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=h2().scaleExtent([t,n]).translateExtent(r),v=An(e).call(d);x({x:a.x,y:a.y,zoom:Ca(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const _=v.on("wheel.zoom"),C=v.on("dblclick.zoom");d.wheelDelta(F2);async function w(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).transform(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function S({noWheelClassName:z,noPanClassName:V,onPaneContextMenu:F,userSelectionActive:P,panOnScroll:W,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:re,connectionInProgress:se,paneClickDistance:Z,selectionOnDrag:H}){P&&!f.isZoomingOrPanning&&y();const ee=W&&!$&&!P;d.clickDistance(H?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?OH({zoomPanValues:f,noWheelClassName:z,d3Selection:v,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):BH({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:_});v.on("wheel.zoom",ne,{passive:!1});const pe=IH({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",pe);const fe=zH({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!F,onPanZoom:l,onTransformChange:re});d.on("zoom",fe);const ye=HH({zoomPanValues:f,panOnDrag:q,panOnScroll:W,onPaneContextMenu:F,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const Ce=FH({zoomActivationKeyPressed:$,panOnDrag:q,zoomOnScroll:O,panOnScroll:W,zoomOnDoubleClick:U,zoomOnPinch:M,userSelectionActive:P,noPanClassName:V,noWheelClassName:z,lib:Q,connectionInProgress:se});d.filter(Ce),U?v.on("dblclick.zoom",C):v.on("dblclick.zoom",null)}function y(){d.on("zoom",null)}async function x(z,V,F){const P=kp(z),W=d==null?void 0:d.constrain()(P,V,F);return W&&await w(W),W}async function b(z,V){const F=kp(z);return await w(F,V),F}function E(z){if(v){const V=kp(z),F=v.property("__zoom");(F.k!==z.zoom||F.x!==z.x||F.y!==z.y)&&(d==null||d.transform(v,V,null,{sync:!0}))}}function D(){const z=v?u2(v.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleTo(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}async function R(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleBy(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const V=!Zn(z)||z<0?0:z;d==null||d.clickDistance(V)}return{update:S,destroy:y,setViewport:b,setViewportConstrained:x,getViewport:D,scaleTo:N,scaleBy:R,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var ka;(function(e){e.Line="line",e.Handle="handle"})(ka||(ka={}));function $H({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function SS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function Er(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function lu(e,t,n){return Math.max(0,t-e,e-n)}function xS(e,t){return e?!t:t}function UH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,v=p&&d,{xSnapped:_,ySnapped:C}=n,{minWidth:w,maxWidth:S,minHeight:y,maxHeight:x}=r,{x:b,y:E,width:D,height:N,aspectRatio:R}=e;let T=Math.floor(p?_-e.pointerX:0),j=Math.floor(d?C-e.pointerY:0);const B=D+(c?-T:T),z=N+(f?-j:j),V=-l[0]*D,F=-l[1]*N;let P=lu(B,w,S),W=lu(z,y,x);if(u){let K=0,L=0;c&&T<0?K=Er(b+T+V,u[0][0]):!c&&T>0&&(K=kr(b+B+V,u[1][0])),f&&j<0?L=Er(E+j+F,u[0][1]):!f&&j>0&&(L=kr(E+z+F,u[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(o){let K=0,L=0;c&&T>0?K=kr(b+T,o[0][0]):!c&&T<0&&(K=Er(b+B,o[1][0])),f&&j>0?L=kr(E+j,o[0][1]):!f&&j<0&&(L=Er(E+z,o[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(a){if(p){const K=lu(B/R,y,x)*R;if(P=Math.max(P,K),u){let L=0;!c&&!f||c&&!f&&v?L=kr(E+F+B/R,u[1][1])*R:L=Er(E+F+(c?T:-T)/R,u[0][1])*R,P=Math.max(P,L)}if(o){let L=0;!c&&!f||c&&!f&&v?L=Er(E+B/R,o[1][1])*R:L=kr(E+(c?T:-T)/R,o[0][1])*R,P=Math.max(P,L)}}if(d){const K=lu(z*R,w,S)/R;if(W=Math.max(W,K),u){let L=0;!c&&!f||f&&!c&&v?L=kr(b+z*R+V,u[1][0])/R:L=Er(b+(f?j:-j)*R+V,u[0][0])/R,W=Math.max(W,L)}if(o){let L=0;!c&&!f||f&&!c&&v?L=Er(b+z*R,o[1][0])/R:L=kr(b+(f?j:-j)*R,o[0][0])/R,W=Math.max(W,L)}}}j=j+(j<0?W:-W),T=T+(T<0?P:-P),a&&(v?B>z*R?j=(xS(c,f)?-T:T)/R:T=(xS(c,f)?-j:j)*R:p?(j=T/R,f=c):(T=j*R,c=f));const q=c?b+T:b,X=f?E+j:E;return{width:D+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const P2={width:0,height:0,x:0,y:0},GH={...P2,pointerX:0,pointerY:0,aspectRatio:1};function qH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function VH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:SS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:v,onResizeStart:_,onResize:C,onResizeEnd:w,shouldResize:S}){let y={...P2},x={...GH};u={boundaries:p,resizeDirection:v,keepAspectRatio:d,controlDirection:SS(f)};let b,E=null,D=[],N,R,T,j=!1;const B=KC().on("start",z=>{const{nodeLookup:V,transform:F,snapGrid:P,snapToGrid:W,nodeOrigin:q,paneDomNode:X}=n();if(b=V.get(t),!b)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Go(z.sourceEvent,{transform:F,snapGrid:P,snapToGrid:W,containerBounds:E});y={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...y,pointerX:K,pointerY:L,aspectRatio:y.width/y.height},N=void 0,R=ds(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=V.get(b.parentId)),N&&b.extent==="parent"&&(R=[[0,0],[N.measured.width,N.measured.height]]),D=[],T=void 0;for(const[M,O]of V)if(O.parentId===t&&(D.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const U=qH(O,b,O.origin??q);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}_==null||_(z,{...y})}).on("drag",z=>{const{transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:W}=n(),q=Go(z.sourceEvent,{transform:V,snapGrid:F,snapToGrid:P,containerBounds:E}),X=[];if(!b)return;const{x:K,y:L,width:M,height:O}=y,U={},$=b.origin??W,{width:Q,height:re,x:se,y:Z}=UH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,$,R,T),H=Q!==M,ee=re!==O,ne=se!==K&&H,pe=Z!==L&ⅇif(!ne&&!pe&&!H&&!ee)return;if((ne||pe||$[0]===1||$[1]===1)&&(U.x=ne?se:y.x,U.y=pe?Z:y.y,y.x=U.x,y.y=U.y,D.length>0)){const Ee=se-K,Ne=Z-L;for(const we of D)we.position={x:we.position.x-Ee+$[0]*(Q-M),y:we.position.y-Ne+$[1]*(re-O)},X.push(we)}if((H||ee)&&(U.width=H&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:y.width,U.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:y.height,y.width=U.width,y.height=U.height),N&&b.expandParent){const Ee=$[0]*(U.width??0);U.x&&U.x{j&&(w==null||w(z,{...y}),a==null||a({...y}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Np={exports:{}},Tp={},Dp={exports:{}},Rp={};/** * @license React * use-sync-external-store-shim.production.js * diff --git a/ui/dist/assets/index-FZ8l5lIQ.css b/ui/dist/assets/index-C5oJgTxI.css similarity index 81% rename from ui/dist/assets/index-FZ8l5lIQ.css rename to ui/dist/assets/index-C5oJgTxI.css index a4e1e681..4e6eab3a 100644 --- a/ui/dist/assets/index-FZ8l5lIQ.css +++ b/ui/dist/assets/index-C5oJgTxI.css @@ -1,4 +1,4 @@ -:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--fs-2xs: 10px;--fs-xs: 11px;--fs-sm: 12px;--fs-md: 13px;--fs-base: 14px;--fs-lg: 15px;--fs-xl: 16px;--fs-2xl: 18px;--fs-3xl: 22px;--fs-4xl: 28px;--fs-5xl: 34px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--fw-display: 700;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 10px;--radius-xl: 12px;--radius-full: 999px;--term-bg: #1a1a1a;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-sm);border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.wordmark{display:inline-flex;align-items:center;gap:.4em;color:var(--text)}.wordmark svg{width:1em;height:1em;flex-shrink:0}.home-brand{font-weight:var(--fw-display);font-size:var(--fs-4xl);letter-spacing:-.02em;margin-bottom:36px}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:var(--fs-2xl);letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:var(--radius-sm);color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.project-card .repo{color:var(--text)}.project-card .paper,.project-card .time{font-size:var(--fs-xs);color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:var(--fw-semibold);font-size:var(--fs-md);color:var(--text);padding:4px 6px 4px 0;border-radius:var(--radius-sm)}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:var(--fs-xs);font-weight:var(--fw-medium);line-height:1;padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--text)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:var(--fs-xs);border-radius:var(--radius-sm)}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text);white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:var(--fs-md);color:var(--text);border-radius:var(--radius-md);text-align:left}.rail-nav-item:hover{background:var(--surface)}.rail-nav-item.active{background:var(--panel);font-weight:var(--fw-semibold)}.rail-section-label{padding:10px 10px 6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--subtext)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:var(--radius-sm)}.rail-empty{padding:6px 10px;font-size:var(--fs-sm);color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0}.tab.active{background:var(--surface)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm)}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:var(--radius-md);font-size:var(--fs-md);color:var(--text);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface)}.session-row.active{background:var(--surface);font-weight:var(--fw-medium)}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:var(--fs-2xs);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:var(--radius-sm);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:var(--radius-sm);outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--text);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:var(--fs-5xl);font-weight:var(--fw-display);letter-spacing:-.02em;color:var(--text)}.chat-empty .chat-empty-hint{font-size:var(--fs-sm);color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:var(--fs-md);max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-full);padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:var(--fs-md);white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:var(--radius-xs);display:block}.msg-assistant{font-size:var(--fs-base);line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:var(--fs-sm);margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:var(--fw-semibold)}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:var(--fs-md);text-align:left;border-radius:var(--radius-sm)}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:var(--radius-sm)}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-md);color:var(--subtext)}.tool-open{flex-shrink:0;font-size:var(--fs-xs);color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--text);background:var(--surface);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:var(--fs-md);min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:var(--radius-sm);display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:var(--fw-semibold)}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:var(--radius-md);padding:8px 12px;overflow-x:auto;font-size:var(--fs-sm);color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--text);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:var(--fw-regular)}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm);opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:var(--fw-semibold);margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:var(--fs-md);margin:10px 0;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:var(--fw-medium);color:var(--text);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:var(--fs-md);transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--text);font-size:var(--fs-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:var(--fs-2xs);color:var(--muted)}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text);border-radius:var(--radius-sm);text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-md);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.runs-table th{text-align:left;color:var(--text);font-size:var(--fs-xs);font-weight:var(--fw-semibold);padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:var(--fs-sm)}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--radius-md);background:var(--canvas);border:1px solid var(--border);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--base);color:var(--subtext);font-size:var(--fs-md)}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:var(--fw-medium)}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:var(--fs-md)}.kv .k{color:var(--subtext)}.kv .v{font-family:var(--mono);font-size:var(--fs-sm);word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:var(--fs-sm);color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:var(--term-bg);padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:var(--fs-md);color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:var(--fs-sm);font-weight:var(--fw-semibold)}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-sm);border-radius:var(--radius-sm)}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:var(--fw-semibold)}.history-item .when{margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--subtext)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm)}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:var(--fs-sm);color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:var(--fs-md);line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:var(--fs-2xl);font-weight:var(--fw-regular);color:var(--text)}.empty-state p.empty-state-hint{font-size:var(--fs-lg);color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--muted);margin-bottom:14px}.onb-title{margin:0 0 6px;font-size:var(--fs-3xl);letter-spacing:-.01em}.onb-sub{color:var(--text);font-size:var(--fs-base);line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.onb-card-detail{font-size:var(--fs-sm)}.onb-card-meta{font-size:var(--fs-sm);color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:var(--fs-sm);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:3px 8px}.onb-gh-hint{font-size:var(--fs-sm);color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:var(--fs-xs)}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:var(--fs-sm)}.onb-token-form a{font-size:var(--fs-sm);color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:var(--fw-regular);font-size:var(--fs-xs);color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:var(--fs-md);font-weight:var(--fw-medium)}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:var(--fs-md);font-weight:var(--fw-semibold)}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:var(--fs-xs);color:var(--text);font-weight:var(--fw-medium)}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:var(--fs-xl)}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:4px 0}.settings-note{margin:10px 0 0;font-size:var(--fs-sm);padding:8px 10px;border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:var(--fw-medium)}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:var(--radius-full);transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:var(--fs-sm);color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-family:var(--sans);font-size:var(--fs-xs);font-weight:var(--fw-medium);padding:1px 7px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:var(--radius-sm);cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:var(--fs-md);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:var(--radius-xs);border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:var(--fs-md);line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:var(--fs-xs);color:var(--muted)}.report-md{font-size:var(--fs-lg)}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:var(--fs-sm);color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:var(--radius-md) var(--radius-md) 0 0}.diff-file-header .chev{color:var(--muted);font-size:var(--fs-2xs);flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:var(--fs-2xs);font-weight:var(--fw-medium);font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:var(--fs-md)}.truncated-notice{border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);padding:12px 14px;font-size:var(--fs-md)}.truncated-notice h4{margin:0 0 4px;font-size:var(--fs-md);color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:var(--fs-sm);line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:var(--fs-3xl)}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--text);font-size:var(--fs-md)}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:var(--fs-md);margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg)}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:var(--radius-lg)}.compute-row.open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:var(--radius-sm)}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:var(--fs-sm)}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:var(--fs-sm);color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:var(--fs-md);table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:var(--fs-md)}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:var(--fw-medium);color:var(--text)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-xs)}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text);padding:5px 8px;border-radius:var(--radius-sm)}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-sm);color:var(--text);padding:5px 4px;border-radius:var(--radius-sm)}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:var(--fw-regular)}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:var(--fs-md);outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-md);border-radius:var(--radius-sm)}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:var(--fs-2xs);color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:var(--fs-xs);color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:var(--fs-xs);color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:var(--radius-sm)}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-size:var(--fs-sm)}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:var(--fs-xs);color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--text);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:var(--fs-sm);line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:var(--fs-sm);color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:var(--fs-base)}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.prompt-head code{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text)}.prompt-sub{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-q{font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.prompt-plan{font-size:var(--fs-base);line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.prompt-option-desc{display:block;font-size:var(--fs-sm);font-weight:var(--fw-regular);line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid transparent;border-radius:var(--radius-sm);cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:var(--fs-md);margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:var(--fw-semibold);word-break:break-word}.prompt-outcome{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:var(--fs-md);color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:var(--fw-semibold)}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:var(--fs-md);cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:var(--radius-md);padding:9px 11px;font-size:var(--fs-md);font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text);font-size:var(--fs-md);cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:var(--fs-sm);padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:var(--fs-sm)}.code-tab-note{padding:8px 16px;font-size:var(--fs-sm);color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:var(--fs-md)}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:var(--radius-lg);box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:var(--radius-lg);border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:340px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:18px 20px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 24px 6px 0;font-size:var(--fs-base);font-weight:var(--fw-semibold)}.tour-card p{margin:0;font-size:var(--fs-md);line-height:1.5;color:var(--text)}.tour-card .tour-close{position:absolute;top:10px;right:10px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:14px;padding:10px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:var(--fs-xs);color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** +:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--fs-2xs: 10px;--fs-xs: 11px;--fs-sm: 12px;--fs-md: 13px;--fs-base: 14px;--fs-lg: 15px;--fs-xl: 16px;--fs-2xl: 18px;--fs-3xl: 22px;--fs-4xl: 28px;--fs-5xl: 34px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--fw-display: 700;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 10px;--radius-xl: 12px;--radius-full: 999px;--term-bg: #1a1a1a;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-sm);border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.wordmark{display:inline-flex;align-items:center;gap:.4em;color:var(--text)}.wordmark svg{width:1em;height:1em;flex-shrink:0}.home-brand{font-weight:var(--fw-display);font-size:var(--fs-4xl);letter-spacing:-.02em;margin-bottom:36px}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:var(--fs-2xl);letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:var(--radius-sm);color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.project-card .repo{color:var(--text)}.project-card .paper,.project-card .time{font-size:var(--fs-xs);color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:var(--fw-semibold);font-size:var(--fs-md);color:var(--text);padding:4px 6px 4px 0;border-radius:var(--radius-sm)}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:var(--fs-xs);font-weight:var(--fw-medium);line-height:1;padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--text)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:var(--fs-xs);border-radius:var(--radius-sm)}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text);white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:var(--fs-md);color:var(--text);border-radius:var(--radius-md);text-align:left}.rail-nav-item:hover{background:var(--surface)}.rail-nav-item.active{background:var(--panel);font-weight:var(--fw-semibold)}.rail-section-label{padding:10px 10px 6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--subtext)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:var(--radius-sm)}.rail-empty{padding:6px 10px;font-size:var(--fs-sm);color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0}.tab.active{background:var(--surface)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm)}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:var(--radius-md);font-size:var(--fs-md);color:var(--text);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface)}.session-row.active{background:var(--surface);font-weight:var(--fw-medium)}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:var(--fs-2xs);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:var(--radius-sm);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:var(--radius-sm);outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--text);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:var(--fs-5xl);font-weight:var(--fw-display);letter-spacing:-.02em;color:var(--text)}.chat-empty .chat-empty-hint{font-size:var(--fs-sm);color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:var(--fs-md);max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-full);padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:var(--fs-md);white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:var(--radius-xs);display:block}.msg-assistant{font-size:var(--fs-base);line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:var(--fs-sm);margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:var(--fw-semibold)}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:var(--fs-md);text-align:left;border-radius:var(--radius-sm)}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:var(--radius-sm)}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-md);color:var(--subtext)}.tool-open{flex-shrink:0;font-size:var(--fs-xs);color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--text);background:var(--surface);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:var(--fs-md);min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:var(--radius-sm);display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:var(--fw-semibold)}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:var(--radius-md);padding:8px 12px;overflow-x:auto;font-size:var(--fs-sm);color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--text);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:var(--fw-regular)}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm);opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:var(--fw-semibold);margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:var(--fs-md);margin:10px 0;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:var(--fw-medium);color:var(--text);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:var(--fs-md);transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--text);font-size:var(--fs-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:var(--fs-2xs);color:var(--muted)}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text);border-radius:var(--radius-sm);text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-md);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.runs-table th{text-align:left;color:var(--text);font-size:var(--fs-xs);font-weight:var(--fw-semibold);padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:var(--fs-sm)}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--radius-md);background:var(--canvas);border:1px solid var(--border);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--base);color:var(--subtext);font-size:var(--fs-md)}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:var(--fw-medium)}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:var(--fs-md)}.kv .k{color:var(--subtext)}.kv .v{font-family:var(--mono);font-size:var(--fs-sm);word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:var(--fs-sm);color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:var(--term-bg);padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:var(--fs-md);color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:var(--fs-sm);font-weight:var(--fw-semibold)}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-sm);border-radius:var(--radius-sm)}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:var(--fw-semibold)}.history-item .when{margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--subtext)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm)}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:var(--fs-sm);color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:var(--fs-md);line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:var(--fs-2xl);font-weight:var(--fw-regular);color:var(--text)}.empty-state p.empty-state-hint{font-size:var(--fs-lg);color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--muted);margin-bottom:14px}.onb-title{margin:0 0 6px;font-size:var(--fs-3xl);letter-spacing:-.01em}.onb-sub{color:var(--text);font-size:var(--fs-base);line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.onb-card-detail{font-size:var(--fs-sm)}.onb-card-meta{font-size:var(--fs-sm);color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:var(--fs-sm);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:3px 8px}.onb-gh-hint{font-size:var(--fs-sm);color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:var(--fs-xs)}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:var(--fs-sm)}.onb-token-form a{font-size:var(--fs-sm);color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:var(--fw-regular);font-size:var(--fs-xs);color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:var(--fs-md);font-weight:var(--fw-medium)}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:var(--fs-md);font-weight:var(--fw-semibold)}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:var(--fs-xs);color:var(--text);font-weight:var(--fw-medium)}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:var(--fs-xl)}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:4px 0}.settings-note{margin:10px 0 0;font-size:var(--fs-sm);padding:8px 10px;border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:var(--fw-medium)}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:var(--radius-full);transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:var(--fs-sm);color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-family:var(--sans);font-size:var(--fs-xs);font-weight:var(--fw-medium);padding:1px 7px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:var(--radius-sm);cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:var(--fs-md);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:var(--radius-xs);border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:var(--fs-md);line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:var(--fs-xs);color:var(--muted)}.report-md{font-size:var(--fs-lg)}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:var(--fs-sm);color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:var(--radius-md) var(--radius-md) 0 0}.diff-file-header .chev{color:var(--muted);font-size:var(--fs-2xs);flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:var(--fs-2xs);font-weight:var(--fw-medium);font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:var(--fs-md)}.truncated-notice{border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);padding:12px 14px;font-size:var(--fs-md)}.truncated-notice h4{margin:0 0 4px;font-size:var(--fs-md);color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:var(--fs-sm);line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:var(--fs-3xl)}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--text);font-size:var(--fs-md)}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:var(--fs-md);margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg)}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:var(--radius-lg)}.compute-row.open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:var(--radius-sm)}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:var(--fs-sm)}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:var(--fs-sm);color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:var(--fs-md);table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:var(--fs-md)}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:var(--fw-medium);color:var(--text)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-xs)}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text);padding:5px 8px;border-radius:var(--radius-sm)}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-sm);color:var(--text);padding:5px 4px;border-radius:var(--radius-sm)}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:var(--fw-regular)}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:var(--fs-md);outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-md);border-radius:var(--radius-sm)}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:var(--fs-2xs);color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:var(--fs-xs);color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:var(--fs-xs);color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:var(--radius-sm)}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-size:var(--fs-sm)}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:var(--fs-xs);color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--text);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:var(--fs-sm);line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:var(--fs-sm);color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:var(--fs-base)}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.prompt-head code{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text)}.prompt-sub{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-q{font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.prompt-plan{font-size:var(--fs-base);line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.prompt-option-desc{display:block;font-size:var(--fs-sm);font-weight:var(--fw-regular);line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid transparent;border-radius:var(--radius-sm);cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:var(--fs-md);margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:var(--fw-semibold);word-break:break-word}.prompt-outcome{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:var(--fs-md);color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:var(--fw-semibold)}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:var(--fs-md);cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:var(--radius-md);padding:9px 11px;font-size:var(--fs-md);font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text);font-size:var(--fs-md);cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:var(--fs-sm);padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:var(--fs-sm)}.code-tab-note{padding:8px 16px;font-size:var(--fs-sm);color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:var(--fs-md)}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:var(--radius-lg);box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:var(--radius-lg);border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:390px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:21px 23px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 26px 7px 0;font-size:var(--fs-lg);font-weight:var(--fw-semibold)}.tour-card p{margin:0;font-size:var(--fs-base);line-height:1.55;color:var(--text)}.tour-card .tour-close{position:absolute;top:12px;right:12px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:16px;padding:11px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:var(--fs-sm);color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** * Copyright (c) 2014 The xterm.js authors. All rights reserved. * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) * https://github.com/chjj/term.js diff --git a/ui/dist/index.html b/ui/dist/index.html index 811b284d..b0246cb8 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -9,8 +9,8 @@ html { background: #ffffff; } @media (prefers-color-scheme: dark) { html { background: #0e0c0c; } } - - + +
diff --git a/ui/src/components/Tour.tsx b/ui/src/components/Tour.tsx index 024cf095..144a59c8 100644 --- a/ui/src/components/Tour.tsx +++ b/ui/src/components/Tour.tsx @@ -32,16 +32,16 @@ const STEPS: TourStep[] = [ anchor: null, title: "Welcome to OpenResearch", description: - "This is your research workspace: agents on the left, conversation in the middle, " + - "experiments on the right. Here's a quick look around — about thirty seconds.", + "OpenResearch is your home for autoresearch. Spawn and coordinate research agents " + + "in one workspace.", }, { focus: ["composer"], anchor: "above", title: "Talk to your research agent", description: - "This is how you communicate with research agents: describe the experiment you want, " + - "and the agent plans it, writes the code, and runs it. Type / for skills like " + + "Prompt your research agents to replicate a paper, create a baseline experiment, " + + "run an eval, or investigate any research question. Type / for skills like " + "/reproduce-paper.", }, { @@ -49,15 +49,15 @@ const STEPS: TourStep[] = [ anchor: "above", title: "Pick your model", description: - "Choose a model from any harness you've connected — Claude Code, Codex, or OpenCode. " + - "New sessions start with whatever you pick here; each session keeps its harness for life.", + "Choose a model from any harness you've connected: Claude Code, Codex, or OpenCode. " + + "New sessions start with whatever you pick here, and each session keeps its harness.", }, { focus: ["nav-files"], anchor: "right", title: "Reports and outputs", description: - "The agent writes its reports, figures, and other outputs here — and anything you drop " + + "The agent writes its reports, figures, and other outputs here, and anything you drop " + "in is visible to it too. Check Files after a run to see what came back.", }, { @@ -66,14 +66,14 @@ const STEPS: TourStep[] = [ title: "Configure compute", description: "This is where compute is configured. Point runs at this machine, Modal, SSH boxes, " + - "Kubernetes, or Slurm — set it up once and agents pick the right hardware per run.", + "Kubernetes, or Slurm. Set it up once and agents pick the right hardware per run.", }, { focus: ["experiments"], anchor: "left", title: "Follow every experiment", description: - "Runs land here as a tree of experiments — branch variants off a baseline, compare " + + "Runs land here as a tree of experiments. Branch variants off a baseline, compare " + "results, and open any run's terminal or code changes in a tab.", }, { @@ -81,9 +81,8 @@ const STEPS: TourStep[] = [ anchor: "right", title: "Start a session", description: - "Each session is its own agent working in its own branch, so you can run several lines " + - "of inquiry in parallel. That's the tour — ask for your first experiment whenever " + - "you're ready.", + "Each session is its own agent working in its own worktree, so you can run several " + + "agents in parallel. Ask for your first experiment whenever you're ready.", }, ]; @@ -196,7 +195,7 @@ function TourCard({
{index > 0 && ( - )} @@ -205,7 +204,7 @@ function TourCard({ {index + 1} / {STEPS.length}
-
diff --git a/ui/src/styles.css b/ui/src/styles.css index 45661418..8e19ff97 100644 --- a/ui/src/styles.css +++ b/ui/src/styles.css @@ -4146,13 +4146,13 @@ a.files-pill:hover { } .tour-card { position: absolute; - width: 340px; + width: 390px; max-width: calc(100vw - 32px); background: var(--base); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22); - padding: 18px 20px 0; + padding: 21px 23px 0; transition: left 200ms ease, top 200ms ease; @@ -4164,27 +4164,27 @@ a.files-pill:hover { transition: none; } .tour-card h3 { - margin: 0 24px 6px 0; - font-size: var(--fs-base); + margin: 0 26px 7px 0; + font-size: var(--fs-lg); font-weight: var(--fw-semibold); } .tour-card p { margin: 0; - font-size: var(--fs-md); - line-height: 1.5; + font-size: var(--fs-base); + line-height: 1.55; color: var(--text); } .tour-card .tour-close { position: absolute; - top: 10px; - right: 10px; + top: 12px; + right: 12px; } .tour-footer { display: flex; align-items: center; border-top: 1px solid var(--border-variant); - margin-top: 14px; - padding: 10px 0; + margin-top: 16px; + padding: 11px 0; } .tour-footer-side { flex: 1; @@ -4194,7 +4194,7 @@ a.files-pill:hover { justify-content: flex-end; } .tour-count { - font-size: var(--fs-xs); + font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }