@fabiofiorita/porcelain 0.88.2 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-editor-MXkoMjoi.js","assets/rolldown-runtime-XKyaHtl9.js","assets/access-B1ddZlps.js","assets/sides-711aNttp.js","assets/preload-helper-7y9sWmk5.js","assets/announce-Cs-wr5G8.js","assets/edit-file-D4o1bywx.js","assets/hastToHtml-CpdMSaFQ.js","assets/unwrapDefault-ByDmBtHB.js","assets/lib-BKZ5ZaMU.js","assets/constants-CmGPilXJ.js","assets/formatCSSVariablePrefix-KRh9vnZf.js","assets/utils-C9Glzetk.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,$n as n,$r as r,$s as i,$t as a,$u as o,A as s,Aa as c,Ac as l,Ad as u,Ai as d,Al as f,An as p,Ao as m,At as h,Au as g,B as _,Ba as v,Bd as y,Bi as b,Bl as x,Bn as S,Bo as C,Br as w,Bs as T,Bt as E,Bu as D,C as O,Ca as k,Cc as A,Cd as j,Cl as M,Cn as N,Co as P,Cr as F,Cs as I,Cu as L,D as R,Da as z,Dc as B,Dd as V,Di as H,Dl as U,Dn as W,Do as G,Dr as K,Ds as q,Du as ee,E as J,Ea as te,Ed as ne,Ei as re,El as ie,En as ae,Eo as oe,Es as se,Et as ce,F as le,Fa as ue,Fd as de,Fi as fe,Fl as pe,Fn as me,Fo as he,Fr as ge,Fs as _e,Gi as ve,Gn as ye,Go as be,Gr as xe,Gt as Se,Gu as Ce,H as we,Ha as Te,Hd as Ee,Hi as De,Hl as Oe,Hn as ke,Ho as Ae,Hs as je,Ht as Me,I as Ne,Ia as Pe,Id as Fe,Ii as Ie,Il as Le,In as Re,Is as ze,It as Be,Iu as Ve,J as He,Ja as Ue,Jc as We,Ji as Ge,Jl as Ke,Jn as qe,Jo as Je,Jr as Ye,Js as Xe,Jt as Ze,Ju as Qe,Ka as $e,Ki as et,Kl as tt,Kn as nt,Ko as rt,Kr as it,Ks as at,Kt as ot,Ku as st,L as ct,La as lt,Li as ut,Ll as dt,Ln as ft,Lo as pt,Lr as mt,Ls as ht,Lt as gt,Lu as _t,M as vt,Ma as yt,Md as bt,Mi as xt,Mn as St,Mo as Ct,Mr as wt,Mu as Tt,N as Et,Na as Dt,Nc as Ot,Nd as kt,Ni as At,Nl as jt,Nn as Mt,No as Nt,Nr as Pt,Nu as Ft,O as It,Oc as Lt,Od as Rt,Oi as zt,On as Bt,Oo as Y,Or as Vt,Os as Ht,Ou as Ut,P as Wt,Pa as Gt,Pd as Kt,Pi as qt,Pl as Jt,Pn as Yt,Po as Xt,Pt as Zt,Pu as Qt,Q as $t,Qa as en,Qc as tn,Qi as nn,Ql as rn,Qn as an,Qo as on,Qr as sn,Qs as cn,Qt as ln,Qu as un,R as dn,Rd as fn,Ri as pn,Rl as mn,Rn as hn,Ro as gn,Rr as _n,Rt as vn,Ru as yn,S as bn,Sa as xn,Sc as Sn,Sd as Cn,Si as wn,Sl as Tn,Sn as En,So as Dn,Ss as On,St as kn,Su as An,Ta as jn,Td as Mn,Ti as Nn,Tl as Pn,Tn as Fn,To as X,Ts as In,Tu as Ln,U as Rn,Ua as zn,Ud as Bn,Ui as Vn,Ul as Hn,Un,Uo as Wn,Ur as Gn,Us as Kn,Ut as qn,Uu as Jn,V as Yn,Va as Xn,Vd as Zn,Vi as Qn,Vl as $n,Vn as er,Vo as tr,Vr as nr,Vs as rr,Vt as ir,Vu as ar,Wc as or,Wi as sr,Wl as cr,Wn as lr,Wo as ur,Wr as dr,Wt as fr,Wu as pr,X as mr,Xi as hr,Xl as gr,Xn as _r,Xr as vr,Xs as yr,Xt as br,Xu as xr,Y as Sr,Ya as Cr,Yc as wr,Yi as Tr,Yn as Er,Yo as Dr,Yr as Or,Ys as kr,Yt as Ar,Yu as jr,Z as Mr,Za as Nr,Zi as Pr,Zl as Fr,Zn as Ir,Zr as Lr,Zs as Rr,Zt as zr,Zu as Br,_ as Vr,_d as Hr,_i as Ur,_l as Wr,_o as Gr,_r as Kr,_u as qr,a as Jr,ac as Yr,ad as Xr,ai as Zr,al as Qr,as as $r,at as ei,au as ti,b as ni,ba as ri,bd as ii,bi as ai,bl as oi,bn as si,bo as ci,br as li,bs as ui,bt as di,bu as fi,c as pi,cc as mi,cd as hi,ci as gi,cl as _i,cr as vi,cs as yi,ct as bi,cu as xi,d as Si,dc as Ci,dd as wi,di as Ti,dl as Ei,dn as Di,do as Oi,dr as ki,ds as Ai,dt as ji,du as Mi,ed as Ni,ei as Pi,el as Fi,en as Ii,er as Li,es as Ri,et as zi,eu as Bi,f as Vi,fc as Hi,fd as Ui,fi as Wi,fl as Gi,fn as Ki,fo as qi,fr as Ji,ft as Yi,fu as Xi,g as Zi,gc as Qi,gd as $i,gi as ea,gl as ta,gn as na,go as ra,gr as ia,gu as aa,h as oa,hc as sa,hd as ca,hi as la,hl as ua,ho as da,hr as fa,ht as pa,hu as ma,i as ha,ic as ga,id as _a,ii as va,il as ya,in as ba,io as xa,ir as Sa,is as Ca,it as wa,iu as Ta,j as Ea,jc as Da,jd as Oa,ji as ka,jl as Aa,jn as ja,jo as Ma,js as Na,ju as Pa,k as Fa,ka as Ia,kc as La,kd as Ra,ki as za,kl as Ba,kn as Va,ko as Ha,kr as Ua,ks as Wa,kt as Ga,ku as Ka,lc as qa,ld as Ja,lo as Ya,lr as Xa,ls as Za,lt as Qa,m as $a,mc as eo,md as to,mi as no,ml as ro,mn as io,mo as ao,mr as oo,ms as so,mt as co,mu as lo,n as uo,nc as fo,nd as po,ni as mo,nl as ho,ns as go,nt as _o,nu as vo,o as yo,oc as bo,od as xo,oi as So,ol as Co,on as wo,oo as To,or as Eo,os as Do,ot as Oo,ou as ko,p as Ao,pc as jo,pd as Mo,pi as No,pl as Po,pn as Fo,po as Io,pr as Lo,ps as Ro,pt as zo,pu as Bo,q as Vo,qa as Ho,qi as Uo,ql as Wo,qn as Go,qo as Ko,qr as qo,qs as Jo,qt as Yo,qu as Xo,r as Zo,rc as Qo,rd as $o,ri as es,rl as ts,rn as ns,ro as rs,rs as is,rt as as,ru as os,s as ss,sc as cs,sd as ls,si as us,sl as ds,sr as fs,ss as ps,su as ms,t as hs,tc as gs,td as _s,ti as vs,to as ys,tr as bs,ts as xs,tt as Ss,tu as Cs,u as ws,uc as Ts,ud as Es,ui as Ds,ul as Os,uo as ks,ur as As,us as js,ut as Ms,uu as Ns,v as Ps,va as Fs,vc as Is,vd as Ls,vi as Rs,vn as zs,vo as Bs,vr as Vs,vu as Hs,w as Us,wa as Ws,wc as Gs,wd as Ks,wi as qs,wl as Js,wn as Ys,wo as Xs,ws as Zs,wt as Qs,wu as $s,x as ec,xa as tc,xc as nc,xd as rc,xi as ic,xl as ac,xn as oc,xo as sc,xt as cc,xu as lc,y as uc,ya as dc,yd as fc,yi as pc,yl as mc,yn as hc,yo as gc,yr as _c,ys as vc,yu as yc,z as bc,za as xc,zd as Sc,zi as Cc,zl as wc,zn as Tc,zo as Ec,zr as Dc,zs as Oc,zt as kc,zu as Ac}from"./access-B1ddZlps.js";import{a as jc,c as Mc,i as Nc,n as Pc,o as Fc}from"./useNavigate-BZWuXWB6.js";import{$n as Ic,$r as Lc,$t as Rc,A as zc,An as Bc,Ar as Vc,At as Hc,B as Uc,Br as Wc,Bt as Gc,C as Kc,Cn as qc,Cr as Jc,Ct as Yc,D as Xc,Dn as Zc,Dr as Qc,Dt as $c,E as el,En as tl,Et as nl,F as rl,Fr as il,Ft as al,G as ol,Gn as sl,Gr as cl,Gt as ll,H as ul,Hr as dl,Ht as fl,I as pl,Ir as ml,It as hl,J as gl,Jn as _l,Jr as vl,Jt as yl,K as bl,Kn as xl,Kr as Sl,Kt as Cl,Lr as wl,Lt as Tl,M as El,Mr as Dl,Nr as Ol,O as kl,On as Al,Or as jl,Ot as Ml,P as Nl,Pr as Pl,Pt as Fl,Qn as Il,Qr as Ll,Qt as Rl,Rr as zl,Rt as Bl,S as Vl,Sn as Hl,Sr as Ul,St as Wl,T as Gl,Tn as Kl,Tr as ql,Tt as Jl,U as Yl,Un as Xl,Ur as Zl,Ut as Ql,V as $l,Vr as eu,Vt as tu,W as nu,Wn as ru,Wr as iu,Wt as au,X as ou,Xn as su,Xr as cu,Xt as lu,Yn as uu,Yr as du,Yt as fu,Zn as pu,Zr as mu,Zt as hu,_ as gu,_i as _u,_n as vu,_r as yu,_t as bu,a as xu,ai as Su,an as Cu,ar as wu,at as Tu,bn as Eu,br as Du,bt as Ou,c as ku,ci as Au,cr as ju,ct as Mu,d as Nu,di as Pu,dn as Fu,dr as Iu,dt as Lu,ei as Ru,er as zu,et as Bu,f as Vu,fi as Hu,fn as Uu,fr as Wu,ft as Gu,g as Ku,gn as qu,gr as Ju,h as Yu,hn as Xu,hr as Zu,ht as Qu,i as $u,ii as ed,in as td,ir as nd,it as rd,j as id,jr as ad,jt as od,k as sd,kn as cd,kt as ld,l as ud,li as dd,ln as fd,lr as pd,lt as md,m as hd,mn as gd,mr as _d,mt as vd,n as yd,ni as bd,nn as xd,nr as Sd,nt as Cd,o as wd,oi as Td,on as Ed,or as Dd,ot as Od,p as kd,pi as Ad,pn as jd,pr as Md,pt as Nd,q as Pd,qn as Fd,qr as Id,qt as Ld,r as Rd,ri as zd,rn as Bd,rr as Vd,rt as Hd,s as Ud,si as Wd,sn as Gd,sr as Kd,st as qd,ti as Jd,tr as Yd,tt as Xd,u as Zd,ui as Qd,un as $d,ur as ef,ut as tf,v as nf,vn as rf,vr as af,vt as of,w as sf,wn as cf,wr as lf,wt as uf,xn as df,xr as ff,xt as pf,yn as mf,yr as hf,yt as gf,zr as _f,zt as vf}from"./edit-file-D4o1bywx.js";import{a as yf,c as bf,d as xf,f as Sf,g as Cf,l as wf,m as Tf,p as Ef,r as Df,s as Of,v as kf}from"./sides-711aNttp.js";import{t as Af}from"./preload-helper-7y9sWmk5.js";import{a as jf,c as Mf,d as Nf,i as Pf,l as Ff,m as If,n as Lf,o as Rf,r as zf,s as Bf,t as Vf,u as Hf,v as Uf}from"./hastToHtml-CpdMSaFQ.js";import{r as Wf}from"./constants-CmGPilXJ.js";import{t as Gf}from"./resolveLanguages-CK0v50mm.js";function Kf(e){return e?.isNotFound===!0}function qf(){try{return sessionStorage}catch{return}}var Jf=`tsr-scroll-restoration-v1_3`,Yf=qf();function Xf(){try{return JSON.parse(Yf?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Zf(){try{Yf?.setItem(Jf,JSON.stringify(Qf))}catch{}}var Qf=Xf(),$f=`data-scroll-restoration-id`,ep=e=>e.state.__TSR_key||e.href;function tp(e){let t=e.getAttribute($f);if(t)return`[${$f}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var np=!1,rp=`window`;function ip(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ap(e){let t=new Set;for(let n of e){if(n===rp)continue;let e=ip(n);e&&t.add(e)}return t}function op(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ep,a=new Set,o=e=>{let t=Qf[e]||={};for(let e of a)e===document?t[rp]={scrollX,scrollY}:e.isConnected&&(t[tp(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,np=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{np||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Zf()})),r.reset||(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Qf[d];if(e){let t=Qf[u];for(let n in e){if(n===rp){if(s)continue}else{let e=ip(n);if(!e||s&&o&&(l??=ap(o),l.has(e)))continue}t||=Qf[u]={},t[n]??=e[n]}}}np=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=ap(o));let t=e&&i&&c,s=r.restoring?Qf[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===rp){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=ip(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{np=!1}}))}function sp(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function cp(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function lp(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=cp(r):Array.isArray(t)?t.push(cp(r)):n[e]=[t,cp(r)]}return n}var up=/^(?:\s|["[{\d-]|fa|nu|tr)/,dp=pp(JSON.parse),fp=mp(JSON.stringify,JSON.parse);function pp(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=lp(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!up.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function mp(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!up.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=sp(e,r);return t?`?${t}`:``}}function hp(e){return{input:({url:t})=>{for(let n of e)t=_p(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=vp(e[n],t);return t}}}function gp(e){let t=_i(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Co([`/`,t,e.pathname]),e)}}function _p(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function vp(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function yp(e){let t=e;return{get(){return t},set(e){t=Js(e,t)}}}function bp(e){return{get(){return e()}}}function xp(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{oi(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Sp=`__TSR_index`,Cp=`popstate`,wp=`beforeunload`;function Tp(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=kp(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Sp];i=Ep(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Sp];i=Ep(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Sp]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ep(e,t){t||={};let n=Ap();return{...t,key:n,__TSR_key:n,[Sp]:e}}function Dp(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>kp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ap();t.history.replaceState({[Sp]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=kp(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[Sp]-l.state[Sp],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Tp({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(wp,x,{capture:!0}),t.removeEventListener(Cp,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(wp,x,{capture:!0}),t.addEventListener(Cp,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Op(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function kp(e,t){let n=Op(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ap();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Sp]:0,key:a,__TSR_key:a}}}function Ap(){return(Math.random()+1).toString(36).substring(7)}function jp(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Mp(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Np({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Pp(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Fp(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Ip=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ya(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dp()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Wr(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=xp(this.latestLocation,e),op(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=_i(a);t&&t!==`/`&&e.push(gp({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:hp(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ta(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ua(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ac(e).path,external:!1,searchStr:o,search:f(t?.search,i),hash:ac(r.slice(1)).path,state:Aa(t?.state,a)}}let o=new URL(i,this.origin),s=_p(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ac(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:f(t?.search,c),hash:ac(s.hash.slice(1)).path,state:Aa(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ds({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Po(Os(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=kp(t.href,{});t={...t,to:_p(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n),i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Hp(t.params,o),l=this.routesByPath[Os(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Pn(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:ac(Qr({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,zp(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Bp(p,t,u,e._includeValidateSearch),p=f(a,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?Js(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?Js(t.state,n.state):{};t.state&&(_=Aa(n.state,_));let v=`${d}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=vp(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=M(v),b=y;return{publicHref:b,href:y,pathname:d,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=Gi(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Hp(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Os(this.latestLocation.href)===Os(n.href)&&Tn(Np(n.state),Np(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!!n&&ie(`${n}`);if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(U(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t}else return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Nm(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Mp(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&jp(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&U(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Kp,this.preloadRoute=e=>Pm(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=ro(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Tn(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Tn(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??fp,parseSearch:e.parseSearch??dp,protocolAllowlist:e.protocolAllowlist??mc}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ei(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Os(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Vp(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=zp(i.options.validateSearch,{...n})??void 0;l={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Lp||(r=new Lp(e.message,{cause:e})),t?.throwOnError)throw r;l=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:l})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=Qr({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=u(i,n),x=this._cache.get(y)??(b?.id===y?b:void 0);d=x?._strictParams??Object.assign(v,d);let S;if(!x)try{Up(i,d)}catch(e){if(S=Kf(e)||Fc(e)?e:new Rp(e.message,{cause:e}),t?.throwOnError)throw S}let C=b?`stay`:`enter`,w;if(x)w={...x,cause:C,search:f(b?b.search:x.search,l),_strictSearch:p,searchError:m};else{let e=jp(i)?`pending`:`success`;w={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:b?f(b.search,l):l,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:S,context:{},abortController:t?._controller??new AbortController,cause:C,loaderDeps:b?Aa(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let T=s===i.id;w._notFound&&!T&&(w.error=void 0),w._notFound=T,c[n]=w}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?f(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=Ba(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=Ba(a),c={...e.search};for(let e of a)try{Object.assign(c,zp(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{Up(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Lp=class extends Error{},Rp=class extends Error{};function zp(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Lp(`Async validation not supported`);if(n.issues)throw new Lp(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Bp(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=zp(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Js(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Vp(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Mc}function Hp(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Js(e,n))}function Up(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Wp(e,t){return e.options[t]?.preload?.()}function Gp(e,t){let n=Wp(e,`component`),r=Wp(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Kp(e,t,n){let r=()=>t===!1?void 0:t?Wp(e,t):Gp(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function qp(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Jp=0,Yp=1,Xp=2,Zp=3,Qp=[4];function $p(e){return typeof e[0]==`number`}function em(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function tm(e,t){return e.routesById[t.routeId]}function nm(e,t,n){return Fc(e)?[Zp,e]:Kf(e)?(e.routeId||=n,[Xp,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Yp,e]):[Jp,e]}function rm(e,t){let n=nm(t,!0,e.id);if(n[0]!==Yp)return n;try{e.options.onError?.(n[1])}catch(t){n=nm(t,!0,e.id)}return n}function im(e,t,n,r,i){return i[0].signal.aborted?Qp:bm(e,t,n,rm(n,r),i)}async function am(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=tm(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return sm(e,r),[i,im(e,t,u,a,n)]}if(c.aborted)return[i,Qp];let p=r.paramsError??r.searchError;if(p!==void 0)return sm(e,r),[i,im(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{um(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?em(a,c):a);if(c.aborted)return[i,Qp];let s=bm(e,t,u,nm(o,!1,u.id),n);if(s[0]!==Jp)return sm(e,r),[i,s];r.context={...r.context,...o}}catch(a){return sm(e,r),[i,im(e,t,u,a,n)]}finally{r.status=h,um(e,r,!1,n[0])}}i()}function om(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function sm(e,t){let n=t._flight;t._flight=void 0,om(e,t,n)?.abort()}function cm(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=om(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function lm(e){for(let t of e){let e=t._flight;e&&e[2]++}}function um(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function dm(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function fm(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Qp;if(!i)return[Jp,void 0];let l=n._flight;um(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(dm(e,t,n,r,s,a,!!o[3]))).then(e=>nm(e,!1,r.id),e=>nm(e,!0,r.id)).then(t=>(t[0]!==Jp&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Yp&&l[2]?rm(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],bm(e,t,r,await em(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return sm(e,n),Qp}finally{um(e,n,!1,s)}}function pm(e,t,n){t[0]!==Zp&&(e.status=`success`,e.error=void 0,t[0]===Jp?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function mm(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&sm(e,r)}function hm(e,t){return t[0]===Yp||t[0]===Xp?{...e,status:t[0]===Yp?`error`:`notFound`,error:t[1],_flight:void 0}:e}function gm(e,t,n,r,i,a,o){let s=t[1][n],c=tm(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(dm(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Qp)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,sm(e,s),p=im(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,om(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?fm(e,t,s,c,g,i,a).then(t=>(pm(s,t,l),t[0]===Jp&&(m&&!a[0].signal.aborted&&mm(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Jp,s.loaderData]),T=(async()=>{try{let e=Kp(c,void 0,C);e&&await em(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,im(e,t,c,r,a)]}let r=await w;x&&r[0]===Jp&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>hm(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=fm(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,pm(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>hm(E,e))}async function _m(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=tm(e,t[n]);try{let e=Kp(i,!1);e&&await em(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function vm(e,t){t[2]&&=(cm(e,t[2].map(e=>e[3])),void 0)}async function ym(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Zp)throw[a,t];!i&&t[0]!==Jp&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Zp)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function bm(e,t,n,r,i,a){for(;r[0]===Zp;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Zp,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Yp,e]:rm(n,e),a=!0}}return r}async function xm(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Xp?_m(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Zp)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Jp&&t[0]<Zp&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Zp){let n=s[1];if(n[0]!==Zp||n[1].options.reloadDocument||n[2])return vm(e,t),n;c=!0,s=[0,[Yp,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Yp?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=tm(e,u);try{await em(i?Promise.resolve().then(()=>Kp(m,l===Yp?`errorComponent`:`notFoundComponent`)):Promise.all([Kp(m),Kp(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return vm(e,t),Qp}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),vm(e,t),cm(e,o),p()):u.status=`success`}return t}async function Sm(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=tm(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await em(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Cm(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await _m(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=gm(e,i,t,u,f,r,l)},m=await am(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Xp){let t=await _m(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Zp&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=xm(e,i,u,r[0],ym(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=ym(i[2],void 0,void 0,h.then(e=>$p(e)?0:qp(n).length,()=>0))),o=await h}catch(t){if(vm(e,i),t===a&&a.aborted)return Qp;throw t}return $p(o)?o:Sm(e,o,a,r[6]===n.length?r[6]:0)}function wm(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=tm(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>wm(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Tm(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function Em(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!qp(t[3]).some(e=>e.id===n[1]))return;let i;try{await em(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Dm(e,t){e._committed=t,e.stores.setMatches(t)}function Om(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=qp(n).length,c=new Map;{let t=Date.now();for(let r of[...i,...o.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<s||e.status===`success`)))continue;let i=tm(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(r.id,o.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Pp(n);Dm(e,n),cm(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Fp(e,i,n,a,l,t)}async function km(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Am(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function jm(e,t,n,r,i){let a=n.map(e=>({...e}));lm(a);for(let t of r)sm(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await xm(e,o,r,t[0],i)}catch(t){throw cm(e,a),t}if($p(s))cm(e,a),s[0]===Zp&&e._tx===t&&e._committed===n&&await Am(e,t,s);else if(await Sm(e,s,t[0].signal),e._tx!==t||e._committed!==n)cm(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),sm(e,n))}Dm(e,a),cm(e,n,a)}}async function Mm(e,t,n,r,i,a){let o=await Cm(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if($p(o)){let n=o[0]===Zp&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Tm(e,t),cm(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Tm(e,t);return}await Am(e,t,o);return}let s=o[1];if(e._tx===t&&await Em(e,t),e._tx!==t){Tm(e,t),cm(e,s),vm(e,o);return}let c=t[2],l=Mp(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Em(e,t),e._tx!==t){Tm(e,t),cm(e,s),vm(e,o);return}let n=await e.startTransition(()=>{Tm(e,t),Om(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&jm(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):vm(e,o)})}async function Nm(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Mp(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await km(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});lm(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){cm(e,m),await km(e,n);return}e._preflight=void 0;let g,_=()=>Mm(e,y,f,()=>wm(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>km(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&um(e,t,!1)}n[0].abort(),cm(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&wm(e,y),g?.(_()),await y[5]):(cm(e,y[3]),y[3]=[],g?.(),await km(e,y))}async function Pm(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),lm(a),o=(e._preloads??=new Map).set(i,a),s=await Cm(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),cm(e,a)),i.abort()}if(!$p(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Kf(e)||console.error(e);return}}}var Z=e(Jt(),1),Q=ts(),Fm=class extends Z.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?Z.createElement(this.props.errorComponent??Im,{error:e[0],reset:this.reset}):this.props.children}};function Im({error:e}){let[t,n]=Z.useState(!1);return(0,Q.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Q.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Q.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Q.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,Q.jsx)(`code`,{children:e.message}):null})}):null]})}function Lm(e){let t=Fi(),n=`not-found-${tn(t.stores.location,e=>e.pathname)}-${tn(t.stores.status,e=>e)}`;return(0,Q.jsx)(Fm,{getResetKey:()=>n,onCatch:(t,n)=>{if(Kf(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Kf(t))return e.fallback?.(t);throw t},children:e.children})}function Rm(){return(0,Q.jsx)(`p`,{children:`Not Found`})}function zm(e){return(0,Q.jsx)(Q.Fragment,{children:e.children})}function Bm(e,t,n){return t.options.notFoundComponent?(0,Q.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Q.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Q.jsx)(Rm,{})}function Vm(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,Q.jsx)(n,{}):null}var Hm=(e,t)=>e[0]===t[0]&&e[1]===t[1],Um=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Wm=Z.memo(function({routeId:e}){let t=Fi();return(0,Q.jsx)(Gm,{router:t,match:tn(t.stores.getMatchStore(e),e=>e)})});function Gm({router:e,match:t}){let n=e.routesById[t.routeId],r=Vm(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Um(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?Z.Suspense:zm,l=i?Fm:zm,u=o?Lm:zm;return(0,Q.jsxs)(n.isRoot?n.options.shellComponent??zm:zm,{children:[(0,Q.jsx)(jc.Provider,{value:t.routeId,children:(0,Q.jsx)(c,{fallback:r,children:(0,Q.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Kf(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,Q.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return Z.createElement(o,e)},children:s?(0,Q.jsx)(ho,{fallback:r,children:(0,Q.jsx)(Km,{match:t})}):(0,Q.jsx)(Km,{match:t})})})})}),null]})}var Km=Z.memo(function({match:e}){let t=Fi(),n=e.routeId,r=t.routesById[n],i=Z.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=Z.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,Q.jsx)(e,{},i):(0,Q.jsx)(qm,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Um(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Vm(t,r)}if(e.status===`notFound`)return Bm(t,r,e.error);if(e.status===`error`)throw e.error;return a}),qm=Z.memo(function(){let e=Fi(),t=Z.useContext(jc),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=tn(a,e=>[!!e._notFound,e.error],Hm),i=tn(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Bm(e,e.routesById[t],r);if(!i)return null;let a=(0,Q.jsx)(Wm,{routeId:i});return t===`__root__`?(0,Q.jsx)(Z.Suspense,{fallback:Vm(e),children:a}):a});function Jm(e,t){let n=e[1];e.length=0,n?.(t)}function Ym({t:e}){let t=Fi(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Jm(n,!1),n.push(i,a),e(t),Z.startTransition(r)}),jt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Os(r.publicHref)!==Os(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Mp(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Xm(){let e=Fi(),t=e.routesById[Mc],n=Vm(e,t),r=e.ssr?zm:Z.Suspense,i=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ym,{t:Z.useState()[1]}),(0,Q.jsx)(r,{fallback:n,children:(0,Q.jsx)(Zm,{})})]});return e.options.InnerWrap?(0,Q.jsx)(e.options.InnerWrap,{children:i}):i}function Zm(){let e=Fi(),t=e._rendered,n=tn(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;jt(()=>{t[0]===n&&Jm(t,!0)},[t,n]);let a=i?(0,Q.jsx)(Wm,{routeId:i}):null;return(0,Q.jsx)(jc.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,Q.jsx)(Fm,{getResetKey:()=>r,onCatch:void 0,children:a})})}function Qm(e){let t=Fi();return tn(t.stores.matches,Nc(e,t))}function $m(e){let t=Fi();return tn(t.stores.location,Nc(e,t))}function eh(){let e=Fi();return tn(e.stores.location,e=>e.state.__TSR_index!==0)}var th=wr(),$=We(),nh=e=>typeof e==`string`?{value:e,label:e}:e;function*rh(e){for(let t of e)if(typeof t==`string`||!(`type`in t))yield nh(t);else if(t.type===`group`)for(let e of t.items)yield nh(e)}function ih(e,t){let n=e;for(let e of t){if(!n)return;let t;for(let r of rh(n))r.value===e&&(t=r.items);n=t}return n}function ah(e,t){if(e)for(let n of rh(e)){if(n.value===t)return n;let e=ah(n.items,t);if(e)return e}}function oh(e){let t=[],n=e=>{for(let r of rh(e))r.shortcut&&!r.disabled&&t.push({value:r.value,shortcut:r.shortcut}),r.items&&n(r.items)};return e&&n(e),t}function sh(e,t){let n=e.getAttribute(`aria-labelledby`);if(n&&n!==`${t}-label`)return{labelledBy:n};let r=[...e.labels??[]].map(e=>e.id).filter(Boolean);if(r.length)return{labelledBy:r.join(` `)};let i=e.getAttribute(`aria-label`);return i?{label:i}:null}function ch(e,t,n){In(t,r=>{let i=sh(e,n);JSON.stringify(i)!==JSON.stringify(t.get().fieldName)&&(r.fieldName=i)})}function lh(e,t){let n=e.labeled?null:e.fieldName;return{"aria-labelledby":e.labeled?`${t}-label`:n&&`label`in n?void 0:n?.labelledBy??`${t}-input`,"aria-label":n&&`label`in n?n.label:void 0}}var uh={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};uh.node;var dh=Xs(uh),fh={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};fh.node;var ph=Xs(fh),mh={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};mh.node;var hh=Xs(mh),gh={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};gh.node;var _h=Xs(gh),vh={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vh.node;var yh=Xs(vh),bh={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};bh.node;var xh=Xs(bh),Sh={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};Sh.node;var Ch=Xs(Sh),wh={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};wh.node;var Th=Xs(wh),Eh={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Eh.node;var Dh=Xs(Eh),Oh={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Oh.node;var kh=Xs(Oh),Ah={name:`circle-minus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-circle`]};Ah.node;var jh=Xs(Ah),Mh={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Mh.node;var Nh=Xs(Mh),Ph={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};Ph.node;var Fh=Xs(Ph),Ih={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Ih.node;var Lh=Xs(Ih),Rh={name:`copy-plus`,size:24,node:[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Rh.node;var zh=Xs(Rh),Bh={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Bh.node;var Vh=Xs(Bh),Hh={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Hh.node;var Uh=Xs(Hh),Wh={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Wh.node;var Gh=Xs(Wh),Kh={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Kh.node;var qh=Xs(Kh),Jh={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Jh.node;var Yh=Xs(Jh),Xh={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};Xh.node;var Zh=Xs(Xh),Qh={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Qh.node;var $h=Xs(Qh),eg={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};eg.node;var tg=Xs(eg),ng={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};ng.node;var rg=Xs(ng),ig={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};ig.node;var ag=Xs(ig),og={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};og.node;var sg=Xs(og),cg={name:`folder-minus`,size:24,node:[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};cg.node;var lg=Xs(cg),ug={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};ug.node;var dg=Xs(ug),fg={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};fg.node;var pg=Xs(fg),mg={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};mg.node;var hg=Xs(mg),gg={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};gg.node;var _g=Xs(gg),vg={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};vg.node;var yg=Xs(vg),bg={name:`git-graph`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v6`,key:`158jrl`}],[`circle`,{cx:`5`,cy:`18`,r:`3`,key:`104gr9`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`circle`,{cx:`19`,cy:`6`,r:`3`,key:`108a5v`}],[`path`,{d:`M16 15.7A9 9 0 0 0 19 9`,key:`1e3vqb`}]]};bg.node;var xg=Xs(bg),Sg={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Sg.node;var Cg=Xs(Sg),wg={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};wg.node;var Tg=Xs(wg),Eg={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Eg.node;var Dg=Xs(Eg),Og={name:`git-pull-request-draft`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M18 6V5`,key:`1oao2s`}],[`path`,{d:`M18 11v-1`,key:`11c8tz`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Og.node;var kg=Xs(Og),Ag={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Ag.node;var jg=Xs(Ag),Mg={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Mg.node;var Ng=Xs(Mg),Pg={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};Pg.node;var Fg=Xs(Pg),Ig={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ig.node;var Lg=Xs(Ig),Rg={name:`list-chevrons-up-down`,size:24,node:[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]};Rg.node;var zg=Xs(Rg),Bg={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Bg.node;var Vg=Xs(Bg),Hg={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Hg.node;var Ug=Xs(Hg),Wg={name:`list-x`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]};Wg.node;var Gg=Xs(Wg),Kg={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Kg.node;var qg=Xs(Kg),Jg={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Jg.node;var Yg=Xs(Jg),Xg={name:`message-square-warning`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]};Xg.node;var Zg=Xs(Xg),Qg={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Qg.node;var $g=Xs(Qg),e_={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};e_.node;var t_=Xs(e_),n_={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};n_.node;var r_=Xs(n_),i_={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};i_.node;var a_=Xs(i_),o_={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};o_.node;var s_=Xs(o_),c_={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};c_.node;var l_=Xs(c_),u_={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};u_.node;var d_=Xs(u_),f_={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};f_.node;var p_=Xs(f_),m_={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};m_.node;var h_=Xs(m_),g_={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};g_.node;var __=Xs(g_),v_={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};v_.node;var y_=Xs(v_),b_={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};b_.node;var x_=Xs(b_),S_={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};S_.node;var C_=Xs(S_),w_={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};w_.node;var T_=Xs(w_),E_={name:`square-x`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-square`]};E_.node;var D_=Xs(E_),O_={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};O_.node;var k_=Xs(O_),A_={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};A_.node;var j_=Xs(A_),M_={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};M_.node;var N_=Xs(M_),P_={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};P_.node;var F_=Xs(P_),I_={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};I_.node;var L_=Xs(I_),R_=`160000`;function z_(e){return e.oldMode===R_||e.newMode===R_}function B_(e){return e.kind===`text`||e.kind===`metadata-only`}function V_(e,t){return z_(e)||t?.kind!==`text`?null:e.newPath??e.oldPath??null}function H_(e){switch(e){case`size-limit`:return`Too large to show`;case`unsupported-submodule`:return`Submodule change`;case`unsupported-encoding`:return`Unsupported text encoding`}}function U_(e){switch(e.kind){case`binary`:return`Binary change`;case`metadata-only`:return`No code change`;case`omitted`:return H_(e.reason);case`text`:return}}function W_(e,t,n){return z_(e)?`Submodule change`:t===void 0?n?`The patch could not be read`:void 0:U_(t)}function G_(e){return e.scope===`staged`||e.scope===`unstaged`?{scope:e.scope,oldPath:e.oldPath,newPath:e.newPath}:void 0}var K_=/(?=^From [a-f0-9]+ .+$)/m,q_=/(?=^diff --git)/gm,J_=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Y_=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;Object.freeze({fromStart:0,fromEnd:0}),Object.freeze([]);function X_(e,t){return e-(t===0?0:1)}function Z_(e,t){return X_(e,t)+t}var Q_=1;function $_(e,...t){return`ck${Q_}:${JSON.stringify([e,...t])}`}function ev(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var tv=new TextEncoder,nv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),rv=/[\uD800-\uDFFF]/,iv=1024,av=new Uint8Array(iv);function ov(){av.length!==iv&&(av=new Uint8Array(iv))}function sv(e){if(e.length===0)return e;if(rv.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;av.length<t&&(av=new Uint8Array(t));let{written:n}=tv.encodeInto(e,av);return nv.decode(av.subarray(0,n))}var cv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),lv={'"':`"`,"\\":`\\`,a:`\x07`,b:`\b`,t:` `,n:`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-editor-CqYmInQP.js","assets/rolldown-runtime-XKyaHtl9.js","assets/access-Czr_5Nvq.js","assets/sides-711aNttp.js","assets/preload-helper-7y9sWmk5.js","assets/announce-Cs-wr5G8.js","assets/edit-file-CoGaqr7C.js","assets/hastToHtml-CpdMSaFQ.js","assets/unwrapDefault-ByDmBtHB.js","assets/lib-BKZ5ZaMU.js","assets/constants-CmGPilXJ.js","assets/formatCSSVariablePrefix-KRh9vnZf.js","assets/utils-C9Glzetk.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,$n as n,$r as r,$s as i,$t as a,$u as o,A as s,Aa as c,Ac as l,Ad as u,Ai as d,Al as f,An as p,Ao as m,At as h,Au as g,B as _,Ba as v,Bd as y,Bi as b,Bl as x,Bn as S,Bo as C,Br as w,Bs as T,Bt as E,Bu as D,C as O,Ca as k,Cc as A,Cd as j,Cl as M,Cn as N,Co as P,Cr as F,Cs as I,Cu as L,D as R,Da as z,Dc as B,Dd as V,Di as H,Dl as U,Dn as W,Do as G,Dr as K,Ds as q,Du as J,E as ee,Ea as te,Ed as ne,Ei as re,El as ie,En as ae,Eo as oe,Es as se,Et as ce,F as le,Fa as ue,Fd as de,Fi as fe,Fl as pe,Fn as me,Fo as he,Fr as ge,Fs as _e,Gi as ve,Gn as ye,Go as be,Gr as xe,Gt as Se,Gu as Ce,H as we,Ha as Te,Hd as Ee,Hi as De,Hl as Oe,Hn as ke,Ho as Ae,Hs as je,Ht as Me,I as Ne,Ia as Pe,Id as Fe,Ii as Ie,Il as Le,In as Re,Is as ze,It as Be,Iu as Ve,J as He,Ja as Ue,Jc as We,Ji as Ge,Jl as Ke,Jn as qe,Jo as Je,Jr as Ye,Js as Xe,Jt as Ze,Ju as Qe,Ka as $e,Ki as et,Kl as tt,Kn as nt,Ko as rt,Kr as it,Ks as at,Kt as ot,Ku as st,L as ct,La as lt,Li as ut,Ll as dt,Ln as ft,Lo as pt,Lr as mt,Ls as ht,Lt as gt,Lu as _t,M as vt,Ma as yt,Md as bt,Mi as xt,Mn as St,Mo as Ct,Mr as wt,Mu as Tt,N as Et,Na as Dt,Nc as Ot,Nd as kt,Ni as At,Nl as jt,Nn as Mt,No as Nt,Nr as Pt,Nu as Ft,O as It,Oc as Lt,Od as Rt,Oi as zt,On as Bt,Oo as Y,Or as Vt,Os as Ht,Ou as Ut,P as Wt,Pa as Gt,Pd as Kt,Pi as qt,Pl as Jt,Pn as Yt,Po as Xt,Pt as Zt,Pu as Qt,Q as $t,Qa as en,Qc as tn,Qi as nn,Ql as rn,Qn as an,Qo as on,Qr as sn,Qs as cn,Qt as ln,Qu as un,R as dn,Rd as fn,Ri as pn,Rl as mn,Rn as hn,Ro as gn,Rr as _n,Rt as vn,Ru as yn,S as bn,Sa as xn,Sc as Sn,Sd as Cn,Si as wn,Sl as Tn,Sn as En,So as Dn,Ss as On,St as kn,Su as An,Ta as jn,Td as Mn,Ti as Nn,Tl as Pn,Tn as Fn,To as X,Ts as In,Tu as Ln,U as Rn,Ua as zn,Ud as Bn,Ui as Vn,Ul as Hn,Un,Uo as Wn,Ur as Gn,Us as Kn,Ut as qn,Uu as Jn,V as Yn,Va as Xn,Vd as Zn,Vi as Qn,Vl as $n,Vn as er,Vo as tr,Vr as nr,Vs as rr,Vt as ir,Vu as ar,Wc as or,Wi as sr,Wl as cr,Wn as lr,Wo as ur,Wr as dr,Wt as fr,Wu as pr,X as mr,Xi as hr,Xl as gr,Xn as _r,Xr as vr,Xs as yr,Xt as br,Xu as xr,Y as Sr,Ya as Cr,Yc as wr,Yi as Tr,Yn as Er,Yo as Dr,Yr as Or,Ys as kr,Yt as Ar,Yu as jr,Z as Mr,Za as Nr,Zi as Pr,Zl as Fr,Zn as Ir,Zr as Lr,Zs as Rr,Zt as zr,Zu as Br,_ as Vr,_d as Hr,_i as Ur,_l as Wr,_o as Gr,_r as Kr,_u as qr,a as Jr,ac as Yr,ad as Xr,ai as Zr,al as Qr,as as $r,at as ei,au as ti,b as ni,ba as ri,bd as ii,bi as ai,bl as oi,bn as si,bo as ci,br as li,bs as ui,bt as di,bu as fi,c as pi,cc as mi,cd as hi,ci as gi,cl as _i,cr as vi,cs as yi,ct as bi,cu as xi,d as Si,dc as Ci,dd as wi,di as Ti,dl as Ei,dn as Di,do as Oi,dr as ki,ds as Ai,dt as ji,du as Mi,ed as Ni,ei as Pi,el as Fi,en as Ii,er as Li,es as Ri,et as zi,eu as Bi,f as Vi,fc as Hi,fd as Ui,fi as Wi,fl as Gi,fn as Ki,fo as qi,fr as Ji,ft as Yi,fu as Xi,g as Zi,gc as Qi,gd as $i,gi as ea,gl as ta,gn as na,go as ra,gr as ia,gu as aa,h as oa,hc as sa,hd as ca,hi as la,hl as ua,ho as da,hr as fa,ht as pa,hu as ma,i as ha,ic as ga,id as _a,ii as va,il as ya,in as ba,io as xa,ir as Sa,is as Ca,it as wa,iu as Ta,j as Ea,jc as Da,jd as Oa,ji as ka,jl as Aa,jn as ja,jo as Ma,js as Na,ju as Pa,k as Fa,ka as Ia,kc as La,kd as Ra,ki as za,kl as Ba,kn as Va,ko as Ha,kr as Ua,ks as Wa,kt as Ga,ku as Ka,lc as qa,ld as Ja,lo as Ya,lr as Xa,ls as Za,lt as Qa,m as $a,mc as eo,md as to,mi as no,ml as ro,mn as io,mo as ao,mr as oo,ms as so,mt as co,mu as lo,n as uo,nc as fo,nd as po,ni as mo,nl as ho,ns as go,nt as _o,nu as vo,o as yo,oc as bo,od as xo,oi as So,ol as Co,on as wo,oo as To,or as Eo,os as Do,ot as Oo,ou as ko,p as Ao,pc as jo,pd as Mo,pi as No,pl as Po,pn as Fo,po as Io,pr as Lo,ps as Ro,pt as zo,pu as Bo,q as Vo,qa as Ho,qi as Uo,ql as Wo,qn as Go,qo as Ko,qr as qo,qs as Jo,qt as Yo,qu as Xo,r as Zo,rc as Qo,rd as $o,ri as es,rl as ts,rn as ns,ro as rs,rs as is,rt as as,ru as os,s as ss,sc as cs,sd as ls,si as us,sl as ds,sr as fs,ss as ps,su as ms,t as hs,tc as gs,td as _s,ti as vs,to as ys,tr as bs,ts as xs,tt as Ss,tu as Cs,u as ws,uc as Ts,ud as Es,ui as Ds,ul as Os,uo as ks,ur as As,us as js,ut as Ms,uu as Ns,v as Ps,va as Fs,vc as Is,vd as Ls,vi as Rs,vn as zs,vo as Bs,vr as Vs,vu as Hs,w as Us,wa as Ws,wc as Gs,wd as Ks,wi as qs,wl as Js,wn as Ys,wo as Xs,ws as Zs,wt as Qs,wu as $s,x as ec,xa as tc,xc as nc,xd as rc,xi as ic,xl as ac,xn as oc,xo as sc,xt as cc,xu as lc,y as uc,ya as dc,yd as fc,yi as pc,yl as mc,yn as hc,yo as gc,yr as _c,ys as vc,yu as yc,z as bc,za as xc,zd as Sc,zi as Cc,zl as wc,zn as Tc,zo as Ec,zr as Dc,zs as Oc,zt as kc,zu as Ac}from"./access-Czr_5Nvq.js";import{a as jc,c as Mc,i as Nc,n as Pc,o as Fc}from"./useNavigate-CSjcsPKp.js";import{$n as Ic,$r as Lc,$t as Rc,A as zc,An as Bc,Ar as Vc,At as Hc,B as Uc,Br as Wc,Bt as Gc,C as Kc,Cn as qc,Cr as Jc,Ct as Yc,D as Xc,Dn as Zc,Dr as Qc,Dt as $c,E as el,En as tl,Et as nl,F as rl,Fr as il,Ft as al,G as ol,Gn as sl,Gr as cl,Gt as ll,H as ul,Hr as dl,Ht as fl,I as pl,Ir as ml,It as hl,J as gl,Jn as _l,Jr as vl,Jt as yl,K as bl,Kn as xl,Kr as Sl,Kt as Cl,Lr as wl,Lt as Tl,M as El,Mr as Dl,Nr as Ol,O as kl,On as Al,Or as jl,Ot as Ml,P as Nl,Pr as Pl,Pt as Fl,Qn as Il,Qr as Ll,Qt as Rl,Rr as zl,Rt as Bl,S as Vl,Sn as Hl,Sr as Ul,St as Wl,T as Gl,Tn as Kl,Tr as ql,Tt as Jl,U as Yl,Un as Xl,Ur as Zl,Ut as Ql,V as $l,Vr as eu,Vt as tu,W as nu,Wn as ru,Wr as iu,Wt as au,X as ou,Xn as su,Xr as cu,Xt as lu,Yn as uu,Yr as du,Yt as fu,Zn as pu,Zr as mu,Zt as hu,_ as gu,_i as _u,_n as vu,_r as yu,_t as bu,a as xu,ai as Su,an as Cu,ar as wu,at as Tu,bn as Eu,br as Du,bt as Ou,c as ku,ci as Au,cr as ju,ct as Mu,d as Nu,di as Pu,dn as Fu,dr as Iu,dt as Lu,ei as Ru,er as zu,et as Bu,f as Vu,fi as Hu,fn as Uu,fr as Wu,ft as Gu,g as Ku,gn as qu,gr as Ju,h as Yu,hn as Xu,hr as Zu,ht as Qu,i as $u,ii as ed,in as td,ir as nd,it as rd,j as id,jr as ad,jt as od,k as sd,kn as cd,kt as ld,l as ud,li as dd,ln as fd,lr as pd,lt as md,m as hd,mn as gd,mr as _d,mt as vd,n as yd,ni as bd,nn as xd,nr as Sd,nt as Cd,o as wd,oi as Td,on as Ed,or as Dd,ot as Od,p as kd,pi as Ad,pn as jd,pr as Md,pt as Nd,q as Pd,qn as Fd,qr as Id,qt as Ld,r as Rd,ri as zd,rn as Bd,rr as Vd,rt as Hd,s as Ud,si as Wd,sn as Gd,sr as Kd,st as qd,ti as Jd,tr as Yd,tt as Xd,u as Zd,ui as Qd,un as $d,ur as ef,ut as tf,v as nf,vn as rf,vr as af,vt as of,w as sf,wn as cf,wr as lf,wt as uf,xn as df,xr as ff,xt as pf,yn as mf,yr as hf,yt as gf,zr as _f,zt as vf}from"./edit-file-CoGaqr7C.js";import{a as yf,c as bf,d as xf,f as Sf,g as Cf,l as wf,m as Tf,p as Ef,r as Df,s as Of,v as kf}from"./sides-711aNttp.js";import{t as Af}from"./preload-helper-7y9sWmk5.js";import{a as jf,c as Mf,d as Nf,i as Pf,l as Ff,m as If,n as Lf,o as Rf,r as zf,s as Bf,t as Vf,u as Hf,v as Uf}from"./hastToHtml-CpdMSaFQ.js";import{r as Wf}from"./constants-CmGPilXJ.js";import{t as Gf}from"./resolveLanguages-CK0v50mm.js";function Kf(e){return e?.isNotFound===!0}function qf(){try{return sessionStorage}catch{return}}var Jf=`tsr-scroll-restoration-v1_3`,Yf=qf();function Xf(){try{return JSON.parse(Yf?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Zf(){try{Yf?.setItem(Jf,JSON.stringify(Qf))}catch{}}var Qf=Xf(),$f=`data-scroll-restoration-id`,ep=e=>e.state.__TSR_key||e.href;function tp(e){let t=e.getAttribute($f);if(t)return`[${$f}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var np=!1,rp=`window`;function ip(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ap(e){let t=new Set;for(let n of e){if(n===rp)continue;let e=ip(n);e&&t.add(e)}return t}function op(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ep,a=new Set,o=e=>{let t=Qf[e]||={};for(let e of a)e===document?t[rp]={scrollX,scrollY}:e.isConnected&&(t[tp(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,np=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{np||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Zf()})),r.reset||(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Qf[d];if(e){let t=Qf[u];for(let n in e){if(n===rp){if(s)continue}else{let e=ip(n);if(!e||s&&o&&(l??=ap(o),l.has(e)))continue}t||=Qf[u]={},t[n]??=e[n]}}}np=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=ap(o));let t=e&&i&&c,s=r.restoring?Qf[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===rp){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=ip(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{np=!1}}))}function sp(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function cp(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function lp(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=cp(r):Array.isArray(t)?t.push(cp(r)):n[e]=[t,cp(r)]}return n}var up=/^(?:\s|["[{\d-]|fa|nu|tr)/,dp=pp(JSON.parse),fp=mp(JSON.stringify,JSON.parse);function pp(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=lp(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!up.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function mp(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!up.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=sp(e,r);return t?`?${t}`:``}}function hp(e){return{input:({url:t})=>{for(let n of e)t=_p(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=vp(e[n],t);return t}}}function gp(e){let t=_i(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Co([`/`,t,e.pathname]),e)}}function _p(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function vp(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function yp(e){let t=e;return{get(){return t},set(e){t=Js(e,t)}}}function bp(e){return{get(){return e()}}}function xp(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{oi(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Sp=`__TSR_index`,Cp=`popstate`,wp=`beforeunload`;function Tp(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=kp(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Sp];i=Ep(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Sp];i=Ep(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Sp]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ep(e,t){t||={};let n=Ap();return{...t,key:n,__TSR_key:n,[Sp]:e}}function Dp(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>kp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ap();t.history.replaceState({[Sp]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=kp(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[Sp]-l.state[Sp],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Tp({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(wp,x,{capture:!0}),t.removeEventListener(Cp,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(wp,x,{capture:!0}),t.addEventListener(Cp,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Op(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function kp(e,t){let n=Op(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ap();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Sp]:0,key:a,__TSR_key:a}}}function Ap(){return(Math.random()+1).toString(36).substring(7)}function jp(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Mp(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Np({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Pp(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Fp(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Ip=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ya(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dp()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Wr(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=xp(this.latestLocation,e),op(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=_i(a);t&&t!==`/`&&e.push(gp({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:hp(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ta(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ua(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ac(e).path,external:!1,searchStr:o,search:f(t?.search,i),hash:ac(r.slice(1)).path,state:Aa(t?.state,a)}}let o=new URL(i,this.origin),s=_p(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ac(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:f(t?.search,c),hash:ac(s.hash.slice(1)).path,state:Aa(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ds({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Po(Os(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=kp(t.href,{});t={...t,to:_p(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n),i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Hp(t.params,o),l=this.routesByPath[Os(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Pn(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:ac(Qr({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,zp(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Bp(p,t,u,e._includeValidateSearch),p=f(a,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?Js(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?Js(t.state,n.state):{};t.state&&(_=Aa(n.state,_));let v=`${d}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=vp(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=M(v),b=y;return{publicHref:b,href:y,pathname:d,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=Gi(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Hp(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Os(this.latestLocation.href)===Os(n.href)&&Tn(Np(n.state),Np(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!!n&&ie(`${n}`);if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(U(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t}else return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Nm(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Mp(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&jp(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&U(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Kp,this.preloadRoute=e=>Pm(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=ro(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Tn(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Tn(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??fp,parseSearch:e.parseSearch??dp,protocolAllowlist:e.protocolAllowlist??mc}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ei(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Os(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Vp(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=zp(i.options.validateSearch,{...n})??void 0;l={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Lp||(r=new Lp(e.message,{cause:e})),t?.throwOnError)throw r;l=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:l})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=Qr({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=u(i,n),x=this._cache.get(y)??(b?.id===y?b:void 0);d=x?._strictParams??Object.assign(v,d);let S;if(!x)try{Up(i,d)}catch(e){if(S=Kf(e)||Fc(e)?e:new Rp(e.message,{cause:e}),t?.throwOnError)throw S}let C=b?`stay`:`enter`,w;if(x)w={...x,cause:C,search:f(b?b.search:x.search,l),_strictSearch:p,searchError:m};else{let e=jp(i)?`pending`:`success`;w={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:b?f(b.search,l):l,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:S,context:{},abortController:t?._controller??new AbortController,cause:C,loaderDeps:b?Aa(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let T=s===i.id;w._notFound&&!T&&(w.error=void 0),w._notFound=T,c[n]=w}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?f(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=Ba(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=Ba(a),c={...e.search};for(let e of a)try{Object.assign(c,zp(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{Up(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Lp=class extends Error{},Rp=class extends Error{};function zp(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Lp(`Async validation not supported`);if(n.issues)throw new Lp(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Bp(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=zp(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Js(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Vp(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Mc}function Hp(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Js(e,n))}function Up(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Wp(e,t){return e.options[t]?.preload?.()}function Gp(e,t){let n=Wp(e,`component`),r=Wp(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Kp(e,t,n){let r=()=>t===!1?void 0:t?Wp(e,t):Gp(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function qp(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Jp=0,Yp=1,Xp=2,Zp=3,Qp=[4];function $p(e){return typeof e[0]==`number`}function em(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function tm(e,t){return e.routesById[t.routeId]}function nm(e,t,n){return Fc(e)?[Zp,e]:Kf(e)?(e.routeId||=n,[Xp,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Yp,e]):[Jp,e]}function rm(e,t){let n=nm(t,!0,e.id);if(n[0]!==Yp)return n;try{e.options.onError?.(n[1])}catch(t){n=nm(t,!0,e.id)}return n}function im(e,t,n,r,i){return i[0].signal.aborted?Qp:bm(e,t,n,rm(n,r),i)}async function am(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=tm(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return sm(e,r),[i,im(e,t,u,a,n)]}if(c.aborted)return[i,Qp];let p=r.paramsError??r.searchError;if(p!==void 0)return sm(e,r),[i,im(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{um(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?em(a,c):a);if(c.aborted)return[i,Qp];let s=bm(e,t,u,nm(o,!1,u.id),n);if(s[0]!==Jp)return sm(e,r),[i,s];r.context={...r.context,...o}}catch(a){return sm(e,r),[i,im(e,t,u,a,n)]}finally{r.status=h,um(e,r,!1,n[0])}}i()}function om(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function sm(e,t){let n=t._flight;t._flight=void 0,om(e,t,n)?.abort()}function cm(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=om(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function lm(e){for(let t of e){let e=t._flight;e&&e[2]++}}function um(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function dm(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function fm(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Qp;if(!i)return[Jp,void 0];let l=n._flight;um(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(dm(e,t,n,r,s,a,!!o[3]))).then(e=>nm(e,!1,r.id),e=>nm(e,!0,r.id)).then(t=>(t[0]!==Jp&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Yp&&l[2]?rm(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],bm(e,t,r,await em(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return sm(e,n),Qp}finally{um(e,n,!1,s)}}function pm(e,t,n){t[0]!==Zp&&(e.status=`success`,e.error=void 0,t[0]===Jp?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function mm(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&sm(e,r)}function hm(e,t){return t[0]===Yp||t[0]===Xp?{...e,status:t[0]===Yp?`error`:`notFound`,error:t[1],_flight:void 0}:e}function gm(e,t,n,r,i,a,o){let s=t[1][n],c=tm(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(dm(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Qp)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,sm(e,s),p=im(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,om(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?fm(e,t,s,c,g,i,a).then(t=>(pm(s,t,l),t[0]===Jp&&(m&&!a[0].signal.aborted&&mm(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Jp,s.loaderData]),T=(async()=>{try{let e=Kp(c,void 0,C);e&&await em(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,im(e,t,c,r,a)]}let r=await w;x&&r[0]===Jp&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>hm(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=fm(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,pm(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>hm(E,e))}async function _m(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=tm(e,t[n]);try{let e=Kp(i,!1);e&&await em(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function vm(e,t){t[2]&&=(cm(e,t[2].map(e=>e[3])),void 0)}async function ym(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Zp)throw[a,t];!i&&t[0]!==Jp&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Zp)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function bm(e,t,n,r,i,a){for(;r[0]===Zp;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Zp,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Yp,e]:rm(n,e),a=!0}}return r}async function xm(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Xp?_m(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Zp)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Jp&&t[0]<Zp&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Zp){let n=s[1];if(n[0]!==Zp||n[1].options.reloadDocument||n[2])return vm(e,t),n;c=!0,s=[0,[Yp,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Yp?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=tm(e,u);try{await em(i?Promise.resolve().then(()=>Kp(m,l===Yp?`errorComponent`:`notFoundComponent`)):Promise.all([Kp(m),Kp(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return vm(e,t),Qp}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),vm(e,t),cm(e,o),p()):u.status=`success`}return t}async function Sm(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=tm(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await em(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Cm(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await _m(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=gm(e,i,t,u,f,r,l)},m=await am(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Xp){let t=await _m(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Zp&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=xm(e,i,u,r[0],ym(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=ym(i[2],void 0,void 0,h.then(e=>$p(e)?0:qp(n).length,()=>0))),o=await h}catch(t){if(vm(e,i),t===a&&a.aborted)return Qp;throw t}return $p(o)?o:Sm(e,o,a,r[6]===n.length?r[6]:0)}function wm(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=tm(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>wm(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Tm(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function Em(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!qp(t[3]).some(e=>e.id===n[1]))return;let i;try{await em(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Dm(e,t){e._committed=t,e.stores.setMatches(t)}function Om(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=qp(n).length,c=new Map;{let t=Date.now();for(let r of[...i,...o.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<s||e.status===`success`)))continue;let i=tm(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(r.id,o.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Pp(n);Dm(e,n),cm(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Fp(e,i,n,a,l,t)}async function km(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Am(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function jm(e,t,n,r,i){let a=n.map(e=>({...e}));lm(a);for(let t of r)sm(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await xm(e,o,r,t[0],i)}catch(t){throw cm(e,a),t}if($p(s))cm(e,a),s[0]===Zp&&e._tx===t&&e._committed===n&&await Am(e,t,s);else if(await Sm(e,s,t[0].signal),e._tx!==t||e._committed!==n)cm(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),sm(e,n))}Dm(e,a),cm(e,n,a)}}async function Mm(e,t,n,r,i,a){let o=await Cm(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if($p(o)){let n=o[0]===Zp&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Tm(e,t),cm(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Tm(e,t);return}await Am(e,t,o);return}let s=o[1];if(e._tx===t&&await Em(e,t),e._tx!==t){Tm(e,t),cm(e,s),vm(e,o);return}let c=t[2],l=Mp(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Em(e,t),e._tx!==t){Tm(e,t),cm(e,s),vm(e,o);return}let n=await e.startTransition(()=>{Tm(e,t),Om(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&jm(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):vm(e,o)})}async function Nm(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Mp(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await km(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});lm(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){cm(e,m),await km(e,n);return}e._preflight=void 0;let g,_=()=>Mm(e,y,f,()=>wm(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>km(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&um(e,t,!1)}n[0].abort(),cm(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&wm(e,y),g?.(_()),await y[5]):(cm(e,y[3]),y[3]=[],g?.(),await km(e,y))}async function Pm(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),lm(a),o=(e._preloads??=new Map).set(i,a),s=await Cm(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),cm(e,a)),i.abort()}if(!$p(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Kf(e)||console.error(e);return}}}var Z=e(Jt(),1),Q=ts(),Fm=class extends Z.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?Z.createElement(this.props.errorComponent??Im,{error:e[0],reset:this.reset}):this.props.children}};function Im({error:e}){let[t,n]=Z.useState(!1);return(0,Q.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Q.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Q.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Q.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,Q.jsx)(`code`,{children:e.message}):null})}):null]})}function Lm(e){let t=Fi(),n=`not-found-${tn(t.stores.location,e=>e.pathname)}-${tn(t.stores.status,e=>e)}`;return(0,Q.jsx)(Fm,{getResetKey:()=>n,onCatch:(t,n)=>{if(Kf(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Kf(t))return e.fallback?.(t);throw t},children:e.children})}function Rm(){return(0,Q.jsx)(`p`,{children:`Not Found`})}function zm(e){return(0,Q.jsx)(Q.Fragment,{children:e.children})}function Bm(e,t,n){return t.options.notFoundComponent?(0,Q.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Q.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Q.jsx)(Rm,{})}function Vm(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,Q.jsx)(n,{}):null}var Hm=(e,t)=>e[0]===t[0]&&e[1]===t[1],Um=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Wm=Z.memo(function({routeId:e}){let t=Fi();return(0,Q.jsx)(Gm,{router:t,match:tn(t.stores.getMatchStore(e),e=>e)})});function Gm({router:e,match:t}){let n=e.routesById[t.routeId],r=Vm(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Um(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?Z.Suspense:zm,l=i?Fm:zm,u=o?Lm:zm;return(0,Q.jsxs)(n.isRoot?n.options.shellComponent??zm:zm,{children:[(0,Q.jsx)(jc.Provider,{value:t.routeId,children:(0,Q.jsx)(c,{fallback:r,children:(0,Q.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Kf(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,Q.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return Z.createElement(o,e)},children:s?(0,Q.jsx)(ho,{fallback:r,children:(0,Q.jsx)(Km,{match:t})}):(0,Q.jsx)(Km,{match:t})})})})}),null]})}var Km=Z.memo(function({match:e}){let t=Fi(),n=e.routeId,r=t.routesById[n],i=Z.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=Z.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,Q.jsx)(e,{},i):(0,Q.jsx)(qm,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Um(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Vm(t,r)}if(e.status===`notFound`)return Bm(t,r,e.error);if(e.status===`error`)throw e.error;return a}),qm=Z.memo(function(){let e=Fi(),t=Z.useContext(jc),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=tn(a,e=>[!!e._notFound,e.error],Hm),i=tn(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Bm(e,e.routesById[t],r);if(!i)return null;let a=(0,Q.jsx)(Wm,{routeId:i});return t===`__root__`?(0,Q.jsx)(Z.Suspense,{fallback:Vm(e),children:a}):a});function Jm(e,t){let n=e[1];e.length=0,n?.(t)}function Ym({t:e}){let t=Fi(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Jm(n,!1),n.push(i,a),e(t),Z.startTransition(r)}),jt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Os(r.publicHref)!==Os(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Mp(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Xm(){let e=Fi(),t=e.routesById[Mc],n=Vm(e,t),r=e.ssr?zm:Z.Suspense,i=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ym,{t:Z.useState()[1]}),(0,Q.jsx)(r,{fallback:n,children:(0,Q.jsx)(Zm,{})})]});return e.options.InnerWrap?(0,Q.jsx)(e.options.InnerWrap,{children:i}):i}function Zm(){let e=Fi(),t=e._rendered,n=tn(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;jt(()=>{t[0]===n&&Jm(t,!0)},[t,n]);let a=i?(0,Q.jsx)(Wm,{routeId:i}):null;return(0,Q.jsx)(jc.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,Q.jsx)(Fm,{getResetKey:()=>r,onCatch:void 0,children:a})})}function Qm(e){let t=Fi();return tn(t.stores.matches,Nc(e,t))}function $m(e){let t=Fi();return tn(t.stores.location,Nc(e,t))}function eh(){let e=Fi();return tn(e.stores.location,e=>e.state.__TSR_index!==0)}var th=wr(),$=We(),nh=e=>typeof e==`string`?{value:e,label:e}:e;function*rh(e){for(let t of e)if(typeof t==`string`||!(`type`in t))yield nh(t);else if(t.type===`group`)for(let e of t.items)yield nh(e)}function ih(e,t){let n=e;for(let e of t){if(!n)return;let t;for(let r of rh(n))r.value===e&&(t=r.items);n=t}return n}function ah(e,t){if(e)for(let n of rh(e)){if(n.value===t)return n;let e=ah(n.items,t);if(e)return e}}function oh(e){let t=[],n=e=>{for(let r of rh(e))r.shortcut&&!r.disabled&&t.push({value:r.value,shortcut:r.shortcut}),r.items&&n(r.items)};return e&&n(e),t}function sh(e,t){let n=e.getAttribute(`aria-labelledby`);if(n&&n!==`${t}-label`)return{labelledBy:n};let r=[...e.labels??[]].map(e=>e.id).filter(Boolean);if(r.length)return{labelledBy:r.join(` `)};let i=e.getAttribute(`aria-label`);return i?{label:i}:null}function ch(e,t,n){In(t,r=>{let i=sh(e,n);JSON.stringify(i)!==JSON.stringify(t.get().fieldName)&&(r.fieldName=i)})}function lh(e,t){let n=e.labeled?null:e.fieldName;return{"aria-labelledby":e.labeled?`${t}-label`:n&&`label`in n?void 0:n?.labelledBy??`${t}-input`,"aria-label":n&&`label`in n?n.label:void 0}}var uh={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};uh.node;var dh=Xs(uh),fh={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};fh.node;var ph=Xs(fh),mh={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};mh.node;var hh=Xs(mh),gh={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};gh.node;var _h=Xs(gh),vh={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vh.node;var yh=Xs(vh),bh={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};bh.node;var xh=Xs(bh),Sh={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};Sh.node;var Ch=Xs(Sh),wh={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};wh.node;var Th=Xs(wh),Eh={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Eh.node;var Dh=Xs(Eh),Oh={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Oh.node;var kh=Xs(Oh),Ah={name:`circle-minus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-circle`]};Ah.node;var jh=Xs(Ah),Mh={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Mh.node;var Nh=Xs(Mh),Ph={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};Ph.node;var Fh=Xs(Ph),Ih={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Ih.node;var Lh=Xs(Ih),Rh={name:`copy-plus`,size:24,node:[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Rh.node;var zh=Xs(Rh),Bh={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Bh.node;var Vh=Xs(Bh),Hh={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Hh.node;var Uh=Xs(Hh),Wh={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Wh.node;var Gh=Xs(Wh),Kh={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Kh.node;var qh=Xs(Kh),Jh={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Jh.node;var Yh=Xs(Jh),Xh={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};Xh.node;var Zh=Xs(Xh),Qh={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Qh.node;var $h=Xs(Qh),eg={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};eg.node;var tg=Xs(eg),ng={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};ng.node;var rg=Xs(ng),ig={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};ig.node;var ag=Xs(ig),og={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};og.node;var sg=Xs(og),cg={name:`folder-minus`,size:24,node:[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};cg.node;var lg=Xs(cg),ug={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};ug.node;var dg=Xs(ug),fg={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};fg.node;var pg=Xs(fg),mg={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};mg.node;var hg=Xs(mg),gg={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};gg.node;var _g=Xs(gg),vg={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};vg.node;var yg=Xs(vg),bg={name:`git-graph`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v6`,key:`158jrl`}],[`circle`,{cx:`5`,cy:`18`,r:`3`,key:`104gr9`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`circle`,{cx:`19`,cy:`6`,r:`3`,key:`108a5v`}],[`path`,{d:`M16 15.7A9 9 0 0 0 19 9`,key:`1e3vqb`}]]};bg.node;var xg=Xs(bg),Sg={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Sg.node;var Cg=Xs(Sg),wg={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};wg.node;var Tg=Xs(wg),Eg={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Eg.node;var Dg=Xs(Eg),Og={name:`git-pull-request-draft`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M18 6V5`,key:`1oao2s`}],[`path`,{d:`M18 11v-1`,key:`11c8tz`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Og.node;var kg=Xs(Og),Ag={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Ag.node;var jg=Xs(Ag),Mg={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Mg.node;var Ng=Xs(Mg),Pg={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};Pg.node;var Fg=Xs(Pg),Ig={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ig.node;var Lg=Xs(Ig),Rg={name:`list-chevrons-up-down`,size:24,node:[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]};Rg.node;var zg=Xs(Rg),Bg={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Bg.node;var Vg=Xs(Bg),Hg={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Hg.node;var Ug=Xs(Hg),Wg={name:`list-x`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]};Wg.node;var Gg=Xs(Wg),Kg={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Kg.node;var qg=Xs(Kg),Jg={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Jg.node;var Yg=Xs(Jg),Xg={name:`message-square-warning`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]};Xg.node;var Zg=Xs(Xg),Qg={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Qg.node;var $g=Xs(Qg),e_={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};e_.node;var t_=Xs(e_),n_={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};n_.node;var r_=Xs(n_),i_={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};i_.node;var a_=Xs(i_),o_={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};o_.node;var s_=Xs(o_),c_={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};c_.node;var l_=Xs(c_),u_={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};u_.node;var d_=Xs(u_),f_={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};f_.node;var p_=Xs(f_),m_={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};m_.node;var h_=Xs(m_),g_={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};g_.node;var __=Xs(g_),v_={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};v_.node;var y_=Xs(v_),b_={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};b_.node;var x_=Xs(b_),S_={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};S_.node;var C_=Xs(S_),w_={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};w_.node;var T_=Xs(w_),E_={name:`square-x`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-square`]};E_.node;var D_=Xs(E_),O_={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};O_.node;var k_=Xs(O_),A_={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};A_.node;var j_=Xs(A_),M_={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};M_.node;var N_=Xs(M_),P_={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};P_.node;var F_=Xs(P_),I_={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};I_.node;var L_=Xs(I_),R_=`160000`;function z_(e){return e.oldMode===R_||e.newMode===R_}function B_(e){return e.kind===`text`||e.kind===`metadata-only`}function V_(e,t){return z_(e)||t?.kind!==`text`?null:e.newPath??e.oldPath??null}function H_(e){switch(e){case`size-limit`:return`Too large to show`;case`unsupported-submodule`:return`Submodule change`;case`unsupported-encoding`:return`Unsupported text encoding`}}function U_(e){switch(e.kind){case`binary`:return`Binary change`;case`metadata-only`:return`No code change`;case`omitted`:return H_(e.reason);case`text`:return}}function W_(e,t,n){return z_(e)?`Submodule change`:t===void 0?n?`The patch could not be read`:void 0:U_(t)}function G_(e){return e.scope===`staged`||e.scope===`unstaged`?{scope:e.scope,oldPath:e.oldPath,newPath:e.newPath}:void 0}var K_=/(?=^From [a-f0-9]+ .+$)/m,q_=/(?=^diff --git)/gm,J_=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Y_=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;Object.freeze({fromStart:0,fromEnd:0}),Object.freeze([]);function X_(e,t){return e-(t===0?0:1)}function Z_(e,t){return X_(e,t)+t}var Q_=1;function $_(e,...t){return`ck${Q_}:${JSON.stringify([e,...t])}`}function ev(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var tv=new TextEncoder,nv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),rv=/[\uD800-\uDFFF]/,iv=1024,av=new Uint8Array(iv);function ov(){av.length!==iv&&(av=new Uint8Array(iv))}function sv(e){if(e.length===0)return e;if(rv.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;av.length<t&&(av=new Uint8Array(t));let{written:n}=tv.encodeInto(e,av);return nv.decode(av.subarray(0,n))}var cv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),lv={'"':`"`,"\\":`\\`,a:`\x07`,b:`\b`,t:` `,n:`
3
3
  `,v:`\v`,f:`\f`,r:`\r`};function uv(e){if(e[0]!==`"`)return;let t=``,n=1;for(;n<e.length;){let r=e[n];if(r===`"`)return{fileName:t,rawLength:n+1};if(r!==`\\`){t+=r,n++;continue}let i=lv[e[n+1]];if(i!=null){t+=i,n+=2;continue}let a=[];do{let t=dv(e,n+1);if(t==null)return;a.push(t),n+=4}while(e[n]===`\\`&&e[n+1]>=`0`&&e[n+1]<=`7`);t+=cv.decode(new Uint8Array(a))}}function dv(e,t){let n=e.charCodeAt(t)-48,r=e.charCodeAt(t+1)-48,i=e.charCodeAt(t+2)-48;if(n>=0&&n<=3&&r>=0&&r<=7&&i>=0&&i<=7)return n*64+r*8+i}var fv=4096,pv=.5;function mv(e){for(let t of e.hunks)for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=hv(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}}function hv(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>fv)return null;let c=[];for(let t=0;t<n;t++)c.push(_v(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(_v(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=vv(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*pv:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var gv=/\s+/g;function _v(e){return e.replace(gv,``)}function vv(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}var yv=/^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;function bv(e,{cacheKeyPrefix:t,disableLineMatching:n,throwOnError:r=!1}={},i){let a=Rv(e),o=a?Dv(e):Ov(e),s=n===!0?`patch-file-raw`:`patch-file`,c,l=[];for(let e of o){if(a&&!q_.test(e)||!a&&!kv(e)){if(c==null)c=sv(e);else if(r)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let o=xv(e,{cacheKey:t==null?void 0:i==null?$_(s,t,String(l.length)):$_(s,t,String(i),String(l.length)),isGitDiff:a,disableLineMatching:n,throwOnError:r});o!=null&&l.push(o)}return{patchMetadata:c,files:l}}function xv(e,{cacheKey:t,disableLineMatching:n=!1,isGitDiff:r=q_.test(e),oldFile:i,newFile:a,throwOnError:o=!1}={}){let s=0,c=zv(e,`@@ `),l,u=i==null||a==null,d=0,f=0;for(let e of c){let n=Ev(e),c=n[0];if(c==null){if(o)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Fv(c),m=0,h=0;if(p==null||l==null){if(l!=null){if(o)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}l={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:u,additionLines:!u&&i!=null&&a!=null?Tv(a.contents):[],deletionLines:!u&&i!=null&&a!=null?Tv(i.contents):[],additionCharacterCount:!u&&i!=null&&a!=null?a.contents.length:0,deletionCharacterCount:!u&&i!=null&&a!=null?i.contents.length:0,cacheKey:Vv(t)},l.additionLines.length===1&&a?.contents===``&&(l.additionLines.length=0),l.deletionLines.length===1&&i?.contents===``&&(l.deletionLines.length=0);for(let e of n){if(e.startsWith(`diff --git`)){let t=e.trim().match(yv);if(t==null){if(o)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}let n=Cv(t[1],!0),r=Cv(t[2],!0);l.name=sv(r),n!==r&&(l.prevName=sv(n));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(J_):null;if(t!=null){let[,e,n]=t,i=Cv(n,r);if(e===`---`&&i!==`/dev/null`){let e=sv(i);l.prevName=e,l.name=e}else e===`+++`&&i!==`/dev/null`&&(l.name=sv(i))}else if(r){if(e.startsWith(`new mode `)&&(l.mode=sv(e.slice(8).trim())),e.startsWith(`old mode `)&&(l.prevMode=sv(e.slice(8).trim())),e.startsWith(`new file mode`)&&(l.type=`new`,l.mode=sv(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(l.type=`deleted`,l.mode=sv(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?l.type=`rename-pure`:l.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Y_)??[];t!=null&&(l.prevObjectId=sv(t)),n!=null&&(l.newObjectId=sv(n)),r!=null&&(l.mode=sv(r))}(e.startsWith(`rename from `)||e.startsWith(`copy from `))&&(l.prevName=sv(Cv(e.slice(e.startsWith(`rename`)?12:10)))),(e.startsWith(`rename to `)||e.startsWith(`copy to `))&&(l.name=sv(Cv(e.slice(e.startsWith(`rename`)?10:8))))}}continue}let g,_;for(;n.length>0&&(n[n.length-1]===`
4
4
  `||n[n.length-1]===`\r`||n[n.length-1]===`\r
5
5
  `||n[n.length-1]===``);)n.pop();let{additionStart:v,deletionStart:y}=p;d=u?d:y-1,f=u?f:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:d,additionLineIndex:f,hunkContent:[],hunkContext:Vv(p.hunkContext),hunkSpecs:sv(c),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<n.length;e++){let t=n[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(!Nv(t)||Pv(t))break;if(o)throw Error(`parsePatchContent: hunk has more lines than expected`)}let r=t[0];if(r!==`+`&&r!==`-`&&r!==` `&&r!==`\\`){if(o)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${r}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let i=Hv(r);if(i===`addition`){if(o&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Uv(t);(g==null||g.type!==`change`)&&(g=Wv(`change`,d,f),b.hunkContent.push(g)),f++,x++,u&&(l.additionLines.push(e),l.additionCharacterCount+=e.length),g.additions++,m++,_=`addition`}else if(i===`deletion`){if(o&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Uv(t);(g==null||g.type!==`change`)&&(g=Wv(`change`,d,f),b.hunkContent.push(g)),d++,S++,u&&(l.deletionLines.push(e),l.deletionCharacterCount+=e.length),g.deletions++,h++,_=`deletion`}else if(i===`context`){if(o&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Uv(t);(g==null||g.type!==`context`)&&(g=Wv(`context`,d,f),b.hunkContent.push(g)),f++,d++,x++,S++,u&&(l.deletionLines.push(e),l.additionLines.push(e),l.deletionCharacterCount+=e.length,l.additionCharacterCount+=e.length),g.lines++,_=`context`}else if(i===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),u&&(_===`addition`||_===`context`)){let e=l.additionLines.length-1;if(e>=0){let t=l.additionLines[e],n=ev(t);l.additionLines[e]=n,l.additionCharacterCount+=n.length-t.length}}if(u&&(_===`deletion`||_===`context`)){let e=l.deletionLines.length-1;if(e>=0){let t=l.deletionLines[e],n=ev(t);l.deletionLines[e]=n,l.deletionCharacterCount+=n.length-t.length}}}}if(x!==b.additionCount||S!==b.deletionCount){if(o)throw Error(`parsePatchContent: hunk line count mismatch`);console.error(`parsePatchContent: hunk line count mismatch: "${c.trimEnd()}", declared old/new ${b.deletionCount}/${b.additionCount}, parsed old/new ${S}/${x}`);let e=X_(b.additionStart,b.additionCount)+(x===0?0:1),t=X_(b.deletionStart,b.deletionCount)+(S===0?0:1);if(!u){let n=e-b.additionStart,r=t-b.deletionStart;b.additionLineIndex+=n,b.deletionLineIndex+=r;for(let e of b.hunkContent)e.additionLineIndex+=n,e.deletionLineIndex+=r}b.additionStart=e,b.deletionStart=t,b.additionCount=x,b.deletionCount=S}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(X_(b.additionStart,b.additionCount)-s,0),l.hunks.push(b),s=Z_(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=l.splitLineCount+b.collapsedBefore,b.unifiedLineStart=l.unifiedLineCount+b.collapsedBefore,l.splitLineCount+=b.collapsedBefore+b.splitLineCount,l.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(l!=null){if(o&&u&&!r&&l.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(l.hunks.length>0&&!u&&l.additionLines.length>0&&l.deletionLines.length>0){let e=l.hunks[l.hunks.length-1],t=Z_(e.additionStart,e.additionCount),n=l.additionLines.length,r=Math.max(n-t,0);l.splitLineCount+=r,l.unifiedLineCount+=r}return r||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type=`rename-changed`:l.type=`rename-pure`:(i==null||i.contents===``)&&a!=null&&a.contents!==``?l.type=`new`:i!=null&&i.contents!==``&&(a==null||a.contents===``)&&(l.type=`deleted`)),l.type!==`rename-pure`&&l.type!==`rename-changed`&&(l.prevName=void 0),n||mv(l),l}}function Sv(e,t={}){let{cacheKeyPrefix:n,throwOnError:r=!1}=t,i=[],a=wv(e)?e.split(K_):[e];for(let e of a)try{i.push(bv(e,t,n==null?void 0:i.length))}catch(e){if(r)throw e;console.error(e)}finally{ov()}return i}function Cv(e,t=!1){let n=e.trim(),r=n.startsWith(`"`)?uv(n)?.fileName??n:n;return t&&(r.startsWith(`a/`)||r.startsWith(`b/`))?r.slice(2):r}function wv(e){return e.startsWith(`From `)||e.includes(`
@@ -1279,7 +1279,7 @@ diff --git`)}function zv(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1279
1279
  }`}function hT(e){return`${pT}
1280
1280
  @layer unsafe {
1281
1281
  ${e}
1282
- }`}var gT=new WeakMap;function _T(e){let t=gT.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(px,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),gT.set(e,i),i}function vT(e,t){if(!e.isConnected)return;let n=_T(t);if(n==null)return;let r=t.querySelector(`style[${mx}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(mx,``),t.appendChild(i)),i.textContent=`:host { ${hx}: ${n}px; }`}var yT;function bT(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){yT??(yT=new CSSStyleSheet,yT.replaceSync(mT(fT)));let t=!1;try{e.adoptedStyleSheets=[yT],t=!0}catch{}if(t){e.querySelector(`style[${dx}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(dx,``),t.textContent=mT(fT),e.prepend(t)}}function xT(e,t){ST(e,t),bT(t),vT(e,t)}function ST(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});xT(this,e)}}if(customElements.define(ux,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(ux)))e instanceof HTMLElement&&xT(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var CT=e=>e.startsWith(`f::`)?e.slice(3):e;function wT(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function TT(e,t){return e===``?t:`${e}/${t}`}function ET({files:e,path:t,isFolder:n,nextBasename:r}){let i=CT(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=wT(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=TT(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function DT(e){return e.endsWith(`/`)}function OT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function kT(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function AT(e,t){return t.includes(e)?kT(t):[e]}function jT(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function MT(e,t){return{draggedPaths:e,target:t}}function NT(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(DT(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function PT(e,t){return t.kind===`root`||t.directoryPath==null?OT(e):t.directoryPath}function FT(e,t){let n=e.map(e=>{let n=PT(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function IT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LT(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!IT(sT.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function RT(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function zT(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function BT(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function VT(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return BT(e,t.path)?n?e:null:e;case`move`:return zT(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=VT(r,e,n),r==null)return null;return r}}}function HT(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function UT(e){switch(e.operation){case`add`:return{...HT(e),operation:`add`,path:e.path};case`remove`:return{...HT(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...HT(e),from:e.from,operation:`move`,to:e.to}}}function WT(e){return{...HT(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>UT(e)),operation:`batch`}}function GT(e){switch(e.operation){case`add`:case`remove`:case`move`:return UT(e);case`batch`:return WT(e);default:return null}}function KT(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function qT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function JT(e){return qT(e).at(-1)??null}function YT(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function XT(e){return e.endsWith(`/`)}var ZT=e=>e.toLowerCase();function QT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function $T(e){return e.endsWith(`/`)?e.slice(0,-1):e}function eE(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var tE=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},nE=Symbol(`FILE_TREE_RENAME_VIEW`),rE=512,iE=512;function aE(e){return e===`top`||e===`center`?e:`nearest`}function oE(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=qT(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function sE(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:oE(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var cE=class e{static{Object.defineProperty(e.prototype,nE,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=LT({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=JT(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:aE(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=iE){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];r!=null&&r===a+1?a=r:(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null?(i=-1,a=-1):(i=r,a=r))}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t!=null&&this.#B.has(t)&&this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);t!=null&&(this.#B.has(t)?this.deselectPath(t):this.selectPath(t))}togglePathSelectionFromInput(e){let t=this.#Ne(e);t!=null&&(this.#B.has(t)?this.#ae([...this.#B].filter(e=>e!==t),t):this.#ae([...this.#B,t],t))}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=AT(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=MT(t.draggedPaths,n);(NT(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}jT(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=MT(e.draggedPaths,t);if(NT(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=FT(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=XT(r),a=$T(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of qT(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=QT(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;this.#T=null,this.#E=``,this.#D=!1,t?this.remove(e,XT(e)?{recursive:!0}:void 0):(this.#Pe(e),this.#De())}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,XT(e)?{recursive:!0}:void 0);return}let t=XT(e),n=ET({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:$T(e)});this.#T=null,this.#E=``,this.#D=!1,`error`in n?(this.#Pe(e),this.#v?.(n.error),this.#De()):n.sourcePath===n.destinationPath?(this.#Pe(e),this.#De()):(this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(eE(n.sourcePath,t),eE(n.destinationPath,t)))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=LT({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!KT(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=JT(e),n=YT(e,t),r=null,i=null;for(let e of this.#be()){if(JT(e)!==t)continue;let a=YT(e,t);if(a<n)r=e;else if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=qT(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!KT(this.#B,r),a=this.#z!==t;(i||a)&&(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new sT({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of qT(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(ZT),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(ZT),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of qT(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:tE(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of qT(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of qT(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=sE(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,rE)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=VT(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=VT(this.#c,e,!0),r=[...this.#B].map(t=>VT(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=VT(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return KT(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&RT(e)&&(this.#i=null);let t=RT(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=GT(e);i!=null&&this.#Oe(i)})}#ze(e){this.#H.isExpanded(e)?this.#ie(e):this.#ke(e)}},lE=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function uE(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1)e[t]!==`/`&&t!==e.length?r===-1&&(r=t):r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1);return n===``?null:{isDirectory:t,path:n}}function dE(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function fE(e,t){return t?`${e}/`:e}function pE(e,t=null){let n=lE(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=hE(t);e!=null&&vE({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function mE(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=gE(e);t!=null&&(c=_E({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=hE(e);t!=null&&(c=vE({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:xE(i),statusByPath:i}:e}function hE(e){return gE(e.path)}function gE(e){let t=uE(e);if(t!=null)return{canonicalPath:fE(t.path,t.isDirectory),isDirectory:t.isDirectory}}function _E({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),bE(t,n,e),!0)}function vE({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??yE(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function yE(e,t,n){for(let r of dE(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function bE(e,t,n){for(let r of dE(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function xE(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME={},NE=[],PE=Array.isArray,FE=NE.slice,IE=Object.assign;function LE(e){e&&e.parentNode&&e.remove()}function RE(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?FE.call(arguments,2):n),zE(e,o,r,i,null)}function zE(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++CE,__i:-1,__u:0};return i==null&&SE.vnode!=null&&SE.vnode(a),a}function BE(e){return e.children}function VE(e,t){this.props=e,this.context=t,this.__g=0}function HE(e,t){if(t==null)return e.__?HE(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?HE(e):null}function UE(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return UE(e)}}function WE(e){(8&e.__g||!(e.__g|=8)||!wE.push(e)||EE++)&&TE==SE.debounceRendering||((TE=SE.debounceRendering)||queueMicrotask)(GE)}function GE(){for(var e,t,n,r,i,a,o,s,c=1;wE.length;)wE.length>c&&wE.sort(DE),e=wE.shift(),c=wE.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=IE({},r)).__v=r.__v+1,SE.vnode&&SE.vnode(n),$E(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??HE(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,tD(a,n,o),n.__e!=i&&UE(n)));EE=0}function KE(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||NE,b=t.length;for(c=qE(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ME:y[m.__i]||ME,m.__i=f,_=$E(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&iD(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=JE(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function qE(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?zE(null,o,null,null,null):PE(o)?zE(BE,{children:o},null,null,null):o.constructor==null&&o.__b>0?zE(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=YE(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=HE(s)),aD(s,s));return r}function JE(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=JE(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=HE(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function YE(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function XE(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function ZE(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||XE(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||XE(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(OE,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=kE,e.addEventListener(t,a?jE:AE,a)):e.removeEventListener(t,a?jE:AE,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function QE(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=kE++;else if(t.u<n.l)return;return n(SE.event?SE.event(t):t)}}}function $E(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=SE.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new VE(v,x),f.constructor=M,f.render=oD),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=IE({},f.__s)),IE(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=SE.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=IE({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===BE&&d.key==null&&(E=nD(d.props.children)),s=KE(e,PE(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)LE(a[j]);eD(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||eD(t);SE.__e(e,t,n)}else s=t.__e=rD(n.__e,t,n,r,i,a,o,c,l,u);return(d=SE.diffed)&&d(t),128&t.__u?void 0:s}function eD(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(eD)}function tD(e,t,n){for(var r=0;r<n.length;r++)iD(n[r],n[++r],n[++r]);SE.__c&&SE.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){SE.__e(e,t.__v)}})}function nD(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:PE(e)?e.map(nD):IE({},e)}function rD(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(SE.__m&&SE.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=FE.call(e.childNodes),v=n.props||ME,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;ZE(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||ZE(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),KE(b==`template`?e.content:e,PE(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&HE(n,0),s,c,l),a!=null)for(u=a.length;u--;)LE(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||ZE(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&ZE(e,u,g,v[u],i))}return e}function iD(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){SE.__e(e,n)}}function aD(e,t,n){var r,i;if(SE.unmount&&SE.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||iD(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){SE.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&aD(r[i],t,n||typeof e.type!=`function`);n||LE(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function oD(e,t,n){return this.constructor(e,n)}function sD(e,t){var n,r,i,a;t==document&&(t=document.documentElement),SE.__&&SE.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=RE(BE,null,[e]),i=[],a=[],$E(t,e,r||ME,ME,t.namespaceURI,r?null:t.firstChild?FE.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),tD(i,e,a)}function cD(e,t){e.__u|=32,sD(e,t)}SE={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw EE=0,e}},CE=0,VE.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=IE({},this.state);typeof e==`function`&&(e=e(IE({},n),this.props)),e&&IE(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),WE(this))},VE.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),WE(this))},VE.prototype.render=BE,wE=[],EE=0,DE=function(e,t){return e.__v.__b-t.__v.__b},OE=/(PointerCapture)$|Capture$/i,kE=0,AE=QE(!1),jE=QE(!0);var lD=0;Array.isArray;function uD(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--lD,__i:-1,__u:0,__source:i,__self:a};return SE.vnode&&SE.vnode(l),l}var dD=16,fD=16,pD={};function mD({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=pD[e]??{width:dD,height:fD},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return uD(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:uD(`use`,{href:c})})}var hD=e=>e!==void 0&&/\s/.test(e),gD=(e,t)=>{let n=t=>hD(e[t-1])||hD(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},_D=e=>gD(e,Math.ceil(e.length/2)),vD=e=>{if(e.length<2)return[e,``];let t=_D(e);return[e.slice(0,t),e.slice(t)]},yD=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:_D(e);return[e.slice(0,r),e.slice(r)]},bD=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},xD=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},SD=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},CD=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function wD({children:e,marker:t,variant:n=`default`}){"use no memo";return uD(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:uD(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?uD(`span`,{"data-truncate-fade":!0}):t})})}function TD(e){"use no memo";let{mode:t,children:n}=e;return uD(`div`,{children:[uD(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?uD(`span`,{children:n}):n}),uD(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?uD(`span`,{children:n}):n})]})}function ED({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=uD(TD,{mode:t,children:e},`content`),o=uD(wD,{marker:n,mode:t,variant:r},`marker`),s=uD(`div`,{"data-truncate-fill":!0},`fill`);return uD(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:uD(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function DD({children:e,...t}){"use no memo";return uD(ED,{mode:`truncate`,...t,children:e})}function OD({children:e,...t}){"use no memo";return uD(ED,{mode:`fruncate`,...t,children:e})}function kD({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=uD(DD,{...s,children:t[0]}),l=uD(OD,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return uD(`div`,{className:a,style:o});if(e.length<i)return uD(n===`end`?OD:DD,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=vD:r===`extension`?t=yD:r===`leaf-path`&&(t=bD);else if(typeof r==`number`)t=xD,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=SD:e===`first`&&(t=CD)}else typeof r==`function`&&(t=r);t??=vD;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=uD(DD,{...s,..._,children:f}),l=uD(OD,{...s,...v,children:p})}return uD(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[uD(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),uD(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var AD={endIndex:-1,startIndex:-1};function jD(e,t,n){return Math.min(Math.max(e,t),n)}function MD(e,t){return e<0||t<e?AD:{endIndex:t,startIndex:e}}function ND(e){return e.startIndex<0||e.endIndex<e.startIndex}function PD(e,t){return ND(e)?0:(e.endIndex-e.startIndex+1)*t}function FD(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function ID(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function LD(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);i==null?t.set(r,[n]):i.push(n)}),t}function RD(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;o<=t?(i=a,n=a+1):r=a-1}return i}function zD(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function BD(e,t,n){if(e.length===0||t<=0)return[];let r=zD(e),i=LD(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=RD(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function VD(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=jD(t.scrollTop,0,o),c=t.stickyRows??BD(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=FD(s,n,t.itemHeight),m=FD(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?AD:MD(m,ID(u+d,n,t.itemHeight)),y=g+1,b=ND(v)?AD:MD(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=PD(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:ND(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var HD={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},UD={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},WD=`Contains git status items`;function GD(e){return e.current?!0:(e.current=!0,!1)}function KD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function qD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return KD({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function JD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function YD(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function XD(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function ZD(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function QD(e,t){return e!=null&&e>0?e:t}function $D(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function eO(e,t,n,r,i=0){let a=KD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function tO(e,t,n,r,i,a,o=0){let s=qD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function nO(e,t,n,r,i,a){let o=JD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function rO(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function iO(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function aO({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return uD(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function oO(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function sO(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var cO,lO,uO,dO,fO=Object.is,pO=0,mO=[],hO=SE,gO=hO.__b,_O=hO.__r,vO=hO.diffed,yO=hO.__c,bO=hO.unmount,xO=hO.__;function SO(e,t){hO.__h&&hO.__h(lO,e,pO||t),pO=0;var n=lO.__H||(lO.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function CO(e){return pO=1,wO(IO,e)}function wO(e,t,n){var r=SO(cO++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):IO(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);fO(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=lO,!lO.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,fO(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};lO.__f=!0;var a=lO.shouldComponentUpdate,o=lO.componentWillUpdate;lO.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},lO.shouldComponentUpdate=i}return r.__N||r.__}function TO(e,t){var n=SO(cO++,3);!hO.__s&&FO(n.__H,t)&&(n.__=e,n.u=t,lO.__H.__h.push(n))}function EO(e,t){var n=SO(cO++,4);!hO.__s&&FO(n.__H,t)&&(n.__=e,n.u=t,lO.__h.push(n))}function DO(e){return pO=5,OO(function(){return{current:e}},[])}function OO(e,t){var n=SO(cO++,7);return FO(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function kO(e,t){return pO=8,OO(function(){return e},t)}function AO(){for(var e;e=mO.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(NO),e.__H.__h.forEach(PO),e.__H.__h=[]}catch(t){e.__H.__h=[],hO.__e(t,e.__v)}}hO.__b=function(e){lO=null,gO&&gO(e)},hO.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xO&&xO(e,t)},hO.__r=function(e){_O&&_O(e),cO=0;var t=(lO=e.__c).__H;t&&(uO===lO?(t.__h=[],lO.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(NO),t.__h.forEach(PO),t.__h=[],cO=0)),uO=lO},hO.diffed=function(e){vO&&vO(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mO.push(t)!==1&&dO===hO.requestAnimationFrame||((dO=hO.requestAnimationFrame)||MO)(AO)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),uO=lO=null},hO.__c=function(e,t){t.some(function(e){try{e.__h.forEach(NO),e.__h=e.__h.filter(function(e){return!e.__||PO(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],hO.__e(n,e.__v)}}),yO&&yO(e,t)},hO.unmount=function(e){bO&&bO(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{NO(e)}catch(e){t=e}}),n.__H=void 0,t&&hO.__e(t,n.__v))};var jO=typeof requestAnimationFrame==`function`;function MO(e){var t,n=function(){clearTimeout(r),jO&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);jO&&(t=requestAnimationFrame(n))}function NO(e){var t=lO,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),lO=t}function PO(e){var t=lO;e.__c=e.__(),lO=t}function FO(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!fO(t,e[n])})}function IO(e,t){return typeof t==`function`?t(e):t}function LO(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:uD(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return uD(BE,{children:[uD(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:uD(DD,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function RO(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function zO(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function BO(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function VO({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=VD(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:BO(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?BO(u,1,t,o):i&&r<=0&&c.length>0?BD(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var HO=400,UO=40,WO=18;function GO(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?KO(e,t,n):a instanceof HTMLElement?a:null}function KO(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function qO(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function JO(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function YO(){return navigator.vendor!==`Apple Computer, Inc.`}function XO(e,t){let n=e-t.top;if(n<UO)return-Math.ceil((UO-Math.max(0,n))/UO*WO);let r=t.bottom-e;return r<UO?Math.ceil((UO-Math.max(0,r))/UO*WO):0}function ZO(e,t){if(e!=null){let t=HD[e];return t==null?null:{text:t,title:UD[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:WD}:null}function QO(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function $O(e){return e!=null&&`toggle`in e}function ek(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function tk(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function nk(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function rk(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function ik(e,t){return t&&rk(e)||(e.ctrlKey||e.metaKey)&&ek(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var ak=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function ok(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function sk(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function ck(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function lk(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function uk(e,t,n){n==null?e.delete(t):e.set(t,n)}function dk(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function fk(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function pk(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function mk(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=pk(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function hk(e,t){return{kind:e.kind,name:zO(e),path:t}}function gk(e){return e==null?void 0:`${e}__tree`}function _k(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function vk(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function yk(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?uD(`span`,{title:e.title,children:e.text}):uD(`span`,{title:e.title,children:e.parts.map((e,t)=>uD(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?vk(e.icon)?t(e.icon):{name:e.icon}:vk(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return uD(`span`,{title:e.title,children:uD(mD,{...n})})}function bk(e){e!=null&&YD(e.querySelector(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??e)}function xk(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=RO(e);return uD(BE,{children:[e.depth>0?uD(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>uD(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,uD(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?uD(mD,{...t(`file-tree-icon-chevron`)}):uD(mD,{...t(`file-tree-icon-file`,u)})}),uD(`div`,{"data-item-section":`content`,children:e.isFlattened?LO(e,c,a):c??uD(kD,{minimumLength:5,split:`extension`,children:e.name})}),i?uD(`div`,{"data-item-section":`decoration`,children:r==null?null:yk(r,t)}):null,s?uD(`div`,{"data-item-section":`git`,children:yk(o,t)}):null,n?uD(`div`,{"data-item-section":`action`,children:l?uD(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:uD(mD,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Sk(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=RO(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??QO(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=ZO(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,q=K?a.getValue():``,ee=R||!K?null:uD(aO,{ref:D,ariaLabel:`Rename ${zO(t)}`,isFlattened:t.isFlattened,value:q,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),J=xk(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:ee,showDecorativeActionAffordance:G}),te={...oO({ariaLabel:zO(t),domId:t.isFocused?_k(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{d()?e.preventDefault():S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:ck(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?uD(`div`,{...te,children:J}):uD(`button`,{...te,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{(R||i.isSearchOpen())&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:J})}function Ck(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(RO(e))).map((n,r)=>Sk(e,n,t.start+r))}function wk({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=dT,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=DO(null),v=DO(null),y=DO(!1),b=DO(null),x=DO(null),S=DO(null),C=DO(null),w=DO(null),T=DO(new Map),E=DO(new Map),D=DO(()=>{}),O=DO(null),k=DO(0),A=DO(!1),j=DO(null);j.current!==t&&(A.current=!1,j.current=t);let M=DO(!1),N=DO(null),P=DO(null),F=DO(!1),I=DO(null),L=DO(null),R=DO(null),z=DO(null),B=DO(null),V=DO(null),H=DO(null),U=DO(null),W=DO(!1),G=DO(null),K=DO(null),q=DO(null),ee=DO(null),J=OO(()=>new Map,[]),[,te]=CO(0),ne=DO(!1),[re,ie]=CO(null),[ae,oe]=CO(null),[se,ce]=CO(null),[le,ue]=CO(null),[de,fe]=CO(0),[pe,me]=CO(null),he=DO(pe);he.current=pe;let ge=DO(null),_e=DO(null),ve=DO(null),ye=DO(null),be=DO(null),xe=DO(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=DO(d===`retain`&&t.isSearchOpen()),[Ee,De]=CO(p);TO(()=>{p||De(!1)},[p]);let Oe=DO(!1),ke=kO(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=CO(()=>VO({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=CO(!1);TO(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;EO(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,oe(t),ue(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let ze=kO((e,t)=>{uk(T.current,e,t)},[]),Be=kO((e,t)=>{uk(E.current,e,t)},[]),Ve=kO(e=>{x.current=e},[]),He=kO(e=>dk(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=OO(()=>Tx(a),[a]),Ge=t[nE](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),Xe=t.getFocusedPath(),Ze=t.getFocusedIndex(),Qe=t.getScrollRequest(),$e=t.isDragAndDropEnabled(),et=t.getDragSession(),tt=OO(()=>et==null?null:new Set(et.draggedPaths),[et]),nt=et?.target??null,rt=et?.primaryPath??null,it=gk(o),{overlayHeight:at,overlayRows:ot,snapshot:st,visibleRows:ct}=Ae,lt=st.physical.viewportHeight,ut=OO(()=>({end:st.window.endIndex,start:st.window.startIndex}),[st.window.endIndex,st.window.startIndex]),dt=ot,ft=st.sticky.rows,pt=st.physical.totalHeight,mt=st.sticky.height,ht=OO(()=>new Set(ft.map(e=>RO(e.row))),[ft]),gt=Ze>=0&&Ze>=ut.start&&Ze<=ut.end,_t=kO((e,t)=>u?.({item:hk(e,t),row:e})??null,[u]),vt=kO(e=>YD(e==null?null:T.current.get(e)??null)?!0:YD(S.current),[]),yt=kO(e=>{vt(t.focusNearestPath(e))},[t,vt]),bt=DO(yt);bt.current=yt;let xt=DO(!0),St=DO(()=>{}),Ct=kO((t=!0)=>{let n=he.current;n!=null&&(xt.current=xt.current&&t,me(null),e?.contextMenu?.onClose?.(),xt.current&&yt(n.path))},[e?.contextMenu,yt]);St.current=Ct;let wt=kO(e=>{let t=e==null?null:lk(S.current,e);ce(e=>e===t?e:t)},[]),Tt=kO((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),M.current=!0,ie(e=>e===n?e:n)}i.focus(),wt(a),xt.current=!0,me({anchorRect:r?.anchorRect??null,item:hk(e,n),path:n,source:r?.source??`keyboard`})},[t,He,wt]),Et=kO(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=ZD(e,lt);I.current=Ze<0||e==null?null:Math.max(0,Math.min(Ze*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(ue(`focus`),te(e=>e+1))}},[t,Ze,s,l,lt]),Dt=kO((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=ZD(i,lt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:VO({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,nO(i,a,s,l,u,d),D.current(),ge.current=n?e:null,!0},[t,s,c,lt,h]),Ot=()=>y.current===!0||ee.current!=null||W.current===!0,kt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),At=e=>{e!=null&&(typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame(e):window.clearTimeout(e))},jt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Mt=()=>{V.current?.remove(),V.current=null},Nt=()=>{At(L.current),L.current=null,B.current=null},Pt=e=>{let t=S.current?.getRootNode();t instanceof ShadowRoot?t.append(e):document.body.append(e)},Ft=()=>{U.current?.(),U.current=null,ee.current!=null&&(clearTimeout(ee.current),ee.current=null),W.current=!1,G.current=null,q.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),Mt(),jt(),Nt(),H.current=null},It=(e,n)=>{let r=S.current?.getRootNode(),i=qO(GO(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Lt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){jt();return}let r=t.getItem(e.directoryPath),i=$O(r)?r:null;if(i==null||i.isExpanded()){jt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(jt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Rt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=XO(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Lt(It(e.clientX,e.clientY)),L.current=kt(Rt)},zt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=kt(Rt)},Bt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Ft(),Mt(),jt(),Nt(),t.startDrag(r)===!1)e.preventDefault();else if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),YO())){let t=JO(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Pt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Y=()=>{Mt(),jt(),Nt(),H.current=null,t.cancelDrag()},Vt=(e,n,r)=>{if(ee.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;q.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;ee.current!=null&&(clearTimeout(ee.current),ee.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null)},s=e=>{let t=e.touches[0],n=q.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,ee.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=JO(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Pt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Lt(It(t.clientX,t.clientY)),zt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&It(n.clientX,n.clientY),t.completeDrag(),Ft()},u=()=>{t.cancelDrag(),Ft()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},HO)},Ht=e=>{if(pe!=null){if(e.key===`Escape`){Ct(),e.preventDefault(),e.stopPropagation();return}ak.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;ue(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Et(Xe??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=ZD(n,lt);I.current=Ze<0||n==null?null:Math.max(0,Math.min(Ze*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ue(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&tk(e)){t.openSearch(e.key),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&rk(e),r=ik(e,Pe),i=r&&S.current!=null?XD(S.current):null,a=r?new Set(fk(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Xe&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=$O(p)?p:null,h=u!=null&&(ht.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=dk(u,E.current,T.current);e==null||n==null?y=!1:Tt(e,u)}else if((e.ctrlKey||e.metaKey)&&ek(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ue(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ht.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),M.current=!0,ie(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,mk(S.current,v,i,u,s,mt,lt)),M.current=!0,ie(e=>e===b?e:b)):Se()}te(e=>e+1),e.preventDefault(),e.stopPropagation()};EO(()=>{f&&Je&&(Te.current?Te.current=!1:YD(w.current))},[Je,f]),EO(()=>{let e=x.current;switch(iO({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ke})){case`reset`:P.current=null;return;case`reveal-canonical`:Ke!=null&&Dt(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ge.current=null,P.current=Ke,YD(e),e.select());return}},[ut.end,ut.start,Ke,Dt,ht]),EO(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=XD(e)?.dataset.itemPath??null;ie(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{t=null,XD(e)==null?(M.current=!1,ie(null)):r()},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ie(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ie(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),EO(()=>{let e=S.current;e!=null&&(st.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[st.physical.scrollTop]),EO(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=ZD(n,g);let a=()=>{let e=t.getVisibleCount(),r=QD(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(VO({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=QD(O.current,g),i=t.getVisibleRows(e,e)[0]??null;eO(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{GD(ne)&&te(e=>e+1),a()}),l=()=>{xe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,fe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&xe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{a(),n.scrollTop>0&&d(),he.current!=null&&y.current&&St.current(),xe.current===!0?y.current=!1:(oe(e=>e==null?e:null),l())},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:$D(e[0]))??ZD(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),EO(()=>{Pe||pe==null||Ct(!1)},[Ct,Pe,pe]);let Ut=OO(()=>pe==null?null:`${pe.path}::${pe.source}`,[pe]);EO(()=>{if(Ut==null){m?.clearSlotContent(_x);return}let t=he.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??sk(n.getBoundingClientRect()),close:e=>{St.current(e?.restoreFocus??!0)},restoreFocus:()=>{xt.current&&bt.current(he.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(_x,i),e?.contextMenu?.onOpen?.(t.item,r),bk(i),queueMicrotask(()=>{i!=null&&i.isConnected&&document.activeElement===i&&bk(i)}),()=>{m?.clearSlotContent(_x)}},[Ut,e?.contextMenu,m]),EO(()=>{pe!=null&&t.getItem(pe.path)==null&&Ct()},[Ct,pe,t]),EO(()=>{if(pe==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(ok(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ct())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ct())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ct,pe]),EO(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Xe;return}let r=Xe==null?null:T.current.get(Xe)??null,i=XD(n),a=i?.dataset.itemPath??null,o=qe&&x.current===i,c=f&&w.current===i,l=F.current&&!Je,u=I.current??0,d=ge.current,p=_e.current,m=ve.current,g=ye.current,_=i!=null,v=M.current||_,y=N.current!==Xe,b=p!=null&&p===Xe&&Xe!=null,E=!1,O=!1;if(Qe!=null&&Qe.id!==k.current){k.current=Qe.id;let n=Qe.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,lt-s))):mt;E=!0,O=tO(e,n,s,lt,pt,Qe.offset,t)}t.clearScrollRequest(Qe.id)}let A=!E&&l&&nO(e,Ze,s,lt,pt,u),j=!E&&d!=null&&d===Xe&&nO(e,Ze,s,lt,pt,mt),P=!E&&m!=null&&m.path===Xe&&nO(e,Ze,s,lt,pt,m.viewportOffset),L=!E&&g!=null&&g.path===Xe&&e.scrollTop!==g.scrollTop;L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Xe&&!b&&eO(e,Ze,s,lt,mt))&&D.current(),E?N.current=Xe:v?o||c&&!l?N.current=Xe:r==null?(l&&Ze>=0&&(nO(e,Ze,s,lt,pt,u),D.current()),N.current=Xe):((y||l||d===Xe||p===Xe||m?.path===Xe||g?.path===Xe||a==null||a!==Xe)&&(YD(r),d===Xe&&(ge.current=null),p===Xe&&(_e.current=null),m?.path===Xe&&(ve.current=null),g?.path===Xe&&(ye.current=null),F.current=!1,I.current=null),N.current=Xe):N.current=Xe},[t,Ze,Xe,gt,s,qe,Je,ut,lt,f,Qe,h,mt,pt,ct]);let Wt=Ze>=0&&Ze>=st.visible.startIndex&&Ze<=st.visible.endIndex,Gt=Xe!=null&&dt.some(e=>RO(e.row)===Xe),Kt=Wt||Gt,qt=Ie&&M.current===!0&&Kt?Xe:null,Jt=le===`pointer`?ae:null,Yt=pe?.path??be.current??Jt??qt??ae,Xt=pe?.source===`right-click`;EO(()=>{y.current&&pe==null||wt(He(Yt))},[pe,He,ut,lt,de,dt,Yt,wt,ct]);let Zt=kO(e=>{if(y.current||ok(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ue(e=>e===`pointer`?e:`pointer`),oe(e=>e===i?e:i)},[]),Qt=kO(()=>{oe(null)},[]);EO(()=>{if(!$e)return;let e=()=>{Ft(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Ft(),t.cancelDrag()}},[t,$e]);let $t=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=qO(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Lt(t.getDragSession()?.target??null),zt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},en=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(jt(),Nt(),t.setDragTarget(null))},tn=e=>{$e&&t.getDragSession()!=null&&!W.current&&(e.preventDefault(),It(e.clientX,e.clientY),t.completeDrag(),Mt(),jt(),Nt(),H.current=null)},nn=st.window.height,rn=st.window.offsetTop,an=Math.min(0,lt-nn),on=Math.min(0,lt-nn-mt),sn=re===Xe||F.current,cn=Xe!=null&&sn&&!gt&&Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null,ln=cn==null?null:rO(Ze,s,ut,nn),un=H.current,dn=rt!=null&&un!=null&&un.path===rt&&un.index>=ut.start&&un.index<=ut.end,fn=rt!=null&&un!=null&&un.path===rt&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:rO(fn.index,s,ut,nn),mn=nk((Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Je&&Xe!=null?_k(o,Xe,!gt):void 0,gn=pe?.path??(Je?Xe:re),_n=pe?.path??ae,vn=He(Yt),yn=Pe&&Ie&&!Xt&&!qe&&vn!=null&&se!=null&&Yt!=null,bn=Pe&&(yn||pe!=null),xn=pe?.anchorRect,Sn=xn==null&&vn!=null&&se!=null&&(pe!=null||yn)?se:null,Cn=xn==null?Sn==null?void 0:{top:`${Sn}px`}:{left:`${xn.left}px`,position:`fixed`,right:`auto`,top:`${xn.top}px`},wn=Xt?{opacity:`0`}:void 0,Tn=kO((e,n,r,i)=>{let a=sO({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Je,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=st.visible.startIndex&&n.index<=st.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ie(e=>e===c?e:c),ue(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Dt(c,{targetOffset:`sticky-parents`})},[t,Je,st.visible.endIndex,st.visible.startIndex,Dt]),En=()=>{if(y.current||!Ie||Yt==null||vn==null)return;let e=t.getItem(Yt);e!=null&&(wt(vn),xt.current=!0,me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Yt,path:e.getPath()},path:e.getPath(),source:`button`}))},Dn={contextHoverPath:_n,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:$e,draggedPathSet:tt,dragTarget:nt,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Y,handleRowDragStart:Bt,handleRowTouchStart:Vt,ignoredGitDirectories:r,ignoredInheritanceCache:J,instanceId:o,itemHeight:s,onKeyDown:Ht,onRowClick:Tn,openContextMenuForRow:Tt,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:_t,resolveIcon:We,shouldSuppressContextMenu:Ot,visualFocusPath:gn},On={...Dn,registerButton:Be};return uD(`div`,{ref:S,id:it,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:$e?en:void 0,onDragOver:$e?$t:void 0,onDrop:$e?tn:void 0,onKeyDown:Ht,onPointerLeave:Pe?Qt:void 0,onPointerOver:Pe?Zt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[uD(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),uD(`slot`,{name:gx,"data-type":`header-slot`}),f?uD(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:uD(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":it,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{(d!==`retain`||Oe.current)&&t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,uD(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&dt.length>0?uD(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:uD(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${at}px`},children:dt.map((e,t)=>Sk(On,e.row,`sticky:${RO(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${dt.length-t}`}}))})}):null,uD(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${pt}px`},children:[uD(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${rn}px`}}),uD(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${nn}px`,top:`${an}px`,bottom:`${on}px`},children:[Ck(Dn,ut,ht),cn!=null&&ln!=null?Sk(Dn,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:rt===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?Sk(Dn,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Pe?uD(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":bn?`true`:`false`,style:Cn,children:[uD(`button`,{ref:v,type:`button`,"data-type":vx,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":pe==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.preventDefault(),e.stopPropagation(),pe==null?En():Ct()},tabIndex:-1,style:wn,children:uD(mD,{...We(`file-tree-icon-ellipsis`)})}),pe==null?null:uD(`slot`,{name:_x})]}):null,pe==null?null:uD(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ct()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ct()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var Tk={hydrateRoot:(e,t)=>{cD(RE(wk,t),e)},renderRoot:(e,t)=>{sD(RE(wk,t),e)},unmountRoot:e=>{sD(null,e)}};function Ek(e,t){Tk.renderRoot(e,t)}function Dk(e,t){Tk.hydrateRoot(e,t)}function Ok(e){Tk.unmountRoot(e)}var kk=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);n===t?t!=null&&(this.#e.set(e,t),this.#r(e,t)):(n?.remove(),t==null?this.#e.delete(e):(this.#e.set(e,t),this.#r(e,t)))}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var Ak=0;function jk(e){return e!=null&&e.length>0?e:(Ak+=1,`pst_ft_${Ak}`)}function Mk({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??dT)}function Nk(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Pk(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function Fk(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Ik=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new kk;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=jk(a),this.#p=pE(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=uT(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new cE({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(Ok(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{t?e():t=!0})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=mE(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Ek(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Ek(t.wrapper,this.#w()))}setGitStatus(e){let t=pE(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Ek(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Ek(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Dk(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Ek(r,this.#w())}#C(){return{initialViewportHeight:Mk({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;e==null?this.#l.setSlotHtml(gx,this.#e?.header?.html??null):this.#l.setSlotContent(gx,e())}#k(e){let t=Fk(e).find(e=>Pk(e)),n=Nk(ox(bx(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=Fk(e),n=t.find(e=>Pk(e)),r=t.filter(e=>e!==n),i=bx(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=Nk(i);if(a==null)for(let e of r)e.remove();else if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=bx(this.#m);t.colored&&cx(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${fx}]`);this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``?(this.#g?.remove(),this.#g=void 0,this.#_=void 0):(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(fx,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=hT(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return xT(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},Lk=e=>e.split(`/`).at(-1)??e,Rk={symlink:`porcelain-symlink`,submodule:`porcelain-submodule`},zk=`viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"`,Bk=`<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
1282
+ }`}var gT=new WeakMap;function _T(e){let t=gT.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(px,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),gT.set(e,i),i}function vT(e,t){if(!e.isConnected)return;let n=_T(t);if(n==null)return;let r=t.querySelector(`style[${mx}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(mx,``),t.appendChild(i)),i.textContent=`:host { ${hx}: ${n}px; }`}var yT;function bT(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){yT??(yT=new CSSStyleSheet,yT.replaceSync(mT(fT)));let t=!1;try{e.adoptedStyleSheets=[yT],t=!0}catch{}if(t){e.querySelector(`style[${dx}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(dx,``),t.textContent=mT(fT),e.prepend(t)}}function xT(e,t){ST(e,t),bT(t),vT(e,t)}function ST(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});xT(this,e)}}if(customElements.define(ux,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(ux)))e instanceof HTMLElement&&xT(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var CT=e=>e.startsWith(`f::`)?e.slice(3):e;function wT(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function TT(e,t){return e===``?t:`${e}/${t}`}function ET({files:e,path:t,isFolder:n,nextBasename:r}){let i=CT(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=wT(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=TT(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function DT(e){return e.endsWith(`/`)}function OT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function kT(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function AT(e,t){return t.includes(e)?kT(t):[e]}function jT(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function MT(e,t){return{draggedPaths:e,target:t}}function NT(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(DT(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function PT(e,t){return t.kind===`root`||t.directoryPath==null?OT(e):t.directoryPath}function FT(e,t){let n=e.map(e=>{let n=PT(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function IT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LT(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!IT(sT.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function RT(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function zT(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function BT(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function VT(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return BT(e,t.path)?n?e:null:e;case`move`:return zT(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=VT(r,e,n),r==null)return null;return r}}}function HT(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function UT(e){switch(e.operation){case`add`:return{...HT(e),operation:`add`,path:e.path};case`remove`:return{...HT(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...HT(e),from:e.from,operation:`move`,to:e.to}}}function WT(e){return{...HT(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>UT(e)),operation:`batch`}}function GT(e){switch(e.operation){case`add`:case`remove`:case`move`:return UT(e);case`batch`:return WT(e);default:return null}}function KT(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function qT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function JT(e){return qT(e).at(-1)??null}function YT(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function XT(e){return e.endsWith(`/`)}var ZT=e=>e.toLowerCase();function QT(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function $T(e){return e.endsWith(`/`)?e.slice(0,-1):e}function eE(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var tE=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},nE=Symbol(`FILE_TREE_RENAME_VIEW`),rE=512,iE=512;function aE(e){return e===`top`||e===`center`?e:`nearest`}function oE(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=qT(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function sE(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:oE(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var cE=class e{static{Object.defineProperty(e.prototype,nE,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=LT({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=JT(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:aE(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=iE){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];r!=null&&r===a+1?a=r:(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null?(i=-1,a=-1):(i=r,a=r))}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t!=null&&this.#B.has(t)&&this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);t!=null&&(this.#B.has(t)?this.deselectPath(t):this.selectPath(t))}togglePathSelectionFromInput(e){let t=this.#Ne(e);t!=null&&(this.#B.has(t)?this.#ae([...this.#B].filter(e=>e!==t),t):this.#ae([...this.#B,t],t))}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=AT(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=MT(t.draggedPaths,n);(NT(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}jT(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=MT(e.draggedPaths,t);if(NT(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=FT(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=XT(r),a=$T(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of qT(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=QT(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;this.#T=null,this.#E=``,this.#D=!1,t?this.remove(e,XT(e)?{recursive:!0}:void 0):(this.#Pe(e),this.#De())}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,XT(e)?{recursive:!0}:void 0);return}let t=XT(e),n=ET({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:$T(e)});this.#T=null,this.#E=``,this.#D=!1,`error`in n?(this.#Pe(e),this.#v?.(n.error),this.#De()):n.sourcePath===n.destinationPath?(this.#Pe(e),this.#De()):(this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(eE(n.sourcePath,t),eE(n.destinationPath,t)))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=LT({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!KT(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=JT(e),n=YT(e,t),r=null,i=null;for(let e of this.#be()){if(JT(e)!==t)continue;let a=YT(e,t);if(a<n)r=e;else if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=qT(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!KT(this.#B,r),a=this.#z!==t;(i||a)&&(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new sT({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of qT(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(ZT),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(ZT),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of qT(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:tE(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of qT(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of qT(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=sE(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,rE)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=VT(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=VT(this.#c,e,!0),r=[...this.#B].map(t=>VT(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=VT(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return KT(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&RT(e)&&(this.#i=null);let t=RT(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=GT(e);i!=null&&this.#Oe(i)})}#ze(e){this.#H.isExpanded(e)?this.#ie(e):this.#ke(e)}},lE=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function uE(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1)e[t]!==`/`&&t!==e.length?r===-1&&(r=t):r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1);return n===``?null:{isDirectory:t,path:n}}function dE(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function fE(e,t){return t?`${e}/`:e}function pE(e,t=null){let n=lE(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=hE(t);e!=null&&vE({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function mE(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=gE(e);t!=null&&(c=_E({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=hE(e);t!=null&&(c=vE({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:xE(i),statusByPath:i}:e}function hE(e){return gE(e.path)}function gE(e){let t=uE(e);if(t!=null)return{canonicalPath:fE(t.path,t.isDirectory),isDirectory:t.isDirectory}}function _E({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),bE(t,n,e),!0)}function vE({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??yE(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function yE(e,t,n){for(let r of dE(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function bE(e,t,n){for(let r of dE(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function xE(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME={},NE=[],PE=Array.isArray,FE=NE.slice,IE=Object.assign;function LE(e){e&&e.parentNode&&e.remove()}function RE(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?FE.call(arguments,2):n),zE(e,o,r,i,null)}function zE(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++CE,__i:-1,__u:0};return i==null&&SE.vnode!=null&&SE.vnode(a),a}function BE(e){return e.children}function VE(e,t){this.props=e,this.context=t,this.__g=0}function HE(e,t){if(t==null)return e.__?HE(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?HE(e):null}function UE(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return UE(e)}}function WE(e){(8&e.__g||!(e.__g|=8)||!wE.push(e)||EE++)&&TE==SE.debounceRendering||((TE=SE.debounceRendering)||queueMicrotask)(GE)}function GE(){for(var e,t,n,r,i,a,o,s,c=1;wE.length;)wE.length>c&&wE.sort(DE),e=wE.shift(),c=wE.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=IE({},r)).__v=r.__v+1,SE.vnode&&SE.vnode(n),$E(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??HE(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,tD(a,n,o),n.__e!=i&&UE(n)));EE=0}function KE(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||NE,b=t.length;for(c=qE(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ME:y[m.__i]||ME,m.__i=f,_=$E(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&iD(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=JE(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function qE(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?zE(null,o,null,null,null):PE(o)?zE(BE,{children:o},null,null,null):o.constructor==null&&o.__b>0?zE(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=YE(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=HE(s)),aD(s,s));return r}function JE(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=JE(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=HE(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function YE(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function XE(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function ZE(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||XE(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||XE(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(OE,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=kE,e.addEventListener(t,a?jE:AE,a)):e.removeEventListener(t,a?jE:AE,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function QE(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=kE++;else if(t.u<n.l)return;return n(SE.event?SE.event(t):t)}}}function $E(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=SE.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new VE(v,x),f.constructor=M,f.render=oD),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=IE({},f.__s)),IE(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=SE.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=IE({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===BE&&d.key==null&&(E=nD(d.props.children)),s=KE(e,PE(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)LE(a[j]);eD(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||eD(t);SE.__e(e,t,n)}else s=t.__e=rD(n.__e,t,n,r,i,a,o,c,l,u);return(d=SE.diffed)&&d(t),128&t.__u?void 0:s}function eD(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(eD)}function tD(e,t,n){for(var r=0;r<n.length;r++)iD(n[r],n[++r],n[++r]);SE.__c&&SE.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){SE.__e(e,t.__v)}})}function nD(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:PE(e)?e.map(nD):IE({},e)}function rD(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(SE.__m&&SE.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=FE.call(e.childNodes),v=n.props||ME,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;ZE(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||ZE(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),KE(b==`template`?e.content:e,PE(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&HE(n,0),s,c,l),a!=null)for(u=a.length;u--;)LE(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||ZE(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&ZE(e,u,g,v[u],i))}return e}function iD(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){SE.__e(e,n)}}function aD(e,t,n){var r,i;if(SE.unmount&&SE.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||iD(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){SE.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&aD(r[i],t,n||typeof e.type!=`function`);n||LE(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function oD(e,t,n){return this.constructor(e,n)}function sD(e,t){var n,r,i,a;t==document&&(t=document.documentElement),SE.__&&SE.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=RE(BE,null,[e]),i=[],a=[],$E(t,e,r||ME,ME,t.namespaceURI,r?null:t.firstChild?FE.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),tD(i,e,a)}function cD(e,t){e.__u|=32,sD(e,t)}SE={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw EE=0,e}},CE=0,VE.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=IE({},this.state);typeof e==`function`&&(e=e(IE({},n),this.props)),e&&IE(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),WE(this))},VE.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),WE(this))},VE.prototype.render=BE,wE=[],EE=0,DE=function(e,t){return e.__v.__b-t.__v.__b},OE=/(PointerCapture)$|Capture$/i,kE=0,AE=QE(!1),jE=QE(!0);var lD=0;Array.isArray;function uD(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--lD,__i:-1,__u:0,__source:i,__self:a};return SE.vnode&&SE.vnode(l),l}var dD=16,fD=16,pD={};function mD({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=pD[e]??{width:dD,height:fD},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return uD(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:uD(`use`,{href:c})})}var hD=e=>e!==void 0&&/\s/.test(e),gD=(e,t)=>{let n=t=>hD(e[t-1])||hD(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},_D=e=>gD(e,Math.ceil(e.length/2)),vD=e=>{if(e.length<2)return[e,``];let t=_D(e);return[e.slice(0,t),e.slice(t)]},yD=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:_D(e);return[e.slice(0,r),e.slice(r)]},bD=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},xD=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},SD=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},CD=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function wD({children:e,marker:t,variant:n=`default`}){"use no memo";return uD(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:uD(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?uD(`span`,{"data-truncate-fade":!0}):t})})}function TD(e){"use no memo";let{mode:t,children:n}=e;return uD(`div`,{children:[uD(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?uD(`span`,{children:n}):n}),uD(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?uD(`span`,{children:n}):n})]})}function ED({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=uD(TD,{mode:t,children:e},`content`),o=uD(wD,{marker:n,mode:t,variant:r},`marker`),s=uD(`div`,{"data-truncate-fill":!0},`fill`);return uD(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:uD(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function DD({children:e,...t}){"use no memo";return uD(ED,{mode:`truncate`,...t,children:e})}function OD({children:e,...t}){"use no memo";return uD(ED,{mode:`fruncate`,...t,children:e})}function kD({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=uD(DD,{...s,children:t[0]}),l=uD(OD,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return uD(`div`,{className:a,style:o});if(e.length<i)return uD(n===`end`?OD:DD,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=vD:r===`extension`?t=yD:r===`leaf-path`&&(t=bD);else if(typeof r==`number`)t=xD,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=SD:e===`first`&&(t=CD)}else typeof r==`function`&&(t=r);t??=vD;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=uD(DD,{...s,..._,children:f}),l=uD(OD,{...s,...v,children:p})}return uD(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[uD(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),uD(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var AD={endIndex:-1,startIndex:-1};function jD(e,t,n){return Math.min(Math.max(e,t),n)}function MD(e,t){return e<0||t<e?AD:{endIndex:t,startIndex:e}}function ND(e){return e.startIndex<0||e.endIndex<e.startIndex}function PD(e,t){return ND(e)?0:(e.endIndex-e.startIndex+1)*t}function FD(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function ID(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function LD(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);i==null?t.set(r,[n]):i.push(n)}),t}function RD(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;o<=t?(i=a,n=a+1):r=a-1}return i}function zD(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function BD(e,t,n){if(e.length===0||t<=0)return[];let r=zD(e),i=LD(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=RD(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function VD(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=jD(t.scrollTop,0,o),c=t.stickyRows??BD(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=FD(s,n,t.itemHeight),m=FD(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?AD:MD(m,ID(u+d,n,t.itemHeight)),y=g+1,b=ND(v)?AD:MD(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=PD(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:ND(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var HD={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},UD={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},WD=`Contains git status items`;function GD(e){return e.current?!0:(e.current=!0,!1)}function KD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function qD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return KD({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function JD(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function YD(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function XD(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function ZD(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function QD(e,t){return e!=null&&e>0?e:t}function $D(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function eO(e,t,n,r,i=0){let a=KD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function tO(e,t,n,r,i,a,o=0){let s=qD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function nO(e,t,n,r,i,a){let o=JD({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function rO(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function iO(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function aO({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return uD(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function oO(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function sO(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var cO,lO,uO,dO,fO=Object.is,pO=0,mO=[],hO=SE,gO=hO.__b,_O=hO.__r,vO=hO.diffed,yO=hO.__c,bO=hO.unmount,xO=hO.__;function SO(e,t){hO.__h&&hO.__h(lO,e,pO||t),pO=0;var n=lO.__H||(lO.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function CO(e){return pO=1,wO(IO,e)}function wO(e,t,n){var r=SO(cO++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):IO(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);fO(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=lO,!lO.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,fO(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};lO.__f=!0;var a=lO.shouldComponentUpdate,o=lO.componentWillUpdate;lO.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},lO.shouldComponentUpdate=i}return r.__N||r.__}function TO(e,t){var n=SO(cO++,3);!hO.__s&&FO(n.__H,t)&&(n.__=e,n.u=t,lO.__H.__h.push(n))}function EO(e,t){var n=SO(cO++,4);!hO.__s&&FO(n.__H,t)&&(n.__=e,n.u=t,lO.__h.push(n))}function DO(e){return pO=5,OO(function(){return{current:e}},[])}function OO(e,t){var n=SO(cO++,7);return FO(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function kO(e,t){return pO=8,OO(function(){return e},t)}function AO(){for(var e;e=mO.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(NO),e.__H.__h.forEach(PO),e.__H.__h=[]}catch(t){e.__H.__h=[],hO.__e(t,e.__v)}}hO.__b=function(e){lO=null,gO&&gO(e)},hO.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xO&&xO(e,t)},hO.__r=function(e){_O&&_O(e),cO=0;var t=(lO=e.__c).__H;t&&(uO===lO?(t.__h=[],lO.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(NO),t.__h.forEach(PO),t.__h=[],cO=0)),uO=lO},hO.diffed=function(e){vO&&vO(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mO.push(t)!==1&&dO===hO.requestAnimationFrame||((dO=hO.requestAnimationFrame)||MO)(AO)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),uO=lO=null},hO.__c=function(e,t){t.some(function(e){try{e.__h.forEach(NO),e.__h=e.__h.filter(function(e){return!e.__||PO(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],hO.__e(n,e.__v)}}),yO&&yO(e,t)},hO.unmount=function(e){bO&&bO(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{NO(e)}catch(e){t=e}}),n.__H=void 0,t&&hO.__e(t,n.__v))};var jO=typeof requestAnimationFrame==`function`;function MO(e){var t,n=function(){clearTimeout(r),jO&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);jO&&(t=requestAnimationFrame(n))}function NO(e){var t=lO,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),lO=t}function PO(e){var t=lO;e.__c=e.__(),lO=t}function FO(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!fO(t,e[n])})}function IO(e,t){return typeof t==`function`?t(e):t}function LO(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:uD(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return uD(BE,{children:[uD(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:uD(DD,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function RO(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function zO(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function BO(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function VO({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=VD(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:BO(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?BO(u,1,t,o):i&&r<=0&&c.length>0?BD(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var HO=400,UO=40,WO=18;function GO(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?KO(e,t,n):a instanceof HTMLElement?a:null}function KO(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function qO(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function JO(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function YO(){return navigator.vendor!==`Apple Computer, Inc.`}function XO(e,t){let n=e-t.top;if(n<UO)return-Math.ceil((UO-Math.max(0,n))/UO*WO);let r=t.bottom-e;return r<UO?Math.ceil((UO-Math.max(0,r))/UO*WO):0}function ZO(e,t){if(e!=null){let t=HD[e];return t==null?null:{text:t,title:UD[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:WD}:null}function QO(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function $O(e){return e!=null&&`toggle`in e}function ek(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function tk(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function nk(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function rk(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function ik(e,t){return t&&rk(e)||(e.ctrlKey||e.metaKey)&&ek(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var ak=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function ok(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function sk(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function ck(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function lk(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function uk(e,t,n){n==null?e.delete(t):e.set(t,n)}function dk(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function fk(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function pk(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function mk(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=pk(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function hk(e,t){return{kind:e.kind,name:zO(e),path:t}}function gk(e){return e==null?void 0:`${e}__tree`}function _k(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function vk(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function yk(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?uD(`span`,{title:e.title,children:e.text}):uD(`span`,{title:e.title,children:e.parts.map((e,t)=>uD(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?vk(e.icon)?t(e.icon):{name:e.icon}:vk(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return uD(`span`,{title:e.title,children:uD(mD,{...n})})}function bk(e){e!=null&&YD(e.querySelector(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??e)}function xk(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=RO(e);return uD(BE,{children:[e.depth>0?uD(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>uD(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,uD(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?uD(mD,{...t(`file-tree-icon-chevron`)}):uD(mD,{...t(`file-tree-icon-file`,u)})}),uD(`div`,{"data-item-section":`content`,children:e.isFlattened?LO(e,c,a):c??uD(kD,{minimumLength:5,split:`extension`,children:e.name})}),i?uD(`div`,{"data-item-section":`decoration`,children:r==null?null:yk(r,t)}):null,s?uD(`div`,{"data-item-section":`git`,children:yk(o,t)}):null,n?uD(`div`,{"data-item-section":`action`,children:l?uD(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:uD(mD,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Sk(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=RO(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??QO(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=ZO(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,q=K?a.getValue():``,J=R||!K?null:uD(aO,{ref:D,ariaLabel:`Rename ${zO(t)}`,isFlattened:t.isFlattened,value:q,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ee=xk(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:J,showDecorativeActionAffordance:G}),te={...oO({ariaLabel:zO(t),domId:t.isFocused?_k(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{d()?e.preventDefault():S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:ck(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?uD(`div`,{...te,children:ee}):uD(`button`,{...te,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{(R||i.isSearchOpen())&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ee})}function Ck(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(RO(e))).map((n,r)=>Sk(e,n,t.start+r))}function wk({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=dT,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=DO(null),v=DO(null),y=DO(!1),b=DO(null),x=DO(null),S=DO(null),C=DO(null),w=DO(null),T=DO(new Map),E=DO(new Map),D=DO(()=>{}),O=DO(null),k=DO(0),A=DO(!1),j=DO(null);j.current!==t&&(A.current=!1,j.current=t);let M=DO(!1),N=DO(null),P=DO(null),F=DO(!1),I=DO(null),L=DO(null),R=DO(null),z=DO(null),B=DO(null),V=DO(null),H=DO(null),U=DO(null),W=DO(!1),G=DO(null),K=DO(null),q=DO(null),J=DO(null),ee=OO(()=>new Map,[]),[,te]=CO(0),ne=DO(!1),[re,ie]=CO(null),[ae,oe]=CO(null),[se,ce]=CO(null),[le,ue]=CO(null),[de,fe]=CO(0),[pe,me]=CO(null),he=DO(pe);he.current=pe;let ge=DO(null),_e=DO(null),ve=DO(null),ye=DO(null),be=DO(null),xe=DO(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=DO(d===`retain`&&t.isSearchOpen()),[Ee,De]=CO(p);TO(()=>{p||De(!1)},[p]);let Oe=DO(!1),ke=kO(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=CO(()=>VO({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=CO(!1);TO(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;EO(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,oe(t),ue(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let ze=kO((e,t)=>{uk(T.current,e,t)},[]),Be=kO((e,t)=>{uk(E.current,e,t)},[]),Ve=kO(e=>{x.current=e},[]),He=kO(e=>dk(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=OO(()=>Tx(a),[a]),Ge=t[nE](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),Xe=t.getFocusedPath(),Ze=t.getFocusedIndex(),Qe=t.getScrollRequest(),$e=t.isDragAndDropEnabled(),et=t.getDragSession(),tt=OO(()=>et==null?null:new Set(et.draggedPaths),[et]),nt=et?.target??null,rt=et?.primaryPath??null,it=gk(o),{overlayHeight:at,overlayRows:ot,snapshot:st,visibleRows:ct}=Ae,lt=st.physical.viewportHeight,ut=OO(()=>({end:st.window.endIndex,start:st.window.startIndex}),[st.window.endIndex,st.window.startIndex]),dt=ot,ft=st.sticky.rows,pt=st.physical.totalHeight,mt=st.sticky.height,ht=OO(()=>new Set(ft.map(e=>RO(e.row))),[ft]),gt=Ze>=0&&Ze>=ut.start&&Ze<=ut.end,_t=kO((e,t)=>u?.({item:hk(e,t),row:e})??null,[u]),vt=kO(e=>YD(e==null?null:T.current.get(e)??null)?!0:YD(S.current),[]),yt=kO(e=>{vt(t.focusNearestPath(e))},[t,vt]),bt=DO(yt);bt.current=yt;let xt=DO(!0),St=DO(()=>{}),Ct=kO((t=!0)=>{let n=he.current;n!=null&&(xt.current=xt.current&&t,me(null),e?.contextMenu?.onClose?.(),xt.current&&yt(n.path))},[e?.contextMenu,yt]);St.current=Ct;let wt=kO(e=>{let t=e==null?null:lk(S.current,e);ce(e=>e===t?e:t)},[]),Tt=kO((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),M.current=!0,ie(e=>e===n?e:n)}i.focus(),wt(a),xt.current=!0,me({anchorRect:r?.anchorRect??null,item:hk(e,n),path:n,source:r?.source??`keyboard`})},[t,He,wt]),Et=kO(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=ZD(e,lt);I.current=Ze<0||e==null?null:Math.max(0,Math.min(Ze*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(ue(`focus`),te(e=>e+1))}},[t,Ze,s,l,lt]),Dt=kO((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=ZD(i,lt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:VO({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,nO(i,a,s,l,u,d),D.current(),ge.current=n?e:null,!0},[t,s,c,lt,h]),Ot=()=>y.current===!0||J.current!=null||W.current===!0,kt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),At=e=>{e!=null&&(typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame(e):window.clearTimeout(e))},jt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Mt=()=>{V.current?.remove(),V.current=null},Nt=()=>{At(L.current),L.current=null,B.current=null},Pt=e=>{let t=S.current?.getRootNode();t instanceof ShadowRoot?t.append(e):document.body.append(e)},Ft=()=>{U.current?.(),U.current=null,J.current!=null&&(clearTimeout(J.current),J.current=null),W.current=!1,G.current=null,q.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),Mt(),jt(),Nt(),H.current=null},It=(e,n)=>{let r=S.current?.getRootNode(),i=qO(GO(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Lt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){jt();return}let r=t.getItem(e.directoryPath),i=$O(r)?r:null;if(i==null||i.isExpanded()){jt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(jt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Rt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=XO(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Lt(It(e.clientX,e.clientY)),L.current=kt(Rt)},zt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=kt(Rt)},Bt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Ft(),Mt(),jt(),Nt(),t.startDrag(r)===!1)e.preventDefault();else if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),YO())){let t=JO(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Pt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Y=()=>{Mt(),jt(),Nt(),H.current=null,t.cancelDrag()},Vt=(e,n,r)=>{if(J.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;q.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;J.current!=null&&(clearTimeout(J.current),J.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null)},s=e=>{let t=e.touches[0],n=q.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,J.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=JO(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Pt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Lt(It(t.clientX,t.clientY)),zt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&It(n.clientX,n.clientY),t.completeDrag(),Ft()},u=()=>{t.cancelDrag(),Ft()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},HO)},Ht=e=>{if(pe!=null){if(e.key===`Escape`){Ct(),e.preventDefault(),e.stopPropagation();return}ak.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;ue(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Et(Xe??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=ZD(n,lt);I.current=Ze<0||n==null?null:Math.max(0,Math.min(Ze*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ue(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&tk(e)){t.openSearch(e.key),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&rk(e),r=ik(e,Pe),i=r&&S.current!=null?XD(S.current):null,a=r?new Set(fk(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Xe&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=$O(p)?p:null,h=u!=null&&(ht.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=dk(u,E.current,T.current);e==null||n==null?y=!1:Tt(e,u)}else if((e.ctrlKey||e.metaKey)&&ek(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ue(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ht.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),M.current=!0,ie(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,mk(S.current,v,i,u,s,mt,lt)),M.current=!0,ie(e=>e===b?e:b)):Se()}te(e=>e+1),e.preventDefault(),e.stopPropagation()};EO(()=>{f&&Je&&(Te.current?Te.current=!1:YD(w.current))},[Je,f]),EO(()=>{let e=x.current;switch(iO({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ke})){case`reset`:P.current=null;return;case`reveal-canonical`:Ke!=null&&Dt(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ge.current=null,P.current=Ke,YD(e),e.select());return}},[ut.end,ut.start,Ke,Dt,ht]),EO(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=XD(e)?.dataset.itemPath??null;ie(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{t=null,XD(e)==null?(M.current=!1,ie(null)):r()},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ie(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ie(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),EO(()=>{let e=S.current;e!=null&&(st.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[st.physical.scrollTop]),EO(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=ZD(n,g);let a=()=>{let e=t.getVisibleCount(),r=QD(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(VO({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=QD(O.current,g),i=t.getVisibleRows(e,e)[0]??null;eO(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{GD(ne)&&te(e=>e+1),a()}),l=()=>{xe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,fe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&xe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{a(),n.scrollTop>0&&d(),he.current!=null&&y.current&&St.current(),xe.current===!0?y.current=!1:(oe(e=>e==null?e:null),l())},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:$D(e[0]))??ZD(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),EO(()=>{Pe||pe==null||Ct(!1)},[Ct,Pe,pe]);let Ut=OO(()=>pe==null?null:`${pe.path}::${pe.source}`,[pe]);EO(()=>{if(Ut==null){m?.clearSlotContent(_x);return}let t=he.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??sk(n.getBoundingClientRect()),close:e=>{St.current(e?.restoreFocus??!0)},restoreFocus:()=>{xt.current&&bt.current(he.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(_x,i),e?.contextMenu?.onOpen?.(t.item,r),bk(i),queueMicrotask(()=>{i!=null&&i.isConnected&&document.activeElement===i&&bk(i)}),()=>{m?.clearSlotContent(_x)}},[Ut,e?.contextMenu,m]),EO(()=>{pe!=null&&t.getItem(pe.path)==null&&Ct()},[Ct,pe,t]),EO(()=>{if(pe==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(ok(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ct())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ct())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ct,pe]),EO(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Xe;return}let r=Xe==null?null:T.current.get(Xe)??null,i=XD(n),a=i?.dataset.itemPath??null,o=qe&&x.current===i,c=f&&w.current===i,l=F.current&&!Je,u=I.current??0,d=ge.current,p=_e.current,m=ve.current,g=ye.current,_=i!=null,v=M.current||_,y=N.current!==Xe,b=p!=null&&p===Xe&&Xe!=null,E=!1,O=!1;if(Qe!=null&&Qe.id!==k.current){k.current=Qe.id;let n=Qe.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,lt-s))):mt;E=!0,O=tO(e,n,s,lt,pt,Qe.offset,t)}t.clearScrollRequest(Qe.id)}let A=!E&&l&&nO(e,Ze,s,lt,pt,u),j=!E&&d!=null&&d===Xe&&nO(e,Ze,s,lt,pt,mt),P=!E&&m!=null&&m.path===Xe&&nO(e,Ze,s,lt,pt,m.viewportOffset),L=!E&&g!=null&&g.path===Xe&&e.scrollTop!==g.scrollTop;L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Xe&&!b&&eO(e,Ze,s,lt,mt))&&D.current(),E?N.current=Xe:v?o||c&&!l?N.current=Xe:r==null?(l&&Ze>=0&&(nO(e,Ze,s,lt,pt,u),D.current()),N.current=Xe):((y||l||d===Xe||p===Xe||m?.path===Xe||g?.path===Xe||a==null||a!==Xe)&&(YD(r),d===Xe&&(ge.current=null),p===Xe&&(_e.current=null),m?.path===Xe&&(ve.current=null),g?.path===Xe&&(ye.current=null),F.current=!1,I.current=null),N.current=Xe):N.current=Xe},[t,Ze,Xe,gt,s,qe,Je,ut,lt,f,Qe,h,mt,pt,ct]);let Wt=Ze>=0&&Ze>=st.visible.startIndex&&Ze<=st.visible.endIndex,Gt=Xe!=null&&dt.some(e=>RO(e.row)===Xe),Kt=Wt||Gt,qt=Ie&&M.current===!0&&Kt?Xe:null,Jt=le===`pointer`?ae:null,Yt=pe?.path??be.current??Jt??qt??ae,Xt=pe?.source===`right-click`;EO(()=>{y.current&&pe==null||wt(He(Yt))},[pe,He,ut,lt,de,dt,Yt,wt,ct]);let Zt=kO(e=>{if(y.current||ok(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ue(e=>e===`pointer`?e:`pointer`),oe(e=>e===i?e:i)},[]),Qt=kO(()=>{oe(null)},[]);EO(()=>{if(!$e)return;let e=()=>{Ft(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Ft(),t.cancelDrag()}},[t,$e]);let $t=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=qO(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Lt(t.getDragSession()?.target??null),zt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},en=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(jt(),Nt(),t.setDragTarget(null))},tn=e=>{$e&&t.getDragSession()!=null&&!W.current&&(e.preventDefault(),It(e.clientX,e.clientY),t.completeDrag(),Mt(),jt(),Nt(),H.current=null)},nn=st.window.height,rn=st.window.offsetTop,an=Math.min(0,lt-nn),on=Math.min(0,lt-nn-mt),sn=re===Xe||F.current,cn=Xe!=null&&sn&&!gt&&Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null,ln=cn==null?null:rO(Ze,s,ut,nn),un=H.current,dn=rt!=null&&un!=null&&un.path===rt&&un.index>=ut.start&&un.index<=ut.end,fn=rt!=null&&un!=null&&un.path===rt&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:rO(fn.index,s,ut,nn),mn=nk((Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Je&&Xe!=null?_k(o,Xe,!gt):void 0,gn=pe?.path??(Je?Xe:re),_n=pe?.path??ae,vn=He(Yt),yn=Pe&&Ie&&!Xt&&!qe&&vn!=null&&se!=null&&Yt!=null,bn=Pe&&(yn||pe!=null),xn=pe?.anchorRect,Sn=xn==null&&vn!=null&&se!=null&&(pe!=null||yn)?se:null,Cn=xn==null?Sn==null?void 0:{top:`${Sn}px`}:{left:`${xn.left}px`,position:`fixed`,right:`auto`,top:`${xn.top}px`},wn=Xt?{opacity:`0`}:void 0,Tn=kO((e,n,r,i)=>{let a=sO({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Je,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=st.visible.startIndex&&n.index<=st.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ie(e=>e===c?e:c),ue(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Dt(c,{targetOffset:`sticky-parents`})},[t,Je,st.visible.endIndex,st.visible.startIndex,Dt]),En=()=>{if(y.current||!Ie||Yt==null||vn==null)return;let e=t.getItem(Yt);e!=null&&(wt(vn),xt.current=!0,me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Yt,path:e.getPath()},path:e.getPath(),source:`button`}))},Dn={contextHoverPath:_n,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:$e,draggedPathSet:tt,dragTarget:nt,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Y,handleRowDragStart:Bt,handleRowTouchStart:Vt,ignoredGitDirectories:r,ignoredInheritanceCache:ee,instanceId:o,itemHeight:s,onKeyDown:Ht,onRowClick:Tn,openContextMenuForRow:Tt,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:_t,resolveIcon:We,shouldSuppressContextMenu:Ot,visualFocusPath:gn},On={...Dn,registerButton:Be};return uD(`div`,{ref:S,id:it,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:$e?en:void 0,onDragOver:$e?$t:void 0,onDrop:$e?tn:void 0,onKeyDown:Ht,onPointerLeave:Pe?Qt:void 0,onPointerOver:Pe?Zt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[uD(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),uD(`slot`,{name:gx,"data-type":`header-slot`}),f?uD(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:uD(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":it,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{(d!==`retain`||Oe.current)&&t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,uD(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&dt.length>0?uD(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:uD(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${at}px`},children:dt.map((e,t)=>Sk(On,e.row,`sticky:${RO(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${dt.length-t}`}}))})}):null,uD(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${pt}px`},children:[uD(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${rn}px`}}),uD(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${nn}px`,top:`${an}px`,bottom:`${on}px`},children:[Ck(Dn,ut,ht),cn!=null&&ln!=null?Sk(Dn,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:rt===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?Sk(Dn,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Pe?uD(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":bn?`true`:`false`,style:Cn,children:[uD(`button`,{ref:v,type:`button`,"data-type":vx,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":pe==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.preventDefault(),e.stopPropagation(),pe==null?En():Ct()},tabIndex:-1,style:wn,children:uD(mD,{...We(`file-tree-icon-ellipsis`)})}),pe==null?null:uD(`slot`,{name:_x})]}):null,pe==null?null:uD(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ct()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ct()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var Tk={hydrateRoot:(e,t)=>{cD(RE(wk,t),e)},renderRoot:(e,t)=>{sD(RE(wk,t),e)},unmountRoot:e=>{sD(null,e)}};function Ek(e,t){Tk.renderRoot(e,t)}function Dk(e,t){Tk.hydrateRoot(e,t)}function Ok(e){Tk.unmountRoot(e)}var kk=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);n===t?t!=null&&(this.#e.set(e,t),this.#r(e,t)):(n?.remove(),t==null?this.#e.delete(e):(this.#e.set(e,t),this.#r(e,t)))}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var Ak=0;function jk(e){return e!=null&&e.length>0?e:(Ak+=1,`pst_ft_${Ak}`)}function Mk({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??dT)}function Nk(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Pk(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function Fk(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Ik=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new kk;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=jk(a),this.#p=pE(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=uT(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new cE({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(Ok(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{t?e():t=!0})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=mE(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Ek(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Ek(t.wrapper,this.#w()))}setGitStatus(e){let t=pE(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Ek(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Ek(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Dk(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Ek(r,this.#w())}#C(){return{initialViewportHeight:Mk({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;e==null?this.#l.setSlotHtml(gx,this.#e?.header?.html??null):this.#l.setSlotContent(gx,e())}#k(e){let t=Fk(e).find(e=>Pk(e)),n=Nk(ox(bx(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=Fk(e),n=t.find(e=>Pk(e)),r=t.filter(e=>e!==n),i=bx(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=Nk(i);if(a==null)for(let e of r)e.remove();else if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=bx(this.#m);t.colored&&cx(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${fx}]`);this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``?(this.#g?.remove(),this.#g=void 0,this.#_=void 0):(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(fx,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=hT(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return xT(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},Lk=e=>e.split(`/`).at(-1)??e,Rk={symlink:`porcelain-symlink`,submodule:`porcelain-submodule`},zk=`viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"`,Bk=`<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
1283
1283
  <symbol id="${Rk.symlink}" ${zk}>
1284
1284
  <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
1285
1285
  <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
@@ -1340,18 +1340,18 @@ diff --git`)}function nN(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1340
1340
  `)}</${n}>`}function AL(e,t,n,r){return`<${e}${n?` style="text-align:${n}"`:``}>${SL(t.children,r)}</${e}>`}function jL(e,t){for(let n of t.extensions??[]){let r=n.renderHtml?.(e,{options:t,renderBlock:e=>bL(e,t),renderInline:e=>xL(e,t)});if(r!==void 0)return r}}function ML(e,t){let n=t.headingAnchors;if(!e||!n)return``;let r=typeof n==`object`?n:{};return`<a href="#${PI(e)}" aria-hidden="${r.ariaHidden??!0}" class="${PI(r.className??`anchor-heading anchor-heading-link`)}" tabindex="${r.tabIndex??-1}">${NI(r.content??`#`)}</a>`}function NL(e){let t={...e.properties};return e.tagName||(t[`data-component`]=e.name,t[`data-attributes`]||=JSON.stringify(e.attributes)),Object.entries(t).map(([e,t])=>` ${e}="${PI(t)}"`).join(``)}function PL(e={}){return{name:`heading-collection`,transformDocument(t){return{...t,headings:FL(t,e)}}}}function FL(e,t={}){let n=[],r=new Set(t.skipComponentNames??[`tabs`]);return IL(e.children,n,void 0,r),n}function IL(e,t,n,r){for(let i of e)if(i.type===`heading`){if(i.id){let e={id:i.id,text:LI(i.children),level:i.depth},r=i.framework??n;r&&(e.framework=r),t.push(e)}}else if(i.type===`list`)for(let e of i.items)IL(e.children,t,n,r);else if(i.type===`blockquote`||i.type===`callout`)IL(i.children,t,n,r);else if(i.type===`component`){let e=i.name.toLowerCase();if(r.has(e))continue;let a=i.tagName===`md-framework-panel`?i.properties?.[`data-framework`]??n:n;IL(i.children,t,a,r)}}var LL=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i,RL=[{name:`porcelain-quotes`,parseBlock(e){if(!/^ {0,3}>/.test(e.lines[e.index]??``))return;let t=[],n=e.index;for(;n<e.lines.length;){let r=/^ {0,3}>\s?(.*)$/.exec(e.lines[n]??``);if(!r)break;t.push(r[1]??``),n+=1}e.consume(n-e.index);let r=LL.exec(t[0]??``)?.[1]?.toLowerCase();return r?{type:`callout`,kind:r,title:r.slice(0,1).toUpperCase()+r.slice(1),children:e.parseBlocks(t.slice(1).join(`
1341
1341
  `))}:{type:`blockquote`,children:e.parseBlocks(t.join(`
1342
1342
  `))}}},PL()];function zL(e){return oL(e,{allowHtml:!0,extensions:RL})}function BL(e,t,n){let r=new DOMParser().parseFromString(yL(typeof e==`string`?zL(e):e,{allowHtml:!0,extensions:RL}),`text/html`),i=e=>Array.from(e.childNodes,(e,t)=>a(e,t)),a=(e,r)=>{if(e.nodeType===Node.TEXT_NODE){let r=e.textContent??``;return e.parentElement?.tagName===`DETAILS`&&r.trim()?BL(r,t,n):r}if(!(e instanceof Element))return null;let a={};for(let t of Array.from(e.attributes))a[t.name.toLowerCase()]=t.value;let o=AI(e.tagName,a,t);return o.kind===`drop`?null:o.kind===`unwrap`?i(e):n(o,o.empty?[]:i(e),r)};return i(r.body)}var VL=new Set(Object.values(ru).filter(e=>e!==void 0));function HL(e){return VL.has(e)?e:ru[e]??`text`}function UL(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(UL).join(``):(0,Z.isValidElement)(e)?UL(e.props.children):``}var WL=new Set([`text`,`plaintext`,`plain`,`txt`]);function GL(e){let t=(0,$.c)(28),{language:n,children:r}=e,{dark:i}=Xd(),a;if(t[0]!==r){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\n$/,t[2]=e):e=t[2],a=UL(Z.Children.toArray(r)).replace(e,``),t[0]=r,t[1]=a}else a=t[1];let o=a,s;t[3]===n?s=t[4]:(s=HL(n),t[3]=n,t[4]=s);let c=s,l=WL.has(n)?``:n,u;t[5]===n?u=t[6]:(u=n===`mermaid`&&(0,Q.jsx)(`span`,{className:`font-sans`,children:` · diagram shown as source`}),t[5]=n,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`span`,{className:`whitespace-nowrap`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]===o?f=t[11]:(f=(0,Q.jsx)(qL,{text:o}),t[10]=o,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(`figcaption`,{className:`flex h-8 items-center justify-between gap-2 border-b bg-muted/50 pr-1 pl-3 font-mono text-2xs text-muted-foreground`,children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]!==o||t[16]!==c?(m={name:`snippet`,contents:o,lang:c},t[15]=o,t[16]=c,t[17]=m):m=t[17];let h;t[18]===i?h=t[19]:(h=KL(i),t[18]=i,t[19]=h);let g;t[20]===h?g=t[21]:(g={...h,disableLineNumbers:!0},t[20]=h,t[21]=g);let _;t[22]!==g||t[23]!==m?(_=(0,Q.jsx)(cI,{file:m,options:g}),t[22]=g,t[23]=m,t[24]=_):_=t[24];let v;return t[25]!==_||t[26]!==p?(v=(0,Q.jsxs)(`figure`,{className:`group/code my-4 min-w-0 overflow-hidden rounded-lg border bg-card`,children:[p,_]}),t[25]=_,t[26]=p,t[27]=v):v=t[27],v}function KL(e){let t=of(e?`dark`:`light`,{overflow:`scroll`});return{...t,unsafeCSS:`${t.unsafeCSS??``}
1343
- [data-code] [data-line] { padding-inline: calc(var(--spacing) * 3); }`}}function qL(e){let t=(0,$.c)(13),{text:n}=e,[r,i]=(0,Z.useState)(!1),a;t[0]===n?a=t[1]:(a=()=>{Zt(n,`code`),i(!0)},t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>i(!1),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":`Copy code`,onClick:a,onMouseLeave:o}),t[3]=a,t[4]=s);let c;t[5]===r?c=t[6]:(c=r?(0,Q.jsx)(Dn,{}):(0,Q.jsx)(Bs,{}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,Q.jsx)(Ze,{render:s,children:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Copy code`}),t[10]=u):u=t[10];let d;return t[11]===l?d=t[12]:(d=(0,Q.jsxs)(ot,{children:[l,u]}),t[11]=l,t[12]=d),d}var JL={"alert-note":{label:`Note`,icon:Gr,tone:`border-graph-1 [--alert:var(--graph-1)]`},"alert-tip":{label:`Tip`,icon:Fg,tone:`border-graph-2 [--alert:var(--graph-2)]`},"alert-important":{label:`Important`,icon:Zg,tone:`border-graph-3 [--alert:var(--graph-3)]`},"alert-warning":{label:`Warning`,icon:qi,tone:`border-graph-4 [--alert:var(--graph-4)]`},"alert-caution":{label:`Caution`,icon:t_,tone:`border-del-fg [--alert:var(--del-fg)]`}};function YL(e){let t=(0,$.c)(16),{role:n,children:r}=e,i=JL[n];if(!i){let e;return t[0]===r?e=t[1]:(e=(0,Q.jsx)(`div`,{children:r}),t[0]=r,t[1]=e),e}let a=i.icon,o;t[2]===r?o=t[3]:([,...o]=r,t[2]=r,t[3]=o);let s=i.label,c;t[4]===i.tone?c=t[5]:(c=Y(`my-4 border-l-3 py-0.5 pl-4 [&>div>:first-child]:mt-0 [&>div>:last-child]:mb-0`,i.tone),t[4]=i.tone,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,Q.jsx)(a,{className:`size-4`,"aria-hidden":!0}),t[6]=a,t[7]=l);let u;t[8]!==i.label||t[9]!==l?(u=(0,Q.jsxs)(`p`,{className:`mb-1 flex items-center gap-1.5 font-medium text-(--alert)`,children:[l,i.label]}),t[8]=i.label,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==i.label||t[12]!==o||t[13]!==c||t[14]!==u?(d=(0,Q.jsxs)(`div`,{role:`note`,"aria-label":s,className:c,children:[u,o]}),t[11]=i.label,t[12]=o,t[13]=c,t[14]=u,t[15]=d):d=t[15],d}function XL(e){let t=(0,$.c)(5),{alt:n,reason:r}=e,i=n||r,a=n?`${n} · ${r}`:r,o;t[0]===a?o=t[1]:(o=(0,Q.jsx)(`span`,{className:`wrap-anywhere`,children:a}),t[0]=a,t[1]=o);let s;return t[2]!==i||t[3]!==o?(s=(0,Q.jsx)(`span`,{role:`img`,"aria-label":i,className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-0.5 align-middle text-caption text-muted-foreground`,children:o}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ZL(e,t){let n=(0,$.c)(13),r=e&&t?.kind===`repository`?t.path:void 0,i;n[0]===e?.scope?i=n[1]:(i=e?.scope??{projectId:``,worktreeId:``},n[0]=e?.scope,n[1]=i);let a=Jk(e?.connection??null,i,e?.path??``,r);if(t?.kind===`external`){let e;return n[2]===t.url?e=n[3]:(e={kind:`ready`,url:t.url},n[2]=t.url,n[3]=e),e}if(r===void 0||a===void 0){let e=t?.kind===`repository`?`not in this view`:`blocked`,r;return n[4]===e?r=n[5]:(r={kind:`failed`,reason:e},n[4]=e,n[5]=r),r}if(Xi(a)){let e;return n[6]===Symbol.for(`react.memo_cache_sentinel`)?(e={kind:`loading`},n[6]=e):e=n[6],e}if(Mi(a)){let e;n[7]===a.cause?e=n[8]:(e=Td(Ra(a.cause)),n[7]=a.cause,n[8]=e);let t;return n[9]===e?t=n[10]:(t={kind:`failed`,reason:e},n[9]=e,n[10]=t),t}let o;if(n[11]!==a){let e=Kt(qr(a));o=e===null?{kind:`failed`,reason:`not found or not previewable`}:{kind:`ready`,url:Kk(e)},n[11]=a,n[12]=o}else o=n[12];return o}function QL(e){let t=(0,$.c)(14),{element:n,file:r}=e,i=ZL(r,n.source),[a,o]=(0,Z.useState)(),s=typeof n.props.alt==`string`?n.props.alt:``;if(i.kind===`failed`){let e;return t[0]!==s||t[1]!==i.reason?(e=(0,Q.jsx)(XL,{alt:s,reason:i.reason}),t[0]=s,t[1]=i.reason,t[2]=e):e=t[2],e}if(i.kind===`loading`){let e=s||`Loading image`,n;return t[3]===e?n=t[4]:(n=(0,Q.jsx)(`span`,{"aria-busy":!0,"aria-label":e,className:`inline-block h-6 w-24 animate-pulse rounded bg-muted align-middle`}),t[3]=e,t[4]=n),n}if(a===i.url){let e;return t[5]===s?e=t[6]:(e=(0,Q.jsx)(XL,{alt:s,reason:`failed`}),t[5]=s,t[6]=e),e}let c;t[7]===i.url?c=t[8]:(c=()=>o(i.url),t[7]=i.url,t[8]=c);let l;return t[9]!==s||t[10]!==n.props||t[11]!==i.url||t[12]!==c?(l=(0,Q.jsx)(`img`,{...n.props,alt:s,src:i.url,loading:`lazy`,decoding:`async`,referrerPolicy:`no-referrer`,onError:c,className:`inline h-auto max-w-full align-middle`}),t[9]=s,t[10]=n.props,t[11]=i.url,t[12]=c,t[13]=l):l=t[13],l}function $L(e){let t=(0,$.c)(6),{element:n,file:r}=e,i=ZL(r,n.source);if(i.kind!==`ready`)return null;let{media:a,type:o}=n.props,s;t[0]===o?s=t[1]:(s=typeof o==`string`?{type:o}:{},t[0]=o,t[1]=s);let c=s,l;return t[2]!==a||t[3]!==i.url||t[4]!==c?(l=typeof a==`string`?(0,Q.jsx)(`source`,{media:a,srcSet:i.url,...c}):(0,Q.jsx)(`source`,{src:i.url,...c}),t[2]=a,t[3]=i.url,t[4]=c,t[5]=l):l=t[5],l}function eR(e){let t=(0,$.c)(12),{element:n,file:r,children:i}=e,a=n.source?.kind===`repository`,o=ZL(r,a?n.source:void 0),s=ZL(r,n.poster);if(a&&o.kind===`failed`){let e=n.tag===`video`?`Video`:`Audio`,r;return t[0]!==o.reason||t[1]!==e?(r=(0,Q.jsx)(XL,{alt:e,reason:o.reason}),t[0]=o.reason,t[1]=e,t[2]=r):r=t[2],r}if(a&&o.kind===`loading`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{className:`my-3 block aspect-video max-w-120 animate-pulse rounded-lg bg-muted`}),t[3]=e):e=t[3],e}let c;return t[4]!==i||t[5]!==a||t[6]!==n.props||t[7]!==n.tag||t[8]!==s.kind||t[9]!==s.url||t[10]!==o?(c=(0,Z.createElement)(n.tag,{...n.props,...a&&o.kind===`ready`?{src:o.url}:{},...s.kind===`ready`?{poster:s.url}:{},className:n.tag===`video`?`my-3 block h-auto max-w-full rounded-lg border bg-black`:`my-3 block w-full max-w-120`},...i),t[4]=i,t[5]=a,t[6]=n.props,t[7]=n.tag,t[8]=s.kind,t[9]=s.url,t[10]=o,t[11]=c):c=t[11],c}function tR(e){let t=(0,$.c)(32),{element:n,file:r,children:i}=e,a=n.link,o=n.role===`footnote-ref`||n.role===`footnote-backref`?`text-muted-foreground no-underline hover:text-foreground`:`text-brand underline decoration-brand/40 underline-offset-2 hover:decoration-brand`;if(a?.kind===`external`){let e;return t[0]!==i||t[1]!==o||t[2]!==n.props||t[3]!==a.url?(e=(0,Q.jsx)(`a`,{...n.props,href:a.url,target:`_blank`,rel:`noreferrer noopener`,className:o,children:i}),t[0]=i,t[1]=o,t[2]=n.props,t[3]=a.url,t[4]=e):e=t[4],e}if(a?.kind===`fragment`){let e;t[5]===a.hash?e=t[6]:(e=e=>{e.preventDefault(),nR(e.currentTarget,a.hash)},t[5]=a.hash,t[6]=e);let r;return t[7]!==i||t[8]!==o||t[9]!==n.props||t[10]!==a.hash||t[11]!==e?(r=(0,Q.jsx)(`a`,{...n.props,href:a.hash,className:o,onClick:e,children:i}),t[7]=i,t[8]=o,t[9]=n.props,t[10]=a.hash,t[11]=e,t[12]=r):r=t[12],r}if(a?.kind===`repository`&&r){let e;t[13]!==r||t[14]!==a.hash||t[15]!==a.path?(e=()=>r.openPath(a.path,a.hash),t[13]=r,t[14]=a.hash,t[15]=a.path,t[16]=e):e=t[16];let s=e,c=n.props,l=a.path,u;t[17]===o?u=t[18]:(u=Y(o,`cursor-pointer`),t[17]=o,t[18]=u);let d,f;t[19]===s?(d=t[20],f=t[21]):(d=e=>{e.preventDefault(),s()},f=e=>{e.key===`Enter`&&s()},t[19]=s,t[20]=d,t[21]=f);let p;return t[22]!==i||t[23]!==n.props||t[24]!==a.path||t[25]!==u||t[26]!==d||t[27]!==f?(p=(0,Q.jsx)(`a`,{...c,role:`link`,tabIndex:0,title:l,className:u,onClick:d,onKeyDown:f,children:i}),t[22]=i,t[23]=n.props,t[24]=a.path,t[25]=u,t[26]=d,t[27]=f,t[28]=p):p=t[28],p}let s;return t[29]!==i||t[30]!==n.props?(s=(0,Q.jsx)(`span`,{...n.props,children:i}),t[29]=i,t[30]=n.props,t[31]=s):s=t[31],s}function nR(e,t){let n=e.closest(`[data-markdown-root]`),r=TI(t);if(!n||r===void 0)return;let i=n.querySelector(`[id="${CSS.escape(r)}"]`)??n.querySelector(`[id="user-content-${CSS.escape(r)}"]`);if(!i)return;let a=n.closest(`[data-reader-scroll]`)??n.parentElement;for(;a&&a.scrollHeight<=a.clientHeight;)a=a.parentElement;a&&(a.scrollTop+=i.getBoundingClientRect().top-a.getBoundingClientRect().top-rR)}var rR=16,iR={h1:`mt-5 mb-2 text-lg font-semibold first:mt-0`,h2:`mt-5 mb-2 text-base font-semibold first:mt-0`,h3:`mt-4 mb-1.5 text-sm font-semibold`,h4:`mt-4 mb-1.5 text-sm font-semibold`,h5:`mt-3 mb-1 text-ui font-semibold`,h6:`mt-3 mb-1 text-ui font-semibold text-muted-foreground`,p:`my-2 leading-relaxed`,ul:`my-2 list-disc pl-5`,ol:`my-2 list-decimal pl-5`,li:`my-0.5`},aR={h1:`mt-8 mb-4 border-b pb-2 text-subpage-title font-semibold first:mt-0`,h2:`mt-8 mb-3 border-b pb-1.5 text-lead font-semibold tracking-pr-subheading first:mt-0`,h3:`mt-6 mb-2 text-section font-semibold`,h4:`mt-5 mb-2 text-prose font-semibold`,h5:`mt-5 mb-1.5 text-ui font-semibold`,h6:`mt-5 mb-1.5 text-ui font-semibold text-muted-foreground`,p:`my-3`,ul:`my-3 list-disc pl-6 [&_ul]:my-1 [&_ol]:my-1`,ol:`my-3 list-decimal pl-6 [&_ul]:my-1 [&_ol]:my-1`,li:`my-1 pl-0.5 marker:text-muted-foreground`},oR={li:`has-[>input[type=checkbox]]:list-none has-[>input[type=checkbox]]:-ml-5`,code:`rounded-sm bg-muted px-1 py-px font-mono text-[0.875em]`,kbd:`rounded border border-b-2 bg-muted px-1.5 py-px font-mono text-[0.8em] text-foreground`,blockquote:`my-4 border-l-3 pl-4 text-muted-foreground [&>:first-child]:mt-0 [&>:last-child]:mb-0 [&>p]:my-2`,hr:`my-6 border-t`,details:`my-4 rounded-lg border px-3 py-2 open:pb-3`,summary:`cursor-pointer font-medium select-none`,dl:`my-3`,dt:`mt-3 font-semibold`,dd:`mt-1 pl-4`,mark:`rounded-sm bg-graph-4/20 px-0.5 text-foreground`,sup:`text-[0.75em]`,sub:`text-[0.75em]`,figure:`my-4`,figcaption:`mt-1 text-caption text-muted-foreground`,input:`mr-1.5 size-3.5 translate-y-0.5 accent-brand`,thead:``,th:`sticky top-0 z-1 border-b bg-muted px-3 py-1.5 text-left font-medium whitespace-nowrap`,td:`max-w-96 border-b px-3 py-1.5 align-top`,tr:`last:[&>td]:border-b-0`,caption:`px-3 py-1.5 text-left text-caption text-muted-foreground`};function sR(e,t){let n=t===`reader`?aR:iR;return(t,r,i)=>{if(t.role?.startsWith(`alert-`)&&t.role!==`alert-title`)return t.role===`alert-content`?(0,Q.jsx)(`div`,{children:r},i):(0,Q.jsx)(YL,{role:t.role,children:r},i);if(t.role===`footnotes`)return(0,Q.jsx)(`section`,{className:`mt-8 border-t pt-4 text-ui text-muted-foreground [&_li]:my-1 [&_p]:my-1`,children:r},i);switch(t.tag){case`a`:return(0,Q.jsx)(tR,{element:t,file:e,children:r},i);case`img`:return(0,Q.jsx)(QL,{element:t,file:e},i);case`source`:return(0,Q.jsx)($L,{element:t,file:e},i);case`video`:case`audio`:return(0,Q.jsx)(eR,{element:t,file:e,children:r},i);case`pre`:return(0,Q.jsx)(GL,{language:t.language??`text`,children:r},i);case`table`:return(0,Q.jsx)(`div`,{className:`my-4 max-h-144 max-w-full overflow-auto rounded-lg border`,children:(0,Q.jsx)(`table`,{className:`w-max min-w-full border-separate border-spacing-0 text-ui`,children:r})},i)}return(0,Z.createElement)(t.tag,{key:i,...t.props,className:Y(n[t.tag]??oR[t.tag],n[t.tag]&&oR[t.tag],t.props.className===`sr-only`&&`sr-only`)},...r)}}function cR(e){let t=(0,$.c)(11),{text:n,className:r,file:i,variant:a}=e,o=a===void 0?`compact`:a,s=o===`reader`?`text-prose break-words`:`text-ui`,c;t[0]!==r||t[1]!==s?(c=Y(`min-w-0 text-foreground`,s,r),t[0]=r,t[1]=s,t[2]=c):c=t[2];let l=i?.path??``,u;t[3]!==i||t[4]!==l||t[5]!==n||t[6]!==o?(u=BL(n,l,sR(i,o)),t[3]=i,t[4]=l,t[5]=n,t[6]=o,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==u?(d=(0,Q.jsx)(`div`,{"data-markdown-root":!0,className:c,children:u}),t[8]=c,t[9]=u,t[10]=d):d=t[10],d}function lR(e){return e.reduce((e,t)=>Math.min(e,t.level),1/0)}function uR(e){let t=e[0]?.level===1&&e.filter(e=>e.level===1).length===1?e.slice(1):e,n=lR(t),r=t.filter(e=>e.level<n+2);return r.length>=2?r:[]}function dR(e){let t=zL(e);return{document:t,outline:uR(t.headings??[])}}function fR(e,t){let n=e?.querySelector(`[data-markdown-root]`);n&&nR(n,`#${t}`)}function pR(e){let t=(0,$.c)(8),{outline:n}=e,r=lR(n),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`On this page`}),t[0]=i):i=t[0];let a;if(t[1]!==n||t[2]!==r){let e;t[4]===r?e=t[5]:(e=e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),fR(t.currentTarget.closest(`[data-reader-scroll]`),e.id)},style:{paddingLeft:`${(e.level-r)*.75+.75}rem`},className:`-ml-px block border-l border-transparent py-1 text-muted-foreground hover:border-foreground/40 hover:text-foreground`,children:(0,Q.jsx)(fr,{text:e.text,className:`block`})})},e.id),t[4]=r,t[5]=e),a=n.map(e),t[1]=n,t[2]=r,t[3]=a}else a=t[3];let o;return t[6]===a?o=t[7]:(o=(0,Q.jsxs)(`nav`,{"aria-label":`On this page`,className:`text-caption`,children:[i,(0,Q.jsx)(`ul`,{className:`flex flex-col border-l`,children:a})]}),t[6]=a,t[7]=o),o}function mR(e){let t=(0,$.c)(11),{outline:n,root:r}=e;if(n.length===0)return null;let i=lR(n),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Outline`,className:`@5xl/document:hidden`})}),children:(0,Q.jsx)(Ug,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Outline`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(bc,{children:`On this page`}),t[1]=o):o=t[1];let s;if(t[2]!==n||t[3]!==r||t[4]!==i){let e;t[6]!==r||t[7]!==i?(e=e=>(0,Q.jsx)(dn,{onSelect:()=>fR(r,e.id),style:{paddingLeft:`${(e.level-i)*.75+.5}rem`},children:(0,Q.jsx)(fr,{text:e.text,className:`min-w-0 flex-1`})},e.id),t[6]=r,t[7]=i,t[8]=e):e=t[8],s=n.map(e),t[2]=n,t[3]=r,t[4]=i,t[5]=s}else s=t[5];let c;return t[9]===s?c=t[10]:(c=(0,Q.jsxs)(Wt,{children:[a,(0,Q.jsx)(Ne,{align:`end`,className:`max-h-96 w-72`,children:(0,Q.jsxs)(ct,{children:[o,s]})})]}),t[9]=s,t[10]=c),c}var hR=[`wheel`,`touchstart`,`keydown`,`pointerdown`];function gR(e,t,n){let r=e.querySelector(`[data-markdown-root]`);if(!r)return;let i=e.scrollTop,a=()=>{t.anchor?nR(r,t.anchor):e.scrollTop=t.scrollTop,i=e.scrollTop};if(a(),!t.anchor&&t.scrollTop===0)return;let o=new ResizeObserver(a);o.observe(r),o.observe(e);let s=()=>{Math.abs(e.scrollTop-i)>2&&l()},c=()=>{o.disconnect(),e.removeEventListener(`scroll`,s);for(let t of hR)e.removeEventListener(t,l)},l=()=>{c(),n()};for(let t of hR)e.addEventListener(t,l,{passive:!0});return e.addEventListener(`scroll`,s,{passive:!0}),c}function _R(e){let t=(0,$.c)(18),{document:n,outline:r,file:i,attach:a}=e,o=wl(),s=`${i.scope.worktreeId}:${i.path}`,c;t[0]!==a||t[1]!==s||t[2]!==o?(c=e=>{if(a(e),!e)return;let t=o.place(s),n=t.anchor||Math.abs(e.scrollTop-t.scrollTop)>1?gR(e,t,()=>o.clearAnchor(s)):void 0,r=()=>{e.offsetParent!==null&&o.rememberScroll(s,e.scrollTop)};return e.addEventListener(`scroll`,r,{passive:!0}),()=>{n?.(),e.removeEventListener(`scroll`,r)}},t[0]=a,t[1]=s,t[2]=o,t[3]=c):c=t[3];let l=r.length>0&&`@5xl/document:max-w-5xl`,u;t[4]===l?u=t[5]:(u=Y(`mx-auto flex w-full justify-center gap-10 px-6 pt-6 pb-16`,l),t[4]=l,t[5]=u);let d;t[6]!==n||t[7]!==i?(d=(0,Q.jsx)(cR,{text:n,file:i,variant:`reader`,className:`w-full max-w-(--container-reading) min-w-0 flex-1`}),t[6]=n,t[7]=i,t[8]=d):d=t[8];let f;t[9]===r?f=t[10]:(f=r.length>0&&(0,Q.jsx)(`aside`,{className:`sticky top-6 hidden max-h-[calc(100svh-10rem)] w-52 shrink-0 self-start overflow-y-auto overscroll-contain @5xl/document:block`,children:(0,Q.jsx)(pR,{outline:r})}),t[9]=r,t[10]=f);let p;t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(`div`,{className:u,children:[d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==c||t[16]!==p?(m=(0,Q.jsx)(`div`,{"data-reader-scroll":!0,ref:c,className:`min-h-0 flex-1 overflow-auto [overflow-anchor:none]`,children:p}),t[15]=c,t[16]=p,t[17]=m):m=t[17],m}var vR=dt(e=>Oe(t=>e.paths.map(n=>t(Vs({...e,path:n}))))),yR=dt(e=>wc((t,n)=>{for(let t of e.paths)n.refresh(Vs({...e,path:t}));return null}));function bR(e,t,n){let r=(0,$.c)(14),i={connection:e,scope:t,paths:n},a=Ot(vR(i)),o=Da(yR(i)),s;if(r[0]!==n||r[1]!==a){let e;r[3]===a?e=r[4]:(e=(e,t)=>{let n=a[t],r=n?de(qr(n)):void 0;return r&&`text`in r?[[e,r.text]]:[]},r[3]=a,r[4]=e),s=new Map(n.flatMap(e)),r[0]=n,r[1]=a,r[2]=s}else s=r[2];let c;r[5]===a?c=r[6]:(c=a.some(Xi),r[5]=a,r[6]=c);let l;r[7]===a?l=r[8]:(l=a.some(Mi),r[7]=a,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u={contents:s,pending:c,failed:l,retry:o},r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u}var xR=(0,Z.lazy)(()=>Af(()=>import(`./file-editor-MXkoMjoi.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function SR(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(kc,{label:`Opening the editor`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Q.jsx)(Z.Suspense,{fallback:n,children:(0,Q.jsx)(xR,{...e})}),t[1]=e,t[2]=r),r}var CR=/url\(\s*(['"]?)([^)'"]+)\1\s*\)|@import\s+(?:url\(\s*)?(['"])([^'"]+)\3\s*\)?\s*([^;]*);?/g,wR=`default-src 'none'; script-src 'unsafe-inline' data:; style-src 'unsafe-inline' data:; img-src data: blob:; media-src data: blob:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-src 'none'`;function TR(e){let t=e.join(` `);return e.length===0?wR:wR.replace(`img-src data: blob:;`,`img-src data: blob: ${t};`).replace(`media-src data: blob:;`,`media-src data: blob: ${t};`)}var ER=`img[src], script[src], source[src], video[src], audio[src], track[src], video[poster], image[href], input[type="image"][src]`;function DR(e,t,n){let r=window.document.implementation.createHTMLDocument(),i=r.createElement(`meta`);i.httpEquiv=`Content-Security-Policy`,i.content=t.run?TR(n):TR(n).replace(`script-src 'unsafe-inline' data:`,`script-src 'nonce-${t.nonce}'`);let a=r.createElement(`style`);a.textContent=`html, body { height: 100%; margin: 0; } iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: inherit; }`,r.head.replaceChildren(i,a),r.documentElement.style.colorScheme=`light dark`;let o=r.createElement(`iframe`);return o.title=`Preview content`,o.setAttribute(`aria-label`,`Preview content`),o.sandbox.add(`allow-scripts`),o.referrerPolicy=`no-referrer`,o.srcdoc=e,r.body.append(o),`<!doctype html>${r.documentElement.outerHTML}`}var OR=_s(`BrowserHtmlPreview.inlineAssets`)(function*(e,t,n){let r=new Set,i=new Map,a=0;function o(e,t){if(e.startsWith(`data:`))return null;let n=pI(t,e);if(n.kind===`fragment`)return null;if(n.kind!==`repository`)throw Error(`Not in the repository`);return n}function s(e,t){let n=[];for(let i of e.matchAll(CR)){let e=(i[2]??i[4]??``).trim();try{let r=o(e,t);r&&n.push(r.path)}catch{r.add(e)}}return n}function c(e){return new TextDecoder().decode(Uint8Array.from(atob(e.base64),e=>e.charCodeAt(0)))}function l(e){if(a+e>29360128)throw Error(`Expanded preview too large`);a+=e}function u(e,t,n){let r=o(e,t);if(r===null)return``;let a=i.get(r.path);if(!a||`url`in a||a.mediaType!==`text/css`)throw Error(`Unavailable`);if(n.includes(r.path))throw Error(`Circular stylesheet`);let s=f(c(a),r.path,[...n,r.path]);return l(s.length),s}function d(e,t){try{let n=o(e,t);if(n===null)return e;let r=i.get(n.path);if(!r||`mediaType`in r&&r.mediaType===`text/css`)throw Error(`Unavailable`);let a=Kk(r)+n.hash;return l(a.length),a}catch{return r.add(e),`data:,`}}function f(e,t,n=[]){let i=``,a=0;for(let o of e.matchAll(CR)){if(i+=e.slice(a,o.index),o[4]!==void 0){let e=(o[5]??``).trim();try{let r=u(o[4].trim(),t,n);i+=e?`@media ${e} {\n${r}\n}`:r}catch{r.add(o[4].trim())}}else i+=`url("${d((o[2]??``).trim(),t)}")`;a=o.index+o[0].length}return i+e.slice(a)}let p=new DOMParser().parseFromString(e,`text/html`);for(let e of p.querySelectorAll(`base, meta[http-equiv]`))e.remove();let m=[...p.querySelectorAll(`link[href]`)],h=m.filter(e=>(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/).includes(`stylesheet`)),g=m.filter(e=>(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/).includes(`icon`));for(let e of m)!h.includes(e)&&!g.includes(e)&&e.remove();let _=[...[...p.querySelectorAll(ER)].flatMap(e=>[`src`,`poster`,`href`].filter(t=>e.hasAttribute(t)&&(t!==`href`||e.tagName.toLowerCase()===`image`)).map(t=>({node:e,attribute:t}))),...g.map(e=>({node:e,attribute:`href`}))],v=[...p.querySelectorAll(`[srcset]`)],y=[...p.querySelectorAll(`style`),...p.querySelectorAll(`[style]`)],b=[],x=e=>{try{let n=o(e,t);n&&b.push(n.path)}catch{r.add(e)}};for(let{node:e,attribute:t}of _)x(e.getAttribute(t)??``);for(let e of h)x(e.getAttribute(`href`)??``);for(let e of v)for(let t of kR(e.getAttribute(`srcset`)??``))x(t.url);for(let e of y)b.push(...s(e.tagName===`STYLE`?e.textContent??``:e.getAttribute(`style`)??``,t));i=yield*Ir(b,n,s);for(let{node:e,attribute:n}of _)e.setAttribute(n,d(e.getAttribute(n)??``,t)),e.removeAttribute(`integrity`),e.removeAttribute(`crossorigin`);for(let e of v)e.setAttribute(`srcset`,kR(e.getAttribute(`srcset`)??``).map(e=>`${d(e.url,t)}${e.descriptor?` ${e.descriptor}`:``}`).join(`, `));for(let e of p.querySelectorAll(`style`))e.textContent=f(e.textContent??``,t);for(let e of p.querySelectorAll(`[style]`))e.setAttribute(`style`,f(e.getAttribute(`style`)??``,t));for(let e of h){let n=e.getAttribute(`href`)??``,i=p.createElement(`style`),a=e.getAttribute(`media`);a&&(i.media=a);try{i.textContent=u(n,t,[]),e.replaceWith(i)}catch{r.add(n),e.remove()}}let S=new Set([...p.querySelectorAll(`a[href], area[href]`)].map(e=>e.getAttribute(`href`)??``)),C=p.createElement(`meta`);C.httpEquiv=`Content-Security-Policy`;let w=[...new Set([...i.values()].flatMap(e=>{if(!e||!(`url`in e))return[];let t=new URL(e.url);return[`${t.protocol}//${t.host}${t.pathname}`]}))];C.content=TR(w);let T=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),E=p.createElement(`script`);return E.setAttribute(`nonce`,T),E.textContent=Jy,p.head.prepend(C,E),{html:`<!doctype html>${p.documentElement.outerHTML}`,missing:[...r],links:[...S],nonce:T,mediaSources:w}});function kR(e){return[...e.matchAll(/(data:[^\s]+|[^,\s]+)(?:\s+(\d+(?:\.\d+)?[wx]))?\s*,?/g)].map(e=>({url:(e[1]??``).replace(/,$/,``),descriptor:e[2]??``}))}var AR=fc(Li,{render:(e,t,n)=>OR(e,t,n).pipe(xr(()=>o(new bs)))});function jR(e){let t=(0,$.c)(18),{html:n,title:r,className:i,onLink:a,scripts:o,mediaSources:s}=e,c;t[0]===s?c=t[1]:(c=s===void 0?[]:s,t[0]=s,t[1]=c);let l=c,{dark:u}=Xd(),d;t[2]===a?d=t[3]:(d=e=>{if(!e||!a)return;let t=t=>{let n=e.contentWindow?.frames[0];if(!n||t.source!==n)return;let r=Xy(t.data);r!==void 0&&a(r)};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},t[2]=a,t[3]=d);let f;t[4]!==n||t[5]!==l||t[6]!==o?(f=DR(n,o,l),t[4]=n,t[5]=l,t[6]=o,t[7]=f):f=t[7];let p=u?`dark`:`light`,m;t[8]===p?m=t[9]:(m={colorScheme:p},t[8]=p,t[9]=m);let h;t[10]===i?h=t[11]:(h=Y(`block min-h-128 w-full border-0 bg-transparent`,i),t[10]=i,t[11]=h);let g;return t[12]!==d||t[13]!==f||t[14]!==m||t[15]!==h||t[16]!==r?(g=(0,Q.jsx)(`iframe`,{ref:d,title:r,"aria-label":r,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,srcDoc:f,style:m,className:h}),t[12]=d,t[13]=f,t[14]=m,t[15]=h,t[16]=r,t[17]=g):g=t[17],g}var MR=/\.html?$/i;function NR(e){let t=(0,$.c)(40),{scope:n,path:r,html:i,connection:a,onOpenPath:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Z.useState)(s),[u,d]=(0,Z.useState)(!0),f;t[1]===u?f=t[2]:(f={run:u,toggle:()=>d(!u)},t[1]=u,t[2]=f);let p=f,m;t[3]!==r||t[4]!==c?(m=c.at(-1)??r,t[3]=r,t[4]=c,t[5]=m):m=t[5];let h=m,g;t[6]!==h||t[7]!==r?(g=h===r?[]:[h],t[6]=h,t[7]=r,t[8]=g):g=t[8];let _=bR(a,n,g),v;t[9]!==h||t[10]!==i||t[11]!==_.contents||t[12]!==r?(v=h===r?i:_.contents.get(h),t[9]=h,t[10]=i,t[11]=_.contents,t[12]=r,t[13]=v):v=t[13];let y=v,b;t[14]===c?b=t[15]:(b=c.length>0?()=>l(c.slice(0,-1)):void 0,t[14]=c,t[15]=b);let x=b;if(y===void 0){let e;t[16]!==x||t[17]!==h||t[18]!==_.retry||t[19]!==p?(e=(0,Q.jsx)(PR,{path:h,onBack:x,onReload:_.retry,scripts:p}),t[16]=x,t[17]=h,t[18]=_.retry,t[19]=p,t[20]=e):e=t[20];let n;t[21]!==h||t[22]!==_.pending?(n=_.pending?(0,Q.jsx)(kc,{label:`Preparing the preview`}):(0,Q.jsxs)(`p`,{role:`alert`,className:`p-4 text-ui`,children:[`Could not read `,h,`. Try again.`]}),t[21]=h,t[22]=_.pending,t[23]=n):n=t[23];let r;return t[24]!==e||t[25]!==n?(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[e,n]}),t[24]=e,t[25]=n,t[26]=r):r=t[26],r}let S;t[27]!==h||t[28]!==o||t[29]!==c?(S=(e,t)=>{if(!t.includes(e))return;let n=pI(h,e);n.kind===`external`&&navigator.userActivation.isActive&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.kind===`repository`&&(MR.test(n.path)?l([...c,n.path]):o(n.path))},t[27]=h,t[28]=o,t[29]=c,t[30]=S):S=t[30];let C;return t[31]!==x||t[32]!==a||t[33]!==h||t[34]!==_.retry||t[35]!==n||t[36]!==p||t[37]!==S||t[38]!==y?(C=(0,Q.jsx)(FR,{scope:n,path:h,html:y,connection:a,onBack:x,onReload:_.retry,scripts:p,onLink:S},h),t[31]=x,t[32]=a,t[33]=h,t[34]=_.retry,t[35]=n,t[36]=p,t[37]=S,t[38]=y,t[39]=C):C=t[39],C}function PR(e){let t=(0,$.c)(14),{path:n,onBack:r,onReload:i,scripts:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,Q.jsx)(IR,{label:`Back`,onClick:r,children:(0,Q.jsx)(_h,{})}),t[0]=r,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Q.jsx)(fr,{text:n,cut:`start`,className:`min-w-0 flex-1 px-1.5 font-mono text-2xs text-muted-foreground`}),t[2]=n,t[3]=s);let c;t[4]===a?c=t[5]:(c=a&&(0,Q.jsxs)(`label`,{className:`flex items-center gap-1.5 px-1.5 text-2xs text-muted-foreground`,children:[`Scripts`,(0,Q.jsx)(bn,{size:`sm`,"aria-label":`Run the page's scripts`,checked:a.run,onCheckedChange:a.toggle})]}),t[4]=a,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(__,{}),t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(IR,{label:`Reload`,onClick:i,children:l}),t[7]=i,t[8]=u);let d;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==u?(d=(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-1 border-b bg-muted/40 px-1.5`,children:[o,s,c,u]}),t[9]=o,t[10]=s,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function FR(e){let t=(0,$.c)(45),{scope:n,path:r,html:i,connection:a,onBack:o,onReload:s,scripts:c,onLink:l}=e,{preview:u,refresh:d}=Yk(a,n,r,i,AR),[f,p]=(0,Z.useState)(0),m;t[0]!==f||t[1]!==s||t[2]!==d?(m=()=>{s(),d(),p(f+1)},t[0]=f,t[1]=s,t[2]=d,t[3]=m):m=t[3];let h;t[4]!==o||t[5]!==r||t[6]!==c||t[7]!==m?(h=(0,Q.jsx)(PR,{path:r,scripts:c,onBack:o,onReload:m}),t[4]=o,t[5]=r,t[6]=c,t[7]=m,t[8]=h):h=t[8];let g=h;if(Xi(u)){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Preparing the preview`}),t[9]=e):e=t[9];let n;return t[10]===g?n=t[11]:(n=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,e]}),t[10]=g,t[11]=n),n}if(Mi(u)){let e;t[12]===u.cause?e=t[13]:(e=Td(Ra(u.cause)),t[12]=u.cause,t[13]=e);let n;t[14]===e?n=t[15]:(n=(0,Q.jsx)(`p`,{role:`alert`,className:`p-4`,children:e}),t[14]=e,t[15]=n);let r;return t[16]!==g||t[17]!==n?(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,n]}),t[16]=g,t[17]=n,t[18]=r):r=t[18],r}let _,v,y,b;t[19]!==g||t[20]!==u?(_=Kt(qr(u)),v=`flex min-h-0 flex-1 flex-col`,y=g,b=_.missing.length>0&&(0,Q.jsx)(`p`,{role:`status`,className:`flex border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:(0,Q.jsx)(fr,{text:`Not loaded: ${_.missing.join(`, `)}`,className:`min-w-0 flex-1`})}),t[19]=g,t[20]=u,t[21]=_,t[22]=v,t[23]=y,t[24]=b):(_=t[21],v=t[22],y=t[23],b=t[24]);let x=`${f}:${c?.run===!0}`,S;t[25]===_.mediaSources?S=t[26]:(S=_.mediaSources??[],t[25]=_.mediaSources,t[26]=S);let C;t[27]!==_.nonce||t[28]!==c?.run?(C=c?.run===!0?{run:!0}:{run:!1,nonce:_.nonce},t[27]=_.nonce,t[28]=c?.run,t[29]=C):C=t[29];let w=`${r} HTML preview`,T;t[30]!==_.links||t[31]!==l?(T=e=>l(e,_.links),t[30]=_.links,t[31]=l,t[32]=T):T=t[32];let E;t[33]!==_.html||t[34]!==T||t[35]!==x||t[36]!==S||t[37]!==C||t[38]!==w?(E=(0,Q.jsx)(jR,{html:_.html,mediaSources:S,scripts:C,title:w,className:`min-h-0 flex-1`,onLink:T},x),t[33]=_.html,t[34]=T,t[35]=x,t[36]=S,t[37]=C,t[38]=w,t[39]=E):E=t[39];let D;return t[40]!==E||t[41]!==v||t[42]!==y||t[43]!==b?(D=(0,Q.jsxs)(`div`,{className:v,children:[y,b,E]}),t[40]=E,t[41]=v,t[42]=y,t[43]=b,t[44]=D):D=t[44],D}function IR(e){let t=(0,$.c)(11),{label:n,onClick:r,children:i}=e,a;t[0]!==n||t[1]!==r?(a=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":n,onClick:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]!==i||t[4]!==a?(o=(0,Q.jsx)(Ze,{render:a,children:i}),t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===n?s=t[7]:(s=(0,Q.jsx)(Yo,{role:`tooltip`,children:n}),t[6]=n,t[7]=s);let c;return t[8]!==o||t[9]!==s?(c=(0,Q.jsxs)(ot,{children:[o,s]}),t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function LR(e,t,n){let r=(0,$.c)(4),i;return r[0]!==e||r[1]!==n||r[2]!==t?(i=ia({connection:e,scope:t,path:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3],$u(i).value}function RR(e,t,n){let r=(0,$.c)(4),i;return r[0]!==e||r[1]!==n||r[2]!==t?(i=ia({connection:e,scope:t,path:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3],xu(i).value}function zR(e,t,n){let r=(0,$.c)(9),i={connection:e,scope:t,paths:n},a=Ot(fa(i)),o=Da(Kr(i)),s;if(r[0]!==n||r[1]!==a){let e;r[3]===n?e=r[4]:(e=(e,t)=>{let r=n[t]??``;if(Mi(e))return{path:r,status:`unavailable`};let i=de(qr(e));return i?{path:r,status:`loaded`,entries:i.entries,omitted:i.omitted}:{path:r,status:`loading`}},r[3]=n,r[4]=e),s=a.map(e),r[0]=n,r[1]=a,r[2]=s}else s=r[2];let c=s,l;return r[5]!==a||r[6]!==o||r[7]!==c?(l={results:a,states:c,retry:o},r[5]=a,r[6]=o,r[7]=c,r[8]=l):l=r[8],l}function BR(){return _u().hotkey?.enabled!==!1}var VR=new WeakMap,HR=`[data-slot="dialog-content"],[data-slot="alert-dialog-content"],[data-slot="drawer-content"]`,UR=[`imperative`,`action`,`parent-close`];function WR(e,t){let n=Sn(e);if(t.pending&&!UR.includes(e)||n&&(!t.dismissible||e===`outside-press`&&!t.outsidePress))return n&&!(e===`outside-press`&&t.beside)?`attempt`:`silent`}function GR(e){return!e||!wf?[]:typeof e==`function`?e():e.flatMap(e=>typeof e==`string`?Array.from(document.querySelectorAll(e)):[e])}function KR(e,t,n={}){let{store:r,element:i}=e,a=e.options;ga(e,()=>r.get().pending!==null);let o=()=>r.get().modal,s=0,c=()=>!t&&(a().closeOnOutsidePress??o()!==!1),l,u=new Set;function d(){let e=u.size?Math.max(...[...u].map(e=>e.stack()+1)):0;e!==r.get().stack&&(r.set({stack:e}),l?.add(f))}let f={close:e=>m.hide({reason:e}),stack:()=>r.get().stack,add(e){u.add(e),d()},remove(e){u.delete(e),d()}},p=Zs(e,{preset:n.preset??On,role:t?`alertdialog`:`dialog`,rules:i=>({persistent:()=>GR(a().persistentElements),onEscape(e){(o()!==!1||i.popup.element()?.contains(qa()))&&i.control.hide({reason:`escape-key`,event:e})},onShow(e){VR.set(e,f),l=void 0;for(let t=e.parent;t&&!l;t=t.parent)l=VR.get(t);l?.add(f),r.set({nested:!!l});let t=n.onShow?.(e);return()=>{t?.(),VR.delete(e)}},onOpenChange(e){if(n.onOpenChange?.(e),e){if(wf){let e=i.triggerElement()?.ownerDocument??document;o()===!0&&gs(e),Of(e.defaultView)}}else{s++,r.set({pending:null});for(let e of[...u])e.close(`parent-close`);l?.remove(f),l=void 0}},open(e,t){r.set({errors:{}}),t()},refusal:e=>WR(e,{dismissible:a().dismissible!==!1,outsidePress:c(),pending:r.get().pending!==null,beside:o()!==!0&&!t}),refused:e=>n.onRefuse?.(e),dismiss(e,t){n.intercept?.(e,t.event)||i.control.hide({reason:e,...t})},preferredFocus(){let n=i.popup.element()?.querySelector(`[autofocus], [data-autofocus]`);if(n&&Rr(n))return n;if(t)return _e(e,`close`).find(({el:e})=>Rr(e))?.el},bind:n.bind})}),{control:m}=p.internal;function h(t,n,i){if(!r.get().open||r.get().pending!==null)return;let a=n.action;if(!a)return m.hide({reason:`close-press`,event:i,returnValue:n.value});let{[t]:o,...c}=r.get().errors;r.set({errors:c});let l=ze(`action`,i),u=!1,d=s;bo(e=>a(i,e),l,{pending(n){d===s&&(u=!0,r.set({pending:n?t:null}),T(e,`pending`,n,{reason:`action`,source:l}))},done(){d===s&&m.hide({reason:`action`,event:u?void 0:i,returnValue:n.value})},failed:n=>{d===s&&(r.set({errors:{...r.get().errors,[t]:n}}),T(e,`error`,n,{reason:`action`,source:l}))}})}function g(t,n){let i=e.props(`trigger`,t)??{};if(!i.disabled){if(r.get().open)return m.hide({reason:`shortcut`,event:n});m.show({event:n,by:`keyboard`,reason:`shortcut`,trigger:t,payload:i.payload})}}return{...p,internal:Object.assign(p.internal,{options:a,show:m.show,hide:m.hide,takeOver:m.takeOver,alert:t,initialFocus:()=>{let{press:e,popup:t,contentProps:n,rules:r}=p.internal;return e.initialFocus(t.element(),n().initialFocus,r?.preferredFocus)},closePress:h,shortcutPress:g,shortcutOf:t=>Je(e,`trigger`,t,{beside:!0}),backdropElement:()=>i(`backdrop`)})}}var qR=KR;function JR(e,{name:t}){let n=a(e);return{trigger:e({props:{id:`id`,disabled:`boolean`,focusableWhenDisabled:`boolean`,payload:`value`,shortcut:`string`},state:n.state,attrs:(e,t)=>({...n.attrs(e,t),...e.modal===!0&&{"aria-expanded":void 0},"aria-keyshortcuts":t.props.shortcut?Ts(t.props.shortcut,e.apple):void 0}),on:n.on,press:n.press,bind(e,t){let{key:r,store:i,api:a}=t,o=n.bind(e,t);rt(i);let s=Ko(()=>t.props.shortcut,e=>a.internal.shortcutPress(r,e),{layer:e},e=>Qi(t,e));return()=>{s(),o?.()}}}),backdrop:e({state:e=>({open:e.open,nested:e.nested,nestedOpen:e.stack>0}),present:(e,{api:t})=>e.mounted||!!t.internal.contentProps().keepMounted,role:`presentation`,attrs:e=>({hidden:e.mounted?void 0:``,...mi(e.open),"data-nested":e.nested?``:void 0,"data-nested-open":e.stack>0?``:void 0}),bind(e,{api:t}){return t.internal.preset.resetStyles?.bind(e),t.internal.popup.backdrop(e)}}),content:e({props:{container:`value`,initialFocus:`string`,finalFocus:`string`,keepMounted:`boolean`,inline:`boolean`},connect:i,role:(e,{api:t})=>t.internal.role,roles:[`dialog`,`alertdialog`],state:e=>({open:e.open,modal:e.modal,nested:e.nested,nestedOpen:e.stack>0,stack:e.stack,payload:e.payload,pending:e.pending!==null,presentation:e.presentation}),present:(e,{props:t})=>e.mounted||!!t.keepMounted,attrs:(e,{id:t,api:n})=>({...Jo(e,t),...n.internal.triggerName?.contentAttrs(e,t),"aria-describedby":e.described?`${t}-description`:void 0,"data-nested":e.nested?``:void 0,"data-nested-open":e.stack>0?``:void 0,"data-presentation":n.internal.presentation&&e.presentation}),on:{keydown(e,{api:t,el:n}){cn(n,e,HR)&&t.internal.popup.keydown(e)}},bind(e,{api:t,store:n,id:r,key:i}){let a=()=>e.style.setProperty(`--dialog-stack`,String(n.get().stack));a();let o=n.subscribe(a),s=br(e,t.internal,i);se(n,`titled`);let c=n.get().presentation===`sheet`?void 0:bf(e);return()=>{o(),c?.(),s(),e.style.removeProperty(`--dialog-stack`)}}}),title:ln(e),description:zr(e),close:e({props:{id:`id`,value:`string`,action:`action`},state:(e,{key:t})=>({pending:e.pending===t,error:e.errors[t]}),attrs:(e,{key:t})=>{let n=e.pending!==null&&e.pending!==t;return{type:`button`,"data-pending":e.pending===t?``:void 0,"aria-busy":e.pending===t?`true`:void 0,"aria-disabled":e.pending===null?void 0:`true`,"data-disabled":n?``:void 0}},press:({api:e,key:t,props:n},r)=>e.internal.closePress(t,n,r)}),shortcut:Dr(e,(e,t,n)=>n&&t.internal.shortcutOf(n))}}function YR(e,t,n,r){return sa({name:e,options:{container:`value`,open:`boolean`,defaultOpen:`boolean`,onOpenChangeComplete:`callback`,dismissible:`boolean`,onDismissAttempt:`callback`,persistentElements:`list`,pendingAnnouncement:`string`,...n},state:e=>({open:e.defaultOpen??!1,mounted:e.open??e.defaultOpen??!1,titled:null,described:!1,trigger:null,payload:void 0,modal:!0,nested:!1,stack:0,pending:null,errors:{},apple:Hi(),presentation:`dialog`}),sync:e=>({...e.open!==void 0&&{open:e.open},modal:t?!0:e.modal??!0}),api:e=>qR(e,t,r?.rules(e.store,e.options)),slots:t=>({...JR(t,{name:e}),...r?.slots(t)}),agent:{actions:[`setOpen`]}})}function XR(){return at()}var ZR=YR(`alert-dialog`,!0,{onOpenChange:`callback`,onPayloadChange:`callback`,controller:`value`}),QR=Z.createContext(null),$R=e=>e.text;function ez(e,t,n){let r=he(e,{title:`h2`,description:`p`,close:`button`,trigger:`button`}),i=Z.createContext(void 0);function a({children:t,container:n,...r}){let a=Ae(e,r);return be(r.controller,a),(0,Q.jsx)(Xt,{handle:a,children:(0,Q.jsx)(i.Provider,{value:n,children:t})})}function o({controller:t,...n}){let{disabled:i,focusableWhenDisabled:a,payload:o,shortcut:s,render:c,...l}=n;return(0,Q.jsx)(QR.Provider,{value:{shortcut:s},children:(0,Q.jsx)(Ha,{primitive:e,controller:t,fallback:()=>ur(`button`,{type:`button`,disabled:i&&!a,"aria-disabled":i&&a||void 0,...l},c,{open:!1,disabled:!!i}),children:(0,Q.jsx)(r.Trigger,{...n})})})}function s(t){let n=Nt(Z.useContext(i)),r=tr(e,`backdrop`,{},t);return r&&m(r,n)}function c({initialFocus:t,finalFocus:r,keepMounted:a,inline:o,container:s,render:c,...l}){let u=Ec(e),d=Nt(Ct(s,i)),f={...l,render:n?n(u,c):c},p=tr(u,`content`,{initialFocus:t,finalFocus:r,keepMounted:a,inline:o},f);return p&&(o?p:m(p,d))}function l(n){let r=Z.useContext(QR);if(C(e))return(0,Q.jsx)(u,{inherited:r?.shortcut,...n});if(r)return null;throw Error(`${t} parts must be used inside <${t}>.`)}function u({inherited:t,shortcut:n,children:r=$R,...i}){return tr(e,`shortcut`,{shortcut:n??t},{...i,children:r},`span`)}return{Root:a,Trigger:o,Backdrop:s,Content:c,Title:r.Title,Description:r.Description,Close:r.Close,Shortcut:l}}var tz=ez(ZR,`AlertDialog`);function nz(e){return(0,Q.jsx)(tz.Root,{...e})}var rz=tz.Backdrop,iz=tz.Content,az=tz.Title,oz=tz.Description,sz=tz.Close;tz.Shortcut;function cz(){return at()}var lz=ez(YR(`dialog`,!1,{onOpenChange:`callback`,onPayloadChange:`callback`,modal:_o,closeOnOutsidePress:`boolean`,presentation:`string`,controller:`value`},{rules(){let e;return{preset:I,bind:()=>({onSheet:t=>e=t}),onRefuse:()=>e?.nudge()}},slots:e=>({viewport:Ii(e)})}),`Dialog`,Ma),uz=lz.Root,dz=lz.Backdrop,fz=lz.Content,pz=lz.Title,mz=lz.Description,hz=lz.Close;lz.Shortcut;var gz=`fixed inset-0 isolate bg-scrim transition-opacity duration-150 ease-out data-closed:pointer-events-none data-starting-style:opacity-0 data-ending-style:opacity-0 motion-reduce:transition-none supports-backdrop-filter:backdrop-blur-xs`;function _z(e){let t=e.currentTarget;if(t.hasAttribute(`data-focused`))return;t.setAttribute(`data-focused`,``);let n=t.querySelector(`[data-autofocus]`);n&&n!==e.target&&n.focus()}function vz({controller:e,children:t,onOpenChange:n,onPayloadChange:r,...i}){let[a,o]=Z.useState(void 0);return(0,Q.jsx)(uz,{"data-slot":`dialog`,container:Ar(),...e===void 0?{}:{controller:e},onOpenChange:(t,r)=>{t&&e&&o(e.getPayload()),n?.(t,r)},onPayloadChange:(e,t)=>{o(e),r?.(e,t)},...i,children:typeof t==`function`?t(a):t})}function yz(e){return(0,Q.jsx)(hz,{"data-slot":`dialog-close`,...e})}function bz({className:e,...t}){return(0,Q.jsx)(dz,{"data-slot":`dialog-overlay`,className:Y(gz,e),...t})}function xz({className:e,children:t,showCloseButton:n=!0,onFocus:r,...i}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(bz,{}),(0,Q.jsxs)(fz,{onFocus:e=>{r?.(e),_z(e)},"data-slot":`dialog-content`,className:Y(`fixed top-1/2 left-1/2 m-0 data-closed:pointer-events-none grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none backdrop:bg-transparent sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:[t,n&&(0,Q.jsxs)(hz,{"data-slot":`dialog-close`,"data-dialog-close":``,render:(0,Q.jsx)(X,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Oi,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Sz({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:Y(`flex flex-col gap-1`,e),...t})}function Cz({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(hz,{render:(0,Q.jsx)(X,{variant:`outline`}),children:`Close`})]})}function wz({className:e,...t}){return(0,Q.jsx)(pz,{"data-slot":`dialog-title`,className:Y(`font-heading text-sm font-medium [overflow-wrap:anywhere]`,e),...t})}function Tz({className:e,...t}){return(0,Q.jsx)(mz,{"data-slot":`dialog-description`,className:Y(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ez({controller:e,children:t,onOpenChange:n,onPayloadChange:r,...i}){let[a,o]=Z.useState(void 0);return(0,Q.jsx)(nz,{"data-slot":`alert-dialog`,container:Ar(),...e===void 0?{}:{controller:e},onOpenChange:(t,r)=>{t&&e&&o(e.getPayload()),n?.(t,r)},onPayloadChange:(e,t)=>{o(e),r?.(e,t)},...i,children:typeof t==`function`?t(a):t})}function Dz({className:e,...t}){return(0,Q.jsx)(rz,{"data-slot":`alert-dialog-overlay`,className:Y(gz,e),...t})}function Oz({className:e,size:t=`default`,onFocus:n,...r}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Dz,{}),(0,Q.jsx)(iz,{onFocus:e=>{n?.(e),_z(e)},"data-slot":`alert-dialog-content`,"data-size":t,className:Y(`group/alert-dialog-content data-closed:pointer-events-none fixed top-1/2 left-1/2 m-0 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none backdrop:bg-transparent data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})]})}function kz({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Y(`grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Az({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Y(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function jz({className:e,...t}){return(0,Q.jsx)(az,{"data-slot":`alert-dialog-title`,className:Y(`font-heading text-sm font-medium [overflow-wrap:anywhere] sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Mz({className:e,...t}){return(0,Q.jsx)(oz,{"data-slot":`alert-dialog-description`,className:Y(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Nz({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,Q.jsx)(sz,{"data-slot":`alert-dialog-cancel`,className:Y(e),render:(0,Q.jsx)(X,{variant:t,size:n}),...r})}var Pz=dt(e=>Vn(e,[`branch`,e.base??null],t=>t.changes.readBranchChanges({params:{worktreeId:e.scope.worktreeId},query:{base:e.base}}),t=>t.worktreeId===e.scope.worktreeId)),Fz=dt(e=>Vn(e,[`branch-bases`],t=>t.changes.listBranchBases({params:{worktreeId:e.scope.worktreeId}}))),Iz=dt(({connection:e,scope:t,input:n})=>et(e,t,[`change-diffs`,n],$o(function*(){let r=yield*(yield*Te(e)).request(e=>e.changes.readChangeDiffs({params:{worktreeId:t.worktreeId},payload:n}));return yield*xc(e,r.environmentId===e.environmentId&&r.worktreeId===t.worktreeId&&r.statusToken===n.expectedStatusToken),r}),Xn(e),n.expectedFiles.map(e=>e.path))),Lz=dt(({connection:e,scope:t,input:n})=>et(e,t,[`branch-diffs`,n],$o(function*(){return yield*(yield*Te(e)).request(e=>e.changes.readBranchDiffs({params:{worktreeId:t.worktreeId},payload:n}))}),Xn(e)).pipe(sr)),Rz=dt(({connection:e,scope:t,oid:n,parent:r,paths:i})=>et(e,t,[`commit-diffs`,n,r,i],$o(function*(){let a=yield*(yield*Te(e)).request(e=>e.changes.readCommitDiffs({params:{worktreeId:t.worktreeId,oid:n},payload:{...r===1?{}:{parent:r},paths:i.map(e=>[...e])}}));return yield*xc(e,a.commitOid===n),a}),Xn(e)).pipe(sr));function zz(e){return new Map(e.diffs.map(e=>[`selection`in e?za(e.selection):e.paths.join(`\0`),e.content]))}var Bz=dt(e=>cr(t=>e.map(e=>ma(t(e),zz)),t=>{for(let n of e)t(n)})),Vz=dt(e=>Oe(t=>Xr(po(e,e=>Xr(t.result(e,{suspendOnWaiting:!0}),zz),{concurrency:`unbounded`}),e=>new Map(e.flatMap(e=>[...e])))).pipe(sr));function Hz(e,t){return Bi(t.map(t=>lt.reviewSurface(e.connection.environmentId,e.scope,[t])))}var Uz=dt(e=>Xn(e.connection).fn(_s(`Changes.readCurrent`)(t=>wi(ka(e),()=>Hz(e,[`changes`]))))),Wz=dt(e=>Xn(e.connection).fn(_s(`Changes.refreshGitLook`)(t=>wi(ka(e),()=>Hz(e,[`changes`,`git-status`]))))),Gz=dt(e=>Xn(e.connection).fn(_s(`Changes.readCurrentGitStatus`)(t=>wi(At(e),()=>Hz(e,[`git-status`]))))),Kz=dt(e=>Ie(e.connection).fn(_s(`Changes.recoverDiffs`)(function*(t,n){let r=yield*qt,i=fe(e.scope);if(!(yield*r.begin(i,t)))return;let a=d(e),o=yield*Ks(),s=!1;n.refresh(a),yield*Qe(Es(()=>n.registry.subscribe(a,e=>{Xi(e)||e.waiting?s=!0:s&&j(o,to)},{immediate:!0})),()=>Cn(o),e=>Es(e)).pipe(Br(r.finish(i)))}),{concurrent:!0})),qz=dt(({connection:e,scope:t})=>Ie(e).atom(ms(Xr(qt,e=>e.changes)).pipe(os(e=>ut(e,fe(t)))))),Jz=dt(e=>Ie(e.connection).fn(_s(`Changes.retryStaleDiff`)(function*(t,n){let r=yield*qt,i=fe(e.scope);yield*ca,(yield*r.retry(i,t.ticket,[e.key])).length!==0&&(yield*Es(()=>n.refresh(t.query)).pipe(jr(un(n.result(t.query,{suspendOnWaiting:!0}))),Br(r.settle(i,t.ticket,e.key))))}))),Yz=dt(e=>{let{connection:t,scope:n,statusToken:r,read:i}=e,a=ty(e.expectedFiles,e.selections,200).map(e=>{let i={expectedStatusToken:r,expectedFiles:e.expectedFiles,selections:e.selections},a=JSON.stringify(i);return{key:a,input:i,query:Iz({connection:t,scope:n,input:i}),retry:Jz({connection:t,scope:n,key:a})}}),o=a.map(e=>e.query),s=Bz(o),c=Vz(o),l=Kz({connection:t,scope:n}),u=mn((e,t)=>Es(()=>{for(let n of e)t.refresh(n)})),d=e=>a.flatMap((t,n)=>{let r=e[n];return r!==void 0&&Mi(r)&&v(Ra(r.cause))?[{key:t.key,statusToken:t.input.expectedStatusToken,expectedFiles:t.input.expectedFiles,waiting:r.waiting}]:[]});return Ke(e=>{e.mount(l),e.mount(u);for(let t of a)e.mount(t.retry);let r=e(s),o=e(qz({connection:t,scope:n})),f=d(r),p=Bo(o)?pn(o.value,i,f):{kind:`idle`};if(p.kind===`recover`&&e.set(l,{read:i,asked:!1}),p.kind===`retry`)for(let t of a)p.batches.includes(t.key)&&e.set(t.retry,{query:t.query,ticket:p.ticket});let m=e(c),h=Cc(p)||Mi(m)&&!r.some(e=>Mi(e));return{result:h&&Mi(m)?Sc(m.previousSuccess,{onNone:()=>Ns(!0),onSome:e=>Hs(e)}):m,recovery:{pending:h}}},(e,t)=>{let n=e.get(s),r=d(n).map(e=>e.key);if(r.length===0)return e.set(u,o);e.set(l,{read:i,asked:!0}),e.set(u,a.flatMap((e,t)=>{let i=n[t];return i!==void 0&&Mi(i)&&!r.includes(e.key)?[e.query]:[]}))},e=>e(s)).pipe(Wo(0))}),Xz=class e extends u()(`@porcelain/client/ReviewedFilesState`){static layer(t,n,r){return Hr(e,$o(function*(){let e=yield*Te(t),i=yield*Fr([]),a=Ey(r),o=yield*Pe(t,lt.reviewSurface(t.environmentId,n,a),$o(function*(){let i=yield*e.request(e=>e.reviewedFiles.listReviewedFiles({params:{worktreeId:n.worktreeId},query:r.kind===`branch`?{scope:`branch`,branch:r.branch}:{}}));return yield*xc(t,i.worktreeId===n.worktreeId),i}),y(),lt.worktreeReads(t,n,a));return{stream:xi(o.stream,gr(i),(e,t)=>ma(e,e=>Dy(e,t))),confirm:(e,r)=>Mo(a=>$o(function*(){yield*a(xc(t));let s={id:Symbol(),changes:e,reviewedAt:Ce(yield*st)};return yield*rn(i,e=>[...e,s]),yield*a(o.confirm(r.pipe(wi(e=>xc(t,e.worktreeId===n.worktreeId))),(e,t)=>Zn({worktreeId:t.worktreeId,marks:t.marks}))).pipe(Br(rn(i,e=>e.filter(e=>e.id!==s.id))))}))}}))}},Zz=dt(({connection:e,scope:t,range:n})=>e.atoms(r=>Ls(Xz.layer(e,t,n),r(Xn(e).layer))));function Qz(e){return Zz({...e,range:Ty(e.range)})}var $z=dt(e=>Uo(e.scope,`reviewed`,Xz,Qz(e)).pipe(sr));function eB({range:e=fy,...t}){return $z({...t,range:Ty(e)})}var tB=dt(({connection:e,scope:t,range:n})=>{let r=Qz({connection:e,scope:t,range:n}),i={worktreeId:t.worktreeId},a=n.kind===`branch`?{scope:`branch`,branch:n.branch}:{};function o(e,t){return Ni(Xz,n=>n.confirm(e,t))}let s=_s(`Reviews.markFile`)(function*(t){let r=yield*Te(e);return yield*o([t],r.request(e=>n.kind===`branch`?e.reviewedFiles.setReviewedFile({params:i,payload:{...t,reviewed:!0,scope:`branch`,base:n.base}}):e.reviewedFiles.setReviewedFile({params:i,payload:{...t,reviewed:!0}})))}),c=_s(`Reviews.unmarkFile`)(function*(t){let n=yield*Te(e);return yield*o([{path:t}],n.request(e=>e.reviewedFiles.removeReviewedFile({params:i,query:{path:t,...a}})))}),l=_s(`Reviews.markFiles`)(function*(t){return yield*o(t,(yield*Te(e)).request(e=>n.kind===`branch`?e.reviewedFiles.setReviewedFiles({params:i,payload:{files:t,scope:`branch`,base:n.base}}):e.reviewedFiles.setReviewedFiles({params:i,payload:{files:t}})))}),u=_s(`Reviews.unmarkFiles`)(function*(t){let n=yield*Te(e);return yield*o(t.map(e=>({path:e})),n.request(e=>e.reviewedFiles.removeReviewedFiles({params:i,payload:{paths:[...t],...a}})))});return{set:r.fn(s,{concurrent:!0}),remove:r.fn(c,{concurrent:!0}),bulk:r.fn(_s(`Reviews.reviewFiles`)(function*(e){if(e.kind===`unmark`){for(let t of my(e.paths,xa))yield*u(t);return{kind:`unmark`}}let t=gy(e.entries),n=t.report;for(let e of my(t.files,xa))n=_y(n,yield*l(e));return{kind:`mark`,report:n}}),{concurrent:!0})}});function nB(e,t){if(Mi(e))return Ra(e.cause);if(Mi(t))return Ra(t.cause)}function rB(e,t){let n=(0,$.c)(3),r;return n[0]!==t||n[1]!==e?(r=d({scope:e,connection:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],$u(r).value}function iB(e,t){let n=(0,$.c)(3),r;return n[0]!==t||n[1]!==e?(r=d({scope:e,connection:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],Ot(r)}function aB(e,t,n,r,i,a){let o=(0,$.c)(20),s;o[0]!==t||o[1]!==i||o[2]!==r||o[3]!==e||o[4]!==a||o[5]!==n?(s=Yz({scope:e,connection:t,statusToken:n,read:r,expectedFiles:i,selections:a}),o[0]=t,o[1]=i,o[2]=r,o[3]=e,o[4]=a,o[5]=n,o[6]=s):s=o[6];let c=s,{result:l,recovery:u}=Ot(c),d=u.pending,f;o[7]===l?f=o[8]:(f=Bo(l)?l.value:new Map,o[7]=l,o[8]=f);let p;o[9]!==d||o[10]!==l?(p=Xi(l)||d,o[9]=d,o[10]=l,o[11]=p):p=o[11];let m;o[12]===l?m=o[13]:(m=Mi(l),o[12]=l,o[13]=m);let h=Da(c),g;return o[14]!==d||o[15]!==f||o[16]!==p||o[17]!==m||o[18]!==h?(g={diffs:f,pending:p,recovering:d,failed:m,retry:h},o[14]=d,o[15]=f,o[16]=p,o[17]=m,o[18]=h,o[19]=g):g=o[19],g}var oB=Oe(Ns());function sB(e,t,n){let r=(0,$.c)(11),i=n===void 0||n,a;r[0]!==t||r[1]!==e?(a=xt({connection:t,scope:e}),r[0]=t,r[1]=e,r[2]=a):a=r[2];let o=a,s=Ot(i?o:oB),c;r[3]!==t||r[4]!==e?(c=Gz({connection:t,scope:e}),r[3]=t,r[4]=e,r[5]=c):c=r[5];let u;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={mode:`promise`},r[6]=u):u=r[6];let d=Da(c,u),f=l(i?o:oB),p;return r[7]!==s||r[8]!==d||r[9]!==f?(p={result:s,read:d,refresh:f},r[7]=s,r[8]=d,r[9]=f,r[10]=p):p=r[10],p}function cB(e,t){if(!B_(t))return null;let n=bu(t.patch),r=zM(t.patch,{cacheKeyPrefix:`${Xv(e)}:${n}`}).flatMap(e=>e.files),i=r.length===1?r[0]:void 0;return i?{id:Xv(e),kind:`diff`,path:zt(e),fileDiff:i,version:n,note:`${e.scope} · ${e.kind}`}:null}function lB(e,t,n){let r=V_(t,n);if(!r||n?.kind!==`text`)return null;let i=bu(n.patch),a=zM(n.patch,{cacheKeyPrefix:`${e}:${r}:${i}`}).flatMap(e=>e.files),o=a[0];return o?{id:`commit:${e}:${r}`,kind:`diff`,path:r,fileDiff:o,lineCounts:a.flatMap(e=>e.hunks).reduce((e,t)=>({added:e.added+t.additionLines,removed:e.removed+t.deletionLines}),{added:0,removed:0}),version:i,note:t.status}:null}function uB(e,t){let n=(0,$.c)(4),r;n[0]!==t||n[1]!==e?(r=Uz({connection:t,scope:e}),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;return n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3],Da(r,i)}function dB(e,t){let n=(0,$.c)(4),r;n[0]!==t||n[1]!==e?(r=Wz({connection:t,scope:e}),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;return n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3],Da(r,i)}function fB(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=Bz(e),t[0]=e,t[1]=n);let r=n,i=Ot(r),a=l(r),o;return t[2]!==i||t[3]!==a?(o={results:i,retry:a},t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function pB(e){let t=(0,$.c)(11),n=fB(e),r;t[0]===n.results?r=t[1]:(r=new Map(n.results.flatMap(mB)),t[0]=n.results,t[1]=r);let i;t[2]===n.results?i=t[3]:(i=n.results.some(Xi),t[2]=n.results,t[3]=i);let a;t[4]===n.results?a=t[5]:(a=n.results.some(Mi),t[4]=n.results,t[5]=a);let o;return t[6]!==n.retry||t[7]!==r||t[8]!==i||t[9]!==a?(o={patches:r,pending:i,failed:a,retry:n.retry},t[6]=n.retry,t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function mB(e){return Ee(qr(e)).flatMap(hB)}function hB(e){return[...e]}var gB=Oe(Ns()),_B=Oe(Ns());function vB(e,t,n){let r=(0,$.c)(7),i;r[0]!==n||r[1]!==t||r[2]!==e?(i=e?Pz({connection:t,scope:e,...n===void 0?{}:{base:n}}):_B,r[0]=n,r[1]=t,r[2]=e,r[3]=i):i=r[3];let a=i,o=Ot(a),s=l(a),c;return r[4]!==o||r[5]!==s?(c={result:o,refresh:s},r[4]=o,r[5]=s,r[6]=c):c=r[6],c}function yB(e,t,n){let r=(0,$.c)(7),i;r[0]!==t||r[1]!==n||r[2]!==e?(i=n?Fz({connection:t,scope:e}):gB,r[0]=t,r[1]=n,r[2]=e,r[3]=i):i=r[3];let a=i,o=Ot(a),s=l(a),c;return r[4]!==o||r[5]!==s?(c={result:o,refresh:s},r[4]=o,r[5]=s,r[6]=c):c=r[6],c}function bB(e,t,n,r){let i=(0,$.c)(5),a;return i[0]!==t||i[1]!==r||i[2]!==n||i[3]!==e?(a=n?ny(r,25).map(r=>Lz({connection:t,scope:e,input:{baseOid:n.baseOid,headOid:n.headOid,paths:r.map(xB)}})):[],i[0]=t,i[1]=r,i[2]=n,i[3]=e,i[4]=a):a=i[4],pB(a)}function xB(e){return[...e]}function SB(e,t,n,r,i){let a=(0,$.c)(11),o;if(a[0]!==e||a[1]!==n||a[2]!==r||a[3]!==i||a[4]!==t){let s;a[6]!==e||a[7]!==n||a[8]!==r||a[9]!==t?(s=i=>Rz({connection:e,scope:t,oid:n,parent:r,paths:i}),a[6]=e,a[7]=n,a[8]=r,a[9]=t,a[10]=s):s=a[10],o=ny(i,25).map(s),a[0]=e,a[1]=n,a[2]=r,a[3]=i,a[4]=t,a[5]=o}else o=a[5];return pB(o)}function CB(e,t){let n=(0,$.c)(7),r;n[0]!==e||n[1]!==t?(r=Ge({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3];let[a,o]=B(r,i),s;return n[4]!==a||n[5]!==o?(s={result:a,submit:o},n[4]=a,n[5]=o,n[6]=s):s=n[6],s}function wB(e,t){let n=(0,$.c)(5),r=CB(e,t),i;n[0]===r?i=n[1]:(i=e=>r.submit({path:Wc(e.path),flag:`hidden`,value:e.hidden}),n[0]=r,n[1]=i);let a;return n[2]!==r||n[3]!==i?(a={...r,submit:i},n[2]=r,n[3]=i,n[4]=a):a=n[4],a}function TB(e,t){let n=(0,$.c)(5),r=CB(e,t),i;n[0]===r?i=n[1]:(i=e=>r.submit({path:Wc(e.path),flag:`pinned`,value:e.pinned}),n[0]=r,n[1]=i);let a;return n[2]!==r||n[3]!==i?(a={...r,submit:i},n[2]=r,n[3]=i,n[4]=a):a=n[4],a}var EB=Oe(void 0),DB=Ve(Ut({group:ee,offset:lc})),OB=Qt(DB),kB=dt(e=>Oe(()=>{let t=`porcelain.worktree-navigator.${e}`,n;try{n=de(OB(sessionStorage.getItem(t)))}catch{n=void 0}return e=>{if(!e)return;if(n&&e.scrollTop===0){let t=e.querySelector(`[data-navigator-group="${CSS.escape(n.group)}"]`);if(t){let r=t.getBoundingClientRect(),i=n.offset<r.height?n.offset:0;e.scrollTop=r.top-e.getBoundingClientRect().top+i}}let r=()=>{if(!e.clientHeight||!e.firstElementChild)return;let r=e.getBoundingClientRect().top,i=Array.from(e.children).find(e=>e.getBoundingClientRect().bottom>r),a=i?.getAttribute(`data-navigator-group`);n=e.scrollTop>0&&i&&a?{group:a,offset:r-i.getBoundingClientRect().top}:void 0;try{n?sessionStorage.setItem(t,JSON.stringify(n)):sessionStorage.removeItem(t)}catch{return}};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),r()}}}).pipe(x)),AB=cz(),jB=cz(),MB=cz(),NB=XR(),PB=XR(),FB=XR(),IB=XR(),LB=cz();function RB(e,t,n,r,i,a){let o=(0,$.c)(15),s;o[0]===e?s=o[1]:(s=b(e),o[0]=e,o[1]=s);let c;o[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={mode:`promiseExit`},o[2]=c):c=o[2];let[l,u]=B(s,c),d=Da(EB),f;o[3]!==n||o[4]!==a||o[5]!==i||o[6]!==u||o[7]!==l||o[8]!==t||o[9]!==r||o[10]!==d?(f=e=>{if(!l.waiting)return u({path:e,remote:t,recover:i,...a?{reconnectProjectId:a}:{},complete:()=>{d(void 0),n()},select:e=>Ui({try:()=>r(e),catch:zB})})},o[3]=n,o[4]=a,o[5]=i,o[6]=u,o[7]=l,o[8]=t,o[9]=r,o[10]=d,o[11]=f):f=o[11];let p=f,m;return o[12]!==l||o[13]!==p?(m={result:l,submit:p},o[12]=l,o[13]=p,o[14]=m):m=o[14],m}function zB(e){return new To({message:`Could not open the selected worktree.`,cause:e})}function BB(){let e=(0,$.c)(2),t=Da(EB),n;return e[0]===t?n=e[1]:(n=e=>{e||t(void 0)},e[0]=t,e[1]=n),n}var VB=tt(F.layer).atom(F),HB=dt(e=>e.atoms(F.layer).fn((t,n)=>$o(function*(){let r=yield*(yield*F).pickProject(e.address);r!==null&&(yield*n.setResult(b(e),{path:r,remote:null,recover:(e,t)=>void AB.open({payload:{remote:null,project:e,path:t}}),complete:()=>void 0,select:e=>Ui({try:()=>t(e),catch:e=>new To({message:`Could not open the selected worktree.`,cause:e})})}))})));function UB(e,t,n){let r=(0,$.c)(3),i=de(qr(Ot(VB))),a;r[0]===e?a=r[1]:(a=HB(e),r[0]=e,r[1]=a);let o;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},r[2]=o):o=r[2];let[s,c]=B(a,o);return i?.canPickProject(e.address)&&(()=>{s.waiting||c(t).then(e=>{if(Mn(e)){let t=Ra(e.cause);n(t instanceof Error?t:new To({message:`Could not open the selected worktree.`,cause:t}))}})})}function WB(e,t){let n=(0,$.c)(6),r;n[0]!==e||n[1]!==t?(r=De({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a=Ot(i),o=l(i),s;return n[3]!==a||n[4]!==o?(s={result:a,refresh:o},n[3]=a,n[4]=o,n[5]=s):s=n[5],s}function GB(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=De({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],$u(r).value}function KB(e,t){let n=(0,$.c)(2),r=GB(e,t),i;return n[0]===r.preferences?i=n[1]:(i=new Set(r.preferences.filter(JB).map(qB)),n[0]=r.preferences,n[1]=i),i}function qB(e){return e.path}function JB(e){return e.hidden}function YB(e,t){let n=(0,$.c)(2),r=GB(e,t),i;return n[0]===r.preferences?i=n[1]:(i=r.preferences.filter(ZB).map(XB),n[0]=r.preferences,n[1]=i),i}function XB(e){return e.path}function ZB(e){return e.pinned}function QB(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=Dt(e),t[0]=e,t[1]=n),$u(n).value}var $B=.875;function eV({overflowX:e,overflowY:t}){return e&&!t?`x`:`y`}function tV({client:e,scroll:t}){return Math.max(0,t-e)}function nV(e){return tV(e)>=1}function rV(e){return Math.min(Math.max(e.position,0),tV(e))}function iV(e){let t=tV(e),n=rV(e),r=t<1?0:n,i=t<1?0:t-n;return{before:r,after:i,atStart:r<1,atEnd:i<1,progress:t<1?0:n/t}}function aV(e,t){if(t<=0||e.scroll<=0)return{size:0,offset:0};let n=Math.min(t,Math.max(16,t*e.client/e.scroll)),r=tV(e);return{size:n,offset:r<=0?0:(t-n)*rV(e)/r}}function oV(e,t,n,r){let{size:i}=aV(n,r),a=r-i;if(a<=0)return e;let o=tV(n);return Math.min(Math.max(e+t/a*o,0),o)}function sV(e,t,n){let{size:r}=aV(t,n),i=n-r;return i<=0?0:Math.min(Math.max((e-r/2)/i,0),1)*tV(t)}function cV(e,t){return e<t.offset?-1:+(e>t.offset+t.size)}function lV(e){return Math.max(1,Math.round(e*$B))}function uV(e,t,n,r){return t===1?e*n:t===2?e*r:e}function dV(e,t){return e===`always`?!0:t.overflow?e===`auto`||t.dragging||t.scrolling?!0:e===`hover`&&t.hovering:!1}function fV(e,t){let n=t.after<1;return e?n||t.delta>=0:n&&t.delta>0}var pV=new Set([`ArrowUp`,`PageUp`,`Home`]);function mV(e,t,n){return n?!1:pV.has(e)||e===` `&&t}var hV=16;function gV(e){let t=new Map,n=Df(),r,i=e=>{r===e&&(r=void 0,n.cancel())};function a(t){if(!e.viewport()||t.ctrlKey)return;t.deltaX!==0&&e.readDirection(),e.measure();let n=uV(t.deltaX,t.deltaMode,hV,e.metrics.x.client),r=uV(t.deltaY,t.deltaMode,hV,e.metrics.y.client),i=(t,n)=>{let r=n===`x`&&e.rtl()?-t:t;return r<0?e.metrics[n].position>0:r>0&&tV(e.metrics[n])-e.metrics[n].position>=1};(i(n,`x`)||i(r,`y`))&&(t.preventDefault(),r<0?e.release():e.stopEasing(),e.viewport().scrollBy({left:n,top:r,behavior:`instant`}))}function o(r,a){t.set(a,r);let o=Ef(r,`pointerdown`,t=>{e.viewport()&&n.accepts(t)&&(t.stopPropagation(),t.preventDefault(),a===`x`&&e.readDirection(),e.measure(),s(r,t,a,e.metrics[a].position))});return()=>{o(),i(r),t.get(a)===r&&t.delete(a)}}function s(t,i,a,o){let s=a===`y`?i.clientY:i.clientX,c=yV(t,a),l=_V(e.viewport());e.stopEasing(),e.setDragging(a),r=t,n.start(t,i,{cancelOnEscape:!0,onMove:t=>{let n=((a===`y`?t.y:t.x)-s)/c,r=a===`x`&&e.rtl()?-n:n;e.scrollTo(a,oV(o,r,e.metrics[a],e.track[a]))},onEnd:(n,i)=>{i&&r===t&&n.type===`pointermove`&&e.scrollTo(a,o),r=void 0,l(),e.setDragging(null)}})}function c(i,a,o){if(!e.viewport()||!n.accepts(i))return;i.preventDefault(),o===`x`&&e.readDirection(),e.measure();let c=vV(a,o,i);if(i.altKey){let n=sV(c,e.metrics[o],e.track[o]);e.scrollTo(o,n);let r=t.get(o);r&&s(r,i,o,n);return}let l=cV(c,aV(e.metrics[o],e.track[o]));if(l===0)return;o===`y`&&l<0&&e.release();let u=lV(e.metrics[o].client),d=tV(e.metrics[o]),f=e.metrics[o].position,p=yf(()=>{let t=aV({...e.metrics[o],position:f},e.track[o]);return cV(c,t)===l&&(f=Math.min(Math.max(f+l*u,0),d),e.scrollTo(o,f,`auto`),f>0&&f<d)});r=a,n.start(a,i,{onMove:e=>c=vV(a,o,e.event),onEnd:()=>{r=void 0,p()}})}return{forwardWheel:a,bindThumb:o,pressTrack:c,endPress:i}}function _V(e){let t=e.style.scrollSnapType;return e.style.scrollSnapType=`none`,()=>{e.style.scrollSnapType=t}}function vV(e,t,n){let r=e.getBoundingClientRect(),i=getComputedStyle(e),a=e=>Number.parseFloat(e)||0,o=yV(e,t);return t===`y`?(n.clientY-r.top)/o-a(i.borderTopWidth)-a(i.paddingTop):i.direction===`rtl`?(r.right-n.clientX)/o-a(i.borderRightWidth)-a(i.paddingRight):(n.clientX-r.left)/o-a(i.borderLeftWidth)-a(i.paddingLeft)}function yV(e,t){let n=e.getBoundingClientRect(),r=t===`y`?e.offsetHeight:e.offsetWidth,i=t===`y`?n.height:n.width;return r>0&&i>0?i/r:1}var bV=[`atXStart`,`atXEnd`,`atYStart`,`atYEnd`,`scrollingX`,`scrollingY`,`hovering`,`visibleX`,`visibleY`,`dragging`,`sticking`],xV=150,SV=[`x`,`y`],CV={x:{overflow:`overflowX`,atStart:`atXStart`,atEnd:`atXEnd`,scrolling:`scrollingX`,visible:`visibleX`,thumbSize:`--scroll-area-thumb-width`,before:`--scroll-area-overflow-x-start`,after:`--scroll-area-overflow-x-end`,progress:`--scroll-area-progress-x`},y:{overflow:`overflowY`,atStart:`atYStart`,atEnd:`atYEnd`,scrolling:`scrollingY`,visible:`visibleY`,thumbSize:`--scroll-area-thumb-height`,before:`--scroll-area-overflow-y-start`,after:`--scroll-area-overflow-y-end`,progress:`--scroll-area-progress-y`}},wV=SV.flatMap(e=>[CV[e].before,CV[e].after,CV[e].progress]);function TV(e){let t,n,r=()=>n?.ownerDocument.defaultView??window,i=new Set,a={x:0,y:0},o={x:0,y:0},s=!1,c={x:{position:0,client:0,scroll:0},y:{position:0,client:0,scroll:0}},l={x:NaN,y:NaN},u=new WeakMap,d=0,f=NaN,p=null,m=!1,h=0,g={x:0,y:0},_={x:0,y:0},v={x:0,y:0};function y(){let e=n;c.y.position=e.scrollTop,c.y.client=e.clientHeight,c.y.scroll=e.scrollHeight;let t=e.scrollLeft;t!==0&&t<0!==s&&(s=xf(e)),c.x.position=s?-t:t,c.x.client=e.clientWidth,c.x.scroll=e.scrollWidth}function b(e,t,n,r=`px`){let i=u.get(e);i||u.set(e,i={});let a=Math.round(n*100)/100;i[t]!==a&&(i[t]=a,e.style.setProperty(t,`${a}${r}`))}function x(t,n){e.get()[t]!==n&&e.set({[t]:n})}function S({resized:i=!1}={}){if(d=0,!n)return;y(),i&&O();let a=e.get(),o,s=(e,t)=>{a[e]!==t&&((o??={})[e]=t)};for(let e of SV){let n=c[e],i=CV[e],o=Number.isNaN(l[e])?0:n.position-l[e];l[e]=n.position;let u=iV(n);s(i.overflow,nV(n)),s(i.atStart,u.atStart),s(i.atEnd,u.atEnd),t&&(kf(wV),b(t,i.before,u.before),b(t,i.after,u.after),b(t,i.progress,u.progress,``)),C(e),o!==0&&(e===`y`&&Math.abs(n.position-f)<1||(_[e]=performance.now(),s(i.scrolling,!0),g[e]||=r().setTimeout(()=>E(e),xV)),e===`y`&&a.stickToEnd&&s(`sticking`,fV(a.sticking,{delta:o,after:u.after})))}w(o?.overflowX??a.overflowX,o?.overflowY??a.overflowY),o&&e.set(o),(o||i)&&D()}function C(e){let t=aV(c[e],a[e]);for(let n of i)n.axis===e&&(b(n.el,CV[e].thumbSize,t.size),b(n.el,`--scroll-area-thumb-offset`,e===`x`&&s?-t.offset:t.offset))}function w(n,r){if(!t)return;let i=e.get(),a=n&&r&&i.scrollbarsX>0&&i.scrollbarsY>0;b(t,`--scroll-area-corner-width`,a?o.y:0),b(t,`--scroll-area-corner-height`,a?o.x:0)}function T(){!d&&n&&(d=r().requestAnimationFrame(()=>S()))}function E(e){let t=performance.now()-_[e];t<xV?g[e]=r().setTimeout(()=>E(e),xV-t):(g[e]=0,x(CV[e].scrolling,!1),D())}function D(){let t=e.get();for(let e of SV){let n=CV[e];if(dV(t.type,{overflow:t[n.overflow],hovering:t.hovering,scrolling:t[n.scrolling],dragging:t.dragging===e})){r().clearTimeout(v[e]),v[e]=0,x(n.visible,!0);continue}if(!t[n.visible]||v[e])continue;let i=t.type===`scroll`||t.type===`hover`?t.scrollHideDelay:0;i<=0?x(n.visible,!1):v[e]=r().setTimeout(()=>{v[e]=0,x(n.visible,!1),D()},i)}}function O(){let t=e.get();if(!t.stickToEnd||!t.sticking||t.dragging||m||p!==null||h)return;let r=tV(c.y);r-c.y.position<1||(f=r,n.scrollTo({top:r,behavior:`instant`}),c.y.position=n.scrollTop)}function k(e,t,r=`instant`){n&&(e===`y`?n.scrollTo({top:t,behavior:r}):n.scrollTo({left:s?-t:t,behavior:r}))}function A(){j(),e.get().sticking&&c.y.position>0&&e.set({sticking:!1})}function j(){h&&=(r().cancelAnimationFrame(h),0)}function M(){let e=()=>{if(h=0,!n)return;y();let t=tV(c.y)-c.y.position;if(t<1)return S();k(`y`,c.y.position+Math.max(1,t*.2)),h=r().requestAnimationFrame(e)};h=r().requestAnimationFrame(e)}function N(t,{behavior:r=`smooth`}={}){if(!n)return;let i=eV(e.get());i===`x`&&(s=xf(n)),y();let a=r===`smooth`&&!eo();if(j(),t===`end`&&i===`y`&&e.get().stickToEnd&&x(`sticking`,!0),t===`end`&&i===`y`&&a)return M();k(i,t===`start`?0:tV(c[i]),a?`smooth`:`instant`)}function P(t){n=t;let r=t.ownerDocument.defaultView??window,i=!1,a=new ResizeObserver(()=>{s=xf(t),!i&&n===t&&(i=!0,S({resized:!0}),e.set({counted:!0})),y(),O(),T()}),o=()=>{a.observe(t);for(let e of Array.from(t.children))a.observe(e)};o();let c=new MutationObserver(()=>{o(),S({resized:!0})});c.observe(t,{childList:!0});let l=()=>e.get().overflowX||e.get().overflowY,u=yr(t,l),f=l(),h=e.subscribe(()=>{l()!==f&&(f=l(),u.check())}),_=()=>{m=!1,r.removeEventListener(`pointerup`,_,!0),r.removeEventListener(`pointercancel`,_,!0),S({resized:!0})},b=()=>{p=null,S({resized:!0})},x=[()=>a.disconnect(),()=>c.disconnect(),u.stop,h,Ef(t,`scroll`,T,{passive:!0}),Ef(t,`wheel`,e=>{e.deltaY>=0?j():DV(e.target,t)||A()},{passive:!0}),Ef(t,`keydown`,e=>{!e.defaultPrevented&&mV(e.key,e.shiftKey,EV(e.target))&&(DV(e.target,t)||A())}),Ef(t,`touchstart`,e=>p=e.touches[0]?.clientY??null,{passive:!0}),Ef(t,`touchmove`,e=>{let n=e.touches[0]?.clientY;n!==void 0&&(p!==null&&n>p&&!DV(e.target,t)&&A(),p=n)},{passive:!0}),Ef(t,`touchend`,b,{passive:!0}),Ef(t,`touchcancel`,b,{passive:!0}),Ef(t,`pointerdown`,e=>{e.pointerType!==`touch`&&e.button===0&&(m=!0,j(),r.addEventListener(`pointerup`,_,!0),r.addEventListener(`pointercancel`,_,!0))})];return()=>{x.forEach(e=>e()),r.removeEventListener(`pointerup`,_,!0),r.removeEventListener(`pointercancel`,_,!0),d&&r.cancelAnimationFrame(d),d=0,j();for(let e of SV)r.clearTimeout(g[e]),r.clearTimeout(v[e]),g[e]=v[e]=0;n===t&&(n=void 0)}}function F(e){Cf(()=>kf(wV)),t=e,queueMicrotask(()=>{t===e&&e.isConnected&&e.matches(`:hover`)&&x(`hovering`,!0)});let n=e=>t=>{t.pointerType!==`touch`&&(x(`hovering`,e),D())},r=[Ef(e,`pointerenter`,n(!0)),Ef(e,`pointerleave`,n(!1))];return()=>{r.forEach(e=>e()),t===e&&(t=void 0)}}let I=gV({viewport:()=>n,metrics:c,track:a,rtl:()=>s,measure:y,readDirection:()=>{s=xf(n)},scrollTo:k,release:A,stopEasing:j,setDragging:z});function L(e,t){let r={el:e,axis:t};i.add(r),queueMicrotask(R);let s=new ResizeObserver(([e])=>{let r=e.borderBoxSize?.[0],i=t===`y`?e.contentRect.height:e.contentRect.width,s=a[t]===0&&i>0;a[t]=i,o[t]=(t===`y`?r?.inlineSize:r?.blockSize)??0,s&&n&&(y(),C(t)),T()});s.observe(e),T();let c=[()=>s.disconnect(),Ef(e,`wheel`,I.forwardWheel,{passive:!1}),Ef(e,`mousedown`,e=>e.preventDefault()),Ef(e,`pointerdown`,n=>I.pressTrack(n,e,t))];return()=>{c.forEach(e=>e()),I.endPress(e),i.delete(r),R();for(let t in u.get(e))e.style.removeProperty(t);u.delete(e)}}function R(){let t=0,n=0;for(let e of i)e.axis===`x`?t++:n++;e.set({scrollbarsX:t,scrollbarsY:n})}function z(t){e.set({dragging:t}),D()}return{bindRoot:F,bindViewport:P,bindScrollbar:L,bindThumb:I.bindThumb,scrollToEdge:N,isAt(e){if(!n?.isConnected)return;y();let t=eV({overflowX:nV(c.x),overflowY:nV(c.y)}),r=iV(c[t]);return e===`start`?r.atStart:r.atEnd},focusViewport(){let e=n;e&&(e.hasAttribute(`tabindex`)||(e.setAttribute(`tabindex`,`-1`),e.addEventListener(`blur`,()=>e.getAttribute(`tabindex`)===`-1`&&e.removeAttribute(`tabindex`),{once:!0})),e.focus({preventScroll:!0}))},refresh(){n?.isConnected&&S({resized:!0}),D()}}}function EV(e){return e instanceof HTMLElement?e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName):!1}function DV(e,t){for(let n=e instanceof Element?e:null;n&&n!==t;n=n.parentElement){if(n.scrollTop<=0||n.scrollHeight<=n.clientHeight)continue;let{overflowY:e}=getComputedStyle(n);if(e===`auto`||e===`scroll`)return!0}return!1}var OV=e=>e===`horizontal`?`x`:`y`;function kV(e,t){let n=OV(e.props.orientation),r=t(n),i=Qi(e,()=>{OV(e.props.orientation)!==n&&(r(),n=OV(e.props.orientation),r=t(n))});return()=>{i(),r()}}var AV=e=>eV(e)===`x`?e.atXStart:e.atYStart,jV=e=>eV(e)===`x`?e.atXEnd:e.atYEnd,MV=e=>e.scrollbarsX+e.scrollbarsY>0,NV=e=>!jV(e)&&!(e.stickToEnd&&e.sticking),PV=e=>e?``:void 0,FV=e=>({overflowX:e.overflowX,overflowY:e.overflowY,atStart:AV(e),atEnd:jV(e),scrolling:e.scrollingX||e.scrollingY,hovering:e.hovering,sticking:e.stickToEnd&&e.sticking}),IV=e=>({"data-overflow-x":PV(e.overflowX),"data-overflow-y":PV(e.overflowY)}),LV=e=>({"data-at-start":PV(AV(e)),"data-at-end":PV(jV(e)),"data-at-x-start":PV(e.atXStart),"data-at-x-end":PV(e.atXEnd),"data-at-y-start":PV(e.atYStart),"data-at-y-end":PV(e.atYEnd),"data-scrolling":PV(e.scrollingX||e.scrollingY),"data-hovering":PV(e.hovering),"data-sticking":PV(e.stickToEnd&&e.sticking)}),RV=Object.fromEntries([`x`,`y`].flatMap(e=>[`overflow-`+e+`-start`,`overflow-`+e+`-end`,`progress-`+e].map(e=>[`--scroll-area-${e}`,`initial`]))),zV=e=>({type:e.type??`hover`,scrollHideDelay:e.scrollHideDelay??600,stickToEnd:e.stickToEnd??!1}),BV=sa({name:`scroll-area`,options:{type:`string`,scrollHideDelay:`number`,stickToEnd:`boolean`,controller:`value`},state:e=>({...zV(e),scrollbarsX:0,scrollbarsY:0,counted:!1,overflowX:!1,overflowY:!1,atXStart:!0,atXEnd:!0,atYStart:!0,atYEnd:!0,scrollingX:!1,scrollingY:!1,hovering:!1,visibleX:!1,visibleY:!1,dragging:null,sticking:!!e.stickToEnd}),live:bV,sync:zV,controlled:[],api:e=>{let{store:t,onDestroy:n}=e,r=TV(t);Gs(e,[`sticking`],(e,t)=>e.stickToEnd===void 0||e.stickToEnd===t.stickToEnd?void 0:{sticking:e.stickToEnd});let{stickToEnd:i,type:a,scrollHideDelay:o}=t.get(),s=!1;return n(()=>s=!0),n(t.subscribe(()=>{let e=t.get();(e.stickToEnd!==i||e.type!==a||e.scrollHideDelay!==o)&&({stickToEnd:i,type:a,scrollHideDelay:o}=e,queueMicrotask(()=>s||r.refresh()))})),{scrollToEnd:e=>r.scrollToEdge(`end`,e),scrollToStart:e=>r.scrollToEdge(`start`,e),isAtEnd:()=>r.isAt(`end`)??jV(t.get()),isAtStart:()=>r.isAt(`start`)??AV(t.get()),isSticking:()=>t.get().stickToEnd&&t.get().sticking,internal:r}},slots:e=>({root:e({state:FV,attrs:e=>({...IV(e),style:`position:relative`}),live:Qo(LV),bind:(e,{api:t})=>t.internal.bindRoot(e)}),viewport:e({state:FV,attrs:e=>({...IV(e),style:Ny({overflow:`auto`,"scrollbar-width":!e.counted||MV(e)?`none`:void 0})}),live:Qo(LV),bind:(e,{api:t})=>t.internal.bindViewport(e)}),content:e({state:FV,attrs:e=>({...IV(e),style:Ny({"min-width":e.scrollbarsX>0?`fit-content`:void 0,...RV})}),live:Qo(LV)}),scrollbar:e({props:{orientation:`string`},state:(e,{props:t})=>{let n=OV(t.orientation);return{orientation:Na(t.orientation,`vertical`),visible:n===`x`?e.visibleX:e.visibleY,scrolling:n===`x`?e.scrollingX:e.scrollingY,hovering:e.hovering,dragging:e.dragging===n}},attrs:(e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.overflowX:e.overflowY;return{"aria-hidden":`true`,"data-orientation":Na(t.orientation,`vertical`),...IV(e),style:Ny({position:`absolute`,"touch-action":`none`,"user-select":`none`,"-webkit-user-select":`none`,...n===`y`?{top:0,bottom:`var(--scroll-area-corner-height,0px)`,"inset-inline-end":0}:{bottom:0,"inset-inline-start":0,"inset-inline-end":`var(--scroll-area-corner-width,0px)`},display:r||e.type===`always`?void 0:`none`})}},live:Qo((e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.visibleX:e.visibleY;return{"data-visible":PV(r),"data-scrolling":PV(n===`x`?e.scrollingX:e.scrollingY),"data-hovering":PV(e.hovering),"data-dragging":PV(e.dragging===n),style:r?void 0:`pointer-events:none`}}),bind:(e,t)=>kV(t,n=>t.api.internal.bindScrollbar(e,n))}),thumb:e({props:{orientation:{kind:`string`,from:`scrollbar`}},state:(e,{props:t})=>({orientation:Na(t.orientation,`vertical`),dragging:e.dragging===OV(t.orientation)}),attrs:(e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.overflowX:e.overflowY;return{"data-orientation":Na(t.orientation,`vertical`),style:Ny(n===`y`?{height:`var(--scroll-area-thumb-height)`,transform:`translate3d(0,var(--scroll-area-thumb-offset,0px),0)`,display:r?void 0:`none`}:{width:`var(--scroll-area-thumb-width)`,transform:`translate3d(var(--scroll-area-thumb-offset,0px),0,0)`,display:r?void 0:`none`})}},live:Qo((e,{props:t})=>({"data-dragging":PV(e.dragging===OV(t.orientation))})),bind:(e,t)=>kV(t,n=>t.api.internal.bindThumb(e,n))}),corner:e({attrs:e=>({"aria-hidden":`true`,style:Ny({position:`absolute`,bottom:0,"inset-inline-end":0,width:`var(--scroll-area-corner-width)`,height:`var(--scroll-area-corner-height)`,display:e.overflowX&&e.overflowY&&e.scrollbarsX>0&&e.scrollbarsY>0?void 0:`none`})})}),"scroll-to-end":e({state:e=>({visible:NV(e)}),attrs:()=>({type:`button`}),live:Qo(e=>({"data-visible":PV(NV(e)),inert:PV(!NV(e))})),press:({api:e,el:t},n)=>{t&&t.ownerDocument.activeElement===t&&e.internal.focusViewport(),e.scrollToEnd(),n?.preventDefault()}})})}),VV=he(BV,{root:`div`,viewport:`div`,content:`div`,corner:`div`,"scroll-to-end":`button`}),HV=Z.createContext(`vertical`),UV=VV.Root,WV=VV.Viewport;VV.Content;function GV({orientation:e=`vertical`,...t}){return(0,Q.jsx)(HV.Provider,{value:e,children:tr(BV,`scrollbar`,{id:e,orientation:e},t)})}function KV(e){let t=Z.useContext(HV);return tr(BV,`thumb`,{id:t,orientation:t},e)}var qV=VV.Corner;VV.ScrollToEnd;function JV({className:e,children:t,...n}){return(0,Q.jsxs)(UV,{"data-slot":`scroll-area`,className:Y(`relative`,e),...n,children:[(0,Q.jsx)(WV,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,Q.jsx)(YV,{}),(0,Q.jsx)(qV,{})]})}function YV({className:e,orientation:t=`vertical`,...n}){return(0,Q.jsx)(GV,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:Y(`flex touch-none p-px transition-[color,opacity] select-none data-horizontal:opacity-0 data-horizontal:data-hovering:opacity-100 data-horizontal:data-scrolling:opacity-100 data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,Q.jsx)(KV,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function XV({className:e,...t}){return(0,Q.jsx)(WV,{"data-scroll-strip":``,className:Y(e),...t})}function ZV({className:e,...t}){return(0,Q.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:Y(e),...t})}function QV({className:e,...t}){return(0,Q.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:Y(`flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground`,e),...t})}function $V({className:e,...t}){return(0,Q.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:Y(`inline-flex items-center gap-1`,e),...t})}function eH({className:e,render:t,...n}){return Se({defaultTagName:`a`,props:Wn({className:Y(`transition-colors hover:text-foreground`,e)},n),render:t,state:{slot:`breadcrumb-link`}})}function tH({className:e,...t}){return(0,Q.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:Y(`font-normal text-foreground`,e),...t})}function nH({children:e,className:t,...n}){return(0,Q.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:Y(`[&>svg]:size-3.5`,t),...n,children:e??(0,Q.jsx)(ci,{})})}function rH(e,t){let n=(0,$.c)(6),r;n[0]!==e||n[1]!==t?(r=Qn(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a=Ot(i),o=l(i),s;return n[3]!==a||n[4]!==o?(s={value:a,refresh:o},n[3]=a,n[4]=o,n[5]=s):s=n[5],s}function iH(e){let t=(0,$.c)(3),{folder:n,disabled:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,Q.jsx)(JV,{className:`h-38`,"aria-label":`Folders`,children:(0,Q.jsx)(`div`,{className:`flex flex-col p-1`,children:(0,Q.jsx)(aH,{folder:n,disabled:r})})})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function aH(e){let t=(0,$.c)(38),{folder:n,disabled:r}=e,i=Da(EB),a;t[0]===n.value?a=t[1]:(a=de(qr(n.value)),t[0]=n.value,t[1]=a);let o=a;if(Xi(n.value)){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-2 py-1.5`,children:(0,Q.jsx)(Be,{label:`Reading folders`})}),t[2]=e):e=t[2],e}if(Mi(n.value)){let e;t[3]===n.value.cause?e=t[4]:(e=ue(Ra(n.value.cause)),t[3]=n.value.cause,t[4]=e);let a;t[5]===e?a=t[6]:(a=(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}),t[5]=e,t[6]=a);let o;t[7]!==r||t[8]!==n.refresh?(o=(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:n.refresh,disabled:r,children:`Try again`}),t[7]=r,t[8]=n.refresh,t[9]=o):o=t[9];let s;t[10]===i?s=t[11]:(s=()=>i(void 0),t[10]=i,t[11]=s);let c;t[12]!==r||t[13]!==s?(c=(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,onClick:s,disabled:r,children:`Home folder`}),t[12]=r,t[13]=s,t[14]=c):c=t[14];let l;t[15]!==o||t[16]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[o,c]}),t[15]=o,t[16]=c,t[17]=l):l=t[17];let u;return t[18]!==a||t[19]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-2 py-1.5`,children:[a,l]}),t[18]=a,t[19]=l,t[20]=u):u=t[20],u}if(!o)return null;let s;t[21]!==o.parent||t[22]!==r||t[23]!==i?(s=o.parent&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`w-full justify-start`,onClick:()=>i(o.parent??void 0),disabled:r,children:[(0,Q.jsx)(yh,{"data-icon":`inline-start`}),`Up`]}),t[21]=o.parent,t[22]=r,t[23]=i,t[24]=s):s=t[24];let c;if(t[25]!==o.directories||t[26]!==r||t[27]!==i){let e;t[29]!==r||t[30]!==i?(e=e=>(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`w-full justify-start`,title:e.path,onClick:()=>i(e.path),disabled:r,children:[(0,Q.jsx)(hg,{"data-icon":`inline-start`}),(0,Q.jsx)(fr,{text:e.name})]},e.path),t[29]=r,t[30]=i,t[31]=e):e=t[31],c=o.directories.map(e),t[25]=o.directories,t[26]=r,t[27]=i,t[28]=c}else c=t[28];let l;t[32]===o.directories.length?l=t[33]:(l=!o.directories.length&&(0,Q.jsx)(`p`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No subfolders.`}),t[32]=o.directories.length,t[33]=l);let u;return t[34]!==s||t[35]!==c||t[36]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[34]=s,t[35]=c,t[36]=l,t[37]=u):u=t[37],u}function oH(e){let t=(0,$.c)(37),{connection:n,disabled:r,onOpen:i,action:a}=e,o=Ot(EB),s=Da(EB),c=rH(n,o),l,u;t[0]===c.value?(l=t[1],u=t[2]):(l=de(qr(c.value)),u=l?[`/`,...l.path.split(`/`).filter(Boolean)]:[],t[0]=c.value,t[1]=l,t[2]=u);let d=u,f;t[3]!==d||t[4]!==l||t[5]!==r||t[6]!==s?(f=l&&(0,Q.jsx)(ZV,{"aria-label":`Folder path`,children:(0,Q.jsx)(QV,{children:d.map((e,t)=>{let n=t===0?`/`:`/${d.slice(1,t+1).join(`/`)}`;return(0,Q.jsxs)(Z.Fragment,{children:[t>0&&(0,Q.jsx)(nH,{}),(0,Q.jsx)($V,{className:`min-w-0`,children:t===d.length-1?(0,Q.jsx)(tH,{className:`max-w-48`,title:l.path,children:e}):(0,Q.jsx)(eH,{render:(0,Q.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>s(n)}),title:n,children:e})})]},n)})})}),t[3]=d,t[4]=l,t[5]=r,t[6]=s,t[7]=f):f=t[7];let p;t[8]===f?p=t[9]:(p=(0,Q.jsx)(`div`,{className:`flex min-h-5 flex-col gap-1`,children:f}),t[8]=f,t[9]=p);let m;t[10]!==r||t[11]!==c?(m=(0,Q.jsx)(iH,{folder:c,disabled:r}),t[10]=r,t[11]=c,t[12]=m):m=t[12];let h;t[13]===l?.truncated?h=t[14]:(h=l?.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This folder is large; some entries are not shown.`}),t[13]=l?.truncated,t[14]=h);let g=l?.repository?`Every worktree appears in the sidebar.`:`Pick a folder that is a Git repository.`,_;t[15]===g?_=t[16]:(_=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g}),t[15]=g,t[16]=_);let v;t[17]!==l?.repository||t[18]!==r||t[19]!==c.value?(v=r||!l?.repository||lo(c.value)||Mi(c.value),t[17]=l?.repository,t[18]=r,t[19]=c.value,t[20]=v):v=t[20];let y;t[21]!==l||t[22]!==i?(y=()=>{l&&i(l.path)},t[21]=l,t[22]=i,t[23]=y):y=t[23];let b=a??`Open repository`,x;t[24]!==r||t[25]!==b||t[26]!==v||t[27]!==y?(x=(0,Q.jsx)(ji,{pending:r,size:`sm`,disabled:v,onClick:y,children:b}),t[24]=r,t[25]=b,t[26]=v,t[27]=y,t[28]=x):x=t[28];let S;t[29]!==x||t[30]!==_?(S=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[_,x]}),t[29]=x,t[30]=_,t[31]=S):S=t[31];let C;return t[32]!==S||t[33]!==p||t[34]!==m||t[35]!==h?(C=(0,Q.jsxs)(`section`,{"aria-label":`Browse for a folder`,className:`flex flex-col gap-2`,children:[p,m,h,S]}),t[32]=S,t[33]=p,t[34]=m,t[35]=h,t[36]=C):C=t[36],C}function sH(e){let t=(0,$.c)(9),{connection:n,remotes:r,onOpened:i}=e,a=BB(),o;t[0]!==n||t[1]!==r?(o=e=>{if(e===null)return{connection:n,name:void 0};let t=r.find(t=>t.remote.environmentId===e);return t&&{connection:t.connection,name:t.remote.name}},t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]!==s||t[4]!==i?(c=e=>{let t=e&&s(e.remote);return e&&t&&(0,Q.jsx)(xz,{className:`flex max-h-[90svh] flex-col sm:max-w-lg`,children:(0,Q.jsx)(cH,{connection:t.connection,remote:e.remote,name:t.name,onOpened:i,project:e.project,path:e.path},`${e.remote}:${e.project?.id??`open`}`)})},t[3]=s,t[4]=i,t[5]=c):c=t[5];let l;return t[6]!==a||t[7]!==c?(l=(0,Q.jsx)(vz,{controller:AB,onOpenChangeComplete:a,children:c}),t[6]=a,t[7]=c,t[8]=l):l=t[8],l}function cH(e){let t=(0,$.c)(29),{connection:n,remote:r,name:i,onOpened:a,project:o,path:s}=e,l;t[0]!==s||t[1]!==o?(l=o?{project:o,path:s}:void 0,t[0]=s,t[1]=o,t[2]=l):l=t[2];let[u,d]=(0,Z.useState)(l),f=Da(EB),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(e,t)=>d({project:e,path:t}),t[3]=p):p=t[3];let m=RB(n,r,lH,a,p,u?.project.id),g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-secondary text-secondary-foreground`,children:(0,Q.jsx)(sg,{"aria-hidden":`true`})}),t[4]=g):g=t[4];let _=u?`Reconnect ${u.project.name}`:`Open project`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(wz,{children:_}),t[5]=_,t[6]=v);let y=i===void 0?`Browse for a repository on the Porcelain server.`:`Browse for a repository on ${i}.`,b;t[7]===y?b=t[8]:(b=(0,Q.jsx)(Tz,{children:y}),t[7]=y,t[8]=b);let x;t[9]!==v||t[10]!==b?(x=(0,Q.jsxs)(Sz,{className:`shrink-0 flex-row items-center text-left`,children:[g,(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[v,b]})]}),t[9]=v,t[10]=b,t[11]=x):x=t[11];let S;t[12]!==m||t[13]!==u||t[14]!==f?(S=u&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm`,children:c(u.project)}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Reconnect only a repository you trust as the replacement for`,` `,u.project.name,`. The project and saved history stay in Porcelain. Replacement worktrees start with fresh review marks and Walkthroughs; old records are not applied to them.`]}),u.path&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-sm wrap-anywhere`,children:u.path}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(X,{disabled:m.result.waiting,onClick:()=>{u.path&&m.submit(u.path)},children:`Reconnect`}),(0,Q.jsx)(X,{variant:`outline`,disabled:m.result.waiting,onClick:()=>{f(u.path),d({...u,path:void 0})},children:`Choose folder`})]})]})]}),t[12]=m,t[13]=u,t[14]=f,t[15]=S):S=t[15];let C;t[16]!==n||t[17]!==m||t[18]!==u?(C=!u?.path&&(0,Q.jsx)(oH,{disabled:m.result.waiting,connection:n,onOpen:e=>{u?d({...u,path:e}):m.submit(e)},action:u?`Choose folder`:void 0}),t[16]=n,t[17]=m,t[18]=u,t[19]=C):C=t[19];let w;t[20]===m.result?w=t[21]:(w=Mi(m.result)&&(0,Q.jsx)(Ga,{variant:`destructive`,children:(0,Q.jsx)(h,{children:ue(Ra(m.result.cause))})}),t[20]=m.result,t[21]=w);let T;t[22]!==C||t[23]!==w||t[24]!==S?(T=(0,Q.jsx)(JV,{className:`min-h-0 [&>[data-slot=scroll-area-viewport]]:max-h-[calc(90svh-8rem)]`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[S,C,w]})}),t[22]=C,t[23]=w,t[24]=S,t[25]=T):T=t[25];let E;return t[26]!==T||t[27]!==x?(E=(0,Q.jsxs)(Q.Fragment,{children:[x,T]}),t[26]=T,t[27]=x,t[28]=E):E=t[28],E}function lH(){return AB.close()}function uH({className:e,...t}){return(0,Q.jsx)(Mr,{"data-slot":`context-menu-trigger`,className:Y(`select-none`,e),...t})}function dH({className:e,...t}){return(0,Q.jsx)(mr,{ref:Sr,"data-slot":`context-menu-content`,container:Ar(),className:Y(He,e),...t})}function fH(e){let t=(0,$.c)(28),{entry:n,context:r,children:i,onRetryChanges:a}=e,o=na(r),s=n.worktreeId,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`div`,{className:`min-w-0 flex-1 py-0.5`}),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=(0,Q.jsx)(uH,{render:c,children:i}),t[1]=i,t[2]=l);let u;t[3]!==n.available||t[4]!==n.changes||t[5]!==n.kind||t[6]!==a?(u=n.available&&n.kind===`worktree`&&n.changes.state===`unavailable`&&(0,Q.jsxs)(dn,{onSelect:a,children:[(0,Q.jsx)(p_,{}),`Retry changes`]}),t[3]=n.available,t[4]=n.changes,t[5]=n.kind,t[6]=a,t[7]=u):u=t[7];let d;t[8]===n.path?d=t[9]:(d=n.path&&(0,Q.jsxs)(dn,{className:`cursor-pointer`,onSelect:()=>n.path&&Zt(n.path,`worktree path`),children:[(0,Q.jsx)(Fh,{}),`Copy worktree path`]}),t[8]=n.path,t[9]=d);let f;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==o?(f=n.kind===`worktree`&&s&&(0,Q.jsxs)(dn,{className:`cursor-pointer`,disabled:!n.available||!!o,"aria-description":o,onSelect:()=>void LB.open({payload:{entry:n,context:r,worktreeId:s,requestId:crypto.randomUUID()}}),children:[(0,Q.jsx)(_g,{}),`Switch branch`]}),t[10]=r,t[11]=n,t[12]=s,t[13]=o,t[14]=f):f=t[14];let p;t[15]!==r||t[16]!==n||t[17]!==s||t[18]!==o?(p=!n.main&&n.kind===`worktree`&&s&&(0,Q.jsxs)(dn,{destructive:!0,className:`cursor-pointer`,disabled:!n.available||!!o,"aria-description":o,onSelect:()=>void IB.open({payload:{entry:n,context:r,worktreeId:s,requestId:crypto.randomUUID()}}),children:[(0,Q.jsx)(N_,{}),`Delete`]}),t[15]=r,t[16]=n,t[17]=s,t[18]=o,t[19]=p):p=t[19];let m;t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p?(m=(0,Q.jsx)(dH,{children:(0,Q.jsxs)(ct,{children:[u,d,f,p]})}),t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=m):m=t[24];let h;return t[25]!==l||t[26]!==m?(h=(0,Q.jsxs)(Wt,{children:[l,m]}),t[25]=l,t[26]=m,t[27]=h):h=t[27],h}function pH({className:e,...t}){return(0,Q.jsx)(`kbd`,{"data-slot":`kbd`,className:Y(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function mH({className:e,...t}){return(0,Q.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Y(`inline-flex items-center gap-1`,e),...t})}function hH(){let e=(0,$.c)(2),[t,n]=(0,Z.useState)(null),r;return e[0]===t?r=e[1]:(r={element:t,attach:n},e[0]=t,e[1]=r),r}function gH({className:e,...t}){return(0,Q.jsx)(`textarea`,{"data-slot":`textarea`,className:Y(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function _H({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Y(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var vH=G(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function yH({className:e,align:t=`inline-start`,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Y(vH({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var bH=G(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function xH({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,Q.jsx)(X,{type:t,"data-size":r,variant:n,className:Y(bH({size:r}),e),...i})}function SH({className:e,...t}){return(0,Q.jsx)(`span`,{className:Y(`flex items-center gap-2 text-xs/relaxed text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function CH({className:e,...t}){return(0,Q.jsx)(ei,{"data-slot":`input-group-control`,className:Y(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function wH({className:e,...t}){return(0,Q.jsx)(gH,{"data-slot":`input-group-control`,className:Y(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function TH(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Me(`(max-width: 767px)`),e[0]=t):t=e[0],Ot(t)}function EH(e){return(0,Q.jsx)(uz,{"data-slot":`sheet`,container:Ar(),...e})}function DH({className:e,...t}){return(0,Q.jsx)(dz,{"data-slot":`sheet-overlay`,className:Y(gz,e),...t})}function OH({className:e,children:t,side:n=`right`,showCloseButton:r=!0,onFocus:i,...a}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(DH,{}),(0,Q.jsxs)(fz,{"data-slot":`sheet-content`,"data-side":n,onFocus:e=>{i?.(e),_z(e)},className:Y(`fixed m-0 data-closed:pointer-events-none flex max-h-none max-w-none flex-col backdrop:bg-transparent data-[side=right]:left-auto data-[side=left]:right-auto data-[side=bottom]:top-auto data-[side=top]:bottom-auto bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...a,children:[t,r&&(0,Q.jsxs)(hz,{"data-slot":`sheet-close`,render:(0,Q.jsx)(X,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,Q.jsx)(Oi,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function kH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sheet-header`,className:Y(`flex flex-col gap-1.5 p-6`,e),...t})}function AH({className:e,...t}){return(0,Q.jsx)(pz,{"data-slot":`sheet-title`,className:Y(`font-heading text-sm font-medium text-foreground`,e),...t})}function jH({className:e,...t}){return(0,Q.jsx)(mz,{"data-slot":`sheet-description`,className:Y(`text-xs/relaxed text-muted-foreground`,e),...t})}var MH=`sidebar_state`,NH=604800,PH=`16rem`,FH=`18rem`,IH=`3rem`,LH=`b`,RH=Z.createContext(null);function zH(){return Z.useContext(RH)}function BH(){let e=Z.useContext(RH);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function VH({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=TH(),[c,l]=Z.useState(!1),[u,d]=Z.useState(e),f=t??u,p=Z.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${MH}=${t}; path=/; max-age=${NH}`},[n,f]),m=Z.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);Z.useEffect(()=>{let e=e=>{e.key===LH&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=Z.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,Q.jsx)(RH.Provider,{value:g,children:(0,Q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":PH,"--sidebar-width-icon":IH,...i},className:Y(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function HH({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=BH();return n===`none`?(0,Q.jsx)(`div`,{"data-slot":`sidebar`,className:Y(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,Q.jsx)(EH,{open:l,onOpenChange:u,...o,children:(0,Q.jsxs)(OH,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":FH},side:e,children:[(0,Q.jsxs)(kH,{className:`sr-only`,children:[(0,Q.jsx)(AH,{children:`Sidebar`}),(0,Q.jsx)(jH,{children:`Displays the mobile sidebar.`})]}),(0,Q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,Q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,Q.jsx)(`div`,{"data-slot":`sidebar-gap`,className:Y(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,Q.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:Y(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,Q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function UH({className:e,onClick:t,...n}){let{toggleSidebar:r}=BH();return(0,Q.jsxs)(X,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:Y(e),onClick:e=>{t?.(e),r()},...n,children:[(0,Q.jsx)(r_,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function WH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:Y(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function GH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:Y(`relative flex w-full min-w-0 flex-col px-2 py-1`,e),...t})}function KH({className:e,render:t,...n}){return Se({defaultTagName:`button`,props:Wn({className:Y(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-action`,sidebar:`group-action`}})}function qH({className:e,...t}){return(0,Q.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:Y(`flex w-full min-w-0 flex-col gap-px`,e),...t})}function JH({className:e,...t}){return(0,Q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:Y(`group/menu-item relative`,e),...t})}G(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-xs`,sm:`h-7 text-xs`,lg:`h-12 text-xs group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function YH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty`,className:Y(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function XH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-header`,className:Y(`flex max-w-sm flex-col items-center gap-1`,e),...t})}G(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function ZH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-title`,className:Y(`font-heading text-sm font-medium tracking-tight`,e),...t})}function QH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-content`,className:Y(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance`,e),...t})}var $H=(e,t)=>.09*e.length/t.length;function eU(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Kn(e,r))return r;return-1}function tU(e,t){let n=0,r=-2,i=0,a=0;for(let o of t){if(o===` `)continue;let t=e.indexOf(o,n);if(t===-1)return 0;a++,Kn(e,t)&&(i+=1),t===r+1&&(i+=1),r=t,n=t+1}return a?.1+.4*i/(2*a):0}function nU(e,t){let n=je(t);if(!n)return 1;let r=je(e);if(r===n)return 1;let i=r.indexOf(n);return i===0?.9+$H(n,r):i>0?(eU(r,n,i)===-1?.6:.75)+$H(n,r):tU(r,n)}function rU(e,t){let n=nU(e.label,t);for(let r of e.keywords??[])n=Math.max(n,nU(r,t)*.95);return n}var iU=e=>e===`fuzzy`?rU:e;function aU(e,t){let{id:n,store:r,options:i}=e,a=!1,o=null,s,c=()=>s??t.query(),l,u=xs({count:()=>d.count(),status:()=>r.get().status,onLoadMore:()=>i().onLoadMore}),d=Ht({store:r,focus:()=>r.get().focusInList?`real`:`virtual`,items:t.items,emptyItems:t.emptyItems,toKey:e=>String(e??``),filter:()=>iU(t.filter()),rank:()=>t.filter()===`fuzzy`||typeof t.filter()==`function`,query:c,loop:()=>i().loop??!0,skipDisabled:!0,active:()=>r.get().open,onHighlight:t.onHighlight,onLastReached:u.reached,container:t.container,scrollRoot:t.scrollRoot,onRegister(){a||(a=!0,nc(()=>{a=!1,r.set({mounts:r.get().mounts+1})}))}});Ro(r,d);let f=t=>e.props(`item`,t);function p(e){let{highlighted:n,settled:i}=r.get();if(!t.items()&&!i)return n;let a=t.autoHighlight(),o=a===`always`||a===`typing`&&c()!==``,s=n!==null&&d.entries().some(e=>e.key===n),l=o?t.preferred?.(d)??d.firstEnabled()??null:null;return e&&o?l:s?n:l}function m(e,n){let i=p(e);i!==r.get().highlighted&&t.highlight(i,n)}function h(e){let n=q(e,{apple:jo()});if(n===void 0||e.altKey&&e.key===`ArrowUp`)return!1;if(!r.get().open)return!t.open||n!==1&&n!==-1?!1:(e.preventDefault(),t.open(e,n===-1?`last`:`first`),!0);e.preventDefault();let i=d.stepKey(n);return i!==void 0&&t.highlight(i,{reason:`list-navigation`,event:e}),!0}let g=t.query(),_=r.get();r.subscribe(()=>{let e=r.get(),n=_;_=e;let i=t.query();if(i!==g){g=i;let e=o??{reason:`imperative`};o=null,m(!0,e)}else if(e.mounts!==n.mounts&&!t.settlesMount?.()||e.items!==n.items||e.settled!==n.settled){let r=n.highlighted===null?null:{reason:`item-removed`};e.highlighted===n.highlighted?m(!1,r):t.highlight(e.highlighted,r)}}),e.onOptions(()=>{if(l===void 0)return;let e=l,n=o;l=void 0,queueMicrotask(()=>{t.query()===e&&m(!0,n)})});let v=t.autoHighlight();return e.onOptions(()=>{let e=t.autoHighlight();e!==v&&(v=e,queueMicrotask(()=>m(!1,{reason:`imperative`})))}),Ri({store:r,query:t.query,count:()=>d.count(),loading:()=>r.get().status===`loading`,shown:()=>r.get().open,silent:()=>_e(e,`status`).length>0,announcement:()=>i().announcement}),{listbox:d,itemProps:f,settledHighlight:p,settle:m,navigate:h,loadMore:u,matchQuery:t.query,matchMode:()=>is(t.filter()),cause(e,t){o={reason:e,event:t}},settleFor(e){l=t.query(),s=e;try{m(!0,o)}finally{s=void 0}},hover(e,n){n.pointerType!==`touch`&&r.get().open&&!f(e)?.disabled&&r.get().highlighted!==e&&t.highlight(e,{reason:`item-hover`,event:n})},isEmpty:e=>(!!t.items()||e.settled)&&d.count()===0,itemCount:()=>d.count(),filterQuery:t.query,activeDescendant(e){let{highlighted:t}=e;if(e.open&&!e.focusInList&&t!==null&&d.element(t)?.isConnected)return`${n}-option-${cs(t)}`}}}function oU(){let e=(e,t)=>e.internal.text(t);return{role:`combobox`,focus:`native`,keys:Do,attrs:(t,{id:n,api:r})=>({id:`${n}-input`,value:e(r,t),autocomplete:`off`,autocapitalize:`none`,spellcheck:`false`,"aria-expanded":String(t.open)}),live:Qo((e,{api:t})=>({"aria-activedescendant":t.internal.activeDescendant(e)})),on:{input:(e,{api:t,el:n})=>t.internal.typed(n,e),keydown:(e,{api:t})=>t.internal.onInputKeyDown(e)},bind(t,{api:n,id:r,store:i}){ch(t,i,r);let a=t,o,s=()=>{let t=e(n,i.get());t!==o&&(o=t,a.value!==t&&(a.value=t))};return ui(a,()=>[e(n,i.get())],()=>n.internal.typed(a)),s(),i.subscribe(s)}}}function sU(){return{props:{value:`string`,label:`string`,keywords:`list`,disabled:`boolean`,index:`number`,group:{kind:`string`,from:`group.id`}},role:`option`,focus:`active-descendant`,attrs:(e,{id:t,key:n,props:r,api:i})=>({id:`${t}-option-${cs(n)}`,tabindex:e.focusInList?`-1`:void 0,"aria-disabled":r.disabled?`true`:void 0,"aria-selected":void 0,...Za(r.index,i.internal.listbox),hidden:i.internal.listbox.matches(n,r)?void 0:``,"data-disabled":r.disabled?``:void 0}),direct:fo([`hidden`]),live:Qo((e,{key:t})=>({"aria-selected":e.highlighted===t?`true`:`false`,"data-highlighted":e.highlighted===t?``:void 0})),on:{...on,pointermove:(e,{api:t,key:n})=>t.internal.hover(n,e)},press:({api:e,key:t},n)=>e.internal.press(t,n),bind(e,{api:t,key:n,props:r}){let i=js(e,{api:t,key:n,props:r});return()=>{i(),e.removeAttribute(`data-highlighted`),e.setAttribute(`aria-selected`,`false`)}}}}function cU(e){return{open:!0,value:e.value===void 0?e.defaultValue??null:e.value,highlighted:null,query:e.query??e.defaultQuery??``,pages:e.pages??e.defaultPages??[],queries:[],items:e.items,status:e.status??`idle`,pending:[],error:null,apple:Hi(),mounts:0,settled:!1,focusInList:!1,groupLabels:[],fieldName:null,listing:so}}function lU(e){return{items:e.items,status:e.status??`idle`,...e.value===void 0?{}:{value:e.value},...e.query===void 0?{}:{query:e.query},...e.pages===void 0?{}:{pages:e.pages}}}var uU=e=>e.pages.at(-1)??null;function dU(e){let{id:t,store:n,options:r,element:i}=e;ga(e,()=>n.get().pending.length>0);let a=ht(e),o=t=>e.props(`item`,t),s=()=>ih(n.get().items,n.get().pages),c=e=>e===null?-1:d.listbox.entries().findIndex(t=>t.key===e);function l(e,t){return e===n.get().value?!1:t?a(`value`,e,{reason:t.reason,event:t.event,index:c(e)}):(r().value===void 0&&n.set({value:e}),!1)}let u=null,d=aU(e,{query:()=>n.get().query,items:s,emptyItems:()=>n.get().pages.length?void 0:r().emptyItems,filter:()=>r().filter??`fuzzy`,autoHighlight:()=>r().autoHighlight!==!1&&`always`,highlight:l,container:()=>i(`list`),scrollRoot:()=>i(`root`),settlesMount:()=>u!==null});function f(e,t,n){return d.cause(t,n),a(`query`,e,{reason:t,event:n})}function p(e,t,n){let i=f(e,t,n);return i&&r().query!==void 0&&r().value!==void 0&&r().filter!==!1&&d.settleFor(e),i}let m=null;function h(e,t,r){let{pages:i,query:o,queries:s}=n.get();return m={reason:t,event:r},a(`pages`,[...i,e],{reason:t,event:r})?(n.set({queries:[...s.slice(0,i.length),o]}),f(``,t,r),!0):!1}function g(e,t){let{pages:r,queries:i}=n.get();return!r.length||(m={reason:e,event:t},!a(`pages`,r.slice(0,-1),{reason:e,event:t}))?!1:(n.set({queries:i.slice(0,r.length-1)}),f(i[r.length-1]??``,e,t),!0)}function _(e,{event:t,reason:i=`item-press`}){let a=o(e),s=ah(n.get().items,e)??ah(r().emptyItems,e);if(!a&&!s)return;if(a?.disabled||s?.disabled||n.get().pending.includes(e)){t?.type===`click`&&t.preventDefault();return}n.get().error?.key===e&&n.set({error:null});let c=t&&!t.defaultPrevented?t:Tf(),l=[a?.onSelect?.(c)],u=a?.page??(s?.items?s.value:void 0);c.defaultPrevented||(u===void 0?l.push(r().onAction?.(e,{event:t})):h(u,i,t));let d=l.filter(Yr);if(!d.length)return;n.set({pending:[...n.get().pending,e]});let f=()=>n.get().pending.filter(t=>t!==e);Promise.all(d).then(()=>n.set({pending:f()}),t=>n.set({pending:f(),error:{key:e,reason:t}}))}function v(e){if(d.navigate(e))return;let{value:t,query:r,pages:i}=n.get();switch(e.key){case`Enter`:{if(t===null){Sf(e)||e.preventDefault();return}let n=d.listbox.element(t);n?.matches(`a[href]`)?n.click():_(t,{event:e}),e.preventDefault();return}case`Escape`:if(!r&&!i.length)return;e.preventDefault(),r?p(``,`escape-key`,e):g(`escape-key`,e);return;case`Backspace`:!e.target.value&&i.length&&(e.preventDefault(),g(`back`,e))}}Gs(e,[`highlighted`],(e,t)=>`value`in e&&e.value!==t.highlighted?{highlighted:e.value}:void 0);let y=n.get().value,b=n.get().pages,x=n.get().mounts;n.subscribe(()=>{let e=n.get();if((e.value!==e.highlighted||e.value!==y)&&(y=e.value,d.listbox.highlight(e.value)),e.pages!==b){b=e.pages;let t=m??{reason:`imperative`};m=null,s()?d.settle(!0,t):u=t}else if(u&&e.mounts!==x){let e=u;u=null,d.settle(!0,e)}x=e.mounts});function S(e){let t,r=[],i=()=>{let{items:i}=n.get();i!==t&&(t=i,r.forEach(e=>e()),r=oh(i).map(({value:t,shortcut:n})=>rr.register(n,e=>_(t,{event:e,reason:`shortcut`}),{layer:e})))};i();let a=n.subscribe(i);return()=>{a(),r.forEach(e=>e())}}function C(e,t,r){return Ko(()=>{let e=o(t);return e?.data||ah(n.get().items,t)?.shortcut?void 0:e?.shortcut},e=>_(t,{event:e,reason:`shortcut`}),{layer:e},r)}let w={id:t,getValue:()=>n.get().value,setValue:(e,{reason:t=`imperative`,event:n}={})=>l(e,{reason:t,event:n}),getQuery:()=>n.get().query,setQuery:(e,{reason:t=`imperative`,event:n}={})=>p(e,t,n),getPages:()=>n.get().pages,setPages(e,{reason:t=`imperative`,event:n}={}){return m={reason:t,event:n},a(`pages`,e,{reason:t,event:n})},push:(e,{reason:t=`imperative`,event:n}={})=>h(e,t,n),pop:({reason:e=`imperative`,event:t}={})=>g(e,t),run(e){let t=e??n.get().value;t!==null&&_(t,{})},focus:()=>i(`input`)?.focus(),internal:{...d,options:r,itemProps:o,run:_,press:(e,t)=>_(e,{event:t}),text:e=>e.query,typed:(e,t)=>p(e.value,`input-change`,t),onInputKeyDown:v,onCurrentPage:(e,t)=>t===void 0||t===uU(e),shortcutOf:t=>Je(e,`item`,t),bindDataShortcuts:S,bindItemShortcut:C,syncPlatform:()=>rt(n)}};return n.get().value!==null&&d.listbox.highlight(n.get().value),d.settle(!1,null),w}var fU=dU,pU=[];function mU(e,t,n){return{highlighted:e.highlighted===t,disabled:!!n.disabled,pending:e.pending.includes(t),error:e.error?.key===t?e.error.reason:void 0}}var hU={open:[],value:[],query:[],queries:[],items:[],status:[],mounts:[],settled:[],groupLabels:[],fieldName:[]},gU=oU(),_U=sU(),vU=e=>({root:e({state:e=>({page:uU(e),loading:e.status===`loading`}),attrs:e=>({"data-loading":e.status===`loading`?``:void 0}),bind(e,{api:t}){return t.internal.syncPlatform(),t.internal.bindDataShortcuts(e)}}),input:e({...gU,keys:[...gU.keys,`Enter`,`Escape`,`Backspace`],state:e=>({page:uU(e)}),attrs:(e,t)=>({...gU.attrs(e,t),type:`text`,"aria-autocomplete":`list`,"aria-controls":`${t.id}-list`}),bind(e,t){return gU.bind(e,t)}}),list:e({role:`listbox`,keys:{none:`The search field handles them, and keeps focus while they move the highlight.`},state:(e,{api:t})=>({status:e.status,items:t.internal.listbox.visibleData()?.list??pU}),attrs:(e,{id:t})=>({id:`${t}-list`,...lh(e,t),"aria-busy":e.status===`loading`?`true`:void 0}),on,bind(e,{api:t,store:n}){let r=!0;queueMicrotask(()=>r&&n.set({settled:!0})),t.internal.syncPlatform();let i=t.internal.loadMore.bind(e);return()=>{r=!1,i(),n.set({settled:!1})}}}),item:e({..._U,props:{value:`id`,label:`string`,keywords:`list`,disabled:`boolean`,shortcut:`string`,page:`string`,index:`number`,onSelect:`action`,group:{kind:`string`,from:`group.id`},inPage:{kind:`string`,from:`page.value`},data:`boolean`},selects:Is({highlighted:({key:e})=>[e],listing:({key:e})=>[e],pending:({key:e})=>[e],...hU}),present:(e,{props:t,api:n})=>n.internal.onCurrentPage(e,t.inPage),state:(e,{key:t,props:n})=>mU(e,t,n),attrs:(e,t)=>{let{key:n,props:r}=t,i=e.pending.includes(n),a=_U.attrs(e,t);return{...a,"aria-disabled":i?`true`:a[`aria-disabled`],"aria-busy":i?`true`:void 0,"aria-keyshortcuts":r.shortcut?Ts(r.shortcut,e.apple):void 0,"data-pending":i?``:void 0}},bind(e,t){let n=_U.bind(e,t),r=t.api.internal.bindItemShortcut(e,t.key,e=>Qi(t,e));return()=>{n(),r()}}}),"item-text":e(go()),"item-icon":e(dd({component:`command`,...Qd})),group:e(ps()),"group-label":e($r()),separator:e(yi()),empty:e(Ca()),status:e(Ai()),page:e({props:{value:`string`},present:(e,{props:t})=>(t.value??null)===uU(e),role:`none`}),shortcut:e({props:{shortcut:{kind:`string`,from:`item`}},state:(e,{props:t})=>({text:t.shortcut?Ci(t.shortcut,e.apple):``}),attrs:()=>({"aria-hidden":`true`,translate:`no`}),bind(e,{store:t,api:n,props:r}){if(e.childNodes.length)return;let i=()=>{let i=r.shortcut??n.internal.shortcutOf(e);e.textContent=i?Ci(i,t.get().apple):``};i();let a=t.subscribe(i);return()=>{a(),e.textContent=``}}})}),yU=sa({name:`command`,options:{value:`string`,defaultValue:`string`,onValueChange:`callback`,query:`string`,defaultQuery:`string`,onQueryChange:`callback`,pages:`list`,defaultPages:`list`,onPagesChange:`callback`,onAction:`action`,pendingAnnouncement:`string`,items:`value`,emptyItems:`value`,filter:Wa([`contains`,`startsWith`,`fuzzy`],`fuzzy`),autoHighlight:`boolean`,loop:`boolean`,status:`string`,onLoadMore:`callback`,announcement:`value`,controller:`value`},state:cU,live:[`value`,`highlighted`],controlled:[`value`,`query`,`pages`],sync:lU,api:fU,slots:e=>vU(e),agent:{actions:[`run`,`setValue`,`setQuery`,`setPages`]}}),bU=he(yU,{input:`input`,"item-icon":`span`,group:`div`,"group-label":`div`,separator:`div`,status:`div`}),xU=Z.createContext(void 0),SU=Z.createContext(!1);function CU(){return Ec(yU)}function wU({value:e,defaultValue:n,onValueChange:r,query:i,defaultQuery:a,onQueryChange:o,pages:s,defaultPages:c,onPagesChange:l,onAction:u,pendingAnnouncement:d,items:f,emptyItems:p,filter:m,autoHighlight:h,loop:g,status:_,onLoadMore:v,announcement:y,controller:b,debug:x,children:S,...C}){let w=Ae(yU,{value:e,defaultValue:n,onValueChange:r,query:i,defaultQuery:a,onQueryChange:o,pages:s,defaultPages:c,onPagesChange:l,onAction:u,pendingAnnouncement:d,items:f,emptyItems:p,filter:m,autoHighlight:h,loop:g,status:_,onLoadMore:v,announcement:y,controller:b,debug:x});be(b,w);let T=typeof S!=`function`&&t(S,EU),[E,D]=Ss(typeof S!=`function`&&!!f&&!T),O=E||T,k=e=>typeof S==`function`?(0,Q.jsx)($t,{value:D,children:S(e)}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($t,{value:D,children:S}),(0,Q.jsx)($t,{value:null,children:f&&!O&&(0,Q.jsx)(EU,{})})]});return tr(w,`root`,{},{...C,children:k})}var TU=bU.Input;function EU({children:e,...t}){zi();let n=CU(),r=t=>typeof e==`function`?e(t):e??(n.state.items?(0,Q.jsx)(MU,{items:t.items}):null);return tr(n,`list`,{},{...t,children:r})}function DU({value:e,label:t,keywords:n,disabled:r,shortcut:i,page:a,index:o,onSelect:s,render:c,...l}){let u=CU(),d=Z.useId(),f=gn(yU,`group`)?.id,p=Z.useContext(xU),m=Z.useContext(SU),h=e??d;return tr(u,`item`,{id:h,value:h,label:t,keywords:n,disabled:r,shortcut:i,page:a,index:o,onSelect:s,group:f,inPage:p,data:m},{...l,render:c})}bU.ItemIcon;var OU=bU.Group,kU=bU.GroupLabel,AU=bU.Separator;function jU({children:e,...t}){let n=t=>typeof e==`function`?e(t):t.empty?e:null;return tr(yU,`empty`,{},{...t,children:n})}bU.Status;function MU({items:e}){return(0,Q.jsx)(SU.Provider,{value:!0,children:e.map((e,t)=>typeof e==`string`?(0,Q.jsx)(DU,{value:e,children:e},e):`type`in e&&e.type===`separator`?(0,Q.jsx)(AU,{},`separator-${t}`):`type`in e&&e.type===`group`?(0,Q.jsxs)(OU,{children:[e.label&&(0,Q.jsx)(kU,{children:e.label}),(0,Q.jsx)(MU,{items:e.items})]},`group-${e.label??t}`):(0,Q.jsx)(DU,{value:e.value,label:e.label,keywords:e.keywords,disabled:e.disabled,shortcut:e.shortcut,children:e.label},e.value))})}var NU={j:`ArrowDown`,n:`ArrowDown`,k:`ArrowUp`,p:`ArrowUp`};function PU(e){let t=NU[e.key];t===void 0||!e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.stopPropagation(),e.target.dispatchEvent(new KeyboardEvent(`keydown`,{key:t,bubbles:!0,cancelable:!0})))}function FU({className:e,onEscape:t,onQueryChange:n,...r}){return(0,Q.jsx)(wU,{onKeyDownCapture:PU,onQueryChange:(e,r)=>{r.reason===`escape-key`&&t?(r.cancel(),t()):n?.(e,r)},"data-slot":`command`,className:Y(`flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground`,e),...r})}function IU({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,Q.jsx)(vz,{...a,children:(0,Q.jsxs)(xz,{className:Y(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:[(0,Q.jsxs)(Sz,{className:`sr-only`,children:[(0,Q.jsx)(wz,{children:e}),(0,Q.jsx)(Tz,{children:t})]}),n]})})}function LU({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,Q.jsxs)(_H,{className:`h-8! bg-input/20 dark:bg-input/30`,children:[(0,Q.jsx)(TU,{"data-slot":`command-input`,className:Y(`w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{className:`size-3.5 shrink-0 opacity-50`})})]})})}function RU({className:e,...t}){return(0,Q.jsx)(EU,{"data-slot":`command-list`,className:Y(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function zU({className:e,...t}){return(0,Q.jsx)(jU,{"data-slot":`command-empty`,className:Y(`py-6 text-center text-xs/relaxed not-data-empty:hidden`,e),...t})}function BU({className:e,heading:t,children:n,...r}){return(0,Q.jsxs)(OU,{"data-slot":`command-group`,className:Y(`overflow-hidden p-1 text-foreground`,e),...r,children:[t!==void 0&&(0,Q.jsx)(kU,{className:`px-2.5 py-1.5 text-xs font-medium text-muted-foreground`,children:t}),n]})}function VU({className:e,children:t,...n}){return(0,Q.jsxs)(DU,{"data-slot":`command-item`,className:Y(`group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-muted data-highlighted:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-highlighted:*:[svg]:text-foreground`,e),...n,children:[t,(0,Q.jsx)(Dn,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function HU(e,t,n){let r=(0,$.c)(12),i;r[0]===e?i=r[1]:(i=Ds(e),r[0]=e,r[1]=i);let[a,o]=ud(i),s=Ki(),c=Fi(),l=Pc(),u;r[2]!==s?.environmentId||r[3]!==l||r[4]!==n||r[5]!==c||r[6]!==o||r[7]!==e?(u=(t,r,i)=>o(t).then(async t=>{if(!t.deleted){r(t.plan);return}n();let i=c.state.matches.at(-1)?.params;t.plan.worktreePath&&i&&`worktreeId`in i&&`projectId`in i&&i.worktreeId===e.scope.worktreeId&&i.projectId===e.scope.projectId&&(`environmentId`in i?i.environmentId:s?.environmentId)===e.connection.environmentId&&await l({to:`/`})},i),r[2]=s?.environmentId,r[3]=l,r[4]=n,r[5]=c,r[6]=o,r[7]=e,r[8]=u):u=r[8];let d;return r[9]!==a||r[10]!==u?(d={result:a,submit:u},r[9]=a,r[10]=u,r[11]=d):d=r[11],d}function UU(e){let t=(0,$.c)(15),n;t[0]===e?n=t[1]:(n=Wi(e),t[0]=e,t[1]=n);let[r,i]=ud(n),a;t[2]===e?a=t[3]:(a=Ti(e),t[2]=e,t[3]=a);let[o,s]=ud(a),[c,l]=(0,Z.useState)(!1),u;t[4]===e?u=t[5]:(u=Rs(e),t[4]=e,t[5]=u);let{unresolved:d}=La(u),f=c?o:r,p=r.waiting||o.waiting,m;t[6]!==s||t[7]!==i||t[8]!==d?(m=(e,t)=>{l(d);let n;if(d)n=s(void 0);else if(e)n=i(e);else return;return n.then(e=>{(e.state===`succeeded`||e.state===`no-change`)&&t()},WU)},t[6]=s,t[7]=i,t[8]=d,t[9]=m):m=t[9];let h;return t[10]!==f||t[11]!==p||t[12]!==m||t[13]!==d?(h={result:f,pending:p,unresolved:d,submit:m},t[10]=f,t[11]=p,t[12]=m,t[13]=d,t[14]=h):h=t[14],h}function WU(){}function GU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(vz,{controller:LB,children:KU}),e[0]=t):t=e[0],t}function KU(e){return e&&(0,Q.jsx)(qU,{...e},e.requestId)}function qU(e){let t=(0,$.c)(45),{context:n,entry:r,worktreeId:i}=e,{connection:a}=n,o=na(n),[s,c]=(0,Z.useState)(),[l,u]=(0,Z.useState)(``),d;t[0]!==r.projectId||t[1]!==i?(d={projectId:r.projectId,worktreeId:i},t[0]=r.projectId,t[1]=i,t[2]=d):d=t[2];let f;t[3]!==a||t[4]!==d?(f={connection:a,scope:d},t[3]=a,t[4]=d,t[5]=f):f=t[5];let{result:p,pending:m,unresolved:h,submit:g}=UU(f),_;t[6]!==r.projectId||t[7]!==i?(_={projectId:r.projectId,worktreeId:i},t[6]=r.projectId,t[7]=i,t[8]=_):_=t[8];let{result:v,refresh:y}=yB(_,a,!0),b=de(qr(v)),x;t[9]===r.projectId?x=t[10]:(x=e=>e.id===r.projectId,t[9]=r.projectId,t[10]=x);let S=QB(a).projects.find(x),C=nu(b?.bases??[],S?.worktrees??[],i),w=new Map(C.map(ZU)),T=C.map(XU),E;t[11]===s?E=t[12]:(E=e=>e.ref===s&&!e.current&&!e.inUse,t[11]=s,t[12]=E);let D=C.some(E),O=`Switch branch`;h&&(O=`Check outcome`);let k;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(wz,{children:`Switch branch`}),t[13]=k):k=t[13];let A;t[14]===r.name?A=t[15]:(A=(0,Q.jsxs)(Sz,{children:[k,(0,Q.jsxs)(Tz,{children:[`Choose a branch for `,r.name,`. Branches used by another worktree are unavailable.`]})]}),t[14]=r.name,t[15]=A);let j;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(LU,{"aria-label":`Find a branch`,placeholder:`Find a branch`}),t[16]=j):j=t[16];let M;t[17]===v?M=t[18]:(M=Xi(v)&&(0,Q.jsx)(`p`,{role:`status`,className:`py-6 text-center text-xs/relaxed text-muted-foreground`,children:`Reading branches`}),t[17]=v,t[18]=M);let N;t[19]!==v||t[20]!==y?(N=Mi(v)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-center gap-2 py-6 text-xs/relaxed text-muted-foreground`,children:[`Branches could not be read.`,(0,Q.jsx)(X,{variant:`link`,size:`flush`,disabled:v.waiting,onClick:y,children:`Try again`})]}),t[19]=v,t[20]=y,t[21]=N):N=t[21];let P;t[22]===b?P=t[23]:(P=b&&(0,Q.jsx)(zU,{children:`No matching branch`}),t[22]=b,t[23]=P);let F;t[24]===h?F=t[25]:(F=h&&(0,Q.jsx)(`p`,{role:`status`,children:`The previous switch is not confirmed. Check its outcome before switching again.`}),t[24]=h,t[25]=F);let I;t[26]===p?I=t[27]:(I=Mi(p)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:String(Ra(p.cause))}),t[26]=p,t[27]=I);let L;t[28]===p?L=t[29]:(L=Bo(p)&&p.value.state!==`succeeded`&&p.value.state!==`no-change`&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p.value.message??`The branch could not be switched.`}),t[28]=p,t[29]=L);let R;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(X,{variant:`outline`}),t[30]=R):R=t[30];let z;t[31]===m?z=t[32]:(z=(0,Q.jsx)(yz,{render:R,disabled:m,children:`Cancel`}),t[31]=m,t[32]=z);let B=!!o||m||!h&&!D,V;t[33]!==s||t[34]!==g?(V=()=>void g(s,JU),t[33]=s,t[34]=g,t[35]=V):V=t[35];let H;t[36]!==O||t[37]!==m||t[38]!==B||t[39]!==V||t[40]!==o?(H=(0,Q.jsx)(ji,{pending:m,disabled:B,"aria-description":o,onClick:V,children:O}),t[36]=O,t[37]=m,t[38]=B,t[39]=V,t[40]=o,t[41]=H):H=t[41];let U;return t[42]!==z||t[43]!==H?(U=(0,Q.jsxs)(Cz,{children:[z,H]}),t[42]=z,t[43]=H,t[44]=U):U=t[44],(0,Q.jsxs)(xz,{showCloseButton:!m,children:[A,(0,Q.jsxs)(FU,{items:T,query:l,onQueryChange:u,onEscape:YU,children:[j,M,N,P,(0,Q.jsx)(RU,{"aria-label":`Branches`,children:e=>(0,Q.jsx)(BU,{children:e.items.map(e=>{let t=``;typeof e==`string`?t=e:`value`in e&&(t=e.value);let n=w.get(t);return n&&(0,Q.jsxs)(VU,{value:n.ref,label:n.name,disabled:m||h||n.current||n.inUse,onSelect:()=>c(n.ref),"data-checked":s===n.ref,className:`cursor-pointer`,children:[(0,Q.jsx)(_g,{}),(0,Q.jsx)(fr,{text:n.name,className:`min-w-0 flex-1`}),n.current&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Current`}),n.inUse&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`In use`}),s===n.ref&&(0,Q.jsx)(Dn,{})]},n.ref)})})})]}),F,I,L,U]})}function JU(){return LB.close()}function YU(){return LB.close()}function XU(e){return{value:e.ref,label:e.name}}function ZU(e){return[e.ref,e]}function QU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:IB,children:$U}),e[0]=t):t=e[0],t}function $U(e){return e&&(0,Q.jsx)(eW,{...e},e.requestId)}function eW(e){let t=(0,$.c)(29),{entry:n,context:r,worktreeId:i}=e,a=Yu(r.connection),o;t[0]===a?o=t[1]:(o=Cd(a),t[0]=a,t[1]=o);let s=o,c;t[2]===a?c=t[3]:(c=rd(a),t[2]=a,t[3]=c);let l=c,u;t[4]===n.name?u=t[5]:(u=(0,Q.jsxs)(jz,{children:[`Delete `,n.name,`?`]}),t[4]=n.name,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(Mz,{children:`Choose what to delete this time. Your saved settings won’t change. Review history stays available.`}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(kz,{children:[u,d]}),t[7]=u,t[8]=f);let p;t[9]!==r||t[10]!==n||t[11]!==s||t[12]!==i?(p=s&&(0,Q.jsx)(tW,{settings:s,entry:n,context:r,worktreeId:i}),t[9]=r,t[10]=n,t[11]=s,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==s||t[15]!==a?(m=!s&&a.kind===`reading`&&(0,Q.jsx)(Be,{label:`Reading deletion settings`}),t[14]=s,t[15]=a,t[16]=m):m=t[16];let h;t[17]!==l||t[18]!==s||t[19]!==a?(h=!s&&a.kind!==`reading`&&l&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),t[17]=l,t[18]=s,t[19]=a,t[20]=h):h=t[20];let g;t[21]===s?g=t[22]:(g=!s&&(0,Q.jsx)(Nz,{children:`Cancel`}),t[21]=s,t[22]=g);let _;return t[23]!==f||t[24]!==p||t[25]!==m||t[26]!==h||t[27]!==g?(_=(0,Q.jsxs)(Oz,{children:[f,p,m,h,g]}),t[23]=f,t[24]=p,t[25]=m,t[26]=h,t[27]=g,t[28]=_):_=t[28],_}function tW(e){let t=(0,$.c)(58),{settings:n,entry:r,context:i,worktreeId:a}=e,{connection:o}=i,s=na(i),{detached:c}=r,l;t[0]!==c||t[1]!==n?(l=()=>gl(n,c),t[0]=c,t[1]=n,t[2]=l):l=t[2];let[u,d]=(0,Z.useState)(l),[f,p]=(0,Z.useState)(),[m,h]=(0,Z.useState)(!1),g;t[3]!==r.projectId||t[4]!==a?(g={projectId:r.projectId,worktreeId:a},t[3]=r.projectId,t[4]=a,t[5]=g):g=t[5];let _;t[6]!==o||t[7]!==g?(_={connection:o,scope:g},t[6]=o,t[7]=g,t[8]=_):_=t[8];let{result:v,submit:y}=HU(_,r,nW),b;t[9]!==m||t[10]!==u||t[11]!==f||t[12]!==y?(b=()=>void y({options:u,...f?{confirmation:{plan:f,discardChanges:m}}:{}},p,()=>{p(void 0),h(!1)}),t[9]=m,t[10]=u,t[11]=f,t[12]=y,t[13]=b):b=t[13];let x=b,S=v.waiting,C=Object.values(u).some(Boolean),w=f&&(f.dirty||f.unpushed),T=f&&!f.worktreePath&&!f.localBranch&&!f.remoteBranch,E=`Review deletion`;f&&(E=`Delete`);let D;t[14]!==c||t[15]!==u||t[16]!==S?(D=Pd.map(e=>{let{key:t,label:n}=e;return(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(Qa,{htmlFor:`delete-${t}`,children:n}),(0,Q.jsx)(bn,{id:`delete-${t}`,checked:u[t],disabled:S||c&&t!==`deleteWorktree`,onCheckedChange:e=>{d(n=>({...n,[t]:e})),p(void 0),h(!1)},className:`cursor-pointer`})]},t)}),t[14]=c,t[15]=u,t[16]=S,t[17]=D):D=t[17];let O;t[18]===c?O=t[19]:(O=c&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This worktree is detached: there is no checked-out branch to delete.`}),t[18]=c,t[19]=O);let k;t[20]!==c||t[21]!==u?(k=!c&&!u.deleteWorktree&&u.deleteLocalBranch&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Keep the worktree folder and its files, detach it from the branch, then delete the local branch.`}),t[20]=c,t[21]=u,t[22]=k):k=t[22];let A;t[23]!==c||t[24]!==u?(A=!c&&u.deleteWorktree&&!u.deleteLocalBranch&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The worktree folder will be deleted. The local branch will be kept.`}),t[23]=c,t[24]=u,t[25]=A):A=t[25];let j;t[26]!==D||t[27]!==O||t[28]!==k||t[29]!==A?(j=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[D,O,k,A]}),t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j):j=t[30];let M;t[31]!==r.path||t[32]!==f?(M=f?(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-all text-xs text-muted-foreground`,children:ol(f)}):(0,Q.jsx)(`p`,{className:`break-all text-xs text-muted-foreground`,children:r.path}),t[31]=r.path,t[32]=f,t[33]=M):M=t[33];let N;t[34]!==m||t[35]!==S||t[36]!==w?(N=w&&(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(Qa,{htmlFor:`delete-discard-changes`,children:`I understand the risk of losing changes and commits`}),(0,Q.jsx)(bn,{id:`delete-discard-changes`,checked:m,disabled:S,onCheckedChange:h,className:`cursor-pointer`})]}),t[34]=m,t[35]=S,t[36]=w,t[37]=N):N=t[37];let P;t[38]===v?P=t[39]:(P=Mi(v)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:bl(Ra(v.cause))}),t[38]=v,t[39]=P);let F;t[40]===S?F=t[41]:(F=(0,Q.jsx)(Nz,{disabled:S,children:`Cancel`}),t[40]=S,t[41]=F);let I=f?`destructive`:`default`,L=!!s||S||!C||!!(T||w&&!m),R;t[42]!==E||t[43]!==x||t[44]!==S||t[45]!==I||t[46]!==L||t[47]!==s?(R=(0,Q.jsx)(ji,{pending:S,"aria-description":s,variant:I,disabled:L,onClick:x,children:E}),t[42]=E,t[43]=x,t[44]=S,t[45]=I,t[46]=L,t[47]=s,t[48]=R):R=t[48];let z;t[49]!==F||t[50]!==R?(z=(0,Q.jsxs)(Az,{children:[F,R]}),t[49]=F,t[50]=R,t[51]=z):z=t[51];let B;return t[52]!==M||t[53]!==N||t[54]!==P||t[55]!==z||t[56]!==j?(B=(0,Q.jsxs)(Q.Fragment,{children:[j,M,N,P,z]}),t[52]=M,t[53]=N,t[54]=P,t[55]=z,t[56]=j,t[57]=B):B=t[57],B}function nW(){return IB.close()}function rW(e){let t=(0,$.c)(42),{environmentId:n,environmentName:r,project:i,icon:a}=e,o;t[0]!==n||t[1]!==i?(o={project:i,remote:n},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s=o,l;t[3]!==i||t[4]!==s?(l=i.available?[]:[{label:`Reconnect project`,icon:sg,run:()=>void AB.open({payload:{...s,...Ia(i)?{path:Ia(i)}:{}}}),destructive:!1}],t[3]=i,t[4]=s,t[5]=l):l=t[5];let u;t[6]===i?u=t[7]:(u={label:`Copy path`,icon:Bs,run:()=>Zt(Ia(i),`project path`),destructive:!1},t[6]=i,t[7]=u);let d;t[8]===s?d=t[9]:(d={label:`Rename project`,icon:ao,run:()=>void MB.open({payload:s}),destructive:!1},t[8]=s,t[9]=d);let f;t[10]===s?f=t[11]:(f={label:`Walkthrough settings`,icon:x_,run:()=>void jB.open({payload:s}),destructive:!1},t[10]=s,t[11]=f);let p;t[12]===s?p=t[13]:(p={label:`Remove from Porcelain`,icon:lg,run:()=>void NB.open({payload:s}),destructive:!0},t[12]=s,t[13]=p);let m;t[14]!==l||t[15]!==u||t[16]!==d||t[17]!==f||t[18]!==p?(m=[...l,u,d,f,p],t[14]=l,t[15]=u,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h=m,g=`Project actions: ${i.name} · ${r}`,_;t[20]===g?_=t[21]:(_=(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":g})}),t[20]=g,t[21]=_);let v;t[22]===a?v=t[23]:(v=a??(0,Q.jsx)(Vh,{}),t[22]=a,t[23]=v);let y;t[24]!==v||t[25]!==_?(y=(0,Q.jsx)(Ze,{render:_,children:v}),t[24]=v,t[25]=_,t[26]=y):y=t[26];let b=a?`Project actions · ${r}`:`Project actions`,x;t[27]===b?x=t[28]:(x=(0,Q.jsx)(Yo,{children:b}),t[27]=b,t[28]=x);let S;t[29]!==y||t[30]!==x?(S=(0,Q.jsxs)(ot,{hoverable:!1,children:[y,x]}),t[29]=y,t[30]=x,t[31]=S):S=t[31];let C;t[32]===i?C=t[33]:(C=!i.available&&(0,Q.jsx)(bc,{children:c(i)}),t[32]=i,t[33]=C);let w;t[34]===h?w=t[35]:(w=h.map(iW),t[34]=h,t[35]=w);let T;t[36]!==C||t[37]!==w?(T=(0,Q.jsx)(Ne,{children:(0,Q.jsxs)(ct,{children:[C,w]})}),t[36]=C,t[37]=w,t[38]=T):T=t[38];let E;return t[39]!==S||t[40]!==T?(E=(0,Q.jsxs)(Wt,{children:[S,T]}),t[39]=S,t[40]=T,t[41]=E):E=t[41],E}function iW(e){let{label:t,icon:n,run:r,destructive:i}=e;return(0,Q.jsxs)(dn,{className:`cursor-pointer`,destructive:i,onSelect:r,children:[(0,Q.jsx)(n,{}),t]},t)}function aW(e){let t=(0,$.c)(2),{environmentName:n}=e,r=`${n} is reconnecting`,i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(Ao,{variant:`secondary`,role:`status`,title:r,children:`Reconnecting`}),t[0]=r,t[1]=i),i}function oW(e){let t=(0,$.c)(11),{projectName:n,environmentName:r,environmentIcon:i,showEnvironment:a,reconnecting:o}=e,s=r?`${n} · ${r}`:n,c;t[0]===n?c=t[1]:(c=(0,Q.jsx)(`div`,{className:`flex min-w-0 text-xs font-semibold`,children:(0,Q.jsx)(fr,{text:n})}),t[0]=n,t[1]=c);let l;t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a?(l=a&&r&&(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-2xs text-muted-foreground`,children:[(0,Q.jsxs)(`div`,{role:`img`,"aria-label":`Computer: ${r}`,className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(Et,{icon:i,className:`size-3 shrink-0`}),(0,Q.jsx)(fr,{text:r})]}),o&&(0,Q.jsx)(aW,{environmentName:r})]}),t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=l):l=t[6];let u;return t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 px-2 py-2`,"aria-label":s,children:[c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function sW(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`window-drag-region`}),e[0]=t):t=e[0],t}function cW(e){let t=(0,$.c)(4),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(sW,{}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:(0,Q.jsx)(fr,{className:`text-sm font-semibold tracking-tight`,text:`Porcelain`})}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Q.jsxs)(`header`,{className:`desktop-sidebar-header relative mt-0.5 flex h-10 shrink-0 items-center gap-2 px-2`,children:[r,i,n]}),t[2]=n,t[3]=a),a}function lW(e){let t=(0,$.c)(23),{remotes:n,onOpenProject:r}=e;if(!n?.length){let e;t[0]===r?e=t[1]:(e=(0,Q.jsx)(KH,{className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,"aria-label":`Open project`,onClick:()=>r(null)}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(d_,{className:`text-muted-foreground`}),t[2]=n):n=t[2];let i;t[3]===e?i=t[4]:(i=(0,Q.jsx)(Ze,{render:e,children:n}),t[3]=e,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open project`}),t[5]=a):a=t[5];let o;return t[6]===i?o=t[7]:(o=(0,Q.jsxs)(ot,{hoverable:!1,children:[i,a]}),t[6]=i,t[7]=o),o}let i;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(KH,{className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,"aria-label":`Open project`})}),children:(0,Q.jsx)(d_,{className:`text-muted-foreground`})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open project`})]}),t[8]=i):i=t[8];let a;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(bc,{children:`Open project on`}),t[9]=a):a=t[9];let o;t[10]===r?o=t[11]:(o=()=>r(null),t[10]=r,t[11]=o);let s;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(da,{}),t[12]=s):s=t[12];let c;t[13]===o?c=t[14]:(c=(0,Q.jsxs)(dn,{onSelect:o,children:[s,`This computer`]}),t[13]=o,t[14]=c);let l;if(t[15]!==r||t[16]!==n){let e;t[18]===r?e=t[19]:(e=e=>(0,Q.jsx)(uW,{entry:e,onOpen:()=>r(e)},e.remote.environmentId),t[18]=r,t[19]=e),l=n.map(e),t[15]=r,t[16]=n,t[17]=l}else l=t[17];let u;return t[20]!==c||t[21]!==l?(u=(0,Q.jsxs)(Wt,{children:[i,(0,Q.jsx)(Ne,{align:`end`,children:(0,Q.jsxs)(ct,{children:[a,c,l]})})]}),t[20]=c,t[21]=l,t[22]=u):u=t[22],u}function uW(e){let t=(0,$.c)(11),{entry:n,onOpen:r}=e,i=wo(n.remote),a=i.kind===`online`,o=!a,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Io,{}),t[0]=s):s=t[0];let c=a?i.name:n.remote.name,l;t[1]===c?l=t[2]:(l=(0,Q.jsx)(fr,{className:`min-w-0`,text:c}),t[1]=c,t[2]=l);let u;t[3]!==a||t[4]!==i?(u=!a&&(0,Q.jsx)(Ao,{variant:_c(i),className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,children:Cr(i)}),t[3]=a,t[4]=i,t[5]=u):u=t[5];let d;return t[6]!==r||t[7]!==o||t[8]!==l||t[9]!==u?(d=(0,Q.jsxs)(dn,{disabled:o,onSelect:r,children:[s,l,u]}),t[6]=r,t[7]=o,t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function dW(e){return e.main?jg:_g}function fW(e){let t=(0,$.c)(114),{remotes:n,selected:r,onSelect:i,onOpenPullRequest:a,onOpenProject:o,onOpenSettings:s,onManageComputers:l,showRemoteNotice:u,onOpenShortcuts:d}=e,{connection:f}=Di(),p;t[0]===f.environmentId?p=t[1]:(p=kB(f.environmentId),t[0]=f.environmentId,t[1]=p);let m=Ot(p),h=hH(),g=hH(),_=hH(),v=[f,...(n??[]).map(gW)],y=r?{kind:`worktree`,worktreeId:r.worktreeId,environmentId:r.remote??f.environmentId}:void 0,{groups:b,filters:x,loading:S,loadingWithoutSavedRows:C,neverRead:w}=Ot(ic({connections:v,snapshots:ba(n??[]),expandSingleCheckout:!0,groupRepositories:!0,compact:{selected:y}})),T=Ot(Fs),E=Da(Fs),{query:D,filter:O}=T;Lt(Tr(v));let A=Da(Ur(v)),j=$m(),M;t[2]===j.pathname?M=t[3]:(M={pathname:j.pathname,open:!1},t[2]=j.pathname,t[3]=M);let[N,P]=(0,Z.useState)(M),F=N.pathname===j.pathname&&N.open,I;t[4]===E?I=t[5]:(I=e=>E(t=>({...t,query:e})),t[4]=E,t[5]=I);let L=I,R=O.projects!==void 0||O.environments!==void 0,B=D.trim()||R?`No matching worktrees`:`No projects yet`,{setOpenMobile:V,isMobile:H}=BH(),U;t[6]!==r||t[7]!==u?(U=e=>u&&r?.remote===e.connection.environmentId&&r.projectId===e.project.id,t[6]=r,t[7]=u,t[8]=U):U=t[8];let W=U,G;t[9]===E?G=t[10]:(G=(e,t)=>E(n=>({...n,showingAll:{...n.showingAll,[e]:t}})),t[9]=E,t[10]=G);let K=G,q,ee;if(t[11]!==b){let e=b.flatMap(hW).filter(mW);q=e[0]?.key,ee=e.at(-1)?.key,t[11]=b,t[12]=q,t[13]=ee}else q=t[12],ee=t[13];let J=ee,ne;t[14]!==f.environmentId||t[15]!==i||t[16]!==V?(ne=e=>{e.worktreeId&&(i({remote:e.environmentId===f.environmentId?null:e.environmentId,projectId:e.projectId,worktreeId:e.worktreeId}),V(!1))},t[14]=f.environmentId,t[15]=i,t[16]=V,t[17]=ne):ne=t[17];let re=ne,ie=HH,ae;t[18]!==o||t[19]!==n?(ae=(0,Q.jsx)(cW,{children:(0,Q.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center`,children:(0,Q.jsx)(lW,{remotes:n,onOpenProject:o})})}),t[18]=o,t[19]=n,t[20]=ae):ae=t[20];let oe=H?``:void 0,se;t[21]===L?se=t[22]:(se=e=>L(e.target.value),t[21]=L,t[22]=se);let ue;t[23]!==g||t[24]!==q||t[25]!==_||t[26]!==J||t[27]!==D.length||t[28]!==L?(ue=e=>{e.key===`Escape`&&D.length>0&&(e.stopPropagation(),L(``)),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),(e.key===`ArrowDown`||q===J?g:_).element?.focus())},t[23]=g,t[24]=q,t[25]=_,t[26]=J,t[27]=D.length,t[28]=L,t[29]=ue):ue=t[29];let de;t[30]!==H||t[31]!==D||t[32]!==oe||t[33]!==se||t[34]!==ue?(de=(0,Q.jsx)(CH,{autoFocus:H,"data-autofocus":oe,type:`search`,"aria-label":`Search worktrees`,placeholder:`Search`,value:D,onChange:se,onKeyDown:ue}),t[30]=H,t[31]=D,t[32]=oe,t[33]=se,t[34]=ue,t[35]=de):de=t[35];let fe;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{})}),t[36]=fe):fe=t[36];let pe;t[37]===de?pe=t[38]:(pe=(0,Q.jsxs)(_H,{className:`min-w-0 flex-1`,children:[de,fe]}),t[37]=de,t[38]=pe);let me;t[39]===j.pathname?me=t[40]:(me=e=>P({pathname:j.pathname,open:e}),t[39]=j.pathname,t[40]=me);let he;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(KH,{"aria-label":`Filter worktrees`,className:`relative top-0 right-0 w-6 cursor-pointer`})}),children:(0,Q.jsx)(Vg,{})}),(0,Q.jsx)(Yo,{children:`Filter worktrees`})]}),t[41]=he):he=t[41];let ge;if(t[42]!==x||t[43]!==E){let e;t[45]===E?e=t[46]:(e=e=>(0,Q.jsxs)(ct,{children:[(0,Q.jsx)(bc,{children:e.label}),e.items.map(t=>(0,Q.jsxs)(le,{value:t.id,className:`cursor-pointer`,checked:t.checked,closeOnSelect:!1,onCheckedChange:()=>E(n=>({...n,filter:{...n.filter,[e.key]:t.next}})),children:[t.icon&&(0,Q.jsx)(Et,{icon:t.icon}),(0,Q.jsx)(fr,{propagateEscape:!0,text:t.label,className:`min-w-0 flex-1`})]},t.id)),(0,Q.jsx)(we,{})]},e.key),t[45]=E,t[46]=e),ge=x.map(e),t[42]=x,t[43]=E,t[44]=ge}else ge=t[44];let _e;t[47]===E?_e=t[48]:(_e=(0,Q.jsx)(dn,{className:`cursor-pointer`,onSelect:()=>E(pW),children:`Clear filters`}),t[47]=E,t[48]=_e);let ve;t[49]!==ge||t[50]!==_e?(ve=(0,Q.jsx)(Ne,{align:`start`,className:`flex max-h-[min(24rem,var(--available-height))] w-80 max-w-[calc(100vw-2rem)] flex-col overflow-y-hidden`,children:(0,Q.jsxs)(`div`,{className:`-m-1 min-h-0 overflow-y-auto p-1`,children:[ge,_e]})}),t[49]=ge,t[50]=_e,t[51]=ve):ve=t[51];let ye;t[52]!==F||t[53]!==me||t[54]!==ve?(ye=(0,Q.jsxs)(Wt,{open:F,onOpenChange:me,children:[he,ve]}),t[52]=F,t[53]=me,t[54]=ve,t[55]=ye):ye=t[55];let be;t[56]!==pe||t[57]!==ye?(be=(0,Q.jsxs)(`div`,{className:`navigator-filters mb-2 flex items-center gap-1 px-2`,children:[pe,ye]}),t[56]=pe,t[57]=ye,t[58]=be):be=t[58];let xe=WH,Se=C?void 0:m,Ce=b.map(e=>{let{key:t,sources:n,members:r,rows:i,more:o,less:s}=e,l=r[0];if(!l)return null;let u=t!==l.key,d=!u&&l.singleCheckout,p=(0,Q.jsx)(rW,{project:l.project,environmentId:l.connection.environmentId===f.environmentId?null:l.connection.environmentId,environmentName:l.environmentName});return(0,Q.jsx)(GH,{"data-navigator-group":t,className:d?`py-0`:`mb-3`,children:(0,Q.jsxs)(zo,{open:l.expanded,onOpenChange:e=>E(n=>({...n,expanded:{...n.expanded,[t]:e}})),className:`group/project`,children:[!d&&(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(oW,{projectName:l.project.name,environmentName:u?void 0:l.environmentName,environmentIcon:l.environmentIcon,showEnvironment:!u&&v.length>1,reconnecting:!u&&W(l)}),u?r.map(e=>(0,Q.jsx)(rW,{project:e.project,environmentId:e.connection.environmentId===f.environmentId?null:e.connection.environmentId,environmentName:e.environmentName,icon:(0,Q.jsx)(Et,{icon:e.environmentIcon})},e.key)):p,(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(pa,{render:(0,Q.jsx)(KH,{className:`relative top-0 right-0 w-6 cursor-pointer`,"aria-label":`${l.expanded?`Collapse`:`Expand`} ${l.project.name}${u?``:` · ${l.environmentName}`}`})}),children:(0,Q.jsx)(sc,{className:`group-data-closed/project:-rotate-90`})}),(0,Q.jsx)(Yo,{children:l.expanded?`Collapse project`:`Expand project`})]})]}),n.map(e=>(0,Q.jsxs)(`div`,{children:[e.saved&&(0,Q.jsx)(`p`,{role:`status`,className:`px-2 py-2 text-xs text-muted-foreground`,children:u?`${e.environmentName} unavailable`:`Computer unavailable`}),!e.saved&&!e.project.available&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-2`,children:[(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:c(e.project)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[`Reconnect`,`Choose folder`].map(t=>(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:()=>void AB.open({payload:{remote:e.connection.environmentId===f.environmentId?null:e.connection.environmentId,project:e.project,...t===`Reconnect`&&Ia(e.project)?{path:Ia(e.project)}:{}}}),children:t},t))})]})]},e.key)),(0,Q.jsx)(co,{children:(0,Q.jsxs)(qH,{children:[i.map(e=>{let{source:t}=e,n=y!==void 0&&Ws(e,y),r=e.pullRequest.state===`available`?e.pullRequest:void 0,i=jn(e),o=te(e),s=dW(e),c=r?.checks?.state===`available`&&r.checks.result===`failed`,l=o?.kind===`pull-request`?` on #${o.number}`:``,m=c?`Checks failed${l}`:void 0,h=d?z(e):void 0,b=[d?e.projectName:void 0,d||u?e.environmentName:void 0,i,e.name===i?void 0:e.name,e.path,d&&e.changes.state===`available`&&e.changes.count>0?tc(e.changes):void 0,h?$a(h,Date.now()):void 0,m].filter(Boolean).join(` · `),x=e.key===J?_.attach:void 0;e.key===q&&(x=g.attach);let S=`${k(e)}${m?`, ${m.toLowerCase()}`:``}${n?`, Current`:``}`;return(0,Q.jsxs)(JH,{className:d?`flex min-w-0 items-center`:void 0,children:[(0,Q.jsx)(fH,{onRetryChanges:()=>A({environmentId:e.environmentId}),entry:e,context:{connection:v.find(t=>t.environmentId===e.environmentId)??f,remoteStatus:t.connection.environmentId===f.environmentId?void 0:ns(t.connection.environmentId)},children:(0,Q.jsxs)(`div`,{"data-navigator-card":``,className:Y(`relative rounded-md`,n?`bg-selection`:`hover:bg-accent`,d&&`flex min-w-0 items-center`),children:[(0,Q.jsx)(fr,{text:b,disclose:`always`,renderTrigger:(r,a)=>(0,Q.jsxs)(kn,{className:Y(`w-full cursor-pointer text-left text-ui leading-4.5`,d?`min-w-0 flex-1 py-2`:`py-1.5`),"data-sidebar":`menu-button`,size:`xs`,"aria-label":S,"aria-current":n?`page`:void 0,onClick:()=>re(e),render:(0,Q.jsx)(`button`,{type:`button`,ref:x,disabled:!e.available}),children:[!d&&(0,Q.jsx)(ce,{className:`self-start`,children:(0,Q.jsx)(s,{className:`mt-0.5 size-3.5 text-muted-foreground`})}),(0,Q.jsxs)(Qs,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[a(d?e.projectName:i,Y(`min-w-0`,!d&&`flex-1`,n?`font-semibold`:`font-medium`),!d&&e.displayTitle===void 0?{keep:ri(i)}:`end`),d&&(0,Q.jsx)(Et,{icon:t.environmentIcon,className:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),W(t)&&(d||u&&n)&&(0,Q.jsx)(aW,{environmentName:t.environmentName}),c&&(0,Q.jsx)(Dh,{className:`size-3 shrink-0 text-del-fg`,"aria-hidden":`true`})]}),!d&&(0,Q.jsx)(vW,{entry:e,showEnvironment:u,pullRequest:o?.kind===`pull-request`?o:void 0})]})]})}),o?.kind===`pull-request`&&(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,className:Y(`shrink-0 cursor-pointer`,d?`mr-0.5`:`absolute right-0.5 bottom-1`),"aria-label":`Open PR #${o.number} · ${e.projectName} · ${e.environmentName} · ${xn(r?.checks)}${o.merged?` · Merged`:``}`,"data-merged":o.merged?``:void 0,onClick:()=>{a(e),V(!1)},children:(0,Q.jsx)(_W,{trailing:o})})]})}),d&&p]},e.key)}),(o>0||s)&&(0,Q.jsx)(JH,{children:(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,className:`w-full cursor-pointer justify-start`,onClick:()=>K(t,o>0),children:(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:o>0?`Show ${o} more`:`Show less`})})}),i.length===0&&!S&&(0,Q.jsx)(`p`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:`No matching worktrees`})]})})]})},t)}),Te;t[59]!==b.length||t[60]!==S||t[61]!==w||t[62]!==A?(Te=!S&&b.length===0&&w&&(0,Q.jsxs)(YH,{children:[(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`Couldn’t reach Porcelain`})}),(0,Q.jsx)(QH,{children:(0,Q.jsx)(X,{variant:`outline`,onClick:()=>A(void 0),children:`Try again`})})]}),t[59]=b.length,t[60]=S,t[61]=w,t[62]=A,t[63]=Te):Te=t[63];let Ee;t[64]!==B||t[65]!==b.length||t[66]!==S||t[67]!==w?(Ee=!S&&b.length===0&&!w&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:B}),t[64]=B,t[65]=b.length,t[66]=S,t[67]=w,t[68]=Ee):Ee=t[68];let De;t[69]!==xe||t[70]!==Se||t[71]!==Ce||t[72]!==Te||t[73]!==Ee?(De=(0,Q.jsxs)(xe,{ref:Se,children:[Ce,Te,Ee]}),t[69]=xe,t[70]=Se,t[71]=Ce,t[72]=Te,t[73]=Ee,t[74]=De):De=t[74];let Oe;t[75]===h?Oe=t[76]:(Oe=e=>h.attach(e),t[75]=h,t[76]=Oe);let ke;t[77]!==s||t[78]!==Oe?(ke=(0,Q.jsx)(X,{ref:Oe,variant:`ghost`,className:`min-w-0 shrink`,"aria-label":`Settings`,onClick:s}),t[77]=s,t[78]=Oe,t[79]=ke):ke=t[79];let Ae,je;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(x_,{className:`text-muted-foreground`}),je=(0,Q.jsx)(fr,{text:`Settings`}),t[80]=Ae,t[81]=je):(Ae=t[80],je=t[81]);let Me;t[82]===ke?Me=t[83]:(Me=(0,Q.jsxs)(Ze,{render:ke,children:[Ae,je]}),t[82]=ke,t[83]=Me);let Pe;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Q.jsxs)(Yo,{role:`tooltip`,children:[`Settings `,(0,Q.jsx)(pH,{children:Ad(ou.openSettings)})]}),t[84]=Pe):Pe=t[84];let Fe;t[85]===Me?Fe=t[86]:(Fe=(0,Q.jsxs)(ot,{hoverable:!1,children:[Me,Pe]}),t[85]=Me,t[86]=Fe);let Ie;t[87]!==l||t[88]!==h?(Ie=(0,Q.jsx)(hs,{fallbackFocus:h,onManageComputers:l}),t[87]=l,t[88]=h,t[89]=Ie):Ie=t[89];let Le;t[90]===d?Le=t[91]:(Le=(0,Q.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`Keyboard shortcuts`,onClick:d}),t[90]=d,t[91]=Le);let Re;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Q.jsx)(Ng,{className:`text-muted-foreground`}),t[92]=Re):Re=t[92];let ze;t[93]===Le?ze=t[94]:(ze=(0,Q.jsx)(Ze,{render:Le,children:Re}),t[93]=Le,t[94]=ze);let Be;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Q.jsxs)(Yo,{role:`tooltip`,children:[`Keyboard shortcuts`,` `,(0,Q.jsx)(pH,{children:Ad(ou.openShortcuts)})]}),t[95]=Be):Be=t[95];let Ve;t[96]===ze?Ve=t[97]:(Ve=(0,Q.jsxs)(ot,{hoverable:!1,children:[ze,Be]}),t[96]=ze,t[97]=Ve);let He;t[98]!==Ie||t[99]!==Ve?(He=(0,Q.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[Ie,Ve]}),t[98]=Ie,t[99]=Ve,t[100]=He):He=t[100];let Ue;t[101]!==Fe||t[102]!==He?(Ue=(0,Q.jsxs)(`footer`,{role:`group`,"aria-label":`Navigator controls`,className:`navigator-footer flex shrink-0 items-center gap-1 p-2`,children:[Fe,He]}),t[101]=Fe,t[102]=He,t[103]=Ue):Ue=t[103];let We;t[104]!==ie||t[105]!==ae||t[106]!==be||t[107]!==De||t[108]!==Ue?(We=(0,Q.jsxs)(ie,{role:`navigation`,collapsible:`none`,className:`h-full w-full min-h-0 overflow-hidden`,"aria-label":`Projects and worktrees`,children:[ae,be,De,Ue]}),t[104]=ie,t[105]=ae,t[106]=be,t[107]=De,t[108]=Ue,t[109]=We):We=t[109];let Ge,Ke;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Q.jsx)(QU,{}),Ke=(0,Q.jsx)(GU,{}),t[110]=Ge,t[111]=Ke):(Ge=t[110],Ke=t[111]);let qe;return t[112]===We?qe=t[113]:(qe=(0,Q.jsxs)(`div`,{className:`review-navigator h-full min-h-0 overflow-hidden bg-frame text-ui [--sidebar:var(--frame)] [--sidebar-foreground:var(--foreground)] [--muted:var(--card)] [--secondary:var(--card)] [--sidebar-accent:var(--card)]`,children:[We,Ge,Ke]}),t[112]=We,t[113]=qe),qe}function pW(e){return{...e,filter:dc}}function mW(e){return e.available||e.pullRequest.state===`available`}function hW(e){let{rows:t}=e;return t}function gW(e){return e.connection}function _W(e){let t=(0,$.c)(5),{trailing:n}=e,r;t[0]===n.merged?r=t[1]:(r=n.merged&&(0,Q.jsx)(Cg,{"aria-hidden":`true`}),t[0]=n.merged,t[1]=r);let i;return t[2]!==r||t[3]!==n.text?(i=(0,Q.jsxs)(`span`,{className:`flex items-center gap-0.5 text-2xs text-muted-foreground tabular-nums`,children:[r,n.text]}),t[2]=r,t[3]=n.text,t[4]=i):i=t[4],i}function vW(e){let t=(0,$.c)(25),{entry:n,pullRequest:r,showEnvironment:i}=e,a=n.displayTitle===void 0?void 0:n.branch,o;t[0]===n.changes?o=t[1]:(o=tc(n.changes),t[0]=n.changes,t[1]=o);let s=o,c=s===`—`||s===``?void 0:s,l,u,d,f;if(t[2]!==a||t[3]!==c||t[4]!==n||t[5]!==i){let e=z(n);f=`flex h-4 min-w-0 items-center gap-2 text-2xs leading-4 text-muted-foreground`,l=`flex h-4 min-w-0 flex-1 flex-wrap justify-between gap-x-2 overflow-hidden`,t[10]!==a||t[11]!==c||t[12]!==n.environmentName||t[13]!==i?(u=(a||c||i)&&(0,Q.jsxs)(`span`,{className:`flex max-w-full min-w-0`,children:[i&&(0,Q.jsx)(fr,{className:`max-w-1/2 shrink-0`,text:n.environmentName}),a&&(0,Q.jsx)(fr,{className:i?`min-w-0`:`max-w-full shrink-0`,text:i?`\u00a0· ${a}`:a,cut:{keep:ri(a)}}),c&&(0,Q.jsx)(fr,{className:`min-w-0`,text:a||i?`\u00a0· ${c}`:c})]}),t[10]=a,t[11]=c,t[12]=n.environmentName,t[13]=i,t[14]=u):u=t[14],d=e&&(0,Q.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:$a(e,Date.now())}),t[2]=a,t[3]=c,t[4]=n,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f}else l=t[6],u=t[7],d=t[8],f=t[9];let p;t[15]!==l||t[16]!==u||t[17]!==d?(p=(0,Q.jsxs)(`div`,{className:l,children:[u,d]}),t[15]=l,t[16]=u,t[17]=d,t[18]=p):p=t[18];let m;t[19]===r?m=t[20]:(m=r!==void 0&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:Y(oe({variant:`ghost`,size:`xs`}),`invisible h-4 shrink-0`),children:(0,Q.jsx)(_W,{trailing:r})}),t[19]=r,t[20]=m);let h;return t[21]!==f||t[22]!==p||t[23]!==m?(h=(0,Q.jsxs)(`div`,{className:f,children:[p,m]}),t[21]=f,t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function yW(e,t){let n=(0,$.c)(6),[r,i]=ud(e),a;n[0]!==t||n[1]!==i?(a=e=>i(e).then(t,bW),n[0]=t,n[1]=i,n[2]=a):a=n[2];let o;return n[3]!==r||n[4]!==a?(o={result:r,submit:a},n[3]=r,n[4]=a,n[5]=o):o=n[5],o}function bW(){}function xW(e,t){let n=(0,$.c)(2),r;return n[0]===e?r=n[1]:(r=nn(e),n[0]=e,n[1]=r),yW(r,t)}function SW(e,t){let n=(0,$.c)(2),r;return n[0]===e?r=n[1]:(r=Pr(e),n[0]=e,n[1]=r),yW(r,t)}var CW=en;function wW(e){let t=(0,$.c)(4),{remote:n,connection:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=n===null?i({connection:r,unavailable:void 0}):(0,Q.jsx)(TW,{environmentId:n,children:i}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function TW(e){let t=(0,$.c)(3),{environmentId:n,children:r}=e,i=Fo(n),a;return t[0]!==r||t[1]!==i?(a=i&&(0,Q.jsx)(EW,{entry:i,children:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function EW(e){let t=(0,$.c)(6),{entry:n,children:r}=e,i=wo(n.remote),a;t[0]===i?a=t[1]:(a=i.kind===`online`?void 0:`${Cr(i)}. ${Ue(i)??`Wait for this computer to answer before changing its projects.`}`,t[0]=i,t[1]=a);let o;return t[2]!==r||t[3]!==n.connection||t[4]!==a?(o=r({connection:n.connection,unavailable:a}),t[2]=r,t[3]=n.connection,t[4]=a,t[5]=o):o=t[5],o}function DW(e){let t=(0,$.c)(5),{unavailable:n,result:r}=e,i;t[0]!==r||t[1]!==n?(i=n??(Mi(r)?ue(Ra(r.cause)):void 0),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=a&&(0,Q.jsx)(Ga,{variant:`destructive`,children:(0,Q.jsx)(h,{children:a})}),t[3]=a,t[4]=o),o}function OW(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(Ez,{controller:NB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsx)(Oz,{children:(0,Q.jsx)(kW,{project:e.project,...t},e.project.id)})})}),t[0]=n,t[1]=r),r}function kW(e){let t=(0,$.c)(29),{project:n,connection:r,unavailable:i}=e,a=SW(r,AW),{result:o}=a,s;t[0]===n.name?s=t[1]:(s=(0,Q.jsxs)(jz,{className:`break-all`,children:[`Remove `,n.name,` from Porcelain?`]}),t[0]=n.name,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(Mz,{children:`Removes this project and its reviews and comments from Porcelain; files and Git history stay on disk.`}),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=(0,Q.jsxs)(kz,{children:[s,c]}),t[3]=s,t[4]=l);let u;t[5]===n?u=t[6]:(u=Ia(n),t[5]=n,t[6]=u);let d;t[7]===u?d=t[8]:(d=(0,Q.jsx)(`p`,{className:`break-all font-mono text-xs text-muted-foreground`,children:u}),t[7]=u,t[8]=d);let f;t[9]!==o||t[10]!==i?(f=(0,Q.jsx)(DW,{unavailable:i,result:o}),t[9]=o,t[10]=i,t[11]=f):f=t[11];let p;t[12]===o.waiting?p=t[13]:(p=(0,Q.jsx)(Nz,{disabled:o.waiting,children:`Cancel`}),t[12]=o.waiting,t[13]=p);let m=o.waiting||i!==void 0,h;t[14]!==n.id||t[15]!==a?(h=()=>void a.submit(n.id),t[14]=n.id,t[15]=a,t[16]=h):h=t[16];let g;t[17]!==o.waiting||t[18]!==m||t[19]!==h?(g=(0,Q.jsx)(ji,{"data-slot":`alert-dialog-action`,pending:o.waiting,variant:`destructive`,disabled:m,onClick:h,children:`Remove from Porcelain`}),t[17]=o.waiting,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]!==g||t[22]!==p?(_=(0,Q.jsxs)(Az,{children:[p,g]}),t[21]=g,t[22]=p,t[23]=_):_=t[23];let v;return t[24]!==_||t[25]!==l||t[26]!==d||t[27]!==f?(v=(0,Q.jsxs)(Q.Fragment,{children:[l,d,f,_]}),t[24]=_,t[25]=l,t[26]=d,t[27]=f,t[28]=v):v=t[28],v}function AW(){return NB.close()}function jW(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(vz,{controller:MB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsx)(xz,{children:(0,Q.jsx)(MW,{project:e.project,...t},e.project.id)})})}),t[0]=n,t[1]=r),r}function MW(e){let t=(0,$.c)(40),{project:n,connection:r,unavailable:i}=e,a=xW(r,IW),{result:o}=a,s;t[0]===n.name?s=t[1]:(s={name:n.name},t[0]=n.name,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={onChange:CW},t[2]=c):c=t[2];let l;t[3]!==n.id||t[4]!==a?(l=e=>{let{value:t}=e;return a.submit({projectId:n.id,name:t.name})},t[3]=n.id,t[4]=a,t[5]=l):l=t[5];let u;t[6]!==s||t[7]!==l?(u={defaultValues:s,validators:c,onSubmit:l},t[6]=s,t[7]=l,t[8]=u):u=t[8];let d=Zd(u),f;t[9]===d?f=t[10]:(f=e=>wa(e,()=>d.handleSubmit()),t[9]=d,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(wz,{children:`Rename project`}),(0,Q.jsx)(Tz,{children:`The name is only a label in this sidebar. Nothing on disk changes, and two projects may share one.`})]}),t[11]=p):p=t[11];let m;t[12]===d.Field?m=t[13]:(m=(0,Q.jsx)(d.Field,{name:`name`,children:FW}),t[12]=d.Field,t[13]=m);let h;t[14]===n?h=t[15]:(h=Ia(n),t[14]=n,t[15]=h);let g;t[16]===h?g=t[17]:(g=(0,Q.jsx)(`p`,{className:`break-all font-mono text-xs text-muted-foreground`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==o||t[19]!==i?(_=(0,Q.jsx)(DW,{unavailable:i,result:o}),t[18]=o,t[19]=i,t[20]=_):_=t[20];let v;t[21]!==_||t[22]!==m||t[23]!==g?(v=(0,Q.jsxs)(`div`,{className:`grid gap-2 py-4`,children:[m,g,_]}),t[21]=_,t[22]=m,t[23]=g,t[24]=v):v=t[24];let y;t[25]===o.waiting?y=t[26]:(y=(0,Q.jsx)(X,{type:`button`,variant:`outline`,disabled:o.waiting,onClick:PW,children:`Cancel`}),t[25]=o.waiting,t[26]=y);let b;t[27]!==o.waiting||t[28]!==i?(b=e=>(0,Q.jsx)(ji,{pending:o.waiting,type:`submit`,disabled:!e||o.waiting||i!==void 0,children:`Rename`}),t[27]=o.waiting,t[28]=i,t[29]=b):b=t[29];let x;t[30]!==d.Subscribe||t[31]!==b?(x=(0,Q.jsx)(d.Subscribe,{selector:NW,children:b}),t[30]=d.Subscribe,t[31]=b,t[32]=x):x=t[32];let S;t[33]!==y||t[34]!==x?(S=(0,Q.jsxs)(Cz,{children:[y,x]}),t[33]=y,t[34]=x,t[35]=S):S=t[35];let C;return t[36]!==v||t[37]!==S||t[38]!==f?(C=(0,Q.jsxs)(`form`,{onSubmit:f,children:[p,v,S]}),t[36]=v,t[37]=S,t[38]=f,t[39]=C):C=t[39],C}function NW(e){return e.canSubmit}function PW(){return MB.close()}function FW(e){return(0,Q.jsxs)(Oo,{"data-invalid":e.state.meta.isTouched&&!e.state.meta.isValid,children:[(0,Q.jsx)(Ms,{htmlFor:`project-name`,children:`Name`}),(0,Q.jsx)(ei,{id:`project-name`,name:e.name,value:e.state.value,autoFocus:!0,"data-autofocus":``,"aria-invalid":e.state.meta.isTouched&&!e.state.meta.isValid,"aria-describedby":e.state.meta.isTouched&&!e.state.meta.isValid?`project-name-error`:void 0,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value)}),e.state.meta.isTouched&&!e.state.meta.isValid&&(0,Q.jsx)(bi,{id:`project-name-error`,errors:e.state.value.trim()===``?[{message:`Enter a project name.`}]:e.state.meta.errors})]})}function IW(){return MB.close()}function LW(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function RW(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function zW(e){return e/100*window.innerHeight}function BW(e){return e/100*window.innerWidth}function VW(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function HW({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=VW(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=RW(t,i);break;case`em`:r=LW(t,i);break;case`vh`:r=zW(i);break;case`vw`:r=BW(i)}return r}function UW(e){return parseFloat(e.toFixed(3))}function WW({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function GW(e){let{panels:t}=e,n=WW({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=UW(HW({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=UW(HW({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=UW(HW({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=UW(HW({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function KW(e,t=`Assertion error`){if(!e)throw Error(t)}function qW(e,t){return Array.from(t).sort(e===`horizontal`?JW:YW)}function JW(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function YW(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function XW(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ZW(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function QW({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ZW(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return KW(i,`No rect found`),i}var $W;function eG(){return $W===void 0&&($W=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),$W}function tG(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=qW(n,Array.from(t.children).filter(XW).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,QW({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=eG()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:WW({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var nG=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},rG={cursorFlags:0,state:`inactive`},iG=new nG;function aG(){return rG}function oG(e){return iG.addListener(`change`,e)}function sG(e){let t=rG,n={...rG};n.cursorFlags=e,rG=n,iG.emit(`change`,{prev:t,next:n})}function cG(e){let t=rG;rG=e,iG.emit(`change`,{prev:t,next:e})}var lG=e=>e,uG=()=>{},dG=1,fG=2,pG=4,mG=8,hG=3,gG=12,_G;function vG(){return _G===void 0&&(_G=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(_G=!0)),_G}function yG({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&vG()){let t=(e&dG)!==0,n=(e&fG)!==0,r=(e&pG)!==0,i=(e&mG)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return vG()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var bG=new WeakMap;function xG(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=bG.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=aG();switch(r.state){case`active`:case`hover`:{let e=yG({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}bG.set(e,{prevStyle:t,styleSheet:n})}var SG=new Map,CG=new nG;function wG(e){SG=new Map(SG),SG.delete(e)}function TG(e,t){for(let[t]of SG)if(t.id===e)return t}function EG(e,t){for(let[t,n]of SG)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function DG(){return SG}function OG(e,t){return CG.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function kG(e,t,n){let r=SG.get(e);SG=new Map(SG),SG.set(e,t),CG.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function AG(e){let t=aG(),n=DG(),r=!1;return t.state===`active`&&(cG({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(xG(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=EG(e.group.id,!0);kG(e.group,t,{isUserInteraction:!0})}))),r}function jG(e){e.defaultPrevented||AG(e.currentTarget)}function MG(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ZW(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function NG(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function PG(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:BG(e),b:BG(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();KW(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:zG(RG(n.a)),b:zG(RG(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var FG=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function IG(e){let t=getComputedStyle(VG(e)??e).display;return t===`flex`||t===`inline-flex`}function LG(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||IG(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||FG.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function RG(e){let t=e.length;for(;t--;){let n=e[t];if(KW(n,`Missing node`),LG(n))return n}return null}function zG(e){return e&&Number(getComputedStyle(e).zIndex)||0}function BG(e){let t=[];for(;e;)t.push(e),e=VG(e);return t}function VG(e){let{parentNode:t}=e;return NG(t)?t.host:t}function HG(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function UG({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!XW(n)||n.contains(e)||e.contains(n))return!0;if(PG(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(HG(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function WG(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=tG(r),a=MG(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&UG({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function GG(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KG(e,t,n=0){return Math.abs(UW(e)-UW(t))<=n}function qG(e,t){return KG(e,t)?0:e>t?1:-1}function JG({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(qG(r,c)<0){if(a){let e=(i+c)/2;r=qG(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=UW(r),r}function YG({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(KG(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;KW(u!=null,`Invalid first pivot index`),KW(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];KW(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(KW(n!=null,`Previous layout not found for panel index ${t}`),KG(n,i)){let t=o-n;qG(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];KW(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(KW(n!=null,`Previous layout not found for panel index ${t}`),KG(n,o)){let t=n-i;qG(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];KW(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&qG(i,c)<0){if(e>0){let t=c-o,n=t/2;qG(i+e,c)<0&&(e=qG(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;qG(i-e,c)<0&&(e=qG(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];KW(e!=null,`Previous layout not found for panel index ${r}`);let a=JG({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];KW(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=JG({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!KG(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(GG(c,l))return i;{let t=e<0?d:u,r=s[t];KW(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=JG({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!KG(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];KW(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=JG({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(KG(i,s)||(t-=s-i,l[r]=s),KG(t,0))break;e>0?r--:r++}}}if(!KG(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function XG(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||qG(e[n],t[n])!==0)return!1;return!0}function ZG({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!KG(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];KW(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];KW(i!=null,`No layout data found for index ${e}`);let o=r[e];KW(o!=null,`No layout data found for index ${e}`);let s=JG({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!KG(a,0))for(let e=0;e<t.length;e++){let n=r[e];KW(n!=null,`No layout data found for index ${e}`);let i=n+a,o=JG({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,KG(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function QG({groupId:e,panelId:t}){let n=()=>{let t=DG();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&KG(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:UW(100-e)}}return YG({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=ZG({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});XG(c,u)||kG(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&KG(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=WW({group:t}),o=UW(HW({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function $G(e){e.defaultPrevented||WG(e,DG()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=QG({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function eK(e){let t=DG();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function tK({groupId:e}){let t=()=>{let t=DG();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=ZG({layout:e,panelConstraints:r});return n?o:(XG(o,c)||kG(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function nK(e,t){let n=eK(e),r=EG(n.id,!0),i=n.separators.find(t=>t.element===e);KW(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);KW(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=tK({groupId:n.id}).getLayout(),c=ZG({layout:YG({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});XG(s,c)||kG(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function rK(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=eK(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&nK(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&nK(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&nK(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&nK(t,-5);break;case`End`:e.preventDefault(),nK(t,100);break;case`Enter`:{e.preventDefault();let n=eK(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=EG(n.id,!0),o=n.separators.find(e=>e.element===t);KW(o,`Matching separator not found`);let s=a.get(o);KW(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(KW(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];nK(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=eK(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);KW(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),nK(t,-100)}}function iK(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=DG(),n=WG(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),cG({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function aK({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=YG({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(XG(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?dG:fG;break;case`vertical`:s|=d<0?pG:mG}}else kG(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&hG:c|=s&hG,t.movementY===0?c|=o&gG:c|=s&gG,sG(c),xG(e)}function oK(e){let t=DG(),n=aG();n.state===`active`&&aK({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function sK(e){if(e.defaultPrevented)return;let t=aG(),n=DG();switch(t.state){case`active`:if(e.buttons===0){cG({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=EG(e.group.id,!0);kG(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.isConnected&&!t.hasPointerCapture?.(e.pointerId)&&t.setPointerCapture?.(e.pointerId)}aK({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=WG(e,n);r.length===0?t.state!==`inactive`&&cG({cursorFlags:0,state:`inactive`}):cG({cursorFlags:0,hitRegions:r,state:`hover`}),xG(e.currentTarget);break}}}function cK(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(aG().state){case`hover`:cG({cursorFlags:0,state:`inactive`})}}function lK(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||AG(e.currentTarget)&&e.preventDefault()}function uK(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=UW(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=UW((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function dK(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=WW({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:UW(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function fK(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function pK(e,t){return e.length===t.length&&e.every((e,n)=>fK(e,t[n]))}function mK({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=UW(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=UW((r[e]??0)/a*l);else{let e=UW(l/c.length);for(let t of c)u[t]=e}return u}function hK(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var gK=new Map;function _K(e){let t=!0;KW(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=WW({group:e});if(t===0)return;let n=EG(e.id);if(!n)return;let r=GW(e),i=n.defaultLayoutDeferred?uK(r):n.layout,a=ZG({layout:mK({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&XG(n.layout,a)&&pK(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;kG(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else dK(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{KW(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=WW({group:e}),s=GW(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(hK(e.panels,l)||(l=void 0));let u=ZG({layout:e.mutableState.layouts[c]??l??uK(s),panelConstraints:s}),d=e.element.ownerDocument;gK.set(d,(gK.get(d)??0)+1);let f=new Map;return tG(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),kG(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{KW(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,rK)}),gK.get(d)===1&&(d.addEventListener(`contextmenu`,jG,!0),d.addEventListener(`dblclick`,$G,!0),d.addEventListener(`pointerdown`,iK,!0),d.addEventListener(`pointerleave`,oK),d.addEventListener(`pointermove`,sK),d.addEventListener(`pointerout`,cK),d.addEventListener(`pointerup`,lK,!0)),function(){t=!1,gK.set(d,Math.max(0,(gK.get(d)??0)-1)),wG(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,rK)}),gK.get(d)||(d.removeEventListener(`contextmenu`,jG,!0),d.removeEventListener(`dblclick`,$G,!0),d.removeEventListener(`pointerdown`,iK,!0),d.removeEventListener(`pointerleave`,oK),d.removeEventListener(`pointermove`,sK),d.removeEventListener(`pointerout`,cK),d.removeEventListener(`pointerup`,lK,!0)),a.disconnect()}}function vK(){let[e,t]=(0,Z.useState)({});return[e,(0,Z.useCallback)(()=>t({}),[])]}function yK(e){let t=(0,Z.useId)();return`${e??t}`}var bK=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function xK(e){let t=(0,Z.useRef)(e);return bK(()=>{t.current=e},[e]),(0,Z.useCallback)((...e)=>t.current?.(...e),[t])}function SK(...e){return xK(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function CK(e){let t=(0,Z.useRef)({...e});return bK(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var wK=(0,Z.createContext)(null);function TK(e,t){let n=(0,Z.useRef)({getLayout:()=>({}),setLayout:lG});(0,Z.useImperativeHandle)(t,()=>n.current,[]),bK(()=>{Object.assign(n.current,tK({groupId:e}))})}function EK({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Z.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=xK(e=>{XG(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=xK((e,t)=>{XG(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=yK(s),v=(0,Z.useRef)(null),[y,b]=vK(),x=(0,Z.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=SK(v,a);TK(_,o);let C=xK((e,t)=>{let r=aG(),i=TG(e),a=EG(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=CK({defaultLayout:n,disableCursor:r}),T=(0,Z.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=qW(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=qW(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=TG(_),i=EG(_);r&&i&&kG(r,{...i,derivedPanelConstraints:GW(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Z.useRef)(null);return bK(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=_K(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=EG(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=OG(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=KG(t.collapsedSize,i[t.panelId]),a=KG(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=aG().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Z.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Q.jsx)(wK.Provider,{value:T,children:(0,Q.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}EK.displayName=`Group`;function DK(){let e=(0,Z.useContext)(wK);return KW(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function OK(e,t){let{id:n}=DK(),r=(0,Z.useRef)({collapse:uG,expand:uG,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:uG});(0,Z.useImperativeHandle)(t,()=>r.current,[]),bK(()=>{Object.assign(r.current,QG({groupId:n,panelId:e}))})}function kK({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=yK(c),_=CK({disabled:a}),v=(0,Z.useRef)(null),y=SK(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=DK(),T=d!==null,E=xK((e,t,n)=>{d?.(e,c,n)});bK(()=>{let e=v.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return C(t)}},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Z.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),OK(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Z.useSyncExternalStore)(e=>OG(x,e),D,D),k;return k=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,Q.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...AK,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Q.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}kK.displayName=`Panel`;var AK={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function jK({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=ZG({layout:YG({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=ZG({layout:YG({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function MK({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=yK(a),l=CK({disabled:n,disableDoubleClick:r}),[u,d]=(0,Z.useState)({}),[f,p]=(0,Z.useState)(`inactive`),[m,h]=(0,Z.useState)(!1),g=(0,Z.useRef)(null),_=SK(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=DK(),C=b===`horizontal`?`vertical`:`horizontal`;bK(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=oG(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=OG(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=n.findIndex(t=>t.panelId===e.id);d(jK({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,Z.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,Q.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}MK.displayName=`Separator`;function NK({className:e,...t}){return(0,Q.jsx)(EK,{"data-slot":`resizable-panel-group`,className:Y(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function PK({...e}){return(0,Q.jsx)(kK,{"data-slot":`resizable-panel`,...e})}function FK({withHandle:e,className:t,...n}){return(0,Q.jsx)(MK,{"data-slot":`resizable-handle`,className:Y(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:after:bg-ring aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,Q.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`})})}function IK(e){let t=(0,$.c)(4),{open:n,onOpenChange:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=(0,Q.jsx)(VH,{open:n,onOpenChange:r,children:i}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function LK(e){let t=(0,$.c)(26),{navigator:n,isMobile:r,open:i,children:a}=e,[o,s]=(0,Z.useState)(248),[c,l]=(0,Z.useState)(null),u=hH(),d=(r||!i)&&`desktop-workspace-without-navigator`,f;t[0]===d?f=t[1]:(f=Y(`h-svh min-w-0 flex-1 bg-frame p-2 text-ui text-foreground max-md:p-0`,d),t[0]=d,t[1]=f);let p;t[2]!==u.element||t[3]!==r||t[4]!==c||t[5]!==o||t[6]!==i?(p=(e,t)=>{let{isUserInteraction:n}=t;if(c&&u.element&&!r&&i){if(n){let t=Array.from(u.element.children).reduce(RK,0);s(t*(e.navigator??0)/100)}else c.resize(o)}},t[2]=u.element,t[3]=r,t[4]=c,t[5]=o,t[6]=i,t[7]=p):p=t[7];let m;t[8]!==r||t[9]!==n||t[10]!==o||t[11]!==i?(m=!r&&i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(PK,{id:`navigator`,panelRef:l,groupResizeBehavior:`preserve-pixel-size`,defaultSize:o,minSize:220,maxSize:420,children:(0,Q.jsx)(fW,{...n})}),(0,Q.jsx)(FK,{"aria-label":`Worktree navigator and document panes`,className:`w-2 bg-transparent after:w-2`})]}),t[8]=r,t[9]=n,t[10]=o,t[11]=i,t[12]=m):m=t[12];let h=r?0:420,g;t[13]===a?g=t[14]:(g=(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:a}),t[13]=a,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsx)(PK,{id:`document`,minSize:h,children:g}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==u.attach||t[19]!==p||t[20]!==m||t[21]!==_?(v=(0,Q.jsxs)(NK,{orientation:`horizontal`,elementRef:u.attach,onLayoutChanged:p,children:[m,_]}),t[18]=u.attach,t[19]=p,t[20]=m,t[21]=_,t[22]=v):v=t[22];let y;return t[23]!==f||t[24]!==v?(y=(0,Q.jsx)(`div`,{className:f,children:v}),t[23]=f,t[24]=v,t[25]=y):y=t[25],y}function RK(e,t){return t instanceof HTMLElement&&t.hasAttribute(`data-panel`)?e+t.offsetWidth:e}function zK(e,t,n,r,i){let a=(0,$.c)(17),o;a[0]!==e||a[1]!==n||a[2]!==t?(o=_n({connection:e,projectId:t,number:n}),a[0]=e,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promise`},a[4]=s):s=a[4];let[c,l]=B(o,s),u;a[5]===e?u=a[6]:(u=hr(e),a[5]=e,a[6]=u);let d;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(d={mode:`promise`},a[7]=d):d=a[7];let[,f]=B(u,d),p=Pc(),m;a[8]!==i||a[9]!==p||a[10]!==r||a[11]!==f||a[12]!==l?(m=async e=>{e.confirmation&&i&&i();let t;try{t=await l(e),t.archived&&(await f(),await p({to:`/`,replace:!0}))}catch{return}return t.archived&&r&&r(),t},a[8]=i,a[9]=p,a[10]=r,a[11]=f,a[12]=l,a[13]=m):m=a[13];let h;return a[14]!==c||a[15]!==m?(h={result:c,submit:m},a[14]=c,a[15]=m,a[16]=h):h=a[16],h}function BK(e){let t=(0,$.c)(24),{context:n,projectId:r,number:i,beforeLeave:a}=e,o=a===void 0?VK:a,{connection:s}=n,c=na(n),l=Yu(s),u;t[0]===l?u=t[1]:(u=Cd(l),t[0]=l,t[1]=u);let d=u,f;t[2]!==l||t[3]!==c?(f=c??(l.kind===`reading`?void 0:rd(l)),t[2]=l,t[3]=c,t[4]=f):f=t[4];let p=f,{submit:m}=zK(s,r,i),h;t[5]!==o||t[6]!==n||t[7]!==i||t[8]!==r||t[9]!==d||t[10]!==m||t[11]!==c?(h=()=>{if(!d||c)return;let e=Yl(d);PB.open({payload:{context:n,projectId:r,number:i,options:e,requestId:crypto.randomUUID(),beforeLeave:o}}),m({options:e})},t[5]=o,t[6]=n,t[7]=i,t[8]=r,t[9]=d,t[10]=m,t[11]=c,t[12]=h):h=t[12];let g=h,_=!d||!!c,v;t[13]!==g||t[14]!==_||t[15]!==c?(v=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,disabled:_,"aria-description":c,focusableWhenDisabled:!0,onClick:g,children:`Archive`}),t[13]=g,t[14]=_,t[15]=c,t[16]=v):v=t[16];let y=v;if(d&&!c||!p)return y;let b;t[17]===y?b=t[18]:(b=(0,Q.jsx)(Ze,{render:y}),t[17]=y,t[18]=b);let x;t[19]===p?x=t[20]:(x=(0,Q.jsx)(Yo,{children:p}),t[19]=p,t[20]=x);let S;return t[21]!==b||t[22]!==x?(S=(0,Q.jsxs)(ot,{children:[b,x]}),t[21]=b,t[22]=x,t[23]=S):S=t[23],S}function VK(){}function HK(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:PB,children:UK}),e[0]=t):t=e[0],t}function UK(e){return e&&(0,Q.jsx)(WK,{...e},e.requestId)}function WK(e){let t=(0,$.c)(34),{context:n,projectId:r,number:i,options:a,beforeLeave:o}=e,s=na(n),{result:c,submit:l}=zK(n.connection,r,i,GK,o),[u,d]=(0,Z.useState)(!1),f;t[0]===c?f=t[1]:(f=Bo(c)?c.value:void 0,t[0]=c,t[1]=f);let p=f?.plan,[m,h]=(0,Z.useState)(!1),g=c.waiting&&m,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Be,{label:`Checking the worktree and branches`}),t[2]=_):_=t[2];let v=_;if(Mi(c)&&(v=`Archiving could not be completed.`),p){let e;t[3]===p?e=t[4]:(e=$l(p),t[3]=p,t[4]=e),v=e}let y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(jz,{children:`Archive pull request?`}),t[5]=y):y=t[5];let b;t[6]===v?b=t[7]:(b=(0,Q.jsxs)(kz,{children:[y,(0,Q.jsx)(Mz,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:v})]}),t[6]=v,t[7]=b);let x;t[8]===c?x=t[9]:(x=Mi(c)?(0,Q.jsx)(`p`,{role:`alert`,className:`text-ui text-destructive`,children:ul(Ra(c.cause))}):null,t[8]=c,t[9]=x);let S;t[10]!==u||t[11]!==p?(S=p&&(p.dirty||p.unpushed)?(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(bn,{checked:u,onCheckedChange:d,id:`archive-discard-changes`}),(0,Q.jsx)(Qa,{htmlFor:`archive-discard-changes`,children:`I understand the risk of losing changes and commits`})]}):null,t[10]=u,t[11]=p,t[12]=S):S=t[12];let C;t[13]===g?C=t[14]:(C=(0,Q.jsx)(Nz,{disabled:g,children:`Cancel`}),t[13]=g,t[14]=C);let w=!!s||c.waiting||!p||(p.dirty||p.unpushed)&&!u,T;t[15]!==u||t[16]!==a||t[17]!==p||t[18]!==l||t[19]!==s?(T=()=>{p&&!s&&(h(!0),l({options:a,confirmation:{plan:p,discardChanges:u}}))},t[15]=u,t[16]=a,t[17]=p,t[18]=l,t[19]=s,t[20]=T):T=t[20];let E;t[21]!==g||t[22]!==w||t[23]!==T||t[24]!==s?(E=(0,Q.jsx)(ji,{pending:g,variant:`destructive`,disabled:w,"aria-description":s,onClick:T,children:`Archive pull request`}),t[21]=g,t[22]=w,t[23]=T,t[24]=s,t[25]=E):E=t[25];let D;t[26]!==E||t[27]!==C?(D=(0,Q.jsxs)(Az,{children:[C,E]}),t[26]=E,t[27]=C,t[28]=D):D=t[28];let O;return t[29]!==D||t[30]!==b||t[31]!==x||t[32]!==S?(O=(0,Q.jsxs)(Oz,{children:[b,x,S,D]}),t[29]=D,t[30]=b,t[31]=x,t[32]=S,t[33]=O):O=t[33],O}function GK(){return PB.close()}function KK(e,t,n,r){let i=(0,$.c)(12),a;i[0]!==e||i[1]!==n||i[2]!==t?(a=w({connection:e,projectId:t,number:n}),i[0]=e,i[1]=n,i[2]=t,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=B(a,o),l;i[5]!==n||i[6]!==r||i[7]!==c?(l=async e=>{let t=await c(e);ne(t)&&(r(),ks({title:`Merged #${n}`,type:`success`}))},i[5]=n,i[6]=r,i[7]=c,i[8]=l):l=i[8];let u;return i[9]!==s||i[10]!==l?(u={result:s,submit:l},i[9]=s,i[10]=l,i[11]=u):u=i[11],u}function qK(e){let t=(0,$.c)(27),{context:n,projectId:r,pull:i,review:a,label:o,showBlock:s,reason:c,className:l}=e,u=o===void 0?`Merge`:o,d=s===void 0||s,f=(0,Z.useId)(),p=na(n),m;t[0]!==i||t[1]!==c||t[2]!==a||t[3]!==p?(m=p??gu(sd(i,a),c),t[0]=i,t[1]=c,t[2]=a,t[3]=p,t[4]=m):m=t[4];let h=m,g;t[5]===l?g=t[6]:(g=Y(`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5`,l),t[5]=l,t[6]=g);let _=h!==void 0,v=h?f:void 0,y;t[7]!==n||t[8]!==r||t[9]!==i?(y=()=>void FB.open({payload:{context:n,projectId:r,number:i.number,headSha:i.headSha,headBranch:i.headBranch,baseBranch:i.baseBranch,methods:zc(i).map(JK),requestId:li()}}),t[7]=n,t[8]=r,t[9]=i,t[10]=y):y=t[10];let b;t[11]===h?b=t[12]:(b=h!==void 0&&(0,Q.jsx)(qg,{"aria-hidden":!0}),t[11]=h,t[12]=b);let x;t[13]!==u||t[14]!==_||t[15]!==v||t[16]!==y||t[17]!==b?(x=(0,Q.jsxs)(X,{size:`sm`,disabled:_,focusableWhenDisabled:!0,"aria-describedby":v,onClick:y,children:[b,u]}),t[13]=u,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x):x=t[18];let S;t[19]!==h||t[20]!==f||t[21]!==d?(S=h&&(0,Q.jsx)(`p`,{id:f,className:Y(`min-w-0 text-ui leading-4.5 text-muted-foreground`,!d&&`sr-only`),children:h}),t[19]=h,t[20]=f,t[21]=d,t[22]=S):S=t[22];let C;return t[23]!==S||t[24]!==g||t[25]!==x?(C=(0,Q.jsxs)(`div`,{className:g,children:[x,S]}),t[23]=S,t[24]=g,t[25]=x,t[26]=C):C=t[26],C}function JK(e){let{method:t}=e;return t}function YK(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:FB,children:XK}),e[0]=t):t=e[0],t}function XK(e){return e&&(0,Q.jsx)(ZK,{...e},e.requestId)}function ZK(e){let t=(0,$.c)(37),{context:n,projectId:r,number:i,headSha:a,headBranch:o,baseBranch:s,methods:c}=e,l=na(n),u=zc({mergeMethods:c}),[d,f]=(0,Z.useState)(u[0]?.method),{result:p,submit:m}=KK(n.connection,r,i,$K),h;t[0]===d?h=t[1]:(h=e=>e.method===d,t[0]=d,t[1]=h);let g=u.find(h),_=Oz,v;t[2]===i?v=t[3]:(v=(0,Q.jsxs)(jz,{children:[`Merge pull request #`,i,`?`]}),t[2]=i,t[3]=v);let y;t[4]===a?y=t[5]:(y=By(a),t[4]=a,t[5]=y);let b;t[6]!==s||t[7]!==o||t[8]!==y?(b=(0,Q.jsxs)(Mz,{className:`[overflow-wrap:anywhere]`,children:[o,` at `,y,` goes into `,s,` on GitHub. A merge cannot be undone.`]}),t[6]=s,t[7]=o,t[8]=y,t[9]=b):b=t[9];let x;t[10]!==v||t[11]!==b?(x=(0,Q.jsxs)(kz,{children:[v,b]}),t[10]=v,t[11]=b,t[12]=x):x=t[12];let S=u.length>1&&(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Q.jsx)(Ms,{htmlFor:`merge-method`,children:`Method`}),(0,Q.jsxs)(oa,{value:d??null,disabled:p.waiting,onValueChange:f,children:[(0,Q.jsx)(ni,{id:`merge-method`,"aria-label":`Merge method`,className:`w-full`,children:(0,Q.jsx)(ec,{children:g?.label})}),(0,Q.jsx)(Zi,{children:u.map(QK)})]})]}),C;t[13]===p?C=t[14]:(C=Mi(p)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-ui text-destructive`,children:sf(Ra(p.cause))}),t[13]=p,t[14]=C);let w;t[15]===p.waiting?w=t[16]:(w=(0,Q.jsx)(Nz,{disabled:p.waiting,children:`Cancel`}),t[15]=p.waiting,t[16]=w);let T=!!l||p.waiting||!g,E;t[17]!==g||t[18]!==a||t[19]!==m||t[20]!==l?(E=()=>{g&&!l&&m({method:g.method,headSha:a})},t[17]=g,t[18]=a,t[19]=m,t[20]=l,t[21]=E):E=t[21];let D=g?.label??`Merge`,O;t[22]!==p.waiting||t[23]!==E||t[24]!==D||t[25]!==T||t[26]!==l?(O=(0,Q.jsx)(ji,{pending:p.waiting,disabled:T,"aria-description":l,onClick:E,children:D}),t[22]=p.waiting,t[23]=E,t[24]=D,t[25]=T,t[26]=l,t[27]=O):O=t[27];let k;t[28]!==O||t[29]!==w?(k=(0,Q.jsxs)(Az,{children:[w,O]}),t[28]=O,t[29]=w,t[30]=k):k=t[30];let A;return t[31]!==_||t[32]!==k||t[33]!==x||t[34]!==S||t[35]!==C?(A=(0,Q.jsxs)(_,{children:[x,S,C,k]}),t[31]=_,t[32]=k,t[33]=x,t[34]=S,t[35]=C,t[36]=A):A=t[36],A}function QK(e){return(0,Q.jsx)(Ps,{value:e.method,children:e.label},e.method)}function $K(){return FB.close()}function eq(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(vz,{controller:jB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsxs)(xz,{children:[(0,Q.jsxs)(Sz,{children:[(0,Q.jsxs)(wz,{children:[`Walkthroughs for `,e.project.name]}),(0,Q.jsx)(Tz,{children:`Use the default writer or override it for this project. This choice applies to manual and automatic walkthroughs and their answers.`})]}),(0,Q.jsx)(ku,{project:e.project,...t,onSaved:tq},e.project.id)]})})}),t[0]=n,t[1]=r),r}function tq(){return jB.close()}function nq(e,t){return fs(t).filter(t=>{let n=e.getItem(t);return n!==null&&`isExpanded`in n&&n.isExpanded()})}function rq(e){let t=(0,$.c)(32),n=(0,Z.useId)(),r;t[0]===n?r=t[1]:(r=Vc(n),t[0]=n,t[1]=r);let i=r,a=Ot(E),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!0),[u,d]=(0,Z.useState)(null),f;t[2]!==u||t[3]!==e.filter||t[4]!==e.paths?(f=u?.pathsKey===e.paths.join(`\0`)&&u.filter===e.filter,t[2]=u,t[3]=e.filter,t[4]=e.paths,t[5]=f):f=t[5];let p=f;o&&!p&&s(!1);let m;t[6]!==i||t[7]!==a?(m=()=>e=>{if(e)return iq(e,a,i,d,e=>{l(e),s(!1)})},t[6]=i,t[7]=a,t[8]=m):m=t[8];let[h]=(0,Z.useState)(m),g=o&&p,_;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e&&l(!0),s(e)},t[9]=_):_=t[9];let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`}),t[10]=v):v=t[10];let y;t[11]!==i||t[12]!==e||t[13]!==a?(y=(0,Q.jsx)(`span`,{hidden:!0,ref:t=>{t&&a.set(i,Zn(e))}}),t[11]=i,t[12]=e,t[13]=a,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`div`,{ref:h,className:`flex min-h-0 flex-1 flex-col`}),t[15]=b):b=t[15];let x;t[16]===y?x=t[17]:(x=(0,Q.jsxs)(uH,{render:v,children:[y,b]}),t[16]=y,t[17]=x);let S;t[18]!==p||t[19]!==o||t[20]!==u?(S=o&&p&&u&&(0,Q.jsx)(`span`,{hidden:!0,ref:()=>{let{row:e}=u;return e.setAttribute(`aria-haspopup`,`menu`),e.setAttribute(`data-context-menu-open`,``),()=>{e.removeAttribute(`aria-haspopup`),e.removeAttribute(`data-context-menu-open`)}}}),t[18]=p,t[19]=o,t[20]=u,t[21]=S):S=t[21];let C;t[22]!==p||t[23]!==u||t[24]!==e.renderMenu||t[25]!==c?(C=u&&e.renderMenu(u.item,{finalFocus:p&&c?u.finalFocus:`none`,close:u.close},u.rename),t[22]=p,t[23]=u,t[24]=e.renderMenu,t[25]=c,t[26]=C):C=t[26];let w;return t[27]!==S||t[28]!==C||t[29]!==g||t[30]!==x?(w=(0,Q.jsxs)(Wt,{open:g,onOpenChange:_,children:[x,S,C]}),t[27]=S,t[28]=C,t[29]=g,t[30]=x,t[31]=w):w=t[31],w}function iq(e,t,n,r,i){let a=()=>Kt(t.get(n)),o=ad(a().owner),s=t.get(o),c=new Set(s.expanded),l=!a().filter&&s.document===a().selected&&!(document.activeElement instanceof HTMLInputElement),u=!0,d=!1,f=!1,p={selected:s.document,complete:s.document===a().selected},m=null,h,g,_=null,v=new Set;function y(e){let t=requestAnimationFrame(()=>{v.delete(t),u&&e()});v.add(t)}let b=new Ik({paths:a().paths,density:`default`,itemHeight:28,flattenEmptyDirectories:!0,initialExpansion:a().filter?`open`:`closed`,icons:Vk(a().links),unsafeCSS:`[data-icon-name="file-tree-icon-chevron"] { color: var(--trees-fg-muted); } [data-item-git-status]:not([data-item-git-status="ignored"]) > [data-item-section="content"] { color: inherit; } [data-context-menu-open] { outline: 1px solid var(--trees-fg-muted); outline-offset: -1px; border-radius: 4px; } [data-truncate-container] { --truncate-marker-background-color: var(--card); --truncate-marker-opacity: 100%; }`,gitStatus:a().gitStatus,search:!1,renaming:{onError:e=>{m=null,a().onInvalidName(e),queueMicrotask(()=>{u&&b.resetPaths(a().paths)})},onRename:e=>{f=!0;let t=m;m=null,(t?.path.replace(/\/$/,``)===e.sourcePath.replace(/\/$/,``)?a().onCreate(e.destinationPath,t.kind):a().onMove(e.sourcePath,e.destinationPath)).catch(()=>{u&&b.resetPaths(a().paths)})}},dragAndDrop:{canDrag:()=>!a().writeBlock&&(d=!0,queueMicrotask(()=>{d=!1}),!0),canDrop:({draggedPaths:e,target:t})=>!a().writeBlock&&Eo(e,t.directoryPath??``),onDropComplete:e=>{if(a().writeBlock)return;let t=a().onMove;ls(Sa(e.draggedPaths,e.target.directoryPath??``,(e,n)=>Ui({try:()=>t(e,n),catch:e=>new Rt(e)}))).catch(()=>{u&&b.resetPaths(a().paths)})}},renderRowDecoration:({item:e})=>{let t=a().links.find(t=>t.path===e.path);return t?{text:t.kind===`symlink`?`→ ${t.target??`?`}`:`submodule`,title:`Not followed`}:null},onSelectionChange:([e])=>{!d&&!f&&e&&m?.path.replace(/\/$/,``)!==e.replace(/\/$/,``)&&e!==a().selected&&a().onSelect(e)}});function x(){a().bindCollapseAll(()=>{d=!0,c.clear(),l=!1,p={selected:a().selected,complete:!0};let e=ad(a().owner.replace(/:search$/,``));t.set(e,{...t.get(e),expanded:[],document:a().selected,focused:null,anchor:null}),a().onFilterChange(``),b.resetPaths(a().paths,{initialExpandedPaths:[]}),d=!1}),a().bindRename(e=>a().onRequestRename(e))}function S(){let e=a().renameRequest;e&&!a().filter&&g!==e.nonce&&b.getItem(e.path)!==null&&(g=e.nonce,y(()=>{d=!0,b.startRenaming(e.path)&&e.onStart(),d=!1}))}function C(){let{creating:t}=a();if(!t||h===t.nonce)return;h=t.nonce;let n=ki(t.kind,t.folder,e=>b.getItem(e)!==null);m={path:n,kind:t.kind},b.add(n),b.startRenaming(n,{removeIfCanceled:!0}),y(()=>{t.onStart();let n=e.querySelector(`[data-slot="file-tree"]`)?.shadowRoot?.querySelector(`[data-item-rename-input]`);n instanceof HTMLInputElement&&n.focus()})}function w(){let e=nq(b,a().paths).map(e=>e.replace(/\/$/,``));e.length&&!a().filter&&a().onExpand(e)}function T(){a().onContentHeight?.(b.getVisibleCount()*b.getItemHeight())}function E(){if(m)return;let{selected:e}=a(),t=a().paths;p.selected!==e&&(p={selected:e,complete:!1});let n=Ru(t.flatMap(e=>{let t=a().kinds.get(e);return t===void 0?[]:[{path:e,kind:t}]}),new Set([...nq(b,t),...c]),new Set(fs(t).filter(e=>b.getItem(e)!==null))).map(e=>`${e}/`);d=!0;{let r=p.complete?[]:Ji(e);b.resetPaths(t,{initialExpandedPaths:a().filter?fs(t):[...new Set([...n,...r])]});for(let e of c)b.getItem(e)!==null&&c.delete(e);let i=b.getItem(e);!p.complete&&i&&!i.isDirectory()&&(i.select(),p.complete=!0)}if(d=!1,l){d=!0;for(let e of s.selected)b.getItem(e)?.select();s.focused&&b.getItem(s.focused)&&b.focusPath(s.focused),s.anchor&&b.getItem(s.anchor)&&(b.scrollToPath(s.anchor,{focus:!1,offset:`top`}),l=!1),d=!1}w()}let D;function O(){let e=a();x(),D&&D.paths.join(`\0`)===e.paths.join(`\0`)&&D.selected===e.selected||E(),Bn(D?.gitStatus,e.gitStatus)||b.setGitStatus(e.gitStatus),Bn(D?.links,e.links)||b.setIcons(Vk(e.links)),D=e,C(),S(),T()}let k=b.onMutation(`move`,()=>{f=!1}),A=t.subscribe(n,O),j=b.subscribe(()=>{T(),d||w()});function M(e){let t=m;if(!t)return;let n=e.composedPath().find(e=>e instanceof HTMLInputElement&&e.hasAttribute(`data-item-rename-input`));n?.value.trim()===``?(m=null,y(E)):n?.value===Xa(t.path)&&(m=null,a().onCreate(t.path,t.kind).catch(()=>{u&&b.resetPaths(a().paths)}))}function N(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-item-path`)),n=t?.dataset.itemPath,o=n===void 0?null:b.getItem(n);if(!t||!n||!o||t.querySelector(`[data-item-rename-input]`))return null;let s={restore:!0},{paths:c,filter:l}=a();return r({row:t,pathsKey:c.join(`\0`),filter:l,finalFocus:()=>s.restore&&t.isConnected&&t.dataset.itemPath===n?t:null,close:e=>{s.restore=e,i(e)},rename:()=>a().onRequestRename(n),item:{path:n,name:Xa(n),kind:o.isDirectory()?`directory`:`file`}}),t}function P(e){if(e.key===`Escape`&&(_=null),e.key===`F2`&&!m&&!a().writeBlock){let t=b.getFocusedPath();t&&(e.preventDefault(),e.stopPropagation(),a().onRequestRename(t))}e.key===`Enter`&&M(e),e.key===`Escape`&&m&&(m=null,y(E))}function F(e){if(e.button!==0||!e.altKey&&(e.ctrlKey||e.metaKey||e.shiftKey))return;let t=e.composedPath();if(t.some(e=>e instanceof HTMLInputElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-item-path`))?.dataset.itemPath;if(!n||a().kinds.get(n)!==`file`)return;let r=b.getItem(n);if(r&&m?.path!==n){e.preventDefault(),e.stopPropagation(),d=!0;for(let e of b.getSelectedPaths())e!==n&&b.getItem(e)?.deselect();r.select(),d=!1,a().onSelect(n,e.altKey)}}function I(){return!!b.getFileTreeContainer()?.shadowRoot?.querySelector(`[data-is-scrolling]`)}function L(e){let t=N(e);if(!t){e.stopPropagation();return}if(!(e instanceof MouseEvent)||e.button===2||!I())return;e.preventDefault(),e.stopPropagation();let n=t.dataset.itemPath;_=t;let r=()=>{_===t&&(!t.isConnected||t.dataset.itemPath!==n||b.getFocusedPath()!==n?_=null:I()?y(r):(_=null,t.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,composed:!0}))))};y(r)}function R(t){t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(_=null)}return e.addEventListener(`keydown`,P,!0),e.addEventListener(`click`,F,!0),e.addEventListener(`blur`,M,!0),e.addEventListener(`contextmenu`,L,!0),e.addEventListener(`touchstart`,L,!0),e.addEventListener(`focusout`,R,!0),b.render({containerWrapper:e}),b.getFileTreeContainer()?.setAttribute(`class`,`min-h-0 flex-1`),b.getFileTreeContainer()?.setAttribute(`data-slot`,`file-tree`),b.getFileTreeContainer()?.setAttribute(`aria-label`,`Worktree files`),O(),()=>{let n=b.getFileTreeContainer(),r=n?.getBoundingClientRect().top??0,i=[...n?.shadowRoot?.querySelectorAll(`[data-item-path]`)??[]].find(e=>e.getBoundingClientRect().bottom>r)?.dataset.itemPath??null;t.set(o,{expanded:[...new Set([...nq(b,a().paths),...c])],selected:b.getSelectedPaths(),focused:b.getFocusedPath(),anchor:i,document:a().selected}),u=!1;for(let e of v)cancelAnimationFrame(e);A(),j(),k(),a().bindRename(()=>void 0),a().bindCollapseAll(()=>void 0),e.removeEventListener(`keydown`,P,!0),e.removeEventListener(`click`,F,!0),e.removeEventListener(`blur`,M,!0),e.removeEventListener(`contextmenu`,L,!0),e.removeEventListener(`touchstart`,L,!0),e.removeEventListener(`focusout`,R,!0),b.cleanUp(),e.replaceChildren()}}function aq(e,t){t.close(e!==`rename`&&e!==`new-file`&&e!==`new-folder`&&e!==`open-to-side`),e===`rename`?queueMicrotask(t.rename):e===`new-file`?t.onStartCreate(`file`,t.path):e===`new-folder`?t.onStartCreate(`directory`,t.path):e===`open`||e===`open-file`?t.onOpenFile(t.path):e===`open-to-side`?t.onOpenToSide(t.path):e===`open-diff`?t.onOpenDiff(t.path):e===`timeline`?t.onOpenTimeline(t.path):e===`duplicate`?t.onDuplicate(t.path):e===`pin`?t.onTogglePinned(t.path):e===`hide`?t.onSetHidden(t.hiddenEntry??t.path,t.hiddenEntry===null):e===`copy-relative`?Zt(t.path,`relative path`):e===`copy-full`?Zt(`${t.worktreePath.replace(/\/$/,``)}/${t.path}`,`full path`):t.onTrash(t.path)}var oq=Oe(Ns());function sq(e,t,n){let r=(0,$.c)(7),i=n===void 0||n,a;r[0]!==e||r[1]!==i||r[2]!==t?(a=i?oo({connection:e,scope:t}):oq,r[0]=e,r[1]=i,r[2]=t,r[3]=a):a=r[3];let o=a,s=Ot(o),c=l(o),u;return r[4]!==s||r[5]!==c?(u={result:s,refresh:c},r[4]=s,r[5]=c,r[6]=u):u=r[6],u}var cq={"new-file":$h,"new-folder":dg,rename:ao,duplicate:zh,open:Yh,"open-file":Yh,"open-to-side":Lh,"open-diff":Zh,timeline:h_,pin:s_,hide:Gh,"copy-relative":Bs,"copy-full":Bs,trash:N_};function lq(e){let t=(0,$.c)(9),{path:n,finalFocus:r,actions:i,hidden:a,writeBlock:o,onAction:s}=e,c=`${n} actions`,l;t[0]!==i||t[1]!==a||t[2]!==s||t[3]!==o?(l=(0,Q.jsx)(dq,{actions:i,hidden:a,onAction:s,writeBlock:o}),t[0]=i,t[1]=a,t[2]=s,t[3]=o,t[4]=l):l=t[4];let u;return t[5]!==r||t[6]!==c||t[7]!==l?(u=(0,Q.jsx)(dH,{"aria-label":c,className:`w-max max-w-[calc(100vw-2rem)] whitespace-nowrap`,onKeyDownCapture:uq,finalFocus:r,children:l}),t[5]=r,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function uq(e){if(e.key!==`ArrowDown`||e.target!==e.currentTarget)return;let t=e.currentTarget.querySelector(`[role="menuitem"]`);t instanceof HTMLElement&&(e.preventDefault(),e.stopPropagation(),t.focus())}function dq({actions:e,hidden:t,onAction:n,writeBlock:r}){return e.map(e=>(0,Q.jsx)(fq,{action:e,onAction:n,hidden:t,writeBlock:r},e.id))}function fq(e){let t=(0,$.c)(17),{action:n,onAction:r,hidden:i,writeBlock:a}=e,o=[`new-file`,`new-folder`,`rename`,`duplicate`,`pin`,`hide`,`trash`].includes(n.id)?a:void 0,s=n.id===`hide`&&i?qh:cq[n.id],c;t[0]===n.id?c=t[1]:(c=(n.id===`hide`||n.id===`copy-relative`||n.id===`trash`)&&(0,Q.jsx)(we,{}),t[0]=n.id,t[1]=c);let l=!!o,u=n.id===`trash`,d;t[2]!==n.id||t[3]!==r?(d=()=>r(n.id),t[2]=n.id,t[3]=r,t[4]=d):d=t[4];let f;t[5]===s?f=t[6]:(f=(0,Q.jsx)(s,{}),t[5]=s,t[6]=f);let p;t[7]!==n.label||t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Q.jsxs)(dn,{disabled:l,"aria-description":o,destructive:u,onSelect:d,children:[f,n.label]}),t[7]=n.label,t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==c||t[15]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[c,p]}),t[14]=c,t[15]=p,t[16]=m):m=t[16],m}function pq(e){let t=(0,$.c)(7),{label:n,count:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`flex-1`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r===void 0?null:(0,Q.jsx)(`span`,{className:`tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`h3`,{className:`flex h-7 shrink-0 items-center gap-1 px-6 text-2xs font-medium text-muted-foreground`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}var mq={added:`A`,deleted:`D`,modified:`M`,renamed:`R`,untracked:`U`},hq={added:`text-add-fg`,deleted:`text-del-fg`,modified:`text-brand`,renamed:`text-brand`,untracked:`text-add-fg`},gq={resolved:`Not followed`,loading:``,missing:`Missing`,unavailable:`Listing unavailable · Open as file`};function _q(e){let t=(0,$.c)(27),{entries:n,expanded:r,onExpand:i,onRetry:a,renderDirectory:o,statuses:s,selected:c,onOpen:l,onUnpin:u,writeBlock:d,menuFor:f}=e,[p,m]=(0,Z.useState)(!1);if(n.length===0)return null;let h,g,_,v,y;if(t[0]!==n||t[1]!==r||t[2]!==f||t[3]!==i||t[4]!==l||t[5]!==a||t[6]!==u||t[7]!==p||t[8]!==o||t[9]!==c||t[10]!==s||t[11]!==d){let e=new Map(s.flatMap(vq));_=`Pinned files`,v=`shrink-0 pt-1.5 pb-1`,t[17]===n.length?y=t[18]:(y=(0,Q.jsx)(pq,{label:`Pinned`,count:n.length}),t[17]=n.length,t[18]=y),h=`px-4 [--trees-item-height:--spacing(7)]`,g=n.map(t=>{let{path:n}=t,s=t.state===`resolved`&&t.entry.kind===`directory`,h=r.includes(n),g=t.state===`unavailable`||t.state===`resolved`&&(t.entry.kind===`file`||s),_=n.lastIndexOf(`/`)+1,v=f(s?`${n}/`:n);return(0,Q.jsxs)(Wt,{onOpenChange:e=>{e&&m(!1)},children:[(0,Q.jsxs)(uH,{render:(0,Q.jsx)(`li`,{className:`flex flex-wrap items-center gap-0.5`}),children:[(0,Q.jsx)(fr,{text:n,className:`min-w-0`,renderTrigger:(r,a)=>(0,Q.jsxs)(`button`,{type:`button`,"data-file-tree-row":``,"aria-label":t.state===`unavailable`?`Open ${n} as file`:n,"aria-current":n===c?`page`:void 0,"aria-expanded":s?h:void 0,disabled:!g,className:Y(`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 text-left hover:bg-accent`,n===c&&`bg-accent`),onClick:e=>s?i(n,!h):l(n,e.altKey),children:[s?(0,Q.jsx)(Gk,{expanded:h,className:`size-4 shrink-0`}):(0,Q.jsx)(Gk,{path:n,className:`size-4 shrink-0`}),r,_>0&&a(n.slice(0,_-1),`shrink-[100] text-muted-foreground`),e.has(n)&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:Y(`ml-auto shrink-0 pl-1 font-mono text-xs font-medium`,e.get(n)?.tone),children:e.get(n)?.mark})]}),children:n.slice(_)}),(!g||t.state===`unavailable`)&&gq[t.state]&&(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:gq[t.state]}),t.state===`unavailable`&&(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:a,children:`Try again`}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":`Unpin ${n}`,disabled:!!d,"aria-description":d,onClick:()=>u(n)}),children:(0,Q.jsx)(l_,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Unpin ${n}`})]}),s&&h&&(0,Q.jsx)(`div`,{className:`w-full`,children:o(n)})]}),(0,Q.jsx)(dH,{finalFocus:p?`none`:`trigger`,children:(0,Q.jsx)(dq,{writeBlock:d,actions:v.actions,hidden:v.hidden,onAction:e=>{e===`open-to-side`&&(0,th.flushSync)(()=>m(!0)),v.onAction(e)}})})]},n)}),t[0]=n,t[1]=r,t[2]=f,t[3]=i,t[4]=l,t[5]=a,t[6]=u,t[7]=p,t[8]=o,t[9]=c,t[10]=s,t[11]=d,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y}else h=t[12],g=t[13],_=t[14],v=t[15],y=t[16];let b;t[19]!==h||t[20]!==g?(b=(0,Q.jsx)(`ul`,{className:h,children:g}),t[19]=h,t[20]=g,t[21]=b):b=t[21];let x;return t[22]!==_||t[23]!==v||t[24]!==y||t[25]!==b?(x=(0,Q.jsxs)(`section`,{"aria-label":_,className:v,children:[y,b]}),t[22]=_,t[23]=v,t[24]=y,t[25]=b,t[26]=x):x=t[26],x}function vq(e){let t=mq[e.status];return t===void 0?[]:[[e.path,{mark:t,tone:hq[e.status]??``}]]}function yq(e){let t=(0,$.c)(3),{connection:n}=e.context,r=`${n.environmentId}:${e.scope.projectId}:${e.scope.worktreeId}`,i;return t[0]!==e||t[1]!==r?(i=(0,Q.jsx)(bq,{...e},r),t[0]=e,t[1]=r,t[2]=i):i=t[2],i}function bq(e){let t=(0,$.c)(99),{scope:n,context:r,worktreePath:i,selected:a,onOpen:o,onMoved:s,onTrashed:c,sideLabel:l,actionsTarget:u}=e,{connection:d}=r,f=na(r),p=LR(d,n,``),m=yd(d,n),h=Mi(m.result)?Ra(m.result.cause):void 0,[g,_]=(0,Z.useState)(),[v,y]=(0,Z.useState)(),[b,x]=(0,Z.useState)(null),S=de(qr(iB(n,d))),C=KB(d,n.projectId),w=wB(d,n.projectId),T=YB(d,n.projectId),E=TB(d,n.projectId),D=`${d.environmentId}:${n.projectId}:${n.worktreeId}`,O=Pl(D),{showHidden:k,query:A,requested:j,pinnedExpanded:M}=O.state,N;t[0]===A?N=t[1]:(N=A.trim(),t[0]=A,t[1]=N);let P=N!==``,F=sq(d,n,P),I;t[2]===O?I=t[3]:(I=e=>O.set(t=>({...t,showHidden:e})),t[2]=O,t[3]=I);let L=I,R;t[4]===O?R=t[5]:(R=e=>O.set(t=>({...t,query:e})),t[4]=O,t[5]=R);let z=R,B;t[6]===O?B=t[7]:(B=e=>O.set(t=>{let n=e(t.requested);return n===t.requested?t:{...t,requested:n}}),t[6]=O,t[7]=B);let V=B,H=A===``?`Collapse all`:`Clear search and collapse all`,U;t[8]!==T||t[9]!==j||t[10]!==a?(U=zq(zq(zq(j,iu(T.map(Rq))),[``]),Lc(a)),t[8]=T,t[9]=j,t[10]=a,t[11]=U):U=t[11];let W=zR(d,n,U),G=[p,...W.results.flatMap(Lq)],K=Su(Jd(G),G,a),q=P?cu(cl(de(qr(F.result))?.paths??[],C,k),A):[],ee=zq(q,q.flatMap(Fq)),J=[...K],te=new Map(J.map(Pq));for(let e of ee){if(te.has(e))continue;let t=e.endsWith(`/`)?`directory`:`file`;J.push({path:e,kind:t}),te.set(e,t)}let ne=P?ee:J.map(Nq),re=cl(ne,C,k),ie;t[12]===W.results?ie=t[13]:(ie=W.results.filter(Mi),t[12]=W.results,t[13]=ie);let ae=ie,oe=P?[]:G.flatMap(Mq),se=[{path:``,status:`loaded`,entries:p.entries},...W.states],ce=Zl(cl(T,C,k),se),le=[...J.filter(jq).map(Aq),...(S?.changes??[]).flatMap(kq).map(Oq)],ue=new Set((S?.changes??[]).map(Dq)),fe=new Set(J.filter(Eq).map(Tq)),pe;t[14]===o?pe=t[15]:(pe=(e,t)=>o({kind:`file`,path:e},{toSide:t!==void 0&&t}),t[14]=o,t[15]=pe);let me=pe,he=e=>m.duplicate(e,vi(e,e=>te.has(e)),me),ge=BR(),_e;t[16]!==he||t[17]!==m.result.waiting||t[18]!==a||t[19]!==f?(_e=()=>{!f&&!m.result.waiting&&he(a)},t[16]=he,t[17]=m.result.waiting,t[18]=a,t[19]=f,t[20]=_e):_e=t[20];let ve=ge&&fe.has(a),ye;t[21]===ve?ye=t[22]:(ye={enabled:ve,ignoreInputs:!0},t[21]=ve,t[22]=ye),Hu(ou.duplicateFile,_e,ye);let be=(e,t)=>{let n=t!==void 0&&t,r=te.get(e);r===`symlink`||r===`submodule`?o({kind:`file`,path:e},{toSide:n}):r===`file`&&me(e,n)},{collapseAll:xe,renameFile:Se,bindCollapseAll:Ce,bindRename:we}=il(D),Te=e=>{let t=eu(e,C),n=J.find(t=>Wc(t.path)===Wc(e));return{hidden:t!==null,actions:As(n,{changed:ue.has(e),openToSideLabel:l,hiddenEntry:t,ownHidden:t===Wc(e),hiddenName:t?.replace(/\/$/,``).split(`/`).at(-1)??``,pinned:n?.kind===`file`||n?.kind===`directory`?T.includes(Wc(e)):void 0}),run:(n,r,a)=>aq(n,{path:e,hiddenEntry:t,worktreePath:i,close:r,rename:a,onStartCreate:(e,t)=>{m.result.waiting||(m.reset(),_({kind:e,folder:t,nonce:Date.now()}))},onOpenFile:e=>o({kind:`file`,path:e}),onOpenToSide:e=>me(e,!0),onOpenDiff:e=>o({kind:`change`,path:e}),onOpenTimeline:e=>o({kind:`timeline`,path:e}),onSetHidden:(e,t)=>as(w.submit({path:e,hidden:t})),onTogglePinned:e=>as(E.submit({path:e,pinned:!T.includes(Wc(e))})),onTrash:e=>{m.reset(),x(e)},onDuplicate:e=>{m.result.waiting||(m.reset(),he(e))}})}},Ee;t[23]!==m||t[24]!==z||t[25]!==V||t[26]!==f?(Ee=e=>{f||(m.reset(),V(t=>zq(t,Lc(e))),z(``),y({path:e,nonce:Date.now()}))},t[23]=m,t[24]=z,t[25]=V,t[26]=f,t[27]=Ee):Ee=t[27];let De;t[28]!==m||t[29]!==o||t[30]!==f?(De=(e,t)=>f?Promise.reject(Error(f)):m.create(e,t,e=>o({kind:`file`,path:e})),t[28]=m,t[29]=o,t[30]=f,t[31]=De):De=t[31];let Oe;t[32]!==m||t[33]!==s||t[34]!==V||t[35]!==f?(Oe=(e,t)=>f?Promise.reject(Error(f)):m.move(e,t,(e,t)=>{V(n=>[...new Set(n.map(n=>bd(n,e,t)))]),s(e,t)}),t[32]=m,t[33]=s,t[34]=V,t[35]=f,t[36]=Oe):Oe=t[36];let ke;t[37]===V?ke=t[38]:(ke=e=>V(t=>zq(t,e)),t[37]=V,t[38]=ke);let Ae={owner:P?`${D}:search`:D,filter:P?A:``,onFilterChange:z,paths:re,kinds:te,links:J.filter(wq),creating:g&&!f?{...g,onStart:()=>_(void 0)}:void 0,writeBlock:f,renameRequest:v&&!f?{...v,onStart:()=>y(void 0)}:void 0,onRequestRename:Ee,onCreate:De,onMove:Oe,gitStatus:le,selected:a,bindRename:we,bindCollapseAll:Ce,onInvalidName:Cq,renderMenu:(e,t,n)=>{let r=e.kind===`directory`&&!e.path.endsWith(`/`)?`${e.path}/`:e.path,i=Te(r);return(0,Q.jsx)(lq,{path:r,finalFocus:t.finalFocus,actions:i.actions,hidden:i.hidden,writeBlock:f,onAction:e=>i.run(e,t.close,n)},r)},onExpand:ke,onSelect:be},je;t[39]===z?je=t[40]:(je=e=>z(e.target.value),t[39]=z,t[40]=je);let Me;t[41]!==A||t[42]!==je?(Me=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 px-2 pt-2`,children:(0,Q.jsx)(ei,{"aria-label":`Search files`,placeholder:`Search...`,value:A,onChange:je,className:`h-7 w-auto min-w-0 flex-1`})}),t[41]=A,t[42]=je,t[43]=Me):Me=t[43];let Pe;t[44]!==u||t[45]!==xe||t[46]!==H||t[47]!==m.result.waiting||t[48]!==f?(Pe=u&&(0,th.createPortal)((0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Wt,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,"aria-label":`Create file or folder`,disabled:m.result.waiting||!!f,"aria-description":f}),children:(0,Q.jsx)(d_,{className:`text-muted-foreground`})})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:f??`Create file or folder`})]}),(0,Q.jsxs)(Ne,{align:`end`,children:[(0,Q.jsxs)(dn,{disabled:!!f,"aria-description":f,onSelect:()=>_({kind:`file`,folder:``,nonce:Date.now()}),children:[(0,Q.jsx)($h,{}),`New file`]}),(0,Q.jsxs)(dn,{disabled:!!f,"aria-description":f,onSelect:()=>_({kind:`directory`,folder:``,nonce:Date.now()}),children:[(0,Q.jsx)(dg,{}),`New folder`]})]})]}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,"aria-label":H,onClick:()=>xe()}),children:(0,Q.jsx)(zg,{className:`text-muted-foreground`})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:H})]})]}),u),t[44]=u,t[45]=xe,t[46]=H,t[47]=m.result.waiting,t[48]=f,t[49]=Pe):Pe=t[49];let Fe;t[50]!==O||t[51]!==V?(Fe=(e,t)=>{O.set(n=>({...n,pinnedExpanded:t?zq(n.pinnedExpanded,[e]):n.pinnedExpanded.filter(t=>t!==e)})),t&&V(t=>zq(t,[e]))},t[50]=O,t[51]=V,t[52]=Fe):Fe=t[52];let Ie;t[53]===W?Ie=t[54]:(Ie=()=>W.retry(),t[53]=W,t[54]=Ie);let Le;t[55]===E?Le=t[56]:(Le=e=>as(E.submit({path:e,pinned:!1})),t[55]=E,t[56]=Le);let Re;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Q.jsx)(pq,{label:`All files`}),t[57]=Re):Re=t[57];let ze;t[58]!==F||t[59]!==P?(ze=P&&Mi(F.result)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`px-6 py-2 text-xs`,children:[`Could not search files.`,(0,Q.jsx)(X,{variant:`link`,size:`xs`,onClick:()=>F.refresh(),children:`Try again`})]}),t[58]=F,t[59]=P,t[60]=ze):ze=t[60];let Be=b!==null,Ve;t[61]===m.result.waiting?Ve=t[62]:(Ve=e=>{!e&&!m.result.waiting&&x(null)},t[61]=m.result.waiting,t[62]=Ve);let He;t[63]===b?He=t[64]:(He=(0,Q.jsxs)(jz,{children:[`Move `,b,` to the trash?`]}),t[63]=b,t[64]=He);let Ue=b!=null&&ue.has(b)?`This is part of the agent’s changes. Deleting it changes what you are reviewing, and the agent may write it again. You can restore it from the system trash.`:`You can restore it from the system trash. This changes the files in your worktree.`,We;t[65]===Ue?We=t[66]:(We=(0,Q.jsx)(Mz,{children:Ue}),t[65]=Ue,t[66]=We);let Ge;t[67]!==He||t[68]!==We?(Ge=(0,Q.jsxs)(kz,{children:[He,We]}),t[67]=He,t[68]=We,t[69]=Ge):Ge=t[69];let Ke;t[70]===m.result.waiting?Ke=t[71]:(Ke=(0,Q.jsx)(Nz,{disabled:m.result.waiting,children:`Cancel`}),t[70]=m.result.waiting,t[71]=Ke);let qe=m.result.waiting||!!f,Je;t[72]!==b||t[73]!==m||t[74]!==c||t[75]!==V?(Je=()=>{b&&m.trash(b,()=>{x(null),V(e=>e.filter(e=>!ed(e,b))),c(b)})},t[72]=b,t[73]=m,t[74]=c,t[75]=V,t[76]=Je):Je=t[76];let Ye;t[77]!==qe||t[78]!==Je||t[79]!==f?(Ye=(0,Q.jsx)(X,{variant:`destructive`,disabled:qe,"aria-description":f,onClick:Je,children:`Move to trash`}),t[77]=qe,t[78]=Je,t[79]=f,t[80]=Ye):Ye=t[80];let Xe;t[81]!==Ke||t[82]!==Ye?(Xe=(0,Q.jsxs)(Az,{children:[Ke,Ye]}),t[81]=Ke,t[82]=Ye,t[83]=Xe):Xe=t[83];let Qe=h!==void 0&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:Td(h)}),$e;t[84]!==Ge||t[85]!==Xe||t[86]!==Qe?($e=(0,Q.jsxs)(Oz,{children:[Ge,Xe,Qe]}),t[84]=Ge,t[85]=Xe,t[86]=Qe,t[87]=$e):$e=t[87];let et;t[88]!==Be||t[89]!==Ve||t[90]!==$e?(et=(0,Q.jsx)(Ez,{open:Be,onOpenChange:Ve,children:$e}),t[88]=Be,t[89]=Ve,t[90]=$e,t[91]=et):et=t[91];let tt;t[92]===E.result?tt=t[93]:(tt=Mi(E.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-t px-3 py-2 text-xs text-destructive`,children:Wd(Ra(E.result.cause))}),t[92]=E.result,t[93]=tt);let nt;t[94]===w.result?nt=t[95]:(nt=Mi(w.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-t px-3 py-2 text-xs text-destructive`,children:Wd(Ra(w.result.cause))}),t[94]=w.result,t[95]=nt);let rt;return t[96]!==W||t[97]!==ae.length?(rt=ae.length>0&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Some folders could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:()=>W.retry(),children:`Try again`})]}),t[96]=W,t[97]=ae.length,t[98]=rt):rt=t[98],(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Me,Pe,(0,Q.jsx)(_q,{entries:ce,expanded:M,onExpand:Fe,onRetry:Ie,renderDirectory:e=>(0,Q.jsx)(Bq,{prefix:`${e}/`,input:Ae}),statuses:le,selected:a,onOpen:me,writeBlock:f,onUnpin:Le,menuFor:e=>{let t=Te(e);return{actions:ce.some(t=>t.path===Wc(e)&&t.state===`resolved`)?t.actions:[],hidden:t.hidden,onAction:n=>t.run(n,Sq,()=>Se(e))}}}),(0,Q.jsxs)(`section`,{"aria-label":`All files`,className:`flex min-h-0 flex-1 flex-col pt-1`,children:[Re,ze,P&&Bo(F.result)&&!F.result.waiting&&q.length===0&&(0,Q.jsx)(`p`,{role:`status`,className:`px-6 py-2 text-xs text-muted-foreground`,children:`No files match your search.`}),(0,Q.jsx)(rq,{...Ae},Ae.owner),oe.map(xq),C.size>0&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 px-3.5 py-2 text-2xs text-muted-foreground`,children:[(0,Q.jsx)(Gh,{className:`size-3.5 shrink-0`}),(0,Q.jsx)(`span`,{children:dl(C,e=>te.get(e)??te.get(`${e}/`))}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(X,{variant:`link`,size:`xs`,onClick:()=>L(!k),children:k?`Hide`:`Show`})]})]}),et,h!==void 0&&!b&&(0,Q.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:Td(h)}),tt,nt,rt]})}function xq(e){return(0,Q.jsx)(`p`,{role:`status`,className:`shrink-0 px-3.5 py-2 text-2xs text-muted-foreground`,children:e},e)}function Sq(){}function Cq(e){return ks({title:`Invalid name`,description:e,type:`error`})}function wq(e){return e.kind===`symlink`||e.kind===`submodule`}function Tq(e){return e.path}function Eq(e){return e.kind===`file`}function Dq(e){return e.path}function Oq(e){return{path:zt(e),status:Id(e)}}function kq(e){return e.comparisons}function Aq(e){return{path:e.path,status:`ignored`}}function jq(e){return e.ignored}function Mq(e){return Ee(Oa(zd(e)))}function Nq(e){return e.path}function Pq(e){return[e.path,e.kind]}function Fq(e){return Lc(e).map(Iq)}function Iq(e){return`${e}/`}function Lq(e){return Ee(qr(e))}function Rq(e){return{path:e,pinned:!0,hidden:!1}}function zq(e,t){let n=[...new Set([...e,...t])].sort();return n.length===e.length&&n.every((t,n)=>t===e[n])?e:n}function Bq(e){let t=(0,$.c)(73),{prefix:n,input:r}=e,[i,a]=(0,Z.useState)(0),o;t[0]===n.length?o=t[1]:(o=e=>e.slice(n.length),t[0]=n.length,t[1]=o);let s=o,c,l,u,d,f,p,m,h,g;if(t[2]!==i||t[3]!==r||t[4]!==n||t[5]!==s){let e;t[15]===n?e=t[16]:(e=e=>e.startsWith(n)&&e!==n,t[15]=n,t[16]=e);let o=r.paths.filter(e);h=`flex max-h-52 min-h-0 flex-col pl-1.5`,t[17]===i?g=t[18]:(g={height:i},t[17]=i,t[18]=g),c=rq,l=r.owner,u=r,d=a,f=`${r.owner}:pin:${n}`,p=o.map(s);let _;t[19]!==r.kinds||t[20]!==s?(_=e=>{let t=r.kinds.get(e);return t===void 0?[]:[[s(e),t]]},t[19]=r.kinds,t[20]=s,t[21]=_):_=t[21],m=new Map(o.flatMap(_)),t[2]=i,t[3]=r,t[4]=n,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;if(t[22]!==r.links||t[23]!==n||t[24]!==s){let e;t[26]===n?e=t[27]:(e=e=>e.path.startsWith(n),t[26]=n,t[27]=e);let i;t[28]===s?i=t[29]:(i=e=>({...e,path:s(e.path)}),t[28]=s,t[29]=i),_=r.links.filter(e).map(i),t[22]=r.links,t[23]=n,t[24]=s,t[25]=_}else _=t[25];let v;if(t[30]!==r.gitStatus||t[31]!==n||t[32]!==s){let e;t[34]===n?e=t[35]:(e=e=>e.path.startsWith(n),t[34]=n,t[35]=e);let i;t[36]===s?i=t[37]:(i=e=>({...e,path:s(e.path)}),t[36]=s,t[37]=i),v=r.gitStatus.filter(e).map(i),t[30]=r.gitStatus,t[31]=n,t[32]=s,t[33]=v}else v=t[33];let y;t[38]!==r.selected||t[39]!==n||t[40]!==s?(y=r.selected.startsWith(n)?s(r.selected):``,t[38]=r.selected,t[39]=n,t[40]=s,t[41]=y):y=t[41];let b,x,S,C,w;t[42]!==r||t[43]!==n?(b=e=>r.onRequestRename(`${n}${e}`),x=(e,t)=>r.onCreate(`${n}${e}`,t),S=(e,t)=>r.onMove(`${n}${e}`,`${n}${t}`),C=(e,t)=>r.onSelect(`${n}${e}`,t),w=e=>r.onExpand(e.map(e=>`${n}${e}`)),t[42]=r,t[43]=n,t[44]=b,t[45]=x,t[46]=S,t[47]=C,t[48]=w):(b=t[44],x=t[45],S=t[46],C=t[47],w=t[48]);let T;t[49]!==r||t[50]!==n?(T=(e,t,i)=>r.renderMenu({...e,path:`${n}${e.path}`},t,i),t[49]=r,t[50]=n,t[51]=T):T=t[51];let E;t[52]!==c||t[53]!==_||t[54]!==v||t[55]!==y||t[56]!==b||t[57]!==x||t[58]!==S||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==l||t[63]!==u||t[64]!==d||t[65]!==f||t[66]!==p||t[67]!==m?(E=(0,Q.jsx)(c,{...u,onContentHeight:d,owner:f,paths:p,kinds:m,links:_,gitStatus:v,selected:y,creating:void 0,renameRequest:void 0,onRequestRename:b,onCreate:x,onMove:S,onSelect:C,onExpand:w,bindRename:Hq,bindCollapseAll:Vq,renderMenu:T},l),t[52]=c,t[53]=_,t[54]=v,t[55]=y,t[56]=b,t[57]=x,t[58]=S,t[59]=C,t[60]=w,t[61]=T,t[62]=l,t[63]=u,t[64]=d,t[65]=f,t[66]=p,t[67]=m,t[68]=E):E=t[68];let D;return t[69]!==E||t[70]!==h||t[71]!==g?(D=(0,Q.jsx)(`div`,{className:h,style:g,children:E}),t[69]=E,t[70]=h,t[71]=g,t[72]=D):D=t[72],D}function Vq(){}function Hq(){}var Uq=cz(),Wq={toggle(){Uq.toggle()},close(){Uq.close()}};function Gq(e,t){let n=(0,$.c)(9),{query:r,setQuery:i}=ml(),a;n[0]!==e||n[1]!==t||n[2]!==i?(a=n=>{t.close(),i(``),e(n)},n[0]=e,n[1]=t,n[2]=i,n[3]=a):a=n[3];let o;return n[4]!==t.toggle||n[5]!==r||n[6]!==i||n[7]!==a?(o={query:r,setQuery:i,toggle:t.toggle,select:a},n[4]=t.toggle,n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],o}function Kq(e){let t=(0,$.c)(2);Hu(ou.findFile,qq);let n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(IU,{controller:Uq,title:`Find a file`,description:`Find a file by name, or enter a relative path to open it.`,children:(0,Q.jsx)(Jq,{...e})}),t[0]=e,t[1]=n),n}function qq(){return Wq.toggle()}function Jq(e){let t=(0,$.c)(11),{scope:n,connection:r,openFiles:i,onOpen:a,bindPopup:o}=e,{query:s,setQuery:c,select:l}=Gq(a,Wq),u=WB(r,n.projectId),d=de(qr(u.result)),f=new Set(d?.preferences.filter(Qq).map(Zq)??[]),p=Pl(`${r.environmentId}:${n.projectId}:${n.worktreeId}`).state.showHidden,m=FU,h=Xq,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(LU,{"aria-label":`Find a file by name`,placeholder:`Find a file by name`,onFocus:Yq}),t[0]=g):g=t[0];let _=d===void 0&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:Mi(u.result)?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`block`,children:`File visibility preferences could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`mt-2`,onClick:()=>u.refresh(),children:`Try again`})]}):(0,Q.jsx)(Be,{label:`Reading file visibility`})}),v=d!==void 0&&s.trim()===``&&(0,Q.jsx)($q,{scope:n,connection:r,openFiles:cl(i,f,p),preferences:d.preferences.filter(e=>p||eu(e.path,f)===null),onSelect:l}),y=d!==void 0&&s.trim()!==``&&(0,Q.jsx)(aJ,{scope:n,connection:r,query:s,hidden:f,showHidden:p,onSelect:l}),b;return t[1]!==m||t[2]!==o||t[3]!==s||t[4]!==c||t[5]!==h||t[6]!==g||t[7]!==_||t[8]!==v||t[9]!==y?(b=(0,Q.jsxs)(m,{ref:o,filter:!1,query:s,onQueryChange:c,onEscape:h,children:[g,_,v,y]}),t[1]=m,t[2]=o,t[3]=s,t[4]=c,t[5]=h,t[6]=g,t[7]=_,t[8]=v,t[9]=y,t[10]=b):b=t[10],b}function Yq(e){return e.currentTarget.select()}function Xq(){return Wq.close()}function Zq(e){return e.path}function Qq(e){return e.hidden}function $q(e){let t=(0,$.c)(2),{scope:n,connection:r,openFiles:i,preferences:a,onSelect:o}=e,s=a.filter(iJ),c=zR(r,n,s.length===0?[]:[``,...iu(s)]),l=Zl(s.map(rJ),c.states).filter(nJ).map(tJ),u=[...new Set([...i,...l])],d;return t[0]===c?d=t[1]:(d=c.states.some(eJ)&&(0,Q.jsxs)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:[`Pinned files could not be loaded.`,(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`ml-2`,onClick:()=>c.retry(),children:`Try again`})]}),t[0]=c,t[1]=d),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(RU,{children:u.map(e=>(0,Q.jsx)(oJ,{path:e,onSelect:o},e))}),u.length===0&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:`Type a file name or relative path.`}),d]})}function eJ(e){return e.status===`unavailable`}function tJ(e){let{path:t}=e;return t}function nJ(e){return e.state===`resolved`&&e.entry.kind===`file`}function rJ(e){let{path:t}=e;return t}function iJ(e){return e.pinned}function aJ(e){let t=(0,$.c)(26),{scope:n,connection:r,query:i,hidden:a,showHidden:o,onSelect:s}=e,c=sq(r,n),l,u,d,f,p,m;if(t[0]!==a||t[1]!==c||t[2]!==s||t[3]!==i||t[4]!==o){let e=mu(cl(de(qr(c.result))?.paths??[],a,o),i),n=Ll(i),r=n!==null&&(o||eu(n,a)===null)&&!e.includes(n)?n:null;t[11]===c?f=t[12]:(f=Mi(c.result)&&(0,Q.jsxs)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`block`,children:`Full file search could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`mt-2`,onClick:()=>c.refresh(),children:`Try again`})]}),t[11]=c,t[12]=f),t[13]===c.result?p=t[14]:(p=Xi(c.result)&&(0,Q.jsx)(`div`,{className:`p-3`,children:(0,Q.jsx)(Be,{label:`Reading file names`})}),t[13]=c.result,t[14]=p),m=!Xi(c.result)&&!Mi(c.result)&&e.length===0&&r===null&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:`No file matches that name.`}),l=RU,u=r!==null&&(0,Q.jsxs)(VU,{value:r,onSelect:()=>s(r),children:[`Open path `,r]});let h;t[15]===s?h=t[16]:(h=e=>(0,Q.jsx)(oJ,{path:e,onSelect:s},e),t[15]=s,t[16]=h),d=e.map(h),t[0]=a,t[1]=c,t[2]=s,t[3]=i,t[4]=o,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m}else l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10];let h;t[17]!==l||t[18]!==u||t[19]!==d?(h=(0,Q.jsxs)(l,{children:[u,d]}),t[17]=l,t[18]=u,t[19]=d,t[20]=h):h=t[20];let g;return t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,m,h]}),t[21]=f,t[22]=p,t[23]=m,t[24]=h,t[25]=g):g=t[25],g}function oJ(e){let t=(0,$.c)(11),{path:n,onSelect:r}=e,i=n.lastIndexOf(`/`)+1,a;t[0]!==r||t[1]!==n||t[2]!==i?(a=(e,t)=>(0,Q.jsxs)(VU,{value:n,"aria-label":n,onSelect:()=>r(n),children:[e,i>0&&t(n.slice(0,i-1),`shrink-[100] text-muted-foreground`)]}),t[0]=r,t[1]=n,t[2]=i,t[3]=a):a=t[3];let o;t[4]!==n||t[5]!==i?(o=n.slice(i),t[4]=n,t[5]=i,t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==a||t[9]!==o?(s=(0,Q.jsx)(fr,{text:n,className:`min-w-0`,renderTrigger:a,children:o}),t[7]=n,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function sJ(e,t,n){let r=(0,$.c)(7),i;r[0]!==e||r[1]!==t?(i=jl({draft:e,viewer:t}),r[0]=e,r[1]=t,r[2]=i):i=r[2],Lt(i);let a;r[3]!==e||r[4]!==n||r[5]!==t?(a=Qc({draft:e,viewer:t,fingerprint:n}),r[3]=e,r[4]=n,r[5]=t,r[6]=a):a=r[6],Lt(a)}var cJ=`porcelain:quit-check`;L([`open-project`,`open-settings`]),L([`system`,`light`,`dark`]),L([`suspend`,`resume`]),g([Ut({status:An(`idle`)}),Ut({status:An(`checking`)}),Ut({status:An(`unavailable`)}),Ut({status:An(`available`),version:ee}),Ut({status:An(`downloading`),version:ee}),Ut({status:An(`ready`),version:ee}),Ut({status:An(`installing`),version:ee}),Ut({status:An(`error`),message:ee})]),g([Ut({status:An(`empty`)}),Ut({status:An(`saved`),value:ee}),Ut({status:An(`unreadable`),message:ee})]),Ut({bounds:Ut({x:Ln.check(Ac()),y:Ln.check(Ac()),width:Ln.check(Ac()).check(yn(0)),height:Ln.check(Ac()).check(yn(0))}),maximized:fi});var lJ=dt(({connection:e,environmentIds:t})=>Oe(n=>{if(!e||t.length===0)return;let r=n(Gt(e)),i=de(qr(r));if(!i)return;let a=e=>{i.hasUnsaved(t)&&e.preventDefault()};window.addEventListener(`beforeunload`,a),window.addEventListener(cJ,a),n.addFinalizer(()=>{window.removeEventListener(`beforeunload`,a),window.removeEventListener(cJ,a)})}));function uJ(e,t){let n=(0,$.c)(3),r;n[0]!==e||n[1]!==t?(r=lJ({connection:e,environmentIds:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],Lt(r)}function dJ(){return new zj({poolSize:4,workerFactory:()=>new Worker(new URL(`/assets/pierre-worker-COmT0LXL.js`,``+import.meta.url),{type:`module`})},{theme:Qu,preferredHighlighter:Gu})}function fJ(e){let t=(0,$.c)(6),{children:n}=e,[r,i]=(0,Z.useState)(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>e=>{if(!e)return;let t=dJ();return i(t),()=>t.terminate()},t[0]=a):a=t[0];let[o]=(0,Z.useState)(a),s;t[1]!==n||t[2]!==r?(s=r&&(0,Q.jsx)(Kj,{value:r,children:n}),t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]===s?c=t[5]:(c=(0,Q.jsx)(`div`,{ref:o,className:`contents`,children:s}),t[4]=s,t[5]=c),c}function pJ(e,t){let n=(0,$.c)(9),r;n[0]!==t.connection||n[1]!==e?(r=Go({connection:t.connection,scope:e}),n[0]=t.connection,n[1]=e,n[2]=r):r=n[2];let i;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promiseExit`},n[3]=i):i=n[3];let[a,o]=B(r,i),s;n[4]===o?s=n[5]:(s=e=>{o(e)},n[4]=o,n[5]=s);let c;return n[6]!==a||n[7]!==s?(c={result:a,dismiss:s},n[6]=a,n[7]=s,n[8]=c):c=n[8],c}function mJ(e){let t=new Map;for(let n of e){let e=n.id.split(`:`)[0]||n.id,r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t.entries()]}function hJ(e,t){let n=e?.filter(e=>!e.id.endsWith(`:default`));return n?.find(e=>e.id===t)?.id??n?.find(e=>/^codex:(?:.*-)?luna(?:-|$)/.test(e.id))?.id??n?.find(e=>e.id===`claude:haiku`)?.id??n?.find(e=>e.id===`claude:sonnet`)?.id}function gJ(e){return e.split(`/`).at(-1)??e}function _J(e,t){let{message:n,stashOid:r,option:i}=t;return e===`stash-create`?{action:e,message:n,includeUntracked:i}:{action:e,stashOid:r,restoreIndex:i}}function vJ(e,t,n){return{mode:e===`amend`?`amend`:`single`,message:e===`commit`?t:``,amendMessage:e===`amend`?t:n,excluded:new Set,added:new Set,groups:null}}function yJ(e,t,n=new Set){return t.some(t=>!n.has(t.path)&&e.files?.find(e=>e.path===t.path)?.fingerprint!==t.fingerprint)}var bJ=[{id:`commit`,label:`Commit…`,description:`Commit selected files`},{id:`amend`,label:`Amend last commit…`,description:`Replace the latest commit`},{id:`push`,label:`Push`,description:`Send committed changes`},{id:`pull`,label:`Pull`,description:`Bring in upstream changes`},{id:`fetch`,label:`Fetch`,description:`Update a remote-tracking branch`},{id:`stash-create`,label:`Stash changes`,description:`Set aside local changes`},{id:`stash-apply`,label:`Apply stash`,description:`Restore a stash and keep it`},{id:`stash-pop`,label:`Pop stash`,description:`Restore, then remove a stash`}],xJ=[{id:`commit`,actions:[bJ[0],bJ[1]]},{id:`sync`,actions:[bJ[2],bJ[3],bJ[4]]},{id:`stash`,actions:[bJ[5],bJ[7]]}];function SJ(e){return bJ.find(t=>t.id===e)?.label}function CJ(e,t,n){return e===`pull`&&n?n:Bt(e,t)}function wJ(e){let t=(0,$.c)(18),{scope:n,context:r}=e,{connection:i}=r,a=de(qr(iB(n,i))),o=na(r),s=pJ(n,r),c=a?.interrupted;if(!c)return null;let l=c.action.replaceAll(`-`,` `),u;t[0]===l?u=t[1]:(u=(0,Q.jsxs)(`p`,{className:`font-medium`,children:[`A Git action was interrupted:`,` `,l]}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the current changes before trying again.`}),t[2]=d):d=t[2];let f;t[3]===s.result?f=t[4]:(f=Mi(s.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`mt-1 text-destructive`,children:Un(Ra(s.result.cause))}),t[3]=s.result,t[4]=f);let p;t[5]!==f||t[6]!==u?(p=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d,f]}),t[5]=f,t[6]=u,t[7]=p):p=t[7];let m=s.result.waiting||!!o,h;t[8]!==s||t[9]!==c.requestId?(h=()=>s.dismiss(c.requestId),t[8]=s,t[9]=c.requestId,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h||t[13]!==o?(g=(0,Q.jsx)(X,{size:`xs`,variant:`ghost`,disabled:m,"aria-description":o,onClick:h,children:`Got it`}),t[11]=m,t[12]=h,t[13]=o,t[14]=g):g=t[14];let _;return t[15]!==p||t[16]!==g?(_=(0,Q.jsxs)(`div`,{role:`status`,className:`flex shrink-0 items-start gap-3 border-b border-graph-4/20 bg-graph-4/10 px-3 py-2 text-xs`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17],_}function TJ(e){let t=(0,$.c)(23),{scope:n,context:r,onOpen:i}=e,{connection:a}=r,o=de(qr(iB(n,a))),s=o?.inProgress;if(!s)return null;let c=o.changes.filter(EJ),l=`${s===`merge`?`Merge`:`Rebase`} recovery`,u=s===`merge`?`Merge`:`Rebase`,d=c.length?`is waiting for conflict resolution`:`is ready to finish`,f;t[0]!==u||t[1]!==d?(f=(0,Q.jsxs)(`p`,{className:`font-medium`,children:[u,` `,d]}),t[0]=u,t[1]=d,t[2]=f):f=t[2];let p=c.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:c.map(e=>(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:()=>i({kind:`file`,path:e.path}),children:e.path},e.path))}),m=s===`merge`&&o.mergeHeadOid?`Use Commit from the Git menu to finish. The merge commit includes every staged resolution.`:`Stage the resolved files, then continue in a terminal in this worktree.`,h;t[3]===m?h=t[4]:(h=(0,Q.jsxs)(`p`,{children:[`Resolve the files in your editor or with your agent.`,` `,m]}),t[3]=m,t[4]=h);let g;t[5]===s?g=t[6]:(g=s===`rebase`&&(0,Q.jsx)(OJ,{command:`git rebase --continue`}),t[5]=s,t[6]=g);let _;t[7]!==o||t[8]!==s?(_=s===`merge`&&!o.mergeHeadOid&&(0,Q.jsx)(OJ,{command:`git commit`}),t[7]=o,t[8]=s,t[9]=_):_=t[9];let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{children:`To back out:`}),t[10]=v):v=t[10];let y=`git ${s} --abort`,b;t[11]===y?b=t[12]:(b=(0,Q.jsx)(OJ,{command:y}),t[11]=y,t[12]=b);let x;t[13]!==_||t[14]!==b||t[15]!==g?(x=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[g,_,v,b]}),t[13]=_,t[14]=b,t[15]=g,t[16]=x):x=t[16];let S;return t[17]!==l||t[18]!==x||t[19]!==f||t[20]!==p||t[21]!==h?(S=(0,Q.jsxs)(`section`,{"aria-label":l,className:`shrink-0 space-y-2 border-b border-graph-4/20 bg-graph-4/10 px-3 py-2 text-xs`,children:[f,p,h,x]}),t[17]=l,t[18]=x,t[19]=f,t[20]=p,t[21]=h,t[22]=S):S=t[22],S}function EJ(e){return e.comparisons.some(DJ)}function DJ(e){return e.scope===`unmerged`}function OJ(e){let t=(0,$.c)(8),{command:n}=e,r=`Copy ${n}`,i,a;t[0]===n?(i=t[1],a=t[2]):(i=()=>Zt(n,`command`),a=(0,Q.jsx)(`code`,{children:n}),t[0]=n,t[1]=i,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(Bs,{}),t[3]=o):o=t[3];let s;return t[4]!==r||t[5]!==i||t[6]!==a?(s=(0,Q.jsxs)(X,{size:`xs`,variant:`outline`,"aria-label":r,onClick:i,children:[a,o]}),t[4]=r,t[5]=i,t[6]=a,t[7]=s):s=t[7],s}function kJ(e,t){let n=(0,$.c)(5),r;if(n[0]!==t||n[1]!==e.state){let i;n[3]===t?i=n[4]:(i=e=>e.operations.get(t)??null,n[3]=t,n[4]=i),r=e.state.map(i),n[0]=t,n[1]=e.state,n[2]=r}else r=n[2];return La(r)}var AJ=dt(e=>pe({done:new Set,activeGroup:null,ownHead:null,busy:!1,error:null,drafted:{message:null,groups:null},draftedBy:{message:null,groups:null},editingFiles:!1})),jJ=dt(e=>new Set);function MJ(e,t,n){let r=(0,$.c)(14),{connection:i}=n,{operations:a}=i,o;r[0]!==t||r[1]!==e?(o=ai(e,t),r[0]=t,r[1]=e,r[2]=o):o=r[2];let s=o,c;r[3]!==s||r[4]!==a.state.value.operations?(c=()=>{let e=a.state.value.operations.get(s);return e?.receipt&&pc(e.receipt)?e.requestId:null},r[3]=s,r[4]=a.state.value.operations,r[5]=c):c=r[5];let[l]=(0,Z.useState)(c),u=kJ(a,s),d=u?.requestId===l?null:u,f={connection:i,scope:e,action:t},{value:p}=$u(no(f)),m=ea(f),h=la(f),g=Ot(m),_=Ot(h),v;r[6]===d?v=r[7]:(v=d?.receipt&&pc(d.receipt),r[6]=d,r[7]=v);let y=!!v,b;return r[8]!==p||r[9]!==g||r[10]!==d||r[11]!==_||r[12]!==y?(b={...p,execution:g,recovered:_,operation:d,canStartNew:y},r[8]=p,r[9]=g,r[10]=d,r[11]=_,r[12]=y,r[13]=b):b=r[13],b}var NJ=dt(({signal:e,submit:t,recover:n})=>Oe(r=>{e!==void 0&&(r.set(t,Le),r.set(n,Le))}));function PJ(e,t,n){let r=(0,$.c)(45),{path:i,hunk:a,signal:o,what:s,look:c,readChanges:l,notify:u,dismissNotice:d,close:f}=n,p=MJ(e,`discard`,t),m=MJ(e,`stash-apply`,t),h=!(!p.operation||p.canStartNew),g;r[0]===l?g=r[1]:(g=()=>Ui({try:l,catch:BJ}),r[0]=l,r[1]=g);let _;r[2]!==f||r[3]!==d||r[4]!==u||r[5]!==m||r[6]!==g||r[7]!==s?(_={what:s,readChanges:g,notify:u,dismissNotice:d,close:f,restore:m,restoreTimeoutMs:wt,run:xo},r[2]=f,r[3]=d,r[4]=u,r[5]=m,r[6]=g,r[7]=s,r[8]=_):_=r[8];let v=_,[y]=(0,Z.useState)(RJ),[b]=(0,Z.useState)(IJ),x;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(x={mode:`promiseExit`},r[9]=x):x=r[9];let[S,C]=B(y,x),w;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(w={mode:`promiseExit`},r[10]=w):w=r[10];let[T,E]=B(b,w),D=Da(y),O=Da(b),k;r[11]!==b||r[12]!==o||r[13]!==y?(k=NJ({signal:o,submit:y,recover:b}),r[11]=b,r[12]=o,r[13]=y,r[14]=k):k=r[14],Lt(k);let A=S.waiting||T.waiting,j=FJ,M;r[15]!==T||r[16]!==S?(M=j(S)??j(T),r[15]=T,r[16]=S,r[17]=M):M=r[17];let N;r[18]!==O||r[19]!==D?(N=()=>{D(Le),O(Le)},r[18]=O,r[19]=D,r[20]=N):N=r[20];let P;r[21]!==A||r[22]!==p||r[23]!==v||r[24]!==a||r[25]!==c||r[26]!==i||r[27]!==O||r[28]!==C||r[29]!==h?(P=()=>{A||h||!c||(O(Le),C({run:()=>p.run({action:`discard`,path:i,...a?{hunk:a}:{}},ke(c,[i])),discarding:v}))},r[21]=A,r[22]=p,r[23]=v,r[24]=a,r[25]=c,r[26]=i,r[27]=O,r[28]=C,r[29]=h,r[30]=P):P=r[30];let F;r[31]!==A||r[32]!==p.recover||r[33]!==v||r[34]!==E||r[35]!==D?(F=()=>{A||(D(Le),E({recover:p.recover,discarding:v}))},r[31]=A,r[32]=p.recover,r[33]=v,r[34]=E,r[35]=D,r[36]=F):F=r[36];let I;return r[37]!==A||r[38]!==p.operation||r[39]!==M||r[40]!==N||r[41]!==P||r[42]!==F||r[43]!==h?(I={operation:p.operation,uncertain:h,busy:A,error:M,reset:N,run:P,checkOutcome:F},r[37]=A,r[38]=p.operation,r[39]=M,r[40]=N,r[41]=P,r[42]=F,r[43]=h,r[44]=I):I=r[44],I}function FJ(e){return de(qr(e))??(Mi(e)?{text:Un(Ra(e.cause)),moved:!1}:null)}function IJ(){return mn(LJ)}function LJ(e){return ae(e.recover(),e.discarding)}function RJ(){return mn(zJ)}function zJ(e){return ae(e.run(),e.discarding)}function BJ(e){return new Rt(e,Un(e))}function VJ({text:e}){return e.split(/`([^`\n]+)`/).map((e,t)=>t%2?(0,Q.jsx)(`code`,{className:`box-decoration-clone rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]`,children:e},t):e)}function HJ(e){let t=(0,$.c)(6),{text:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(qi,{className:`mt-[0.2lh] size-3.5 shrink-0`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Q.jsx)(VJ,{text:n}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=(0,Q.jsxs)(`p`,{role:`alert`,className:`flex min-w-0 gap-1.5 text-destructive`,children:[i,(0,Q.jsxs)(`span`,{className:`min-w-0 break-words`,children:[a,r]})]}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function UJ(e){let t=(0,$.c)(12),{scope:n,context:r,path:i,hunk:a,variant:o,signal:s,hiddenTrigger:c,children:l}=e,u=o===void 0?`button`:o,d=c!==void 0&&c,{connection:f}=r,p=de(qr(iB(n,f))),m=uB(n,f),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=p,b=y?St(y):null,x=y?.changes.find(e=>e.path===i),S=_??b,C;t[0]===a?C=t[1]:(C=a?KJ(a):null,t[0]=a,t[1]=C);let w=C,T=w?`${w} of ${gJ(i)}`:gJ(i),E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>g(!1),t[2]=E):E=t[2];let D=PJ(n,r,{path:i,hunk:a,signal:s,what:T,look:S,readChanges:m,notify:ks,dismissNotice:Ya,close:E}),{busy:O,error:k,uncertain:A}=D,j=na(r),M=!!(S&&(x||h)),[N,P]=(0,Z.useState)();s!==void 0&&s!==N&&b&&(P(s),v(b),g(!0));let[F,I]=(0,Z.useState)(null),L=M&&!d?(0,Q.jsxs)(X,{ref:I,size:u===`button`?`sm`:`xs`,disabled:!!j,"aria-description":j,variant:u===`button`?`destructive`:`ghost`,"aria-label":a?`Discard ${w} of ${gJ(i)}`:`Discard changes to ${gJ(i)}`,onClick:()=>{D.reset(),v(b),g(!0)},children:[(0,Q.jsx)(F_,{}),qJ(u)]}):null,R=M?(0,Q.jsx)(Ez,{open:h,onOpenChange:e=>!O&&g(e),children:(0,Q.jsxs)(Oz,{finalFocus:()=>F,children:[(0,Q.jsxs)(kz,{children:[(0,Q.jsxs)(jz,{children:[`Discard `,T,`?`]}),(0,Q.jsx)(Mz,{children:JJ(a!=null,x?.comparisons.some(GJ)??!1)})]}),(0,Q.jsx)(fr,{className:`rounded-lg bg-muted/50 px-3 py-2 font-mono text-xs`,render:(0,Q.jsx)(`p`,{}),text:i}),k&&(0,Q.jsx)(HJ,{text:k.text,children:k.moved?` Look at the diff again before discarding.`:``}),D.operation?.receipt?.progress.map(WJ),A&&!D.operation?.receipt&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`The response was lost. Check the existing discard request before trying again.`}),(0,Q.jsxs)(Az,{children:[(0,Q.jsx)(Nz,{disabled:O,children:k?.moved?`Look again`:`Cancel`}),!k?.moved&&(A?(0,Q.jsx)(ji,{pending:O,onClick:D.checkOutcome,children:`Check outcome`}):(0,Q.jsx)(X,{variant:`destructive`,disabled:O||!!j,"aria-description":j,onClick:D.run,children:O?`Discarding…`:`Discard`}))]})]})}):null;if(l){let e;t[3]!==l||t[4]!==L?(e=l(L),t[3]=l,t[4]=L,t[5]=e):e=t[5];let n;return t[6]!==R||t[7]!==e?(n=(0,Q.jsxs)(Q.Fragment,{children:[e,R]}),t[6]=R,t[7]=e,t[8]=n):n=t[8],n}let z;return t[9]!==R||t[10]!==L?(z=(0,Q.jsxs)(Q.Fragment,{children:[L,R]}),t[9]=R,t[10]=L,t[11]=z):z=t[11],z}function WJ(e){return(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:e},e)}function GJ(e){return e.scope===`untracked`}function KJ({startLine:e,endLine:t}){return e===t?`line ${e}`:`lines ${e}–${t}`}function qJ(e){return e===`quiet`?(0,Q.jsx)(`span`,{className:`max-narrow:sr-only`,children:`Discard`}):e===`compact`?`Discard selection`:`Discard`}function JJ(e,t){return e?`Select one complete changed hunk. Only that hunk is reverted; partial selections are refused. A recovery copy is saved first.`:t?`The new file is deleted. You can restore it.`:`The file goes back to the last commit. You can restore the changes.`}var YJ=G(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function XJ({className:e,orientation:t,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Y(YJ({orientation:t}),e),...n})}function ZJ(e,t,n){let r=(0,$.c)(32),i=MJ(e,`fetch`,t),a=MJ(e,`pull`,t),o=MJ(e,`push`,t),s=MJ(e,`stash-apply`,t),c;r[0]===n.details?c=r[1]:(c=()=>Ui({try:n.details.read,catch:eY}),r[0]=n.details,r[1]=c);let l;r[2]!==n.details||r[3]!==c?(l={...n.details,read:c},r[2]=n.details,r[3]=c,r[4]=l):l=r[4];let u;r[5]!==n||r[6]!==l?(u={...n,details:l},r[5]=n,r[6]=l,r[7]=u):u=r[7];let d=u,f,p;r[8]!==i||r[9]!==a||r[10]!==o?(f={fetch:i,pull:a,push:o},p=[`fetch`,`pull`,`push`].map(e=>({name:e,operation:f[e].operation,canStartNew:f[e].canStartNew,checking:f[e].recovered.waiting})).find($J),r[8]=i,r[9]=a,r[10]=o,r[11]=f,r[12]=p):(f=r[11],p=r[12]);let m=p,h;r[13]!==d||r[14]!==f||r[15]!==m?(h=()=>{m&&xo(si(d,f[m.name],m.name))},r[13]=d,r[14]=f,r[15]=m,r[16]=h):h=r[16];let g;r[17]!==d||r[18]!==f?(g=(e,t)=>xo(En(d,f[e],e,t)),r[17]=d,r[18]=f,r[19]=g):g=r[19];let _;r[20]!==d||r[21]!==s?(_=e=>xo(oc(d,s,e)),r[20]=d,r[21]=s,r[22]=_):_=r[22];let v;r[23]!==n.onLooked||r[24]!==n.refreshLook?(v=()=>ls(hc(Ui({try:n.refreshLook,catch:QJ}),n.onLooked)),r[23]=n.onLooked,r[24]=n.refreshLook,r[25]=v):v=r[25];let y;return r[26]!==m||r[27]!==h||r[28]!==g||r[29]!==_||r[30]!==v?(y={running:m,checkOutcome:h,runNetwork:g,restoreDiscarded:_,lookAgain:v},r[26]=m,r[27]=h,r[28]=g,r[29]=_,r[30]=v,r[31]=y):y=r[31],y}function QJ(e){return new Rt(e,Un(e))}function $J(e){let{operation:t,canStartNew:n}=e;return t!=null&&!n}function eY(e){return new Rt(e,Un(e))}function tY(e){let t=(0,$.c)(12),{action:n,className:r}=e;switch(n){case`amend`:{let e;return t[0]===r?e=t[1]:(e=(0,Q.jsx)(h_,{className:r}),t[0]=r,t[1]=e),e}case`push`:{let e;return t[2]===r?e=t[3]:(e=(0,Q.jsx)(yh,{className:r}),t[2]=r,t[3]=e),e}case`pull`:case`fetch`:{let e;return t[4]===r?e=t[5]:(e=(0,Q.jsx)(hh,{className:r}),t[4]=r,t[5]=e),e}case`stash-create`:{let e;return t[6]===r?e=t[7]:(e=(0,Q.jsx)(ph,{className:r}),t[6]=r,t[7]=e),e}case`stash-apply`:case`stash-pop`:{let e;return t[8]===r?e=t[9]:(e=(0,Q.jsx)(dh,{className:r}),t[8]=r,t[9]=e),e}default:{let e;return t[10]===r?e=t[11]:(e=(0,Q.jsx)(yg,{className:r}),t[10]=r,t[11]=e),e}}}function nY(e){let t=e.group?.();if(!t)return;let n=!!e.parent;return{checked:n?t.parentChecked():t.checked(e.value??`on`),name:n?void 0:e.name??t.name(),disabled:!!e.disabled||t.disabled(),readOnly:!!e.readOnly||t.readOnly(),form:e.form??t.form()}}function rY(e){let t=nY(e);return t?{...t,required:!!e.required,value:e.value??`on`}:It(e)}function iY(e){let{store:t,element:n,options:r}=e,i=ht(e),a=()=>r().group?.(),o=()=>!!r().parent,s=Fa(e,i,{owner:a,write(e,n,r){let{reason:a,event:s}=r,c={reason:a===`press`?`item-press`:a,event:s};return(o()?e.setAll(n===!0&&!e.allEnabledChecked(),c):e.setChild(t.get().value,n===!0,c))?(i(`checked`,o()?e.parentChecked():e.checked(t.get().value),r),!0):!1}}),c=!1,l=(e,t)=>t===!1&&e!==!1&&!!n(`indicator`);Gs(e,[`exiting`],(e,t)=>`checked`in e&&e.checked!==t.checked?{exiting:l(t.checked,e.checked)}:void 0);let u=t.get().checked;return t.subscribe(()=>{let{checked:e}=t.get();if(e===u)return;let n=u;u=e,c=!0,t.set({exiting:l(n,e)})}),{...s,isChanged:()=>c,internal:{...s.internal,joinGroup(e){let n=a();if(!n)return()=>{};let i=()=>{let{name:e,disabled:i,readOnly:a,form:s}=nY(r());t.set({checked:o()?n.parentChecked():n.checked(t.get().value),controls:o()&&n.childIds()||void 0,name:e,disabled:i,readOnly:a,form:s})},s=n.subscribe(i);if(i(),o())return s;let c=()=>n.register(t.get().value,e,()=>vc(t.get())),l=c(),{value:u}=t.get(),d=vc(t.get()),f=t.subscribe(()=>{let e=t.get();e.value===u?vc(e)!==d&&n.internal.refreshChildren():(u=e.value,l(),l=c()),d=vc(e)});return()=>{s(),f(),l()}},finishExit(){t.set({exiting:!1})}}}}var aY=iY,oY=e=>({...R(e),indeterminate:e.checked===`indeterminate`}),sY=sa({name:`checkbox`,options:{checked:J,defaultChecked:J,onCheckedChange:`callback`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,value:`string`,form:`string`,controller:`value`,parent:`boolean`,group:`value`},state:e=>{let t=nY(e);return{...vt(t?{...e,...t}:e),exiting:!1,controls:void 0}},controlled:[`checked`],live:[`controls`],sync:rY,api:aY,slots:e=>{let{root:t,input:n}=Ea(`checkbox`,e,oY);return{root:e({...t,live:Qo(e=>({"aria-controls":e.controls})),bind:(e,n)=>{let r=n.api.internal.joinGroup(e),i=t.bind?.(e,n);return()=>{i?.(),r()}}}),input:n,indicator:e({props:{keepMounted:`boolean`},present:(e,{props:t})=>!!t.keepMounted||e.checked!==!1||e.exiting,state:oY,attrs:e=>s(e),bind(e,{api:t,store:n,props:r}){let i,a=n.get().checked!==!1;a&&t.isChanged()&&(i=Xe(e));let o=n.subscribe(()=>{let{checked:o,exiting:s}=n.get();e.toggleAttribute(`data-checked`,o===!0),e.toggleAttribute(`data-unchecked`,o===!1),e.toggleAttribute(`data-indeterminate`,o===`indeterminate`),o!==!1!==a&&(a=o!==!1,i?.(),i=void 0,a?i=Xe(e):(s||r.keepMounted)&&(i=kr(e,()=>{i=void 0,t.internal.finishExit()})))});return()=>{o(),i?.()}}})}},agent:{actions:[`setChecked`]}}),cY=he(sY,{root:`button`,indicator:`span`}),lY=Z.createContext(null);function uY(){return tr(sY,`input`,{},{},`input`)}function dY({disabled:e,name:t,render:n,...r}){let i=Z.useContext(lY),a=Us(),o=i?null:a;return(0,Q.jsx)(cY.Root,{...r,disabled:e||o?.disabled,name:t??o?.name,group:i?pt(i,()=>i.api):void 0,render:O(o,`button`,n,(0,Q.jsx)(uY,{}))})}var fY=cY.Indicator;function pY({className:e,...t}){return(0,Q.jsx)(dY,{"data-slot":`checkbox`,className:Y(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,Q.jsx)(fY,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,Q.jsx)(Dn,{})})})}function mY(e,t,n,r){let i=(0,$.c)(40),{expectedStatus:a,onBusy:o,onLookAgain:s}=r,c=MJ(e,t,n),[l]=(0,Z.useState)(vY),u;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={mode:`promiseExit`},i[0]=u):u=i[0];let[d,f]=B(l,u),p=Da(l),m=c.execution.waiting||c.recovered.waiting||d.waiting,h=!(!c.operation||c.canStartNew),g=_Y,_;i[1]===c.recovered?_=i[2]:(_=g(c.recovered),i[1]=c.recovered,i[2]=_);let v=_,y=v instanceof No&&v.reason===`receipt-unavailable`&&v.requestId===c.operation?.requestId?v.requestId:void 0,b;i[3]===s?b=i[4]:(b=s?Ui({try:s,catch:gY}):to,i[3]=s,i[4]=b);let x=b,S;i[5]!==c||i[6]!==y||i[7]!==x||i[8]!==f?(S=y?()=>{f({read:x,startNew:c.startNew(y)})}:void 0,i[5]=c,i[6]=y,i[7]=x,i[8]=f,i[9]=S):S=i[9];let C=c.operation?.receipt,w;i[10]!==c.execution||i[11]!==d||i[12]!==v?(w=g(d)??v??g(c.execution),i[10]=c.execution,i[11]=d,i[12]=v,i[13]=w):w=i[13];let T;i[14]!==m||i[15]!==a||i[16]!==c||i[17]!==o||i[18]!==p||i[19]!==h?(T=e=>{m||h||(o(!0),p(Le),c.reset(),xo(c.run(e,ke(a,a.files?.map(hY)??[],void 0,!0)).pipe(Br(Es(()=>o(!1))),_a)))},i[14]=m,i[15]=a,i[16]=c,i[17]=o,i[18]=p,i[19]=h,i[20]=T):T=i[20];let E;i[21]!==m||i[22]!==c||i[23]!==s||i[24]!==x||i[25]!==f?(E=()=>{s&&!m&&(c.reset(),f({read:x,startNew:c.startNew()}))},i[21]=m,i[22]=c,i[23]=s,i[24]=x,i[25]=f,i[26]=E):E=i[26];let D;i[27]!==c||i[28]!==p?(D=()=>{c.reset(),p(Le),xo(c.recover().pipe(_a))},i[27]=c,i[28]=p,i[29]=D):D=i[29];let O;return i[30]!==m||i[31]!==c.operation||i[32]!==S||i[33]!==C||i[34]!==w||i[35]!==T||i[36]!==E||i[37]!==D||i[38]!==h?(O={clearUnconfirmed:S,operation:c.operation,messageLimit:rs,outcome:C,busy:m,uncertain:h,error:w,onSubmit:T,lookAgain:E,checkOutcome:D},i[30]=m,i[31]=c.operation,i[32]=S,i[33]=C,i[34]=w,i[35]=T,i[36]=E,i[37]=D,i[38]=h,i[39]=O):O=i[39],O}function hY(e){return e.path}function gY(e){return new Rt(e,Un(e))}function _Y(e){return Mi(e)?Ra(e.cause):null}function vY(){return mn(yY)}function yY(e){return zs(e.read,e.startNew)}function bY(e){let t=[],n=[],r=()=>{let e=t.indexOf(null);return e===-1?(t.push(null),t.length-1):e};for(let i of e){let e=t.flatMap((e,t)=>e===i.oid?[t]:[]);for(let n of e)t[n]=null;let a=e.length>0?Math.min(...e):r(),o=i.parentOids.map((e,n)=>{let i=t.indexOf(e),o=n===0?a:i===-1?r():i;return t[o]=e,o});n.push({commit:i,lane:a,outgoing:o,lanesAfter:[...t]})}return n}var xY={laneWidth:16,lastLane:1/0},SY={laneWidth:10,lastLane:3};function CY(e,t=xY){return 13+Math.min(e,t.lastLane)*t.laneWidth}function wY(e,t=xY){let n=e.flatMap(e=>[e.lane,...e.outgoing,...e.lanesAfter.flatMap((e,t)=>e==null?[]:[t])]);return CY(Math.max(0,...n),t)+13}function TY(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:[`th`,`st`,`nd`,`rd`][e%10]??`th`}`}function EY(e){let t=OY(e),n=t.at(-1);return{snapshot:t[0]?.snapshot??null,commits:t.flatMap(e=>e.commits),nextAfter:n?.nextAfter??null,boundary:n?.boundary??null,restarted:n?.restarted??!1}}function DY(e){let t=OY(e),n=t.at(-1);return{commits:t.flatMap(e=>e.commits),tip:t[0]?.tip??null,nextAfter:n?.nextAfter??null,boundary:n?.boundary??null,restarted:t[0]?.restarted??!1}}function OY(e){let t=e.findLastIndex(e=>e.restarted);return t===-1?e:e.slice(t)}var kY=dt(e=>Oe({loaded:0,selected:void 0,scrollOffset:0,graphScrollOffset:0,resetId:0}).pipe(x)),AY=dt(({connection:e,scope:t})=>ve(e,t,[`history`],n=>NY(n,kY({connection:e,scope:t,kind:`commits`}),n=>$o(function*(){let r=yield*(yield*Te(e)).request(e=>e.changes.listCommits({params:{worktreeId:t.worktreeId},query:{after:n?.after,tip:n?.tip}}));return yield*xc(e),r}),e=>e.nextAfter&&e.tip?{after:e.nextAfter,tip:e.tip}:void 0),Xn(e))),jY=dt(({connection:e,scope:t,oid:n,parent:r=1})=>et(e,t,[`commit`,n,r],$o(function*(){let i=yield*(yield*Te(e)).request(e=>e.changes.readCommitFiles({params:{worktreeId:t.worktreeId,oid:n},query:r===1?{}:{parent:r}}));return yield*xc(e,i.commit.oid===n&&(i.comparison.kind===`empty-tree`||i.comparison.parentNumber===r)),i}),Xn(e)).pipe(sr)),MY=dt(({connection:e,scope:t,path:n})=>ve(e,t,[`history`,`file`,n],r=>NY(r,kY({connection:e,scope:t,kind:`file`,path:n}),r=>$o(function*(){let i=yield*(yield*Te(e)).request(e=>e.changes.listFileCommits({params:{worktreeId:t.worktreeId},query:{path:n,limit:100,after:r}}));return yield*xc(e),i}),e=>e.nextAfter),Xn(e)));function NY(e,t,n,r){let i=e.once(t).loaded,a=0;return ti(void 0,o=>$o(function*(){let s=[],c=a,l=o,u=!1;do{let e=yield*n(l);e.restarted&&(c=0,u=!0),c+=e.commits.length,s.push(e),l=r(e)}while(o===void 0&&c<i&&l!==void 0&&!u);a=c;let d=e.once(t);return e.set(t,{...d,loaded:a,...u?{selected:void 0,scrollOffset:0,graphScrollOffset:0,resetId:d.resetId+1}:{}}),[s,l===void 0?y():Zn(l)]}))}var PY=dt(e=>Hn(MY(e),e=>ma(e,e=>DY(e.items))).pipe(sr)),FY=dt(e=>Hn(AY(e),e=>ma(e,e=>EY(e.items))).pipe(sr));dt(e=>wc((t,n)=>{let r=kY({...e,kind:`commit`,oid:t.oid,parent:t.parent}),i=n(r);n.set(r,{...i,selected:t.path,scrollOffset:0,resetId:i.resetId+1})}));function IY(e,t,n,r){let i=(0,$.c)(5),a=r===void 0?1:r,o;return i[0]!==e||i[1]!==n||i[2]!==a||i[3]!==t?(o=jY({connection:e,scope:t,oid:n,parent:a}),i[0]=e,i[1]=n,i[2]=a,i[3]=t,i[4]=o):o=i[4],$u(o).value}function LY(e){let t=(0,$.c)(28),{tracking:n,title:r}=e,i=r!==void 0&&r,a=i?`mt-0.5 size-4`:`mt-0.5 size-3.5`,o;t[0]===a?o=t[1]:(o=Y(`shrink-0 text-muted-foreground`,a),t[0]=a,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,Q.jsx)(_g,{className:o}),t[2]=o,t[3]=s);let c=i?`text-sm leading-5 font-semibold`:`text-caption font-medium`,l;t[4]===c?l=t[5]:(l=Y(`min-w-0 font-mono text-foreground`,c),t[4]=c,t[5]=l);let u;t[6]===i?u=t[7]:(u=i?{render:(0,Q.jsx)(`h1`,{})}:{},t[6]=i,t[7]=u);let d;t[8]!==l||t[9]!==u||t[10]!==n.name?(d=(0,Q.jsx)(fr,{className:l,text:n.name,...u}),t[8]=l,t[9]=u,t[10]=n.name,t[11]=d):d=t[11];let f;t[12]===n.counts?f=t[13]:(f=n.counts!==null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-2xs text-muted-foreground tabular-nums`,children:n.counts}),t[12]=n.counts,t[13]=f);let p;t[14]!==d||t[15]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let m=i?`text-caption`:`text-2xs`,h;t[17]===m?h=t[18]:(h=Y(`text-muted-foreground`,m),t[17]=m,t[18]=h);let g;t[19]!==h||t[20]!==n.upstream?(g=(0,Q.jsx)(fr,{className:h,text:n.upstream}),t[19]=h,t[20]=n.upstream,t[21]=g):g=t[21];let _;t[22]!==p||t[23]!==g?(_=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[p,g]}),t[22]=p,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==_||t[26]!==s?(v=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[s,_]}),t[25]=_,t[26]=s,t[27]=v):v=t[27],v}function RY(e,t){let n=(0,$.c)(19),r;n[0]!==e||n[1]!==t?(r=AY({connection:e,scope:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a;n[3]!==e||n[4]!==t?(a=FY({connection:e,scope:t}),n[3]=e,n[4]=t,n[5]=a):a=n[5];let{result:o,value:s}=$u(a),c=Da(i),l;n[6]!==e||n[7]!==t?(l=kY({connection:e,scope:t,kind:`commits`}),n[6]=e,n[7]=t,n[8]=l):l=n[8];let u=l,d=Ot(u,zY),f=Da(u),p;n[9]===f?p=n[10]:(p=e=>f(t=>({...t,selected:e})),n[9]=f,n[10]=p);let m;n[11]===c?m=n[12]:(m=()=>c(void 0),n[11]=c,n[12]=m);let h;return n[13]!==o||n[14]!==d||n[15]!==p||n[16]!==m||n[17]!==s?(h={...s,result:o,selected:d,select:p,readMore:m},n[13]=o,n[14]=d,n[15]=p,n[16]=m,n[17]=s,n[18]=h):h=n[18],h}function zY(e){return e.selected}function BY(e,t){let n=(0,$.c)(13),r=RY(e,t),i=iB(t,e),a,o,s,c;if(n[0]!==r||n[1]!==i){let e=de(qr(i));a=r,o=e,n[6]===i?s=n[7]:(s=Xi(i),n[6]=i,n[7]=s),c=Ky(e?.branch,r.snapshot),n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=c}else a=n[2],o=n[3],s=n[4],c=n[5];let l;return n[8]!==a||n[9]!==o||n[10]!==s||n[11]!==c?(l={history:a,overview:o,overviewPending:s,tracking:c},n[8]=a,n[9]=o,n[10]=s,n[11]=c,n[12]=l):l=n[12],l}function VY(e){let t=(0,$.c)(3),{enabled:n,onVisible:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`h-px`,ref:e=>{if(!e||!n||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{let[t]=e;t?.isIntersecting&&r()},{rootMargin:`0px 0px 240px 0px`});return t.observe(e),()=>t.disconnect()}}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function HY(e){let t=(0,$.c)(5),[n,r]=(0,Z.useState)(1),i;t[0]===e?i=t[1]:(i=function(t){if(!t)return;let n=t.querySelector(`[data-ref-measurement]`);if(!n)return;let i=()=>{let i=Array.from(n.children,WY),a=i.pop()??0,o=Number.parseFloat(getComputedStyle(t).columnGap),s=t.getBoundingClientRect().width;if(i.reduce(UY,0)+Math.max(0,i.length-1)*o<=s){r(e);return}let c=0,l=0;for(let t of i){c+=t+(l===0?0:o);let n=l+1===e?0:o+a;if(c+n>s)break;l+=1}r(Math.max(1,l))},a=new ResizeObserver(i);return a.observe(t),a.observe(n),i(),()=>a.disconnect()},t[0]=e,t[1]=i);let a=i,o;return t[2]!==a||t[3]!==n?(o={row:a,visibleCount:n},t[2]=a,t[3]=n,t[4]=o):o=t[4],o}function UY(e,t){return e+t}function WY(e){return e.getBoundingClientRect().width}var GY=`min-w-0 max-w-40`;function KY(e){let t=(0,$.c)(21),{refs:n,current:r,onOpenCommit:i}=e,a=r===void 0?YY:r,{row:o,visibleCount:s}=HY(n.length),c;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==o||t[4]!==s){let e=n.slice(s),r;t[6]===n?r=t[7]:(r=n.map(JY),t[6]=n,t[7]=r);let l;t[8]===n.length?l=t[9]:(l=(0,Q.jsxs)(Ao,{variant:`secondary`,className:GY,children:[`+`,n.length]}),t[8]=n.length,t[9]=l);let u;t[10]!==r||t[11]!==l?(u=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute inset-0 overflow-hidden`,children:(0,Q.jsxs)(`div`,{"data-ref-measurement":!0,className:`flex w-max gap-1`,children:[r,l]})}),t[10]=r,t[11]=l,t[12]=u):u=t[12];let d;if(t[13]!==a||t[14]!==i||t[15]!==n||t[16]!==s){let e;t[18]!==a||t[19]!==i?(e=e=>(0,Q.jsx)(fr,{text:e.name,renderTrigger:t=>(0,Q.jsxs)(Ao,{render:(0,Q.jsx)(`button`,{type:`button`,onClick:i}),variant:a(e)?`brand-soft`:`outline`,className:`${GY} pointer-events-auto shrink`,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`}),t]}),children:e.name},`${e.kind}:${e.name}`),t[18]=a,t[19]=i,t[20]=e):e=t[20],d=n.slice(0,s).map(e),t[13]=a,t[14]=i,t[15]=n,t[16]=s,t[17]=d}else d=t[17];c=(0,Q.jsxs)(`div`,{ref:o,className:`pointer-events-none relative flex min-w-0 items-center gap-1`,children:[u,d,e.length>0&&(0,Q.jsxs)(uo,{children:[(0,Q.jsxs)(yo,{render:(0,Q.jsx)(Ao,{render:(0,Q.jsx)(`button`,{type:`button`}),variant:`secondary`,className:`${GY} pointer-events-auto`,"aria-label":`Show ${e.length} more ${Ua(e.length,`ref`)}`}),children:[`+`,e.length]}),(0,Q.jsxs)(Zo,{align:`start`,className:`max-w-[calc(100vw-2rem)]`,children:[(0,Q.jsx)(Jr,{children:`More refs`}),(0,Q.jsx)(`ul`,{className:`max-h-64 overflow-y-auto text-xs`,children:e.map(qY)})]})]})]}),t[0]=a,t[1]=i,t[2]=n,t[3]=o,t[4]=s,t[5]=c}else c=t[5];return c}function qY(e){return(0,Q.jsxs)(`li`,{className:`flex items-center gap-1 py-1 break-all`,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`,className:`size-3 shrink-0`}),e.name]},`${e.kind}:${e.name}`)}function JY(e){return(0,Q.jsxs)(Ao,{variant:`secondary`,className:GY,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`}),(0,Q.jsx)(`span`,{"data-label":e.name,className:`before:content-[attr(data-label)]`})]},`${e.kind}:${e.name}`)}function YY(){return!1}function XY(e){let t=(0,$.c)(73),{commit:n,selected:r,height:i,inset:a,layout:o,head:s,headRef:c,onSelect:l,openToSide:u,children:d}=e,f=o===void 0?`stacked`:o,p=s!==void 0&&s,[m,h]=(0,Z.useState)(!1),g;t[0]!==l||t[1]!==u?(g=e=>l(u!==void 0&&e.altKey),t[0]=l,t[1]=u,t[2]=g):g=t[2];let _=g,v;t[3]===c?v=t[4]:(v=e=>Uy(e,c),t[3]=c,t[4]=v);let y=v,b;if(t[5]!==n.refs||t[6]!==y){let e;t[8]===y?e=t[9]:(e=(e,t)=>Number(y(t))-Number(y(e)),t[8]=y,t[9]=e),b=Hy(n.refs).toSorted(e),t[5]=n.refs,t[6]=y,t[7]=b}else b=t[7];let x=b,S;t[10]===p?S=t[11]:(S=p?(0,Q.jsx)(Ao,{variant:`brand`,className:`relative shrink-0`,children:`HEAD`}):null,t[10]=p,t[11]=S);let C=S,w=f===`stacked`&&`font-medium`,T=(p||r)&&`font-semibold`,E;t[12]!==w||t[13]!==T?(E=Y(`flex min-w-0 items-center gap-1 text-ui leading-4.5 font-normal`,w,T),t[12]=w,t[13]=T,t[14]=E):E=t[14];let D;t[15]===n.parentOids.length?D=t[16]:(D=n.parentOids.length>1&&(0,Q.jsx)(Cg,{"aria-label":`Merge commit`,className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=n.parentOids.length,t[16]=D);let O;t[17]===n.subject?O=t[18]:(O=(0,Q.jsx)(fr,{text:n.subject}),t[17]=n.subject,t[18]=O);let k=f===`stacked`&&C,A;t[19]!==D||t[20]!==O||t[21]!==k||t[22]!==E?(A=(0,Q.jsxs)(`span`,{className:E,children:[D,O,k]}),t[19]=D,t[20]=O,t[21]=k,t[22]=E,t[23]=A):A=t[23];let j=A,M;t[24]===n.author.timestamp?M=t[25]:(M=$a(n.author.timestamp,Date.now()),t[24]=n.author.timestamp,t[25]=M);let N=M,P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e&&h(!1)},t[26]=P):P=t[26];let F;t[27]!==i||t[28]!==a?(F={height:i,paddingLeft:a},t[27]=i,t[28]=a,t[29]=F):F=t[29];let I=f===`stacked`?`flex-col justify-center gap-0.5`:`items-center gap-3`,L=i===void 0&&`py-1.5`,R=r&&`bg-selection hover:bg-selection`,z;t[30]!==I||t[31]!==L||t[32]!==R?(z=Y(`relative flex w-full rounded-lg px-2 text-left transition-colors hover:bg-accent has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-ring/60`,I,L,R),t[30]=I,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==F||t[35]!==z?(B=(0,Q.jsx)(`div`,{style:F,className:z}),t[34]=F,t[35]=z,t[36]=B):B=t[36];let V;t[37]!==N||t[38]!==d||t[39]!==n.author.name||t[40]!==n.oid||t[41]!==y||t[42]!==C||t[43]!==a||t[44]!==f||t[45]!==x||t[46]!==_||t[47]!==r||t[48]!==j?(V=f===`stacked`?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:_,className:`block min-w-0 flex-1 text-left outline-none before:absolute before:inset-0 before:rounded-lg`,children:[j,(0,Q.jsxs)(`span`,{style:{left:a},className:`absolute inset-x-2 mt-0.5 flex min-w-0 gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`code`,{className:`font-mono`,children:By(n.oid)}),(0,Q.jsx)(fr,{text:n.author.name}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:N})]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 block h-4`}),d!==void 0&&(0,Q.jsx)(`span`,{className:`flex min-w-0`,children:d})]}),x.length>0&&(0,Q.jsx)(`div`,{className:`flex h-4.5 max-w-2/5 min-w-0 shrink-0 flex-col justify-center`,children:(0,Q.jsx)(KY,{refs:x,current:y,onOpenCommit:_})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`code`,{className:`hidden w-16 shrink-0 font-mono text-xs text-muted-foreground @md/graph:block`,children:By(n.oid)}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:_,className:`flex min-w-0 items-center text-left outline-none before:absolute before:inset-0 before:rounded-lg`,children:[j,(0,Q.jsx)(`span`,{className:`sr-only`,children:` ${By(n.oid)} ${n.author.name} ${N}`})]}),C,(0,Q.jsx)(`div`,{className:`max-w-2/5 min-w-0 shrink-0 overflow-hidden`,children:x.length>0&&(0,Q.jsx)(KY,{refs:x,current:y,onOpenCommit:_})})]}),(0,Q.jsx)(fr,{className:`hidden w-28 shrink-0 text-xs text-muted-foreground @2xl/graph:block @3xl/graph:w-40`,text:n.author.name}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-right text-xs whitespace-nowrap text-muted-foreground tabular-nums`,children:N})]}),t[37]=N,t[38]=d,t[39]=n.author.name,t[40]=n.oid,t[41]=y,t[42]=C,t[43]=a,t[44]=f,t[45]=x,t[46]=_,t[47]=r,t[48]=j,t[49]=V):V=t[49];let H;t[50]!==B||t[51]!==V?(H=(0,Q.jsx)(uH,{render:B,children:V}),t[50]=B,t[51]=V,t[52]=H):H=t[52];let U=m?`none`:`trigger`,W;t[53]===u?W=t[54]:(W=u&&(0,Q.jsxs)(dn,{onSelect:()=>{(0,th.flushSync)(()=>h(!0)),u.open()},children:[(0,Q.jsx)(Lh,{}),u.label]}),t[53]=u,t[54]=W);let G;t[55]===n.oid?G=t[56]:(G=()=>Zt(n.oid,`commit id`),t[55]=n.oid,t[56]=G);let K;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(Bs,{}),t[57]=K):K=t[57];let q;t[58]===G?q=t[59]:(q=(0,Q.jsxs)(dn,{onSelect:G,children:[K,`Copy commit id`]}),t[58]=G,t[59]=q);let ee;t[60]===n?ee=t[61]:(ee=()=>Zt(Iy(n),`commit message`),t[60]=n,t[61]=ee);let J;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsx)(Bs,{}),t[62]=J):J=t[62];let te;t[63]===ee?te=t[64]:(te=(0,Q.jsxs)(dn,{onSelect:ee,children:[J,`Copy message`]}),t[63]=ee,t[64]=te);let ne;t[65]!==U||t[66]!==W||t[67]!==q||t[68]!==te?(ne=(0,Q.jsxs)(dH,{finalFocus:U,children:[W,q,te]}),t[65]=U,t[66]=W,t[67]=q,t[68]=te,t[69]=ne):ne=t[69];let re;return t[70]!==H||t[71]!==ne?(re=(0,Q.jsxs)(Wt,{onOpenChange:P,children:[H,ne]}),t[70]=H,t[71]=ne,t[72]=re):re=t[72],re}var ZY=[`text-graph-1`,`text-graph-2`,`text-graph-3`,`text-graph-4`,`text-graph-5`,`text-graph-6`],QY=e=>ZY[e%ZY.length]??ZY[0];function $Y(e){let t=(0,$.c)(11),{rows:n,width:r,rowHeight:i,gutter:a}=e,o;t[0]===a?o=t[1]:(o=e=>CY(e,a),t[0]=a,t[1]=o);let s=o,c=n.length*i,l;t[2]!==a||t[3]!==s||t[4]!==i||t[5]!==n?(l=n.map((e,t)=>{let r=t*i+i*.5,o=n[t+1],c=e.lanesAfter.flatMap((r,i)=>{if(r==null||o==null)return[];let a=e.outgoing.includes(i)?s(e.lane):s(i),c=r===o.commit.oid?s(o.lane):s(i),l=[a];return a!==s(i)&&n[t-1]?.lanesAfter[i]===r&&l.push(s(i)),l.map(e=>({lane:i,startX:e,endX:c}))}),l=e.commit.parentOids.length>1;return(0,Q.jsxs)(`g`,{children:[c.map(e=>{let{lane:t,startX:n,endX:o}=e;return(0,Q.jsx)(`path`,{d:n===o?`M ${n} ${r} L ${o} ${r+i}`:`M ${n} ${r} C ${n} ${r+i*.5}, ${o} ${r+i*.5}, ${o} ${r+i}`,fill:`none`,stroke:`currentColor`,strokeWidth:ge,className:QY(Math.min(t,a.lastLane))},`${t}-${n}`)}),(0,Q.jsx)(`circle`,{cx:s(e.lane),cy:r,r:l?5:4,fill:l?`var(--card)`:`currentColor`,stroke:`currentColor`,strokeWidth:2,className:QY(Math.min(e.lane,a.lastLane))})]},e.commit.oid)}),t[2]=a,t[3]=s,t[4]=i,t[5]=n,t[6]=l):l=t[6];let u;return t[7]!==c||t[8]!==l||t[9]!==r?(u=(0,Q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-2 left-1.5`,"data-testid":`history-graph`,width:r,height:c,children:l}),t[7]=c,t[8]=l,t[9]=r,t[10]=u):u=t[10],u}function eX(e){let t=(0,$.c)(49),{label:n,layout:r,history:i,selected:a,onSelect:o,sideLabel:s,highlightHead:c}=e,l=c!==void 0&&c,u,d,f,p,m,h,g,_,v;if(t[0]!==l||t[1]!==i.commits||t[2]!==i.snapshot||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a||t[7]!==s){f=bY(i.commits),u=r===`stacked`?SY:xY,v=wY(f,u),d=r===`columns`?30:44;let e=i.snapshot?.tipOid,c=i.snapshot?.head.kind===`attached`?i.snapshot.head.ref:void 0;_=`relative py-2 pr-3 pl-1.5`,p=n,m=`flex flex-col`,h=tX;let y;t[17]!==c||t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==d||t[22]!==a||t[23]!==s||t[24]!==e||t[25]!==v?(y=t=>{let{commit:n}=t;return(0,Q.jsx)(`li`,{children:(0,Q.jsx)(XY,{commit:n,selected:a===n.oid,height:d,inset:v+8,layout:r,head:l&&n.oid===e,headRef:c,onSelect:e=>o(n.oid,e),openToSide:{label:s,open:()=>o(n.oid,!0)}})},n.oid)},t[17]=c,t[18]=l,t[19]=r,t[20]=o,t[21]=d,t[22]=a,t[23]=s,t[24]=e,t[25]=v,t[26]=y):y=t[26],g=f.map(y),t[0]=l,t[1]=i.commits,t[2]=i.snapshot,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=s,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g,t[15]=_,t[16]=v}else u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=t[16];let y;t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g?(y=(0,Q.jsx)(`ol`,{"aria-label":p,className:m,onKeyDown:h,children:g}),t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=y):y=t[31];let b;t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==v?(b=(0,Q.jsx)($Y,{rows:f,width:v,rowHeight:d,gutter:u}),t[32]=u,t[33]=d,t[34]=f,t[35]=v,t[36]=b):b=t[36];let x;t[37]===v?x=t[38]:(x={paddingLeft:v},t[37]=v,t[38]=x);let S;t[39]===i?S=t[40]:(S=(0,Q.jsx)(nX,{history:i}),t[39]=i,t[40]=S);let C;t[41]!==S||t[42]!==x?(C=(0,Q.jsx)(`div`,{style:x,children:S}),t[41]=S,t[42]=x,t[43]=C):C=t[43];let w;return t[44]!==C||t[45]!==_||t[46]!==y||t[47]!==b?(w=(0,Q.jsxs)(`div`,{className:_,children:[y,b,C]}),t[44]=C,t[45]=_,t[46]=y,t[47]=b,t[48]=w):w=t[48],w}function tX(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=Array.from(e.currentTarget.querySelectorAll(`button[aria-pressed]`)),n=e.target instanceof Element?e.target.closest(`li`):null,r=t.findIndex(e=>e.closest(`li`)===n);if(r<0)return;e.preventDefault(),e.stopPropagation();let i=t[r+(e.key===`ArrowDown`?1:-1)];i&&(i.focus(),i.click())}function nX(e){let t=(0,$.c)(11),{history:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(rX,{history:n}),t[0]=n,t[1]=r);let i;t[2]!==n.nextAfter||t[3]!==n.result?(i=n.nextAfter!==null&&n.nextAfter!==void 0&&!n.result.waiting&&!Mi(n.result),t[2]=n.nextAfter,t[3]=n.result,t[4]=i):i=t[4];let a;t[5]!==n.readMore||t[6]!==i?(a=(0,Q.jsx)(VY,{enabled:i,onVisible:n.readMore}),t[5]=n.readMore,t[6]=i,t[7]=a):a=t[7];let o;return t[8]!==r||t[9]!==a?(o=(0,Q.jsxs)(Q.Fragment,{children:[r,a]}),t[8]=r,t[9]=a,t[10]=o):o=t[10],o}function rX(e){let t=(0,$.c)(8),{history:n}=e;if(n.result.waiting){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-2 py-3`,children:(0,Q.jsx)(Be,{label:`Reading older commits`})}),t[0]=e):e=t[0],e}if(Mi(n.result)){let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{children:`Older commits could not be loaded.`}),t[1]=e):e=t[1];let r;return t[2]===n.readMore?r=t[3]:(r=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-2 text-2xs text-muted-foreground`,children:[e,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:n.readMore,children:`Try again`})]}),t[2]=n.readMore,t[3]=r),r}if(n.nextAfter===null||n.nextAfter===void 0){let e;t[4]===n.boundary?e=t[5]:(e=Gy(n.boundary),t[4]=n.boundary,t[5]=e);let r;return t[6]===e?r=t[7]:(r=(0,Q.jsx)(`p`,{className:`px-2 py-3 text-2xs text-muted-foreground`,children:e}),t[6]=e,t[7]=r),r}return null}function iX(e,t){let n=(0,$.c)(4),r=t===void 0?`scrollOffset`:t,i=Ot(E),a;return n[0]!==e||n[1]!==r||n[2]!==i?(a={ref:t=>{if(!t)return;let n=t.querySelector(`[data-slot="scroll-area-viewport"]`)??t;n.scrollTop=i.get(e)[r]},onScrollCapture:t=>{t.target instanceof HTMLElement&&i.set(e,{...i.get(e),[r]:t.target.scrollTop})}},n[0]=e,n[1]=r,n[2]=i,n[3]=a):a=n[3],a}function aX(e){let t=(0,$.c)(32),{scope:n,connection:r,selected:i,onSelect:a,sideLabel:o,onOpenGraph:s,onOpenChanges:c}=e,{history:l,overview:u,overviewPending:d,tracking:f}=BY(r,n),p=u?.changes.length??0,m;t[0]!==r||t[1]!==n?(m=kY({connection:r,scope:n,kind:`commits`}),t[0]=r,t[1]=n,t[2]=m):m=t[2];let h=iX(m),g;t[3]===f?g=t[4]:(g=(0,Q.jsx)(`section`,{"aria-label":`Branch`,className:`flex shrink-0 border-b px-3.5 py-2.5`,children:(0,Q.jsx)(LY,{tracking:f})}),t[3]=f,t[4]=g);let _;t[5]===l?_=t[6]:(_=(0,Q.jsx)(sX,{history:l}),t[5]=l,t[6]=_);let v;t[7]!==c||t[8]!==p?(v=p>0&&(0,Q.jsx)(`div`,{className:`pt-2 pr-3 pl-1.5`,children:(0,Q.jsxs)(`button`,{type:`button`,onClick:c,className:`flex h-9 w-full items-center gap-2 rounded-lg px-2 text-left text-caption transition-colors hover:bg-accent`,children:[(0,Q.jsx)(kh,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{className:`flex-1`,text:`Uncommitted changes`}),(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground tabular-nums`,children:Vt(p,`file`)})]})}),t[7]=c,t[8]=p,t[9]=v):v=t[9];let y;t[10]!==l.commits.length||t[11]!==d?(y=!d&&l.commits.length===0&&(0,Q.jsx)(cX,{}),t[10]=l.commits.length,t[11]=d,t[12]=y):y=t[12];let b;t[13]!==l||t[14]!==a||t[15]!==d||t[16]!==i||t[17]!==o?(b=!d&&l.commits.length>0&&(0,Q.jsx)(eX,{label:`Commits`,layout:`stacked`,history:l,selected:i||l.selected||``,onSelect:(e,t)=>{l.select(e),a(e,t)},sideLabel:o}),t[13]=l,t[14]=a,t[15]=d,t[16]=i,t[17]=o,t[18]=b):b=t[18];let x;t[19]!==h||t[20]!==v||t[21]!==y||t[22]!==b?(x=(0,Q.jsxs)(JV,{className:`min-h-0 flex-initial`,role:`region`,"aria-label":`History reading area`,...h,children:[v,y,b]}),t[19]=h,t[20]=v,t[21]=y,t[22]=b,t[23]=x):x=t[23];let S;t[24]!==l.commits.length||t[25]!==s?(S=l.commits.length>0&&(0,Q.jsx)(`div`,{className:`shrink-0 border-t p-1.5`,children:(0,Q.jsxs)(X,{variant:`ghost`,className:`w-full justify-start`,onClick:s,children:[(0,Q.jsx)(xg,{}),`Open graph`,(0,Q.jsx)(ci,{className:`ml-auto text-muted-foreground`})]})}),t[24]=l.commits.length,t[25]=s,t[26]=S):S=t[26];let C;return t[27]!==g||t[28]!==_||t[29]!==x||t[30]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[g,_,x,S]}),t[27]=g,t[28]=_,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function oX(e){let t=(0,$.c)(7),{history:n}=e,r;t[0]===n.snapshot?r=t[1]:(r=n.snapshot!==null&&n.snapshot!==void 0&&(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b px-3.5 font-mono text-caption leading-4 text-muted-foreground`,children:[(0,Q.jsx)(_g,{className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1 font-medium text-foreground`,text:Wy(n.snapshot)})]}),t[0]=n.snapshot,t[1]=r);let i;t[2]===n?i=t[3]:(i=(0,Q.jsx)(sX,{history:n}),t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(Q.Fragment,{children:[r,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function sX(e){let t=(0,$.c)(1),{history:n}=e;if(!n.restarted)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`p`,{role:`status`,className:`shrink-0 border-b bg-muted/40 px-3.5 py-2 text-2xs text-muted-foreground`,children:`History changed. Showing it from the top.`}),t[0]=r):r=t[0],r}function cX(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(YH,{children:(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`No commits yet`})})}),e[0]=t):t=e[0],t}function lX(e){let t=(0,$.c)(14),{scope:n,connection:r,onSelect:i,sideLabel:a}=e,o=RY(r,n),s=TH(),c;t[0]!==r||t[1]!==n?(c=kY({connection:r,scope:n,kind:`commits`}),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=iX(c,`graphScrollOffset`),u;t[3]===o?u=t[4]:(u=(0,Q.jsx)(oX,{history:o}),t[3]=o,t[4]=u);let d;t[5]!==o||t[6]!==i||t[7]!==s||t[8]!==a?(d=o.commits.length===0?(0,Q.jsx)(cX,{}):(0,Q.jsx)(eX,{label:`Commit graph`,highlightHead:!0,layout:s?`stacked`:`columns`,history:o,selected:o.selected??``,onSelect:(e,t)=>{o.select(e),i(e,t)},sideLabel:a}),t[5]=o,t[6]=i,t[7]=s,t[8]=a,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(`div`,{className:`@container/graph flex min-h-0 flex-1 flex-col overflow-auto`,role:`region`,"aria-label":`Graph reading area`,...l,children:[u,d]}),t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function uX(e,t,n){let r=(0,$.c)(6),i={connection:e,scope:t,path:n},{value:a,result:o}=$u(PY(i)),s=Da(MY(i)),c;r[0]===s?c=r[1]:(c=()=>s(void 0),r[0]=s,r[1]=c);let l;return r[2]!==o||r[3]!==c||r[4]!==a?(l={...a,result:o,readMore:c},r[2]=o,r[3]=c,r[4]=a,r[5]=l):l=r[5],l}function dX(e){let t=(0,$.c)(34),{scope:n,connection:r,path:i,onSelect:a,sideLabel:o}=e,s=uX(r,n,i),c;t[0]!==r||t[1]!==i||t[2]!==n?(c=kY({connection:r,scope:n,kind:`file`,path:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=c):c=t[3];let l=c,u=Ot(l,fX),d=Da(l),f=iX(l),p;t[4]!==a||t[5]!==d?(p=(e,t)=>{d(t=>({...t,selected:e.commit.oid})),a({oid:e.commit.oid,path:e.path},t)},t[4]=a,t[5]=d,t[6]=p):p=t[6];let m=p;if(s.commits.length===0&&s.nextAfter===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(YH,{children:(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`No commits touch this file`})})}),t[7]=e):e=t[7],e}let h=`Timeline of ${i}`,g;if(t[8]!==m||t[9]!==i||t[10]!==u||t[11]!==o||t[12]!==s.commits){let e;t[14]!==m||t[15]!==i||t[16]!==u||t[17]!==o?(e=e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(XY,{commit:e.commit,selected:u===e.commit.oid,onSelect:t=>m(e,t),openToSide:{label:o,open:()=>m(e,!0)},children:(0,Q.jsx)(fr,{className:`text-2xs text-muted-foreground`,text:Fy(e,i)})})},e.commit.oid),t[14]=m,t[15]=i,t[16]=u,t[17]=o,t[18]=e):e=t[18],g=s.commits.map(e),t[8]=m,t[9]=i,t[10]=u,t[11]=o,t[12]=s.commits,t[13]=g}else g=t[13];let _;t[19]===s.restarted?_=t[20]:(_=s.restarted&&(0,Q.jsx)(`span`,{role:`status`,children:`History changed. Showing it from the top.`}),t[19]=s.restarted,t[20]=_);let v;t[21]===s?v=t[22]:(v=(0,Q.jsx)(pX,{timeline:s}),t[21]=s,t[22]=v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`A merge appears only when its own result changed the file.`}),t[23]=y):y=t[23];let b;t[24]!==_||t[25]!==v?(b=(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-3 text-2xs text-muted-foreground`,children:[_,v,y]}),t[24]=_,t[25]=v,t[26]=b):b=t[26];let x;t[27]!==h||t[28]!==g||t[29]!==b?(x=(0,Q.jsxs)(`ol`,{"aria-label":h,className:`flex flex-col p-2`,children:[g,b]}),t[27]=h,t[28]=g,t[29]=b,t[30]=x):x=t[30];let S;return t[31]!==f||t[32]!==x?(S=(0,Q.jsx)(`div`,{role:`region`,"aria-label":`Timeline reading area`,className:`min-h-0 flex-1 overflow-auto`,...f,children:x}),t[31]=f,t[32]=x,t[33]=S):S=t[33],S}function fX(e){return e.selected}function pX(e){let t=(0,$.c)(7),{timeline:n}=e;if(Mi(n.result)){let e;return t[0]===n.readMore?e=t[1]:(e=(0,Q.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2`,children:[`Older commits could not be loaded.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:n.readMore,children:`Try again`})]}),t[0]=n.readMore,t[1]=e),e}if(n.nextAfter){let e;return t[2]!==n.readMore||t[3]!==n.result.waiting?(e=(0,Q.jsx)(ji,{pending:n.result.waiting,size:`sm`,variant:`outline`,className:`self-start`,onClick:n.readMore,children:`Load older commits`}),t[2]=n.readMore,t[3]=n.result.waiting,t[4]=e):e=t[4],e}let r=n.boundary===`shallow`?`Shallow clone: older history is not available.`:`Start of this file’s history.`,i;return t[5]===r?i=t[6]:(i=(0,Q.jsx)(`span`,{children:r}),t[5]=r,t[6]=i),i}function mX(e){let t=(0,$.c)(15),{scope:n,connection:r,sideLabel:i,status:a,onOpenCommit:o,onOpenGraph:s}=e,{history:c,tracking:l}=BY(r,n),u=c.snapshot?.head.kind===`attached`?c.snapshot.head.ref:void 0,d;if(t[0]!==u||t[1]!==c.commits||t[2]!==o||t[3]!==s||t[4]!==i||t[5]!==a||t[6]!==l){let e=c.commits.slice(0,8),n;t[8]===l?n=t[9]:(n=(0,Q.jsx)(LY,{tracking:l,title:!0}),t[8]=l,t[9]=n);let r;t[10]===a?r=t[11]:(r=(0,Q.jsx)(`div`,{className:`pl-6`,children:a}),t[10]=a,t[11]=r);let f;t[12]!==n||t[13]!==r?(f=(0,Q.jsxs)(`section`,{"aria-label":`Branch`,className:`flex flex-col gap-3 px-2`,children:[n,r]}),t[12]=n,t[13]=r,t[14]=f):f=t[14],d=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[f,e.length>0&&(0,Q.jsxs)(`section`,{"aria-labelledby":`recent-commits`,className:`@container/graph flex flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex h-8 items-center gap-2 border-b px-2`,children:[(0,Q.jsx)(`h2`,{id:`recent-commits`,className:`min-w-0 flex-1 text-caption font-medium text-muted-foreground`,children:`Recent commits`}),(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,onClick:s,children:[`Open graph`,(0,Q.jsx)(ci,{className:`text-muted-foreground`})]})]}),(0,Q.jsx)(`ol`,{"aria-label":`Recent commits`,className:`flex flex-col pt-1`,children:e.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(XY,{commit:e,selected:!1,height:30,inset:8,layout:`columns`,headRef:u,onSelect:t=>o(e.oid,t),openToSide:{label:i,open:()=>o(e.oid,!0)}})},e.oid))})]})]}),t[0]=u,t[1]=c.commits,t[2]=o,t[3]=s,t[4]=i,t[5]=a,t[6]=l,t[7]=d}else d=t[7];return d}function hX(e){let t=(0,$.c)(2),n;return t[0]===e.connection?n=t[1]:(n=_r(e.connection),t[0]=e.connection,t[1]=n),Ot(n)}var gX=_s(`BrowserCommitDraft.submit`)(function*(e,t,n){return yield*hi($o(function*(){let r=yield*Xo(rc(),e=>ii(e,V)),i=new AbortController,a=()=>{xo(ii(r,V))};return yield*Xo(Es(()=>{t.add(i),i.signal.addEventListener(`abort`,a,{once:!0})}),()=>Es(()=>{i.signal.removeEventListener(`abort`,a),t.delete(i)})),yield*e(n,r)}))});function _X(e,t,n){let r=(0,$.c)(12),i;r[0]!==t.connection||r[1]!==e?(i=Er({connection:t.connection,scope:e}),r[0]=t.connection,r[1]=e,r[2]=i):i=r[2];let{value:a}=$u(i),o;r[3]!==t.connection||r[4]!==e?(o=qe({connection:t.connection,scope:e}),r[3]=t.connection,r[4]=e,r[5]=o):o=r[5];let s=Ot(o),c;r[6]!==n||r[7]!==a?(c=e=>gX(a,n,e),r[6]=n,r[7]=a,r[8]=c):c=r[8];let l;return r[9]!==s||r[10]!==c?(l={result:s,submit:c},r[9]=s,r[10]=c,r[11]=l):l=r[11],l}function vX(e,t,n,r){let i=(0,$.c)(121),{scope:a,status:o,action:s,onBusy:c,onLookAgain:l,initialMessage:u,lastCommitMessage:d}=e,f=s===void 0?`commit`:s,p=u===void 0?``:u,m=d===void 0?``:d,h;i[0]!==f||i[1]!==p||i[2]!==m?(h=vJ(f,p,m),i[0]=f,i[1]=p,i[2]=m,i[3]=h):h=i[3];let g;i[4]===h?g=i[5]:(g={defaultValues:h},i[4]=h,i[5]=g);let _=Zd(g),v;i[6]===_?v=i[7]:(v=AJ(_),i[6]=_,i[7]=v);let y=v,b;i[8]===_?b=i[9]:(b=jJ(_),i[8]=_,i[9]=b);let x=b,{mode:S,message:C,amendMessage:w,excluded:T,added:E,groups:D}=Pu(_.store,wX),{done:O,activeGroup:k,ownHead:A,busy:j,error:M,drafted:N,draftedBy:P,editingFiles:F}=La(y),I;i[10]===_?I=i[11]:(I=e=>_.setFieldValue(`mode`,e),i[10]=_,i[11]=I);let L=I,R;i[12]===_?R=i[13]:(R=e=>_.setFieldValue(`message`,e),i[12]=_,i[13]=R);let z=R,B;i[14]===_?B=i[15]:(B=e=>_.setFieldValue(`amendMessage`,e),i[14]=_,i[15]=B);let V=B,H;i[16]===_?H=i[17]:(H=e=>_.setFieldValue(`excluded`,e),i[16]=_,i[17]=H);let U=H,W;i[18]===_?W=i[19]:(W=e=>_.setFieldValue(`added`,e),i[18]=_,i[19]=W);let G=W,K;i[20]===_?K=i[21]:(K=e=>_.setFieldValue(`groups`,e),i[20]=_,i[21]=K);let q=K,ee;i[22]===y?ee=i[23]:(ee=e=>y.update(t=>({...t,done:typeof e==`function`?e(t.done):e})),i[22]=y,i[23]=ee);let J=ee,te;i[24]===y?te=i[25]:(te=e=>y.update(t=>({...t,activeGroup:e})),i[24]=y,i[25]=te);let ne=te,re;i[26]===y?re=i[27]:(re=e=>y.update(t=>({...t,ownHead:e})),i[26]=y,i[27]=re);let ie=re,ae;i[28]===y?ae=i[29]:(ae=e=>y.update(t=>({...t,busy:e})),i[28]=y,i[29]=ae);let oe=ae,se;i[30]===y?se=i[31]:(se=e=>y.update(t=>({...t,error:e})),i[30]=y,i[31]=se);let ce=se,le=(e,t)=>{let n=t?.length===1?`1 selected file`:`${t?.length} selected files`;y.update(r=>({...r,drafted:{...r.drafted,[e]:t},draftedBy:{...r.draftedBy,[e]:t?`Generated by ${de(qr(me))?.find(e=>e.id===he)?.label??he} from ${n}`:null}}))},ue=S===`amend`?`amend`:`commit`,fe=MJ(a,ue,t),pe=_X(a,t,x),me=hX(t),he=hJ(de(qr(me)),r.value),ge;if(i[32]!==T||i[33]!==n){let e;i[35]===T?e=i[36]:(e=e=>!T.has(e.path),i[35]=T,i[36]=e),ge=new Set(n.filter(e).flatMap(CX)),i[32]=T,i[33]=n,i[34]=ge}else ge=i[34];let _e;i[37]===ge?_e=i[38]:(_e=[...ge],i[37]=ge,i[38]=_e);let ve=_e,ye;if(i[39]!==E||i[40]!==n){let e;i[42]===E?e=i[43]:(e=e=>E.has(e.path),i[42]=E,i[43]=e),ye=new Set(n.filter(e).flatMap(SX)),i[39]=E,i[40]=n,i[41]=ye}else ye=i[41];let be;i[44]===ye?be=i[45]:(be=[...ye],i[44]=ye,i[45]=be);let xe=ue===`amend`?be:ve,Se=ue===`amend`?w:C,Ce=!(!fe.operation||fe.canStartNew),we=fe.operation?.receipt,Te=j||pe.result.waiting||fe.recovered.waiting,Ee=D?N.groups:N.message,De;i[46]!==Ee||i[47]!==ue||i[48]!==O||i[49]!==D||i[50]!==o?(De=ue===`commit`&&Ee!=null&&yJ(o,Ee,new Set((D??[]).filter(e=>O.has(e.id)).flatMap(xX))),i[46]=Ee,i[47]=ue,i[48]=O,i[49]=D,i[50]=o,i[51]=De):De=i[51];let Oe=De,ke;i[52]!==n||i[53]!==D?(ke=D?n.filter(e=>!D.some(t=>t.paths.includes(e.path))):[],i[52]=n,i[53]=D,i[54]=ke):ke=i[54];let Ae=ke,je;i[55]!==ue||i[56]!==Se||i[57]!==O||i[58]!==D||i[59]!==S||i[60]!==xe||i[61]!==Oe||i[62]!==o?(je=Oe||(S===`groups`?!D?.length||D.filter(e=>!O.has(e.id)).some(bX):!Se.trim()||ue!==`amend`&&o.inProgress!==`merge`&&!xe.length),i[55]=ue,i[56]=Se,i[57]=O,i[58]=D,i[59]=S,i[60]=xe,i[61]=Oe,i[62]=o,i[63]=je):je=i[63];let Me=je,Ne;i[64]===o?Ne=i[65]:(Ne=Bt(`commit`,o),i[64]=o,i[65]=Ne);let Pe=Ne,Fe;i[66]===o?Fe=i[67]:(Fe=Bt(`amend`,o),i[66]=o,i[67]=Fe);let Ie=Fe,Le;i[68]===l?Le=i[69]:(Le=l?Ui({try:l,catch:yX}):void 0,i[68]=l,i[69]=Le);let Re;return i[70]!==k||i[71]!==E||i[72]!==w||i[73]!==Ie||i[74]!==Me||i[75]!==j||i[76]!==ue||i[77]!==Pe||i[78]!==ve||i[79]!==x||i[80]!==Se||i[81]!==O||i[82]!==N||i[83]!==P||i[84]!==F||i[85]!==M||i[86]!==T||i[87]!==n||i[88]!==_||i[89]!==pe||i[90]!==fe||i[91]!==D||i[92]!==Ae||i[93]!==C||i[94]!==S||i[95]!==he||i[96]!==me||i[97]!==c||i[98]!==A||i[99]!==xe||i[100]!==we||i[101]!==a||i[102]!==ne||i[103]!==G||i[104]!==V||i[105]!==oe||i[106]!==J||i[107]!==le||i[108]!==ce||i[109]!==U||i[110]!==q||i[111]!==z||i[112]!==L||i[113]!==ie||i[114]!==Oe||i[115]!==y||i[116]!==o||i[117]!==Le||i[118]!==Ce||i[119]!==Te?(Re={scope:a,status:o,onBusy:c,onLookAgain:Le,createId:li,mode:S,commitAction:ue,git:fe,generator:pe,models:me,model:he,message:C,amendMessage:w,editingFiles:F,excluded:T,added:E,groups:D,done:O,activeGroup:k,ownHead:A,busy:j,error:M,drafted:N,draftedBy:P,files:n,commitPaths:ve,paths:xe,currentMessage:Se,uncertain:Ce,receipt:we,working:Te,staleDraft:Oe,leftUncommitted:Ae,blocker:Me,commitModeBlocker:Pe,amendModeBlocker:Ie,controllers:x,form:_,setMode:L,setMessage:z,setAmendMessage:V,setExcluded:U,setAdded:G,setGroups:q,setDone:J,setActiveGroup:ne,setOwnHead:ie,setBusy:oe,setError:ce,setDrafted:le,state:y},i[70]=k,i[71]=E,i[72]=w,i[73]=Ie,i[74]=Me,i[75]=j,i[76]=ue,i[77]=Pe,i[78]=ve,i[79]=x,i[80]=Se,i[81]=O,i[82]=N,i[83]=P,i[84]=F,i[85]=M,i[86]=T,i[87]=n,i[88]=_,i[89]=pe,i[90]=fe,i[91]=D,i[92]=Ae,i[93]=C,i[94]=S,i[95]=he,i[96]=me,i[97]=c,i[98]=A,i[99]=xe,i[100]=we,i[101]=a,i[102]=ne,i[103]=G,i[104]=V,i[105]=oe,i[106]=J,i[107]=le,i[108]=ce,i[109]=U,i[110]=q,i[111]=z,i[112]=L,i[113]=ie,i[114]=Oe,i[115]=y,i[116]=o,i[117]=Le,i[118]=Ce,i[119]=Te,i[120]=Re):Re=i[120],Re}function yX(e){return new Rt(e,Un(e))}function bX(e){return!e.message.trim()||!e.paths.length}function xX(e){return e.paths}function SX(e){return e.paths}function CX(e){return e.paths}function wX(e){return e.values}function TX(e,t,n,r){let i=(0,$.c)(46),a=vX(e,t,n,r),{state:o,form:s,commitAction:c,setMode:l,setGroups:u,setDrafted:d,setAmendMessage:f,setMessage:p,setAdded:m,setExcluded:h}=a,g,_,v,y;i[0]===a?(g=i[1],_=i[2],v=i[3],y=i[4]):(g=()=>xo(me(a)),_=()=>xo(Re(a,a.mode===`groups`?`groups`:`message`)),v=()=>xo(ft(a)),y=()=>xo(hn(a)),i[0]=a,i[1]=g,i[2]=_,i[3]=v,i[4]=y);let b;i[5]===o?b=i[6]:(b=()=>o.update(EX),i[5]=o,i[6]=b);let x;i[7]!==c||i[8]!==f||i[9]!==p?(x=e=>{c===`amend`?f(e):p(e)},i[7]=c,i[8]=f,i[9]=p,i[10]=x):x=i[10];let S;i[11]!==d||i[12]!==u||i[13]!==l?(S=e=>{(e===`single`||e===`amend`||e===`groups`)&&(l(e),e===`single`&&(u(null),d(`groups`,null)))},i[11]=d,i[12]=u,i[13]=l,i[14]=S):S=i[14];let C;i[15]!==c||i[16]!==s||i[17]!==m||i[18]!==h?(C=(e,t)=>{if(c===`amend`){let n=new Set(s.state.values.added);t?n.add(e):n.delete(e),m(n)}else{let n=new Set(s.state.values.excluded);t?n.delete(e):n.add(e),h(n)}},i[15]=c,i[16]=s,i[17]=m,i[18]=h,i[19]=C):C=i[19];let w,T,E,D;i[20]!==s||i[21]!==u?(E=e=>u(s.state.values.groups?.filter(t=>t.id!==e)??null),D=(e,t)=>u(s.state.values.groups?.map(n=>n.id===e?{...n,message:t}:n)??null),w=(e,t)=>u(s.state.values.groups?.map(n=>({...n,paths:[...n.paths.filter(t=>!e.includes(t)),...n.id===t?e:[]]}))??null),T=()=>u([...s.state.values.groups??[],{id:li(),message:``,paths:[]}]),i[20]=s,i[21]=u,i[22]=w,i[23]=T,i[24]=E,i[25]=D):(w=i[22],T=i[23],E=i[24],D=i[25]);let O;i[26]!==d||i[27]!==u||i[28]!==l?(O=()=>{l(`single`),u(null),d(`groups`,null)},i[26]=d,i[27]=u,i[28]=l,i[29]=O):O=i[29];let k;return i[30]!==r.set||i[31]!==a||i[32]!==g||i[33]!==_||i[34]!==w||i[35]!==T||i[36]!==O||i[37]!==v||i[38]!==y||i[39]!==b||i[40]!==x||i[41]!==S||i[42]!==C||i[43]!==E||i[44]!==D?(k={...a,messageLimit:rs,groupLimit:20,commit:g,generate:_,lookAgain:v,checkOutcome:y,setModel:r.set,toggleEditingFiles:b,setCurrentMessage:x,setMode:S,setIncluded:C,removeGroup:E,setGroupMessage:D,moveFile:w,addGroup:T,clearGroups:O},i[30]=r.set,i[31]=a,i[32]=g,i[33]=_,i[34]=w,i[35]=T,i[36]=O,i[37]=v,i[38]=y,i[39]=b,i[40]=x,i[41]=S,i[42]=C,i[43]=E,i[44]=D,i[45]=k):k=i[45],k}function EX(e){return{...e,editingFiles:!e.editingFiles}}var DX=dt(e=>Oe(t=>{t.addFinalizer(()=>{for(let t of e)t.abort();e.clear()})}));function OX(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=DX(e),t[0]=e,t[1]=n),Lt(n)}function kX(e){let t=(0,$.c)(113),{status:n,liveBranch:r,onLookAgain:i}=e,{preferences:a,setPreference:o}=Bu(),s=e.context,c;t[0]===e.status.changes?c=t[1]:(c=$v(e.status.changes),t[0]=e.status.changes,t[1]=c);let l;t[2]===o?l=t[3]:(l=e=>o(`commitModel`,e),t[2]=o,t[3]=l);let u;t[4]!==a.commitModel||t[5]!==l?(u={value:a.commitModel,set:l},t[4]=a.commitModel,t[5]=l,t[6]=u):u=t[6];let d=TX(e,s,c,u);OX(d.controllers);let[f,p]=(0,Z.useState)(d.mode===`groups`),m=na(e.context),{mode:h,commitAction:g,git:_,model:v,groups:y,done:b,commitPaths:x,uncertain:S,receipt:C,working:w,error:T,staleDraft:E,blocker:D,commitModeBlocker:O,amendModeBlocker:k}=d,A=O!=null,j=!A,M;t[7]===j?M=t[8]:(M={value:`single`,label:`Single commit`,available:j},t[7]=j,t[8]=M);let N=k==null,P;t[9]===N?P=t[10]:(P={value:`amend`,label:`Amend last`,available:N},t[9]=N,t[10]=P);let F=!A&&!!v,I=x.length>0,L;t[11]!==F||t[12]!==I?(L={value:`groups`,label:`Use groups`,available:F,ready:I},t[11]=F,t[12]=I,t[13]=L):L=t[13];let R;t[14]!==L||t[15]!==M||t[16]!==P?(R=[M,P,L],t[14]=L,t[15]=M,t[16]=P,t[17]=R):R=t[17];let z;t[18]!==h||t[19]!==R?(z=R.filter(e=>e.available||e.value===h),t[18]=h,t[19]=R,t[20]=z):z=t[20];let B=z,V,H;t[21]!==D||t[22]!==d||t[23]!==S||t[24]!==w||t[25]!==m?(V=e=>{e.preventDefault(),m||D||w||S||d.commit()},H=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),m||D||w||S||d.commit())},t[21]=D,t[22]=d,t[23]=S,t[24]=w,t[25]=m,t[26]=V,t[27]=H):(V=t[26],H=t[27]);let U=g===`amend`?`Amend last commit`:`Commit changes`,W;t[28]===U?W=t[29]:(W=(0,Q.jsx)(wz,{children:U}),t[28]=U,t[29]=W);let G=g===`amend`?`The last commit is replaced by one with this message and the files you add.`:`Committed steps fold away in the review and show up in History.`,K;t[30]===G?K=t[31]:(K=(0,Q.jsx)(Tz,{children:G}),t[30]=G,t[31]=K);let q;t[32]!==W||t[33]!==K?(q=(0,Q.jsxs)(Sz,{children:[W,K]}),t[32]=W,t[33]=K,t[34]=q):q=t[34];let ee=r??void 0,J;t[35]===ee?J=t[36]:(J=Ky(ee,null),t[35]=ee,t[36]=J);let te;t[37]===J?te=t[38]:(te=(0,Q.jsx)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2 text-caption`,children:(0,Q.jsx)(LY,{tracking:J})}),t[37]=J,t[38]=te);let ne;t[39]!==d.setMode||t[40]!==h||t[41]!==B||t[42]!==n.inProgress||t[43]!==w?(ne=n.inProgress!==`merge`&&B.length>1&&(0,Q.jsx)(Nu,{value:h,onValueChange:d.setMode,children:(0,Q.jsx)(kd,{className:`w-full`,children:B.map(e=>(0,Q.jsx)(hd,{value:e.value,className:`flex-1`,disabled:w||!e.available||e.ready===!1,children:e.label},e.value))})}),t[39]=d.setMode,t[40]=h,t[41]=B,t[42]=n.inProgress,t[43]=w,t[44]=ne):ne=t[44];let re=w||S,ie;t[45]!==d||t[46]!==f||t[47]!==h?(ie=h===`groups`?(0,Q.jsx)(VX,{form:d}):(0,Q.jsx)(MX,{form:d,onMessage:f?void 0:e=>{e.focus(),p(!0)}}),t[45]=d,t[46]=f,t[47]=h,t[48]=ie):ie=t[48];let ae;t[49]!==re||t[50]!==ie?(ae=(0,Q.jsx)(`fieldset`,{disabled:re,className:`flex min-w-0 flex-col gap-3`,children:ie}),t[49]=re,t[50]=ie,t[51]=ae):ae=t[51];let oe;t[52]!==g||t[53]!==d||t[54]!==m?(oe=g===`commit`&&(0,Q.jsx)(NX,{form:d,writeBlock:m}),t[52]=g,t[53]=d,t[54]=m,t[55]=oe):oe=t[55];let se;t[56]===E?se=t[57]:(se=E&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-graph-4`,children:`The worktree changed since this draft was proposed. Generate it again before committing.`}),t[56]=E,t[57]=se);let ce;t[58]!==g||t[59]!==e?(ce=qX(e,g)&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:qX(e,g)}),t[58]=g,t[59]=e,t[60]=ce):ce=t[60];let le;t[61]!==T||t[62]!==C?(le=C&&!(T&&lr(C))&&(0,Q.jsxs)(`div`,{role:`status`,className:`text-sm`,children:[(0,Q.jsx)(`p`,{children:C.state}),C.progress.map(jX)]}),t[61]=T,t[62]=C,t[63]=le):le=t[63];let ue;t[64]!==C||t[65]!==S?(ue=S&&!C&&(0,Q.jsx)(`p`,{role:`status`,children:`Outcome not yet confirmed`}),t[64]=C,t[65]=S,t[66]=ue):ue=t[66];let de;t[67]===T?de=t[68]:(de=T?(0,Q.jsx)(HJ,{text:Un(T)}):null,t[67]=T,t[68]=de);let fe;t[69]!==d.lookAgain||t[70]!==i||t[71]!==C||t[72]!==E||t[73]!==w?(fe=(E||C&&Tc(C))&&i&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:w,onClick:d.lookAgain,children:`Look again`}),t[69]=d.lookAgain,t[70]=i,t[71]=C,t[72]=E,t[73]=w,t[74]=fe):fe=t[74];let pe;t[75]!==d.checkOutcome||t[76]!==_.operation||t[77]!==C||t[78]!==w?(pe=_.operation&&!w&&!(C&&ye(C))&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,onClick:d.checkOutcome,children:`Check outcome`}),t[75]=d.checkOutcome,t[76]=_.operation,t[77]=C,t[78]=w,t[79]=pe):pe=t[79];let me;t[80]!==D||t[81]!==b||t[82]!==y||t[83]!==h||t[84]!==C||t[85]!==n.changes||t[86]!==n.inProgress||t[87]!==S||t[88]!==w||t[89]!==m?(me=!!m||w||S||!!(C&&Tc(C))||D||n.inProgress!==`merge`&&n.changes.some(AX)||!!(h===`groups`&&y?.every(e=>b.has(e.id))),t[80]=D,t[81]=b,t[82]=y,t[83]=h,t[84]=C,t[85]=n.changes,t[86]=n.inProgress,t[87]=S,t[88]=w,t[89]=m,t[90]=me):me=t[90];let he;t[91]===d?he=t[92]:(he=JX(d),t[91]=d,t[92]=he);let ge;t[93]!==me||t[94]!==he||t[95]!==m?(ge=(0,Q.jsx)(X,{type:`submit`,className:`self-end`,"aria-description":m,disabled:me,children:he}),t[93]=me,t[94]=he,t[95]=m,t[96]=ge):ge=t[96];let _e;return t[97]!==V||t[98]!==H||t[99]!==q||t[100]!==te||t[101]!==ne||t[102]!==ae||t[103]!==oe||t[104]!==se||t[105]!==ce||t[106]!==le||t[107]!==ue||t[108]!==de||t[109]!==fe||t[110]!==pe||t[111]!==ge?(_e=(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:V,onKeyDown:H,children:[q,te,ne,ae,oe,se,ce,le,ue,de,fe,pe,ge]}),t[97]=V,t[98]=H,t[99]=q,t[100]=te,t[101]=ne,t[102]=ae,t[103]=oe,t[104]=se,t[105]=ce,t[106]=le,t[107]=ue,t[108]=de,t[109]=fe,t[110]=pe,t[111]=ge,t[112]=_e):_e=t[112],_e}function AX(e){return e.scope===`unmerged`}function jX(e){return(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function MX(e){let t=(0,$.c)(50),{form:n,onMessage:r}=e,{commitAction:i,editingFiles:a,excluded:o,added:s,files:c,paths:l,currentMessage:u,working:d}=n,f=i===`amend`?`Files to add`:`Files`,p;t[0]===f?p=t[1]:(p=(0,Q.jsx)(`span`,{className:`font-medium`,children:f}),t[0]=f,t[1]=p);let m;t[2]!==c.length||t[3]!==l.length?(m=(0,Q.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,l.length,` of `,c.length,`)`]}),t[2]=c.length,t[3]=l.length,t[4]=m):m=t[4];let h;t[5]!==i||t[6]!==a||t[7]!==c.length||t[8]!==n||t[9]!==d?(h=i===`commit`&&c.length>0&&(0,Q.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,className:`ml-auto`,disabled:d,onClick:()=>n.toggleEditingFiles(),children:a?`Done`:`Edit`}),t[5]=i,t[6]=a,t[7]=c.length,t[8]=n,t[9]=d,t[10]=h):h=t[10];let g;t[11]!==p||t[12]!==m||t[13]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-caption`,children:[p,m,h]}),t[11]=p,t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;if(t[15]!==s||t[16]!==i||t[17]!==a||t[18]!==o||t[19]!==c||t[20]!==n){let e;t[22]!==s||t[23]!==i||t[24]!==a||t[25]!==o||t[26]!==n?(e=e=>{let t=i===`amend`?s.has(e.path):!o.has(e.path),r=i===`amend`||a,c=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Gk,{path:e.path,className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:e.path}),(0,Q.jsx)(`span`,{"aria-hidden":r,className:`shrink-0 text-muted-foreground`,children:GX(e.kind,t,i)})]});return r?(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 rounded-lg px-2 py-1 text-xs hover:bg-muted`,children:[(0,Q.jsx)(pY,{checked:t,onCheckedChange:t=>n.setIncluded(e.path,t===!0)}),c]},e.path):(0,Q.jsx)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-lg px-2 py-1 text-xs`,children:c},e.path)},t[22]=s,t[23]=i,t[24]=a,t[25]=o,t[26]=n,t[27]=e):e=t[27],_=c.map(e),t[15]=s,t[16]=i,t[17]=a,t[18]=o,t[19]=c,t[20]=n,t[21]=_}else _=t[21];let v;t[28]===_?v=t[29]:(v=(0,Q.jsx)(`div`,{className:`max-h-40 overflow-auto rounded-xl border p-1`,children:_}),t[28]=_,t[29]=v);let y;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(Qa,{htmlFor:`commit-message`,children:`Message`}),t[30]=y):y=t[30];let b;t[31]!==i||t[32]!==n.draftedBy?(b=i===`commit`&&n.draftedBy.message&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.draftedBy.message}),t[31]=i,t[32]=n.draftedBy,t[33]=b):b=t[33];let x;t[34]===r?x=t[35]:(x=e=>{e&&r?.(e)},t[34]=r,t[35]=x);let S;t[36]===n?S=t[37]:(S=e=>n.setCurrentMessage(e.target.value),t[36]=n,t[37]=S);let C;t[38]!==u||t[39]!==n.messageLimit||t[40]!==x||t[41]!==S?(C=(0,Q.jsx)(gH,{"data-autofocus":``,ref:x,id:`commit-message`,value:u,onChange:S,rows:4,maxLength:n.messageLimit,placeholder:`Describe what changed and why`}),t[38]=u,t[39]=n.messageLimit,t[40]=x,t[41]=S,t[42]=C):C=t[42];let w;t[43]!==C||t[44]!==b?(w=(0,Q.jsxs)(Oo,{children:[y,b,C]}),t[43]=C,t[44]=b,t[45]=w):w=t[45];let T;return t[46]!==w||t[47]!==g||t[48]!==v?(T=(0,Q.jsxs)(Q.Fragment,{children:[g,v,w]}),t[46]=w,t[47]=g,t[48]=v,t[49]=T):T=t[49],T}function NX(e){let t=(0,$.c)(31),{form:n,writeBlock:r}=e,{models:i,model:a}=n,o,s,c,l,u;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r){let e=de(qr(i));o=!e&&!Mi(i);let d;t[9]!==n||t[10]!==r?(d=r??RX(n),t[9]=n,t[10]=r,t[11]=d):d=t[11],s=d;let f;t[12]!==n||t[13]!==r?(f=!!r||zX(n),t[12]=n,t[13]=r,t[14]=f):f=t[14];let p=f;c=`flex flex-wrap items-center gap-2`;let m=o||p||n.working||n.uncertain,h;t[15]===n?h=t[16]:(h=()=>n.generate(),t[15]=n,t[16]=h);let g;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(T_,{}),t[17]=g):g=t[17];let _=n.generator.result.waiting?`Generating…`:`Generate with AI`;t[18]!==m||t[19]!==h||t[20]!==_||t[21]!==r?(l=(0,Q.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,disabled:m,"aria-description":r,onClick:h,children:[g,_]}),t[18]=m,t[19]=h,t[20]=_,t[21]=r,t[22]=l):l=t[22],u=(o||!!e?.length)&&(0,Q.jsxs)(oa,{items:e?.map(LX)??[],value:a??null,reselect:!0,disabled:!e?.length||n.working||n.uncertain,onValueChange:n.setModel,children:[(0,Q.jsx)(ni,{"aria-label":`Commit model`,className:`w-auto max-w-48`,size:`sm`,children:(0,Q.jsx)(ec,{placeholder:o||e?.length?`Choose a model`:`No coding CLI available`})}),(0,Q.jsx)(Zi,{children:mJ(e?.filter(IX)??[]).map(PX)})]}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];let d;t[23]!==o||t[24]!==s?(d=!o&&s&&(0,Q.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,role:`status`,children:s}),t[23]=o,t[24]=s,t[25]=d):d=t[25];let f;return t[26]!==c||t[27]!==l||t[28]!==u||t[29]!==d?(f=(0,Q.jsxs)(`div`,{className:c,children:[l,u,d]}),t[26]=c,t[27]=l,t[28]=u,t[29]=d,t[30]=f):f=t[30],f}function PX(e){let[t,n]=e;return(0,Q.jsxs)(Vr,{children:[(0,Q.jsx)(uc,{children:t}),n.map(FX)]},t)}function FX(e){return(0,Q.jsx)(Ps,{value:e.id,children:e.label},e.id)}function IX(e){return!e.id.endsWith(`:default`)}function LX(e){return{value:e.id,label:e.label}}function RX({models:e,model:t}){if(Mi(e))return`Could not load coding CLI models.`;let n=de(qr(e));return!n||t||n.some(e=>!e.id.endsWith(`:default`))?null:`No coding CLI available.`}function zX(e){return RX(e)!==null||!e.model||e.paths.length===0}function BX(e,t){return e?`Groups were not proposed.`:t?`Proposing commits…`:`Generate groups with AI, then review each message and file before committing.`}function VX(e){let t=(0,$.c)(34),{form:n}=e,{groups:r,done:i,activeGroup:a,files:o,leftUncommitted:s,error:c}=n;if(r===null){let e;t[0]!==c||t[1]!==n.working?(e=BX(c,n.working),t[0]=c,t[1]=n.working,t[2]=e):e=t[2];let r;return t[3]===e?r=t[4]:(r=(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:e}),t[3]=e,t[4]=r),r}let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={value:`uncommitted`,label:`Leave uncommitted`},t[5]=l):l=t[5];let u;t[6]===r?u=t[7]:(u=[l,...r.map(WX)],t[6]=r,t[7]=u);let d=u,f;t[8]===n.draftedBy.groups?f=t[9]:(f=n.draftedBy.groups&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.draftedBy.groups}),t[8]=n.draftedBy.groups,t[9]=f);let p;t[10]!==a||t[11]!==d||t[12]!==i||t[13]!==o||t[14]!==n||t[15]!==r?(p=r.map((e,t)=>(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-lg border p-3`,"aria-label":`Commit ${t+1}`,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Commit `,t+1,KX(e.id,i,a)]}),e.paths.length===0&&i.size===0&&(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n.removeGroup(e.id),children:`Remove empty group`}),(0,Q.jsx)(gH,{"aria-label":`Message for commit ${t+1}`,value:e.message,disabled:i.has(e.id),required:!0,maxLength:n.messageLimit,onChange:t=>n.setGroupMessage(e.id,t.target.value)}),o.filter(t=>e.paths.includes(t.path)).map(t=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:t.path}),(0,Q.jsxs)(oa,{items:d,value:e.id,disabled:i.size>0,onValueChange:e=>{e&&n.moveFile(t.paths,e)},children:[(0,Q.jsx)(ni,{size:`sm`,"aria-label":`Commit for ${t.path}`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsxs)(Zi,{children:[(0,Q.jsx)(Ps,{value:`uncommitted`,children:`Leave uncommitted`}),r.map(UX)]})]})]},t.path))]},e.id)),t[10]=a,t[11]=d,t[12]=i,t[13]=o,t[14]=n,t[15]=r,t[16]=p):p=t[16];let m;t[17]!==d||t[18]!==i.size||t[19]!==n||t[20]!==r||t[21]!==s?(m=s.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-lg border border-dashed p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Left uncommitted`}),s.map(e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:e.path}),(0,Q.jsxs)(oa,{items:d,value:`uncommitted`,disabled:i.size>0,onValueChange:t=>{t&&n.moveFile(e.paths,t)},children:[(0,Q.jsx)(ni,{size:`sm`,"aria-label":`Commit for ${e.path}`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsxs)(Zi,{children:[(0,Q.jsx)(Ps,{value:`uncommitted`,children:`Leave uncommitted`}),r.map(HX)]})]})]},e.path))]}),t[17]=d,t[18]=i.size,t[19]=n,t[20]=r,t[21]=s,t[22]=m):m=t[22];let h;t[23]!==i.size||t[24]!==n.addGroup||t[25]!==n.clearGroups||t[26]!==n.groupLimit||t[27]!==r.length?(h=i.size===0&&(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,disabled:r.length>=n.groupLimit,onClick:n.addGroup,children:[(0,Q.jsx)(d_,{}),`Add group`]}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:n.clearGroups,children:`Single commit`})]}),t[23]=i.size,t[24]=n.addGroup,t[25]=n.clearGroups,t[26]=n.groupLimit,t[27]=r.length,t[28]=h):h=t[28];let g;return t[29]!==f||t[30]!==p||t[31]!==m||t[32]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,m,h]}),t[29]=f,t[30]=p,t[31]=m,t[32]=h,t[33]=g):g=t[33],g}function HX(e,t){return(0,Q.jsxs)(Ps,{value:e.id,children:[`Commit `,t+1]},e.id)}function UX(e,t){return(0,Q.jsxs)(Ps,{value:e.id,children:[`Commit `,t+1]},e.id)}function WX(e,t){return{value:e.id,label:`Commit ${t+1}`}}function GX(e,t,n){return t?e.replaceAll(`-`,` `):n===`amend`?`Not added`:`Excluded`}function KX(e,t,n){return t.has(e)?` · committed`:n===e?` · in progress`:``}function qX({status:e,liveBranch:t,replacedSubject:n},r){return r===`amend`?`Amending replaces the last commit${n?`: ${n}`:``}. ${t?.upstream&&t.ahead===0?`This commit is already on the known upstream; amending rewrites shared history.`:`Unselected staged changes stay staged.`}`:e.inProgress===`merge`?`This finishes the merge and commits every staged resolution, including staged files outside your selection.`:Yt(e)}function JX({working:e,generator:t,groups:n,commitAction:r}){return e&&!t.result.waiting?r===`amend`?`Amending…`:`Committing…`:n&&r===`commit`?`Commit groups in order`:r===`amend`?`Amend last commit`:`Commit selected files`}function YX(e){let t=(0,$.c)(15),{scope:n,context:r,entry:i,status:a,current:o,onBusy:s,onLookAgain:c}=e;if(i===`switch`||i===`discard`||i===`fetch`||i===`pull`||i===`push`)return null;if(i===`commit`||i===`amend`){let e;return t[0]!==r||t[1]!==i||t[2]!==s||t[3]!==c||t[4]!==n||t[5]!==a?(e=(0,Q.jsx)(XX,{scope:n,context:r,action:i,status:a,onBusy:s,onLookAgain:c}),t[0]=r,t[1]=i,t[2]=s,t[3]=c,t[4]=n,t[5]=a,t[6]=e):e=t[6],e}let l;return t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==s||t[11]!==c||t[12]!==n||t[13]!==a?(l=(0,Q.jsx)(QX,{scope:n,context:r,action:i,status:a,current:o,onBusy:s,onLookAgain:c},i),t[7]=r,t[8]=o,t[9]=i,t[10]=s,t[11]=c,t[12]=n,t[13]=a,t[14]=l):l=t[14],l}function XX(e){let t=(0,$.c)(17),{scope:n,context:r,action:i,status:a,onBusy:o,onLookAgain:s}=e,c;t[0]===i?c=t[1]:(c=(0,Q.jsx)(ZX,{action:i}),t[0]=i,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Be,{label:`Reading commit details`}),t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=(0,Q.jsxs)(Q.Fragment,{children:[c,l]}),t[3]=c,t[4]=u);let d;t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s||t[9]!==n||t[10]!==a?(d=e=>{let t=e.headCommit;return i===`amend`&&!t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ZX,{action:i}),(0,Q.jsx)(`p`,{role:`alert`,children:`The last commit could not be read. Close and try again.`})]}):(0,Q.jsx)(kX,{scope:n,context:r,action:i,status:a,liveBranch:e.branch??a.branch,initialMessage:i===`amend`&&t?[t.subject,t.body].filter(Boolean).join(`
1343
+ [data-code] [data-line] { padding-inline: calc(var(--spacing) * 3); }`}}function qL(e){let t=(0,$.c)(13),{text:n}=e,[r,i]=(0,Z.useState)(!1),a;t[0]===n?a=t[1]:(a=()=>{Zt(n,`code`),i(!0)},t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>i(!1),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":`Copy code`,onClick:a,onMouseLeave:o}),t[3]=a,t[4]=s);let c;t[5]===r?c=t[6]:(c=r?(0,Q.jsx)(Dn,{}):(0,Q.jsx)(Bs,{}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,Q.jsx)(Ze,{render:s,children:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Copy code`}),t[10]=u):u=t[10];let d;return t[11]===l?d=t[12]:(d=(0,Q.jsxs)(ot,{children:[l,u]}),t[11]=l,t[12]=d),d}var JL={"alert-note":{label:`Note`,icon:Gr,tone:`border-graph-1 [--alert:var(--graph-1)]`},"alert-tip":{label:`Tip`,icon:Fg,tone:`border-graph-2 [--alert:var(--graph-2)]`},"alert-important":{label:`Important`,icon:Zg,tone:`border-graph-3 [--alert:var(--graph-3)]`},"alert-warning":{label:`Warning`,icon:qi,tone:`border-graph-4 [--alert:var(--graph-4)]`},"alert-caution":{label:`Caution`,icon:t_,tone:`border-del-fg [--alert:var(--del-fg)]`}};function YL(e){let t=(0,$.c)(16),{role:n,children:r}=e,i=JL[n];if(!i){let e;return t[0]===r?e=t[1]:(e=(0,Q.jsx)(`div`,{children:r}),t[0]=r,t[1]=e),e}let a=i.icon,o;t[2]===r?o=t[3]:([,...o]=r,t[2]=r,t[3]=o);let s=i.label,c;t[4]===i.tone?c=t[5]:(c=Y(`my-4 border-l-3 py-0.5 pl-4 [&>div>:first-child]:mt-0 [&>div>:last-child]:mb-0`,i.tone),t[4]=i.tone,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,Q.jsx)(a,{className:`size-4`,"aria-hidden":!0}),t[6]=a,t[7]=l);let u;t[8]!==i.label||t[9]!==l?(u=(0,Q.jsxs)(`p`,{className:`mb-1 flex items-center gap-1.5 font-medium text-(--alert)`,children:[l,i.label]}),t[8]=i.label,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==i.label||t[12]!==o||t[13]!==c||t[14]!==u?(d=(0,Q.jsxs)(`div`,{role:`note`,"aria-label":s,className:c,children:[u,o]}),t[11]=i.label,t[12]=o,t[13]=c,t[14]=u,t[15]=d):d=t[15],d}function XL(e){let t=(0,$.c)(5),{alt:n,reason:r}=e,i=n||r,a=n?`${n} · ${r}`:r,o;t[0]===a?o=t[1]:(o=(0,Q.jsx)(`span`,{className:`wrap-anywhere`,children:a}),t[0]=a,t[1]=o);let s;return t[2]!==i||t[3]!==o?(s=(0,Q.jsx)(`span`,{role:`img`,"aria-label":i,className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-0.5 align-middle text-caption text-muted-foreground`,children:o}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ZL(e,t){let n=(0,$.c)(13),r=e&&t?.kind===`repository`?t.path:void 0,i;n[0]===e?.scope?i=n[1]:(i=e?.scope??{projectId:``,worktreeId:``},n[0]=e?.scope,n[1]=i);let a=Jk(e?.connection??null,i,e?.path??``,r);if(t?.kind===`external`){let e;return n[2]===t.url?e=n[3]:(e={kind:`ready`,url:t.url},n[2]=t.url,n[3]=e),e}if(r===void 0||a===void 0){let e=t?.kind===`repository`?`not in this view`:`blocked`,r;return n[4]===e?r=n[5]:(r={kind:`failed`,reason:e},n[4]=e,n[5]=r),r}if(Xi(a)){let e;return n[6]===Symbol.for(`react.memo_cache_sentinel`)?(e={kind:`loading`},n[6]=e):e=n[6],e}if(Mi(a)){let e;n[7]===a.cause?e=n[8]:(e=Td(Ra(a.cause)),n[7]=a.cause,n[8]=e);let t;return n[9]===e?t=n[10]:(t={kind:`failed`,reason:e},n[9]=e,n[10]=t),t}let o;if(n[11]!==a){let e=Kt(qr(a));o=e===null?{kind:`failed`,reason:`not found or not previewable`}:{kind:`ready`,url:Kk(e)},n[11]=a,n[12]=o}else o=n[12];return o}function QL(e){let t=(0,$.c)(14),{element:n,file:r}=e,i=ZL(r,n.source),[a,o]=(0,Z.useState)(),s=typeof n.props.alt==`string`?n.props.alt:``;if(i.kind===`failed`){let e;return t[0]!==s||t[1]!==i.reason?(e=(0,Q.jsx)(XL,{alt:s,reason:i.reason}),t[0]=s,t[1]=i.reason,t[2]=e):e=t[2],e}if(i.kind===`loading`){let e=s||`Loading image`,n;return t[3]===e?n=t[4]:(n=(0,Q.jsx)(`span`,{"aria-busy":!0,"aria-label":e,className:`inline-block h-6 w-24 animate-pulse rounded bg-muted align-middle`}),t[3]=e,t[4]=n),n}if(a===i.url){let e;return t[5]===s?e=t[6]:(e=(0,Q.jsx)(XL,{alt:s,reason:`failed`}),t[5]=s,t[6]=e),e}let c;t[7]===i.url?c=t[8]:(c=()=>o(i.url),t[7]=i.url,t[8]=c);let l;return t[9]!==s||t[10]!==n.props||t[11]!==i.url||t[12]!==c?(l=(0,Q.jsx)(`img`,{...n.props,alt:s,src:i.url,loading:`lazy`,decoding:`async`,referrerPolicy:`no-referrer`,onError:c,className:`inline h-auto max-w-full align-middle`}),t[9]=s,t[10]=n.props,t[11]=i.url,t[12]=c,t[13]=l):l=t[13],l}function $L(e){let t=(0,$.c)(6),{element:n,file:r}=e,i=ZL(r,n.source);if(i.kind!==`ready`)return null;let{media:a,type:o}=n.props,s;t[0]===o?s=t[1]:(s=typeof o==`string`?{type:o}:{},t[0]=o,t[1]=s);let c=s,l;return t[2]!==a||t[3]!==i.url||t[4]!==c?(l=typeof a==`string`?(0,Q.jsx)(`source`,{media:a,srcSet:i.url,...c}):(0,Q.jsx)(`source`,{src:i.url,...c}),t[2]=a,t[3]=i.url,t[4]=c,t[5]=l):l=t[5],l}function eR(e){let t=(0,$.c)(12),{element:n,file:r,children:i}=e,a=n.source?.kind===`repository`,o=ZL(r,a?n.source:void 0),s=ZL(r,n.poster);if(a&&o.kind===`failed`){let e=n.tag===`video`?`Video`:`Audio`,r;return t[0]!==o.reason||t[1]!==e?(r=(0,Q.jsx)(XL,{alt:e,reason:o.reason}),t[0]=o.reason,t[1]=e,t[2]=r):r=t[2],r}if(a&&o.kind===`loading`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{className:`my-3 block aspect-video max-w-120 animate-pulse rounded-lg bg-muted`}),t[3]=e):e=t[3],e}let c;return t[4]!==i||t[5]!==a||t[6]!==n.props||t[7]!==n.tag||t[8]!==s.kind||t[9]!==s.url||t[10]!==o?(c=(0,Z.createElement)(n.tag,{...n.props,...a&&o.kind===`ready`?{src:o.url}:{},...s.kind===`ready`?{poster:s.url}:{},className:n.tag===`video`?`my-3 block h-auto max-w-full rounded-lg border bg-black`:`my-3 block w-full max-w-120`},...i),t[4]=i,t[5]=a,t[6]=n.props,t[7]=n.tag,t[8]=s.kind,t[9]=s.url,t[10]=o,t[11]=c):c=t[11],c}function tR(e){let t=(0,$.c)(32),{element:n,file:r,children:i}=e,a=n.link,o=n.role===`footnote-ref`||n.role===`footnote-backref`?`text-muted-foreground no-underline hover:text-foreground`:`text-brand underline decoration-brand/40 underline-offset-2 hover:decoration-brand`;if(a?.kind===`external`){let e;return t[0]!==i||t[1]!==o||t[2]!==n.props||t[3]!==a.url?(e=(0,Q.jsx)(`a`,{...n.props,href:a.url,target:`_blank`,rel:`noreferrer noopener`,className:o,children:i}),t[0]=i,t[1]=o,t[2]=n.props,t[3]=a.url,t[4]=e):e=t[4],e}if(a?.kind===`fragment`){let e;t[5]===a.hash?e=t[6]:(e=e=>{e.preventDefault(),nR(e.currentTarget,a.hash)},t[5]=a.hash,t[6]=e);let r;return t[7]!==i||t[8]!==o||t[9]!==n.props||t[10]!==a.hash||t[11]!==e?(r=(0,Q.jsx)(`a`,{...n.props,href:a.hash,className:o,onClick:e,children:i}),t[7]=i,t[8]=o,t[9]=n.props,t[10]=a.hash,t[11]=e,t[12]=r):r=t[12],r}if(a?.kind===`repository`&&r){let e;t[13]!==r||t[14]!==a.hash||t[15]!==a.path?(e=()=>r.openPath(a.path,a.hash),t[13]=r,t[14]=a.hash,t[15]=a.path,t[16]=e):e=t[16];let s=e,c=n.props,l=a.path,u;t[17]===o?u=t[18]:(u=Y(o,`cursor-pointer`),t[17]=o,t[18]=u);let d,f;t[19]===s?(d=t[20],f=t[21]):(d=e=>{e.preventDefault(),s()},f=e=>{e.key===`Enter`&&s()},t[19]=s,t[20]=d,t[21]=f);let p;return t[22]!==i||t[23]!==n.props||t[24]!==a.path||t[25]!==u||t[26]!==d||t[27]!==f?(p=(0,Q.jsx)(`a`,{...c,role:`link`,tabIndex:0,title:l,className:u,onClick:d,onKeyDown:f,children:i}),t[22]=i,t[23]=n.props,t[24]=a.path,t[25]=u,t[26]=d,t[27]=f,t[28]=p):p=t[28],p}let s;return t[29]!==i||t[30]!==n.props?(s=(0,Q.jsx)(`span`,{...n.props,children:i}),t[29]=i,t[30]=n.props,t[31]=s):s=t[31],s}function nR(e,t){let n=e.closest(`[data-markdown-root]`),r=TI(t);if(!n||r===void 0)return;let i=n.querySelector(`[id="${CSS.escape(r)}"]`)??n.querySelector(`[id="user-content-${CSS.escape(r)}"]`);if(!i)return;let a=n.closest(`[data-reader-scroll]`)??n.parentElement;for(;a&&a.scrollHeight<=a.clientHeight;)a=a.parentElement;a&&(a.scrollTop+=i.getBoundingClientRect().top-a.getBoundingClientRect().top-rR)}var rR=16,iR={h1:`mt-5 mb-2 text-lg font-semibold first:mt-0`,h2:`mt-5 mb-2 text-base font-semibold first:mt-0`,h3:`mt-4 mb-1.5 text-sm font-semibold`,h4:`mt-4 mb-1.5 text-sm font-semibold`,h5:`mt-3 mb-1 text-ui font-semibold`,h6:`mt-3 mb-1 text-ui font-semibold text-muted-foreground`,p:`my-2 leading-relaxed`,ul:`my-2 list-disc pl-5`,ol:`my-2 list-decimal pl-5`,li:`my-0.5`},aR={h1:`mt-8 mb-4 border-b pb-2 text-subpage-title font-semibold first:mt-0`,h2:`mt-8 mb-3 border-b pb-1.5 text-lead font-semibold tracking-pr-subheading first:mt-0`,h3:`mt-6 mb-2 text-section font-semibold`,h4:`mt-5 mb-2 text-prose font-semibold`,h5:`mt-5 mb-1.5 text-ui font-semibold`,h6:`mt-5 mb-1.5 text-ui font-semibold text-muted-foreground`,p:`my-3`,ul:`my-3 list-disc pl-6 [&_ul]:my-1 [&_ol]:my-1`,ol:`my-3 list-decimal pl-6 [&_ul]:my-1 [&_ol]:my-1`,li:`my-1 pl-0.5 marker:text-muted-foreground`},oR={li:`has-[>input[type=checkbox]]:list-none has-[>input[type=checkbox]]:-ml-5`,code:`rounded-sm bg-muted px-1 py-px font-mono text-[0.875em]`,kbd:`rounded border border-b-2 bg-muted px-1.5 py-px font-mono text-[0.8em] text-foreground`,blockquote:`my-4 border-l-3 pl-4 text-muted-foreground [&>:first-child]:mt-0 [&>:last-child]:mb-0 [&>p]:my-2`,hr:`my-6 border-t`,details:`my-4 rounded-lg border px-3 py-2 open:pb-3`,summary:`cursor-pointer font-medium select-none`,dl:`my-3`,dt:`mt-3 font-semibold`,dd:`mt-1 pl-4`,mark:`rounded-sm bg-graph-4/20 px-0.5 text-foreground`,sup:`text-[0.75em]`,sub:`text-[0.75em]`,figure:`my-4`,figcaption:`mt-1 text-caption text-muted-foreground`,input:`mr-1.5 size-3.5 translate-y-0.5 accent-brand`,thead:``,th:`sticky top-0 z-1 border-b bg-muted px-3 py-1.5 text-left font-medium whitespace-nowrap`,td:`max-w-96 border-b px-3 py-1.5 align-top`,tr:`last:[&>td]:border-b-0`,caption:`px-3 py-1.5 text-left text-caption text-muted-foreground`};function sR(e,t){let n=t===`reader`?aR:iR;return(t,r,i)=>{if(t.role?.startsWith(`alert-`)&&t.role!==`alert-title`)return t.role===`alert-content`?(0,Q.jsx)(`div`,{children:r},i):(0,Q.jsx)(YL,{role:t.role,children:r},i);if(t.role===`footnotes`)return(0,Q.jsx)(`section`,{className:`mt-8 border-t pt-4 text-ui text-muted-foreground [&_li]:my-1 [&_p]:my-1`,children:r},i);switch(t.tag){case`a`:return(0,Q.jsx)(tR,{element:t,file:e,children:r},i);case`img`:return(0,Q.jsx)(QL,{element:t,file:e},i);case`source`:return(0,Q.jsx)($L,{element:t,file:e},i);case`video`:case`audio`:return(0,Q.jsx)(eR,{element:t,file:e,children:r},i);case`pre`:return(0,Q.jsx)(GL,{language:t.language??`text`,children:r},i);case`table`:return(0,Q.jsx)(`div`,{className:`my-4 max-h-144 max-w-full overflow-auto rounded-lg border`,children:(0,Q.jsx)(`table`,{className:`w-max min-w-full border-separate border-spacing-0 text-ui`,children:r})},i)}return(0,Z.createElement)(t.tag,{key:i,...t.props,className:Y(n[t.tag]??oR[t.tag],n[t.tag]&&oR[t.tag],t.props.className===`sr-only`&&`sr-only`)},...r)}}function cR(e){let t=(0,$.c)(11),{text:n,className:r,file:i,variant:a}=e,o=a===void 0?`compact`:a,s=o===`reader`?`text-prose break-words`:`text-ui`,c;t[0]!==r||t[1]!==s?(c=Y(`min-w-0 text-foreground`,s,r),t[0]=r,t[1]=s,t[2]=c):c=t[2];let l=i?.path??``,u;t[3]!==i||t[4]!==l||t[5]!==n||t[6]!==o?(u=BL(n,l,sR(i,o)),t[3]=i,t[4]=l,t[5]=n,t[6]=o,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==u?(d=(0,Q.jsx)(`div`,{"data-markdown-root":!0,className:c,children:u}),t[8]=c,t[9]=u,t[10]=d):d=t[10],d}function lR(e){return e.reduce((e,t)=>Math.min(e,t.level),1/0)}function uR(e){let t=e[0]?.level===1&&e.filter(e=>e.level===1).length===1?e.slice(1):e,n=lR(t),r=t.filter(e=>e.level<n+2);return r.length>=2?r:[]}function dR(e){let t=zL(e);return{document:t,outline:uR(t.headings??[])}}function fR(e,t){let n=e?.querySelector(`[data-markdown-root]`);n&&nR(n,`#${t}`)}function pR(e){let t=(0,$.c)(8),{outline:n}=e,r=lR(n),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`On this page`}),t[0]=i):i=t[0];let a;if(t[1]!==n||t[2]!==r){let e;t[4]===r?e=t[5]:(e=e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),fR(t.currentTarget.closest(`[data-reader-scroll]`),e.id)},style:{paddingLeft:`${(e.level-r)*.75+.75}rem`},className:`-ml-px block border-l border-transparent py-1 text-muted-foreground hover:border-foreground/40 hover:text-foreground`,children:(0,Q.jsx)(fr,{text:e.text,className:`block`})})},e.id),t[4]=r,t[5]=e),a=n.map(e),t[1]=n,t[2]=r,t[3]=a}else a=t[3];let o;return t[6]===a?o=t[7]:(o=(0,Q.jsxs)(`nav`,{"aria-label":`On this page`,className:`text-caption`,children:[i,(0,Q.jsx)(`ul`,{className:`flex flex-col border-l`,children:a})]}),t[6]=a,t[7]=o),o}function mR(e){let t=(0,$.c)(11),{outline:n,root:r}=e;if(n.length===0)return null;let i=lR(n),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Outline`,className:`@5xl/document:hidden`})}),children:(0,Q.jsx)(Ug,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Outline`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(bc,{children:`On this page`}),t[1]=o):o=t[1];let s;if(t[2]!==n||t[3]!==r||t[4]!==i){let e;t[6]!==r||t[7]!==i?(e=e=>(0,Q.jsx)(dn,{onSelect:()=>fR(r,e.id),style:{paddingLeft:`${(e.level-i)*.75+.5}rem`},children:(0,Q.jsx)(fr,{text:e.text,className:`min-w-0 flex-1`})},e.id),t[6]=r,t[7]=i,t[8]=e):e=t[8],s=n.map(e),t[2]=n,t[3]=r,t[4]=i,t[5]=s}else s=t[5];let c;return t[9]===s?c=t[10]:(c=(0,Q.jsxs)(Wt,{children:[a,(0,Q.jsx)(Ne,{align:`end`,className:`max-h-96 w-72`,children:(0,Q.jsxs)(ct,{children:[o,s]})})]}),t[9]=s,t[10]=c),c}var hR=[`wheel`,`touchstart`,`keydown`,`pointerdown`];function gR(e,t,n){let r=e.querySelector(`[data-markdown-root]`);if(!r)return;let i=e.scrollTop,a=()=>{t.anchor?nR(r,t.anchor):e.scrollTop=t.scrollTop,i=e.scrollTop};if(a(),!t.anchor&&t.scrollTop===0)return;let o=new ResizeObserver(a);o.observe(r),o.observe(e);let s=()=>{Math.abs(e.scrollTop-i)>2&&l()},c=()=>{o.disconnect(),e.removeEventListener(`scroll`,s);for(let t of hR)e.removeEventListener(t,l)},l=()=>{c(),n()};for(let t of hR)e.addEventListener(t,l,{passive:!0});return e.addEventListener(`scroll`,s,{passive:!0}),c}function _R(e){let t=(0,$.c)(18),{document:n,outline:r,file:i,attach:a}=e,o=wl(),s=`${i.scope.worktreeId}:${i.path}`,c;t[0]!==a||t[1]!==s||t[2]!==o?(c=e=>{if(a(e),!e)return;let t=o.place(s),n=t.anchor||Math.abs(e.scrollTop-t.scrollTop)>1?gR(e,t,()=>o.clearAnchor(s)):void 0,r=()=>{e.offsetParent!==null&&o.rememberScroll(s,e.scrollTop)};return e.addEventListener(`scroll`,r,{passive:!0}),()=>{n?.(),e.removeEventListener(`scroll`,r)}},t[0]=a,t[1]=s,t[2]=o,t[3]=c):c=t[3];let l=r.length>0&&`@5xl/document:max-w-5xl`,u;t[4]===l?u=t[5]:(u=Y(`mx-auto flex w-full justify-center gap-10 px-6 pt-6 pb-16`,l),t[4]=l,t[5]=u);let d;t[6]!==n||t[7]!==i?(d=(0,Q.jsx)(cR,{text:n,file:i,variant:`reader`,className:`w-full max-w-(--container-reading) min-w-0 flex-1`}),t[6]=n,t[7]=i,t[8]=d):d=t[8];let f;t[9]===r?f=t[10]:(f=r.length>0&&(0,Q.jsx)(`aside`,{className:`sticky top-6 hidden max-h-[calc(100svh-10rem)] w-52 shrink-0 self-start overflow-y-auto overscroll-contain @5xl/document:block`,children:(0,Q.jsx)(pR,{outline:r})}),t[9]=r,t[10]=f);let p;t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(`div`,{className:u,children:[d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==c||t[16]!==p?(m=(0,Q.jsx)(`div`,{"data-reader-scroll":!0,ref:c,className:`min-h-0 flex-1 overflow-auto [overflow-anchor:none]`,children:p}),t[15]=c,t[16]=p,t[17]=m):m=t[17],m}var vR=dt(e=>Oe(t=>e.paths.map(n=>t(Vs({...e,path:n}))))),yR=dt(e=>wc((t,n)=>{for(let t of e.paths)n.refresh(Vs({...e,path:t}));return null}));function bR(e,t,n){let r=(0,$.c)(14),i={connection:e,scope:t,paths:n},a=Ot(vR(i)),o=Da(yR(i)),s;if(r[0]!==n||r[1]!==a){let e;r[3]===a?e=r[4]:(e=(e,t)=>{let n=a[t],r=n?de(qr(n)):void 0;return r&&`text`in r?[[e,r.text]]:[]},r[3]=a,r[4]=e),s=new Map(n.flatMap(e)),r[0]=n,r[1]=a,r[2]=s}else s=r[2];let c;r[5]===a?c=r[6]:(c=a.some(Xi),r[5]=a,r[6]=c);let l;r[7]===a?l=r[8]:(l=a.some(Mi),r[7]=a,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u={contents:s,pending:c,failed:l,retry:o},r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u}var xR=(0,Z.lazy)(()=>Af(()=>import(`./file-editor-CqYmInQP.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function SR(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(kc,{label:`Opening the editor`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Q.jsx)(Z.Suspense,{fallback:n,children:(0,Q.jsx)(xR,{...e})}),t[1]=e,t[2]=r),r}var CR=/url\(\s*(['"]?)([^)'"]+)\1\s*\)|@import\s+(?:url\(\s*)?(['"])([^'"]+)\3\s*\)?\s*([^;]*);?/g,wR=`default-src 'none'; script-src 'unsafe-inline' data:; style-src 'unsafe-inline' data:; img-src data: blob:; media-src data: blob:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-src 'none'`;function TR(e){let t=e.join(` `);return e.length===0?wR:wR.replace(`img-src data: blob:;`,`img-src data: blob: ${t};`).replace(`media-src data: blob:;`,`media-src data: blob: ${t};`)}var ER=`img[src], script[src], source[src], video[src], audio[src], track[src], video[poster], image[href], input[type="image"][src]`;function DR(e,t,n){let r=window.document.implementation.createHTMLDocument(),i=r.createElement(`meta`);i.httpEquiv=`Content-Security-Policy`,i.content=t.run?TR(n):TR(n).replace(`script-src 'unsafe-inline' data:`,`script-src 'nonce-${t.nonce}'`);let a=r.createElement(`style`);a.textContent=`html, body { height: 100%; margin: 0; } iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: inherit; }`,r.head.replaceChildren(i,a),r.documentElement.style.colorScheme=`light dark`;let o=r.createElement(`iframe`);return o.title=`Preview content`,o.setAttribute(`aria-label`,`Preview content`),o.sandbox.add(`allow-scripts`),o.referrerPolicy=`no-referrer`,o.srcdoc=e,r.body.append(o),`<!doctype html>${r.documentElement.outerHTML}`}var OR=_s(`BrowserHtmlPreview.inlineAssets`)(function*(e,t,n){let r=new Set,i=new Map,a=0;function o(e,t){if(e.startsWith(`data:`))return null;let n=pI(t,e);if(n.kind===`fragment`)return null;if(n.kind!==`repository`)throw Error(`Not in the repository`);return n}function s(e,t){let n=[];for(let i of e.matchAll(CR)){let e=(i[2]??i[4]??``).trim();try{let r=o(e,t);r&&n.push(r.path)}catch{r.add(e)}}return n}function c(e){return new TextDecoder().decode(Uint8Array.from(atob(e.base64),e=>e.charCodeAt(0)))}function l(e){if(a+e>29360128)throw Error(`Expanded preview too large`);a+=e}function u(e,t,n){let r=o(e,t);if(r===null)return``;let a=i.get(r.path);if(!a||`url`in a||a.mediaType!==`text/css`)throw Error(`Unavailable`);if(n.includes(r.path))throw Error(`Circular stylesheet`);let s=f(c(a),r.path,[...n,r.path]);return l(s.length),s}function d(e,t){try{let n=o(e,t);if(n===null)return e;let r=i.get(n.path);if(!r||`mediaType`in r&&r.mediaType===`text/css`)throw Error(`Unavailable`);let a=Kk(r)+n.hash;return l(a.length),a}catch{return r.add(e),`data:,`}}function f(e,t,n=[]){let i=``,a=0;for(let o of e.matchAll(CR)){if(i+=e.slice(a,o.index),o[4]!==void 0){let e=(o[5]??``).trim();try{let r=u(o[4].trim(),t,n);i+=e?`@media ${e} {\n${r}\n}`:r}catch{r.add(o[4].trim())}}else i+=`url("${d((o[2]??``).trim(),t)}")`;a=o.index+o[0].length}return i+e.slice(a)}let p=new DOMParser().parseFromString(e,`text/html`);for(let e of p.querySelectorAll(`base, meta[http-equiv]`))e.remove();let m=[...p.querySelectorAll(`link[href]`)],h=m.filter(e=>(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/).includes(`stylesheet`)),g=m.filter(e=>(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/).includes(`icon`));for(let e of m)!h.includes(e)&&!g.includes(e)&&e.remove();let _=[...[...p.querySelectorAll(ER)].flatMap(e=>[`src`,`poster`,`href`].filter(t=>e.hasAttribute(t)&&(t!==`href`||e.tagName.toLowerCase()===`image`)).map(t=>({node:e,attribute:t}))),...g.map(e=>({node:e,attribute:`href`}))],v=[...p.querySelectorAll(`[srcset]`)],y=[...p.querySelectorAll(`style`),...p.querySelectorAll(`[style]`)],b=[],x=e=>{try{let n=o(e,t);n&&b.push(n.path)}catch{r.add(e)}};for(let{node:e,attribute:t}of _)x(e.getAttribute(t)??``);for(let e of h)x(e.getAttribute(`href`)??``);for(let e of v)for(let t of kR(e.getAttribute(`srcset`)??``))x(t.url);for(let e of y)b.push(...s(e.tagName===`STYLE`?e.textContent??``:e.getAttribute(`style`)??``,t));i=yield*Ir(b,n,s);for(let{node:e,attribute:n}of _)e.setAttribute(n,d(e.getAttribute(n)??``,t)),e.removeAttribute(`integrity`),e.removeAttribute(`crossorigin`);for(let e of v)e.setAttribute(`srcset`,kR(e.getAttribute(`srcset`)??``).map(e=>`${d(e.url,t)}${e.descriptor?` ${e.descriptor}`:``}`).join(`, `));for(let e of p.querySelectorAll(`style`))e.textContent=f(e.textContent??``,t);for(let e of p.querySelectorAll(`[style]`))e.setAttribute(`style`,f(e.getAttribute(`style`)??``,t));for(let e of h){let n=e.getAttribute(`href`)??``,i=p.createElement(`style`),a=e.getAttribute(`media`);a&&(i.media=a);try{i.textContent=u(n,t,[]),e.replaceWith(i)}catch{r.add(n),e.remove()}}let S=new Set([...p.querySelectorAll(`a[href], area[href]`)].map(e=>e.getAttribute(`href`)??``)),C=p.createElement(`meta`);C.httpEquiv=`Content-Security-Policy`;let w=[...new Set([...i.values()].flatMap(e=>{if(!e||!(`url`in e))return[];let t=new URL(e.url);return[`${t.protocol}//${t.host}${t.pathname}`]}))];C.content=TR(w);let T=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),E=p.createElement(`script`);return E.setAttribute(`nonce`,T),E.textContent=Jy,p.head.prepend(C,E),{html:`<!doctype html>${p.documentElement.outerHTML}`,missing:[...r],links:[...S],nonce:T,mediaSources:w}});function kR(e){return[...e.matchAll(/(data:[^\s]+|[^,\s]+)(?:\s+(\d+(?:\.\d+)?[wx]))?\s*,?/g)].map(e=>({url:(e[1]??``).replace(/,$/,``),descriptor:e[2]??``}))}var AR=fc(Li,{render:(e,t,n)=>OR(e,t,n).pipe(xr(()=>o(new bs)))});function jR(e){let t=(0,$.c)(18),{html:n,title:r,className:i,onLink:a,scripts:o,mediaSources:s}=e,c;t[0]===s?c=t[1]:(c=s===void 0?[]:s,t[0]=s,t[1]=c);let l=c,{dark:u}=Xd(),d;t[2]===a?d=t[3]:(d=e=>{if(!e||!a)return;let t=t=>{let n=e.contentWindow?.frames[0];if(!n||t.source!==n)return;let r=Xy(t.data);r!==void 0&&a(r)};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},t[2]=a,t[3]=d);let f;t[4]!==n||t[5]!==l||t[6]!==o?(f=DR(n,o,l),t[4]=n,t[5]=l,t[6]=o,t[7]=f):f=t[7];let p=u?`dark`:`light`,m;t[8]===p?m=t[9]:(m={colorScheme:p},t[8]=p,t[9]=m);let h;t[10]===i?h=t[11]:(h=Y(`block min-h-128 w-full border-0 bg-transparent`,i),t[10]=i,t[11]=h);let g;return t[12]!==d||t[13]!==f||t[14]!==m||t[15]!==h||t[16]!==r?(g=(0,Q.jsx)(`iframe`,{ref:d,title:r,"aria-label":r,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,srcDoc:f,style:m,className:h}),t[12]=d,t[13]=f,t[14]=m,t[15]=h,t[16]=r,t[17]=g):g=t[17],g}var MR=/\.html?$/i;function NR(e){let t=(0,$.c)(40),{scope:n,path:r,html:i,connection:a,onOpenPath:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Z.useState)(s),[u,d]=(0,Z.useState)(!0),f;t[1]===u?f=t[2]:(f={run:u,toggle:()=>d(!u)},t[1]=u,t[2]=f);let p=f,m;t[3]!==r||t[4]!==c?(m=c.at(-1)??r,t[3]=r,t[4]=c,t[5]=m):m=t[5];let h=m,g;t[6]!==h||t[7]!==r?(g=h===r?[]:[h],t[6]=h,t[7]=r,t[8]=g):g=t[8];let _=bR(a,n,g),v;t[9]!==h||t[10]!==i||t[11]!==_.contents||t[12]!==r?(v=h===r?i:_.contents.get(h),t[9]=h,t[10]=i,t[11]=_.contents,t[12]=r,t[13]=v):v=t[13];let y=v,b;t[14]===c?b=t[15]:(b=c.length>0?()=>l(c.slice(0,-1)):void 0,t[14]=c,t[15]=b);let x=b;if(y===void 0){let e;t[16]!==x||t[17]!==h||t[18]!==_.retry||t[19]!==p?(e=(0,Q.jsx)(PR,{path:h,onBack:x,onReload:_.retry,scripts:p}),t[16]=x,t[17]=h,t[18]=_.retry,t[19]=p,t[20]=e):e=t[20];let n;t[21]!==h||t[22]!==_.pending?(n=_.pending?(0,Q.jsx)(kc,{label:`Preparing the preview`}):(0,Q.jsxs)(`p`,{role:`alert`,className:`p-4 text-ui`,children:[`Could not read `,h,`. Try again.`]}),t[21]=h,t[22]=_.pending,t[23]=n):n=t[23];let r;return t[24]!==e||t[25]!==n?(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[e,n]}),t[24]=e,t[25]=n,t[26]=r):r=t[26],r}let S;t[27]!==h||t[28]!==o||t[29]!==c?(S=(e,t)=>{if(!t.includes(e))return;let n=pI(h,e);n.kind===`external`&&navigator.userActivation.isActive&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.kind===`repository`&&(MR.test(n.path)?l([...c,n.path]):o(n.path))},t[27]=h,t[28]=o,t[29]=c,t[30]=S):S=t[30];let C;return t[31]!==x||t[32]!==a||t[33]!==h||t[34]!==_.retry||t[35]!==n||t[36]!==p||t[37]!==S||t[38]!==y?(C=(0,Q.jsx)(FR,{scope:n,path:h,html:y,connection:a,onBack:x,onReload:_.retry,scripts:p,onLink:S},h),t[31]=x,t[32]=a,t[33]=h,t[34]=_.retry,t[35]=n,t[36]=p,t[37]=S,t[38]=y,t[39]=C):C=t[39],C}function PR(e){let t=(0,$.c)(14),{path:n,onBack:r,onReload:i,scripts:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,Q.jsx)(IR,{label:`Back`,onClick:r,children:(0,Q.jsx)(_h,{})}),t[0]=r,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Q.jsx)(fr,{text:n,cut:`start`,className:`min-w-0 flex-1 px-1.5 font-mono text-2xs text-muted-foreground`}),t[2]=n,t[3]=s);let c;t[4]===a?c=t[5]:(c=a&&(0,Q.jsxs)(`label`,{className:`flex items-center gap-1.5 px-1.5 text-2xs text-muted-foreground`,children:[`Scripts`,(0,Q.jsx)(bn,{size:`sm`,"aria-label":`Run the page's scripts`,checked:a.run,onCheckedChange:a.toggle})]}),t[4]=a,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(__,{}),t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(IR,{label:`Reload`,onClick:i,children:l}),t[7]=i,t[8]=u);let d;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==u?(d=(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-1 border-b bg-muted/40 px-1.5`,children:[o,s,c,u]}),t[9]=o,t[10]=s,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function FR(e){let t=(0,$.c)(45),{scope:n,path:r,html:i,connection:a,onBack:o,onReload:s,scripts:c,onLink:l}=e,{preview:u,refresh:d}=Yk(a,n,r,i,AR),[f,p]=(0,Z.useState)(0),m;t[0]!==f||t[1]!==s||t[2]!==d?(m=()=>{s(),d(),p(f+1)},t[0]=f,t[1]=s,t[2]=d,t[3]=m):m=t[3];let h;t[4]!==o||t[5]!==r||t[6]!==c||t[7]!==m?(h=(0,Q.jsx)(PR,{path:r,scripts:c,onBack:o,onReload:m}),t[4]=o,t[5]=r,t[6]=c,t[7]=m,t[8]=h):h=t[8];let g=h;if(Xi(u)){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Preparing the preview`}),t[9]=e):e=t[9];let n;return t[10]===g?n=t[11]:(n=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,e]}),t[10]=g,t[11]=n),n}if(Mi(u)){let e;t[12]===u.cause?e=t[13]:(e=Td(Ra(u.cause)),t[12]=u.cause,t[13]=e);let n;t[14]===e?n=t[15]:(n=(0,Q.jsx)(`p`,{role:`alert`,className:`p-4`,children:e}),t[14]=e,t[15]=n);let r;return t[16]!==g||t[17]!==n?(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,n]}),t[16]=g,t[17]=n,t[18]=r):r=t[18],r}let _,v,y,b;t[19]!==g||t[20]!==u?(_=Kt(qr(u)),v=`flex min-h-0 flex-1 flex-col`,y=g,b=_.missing.length>0&&(0,Q.jsx)(`p`,{role:`status`,className:`flex border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:(0,Q.jsx)(fr,{text:`Not loaded: ${_.missing.join(`, `)}`,className:`min-w-0 flex-1`})}),t[19]=g,t[20]=u,t[21]=_,t[22]=v,t[23]=y,t[24]=b):(_=t[21],v=t[22],y=t[23],b=t[24]);let x=`${f}:${c?.run===!0}`,S;t[25]===_.mediaSources?S=t[26]:(S=_.mediaSources??[],t[25]=_.mediaSources,t[26]=S);let C;t[27]!==_.nonce||t[28]!==c?.run?(C=c?.run===!0?{run:!0}:{run:!1,nonce:_.nonce},t[27]=_.nonce,t[28]=c?.run,t[29]=C):C=t[29];let w=`${r} HTML preview`,T;t[30]!==_.links||t[31]!==l?(T=e=>l(e,_.links),t[30]=_.links,t[31]=l,t[32]=T):T=t[32];let E;t[33]!==_.html||t[34]!==T||t[35]!==x||t[36]!==S||t[37]!==C||t[38]!==w?(E=(0,Q.jsx)(jR,{html:_.html,mediaSources:S,scripts:C,title:w,className:`min-h-0 flex-1`,onLink:T},x),t[33]=_.html,t[34]=T,t[35]=x,t[36]=S,t[37]=C,t[38]=w,t[39]=E):E=t[39];let D;return t[40]!==E||t[41]!==v||t[42]!==y||t[43]!==b?(D=(0,Q.jsxs)(`div`,{className:v,children:[y,b,E]}),t[40]=E,t[41]=v,t[42]=y,t[43]=b,t[44]=D):D=t[44],D}function IR(e){let t=(0,$.c)(11),{label:n,onClick:r,children:i}=e,a;t[0]!==n||t[1]!==r?(a=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":n,onClick:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]!==i||t[4]!==a?(o=(0,Q.jsx)(Ze,{render:a,children:i}),t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===n?s=t[7]:(s=(0,Q.jsx)(Yo,{role:`tooltip`,children:n}),t[6]=n,t[7]=s);let c;return t[8]!==o||t[9]!==s?(c=(0,Q.jsxs)(ot,{children:[o,s]}),t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function LR(e,t,n){let r=(0,$.c)(4),i;return r[0]!==e||r[1]!==n||r[2]!==t?(i=ia({connection:e,scope:t,path:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3],$u(i).value}function RR(e,t,n){let r=(0,$.c)(4),i;return r[0]!==e||r[1]!==n||r[2]!==t?(i=ia({connection:e,scope:t,path:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3],xu(i).value}function zR(e,t,n){let r=(0,$.c)(9),i={connection:e,scope:t,paths:n},a=Ot(fa(i)),o=Da(Kr(i)),s;if(r[0]!==n||r[1]!==a){let e;r[3]===n?e=r[4]:(e=(e,t)=>{let r=n[t]??``;if(Mi(e))return{path:r,status:`unavailable`};let i=de(qr(e));return i?{path:r,status:`loaded`,entries:i.entries,omitted:i.omitted}:{path:r,status:`loading`}},r[3]=n,r[4]=e),s=a.map(e),r[0]=n,r[1]=a,r[2]=s}else s=r[2];let c=s,l;return r[5]!==a||r[6]!==o||r[7]!==c?(l={results:a,states:c,retry:o},r[5]=a,r[6]=o,r[7]=c,r[8]=l):l=r[8],l}function BR(){return _u().hotkey?.enabled!==!1}var VR=new WeakMap,HR=`[data-slot="dialog-content"],[data-slot="alert-dialog-content"],[data-slot="drawer-content"]`,UR=[`imperative`,`action`,`parent-close`];function WR(e,t){let n=Sn(e);if(t.pending&&!UR.includes(e)||n&&(!t.dismissible||e===`outside-press`&&!t.outsidePress))return n&&!(e===`outside-press`&&t.beside)?`attempt`:`silent`}function GR(e){return!e||!wf?[]:typeof e==`function`?e():e.flatMap(e=>typeof e==`string`?Array.from(document.querySelectorAll(e)):[e])}function KR(e,t,n={}){let{store:r,element:i}=e,a=e.options;ga(e,()=>r.get().pending!==null);let o=()=>r.get().modal,s=0,c=()=>!t&&(a().closeOnOutsidePress??o()!==!1),l,u=new Set;function d(){let e=u.size?Math.max(...[...u].map(e=>e.stack()+1)):0;e!==r.get().stack&&(r.set({stack:e}),l?.add(f))}let f={close:e=>m.hide({reason:e}),stack:()=>r.get().stack,add(e){u.add(e),d()},remove(e){u.delete(e),d()}},p=Zs(e,{preset:n.preset??On,role:t?`alertdialog`:`dialog`,rules:i=>({persistent:()=>GR(a().persistentElements),onEscape(e){(o()!==!1||i.popup.element()?.contains(qa()))&&i.control.hide({reason:`escape-key`,event:e})},onShow(e){VR.set(e,f),l=void 0;for(let t=e.parent;t&&!l;t=t.parent)l=VR.get(t);l?.add(f),r.set({nested:!!l});let t=n.onShow?.(e);return()=>{t?.(),VR.delete(e)}},onOpenChange(e){if(n.onOpenChange?.(e),e){if(wf){let e=i.triggerElement()?.ownerDocument??document;o()===!0&&gs(e),Of(e.defaultView)}}else{s++,r.set({pending:null});for(let e of[...u])e.close(`parent-close`);l?.remove(f),l=void 0}},open(e,t){r.set({errors:{}}),t()},refusal:e=>WR(e,{dismissible:a().dismissible!==!1,outsidePress:c(),pending:r.get().pending!==null,beside:o()!==!0&&!t}),refused:e=>n.onRefuse?.(e),dismiss(e,t){n.intercept?.(e,t.event)||i.control.hide({reason:e,...t})},preferredFocus(){let n=i.popup.element()?.querySelector(`[autofocus], [data-autofocus]`);if(n&&Rr(n))return n;if(t)return _e(e,`close`).find(({el:e})=>Rr(e))?.el},bind:n.bind})}),{control:m}=p.internal;function h(t,n,i){if(!r.get().open||r.get().pending!==null)return;let a=n.action;if(!a)return m.hide({reason:`close-press`,event:i,returnValue:n.value});let{[t]:o,...c}=r.get().errors;r.set({errors:c});let l=ze(`action`,i),u=!1,d=s;bo(e=>a(i,e),l,{pending(n){d===s&&(u=!0,r.set({pending:n?t:null}),T(e,`pending`,n,{reason:`action`,source:l}))},done(){d===s&&m.hide({reason:`action`,event:u?void 0:i,returnValue:n.value})},failed:n=>{d===s&&(r.set({errors:{...r.get().errors,[t]:n}}),T(e,`error`,n,{reason:`action`,source:l}))}})}function g(t,n){let i=e.props(`trigger`,t)??{};if(!i.disabled){if(r.get().open)return m.hide({reason:`shortcut`,event:n});m.show({event:n,by:`keyboard`,reason:`shortcut`,trigger:t,payload:i.payload})}}return{...p,internal:Object.assign(p.internal,{options:a,show:m.show,hide:m.hide,takeOver:m.takeOver,alert:t,initialFocus:()=>{let{press:e,popup:t,contentProps:n,rules:r}=p.internal;return e.initialFocus(t.element(),n().initialFocus,r?.preferredFocus)},closePress:h,shortcutPress:g,shortcutOf:t=>Je(e,`trigger`,t,{beside:!0}),backdropElement:()=>i(`backdrop`)})}}var qR=KR;function JR(e,{name:t}){let n=a(e);return{trigger:e({props:{id:`id`,disabled:`boolean`,focusableWhenDisabled:`boolean`,payload:`value`,shortcut:`string`},state:n.state,attrs:(e,t)=>({...n.attrs(e,t),...e.modal===!0&&{"aria-expanded":void 0},"aria-keyshortcuts":t.props.shortcut?Ts(t.props.shortcut,e.apple):void 0}),on:n.on,press:n.press,bind(e,t){let{key:r,store:i,api:a}=t,o=n.bind(e,t);rt(i);let s=Ko(()=>t.props.shortcut,e=>a.internal.shortcutPress(r,e),{layer:e},e=>Qi(t,e));return()=>{s(),o?.()}}}),backdrop:e({state:e=>({open:e.open,nested:e.nested,nestedOpen:e.stack>0}),present:(e,{api:t})=>e.mounted||!!t.internal.contentProps().keepMounted,role:`presentation`,attrs:e=>({hidden:e.mounted?void 0:``,...mi(e.open),"data-nested":e.nested?``:void 0,"data-nested-open":e.stack>0?``:void 0}),bind(e,{api:t}){return t.internal.preset.resetStyles?.bind(e),t.internal.popup.backdrop(e)}}),content:e({props:{container:`value`,initialFocus:`string`,finalFocus:`string`,keepMounted:`boolean`,inline:`boolean`},connect:i,role:(e,{api:t})=>t.internal.role,roles:[`dialog`,`alertdialog`],state:e=>({open:e.open,modal:e.modal,nested:e.nested,nestedOpen:e.stack>0,stack:e.stack,payload:e.payload,pending:e.pending!==null,presentation:e.presentation}),present:(e,{props:t})=>e.mounted||!!t.keepMounted,attrs:(e,{id:t,api:n})=>({...Jo(e,t),...n.internal.triggerName?.contentAttrs(e,t),"aria-describedby":e.described?`${t}-description`:void 0,"data-nested":e.nested?``:void 0,"data-nested-open":e.stack>0?``:void 0,"data-presentation":n.internal.presentation&&e.presentation}),on:{keydown(e,{api:t,el:n}){cn(n,e,HR)&&t.internal.popup.keydown(e)}},bind(e,{api:t,store:n,id:r,key:i}){let a=()=>e.style.setProperty(`--dialog-stack`,String(n.get().stack));a();let o=n.subscribe(a),s=br(e,t.internal,i);se(n,`titled`);let c=n.get().presentation===`sheet`?void 0:bf(e);return()=>{o(),c?.(),s(),e.style.removeProperty(`--dialog-stack`)}}}),title:ln(e),description:zr(e),close:e({props:{id:`id`,value:`string`,action:`action`},state:(e,{key:t})=>({pending:e.pending===t,error:e.errors[t]}),attrs:(e,{key:t})=>{let n=e.pending!==null&&e.pending!==t;return{type:`button`,"data-pending":e.pending===t?``:void 0,"aria-busy":e.pending===t?`true`:void 0,"aria-disabled":e.pending===null?void 0:`true`,"data-disabled":n?``:void 0}},press:({api:e,key:t,props:n},r)=>e.internal.closePress(t,n,r)}),shortcut:Dr(e,(e,t,n)=>n&&t.internal.shortcutOf(n))}}function YR(e,t,n,r){return sa({name:e,options:{container:`value`,open:`boolean`,defaultOpen:`boolean`,onOpenChangeComplete:`callback`,dismissible:`boolean`,onDismissAttempt:`callback`,persistentElements:`list`,pendingAnnouncement:`string`,...n},state:e=>({open:e.defaultOpen??!1,mounted:e.open??e.defaultOpen??!1,titled:null,described:!1,trigger:null,payload:void 0,modal:!0,nested:!1,stack:0,pending:null,errors:{},apple:Hi(),presentation:`dialog`}),sync:e=>({...e.open!==void 0&&{open:e.open},modal:t?!0:e.modal??!0}),api:e=>qR(e,t,r?.rules(e.store,e.options)),slots:t=>({...JR(t,{name:e}),...r?.slots(t)}),agent:{actions:[`setOpen`]}})}function XR(){return at()}var ZR=YR(`alert-dialog`,!0,{onOpenChange:`callback`,onPayloadChange:`callback`,controller:`value`}),QR=Z.createContext(null),$R=e=>e.text;function ez(e,t,n){let r=he(e,{title:`h2`,description:`p`,close:`button`,trigger:`button`}),i=Z.createContext(void 0);function a({children:t,container:n,...r}){let a=Ae(e,r);return be(r.controller,a),(0,Q.jsx)(Xt,{handle:a,children:(0,Q.jsx)(i.Provider,{value:n,children:t})})}function o({controller:t,...n}){let{disabled:i,focusableWhenDisabled:a,payload:o,shortcut:s,render:c,...l}=n;return(0,Q.jsx)(QR.Provider,{value:{shortcut:s},children:(0,Q.jsx)(Ha,{primitive:e,controller:t,fallback:()=>ur(`button`,{type:`button`,disabled:i&&!a,"aria-disabled":i&&a||void 0,...l},c,{open:!1,disabled:!!i}),children:(0,Q.jsx)(r.Trigger,{...n})})})}function s(t){let n=Nt(Z.useContext(i)),r=tr(e,`backdrop`,{},t);return r&&m(r,n)}function c({initialFocus:t,finalFocus:r,keepMounted:a,inline:o,container:s,render:c,...l}){let u=Ec(e),d=Nt(Ct(s,i)),f={...l,render:n?n(u,c):c},p=tr(u,`content`,{initialFocus:t,finalFocus:r,keepMounted:a,inline:o},f);return p&&(o?p:m(p,d))}function l(n){let r=Z.useContext(QR);if(C(e))return(0,Q.jsx)(u,{inherited:r?.shortcut,...n});if(r)return null;throw Error(`${t} parts must be used inside <${t}>.`)}function u({inherited:t,shortcut:n,children:r=$R,...i}){return tr(e,`shortcut`,{shortcut:n??t},{...i,children:r},`span`)}return{Root:a,Trigger:o,Backdrop:s,Content:c,Title:r.Title,Description:r.Description,Close:r.Close,Shortcut:l}}var tz=ez(ZR,`AlertDialog`);function nz(e){return(0,Q.jsx)(tz.Root,{...e})}var rz=tz.Backdrop,iz=tz.Content,az=tz.Title,oz=tz.Description,sz=tz.Close;tz.Shortcut;function cz(){return at()}var lz=ez(YR(`dialog`,!1,{onOpenChange:`callback`,onPayloadChange:`callback`,modal:_o,closeOnOutsidePress:`boolean`,presentation:`string`,controller:`value`},{rules(){let e;return{preset:I,bind:()=>({onSheet:t=>e=t}),onRefuse:()=>e?.nudge()}},slots:e=>({viewport:Ii(e)})}),`Dialog`,Ma),uz=lz.Root,dz=lz.Backdrop,fz=lz.Content,pz=lz.Title,mz=lz.Description,hz=lz.Close;lz.Shortcut;var gz=`fixed inset-0 isolate bg-scrim transition-opacity duration-150 ease-out data-closed:pointer-events-none data-starting-style:opacity-0 data-ending-style:opacity-0 motion-reduce:transition-none supports-backdrop-filter:backdrop-blur-xs`;function _z(e){let t=e.currentTarget;if(t.hasAttribute(`data-focused`))return;t.setAttribute(`data-focused`,``);let n=t.querySelector(`[data-autofocus]`);n&&n!==e.target&&n.focus()}function vz({controller:e,children:t,onOpenChange:n,onPayloadChange:r,...i}){let[a,o]=Z.useState(void 0);return(0,Q.jsx)(uz,{"data-slot":`dialog`,container:Ar(),...e===void 0?{}:{controller:e},onOpenChange:(t,r)=>{t&&e&&o(e.getPayload()),n?.(t,r)},onPayloadChange:(e,t)=>{o(e),r?.(e,t)},...i,children:typeof t==`function`?t(a):t})}function yz(e){return(0,Q.jsx)(hz,{"data-slot":`dialog-close`,...e})}function bz({className:e,...t}){return(0,Q.jsx)(dz,{"data-slot":`dialog-overlay`,className:Y(gz,e),...t})}function xz({className:e,children:t,showCloseButton:n=!0,onFocus:r,...i}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(bz,{}),(0,Q.jsxs)(fz,{onFocus:e=>{r?.(e),_z(e)},"data-slot":`dialog-content`,className:Y(`fixed top-1/2 left-1/2 m-0 data-closed:pointer-events-none grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none backdrop:bg-transparent sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:[t,n&&(0,Q.jsxs)(hz,{"data-slot":`dialog-close`,"data-dialog-close":``,render:(0,Q.jsx)(X,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Oi,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Sz({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:Y(`flex flex-col gap-1`,e),...t})}function Cz({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(hz,{render:(0,Q.jsx)(X,{variant:`outline`}),children:`Close`})]})}function wz({className:e,...t}){return(0,Q.jsx)(pz,{"data-slot":`dialog-title`,className:Y(`font-heading text-sm font-medium [overflow-wrap:anywhere]`,e),...t})}function Tz({className:e,...t}){return(0,Q.jsx)(mz,{"data-slot":`dialog-description`,className:Y(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ez({controller:e,children:t,onOpenChange:n,onPayloadChange:r,...i}){let[a,o]=Z.useState(void 0);return(0,Q.jsx)(nz,{"data-slot":`alert-dialog`,container:Ar(),...e===void 0?{}:{controller:e},onOpenChange:(t,r)=>{t&&e&&o(e.getPayload()),n?.(t,r)},onPayloadChange:(e,t)=>{o(e),r?.(e,t)},...i,children:typeof t==`function`?t(a):t})}function Dz({className:e,...t}){return(0,Q.jsx)(rz,{"data-slot":`alert-dialog-overlay`,className:Y(gz,e),...t})}function Oz({className:e,size:t=`default`,onFocus:n,...r}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Dz,{}),(0,Q.jsx)(iz,{onFocus:e=>{n?.(e),_z(e)},"data-slot":`alert-dialog-content`,"data-size":t,className:Y(`group/alert-dialog-content data-closed:pointer-events-none fixed top-1/2 left-1/2 m-0 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none backdrop:bg-transparent data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})]})}function kz({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Y(`grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Az({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Y(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function jz({className:e,...t}){return(0,Q.jsx)(az,{"data-slot":`alert-dialog-title`,className:Y(`font-heading text-sm font-medium [overflow-wrap:anywhere] sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Mz({className:e,...t}){return(0,Q.jsx)(oz,{"data-slot":`alert-dialog-description`,className:Y(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Nz({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,Q.jsx)(sz,{"data-slot":`alert-dialog-cancel`,className:Y(e),render:(0,Q.jsx)(X,{variant:t,size:n}),...r})}var Pz=dt(e=>Vn(e,[`branch`,e.base??null],t=>t.changes.readBranchChanges({params:{worktreeId:e.scope.worktreeId},query:{base:e.base}}),t=>t.worktreeId===e.scope.worktreeId)),Fz=dt(e=>Vn(e,[`branch-bases`],t=>t.changes.listBranchBases({params:{worktreeId:e.scope.worktreeId}}))),Iz=dt(({connection:e,scope:t,input:n})=>et(e,t,[`change-diffs`,n],$o(function*(){let r=yield*(yield*Te(e)).request(e=>e.changes.readChangeDiffs({params:{worktreeId:t.worktreeId},payload:n}));return yield*xc(e,r.environmentId===e.environmentId&&r.worktreeId===t.worktreeId&&r.statusToken===n.expectedStatusToken),r}),Xn(e),n.expectedFiles.map(e=>e.path))),Lz=dt(({connection:e,scope:t,input:n})=>et(e,t,[`branch-diffs`,n],$o(function*(){return yield*(yield*Te(e)).request(e=>e.changes.readBranchDiffs({params:{worktreeId:t.worktreeId},payload:n}))}),Xn(e)).pipe(sr)),Rz=dt(({connection:e,scope:t,oid:n,parent:r,paths:i})=>et(e,t,[`commit-diffs`,n,r,i],$o(function*(){let a=yield*(yield*Te(e)).request(e=>e.changes.readCommitDiffs({params:{worktreeId:t.worktreeId,oid:n},payload:{...r===1?{}:{parent:r},paths:i.map(e=>[...e])}}));return yield*xc(e,a.commitOid===n),a}),Xn(e)).pipe(sr));function zz(e){return new Map(e.diffs.map(e=>[`selection`in e?za(e.selection):e.paths.join(`\0`),e.content]))}var Bz=dt(e=>cr(t=>e.map(e=>ma(t(e),zz)),t=>{for(let n of e)t(n)})),Vz=dt(e=>Oe(t=>Xr(po(e,e=>Xr(t.result(e,{suspendOnWaiting:!0}),zz),{concurrency:`unbounded`}),e=>new Map(e.flatMap(e=>[...e])))).pipe(sr));function Hz(e,t){return Bi(t.map(t=>lt.reviewSurface(e.connection.environmentId,e.scope,[t])))}var Uz=dt(e=>Xn(e.connection).fn(_s(`Changes.readCurrent`)(t=>wi(ka(e),()=>Hz(e,[`changes`]))))),Wz=dt(e=>Xn(e.connection).fn(_s(`Changes.refreshGitLook`)(t=>wi(ka(e),()=>Hz(e,[`changes`,`git-status`]))))),Gz=dt(e=>Xn(e.connection).fn(_s(`Changes.readCurrentGitStatus`)(t=>wi(At(e),()=>Hz(e,[`git-status`]))))),Kz=dt(e=>Ie(e.connection).fn(_s(`Changes.recoverDiffs`)(function*(t,n){let r=yield*qt,i=fe(e.scope);if(!(yield*r.begin(i,t)))return;let a=d(e),o=yield*Ks(),s=!1;n.refresh(a),yield*Qe(Es(()=>n.registry.subscribe(a,e=>{Xi(e)||e.waiting?s=!0:s&&j(o,to)},{immediate:!0})),()=>Cn(o),e=>Es(e)).pipe(Br(r.finish(i)))}),{concurrent:!0})),qz=dt(({connection:e,scope:t})=>Ie(e).atom(ms(Xr(qt,e=>e.changes)).pipe(os(e=>ut(e,fe(t)))))),Jz=dt(e=>Ie(e.connection).fn(_s(`Changes.retryStaleDiff`)(function*(t,n){let r=yield*qt,i=fe(e.scope);yield*ca,(yield*r.retry(i,t.ticket,[e.key])).length!==0&&(yield*Es(()=>n.refresh(t.query)).pipe(jr(un(n.result(t.query,{suspendOnWaiting:!0}))),Br(r.settle(i,t.ticket,e.key))))}))),Yz=dt(e=>{let{connection:t,scope:n,statusToken:r,read:i}=e,a=ty(e.expectedFiles,e.selections,200).map(e=>{let i={expectedStatusToken:r,expectedFiles:e.expectedFiles,selections:e.selections},a=JSON.stringify(i);return{key:a,input:i,query:Iz({connection:t,scope:n,input:i}),retry:Jz({connection:t,scope:n,key:a})}}),o=a.map(e=>e.query),s=Bz(o),c=Vz(o),l=Kz({connection:t,scope:n}),u=mn((e,t)=>Es(()=>{for(let n of e)t.refresh(n)})),d=e=>a.flatMap((t,n)=>{let r=e[n];return r!==void 0&&Mi(r)&&v(Ra(r.cause))?[{key:t.key,statusToken:t.input.expectedStatusToken,expectedFiles:t.input.expectedFiles,waiting:r.waiting}]:[]});return Ke(e=>{e.mount(l),e.mount(u);for(let t of a)e.mount(t.retry);let r=e(s),o=e(qz({connection:t,scope:n})),f=d(r),p=Bo(o)?pn(o.value,i,f):{kind:`idle`};if(p.kind===`recover`&&e.set(l,{read:i,asked:!1}),p.kind===`retry`)for(let t of a)p.batches.includes(t.key)&&e.set(t.retry,{query:t.query,ticket:p.ticket});let m=e(c),h=Cc(p)||Mi(m)&&!r.some(e=>Mi(e));return{result:h&&Mi(m)?Sc(m.previousSuccess,{onNone:()=>Ns(!0),onSome:e=>Hs(e)}):m,recovery:{pending:h}}},(e,t)=>{let n=e.get(s),r=d(n).map(e=>e.key);if(r.length===0)return e.set(u,o);e.set(l,{read:i,asked:!0}),e.set(u,a.flatMap((e,t)=>{let i=n[t];return i!==void 0&&Mi(i)&&!r.includes(e.key)?[e.query]:[]}))},e=>e(s)).pipe(Wo(0))}),Xz=class e extends u()(`@porcelain/client/ReviewedFilesState`){static layer(t,n,r){return Hr(e,$o(function*(){let e=yield*Te(t),i=yield*Fr([]),a=Ey(r),o=yield*Pe(t,lt.reviewSurface(t.environmentId,n,a),$o(function*(){let i=yield*e.request(e=>e.reviewedFiles.listReviewedFiles({params:{worktreeId:n.worktreeId},query:r.kind===`branch`?{scope:`branch`,branch:r.branch}:{}}));return yield*xc(t,i.worktreeId===n.worktreeId),i}),y(),lt.worktreeReads(t,n,a));return{stream:xi(o.stream,gr(i),(e,t)=>ma(e,e=>Dy(e,t))),confirm:(e,r)=>Mo(a=>$o(function*(){yield*a(xc(t));let s={id:Symbol(),changes:e,reviewedAt:Ce(yield*st)};return yield*rn(i,e=>[...e,s]),yield*a(o.confirm(r.pipe(wi(e=>xc(t,e.worktreeId===n.worktreeId))),(e,t)=>Zn({worktreeId:t.worktreeId,marks:t.marks}))).pipe(Br(rn(i,e=>e.filter(e=>e.id!==s.id))))}))}}))}},Zz=dt(({connection:e,scope:t,range:n})=>e.atoms(r=>Ls(Xz.layer(e,t,n),r(Xn(e).layer))));function Qz(e){return Zz({...e,range:Ty(e.range)})}var $z=dt(e=>Uo(e.scope,`reviewed`,Xz,Qz(e)).pipe(sr));function eB({range:e=fy,...t}){return $z({...t,range:Ty(e)})}var tB=dt(({connection:e,scope:t,range:n})=>{let r=Qz({connection:e,scope:t,range:n}),i={worktreeId:t.worktreeId},a=n.kind===`branch`?{scope:`branch`,branch:n.branch}:{};function o(e,t){return Ni(Xz,n=>n.confirm(e,t))}let s=_s(`Reviews.markFile`)(function*(t){let r=yield*Te(e);return yield*o([t],r.request(e=>n.kind===`branch`?e.reviewedFiles.setReviewedFile({params:i,payload:{...t,reviewed:!0,scope:`branch`,base:n.base}}):e.reviewedFiles.setReviewedFile({params:i,payload:{...t,reviewed:!0}})))}),c=_s(`Reviews.unmarkFile`)(function*(t){let n=yield*Te(e);return yield*o([{path:t}],n.request(e=>e.reviewedFiles.removeReviewedFile({params:i,query:{path:t,...a}})))}),l=_s(`Reviews.markFiles`)(function*(t){return yield*o(t,(yield*Te(e)).request(e=>n.kind===`branch`?e.reviewedFiles.setReviewedFiles({params:i,payload:{files:t,scope:`branch`,base:n.base}}):e.reviewedFiles.setReviewedFiles({params:i,payload:{files:t}})))}),u=_s(`Reviews.unmarkFiles`)(function*(t){let n=yield*Te(e);return yield*o(t.map(e=>({path:e})),n.request(e=>e.reviewedFiles.removeReviewedFiles({params:i,payload:{paths:[...t],...a}})))});return{set:r.fn(s,{concurrent:!0}),remove:r.fn(c,{concurrent:!0}),bulk:r.fn(_s(`Reviews.reviewFiles`)(function*(e){if(e.kind===`unmark`){for(let t of my(e.paths,xa))yield*u(t);return{kind:`unmark`}}let t=gy(e.entries),n=t.report;for(let e of my(t.files,xa))n=_y(n,yield*l(e));return{kind:`mark`,report:n}}),{concurrent:!0})}});function nB(e,t){if(Mi(e))return Ra(e.cause);if(Mi(t))return Ra(t.cause)}function rB(e,t){let n=(0,$.c)(3),r;return n[0]!==t||n[1]!==e?(r=d({scope:e,connection:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],$u(r).value}function iB(e,t){let n=(0,$.c)(3),r;return n[0]!==t||n[1]!==e?(r=d({scope:e,connection:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],Ot(r)}function aB(e,t,n,r,i,a){let o=(0,$.c)(20),s;o[0]!==t||o[1]!==i||o[2]!==r||o[3]!==e||o[4]!==a||o[5]!==n?(s=Yz({scope:e,connection:t,statusToken:n,read:r,expectedFiles:i,selections:a}),o[0]=t,o[1]=i,o[2]=r,o[3]=e,o[4]=a,o[5]=n,o[6]=s):s=o[6];let c=s,{result:l,recovery:u}=Ot(c),d=u.pending,f;o[7]===l?f=o[8]:(f=Bo(l)?l.value:new Map,o[7]=l,o[8]=f);let p;o[9]!==d||o[10]!==l?(p=Xi(l)||d,o[9]=d,o[10]=l,o[11]=p):p=o[11];let m;o[12]===l?m=o[13]:(m=Mi(l),o[12]=l,o[13]=m);let h=Da(c),g;return o[14]!==d||o[15]!==f||o[16]!==p||o[17]!==m||o[18]!==h?(g={diffs:f,pending:p,recovering:d,failed:m,retry:h},o[14]=d,o[15]=f,o[16]=p,o[17]=m,o[18]=h,o[19]=g):g=o[19],g}var oB=Oe(Ns());function sB(e,t,n){let r=(0,$.c)(11),i=n===void 0||n,a;r[0]!==t||r[1]!==e?(a=xt({connection:t,scope:e}),r[0]=t,r[1]=e,r[2]=a):a=r[2];let o=a,s=Ot(i?o:oB),c;r[3]!==t||r[4]!==e?(c=Gz({connection:t,scope:e}),r[3]=t,r[4]=e,r[5]=c):c=r[5];let u;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={mode:`promise`},r[6]=u):u=r[6];let d=Da(c,u),f=l(i?o:oB),p;return r[7]!==s||r[8]!==d||r[9]!==f?(p={result:s,read:d,refresh:f},r[7]=s,r[8]=d,r[9]=f,r[10]=p):p=r[10],p}function cB(e,t){if(!B_(t))return null;let n=bu(t.patch),r=zM(t.patch,{cacheKeyPrefix:`${Xv(e)}:${n}`}).flatMap(e=>e.files),i=r.length===1?r[0]:void 0;return i?{id:Xv(e),kind:`diff`,path:zt(e),fileDiff:i,version:n,note:`${e.scope} · ${e.kind}`}:null}function lB(e,t,n){let r=V_(t,n);if(!r||n?.kind!==`text`)return null;let i=bu(n.patch),a=zM(n.patch,{cacheKeyPrefix:`${e}:${r}:${i}`}).flatMap(e=>e.files),o=a[0];return o?{id:`commit:${e}:${r}`,kind:`diff`,path:r,fileDiff:o,lineCounts:a.flatMap(e=>e.hunks).reduce((e,t)=>({added:e.added+t.additionLines,removed:e.removed+t.deletionLines}),{added:0,removed:0}),version:i,note:t.status}:null}function uB(e,t){let n=(0,$.c)(4),r;n[0]!==t||n[1]!==e?(r=Uz({connection:t,scope:e}),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;return n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3],Da(r,i)}function dB(e,t){let n=(0,$.c)(4),r;n[0]!==t||n[1]!==e?(r=Wz({connection:t,scope:e}),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;return n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3],Da(r,i)}function fB(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=Bz(e),t[0]=e,t[1]=n);let r=n,i=Ot(r),a=l(r),o;return t[2]!==i||t[3]!==a?(o={results:i,retry:a},t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function pB(e){let t=(0,$.c)(11),n=fB(e),r;t[0]===n.results?r=t[1]:(r=new Map(n.results.flatMap(mB)),t[0]=n.results,t[1]=r);let i;t[2]===n.results?i=t[3]:(i=n.results.some(Xi),t[2]=n.results,t[3]=i);let a;t[4]===n.results?a=t[5]:(a=n.results.some(Mi),t[4]=n.results,t[5]=a);let o;return t[6]!==n.retry||t[7]!==r||t[8]!==i||t[9]!==a?(o={patches:r,pending:i,failed:a,retry:n.retry},t[6]=n.retry,t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function mB(e){return Ee(qr(e)).flatMap(hB)}function hB(e){return[...e]}var gB=Oe(Ns()),_B=Oe(Ns());function vB(e,t,n){let r=(0,$.c)(7),i;r[0]!==n||r[1]!==t||r[2]!==e?(i=e?Pz({connection:t,scope:e,...n===void 0?{}:{base:n}}):_B,r[0]=n,r[1]=t,r[2]=e,r[3]=i):i=r[3];let a=i,o=Ot(a),s=l(a),c;return r[4]!==o||r[5]!==s?(c={result:o,refresh:s},r[4]=o,r[5]=s,r[6]=c):c=r[6],c}function yB(e,t,n){let r=(0,$.c)(7),i;r[0]!==t||r[1]!==n||r[2]!==e?(i=n?Fz({connection:t,scope:e}):gB,r[0]=t,r[1]=n,r[2]=e,r[3]=i):i=r[3];let a=i,o=Ot(a),s=l(a),c;return r[4]!==o||r[5]!==s?(c={result:o,refresh:s},r[4]=o,r[5]=s,r[6]=c):c=r[6],c}function bB(e,t,n,r){let i=(0,$.c)(5),a;return i[0]!==t||i[1]!==r||i[2]!==n||i[3]!==e?(a=n?ny(r,25).map(r=>Lz({connection:t,scope:e,input:{baseOid:n.baseOid,headOid:n.headOid,paths:r.map(xB)}})):[],i[0]=t,i[1]=r,i[2]=n,i[3]=e,i[4]=a):a=i[4],pB(a)}function xB(e){return[...e]}function SB(e,t,n,r,i){let a=(0,$.c)(11),o;if(a[0]!==e||a[1]!==n||a[2]!==r||a[3]!==i||a[4]!==t){let s;a[6]!==e||a[7]!==n||a[8]!==r||a[9]!==t?(s=i=>Rz({connection:e,scope:t,oid:n,parent:r,paths:i}),a[6]=e,a[7]=n,a[8]=r,a[9]=t,a[10]=s):s=a[10],o=ny(i,25).map(s),a[0]=e,a[1]=n,a[2]=r,a[3]=i,a[4]=t,a[5]=o}else o=a[5];return pB(o)}function CB(e,t){let n=(0,$.c)(7),r;n[0]!==e||n[1]!==t?(r=Ge({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promise`},n[3]=i):i=n[3];let[a,o]=B(r,i),s;return n[4]!==a||n[5]!==o?(s={result:a,submit:o},n[4]=a,n[5]=o,n[6]=s):s=n[6],s}function wB(e,t){let n=(0,$.c)(5),r=CB(e,t),i;n[0]===r?i=n[1]:(i=e=>r.submit({path:Wc(e.path),flag:`hidden`,value:e.hidden}),n[0]=r,n[1]=i);let a;return n[2]!==r||n[3]!==i?(a={...r,submit:i},n[2]=r,n[3]=i,n[4]=a):a=n[4],a}function TB(e,t){let n=(0,$.c)(5),r=CB(e,t),i;n[0]===r?i=n[1]:(i=e=>r.submit({path:Wc(e.path),flag:`pinned`,value:e.pinned}),n[0]=r,n[1]=i);let a;return n[2]!==r||n[3]!==i?(a={...r,submit:i},n[2]=r,n[3]=i,n[4]=a):a=n[4],a}var EB=Oe(void 0),DB=Ve(Ut({group:J,offset:lc})),OB=Qt(DB),kB=dt(e=>Oe(()=>{let t=`porcelain.worktree-navigator.${e}`,n;try{n=de(OB(sessionStorage.getItem(t)))}catch{n=void 0}return e=>{if(!e)return;if(n&&e.scrollTop===0){let t=e.querySelector(`[data-navigator-group="${CSS.escape(n.group)}"]`);if(t){let r=t.getBoundingClientRect(),i=n.offset<r.height?n.offset:0;e.scrollTop=r.top-e.getBoundingClientRect().top+i}}let r=()=>{if(!e.clientHeight||!e.firstElementChild)return;let r=e.getBoundingClientRect().top,i=Array.from(e.children).find(e=>e.getBoundingClientRect().bottom>r),a=i?.getAttribute(`data-navigator-group`);n=e.scrollTop>0&&i&&a?{group:a,offset:r-i.getBoundingClientRect().top}:void 0;try{n?sessionStorage.setItem(t,JSON.stringify(n)):sessionStorage.removeItem(t)}catch{return}};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),r()}}}).pipe(x)),AB=cz(),jB=cz(),MB=cz(),NB=XR(),PB=XR(),FB=XR(),IB=XR(),LB=cz();function RB(e,t,n,r,i,a){let o=(0,$.c)(15),s;o[0]===e?s=o[1]:(s=b(e),o[0]=e,o[1]=s);let c;o[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={mode:`promiseExit`},o[2]=c):c=o[2];let[l,u]=B(s,c),d=Da(EB),f;o[3]!==n||o[4]!==a||o[5]!==i||o[6]!==u||o[7]!==l||o[8]!==t||o[9]!==r||o[10]!==d?(f=e=>{if(!l.waiting)return u({path:e,remote:t,recover:i,...a?{reconnectProjectId:a}:{},complete:()=>{d(void 0),n()},select:e=>Ui({try:()=>r(e),catch:zB})})},o[3]=n,o[4]=a,o[5]=i,o[6]=u,o[7]=l,o[8]=t,o[9]=r,o[10]=d,o[11]=f):f=o[11];let p=f,m;return o[12]!==l||o[13]!==p?(m={result:l,submit:p},o[12]=l,o[13]=p,o[14]=m):m=o[14],m}function zB(e){return new To({message:`Could not open the selected worktree.`,cause:e})}function BB(){let e=(0,$.c)(2),t=Da(EB),n;return e[0]===t?n=e[1]:(n=e=>{e||t(void 0)},e[0]=t,e[1]=n),n}var VB=tt(F.layer).atom(F),HB=dt(e=>e.atoms(F.layer).fn((t,n)=>$o(function*(){let r=yield*(yield*F).pickProject(e.address);r!==null&&(yield*n.setResult(b(e),{path:r,remote:null,recover:(e,t)=>void AB.open({payload:{remote:null,project:e,path:t}}),complete:()=>void 0,select:e=>Ui({try:()=>t(e),catch:e=>new To({message:`Could not open the selected worktree.`,cause:e})})}))})));function UB(e,t,n){let r=(0,$.c)(3),i=de(qr(Ot(VB))),a;r[0]===e?a=r[1]:(a=HB(e),r[0]=e,r[1]=a);let o;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},r[2]=o):o=r[2];let[s,c]=B(a,o);return i?.canPickProject(e.address)&&(()=>{s.waiting||c(t).then(e=>{if(Mn(e)){let t=Ra(e.cause);n(t instanceof Error?t:new To({message:`Could not open the selected worktree.`,cause:t}))}})})}function WB(e,t){let n=(0,$.c)(6),r;n[0]!==e||n[1]!==t?(r=De({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a=Ot(i),o=l(i),s;return n[3]!==a||n[4]!==o?(s={result:a,refresh:o},n[3]=a,n[4]=o,n[5]=s):s=n[5],s}function GB(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=De({connection:e,projectId:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],$u(r).value}function KB(e,t){let n=(0,$.c)(2),r=GB(e,t),i;return n[0]===r.preferences?i=n[1]:(i=new Set(r.preferences.filter(JB).map(qB)),n[0]=r.preferences,n[1]=i),i}function qB(e){return e.path}function JB(e){return e.hidden}function YB(e,t){let n=(0,$.c)(2),r=GB(e,t),i;return n[0]===r.preferences?i=n[1]:(i=r.preferences.filter(ZB).map(XB),n[0]=r.preferences,n[1]=i),i}function XB(e){return e.path}function ZB(e){return e.pinned}function QB(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=Dt(e),t[0]=e,t[1]=n),$u(n).value}var $B=.875;function eV({overflowX:e,overflowY:t}){return e&&!t?`x`:`y`}function tV({client:e,scroll:t}){return Math.max(0,t-e)}function nV(e){return tV(e)>=1}function rV(e){return Math.min(Math.max(e.position,0),tV(e))}function iV(e){let t=tV(e),n=rV(e),r=t<1?0:n,i=t<1?0:t-n;return{before:r,after:i,atStart:r<1,atEnd:i<1,progress:t<1?0:n/t}}function aV(e,t){if(t<=0||e.scroll<=0)return{size:0,offset:0};let n=Math.min(t,Math.max(16,t*e.client/e.scroll)),r=tV(e);return{size:n,offset:r<=0?0:(t-n)*rV(e)/r}}function oV(e,t,n,r){let{size:i}=aV(n,r),a=r-i;if(a<=0)return e;let o=tV(n);return Math.min(Math.max(e+t/a*o,0),o)}function sV(e,t,n){let{size:r}=aV(t,n),i=n-r;return i<=0?0:Math.min(Math.max((e-r/2)/i,0),1)*tV(t)}function cV(e,t){return e<t.offset?-1:+(e>t.offset+t.size)}function lV(e){return Math.max(1,Math.round(e*$B))}function uV(e,t,n,r){return t===1?e*n:t===2?e*r:e}function dV(e,t){return e===`always`?!0:t.overflow?e===`auto`||t.dragging||t.scrolling?!0:e===`hover`&&t.hovering:!1}function fV(e,t){let n=t.after<1;return e?n||t.delta>=0:n&&t.delta>0}var pV=new Set([`ArrowUp`,`PageUp`,`Home`]);function mV(e,t,n){return n?!1:pV.has(e)||e===` `&&t}var hV=16;function gV(e){let t=new Map,n=Df(),r,i=e=>{r===e&&(r=void 0,n.cancel())};function a(t){if(!e.viewport()||t.ctrlKey)return;t.deltaX!==0&&e.readDirection(),e.measure();let n=uV(t.deltaX,t.deltaMode,hV,e.metrics.x.client),r=uV(t.deltaY,t.deltaMode,hV,e.metrics.y.client),i=(t,n)=>{let r=n===`x`&&e.rtl()?-t:t;return r<0?e.metrics[n].position>0:r>0&&tV(e.metrics[n])-e.metrics[n].position>=1};(i(n,`x`)||i(r,`y`))&&(t.preventDefault(),r<0?e.release():e.stopEasing(),e.viewport().scrollBy({left:n,top:r,behavior:`instant`}))}function o(r,a){t.set(a,r);let o=Ef(r,`pointerdown`,t=>{e.viewport()&&n.accepts(t)&&(t.stopPropagation(),t.preventDefault(),a===`x`&&e.readDirection(),e.measure(),s(r,t,a,e.metrics[a].position))});return()=>{o(),i(r),t.get(a)===r&&t.delete(a)}}function s(t,i,a,o){let s=a===`y`?i.clientY:i.clientX,c=yV(t,a),l=_V(e.viewport());e.stopEasing(),e.setDragging(a),r=t,n.start(t,i,{cancelOnEscape:!0,onMove:t=>{let n=((a===`y`?t.y:t.x)-s)/c,r=a===`x`&&e.rtl()?-n:n;e.scrollTo(a,oV(o,r,e.metrics[a],e.track[a]))},onEnd:(n,i)=>{i&&r===t&&n.type===`pointermove`&&e.scrollTo(a,o),r=void 0,l(),e.setDragging(null)}})}function c(i,a,o){if(!e.viewport()||!n.accepts(i))return;i.preventDefault(),o===`x`&&e.readDirection(),e.measure();let c=vV(a,o,i);if(i.altKey){let n=sV(c,e.metrics[o],e.track[o]);e.scrollTo(o,n);let r=t.get(o);r&&s(r,i,o,n);return}let l=cV(c,aV(e.metrics[o],e.track[o]));if(l===0)return;o===`y`&&l<0&&e.release();let u=lV(e.metrics[o].client),d=tV(e.metrics[o]),f=e.metrics[o].position,p=yf(()=>{let t=aV({...e.metrics[o],position:f},e.track[o]);return cV(c,t)===l&&(f=Math.min(Math.max(f+l*u,0),d),e.scrollTo(o,f,`auto`),f>0&&f<d)});r=a,n.start(a,i,{onMove:e=>c=vV(a,o,e.event),onEnd:()=>{r=void 0,p()}})}return{forwardWheel:a,bindThumb:o,pressTrack:c,endPress:i}}function _V(e){let t=e.style.scrollSnapType;return e.style.scrollSnapType=`none`,()=>{e.style.scrollSnapType=t}}function vV(e,t,n){let r=e.getBoundingClientRect(),i=getComputedStyle(e),a=e=>Number.parseFloat(e)||0,o=yV(e,t);return t===`y`?(n.clientY-r.top)/o-a(i.borderTopWidth)-a(i.paddingTop):i.direction===`rtl`?(r.right-n.clientX)/o-a(i.borderRightWidth)-a(i.paddingRight):(n.clientX-r.left)/o-a(i.borderLeftWidth)-a(i.paddingLeft)}function yV(e,t){let n=e.getBoundingClientRect(),r=t===`y`?e.offsetHeight:e.offsetWidth,i=t===`y`?n.height:n.width;return r>0&&i>0?i/r:1}var bV=[`atXStart`,`atXEnd`,`atYStart`,`atYEnd`,`scrollingX`,`scrollingY`,`hovering`,`visibleX`,`visibleY`,`dragging`,`sticking`],xV=150,SV=[`x`,`y`],CV={x:{overflow:`overflowX`,atStart:`atXStart`,atEnd:`atXEnd`,scrolling:`scrollingX`,visible:`visibleX`,thumbSize:`--scroll-area-thumb-width`,before:`--scroll-area-overflow-x-start`,after:`--scroll-area-overflow-x-end`,progress:`--scroll-area-progress-x`},y:{overflow:`overflowY`,atStart:`atYStart`,atEnd:`atYEnd`,scrolling:`scrollingY`,visible:`visibleY`,thumbSize:`--scroll-area-thumb-height`,before:`--scroll-area-overflow-y-start`,after:`--scroll-area-overflow-y-end`,progress:`--scroll-area-progress-y`}},wV=SV.flatMap(e=>[CV[e].before,CV[e].after,CV[e].progress]);function TV(e){let t,n,r=()=>n?.ownerDocument.defaultView??window,i=new Set,a={x:0,y:0},o={x:0,y:0},s=!1,c={x:{position:0,client:0,scroll:0},y:{position:0,client:0,scroll:0}},l={x:NaN,y:NaN},u=new WeakMap,d=0,f=NaN,p=null,m=!1,h=0,g={x:0,y:0},_={x:0,y:0},v={x:0,y:0};function y(){let e=n;c.y.position=e.scrollTop,c.y.client=e.clientHeight,c.y.scroll=e.scrollHeight;let t=e.scrollLeft;t!==0&&t<0!==s&&(s=xf(e)),c.x.position=s?-t:t,c.x.client=e.clientWidth,c.x.scroll=e.scrollWidth}function b(e,t,n,r=`px`){let i=u.get(e);i||u.set(e,i={});let a=Math.round(n*100)/100;i[t]!==a&&(i[t]=a,e.style.setProperty(t,`${a}${r}`))}function x(t,n){e.get()[t]!==n&&e.set({[t]:n})}function S({resized:i=!1}={}){if(d=0,!n)return;y(),i&&O();let a=e.get(),o,s=(e,t)=>{a[e]!==t&&((o??={})[e]=t)};for(let e of SV){let n=c[e],i=CV[e],o=Number.isNaN(l[e])?0:n.position-l[e];l[e]=n.position;let u=iV(n);s(i.overflow,nV(n)),s(i.atStart,u.atStart),s(i.atEnd,u.atEnd),t&&(kf(wV),b(t,i.before,u.before),b(t,i.after,u.after),b(t,i.progress,u.progress,``)),C(e),o!==0&&(e===`y`&&Math.abs(n.position-f)<1||(_[e]=performance.now(),s(i.scrolling,!0),g[e]||=r().setTimeout(()=>E(e),xV)),e===`y`&&a.stickToEnd&&s(`sticking`,fV(a.sticking,{delta:o,after:u.after})))}w(o?.overflowX??a.overflowX,o?.overflowY??a.overflowY),o&&e.set(o),(o||i)&&D()}function C(e){let t=aV(c[e],a[e]);for(let n of i)n.axis===e&&(b(n.el,CV[e].thumbSize,t.size),b(n.el,`--scroll-area-thumb-offset`,e===`x`&&s?-t.offset:t.offset))}function w(n,r){if(!t)return;let i=e.get(),a=n&&r&&i.scrollbarsX>0&&i.scrollbarsY>0;b(t,`--scroll-area-corner-width`,a?o.y:0),b(t,`--scroll-area-corner-height`,a?o.x:0)}function T(){!d&&n&&(d=r().requestAnimationFrame(()=>S()))}function E(e){let t=performance.now()-_[e];t<xV?g[e]=r().setTimeout(()=>E(e),xV-t):(g[e]=0,x(CV[e].scrolling,!1),D())}function D(){let t=e.get();for(let e of SV){let n=CV[e];if(dV(t.type,{overflow:t[n.overflow],hovering:t.hovering,scrolling:t[n.scrolling],dragging:t.dragging===e})){r().clearTimeout(v[e]),v[e]=0,x(n.visible,!0);continue}if(!t[n.visible]||v[e])continue;let i=t.type===`scroll`||t.type===`hover`?t.scrollHideDelay:0;i<=0?x(n.visible,!1):v[e]=r().setTimeout(()=>{v[e]=0,x(n.visible,!1),D()},i)}}function O(){let t=e.get();if(!t.stickToEnd||!t.sticking||t.dragging||m||p!==null||h)return;let r=tV(c.y);r-c.y.position<1||(f=r,n.scrollTo({top:r,behavior:`instant`}),c.y.position=n.scrollTop)}function k(e,t,r=`instant`){n&&(e===`y`?n.scrollTo({top:t,behavior:r}):n.scrollTo({left:s?-t:t,behavior:r}))}function A(){j(),e.get().sticking&&c.y.position>0&&e.set({sticking:!1})}function j(){h&&=(r().cancelAnimationFrame(h),0)}function M(){let e=()=>{if(h=0,!n)return;y();let t=tV(c.y)-c.y.position;if(t<1)return S();k(`y`,c.y.position+Math.max(1,t*.2)),h=r().requestAnimationFrame(e)};h=r().requestAnimationFrame(e)}function N(t,{behavior:r=`smooth`}={}){if(!n)return;let i=eV(e.get());i===`x`&&(s=xf(n)),y();let a=r===`smooth`&&!eo();if(j(),t===`end`&&i===`y`&&e.get().stickToEnd&&x(`sticking`,!0),t===`end`&&i===`y`&&a)return M();k(i,t===`start`?0:tV(c[i]),a?`smooth`:`instant`)}function P(t){n=t;let r=t.ownerDocument.defaultView??window,i=!1,a=new ResizeObserver(()=>{s=xf(t),!i&&n===t&&(i=!0,S({resized:!0}),e.set({counted:!0})),y(),O(),T()}),o=()=>{a.observe(t);for(let e of Array.from(t.children))a.observe(e)};o();let c=new MutationObserver(()=>{o(),S({resized:!0})});c.observe(t,{childList:!0});let l=()=>e.get().overflowX||e.get().overflowY,u=yr(t,l),f=l(),h=e.subscribe(()=>{l()!==f&&(f=l(),u.check())}),_=()=>{m=!1,r.removeEventListener(`pointerup`,_,!0),r.removeEventListener(`pointercancel`,_,!0),S({resized:!0})},b=()=>{p=null,S({resized:!0})},x=[()=>a.disconnect(),()=>c.disconnect(),u.stop,h,Ef(t,`scroll`,T,{passive:!0}),Ef(t,`wheel`,e=>{e.deltaY>=0?j():DV(e.target,t)||A()},{passive:!0}),Ef(t,`keydown`,e=>{!e.defaultPrevented&&mV(e.key,e.shiftKey,EV(e.target))&&(DV(e.target,t)||A())}),Ef(t,`touchstart`,e=>p=e.touches[0]?.clientY??null,{passive:!0}),Ef(t,`touchmove`,e=>{let n=e.touches[0]?.clientY;n!==void 0&&(p!==null&&n>p&&!DV(e.target,t)&&A(),p=n)},{passive:!0}),Ef(t,`touchend`,b,{passive:!0}),Ef(t,`touchcancel`,b,{passive:!0}),Ef(t,`pointerdown`,e=>{e.pointerType!==`touch`&&e.button===0&&(m=!0,j(),r.addEventListener(`pointerup`,_,!0),r.addEventListener(`pointercancel`,_,!0))})];return()=>{x.forEach(e=>e()),r.removeEventListener(`pointerup`,_,!0),r.removeEventListener(`pointercancel`,_,!0),d&&r.cancelAnimationFrame(d),d=0,j();for(let e of SV)r.clearTimeout(g[e]),r.clearTimeout(v[e]),g[e]=v[e]=0;n===t&&(n=void 0)}}function F(e){Cf(()=>kf(wV)),t=e,queueMicrotask(()=>{t===e&&e.isConnected&&e.matches(`:hover`)&&x(`hovering`,!0)});let n=e=>t=>{t.pointerType!==`touch`&&(x(`hovering`,e),D())},r=[Ef(e,`pointerenter`,n(!0)),Ef(e,`pointerleave`,n(!1))];return()=>{r.forEach(e=>e()),t===e&&(t=void 0)}}let I=gV({viewport:()=>n,metrics:c,track:a,rtl:()=>s,measure:y,readDirection:()=>{s=xf(n)},scrollTo:k,release:A,stopEasing:j,setDragging:z});function L(e,t){let r={el:e,axis:t};i.add(r),queueMicrotask(R);let s=new ResizeObserver(([e])=>{let r=e.borderBoxSize?.[0],i=t===`y`?e.contentRect.height:e.contentRect.width,s=a[t]===0&&i>0;a[t]=i,o[t]=(t===`y`?r?.inlineSize:r?.blockSize)??0,s&&n&&(y(),C(t)),T()});s.observe(e),T();let c=[()=>s.disconnect(),Ef(e,`wheel`,I.forwardWheel,{passive:!1}),Ef(e,`mousedown`,e=>e.preventDefault()),Ef(e,`pointerdown`,n=>I.pressTrack(n,e,t))];return()=>{c.forEach(e=>e()),I.endPress(e),i.delete(r),R();for(let t in u.get(e))e.style.removeProperty(t);u.delete(e)}}function R(){let t=0,n=0;for(let e of i)e.axis===`x`?t++:n++;e.set({scrollbarsX:t,scrollbarsY:n})}function z(t){e.set({dragging:t}),D()}return{bindRoot:F,bindViewport:P,bindScrollbar:L,bindThumb:I.bindThumb,scrollToEdge:N,isAt(e){if(!n?.isConnected)return;y();let t=eV({overflowX:nV(c.x),overflowY:nV(c.y)}),r=iV(c[t]);return e===`start`?r.atStart:r.atEnd},focusViewport(){let e=n;e&&(e.hasAttribute(`tabindex`)||(e.setAttribute(`tabindex`,`-1`),e.addEventListener(`blur`,()=>e.getAttribute(`tabindex`)===`-1`&&e.removeAttribute(`tabindex`),{once:!0})),e.focus({preventScroll:!0}))},refresh(){n?.isConnected&&S({resized:!0}),D()}}}function EV(e){return e instanceof HTMLElement?e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName):!1}function DV(e,t){for(let n=e instanceof Element?e:null;n&&n!==t;n=n.parentElement){if(n.scrollTop<=0||n.scrollHeight<=n.clientHeight)continue;let{overflowY:e}=getComputedStyle(n);if(e===`auto`||e===`scroll`)return!0}return!1}var OV=e=>e===`horizontal`?`x`:`y`;function kV(e,t){let n=OV(e.props.orientation),r=t(n),i=Qi(e,()=>{OV(e.props.orientation)!==n&&(r(),n=OV(e.props.orientation),r=t(n))});return()=>{i(),r()}}var AV=e=>eV(e)===`x`?e.atXStart:e.atYStart,jV=e=>eV(e)===`x`?e.atXEnd:e.atYEnd,MV=e=>e.scrollbarsX+e.scrollbarsY>0,NV=e=>!jV(e)&&!(e.stickToEnd&&e.sticking),PV=e=>e?``:void 0,FV=e=>({overflowX:e.overflowX,overflowY:e.overflowY,atStart:AV(e),atEnd:jV(e),scrolling:e.scrollingX||e.scrollingY,hovering:e.hovering,sticking:e.stickToEnd&&e.sticking}),IV=e=>({"data-overflow-x":PV(e.overflowX),"data-overflow-y":PV(e.overflowY)}),LV=e=>({"data-at-start":PV(AV(e)),"data-at-end":PV(jV(e)),"data-at-x-start":PV(e.atXStart),"data-at-x-end":PV(e.atXEnd),"data-at-y-start":PV(e.atYStart),"data-at-y-end":PV(e.atYEnd),"data-scrolling":PV(e.scrollingX||e.scrollingY),"data-hovering":PV(e.hovering),"data-sticking":PV(e.stickToEnd&&e.sticking)}),RV=Object.fromEntries([`x`,`y`].flatMap(e=>[`overflow-`+e+`-start`,`overflow-`+e+`-end`,`progress-`+e].map(e=>[`--scroll-area-${e}`,`initial`]))),zV=e=>({type:e.type??`hover`,scrollHideDelay:e.scrollHideDelay??600,stickToEnd:e.stickToEnd??!1}),BV=sa({name:`scroll-area`,options:{type:`string`,scrollHideDelay:`number`,stickToEnd:`boolean`,controller:`value`},state:e=>({...zV(e),scrollbarsX:0,scrollbarsY:0,counted:!1,overflowX:!1,overflowY:!1,atXStart:!0,atXEnd:!0,atYStart:!0,atYEnd:!0,scrollingX:!1,scrollingY:!1,hovering:!1,visibleX:!1,visibleY:!1,dragging:null,sticking:!!e.stickToEnd}),live:bV,sync:zV,controlled:[],api:e=>{let{store:t,onDestroy:n}=e,r=TV(t);Gs(e,[`sticking`],(e,t)=>e.stickToEnd===void 0||e.stickToEnd===t.stickToEnd?void 0:{sticking:e.stickToEnd});let{stickToEnd:i,type:a,scrollHideDelay:o}=t.get(),s=!1;return n(()=>s=!0),n(t.subscribe(()=>{let e=t.get();(e.stickToEnd!==i||e.type!==a||e.scrollHideDelay!==o)&&({stickToEnd:i,type:a,scrollHideDelay:o}=e,queueMicrotask(()=>s||r.refresh()))})),{scrollToEnd:e=>r.scrollToEdge(`end`,e),scrollToStart:e=>r.scrollToEdge(`start`,e),isAtEnd:()=>r.isAt(`end`)??jV(t.get()),isAtStart:()=>r.isAt(`start`)??AV(t.get()),isSticking:()=>t.get().stickToEnd&&t.get().sticking,internal:r}},slots:e=>({root:e({state:FV,attrs:e=>({...IV(e),style:`position:relative`}),live:Qo(LV),bind:(e,{api:t})=>t.internal.bindRoot(e)}),viewport:e({state:FV,attrs:e=>({...IV(e),style:Ny({overflow:`auto`,"scrollbar-width":!e.counted||MV(e)?`none`:void 0})}),live:Qo(LV),bind:(e,{api:t})=>t.internal.bindViewport(e)}),content:e({state:FV,attrs:e=>({...IV(e),style:Ny({"min-width":e.scrollbarsX>0?`fit-content`:void 0,...RV})}),live:Qo(LV)}),scrollbar:e({props:{orientation:`string`},state:(e,{props:t})=>{let n=OV(t.orientation);return{orientation:Na(t.orientation,`vertical`),visible:n===`x`?e.visibleX:e.visibleY,scrolling:n===`x`?e.scrollingX:e.scrollingY,hovering:e.hovering,dragging:e.dragging===n}},attrs:(e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.overflowX:e.overflowY;return{"aria-hidden":`true`,"data-orientation":Na(t.orientation,`vertical`),...IV(e),style:Ny({position:`absolute`,"touch-action":`none`,"user-select":`none`,"-webkit-user-select":`none`,...n===`y`?{top:0,bottom:`var(--scroll-area-corner-height,0px)`,"inset-inline-end":0}:{bottom:0,"inset-inline-start":0,"inset-inline-end":`var(--scroll-area-corner-width,0px)`},display:r||e.type===`always`?void 0:`none`})}},live:Qo((e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.visibleX:e.visibleY;return{"data-visible":PV(r),"data-scrolling":PV(n===`x`?e.scrollingX:e.scrollingY),"data-hovering":PV(e.hovering),"data-dragging":PV(e.dragging===n),style:r?void 0:`pointer-events:none`}}),bind:(e,t)=>kV(t,n=>t.api.internal.bindScrollbar(e,n))}),thumb:e({props:{orientation:{kind:`string`,from:`scrollbar`}},state:(e,{props:t})=>({orientation:Na(t.orientation,`vertical`),dragging:e.dragging===OV(t.orientation)}),attrs:(e,{props:t})=>{let n=OV(t.orientation),r=n===`x`?e.overflowX:e.overflowY;return{"data-orientation":Na(t.orientation,`vertical`),style:Ny(n===`y`?{height:`var(--scroll-area-thumb-height)`,transform:`translate3d(0,var(--scroll-area-thumb-offset,0px),0)`,display:r?void 0:`none`}:{width:`var(--scroll-area-thumb-width)`,transform:`translate3d(var(--scroll-area-thumb-offset,0px),0,0)`,display:r?void 0:`none`})}},live:Qo((e,{props:t})=>({"data-dragging":PV(e.dragging===OV(t.orientation))})),bind:(e,t)=>kV(t,n=>t.api.internal.bindThumb(e,n))}),corner:e({attrs:e=>({"aria-hidden":`true`,style:Ny({position:`absolute`,bottom:0,"inset-inline-end":0,width:`var(--scroll-area-corner-width)`,height:`var(--scroll-area-corner-height)`,display:e.overflowX&&e.overflowY&&e.scrollbarsX>0&&e.scrollbarsY>0?void 0:`none`})})}),"scroll-to-end":e({state:e=>({visible:NV(e)}),attrs:()=>({type:`button`}),live:Qo(e=>({"data-visible":PV(NV(e)),inert:PV(!NV(e))})),press:({api:e,el:t},n)=>{t&&t.ownerDocument.activeElement===t&&e.internal.focusViewport(),e.scrollToEnd(),n?.preventDefault()}})})}),VV=he(BV,{root:`div`,viewport:`div`,content:`div`,corner:`div`,"scroll-to-end":`button`}),HV=Z.createContext(`vertical`),UV=VV.Root,WV=VV.Viewport;VV.Content;function GV({orientation:e=`vertical`,...t}){return(0,Q.jsx)(HV.Provider,{value:e,children:tr(BV,`scrollbar`,{id:e,orientation:e},t)})}function KV(e){let t=Z.useContext(HV);return tr(BV,`thumb`,{id:t,orientation:t},e)}var qV=VV.Corner;VV.ScrollToEnd;function JV({className:e,children:t,...n}){return(0,Q.jsxs)(UV,{"data-slot":`scroll-area`,className:Y(`relative`,e),...n,children:[(0,Q.jsx)(WV,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,Q.jsx)(YV,{}),(0,Q.jsx)(qV,{})]})}function YV({className:e,orientation:t=`vertical`,...n}){return(0,Q.jsx)(GV,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:Y(`flex touch-none p-px transition-[color,opacity] select-none data-horizontal:opacity-0 data-horizontal:data-hovering:opacity-100 data-horizontal:data-scrolling:opacity-100 data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,Q.jsx)(KV,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function XV({className:e,...t}){return(0,Q.jsx)(WV,{"data-scroll-strip":``,className:Y(e),...t})}function ZV({className:e,...t}){return(0,Q.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:Y(e),...t})}function QV({className:e,...t}){return(0,Q.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:Y(`flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground`,e),...t})}function $V({className:e,...t}){return(0,Q.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:Y(`inline-flex items-center gap-1`,e),...t})}function eH({className:e,render:t,...n}){return Se({defaultTagName:`a`,props:Wn({className:Y(`transition-colors hover:text-foreground`,e)},n),render:t,state:{slot:`breadcrumb-link`}})}function tH({className:e,...t}){return(0,Q.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:Y(`font-normal text-foreground`,e),...t})}function nH({children:e,className:t,...n}){return(0,Q.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:Y(`[&>svg]:size-3.5`,t),...n,children:e??(0,Q.jsx)(ci,{})})}function rH(e,t){let n=(0,$.c)(6),r;n[0]!==e||n[1]!==t?(r=Qn(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a=Ot(i),o=l(i),s;return n[3]!==a||n[4]!==o?(s={value:a,refresh:o},n[3]=a,n[4]=o,n[5]=s):s=n[5],s}function iH(e){let t=(0,$.c)(3),{folder:n,disabled:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,Q.jsx)(JV,{className:`h-38`,"aria-label":`Folders`,children:(0,Q.jsx)(`div`,{className:`flex flex-col p-1`,children:(0,Q.jsx)(aH,{folder:n,disabled:r})})})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function aH(e){let t=(0,$.c)(38),{folder:n,disabled:r}=e,i=Da(EB),a;t[0]===n.value?a=t[1]:(a=de(qr(n.value)),t[0]=n.value,t[1]=a);let o=a;if(Xi(n.value)){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-2 py-1.5`,children:(0,Q.jsx)(Be,{label:`Reading folders`})}),t[2]=e):e=t[2],e}if(Mi(n.value)){let e;t[3]===n.value.cause?e=t[4]:(e=ue(Ra(n.value.cause)),t[3]=n.value.cause,t[4]=e);let a;t[5]===e?a=t[6]:(a=(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}),t[5]=e,t[6]=a);let o;t[7]!==r||t[8]!==n.refresh?(o=(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:n.refresh,disabled:r,children:`Try again`}),t[7]=r,t[8]=n.refresh,t[9]=o):o=t[9];let s;t[10]===i?s=t[11]:(s=()=>i(void 0),t[10]=i,t[11]=s);let c;t[12]!==r||t[13]!==s?(c=(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,onClick:s,disabled:r,children:`Home folder`}),t[12]=r,t[13]=s,t[14]=c):c=t[14];let l;t[15]!==o||t[16]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[o,c]}),t[15]=o,t[16]=c,t[17]=l):l=t[17];let u;return t[18]!==a||t[19]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-2 py-1.5`,children:[a,l]}),t[18]=a,t[19]=l,t[20]=u):u=t[20],u}if(!o)return null;let s;t[21]!==o.parent||t[22]!==r||t[23]!==i?(s=o.parent&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`w-full justify-start`,onClick:()=>i(o.parent??void 0),disabled:r,children:[(0,Q.jsx)(yh,{"data-icon":`inline-start`}),`Up`]}),t[21]=o.parent,t[22]=r,t[23]=i,t[24]=s):s=t[24];let c;if(t[25]!==o.directories||t[26]!==r||t[27]!==i){let e;t[29]!==r||t[30]!==i?(e=e=>(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`w-full justify-start`,title:e.path,onClick:()=>i(e.path),disabled:r,children:[(0,Q.jsx)(hg,{"data-icon":`inline-start`}),(0,Q.jsx)(fr,{text:e.name})]},e.path),t[29]=r,t[30]=i,t[31]=e):e=t[31],c=o.directories.map(e),t[25]=o.directories,t[26]=r,t[27]=i,t[28]=c}else c=t[28];let l;t[32]===o.directories.length?l=t[33]:(l=!o.directories.length&&(0,Q.jsx)(`p`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No subfolders.`}),t[32]=o.directories.length,t[33]=l);let u;return t[34]!==s||t[35]!==c||t[36]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[34]=s,t[35]=c,t[36]=l,t[37]=u):u=t[37],u}function oH(e){let t=(0,$.c)(37),{connection:n,disabled:r,onOpen:i,action:a}=e,o=Ot(EB),s=Da(EB),c=rH(n,o),l,u;t[0]===c.value?(l=t[1],u=t[2]):(l=de(qr(c.value)),u=l?[`/`,...l.path.split(`/`).filter(Boolean)]:[],t[0]=c.value,t[1]=l,t[2]=u);let d=u,f;t[3]!==d||t[4]!==l||t[5]!==r||t[6]!==s?(f=l&&(0,Q.jsx)(ZV,{"aria-label":`Folder path`,children:(0,Q.jsx)(QV,{children:d.map((e,t)=>{let n=t===0?`/`:`/${d.slice(1,t+1).join(`/`)}`;return(0,Q.jsxs)(Z.Fragment,{children:[t>0&&(0,Q.jsx)(nH,{}),(0,Q.jsx)($V,{className:`min-w-0`,children:t===d.length-1?(0,Q.jsx)(tH,{className:`max-w-48`,title:l.path,children:e}):(0,Q.jsx)(eH,{render:(0,Q.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>s(n)}),title:n,children:e})})]},n)})})}),t[3]=d,t[4]=l,t[5]=r,t[6]=s,t[7]=f):f=t[7];let p;t[8]===f?p=t[9]:(p=(0,Q.jsx)(`div`,{className:`flex min-h-5 flex-col gap-1`,children:f}),t[8]=f,t[9]=p);let m;t[10]!==r||t[11]!==c?(m=(0,Q.jsx)(iH,{folder:c,disabled:r}),t[10]=r,t[11]=c,t[12]=m):m=t[12];let h;t[13]===l?.truncated?h=t[14]:(h=l?.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This folder is large; some entries are not shown.`}),t[13]=l?.truncated,t[14]=h);let g=l?.repository?`Every worktree appears in the sidebar.`:`Pick a folder that is a Git repository.`,_;t[15]===g?_=t[16]:(_=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g}),t[15]=g,t[16]=_);let v;t[17]!==l?.repository||t[18]!==r||t[19]!==c.value?(v=r||!l?.repository||lo(c.value)||Mi(c.value),t[17]=l?.repository,t[18]=r,t[19]=c.value,t[20]=v):v=t[20];let y;t[21]!==l||t[22]!==i?(y=()=>{l&&i(l.path)},t[21]=l,t[22]=i,t[23]=y):y=t[23];let b=a??`Open repository`,x;t[24]!==r||t[25]!==b||t[26]!==v||t[27]!==y?(x=(0,Q.jsx)(ji,{pending:r,size:`sm`,disabled:v,onClick:y,children:b}),t[24]=r,t[25]=b,t[26]=v,t[27]=y,t[28]=x):x=t[28];let S;t[29]!==x||t[30]!==_?(S=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[_,x]}),t[29]=x,t[30]=_,t[31]=S):S=t[31];let C;return t[32]!==S||t[33]!==p||t[34]!==m||t[35]!==h?(C=(0,Q.jsxs)(`section`,{"aria-label":`Browse for a folder`,className:`flex flex-col gap-2`,children:[p,m,h,S]}),t[32]=S,t[33]=p,t[34]=m,t[35]=h,t[36]=C):C=t[36],C}function sH(e){let t=(0,$.c)(9),{connection:n,remotes:r,onOpened:i}=e,a=BB(),o;t[0]!==n||t[1]!==r?(o=e=>{if(e===null)return{connection:n,name:void 0};let t=r.find(t=>t.remote.environmentId===e);return t&&{connection:t.connection,name:t.remote.name}},t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]!==s||t[4]!==i?(c=e=>{let t=e&&s(e.remote);return e&&t&&(0,Q.jsx)(xz,{className:`flex max-h-[90svh] flex-col sm:max-w-lg`,children:(0,Q.jsx)(cH,{connection:t.connection,remote:e.remote,name:t.name,onOpened:i,project:e.project,path:e.path},`${e.remote}:${e.project?.id??`open`}`)})},t[3]=s,t[4]=i,t[5]=c):c=t[5];let l;return t[6]!==a||t[7]!==c?(l=(0,Q.jsx)(vz,{controller:AB,onOpenChangeComplete:a,children:c}),t[6]=a,t[7]=c,t[8]=l):l=t[8],l}function cH(e){let t=(0,$.c)(29),{connection:n,remote:r,name:i,onOpened:a,project:o,path:s}=e,l;t[0]!==s||t[1]!==o?(l=o?{project:o,path:s}:void 0,t[0]=s,t[1]=o,t[2]=l):l=t[2];let[u,d]=(0,Z.useState)(l),f=Da(EB),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(e,t)=>d({project:e,path:t}),t[3]=p):p=t[3];let m=RB(n,r,lH,a,p,u?.project.id),g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-secondary text-secondary-foreground`,children:(0,Q.jsx)(sg,{"aria-hidden":`true`})}),t[4]=g):g=t[4];let _=u?`Reconnect ${u.project.name}`:`Open project`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(wz,{children:_}),t[5]=_,t[6]=v);let y=i===void 0?`Browse for a repository on the Porcelain server.`:`Browse for a repository on ${i}.`,b;t[7]===y?b=t[8]:(b=(0,Q.jsx)(Tz,{children:y}),t[7]=y,t[8]=b);let x;t[9]!==v||t[10]!==b?(x=(0,Q.jsxs)(Sz,{className:`shrink-0 flex-row items-center text-left`,children:[g,(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[v,b]})]}),t[9]=v,t[10]=b,t[11]=x):x=t[11];let S;t[12]!==m||t[13]!==u||t[14]!==f?(S=u&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm`,children:c(u.project)}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Reconnect only a repository you trust as the replacement for`,` `,u.project.name,`. The project and saved history stay in Porcelain. Replacement worktrees start with fresh review marks and Walkthroughs; old records are not applied to them.`]}),u.path&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-sm wrap-anywhere`,children:u.path}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(X,{disabled:m.result.waiting,onClick:()=>{u.path&&m.submit(u.path)},children:`Reconnect`}),(0,Q.jsx)(X,{variant:`outline`,disabled:m.result.waiting,onClick:()=>{f(u.path),d({...u,path:void 0})},children:`Choose folder`})]})]})]}),t[12]=m,t[13]=u,t[14]=f,t[15]=S):S=t[15];let C;t[16]!==n||t[17]!==m||t[18]!==u?(C=!u?.path&&(0,Q.jsx)(oH,{disabled:m.result.waiting,connection:n,onOpen:e=>{u?d({...u,path:e}):m.submit(e)},action:u?`Choose folder`:void 0}),t[16]=n,t[17]=m,t[18]=u,t[19]=C):C=t[19];let w;t[20]===m.result?w=t[21]:(w=Mi(m.result)&&(0,Q.jsx)(Ga,{variant:`destructive`,children:(0,Q.jsx)(h,{children:ue(Ra(m.result.cause))})}),t[20]=m.result,t[21]=w);let T;t[22]!==C||t[23]!==w||t[24]!==S?(T=(0,Q.jsx)(JV,{className:`min-h-0 [&>[data-slot=scroll-area-viewport]]:max-h-[calc(90svh-8rem)]`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[S,C,w]})}),t[22]=C,t[23]=w,t[24]=S,t[25]=T):T=t[25];let E;return t[26]!==T||t[27]!==x?(E=(0,Q.jsxs)(Q.Fragment,{children:[x,T]}),t[26]=T,t[27]=x,t[28]=E):E=t[28],E}function lH(){return AB.close()}function uH({className:e,...t}){return(0,Q.jsx)(Mr,{"data-slot":`context-menu-trigger`,className:Y(`select-none`,e),...t})}function dH({className:e,...t}){return(0,Q.jsx)(mr,{ref:Sr,"data-slot":`context-menu-content`,container:Ar(),className:Y(He,e),...t})}function fH(e){let t=(0,$.c)(28),{entry:n,context:r,children:i,onRetryChanges:a}=e,o=na(r),s=n.worktreeId,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`div`,{className:`min-w-0 flex-1 py-0.5`}),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=(0,Q.jsx)(uH,{render:c,children:i}),t[1]=i,t[2]=l);let u;t[3]!==n.available||t[4]!==n.changes||t[5]!==n.kind||t[6]!==a?(u=n.available&&n.kind===`worktree`&&n.changes.state===`unavailable`&&(0,Q.jsxs)(dn,{onSelect:a,children:[(0,Q.jsx)(p_,{}),`Retry changes`]}),t[3]=n.available,t[4]=n.changes,t[5]=n.kind,t[6]=a,t[7]=u):u=t[7];let d;t[8]===n.path?d=t[9]:(d=n.path&&(0,Q.jsxs)(dn,{className:`cursor-pointer`,onSelect:()=>n.path&&Zt(n.path,`worktree path`),children:[(0,Q.jsx)(Fh,{}),`Copy worktree path`]}),t[8]=n.path,t[9]=d);let f;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==o?(f=n.kind===`worktree`&&s&&(0,Q.jsxs)(dn,{className:`cursor-pointer`,disabled:!n.available||!!o,"aria-description":o,onSelect:()=>void LB.open({payload:{entry:n,context:r,worktreeId:s,requestId:crypto.randomUUID()}}),children:[(0,Q.jsx)(_g,{}),`Switch branch`]}),t[10]=r,t[11]=n,t[12]=s,t[13]=o,t[14]=f):f=t[14];let p;t[15]!==r||t[16]!==n||t[17]!==s||t[18]!==o?(p=!n.main&&n.kind===`worktree`&&s&&(0,Q.jsxs)(dn,{destructive:!0,className:`cursor-pointer`,disabled:!n.available||!!o,"aria-description":o,onSelect:()=>void IB.open({payload:{entry:n,context:r,worktreeId:s,requestId:crypto.randomUUID()}}),children:[(0,Q.jsx)(N_,{}),`Delete`]}),t[15]=r,t[16]=n,t[17]=s,t[18]=o,t[19]=p):p=t[19];let m;t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p?(m=(0,Q.jsx)(dH,{children:(0,Q.jsxs)(ct,{children:[u,d,f,p]})}),t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=m):m=t[24];let h;return t[25]!==l||t[26]!==m?(h=(0,Q.jsxs)(Wt,{children:[l,m]}),t[25]=l,t[26]=m,t[27]=h):h=t[27],h}function pH({className:e,...t}){return(0,Q.jsx)(`kbd`,{"data-slot":`kbd`,className:Y(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function mH({className:e,...t}){return(0,Q.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Y(`inline-flex items-center gap-1`,e),...t})}function hH(){let e=(0,$.c)(2),[t,n]=(0,Z.useState)(null),r;return e[0]===t?r=e[1]:(r={element:t,attach:n},e[0]=t,e[1]=r),r}function gH({className:e,...t}){return(0,Q.jsx)(`textarea`,{"data-slot":`textarea`,className:Y(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function _H({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Y(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var vH=G(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function yH({className:e,align:t=`inline-start`,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Y(vH({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var bH=G(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function xH({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,Q.jsx)(X,{type:t,"data-size":r,variant:n,className:Y(bH({size:r}),e),...i})}function SH({className:e,...t}){return(0,Q.jsx)(`span`,{className:Y(`flex items-center gap-2 text-xs/relaxed text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function CH({className:e,...t}){return(0,Q.jsx)(ei,{"data-slot":`input-group-control`,className:Y(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function wH({className:e,...t}){return(0,Q.jsx)(gH,{"data-slot":`input-group-control`,className:Y(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function TH(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Me(`(max-width: 767px)`),e[0]=t):t=e[0],Ot(t)}function EH(e){return(0,Q.jsx)(uz,{"data-slot":`sheet`,container:Ar(),...e})}function DH({className:e,...t}){return(0,Q.jsx)(dz,{"data-slot":`sheet-overlay`,className:Y(gz,e),...t})}function OH({className:e,children:t,side:n=`right`,showCloseButton:r=!0,onFocus:i,...a}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(DH,{}),(0,Q.jsxs)(fz,{"data-slot":`sheet-content`,"data-side":n,onFocus:e=>{i?.(e),_z(e)},className:Y(`fixed m-0 data-closed:pointer-events-none flex max-h-none max-w-none flex-col backdrop:bg-transparent data-[side=right]:left-auto data-[side=left]:right-auto data-[side=bottom]:top-auto data-[side=top]:bottom-auto bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...a,children:[t,r&&(0,Q.jsxs)(hz,{"data-slot":`sheet-close`,render:(0,Q.jsx)(X,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,Q.jsx)(Oi,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function kH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sheet-header`,className:Y(`flex flex-col gap-1.5 p-6`,e),...t})}function AH({className:e,...t}){return(0,Q.jsx)(pz,{"data-slot":`sheet-title`,className:Y(`font-heading text-sm font-medium text-foreground`,e),...t})}function jH({className:e,...t}){return(0,Q.jsx)(mz,{"data-slot":`sheet-description`,className:Y(`text-xs/relaxed text-muted-foreground`,e),...t})}var MH=`sidebar_state`,NH=604800,PH=`16rem`,FH=`18rem`,IH=`3rem`,LH=`b`,RH=Z.createContext(null);function zH(){return Z.useContext(RH)}function BH(){let e=Z.useContext(RH);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function VH({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=TH(),[c,l]=Z.useState(!1),[u,d]=Z.useState(e),f=t??u,p=Z.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${MH}=${t}; path=/; max-age=${NH}`},[n,f]),m=Z.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);Z.useEffect(()=>{let e=e=>{e.key===LH&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=Z.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,Q.jsx)(RH.Provider,{value:g,children:(0,Q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":PH,"--sidebar-width-icon":IH,...i},className:Y(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function HH({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=BH();return n===`none`?(0,Q.jsx)(`div`,{"data-slot":`sidebar`,className:Y(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,Q.jsx)(EH,{open:l,onOpenChange:u,...o,children:(0,Q.jsxs)(OH,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":FH},side:e,children:[(0,Q.jsxs)(kH,{className:`sr-only`,children:[(0,Q.jsx)(AH,{children:`Sidebar`}),(0,Q.jsx)(jH,{children:`Displays the mobile sidebar.`})]}),(0,Q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,Q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,Q.jsx)(`div`,{"data-slot":`sidebar-gap`,className:Y(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,Q.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:Y(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,Q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function UH({className:e,onClick:t,...n}){let{toggleSidebar:r}=BH();return(0,Q.jsxs)(X,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:Y(e),onClick:e=>{t?.(e),r()},...n,children:[(0,Q.jsx)(r_,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function WH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:Y(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function GH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:Y(`relative flex w-full min-w-0 flex-col px-2 py-1`,e),...t})}function KH({className:e,render:t,...n}){return Se({defaultTagName:`button`,props:Wn({className:Y(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-action`,sidebar:`group-action`}})}function qH({className:e,...t}){return(0,Q.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:Y(`flex w-full min-w-0 flex-col gap-px`,e),...t})}function JH({className:e,...t}){return(0,Q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:Y(`group/menu-item relative`,e),...t})}G(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-xs`,sm:`h-7 text-xs`,lg:`h-12 text-xs group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function YH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty`,className:Y(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function XH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-header`,className:Y(`flex max-w-sm flex-col items-center gap-1`,e),...t})}G(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function ZH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-title`,className:Y(`font-heading text-sm font-medium tracking-tight`,e),...t})}function QH({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-content`,className:Y(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance`,e),...t})}var $H=(e,t)=>.09*e.length/t.length;function eU(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Kn(e,r))return r;return-1}function tU(e,t){let n=0,r=-2,i=0,a=0;for(let o of t){if(o===` `)continue;let t=e.indexOf(o,n);if(t===-1)return 0;a++,Kn(e,t)&&(i+=1),t===r+1&&(i+=1),r=t,n=t+1}return a?.1+.4*i/(2*a):0}function nU(e,t){let n=je(t);if(!n)return 1;let r=je(e);if(r===n)return 1;let i=r.indexOf(n);return i===0?.9+$H(n,r):i>0?(eU(r,n,i)===-1?.6:.75)+$H(n,r):tU(r,n)}function rU(e,t){let n=nU(e.label,t);for(let r of e.keywords??[])n=Math.max(n,nU(r,t)*.95);return n}var iU=e=>e===`fuzzy`?rU:e;function aU(e,t){let{id:n,store:r,options:i}=e,a=!1,o=null,s,c=()=>s??t.query(),l,u=xs({count:()=>d.count(),status:()=>r.get().status,onLoadMore:()=>i().onLoadMore}),d=Ht({store:r,focus:()=>r.get().focusInList?`real`:`virtual`,items:t.items,emptyItems:t.emptyItems,toKey:e=>String(e??``),filter:()=>iU(t.filter()),rank:()=>t.filter()===`fuzzy`||typeof t.filter()==`function`,query:c,loop:()=>i().loop??!0,skipDisabled:!0,active:()=>r.get().open,onHighlight:t.onHighlight,onLastReached:u.reached,container:t.container,scrollRoot:t.scrollRoot,onRegister(){a||(a=!0,nc(()=>{a=!1,r.set({mounts:r.get().mounts+1})}))}});Ro(r,d);let f=t=>e.props(`item`,t);function p(e){let{highlighted:n,settled:i}=r.get();if(!t.items()&&!i)return n;let a=t.autoHighlight(),o=a===`always`||a===`typing`&&c()!==``,s=n!==null&&d.entries().some(e=>e.key===n),l=o?t.preferred?.(d)??d.firstEnabled()??null:null;return e&&o?l:s?n:l}function m(e,n){let i=p(e);i!==r.get().highlighted&&t.highlight(i,n)}function h(e){let n=q(e,{apple:jo()});if(n===void 0||e.altKey&&e.key===`ArrowUp`)return!1;if(!r.get().open)return!t.open||n!==1&&n!==-1?!1:(e.preventDefault(),t.open(e,n===-1?`last`:`first`),!0);e.preventDefault();let i=d.stepKey(n);return i!==void 0&&t.highlight(i,{reason:`list-navigation`,event:e}),!0}let g=t.query(),_=r.get();r.subscribe(()=>{let e=r.get(),n=_;_=e;let i=t.query();if(i!==g){g=i;let e=o??{reason:`imperative`};o=null,m(!0,e)}else if(e.mounts!==n.mounts&&!t.settlesMount?.()||e.items!==n.items||e.settled!==n.settled){let r=n.highlighted===null?null:{reason:`item-removed`};e.highlighted===n.highlighted?m(!1,r):t.highlight(e.highlighted,r)}}),e.onOptions(()=>{if(l===void 0)return;let e=l,n=o;l=void 0,queueMicrotask(()=>{t.query()===e&&m(!0,n)})});let v=t.autoHighlight();return e.onOptions(()=>{let e=t.autoHighlight();e!==v&&(v=e,queueMicrotask(()=>m(!1,{reason:`imperative`})))}),Ri({store:r,query:t.query,count:()=>d.count(),loading:()=>r.get().status===`loading`,shown:()=>r.get().open,silent:()=>_e(e,`status`).length>0,announcement:()=>i().announcement}),{listbox:d,itemProps:f,settledHighlight:p,settle:m,navigate:h,loadMore:u,matchQuery:t.query,matchMode:()=>is(t.filter()),cause(e,t){o={reason:e,event:t}},settleFor(e){l=t.query(),s=e;try{m(!0,o)}finally{s=void 0}},hover(e,n){n.pointerType!==`touch`&&r.get().open&&!f(e)?.disabled&&r.get().highlighted!==e&&t.highlight(e,{reason:`item-hover`,event:n})},isEmpty:e=>(!!t.items()||e.settled)&&d.count()===0,itemCount:()=>d.count(),filterQuery:t.query,activeDescendant(e){let{highlighted:t}=e;if(e.open&&!e.focusInList&&t!==null&&d.element(t)?.isConnected)return`${n}-option-${cs(t)}`}}}function oU(){let e=(e,t)=>e.internal.text(t);return{role:`combobox`,focus:`native`,keys:Do,attrs:(t,{id:n,api:r})=>({id:`${n}-input`,value:e(r,t),autocomplete:`off`,autocapitalize:`none`,spellcheck:`false`,"aria-expanded":String(t.open)}),live:Qo((e,{api:t})=>({"aria-activedescendant":t.internal.activeDescendant(e)})),on:{input:(e,{api:t,el:n})=>t.internal.typed(n,e),keydown:(e,{api:t})=>t.internal.onInputKeyDown(e)},bind(t,{api:n,id:r,store:i}){ch(t,i,r);let a=t,o,s=()=>{let t=e(n,i.get());t!==o&&(o=t,a.value!==t&&(a.value=t))};return ui(a,()=>[e(n,i.get())],()=>n.internal.typed(a)),s(),i.subscribe(s)}}}function sU(){return{props:{value:`string`,label:`string`,keywords:`list`,disabled:`boolean`,index:`number`,group:{kind:`string`,from:`group.id`}},role:`option`,focus:`active-descendant`,attrs:(e,{id:t,key:n,props:r,api:i})=>({id:`${t}-option-${cs(n)}`,tabindex:e.focusInList?`-1`:void 0,"aria-disabled":r.disabled?`true`:void 0,"aria-selected":void 0,...Za(r.index,i.internal.listbox),hidden:i.internal.listbox.matches(n,r)?void 0:``,"data-disabled":r.disabled?``:void 0}),direct:fo([`hidden`]),live:Qo((e,{key:t})=>({"aria-selected":e.highlighted===t?`true`:`false`,"data-highlighted":e.highlighted===t?``:void 0})),on:{...on,pointermove:(e,{api:t,key:n})=>t.internal.hover(n,e)},press:({api:e,key:t},n)=>e.internal.press(t,n),bind(e,{api:t,key:n,props:r}){let i=js(e,{api:t,key:n,props:r});return()=>{i(),e.removeAttribute(`data-highlighted`),e.setAttribute(`aria-selected`,`false`)}}}}function cU(e){return{open:!0,value:e.value===void 0?e.defaultValue??null:e.value,highlighted:null,query:e.query??e.defaultQuery??``,pages:e.pages??e.defaultPages??[],queries:[],items:e.items,status:e.status??`idle`,pending:[],error:null,apple:Hi(),mounts:0,settled:!1,focusInList:!1,groupLabels:[],fieldName:null,listing:so}}function lU(e){return{items:e.items,status:e.status??`idle`,...e.value===void 0?{}:{value:e.value},...e.query===void 0?{}:{query:e.query},...e.pages===void 0?{}:{pages:e.pages}}}var uU=e=>e.pages.at(-1)??null;function dU(e){let{id:t,store:n,options:r,element:i}=e;ga(e,()=>n.get().pending.length>0);let a=ht(e),o=t=>e.props(`item`,t),s=()=>ih(n.get().items,n.get().pages),c=e=>e===null?-1:d.listbox.entries().findIndex(t=>t.key===e);function l(e,t){return e===n.get().value?!1:t?a(`value`,e,{reason:t.reason,event:t.event,index:c(e)}):(r().value===void 0&&n.set({value:e}),!1)}let u=null,d=aU(e,{query:()=>n.get().query,items:s,emptyItems:()=>n.get().pages.length?void 0:r().emptyItems,filter:()=>r().filter??`fuzzy`,autoHighlight:()=>r().autoHighlight!==!1&&`always`,highlight:l,container:()=>i(`list`),scrollRoot:()=>i(`root`),settlesMount:()=>u!==null});function f(e,t,n){return d.cause(t,n),a(`query`,e,{reason:t,event:n})}function p(e,t,n){let i=f(e,t,n);return i&&r().query!==void 0&&r().value!==void 0&&r().filter!==!1&&d.settleFor(e),i}let m=null;function h(e,t,r){let{pages:i,query:o,queries:s}=n.get();return m={reason:t,event:r},a(`pages`,[...i,e],{reason:t,event:r})?(n.set({queries:[...s.slice(0,i.length),o]}),f(``,t,r),!0):!1}function g(e,t){let{pages:r,queries:i}=n.get();return!r.length||(m={reason:e,event:t},!a(`pages`,r.slice(0,-1),{reason:e,event:t}))?!1:(n.set({queries:i.slice(0,r.length-1)}),f(i[r.length-1]??``,e,t),!0)}function _(e,{event:t,reason:i=`item-press`}){let a=o(e),s=ah(n.get().items,e)??ah(r().emptyItems,e);if(!a&&!s)return;if(a?.disabled||s?.disabled||n.get().pending.includes(e)){t?.type===`click`&&t.preventDefault();return}n.get().error?.key===e&&n.set({error:null});let c=t&&!t.defaultPrevented?t:Tf(),l=[a?.onSelect?.(c)],u=a?.page??(s?.items?s.value:void 0);c.defaultPrevented||(u===void 0?l.push(r().onAction?.(e,{event:t})):h(u,i,t));let d=l.filter(Yr);if(!d.length)return;n.set({pending:[...n.get().pending,e]});let f=()=>n.get().pending.filter(t=>t!==e);Promise.all(d).then(()=>n.set({pending:f()}),t=>n.set({pending:f(),error:{key:e,reason:t}}))}function v(e){if(d.navigate(e))return;let{value:t,query:r,pages:i}=n.get();switch(e.key){case`Enter`:{if(t===null){Sf(e)||e.preventDefault();return}let n=d.listbox.element(t);n?.matches(`a[href]`)?n.click():_(t,{event:e}),e.preventDefault();return}case`Escape`:if(!r&&!i.length)return;e.preventDefault(),r?p(``,`escape-key`,e):g(`escape-key`,e);return;case`Backspace`:!e.target.value&&i.length&&(e.preventDefault(),g(`back`,e))}}Gs(e,[`highlighted`],(e,t)=>`value`in e&&e.value!==t.highlighted?{highlighted:e.value}:void 0);let y=n.get().value,b=n.get().pages,x=n.get().mounts;n.subscribe(()=>{let e=n.get();if((e.value!==e.highlighted||e.value!==y)&&(y=e.value,d.listbox.highlight(e.value)),e.pages!==b){b=e.pages;let t=m??{reason:`imperative`};m=null,s()?d.settle(!0,t):u=t}else if(u&&e.mounts!==x){let e=u;u=null,d.settle(!0,e)}x=e.mounts});function S(e){let t,r=[],i=()=>{let{items:i}=n.get();i!==t&&(t=i,r.forEach(e=>e()),r=oh(i).map(({value:t,shortcut:n})=>rr.register(n,e=>_(t,{event:e,reason:`shortcut`}),{layer:e})))};i();let a=n.subscribe(i);return()=>{a(),r.forEach(e=>e())}}function C(e,t,r){return Ko(()=>{let e=o(t);return e?.data||ah(n.get().items,t)?.shortcut?void 0:e?.shortcut},e=>_(t,{event:e,reason:`shortcut`}),{layer:e},r)}let w={id:t,getValue:()=>n.get().value,setValue:(e,{reason:t=`imperative`,event:n}={})=>l(e,{reason:t,event:n}),getQuery:()=>n.get().query,setQuery:(e,{reason:t=`imperative`,event:n}={})=>p(e,t,n),getPages:()=>n.get().pages,setPages(e,{reason:t=`imperative`,event:n}={}){return m={reason:t,event:n},a(`pages`,e,{reason:t,event:n})},push:(e,{reason:t=`imperative`,event:n}={})=>h(e,t,n),pop:({reason:e=`imperative`,event:t}={})=>g(e,t),run(e){let t=e??n.get().value;t!==null&&_(t,{})},focus:()=>i(`input`)?.focus(),internal:{...d,options:r,itemProps:o,run:_,press:(e,t)=>_(e,{event:t}),text:e=>e.query,typed:(e,t)=>p(e.value,`input-change`,t),onInputKeyDown:v,onCurrentPage:(e,t)=>t===void 0||t===uU(e),shortcutOf:t=>Je(e,`item`,t),bindDataShortcuts:S,bindItemShortcut:C,syncPlatform:()=>rt(n)}};return n.get().value!==null&&d.listbox.highlight(n.get().value),d.settle(!1,null),w}var fU=dU,pU=[];function mU(e,t,n){return{highlighted:e.highlighted===t,disabled:!!n.disabled,pending:e.pending.includes(t),error:e.error?.key===t?e.error.reason:void 0}}var hU={open:[],value:[],query:[],queries:[],items:[],status:[],mounts:[],settled:[],groupLabels:[],fieldName:[]},gU=oU(),_U=sU(),vU=e=>({root:e({state:e=>({page:uU(e),loading:e.status===`loading`}),attrs:e=>({"data-loading":e.status===`loading`?``:void 0}),bind(e,{api:t}){return t.internal.syncPlatform(),t.internal.bindDataShortcuts(e)}}),input:e({...gU,keys:[...gU.keys,`Enter`,`Escape`,`Backspace`],state:e=>({page:uU(e)}),attrs:(e,t)=>({...gU.attrs(e,t),type:`text`,"aria-autocomplete":`list`,"aria-controls":`${t.id}-list`}),bind(e,t){return gU.bind(e,t)}}),list:e({role:`listbox`,keys:{none:`The search field handles them, and keeps focus while they move the highlight.`},state:(e,{api:t})=>({status:e.status,items:t.internal.listbox.visibleData()?.list??pU}),attrs:(e,{id:t})=>({id:`${t}-list`,...lh(e,t),"aria-busy":e.status===`loading`?`true`:void 0}),on,bind(e,{api:t,store:n}){let r=!0;queueMicrotask(()=>r&&n.set({settled:!0})),t.internal.syncPlatform();let i=t.internal.loadMore.bind(e);return()=>{r=!1,i(),n.set({settled:!1})}}}),item:e({..._U,props:{value:`id`,label:`string`,keywords:`list`,disabled:`boolean`,shortcut:`string`,page:`string`,index:`number`,onSelect:`action`,group:{kind:`string`,from:`group.id`},inPage:{kind:`string`,from:`page.value`},data:`boolean`},selects:Is({highlighted:({key:e})=>[e],listing:({key:e})=>[e],pending:({key:e})=>[e],...hU}),present:(e,{props:t,api:n})=>n.internal.onCurrentPage(e,t.inPage),state:(e,{key:t,props:n})=>mU(e,t,n),attrs:(e,t)=>{let{key:n,props:r}=t,i=e.pending.includes(n),a=_U.attrs(e,t);return{...a,"aria-disabled":i?`true`:a[`aria-disabled`],"aria-busy":i?`true`:void 0,"aria-keyshortcuts":r.shortcut?Ts(r.shortcut,e.apple):void 0,"data-pending":i?``:void 0}},bind(e,t){let n=_U.bind(e,t),r=t.api.internal.bindItemShortcut(e,t.key,e=>Qi(t,e));return()=>{n(),r()}}}),"item-text":e(go()),"item-icon":e(dd({component:`command`,...Qd})),group:e(ps()),"group-label":e($r()),separator:e(yi()),empty:e(Ca()),status:e(Ai()),page:e({props:{value:`string`},present:(e,{props:t})=>(t.value??null)===uU(e),role:`none`}),shortcut:e({props:{shortcut:{kind:`string`,from:`item`}},state:(e,{props:t})=>({text:t.shortcut?Ci(t.shortcut,e.apple):``}),attrs:()=>({"aria-hidden":`true`,translate:`no`}),bind(e,{store:t,api:n,props:r}){if(e.childNodes.length)return;let i=()=>{let i=r.shortcut??n.internal.shortcutOf(e);e.textContent=i?Ci(i,t.get().apple):``};i();let a=t.subscribe(i);return()=>{a(),e.textContent=``}}})}),yU=sa({name:`command`,options:{value:`string`,defaultValue:`string`,onValueChange:`callback`,query:`string`,defaultQuery:`string`,onQueryChange:`callback`,pages:`list`,defaultPages:`list`,onPagesChange:`callback`,onAction:`action`,pendingAnnouncement:`string`,items:`value`,emptyItems:`value`,filter:Wa([`contains`,`startsWith`,`fuzzy`],`fuzzy`),autoHighlight:`boolean`,loop:`boolean`,status:`string`,onLoadMore:`callback`,announcement:`value`,controller:`value`},state:cU,live:[`value`,`highlighted`],controlled:[`value`,`query`,`pages`],sync:lU,api:fU,slots:e=>vU(e),agent:{actions:[`run`,`setValue`,`setQuery`,`setPages`]}}),bU=he(yU,{input:`input`,"item-icon":`span`,group:`div`,"group-label":`div`,separator:`div`,status:`div`}),xU=Z.createContext(void 0),SU=Z.createContext(!1);function CU(){return Ec(yU)}function wU({value:e,defaultValue:n,onValueChange:r,query:i,defaultQuery:a,onQueryChange:o,pages:s,defaultPages:c,onPagesChange:l,onAction:u,pendingAnnouncement:d,items:f,emptyItems:p,filter:m,autoHighlight:h,loop:g,status:_,onLoadMore:v,announcement:y,controller:b,debug:x,children:S,...C}){let w=Ae(yU,{value:e,defaultValue:n,onValueChange:r,query:i,defaultQuery:a,onQueryChange:o,pages:s,defaultPages:c,onPagesChange:l,onAction:u,pendingAnnouncement:d,items:f,emptyItems:p,filter:m,autoHighlight:h,loop:g,status:_,onLoadMore:v,announcement:y,controller:b,debug:x});be(b,w);let T=typeof S!=`function`&&t(S,EU),[E,D]=Ss(typeof S!=`function`&&!!f&&!T),O=E||T,k=e=>typeof S==`function`?(0,Q.jsx)($t,{value:D,children:S(e)}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($t,{value:D,children:S}),(0,Q.jsx)($t,{value:null,children:f&&!O&&(0,Q.jsx)(EU,{})})]});return tr(w,`root`,{},{...C,children:k})}var TU=bU.Input;function EU({children:e,...t}){zi();let n=CU(),r=t=>typeof e==`function`?e(t):e??(n.state.items?(0,Q.jsx)(MU,{items:t.items}):null);return tr(n,`list`,{},{...t,children:r})}function DU({value:e,label:t,keywords:n,disabled:r,shortcut:i,page:a,index:o,onSelect:s,render:c,...l}){let u=CU(),d=Z.useId(),f=gn(yU,`group`)?.id,p=Z.useContext(xU),m=Z.useContext(SU),h=e??d;return tr(u,`item`,{id:h,value:h,label:t,keywords:n,disabled:r,shortcut:i,page:a,index:o,onSelect:s,group:f,inPage:p,data:m},{...l,render:c})}bU.ItemIcon;var OU=bU.Group,kU=bU.GroupLabel,AU=bU.Separator;function jU({children:e,...t}){let n=t=>typeof e==`function`?e(t):t.empty?e:null;return tr(yU,`empty`,{},{...t,children:n})}bU.Status;function MU({items:e}){return(0,Q.jsx)(SU.Provider,{value:!0,children:e.map((e,t)=>typeof e==`string`?(0,Q.jsx)(DU,{value:e,children:e},e):`type`in e&&e.type===`separator`?(0,Q.jsx)(AU,{},`separator-${t}`):`type`in e&&e.type===`group`?(0,Q.jsxs)(OU,{children:[e.label&&(0,Q.jsx)(kU,{children:e.label}),(0,Q.jsx)(MU,{items:e.items})]},`group-${e.label??t}`):(0,Q.jsx)(DU,{value:e.value,label:e.label,keywords:e.keywords,disabled:e.disabled,shortcut:e.shortcut,children:e.label},e.value))})}var NU={j:`ArrowDown`,n:`ArrowDown`,k:`ArrowUp`,p:`ArrowUp`};function PU(e){let t=NU[e.key];t===void 0||!e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.stopPropagation(),e.target.dispatchEvent(new KeyboardEvent(`keydown`,{key:t,bubbles:!0,cancelable:!0})))}function FU({className:e,onEscape:t,onQueryChange:n,...r}){return(0,Q.jsx)(wU,{onKeyDownCapture:PU,onQueryChange:(e,r)=>{r.reason===`escape-key`&&t?(r.cancel(),t()):n?.(e,r)},"data-slot":`command`,className:Y(`flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground`,e),...r})}function IU({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,Q.jsx)(vz,{...a,children:(0,Q.jsxs)(xz,{className:Y(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:[(0,Q.jsxs)(Sz,{className:`sr-only`,children:[(0,Q.jsx)(wz,{children:e}),(0,Q.jsx)(Tz,{children:t})]}),n]})})}function LU({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,Q.jsxs)(_H,{className:`h-8! bg-input/20 dark:bg-input/30`,children:[(0,Q.jsx)(TU,{"data-slot":`command-input`,className:Y(`w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{className:`size-3.5 shrink-0 opacity-50`})})]})})}function RU({className:e,...t}){return(0,Q.jsx)(EU,{"data-slot":`command-list`,className:Y(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function zU({className:e,...t}){return(0,Q.jsx)(jU,{"data-slot":`command-empty`,className:Y(`py-6 text-center text-xs/relaxed not-data-empty:hidden`,e),...t})}function BU({className:e,heading:t,children:n,...r}){return(0,Q.jsxs)(OU,{"data-slot":`command-group`,className:Y(`overflow-hidden p-1 text-foreground`,e),...r,children:[t!==void 0&&(0,Q.jsx)(kU,{className:`px-2.5 py-1.5 text-xs font-medium text-muted-foreground`,children:t}),n]})}function VU({className:e,children:t,...n}){return(0,Q.jsxs)(DU,{"data-slot":`command-item`,className:Y(`group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-muted data-highlighted:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-highlighted:*:[svg]:text-foreground`,e),...n,children:[t,(0,Q.jsx)(Dn,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function HU(e,t,n){let r=(0,$.c)(12),i;r[0]===e?i=r[1]:(i=Ds(e),r[0]=e,r[1]=i);let[a,o]=ud(i),s=Ki(),c=Fi(),l=Pc(),u;r[2]!==s?.environmentId||r[3]!==l||r[4]!==n||r[5]!==c||r[6]!==o||r[7]!==e?(u=(t,r,i)=>o(t).then(async t=>{if(!t.deleted){r(t.plan);return}n();let i=c.state.matches.at(-1)?.params;t.plan.worktreePath&&i&&`worktreeId`in i&&`projectId`in i&&i.worktreeId===e.scope.worktreeId&&i.projectId===e.scope.projectId&&(`environmentId`in i?i.environmentId:s?.environmentId)===e.connection.environmentId&&await l({to:`/`})},i),r[2]=s?.environmentId,r[3]=l,r[4]=n,r[5]=c,r[6]=o,r[7]=e,r[8]=u):u=r[8];let d;return r[9]!==a||r[10]!==u?(d={result:a,submit:u},r[9]=a,r[10]=u,r[11]=d):d=r[11],d}function UU(e){let t=(0,$.c)(15),n;t[0]===e?n=t[1]:(n=Wi(e),t[0]=e,t[1]=n);let[r,i]=ud(n),a;t[2]===e?a=t[3]:(a=Ti(e),t[2]=e,t[3]=a);let[o,s]=ud(a),[c,l]=(0,Z.useState)(!1),u;t[4]===e?u=t[5]:(u=Rs(e),t[4]=e,t[5]=u);let{unresolved:d}=La(u),f=c?o:r,p=r.waiting||o.waiting,m;t[6]!==s||t[7]!==i||t[8]!==d?(m=(e,t)=>{l(d);let n;if(d)n=s(void 0);else if(e)n=i(e);else return;return n.then(e=>{(e.state===`succeeded`||e.state===`no-change`)&&t()},WU)},t[6]=s,t[7]=i,t[8]=d,t[9]=m):m=t[9];let h;return t[10]!==f||t[11]!==p||t[12]!==m||t[13]!==d?(h={result:f,pending:p,unresolved:d,submit:m},t[10]=f,t[11]=p,t[12]=m,t[13]=d,t[14]=h):h=t[14],h}function WU(){}function GU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(vz,{controller:LB,children:KU}),e[0]=t):t=e[0],t}function KU(e){return e&&(0,Q.jsx)(qU,{...e},e.requestId)}function qU(e){let t=(0,$.c)(45),{context:n,entry:r,worktreeId:i}=e,{connection:a}=n,o=na(n),[s,c]=(0,Z.useState)(),[l,u]=(0,Z.useState)(``),d;t[0]!==r.projectId||t[1]!==i?(d={projectId:r.projectId,worktreeId:i},t[0]=r.projectId,t[1]=i,t[2]=d):d=t[2];let f;t[3]!==a||t[4]!==d?(f={connection:a,scope:d},t[3]=a,t[4]=d,t[5]=f):f=t[5];let{result:p,pending:m,unresolved:h,submit:g}=UU(f),_;t[6]!==r.projectId||t[7]!==i?(_={projectId:r.projectId,worktreeId:i},t[6]=r.projectId,t[7]=i,t[8]=_):_=t[8];let{result:v,refresh:y}=yB(_,a,!0),b=de(qr(v)),x;t[9]===r.projectId?x=t[10]:(x=e=>e.id===r.projectId,t[9]=r.projectId,t[10]=x);let S=QB(a).projects.find(x),C=nu(b?.bases??[],S?.worktrees??[],i),w=new Map(C.map(ZU)),T=C.map(XU),E;t[11]===s?E=t[12]:(E=e=>e.ref===s&&!e.current&&!e.inUse,t[11]=s,t[12]=E);let D=C.some(E),O=`Switch branch`;h&&(O=`Check outcome`);let k;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(wz,{children:`Switch branch`}),t[13]=k):k=t[13];let A;t[14]===r.name?A=t[15]:(A=(0,Q.jsxs)(Sz,{children:[k,(0,Q.jsxs)(Tz,{children:[`Choose a branch for `,r.name,`. Branches used by another worktree are unavailable.`]})]}),t[14]=r.name,t[15]=A);let j;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(LU,{"aria-label":`Find a branch`,placeholder:`Find a branch`}),t[16]=j):j=t[16];let M;t[17]===v?M=t[18]:(M=Xi(v)&&(0,Q.jsx)(`p`,{role:`status`,className:`py-6 text-center text-xs/relaxed text-muted-foreground`,children:`Reading branches`}),t[17]=v,t[18]=M);let N;t[19]!==v||t[20]!==y?(N=Mi(v)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-center gap-2 py-6 text-xs/relaxed text-muted-foreground`,children:[`Branches could not be read.`,(0,Q.jsx)(X,{variant:`link`,size:`flush`,disabled:v.waiting,onClick:y,children:`Try again`})]}),t[19]=v,t[20]=y,t[21]=N):N=t[21];let P;t[22]===b?P=t[23]:(P=b&&(0,Q.jsx)(zU,{children:`No matching branch`}),t[22]=b,t[23]=P);let F;t[24]===h?F=t[25]:(F=h&&(0,Q.jsx)(`p`,{role:`status`,children:`The previous switch is not confirmed. Check its outcome before switching again.`}),t[24]=h,t[25]=F);let I;t[26]===p?I=t[27]:(I=Mi(p)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:String(Ra(p.cause))}),t[26]=p,t[27]=I);let L;t[28]===p?L=t[29]:(L=Bo(p)&&p.value.state!==`succeeded`&&p.value.state!==`no-change`&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p.value.message??`The branch could not be switched.`}),t[28]=p,t[29]=L);let R;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(X,{variant:`outline`}),t[30]=R):R=t[30];let z;t[31]===m?z=t[32]:(z=(0,Q.jsx)(yz,{render:R,disabled:m,children:`Cancel`}),t[31]=m,t[32]=z);let B=!!o||m||!h&&!D,V;t[33]!==s||t[34]!==g?(V=()=>void g(s,JU),t[33]=s,t[34]=g,t[35]=V):V=t[35];let H;t[36]!==O||t[37]!==m||t[38]!==B||t[39]!==V||t[40]!==o?(H=(0,Q.jsx)(ji,{pending:m,disabled:B,"aria-description":o,onClick:V,children:O}),t[36]=O,t[37]=m,t[38]=B,t[39]=V,t[40]=o,t[41]=H):H=t[41];let U;return t[42]!==z||t[43]!==H?(U=(0,Q.jsxs)(Cz,{children:[z,H]}),t[42]=z,t[43]=H,t[44]=U):U=t[44],(0,Q.jsxs)(xz,{showCloseButton:!m,children:[A,(0,Q.jsxs)(FU,{items:T,query:l,onQueryChange:u,onEscape:YU,children:[j,M,N,P,(0,Q.jsx)(RU,{"aria-label":`Branches`,children:e=>(0,Q.jsx)(BU,{children:e.items.map(e=>{let t=``;typeof e==`string`?t=e:`value`in e&&(t=e.value);let n=w.get(t);return n&&(0,Q.jsxs)(VU,{value:n.ref,label:n.name,disabled:m||h||n.current||n.inUse,onSelect:()=>c(n.ref),"data-checked":s===n.ref,className:`cursor-pointer`,children:[(0,Q.jsx)(_g,{}),(0,Q.jsx)(fr,{text:n.name,className:`min-w-0 flex-1`}),n.current&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Current`}),n.inUse&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`In use`}),s===n.ref&&(0,Q.jsx)(Dn,{})]},n.ref)})})})]}),F,I,L,U]})}function JU(){return LB.close()}function YU(){return LB.close()}function XU(e){return{value:e.ref,label:e.name}}function ZU(e){return[e.ref,e]}function QU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:IB,children:$U}),e[0]=t):t=e[0],t}function $U(e){return e&&(0,Q.jsx)(eW,{...e},e.requestId)}function eW(e){let t=(0,$.c)(29),{entry:n,context:r,worktreeId:i}=e,a=Yu(r.connection),o;t[0]===a?o=t[1]:(o=Cd(a),t[0]=a,t[1]=o);let s=o,c;t[2]===a?c=t[3]:(c=rd(a),t[2]=a,t[3]=c);let l=c,u;t[4]===n.name?u=t[5]:(u=(0,Q.jsxs)(jz,{children:[`Delete `,n.name,`?`]}),t[4]=n.name,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(Mz,{children:`Choose what to delete this time. Your saved settings won’t change. Review history stays available.`}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(kz,{children:[u,d]}),t[7]=u,t[8]=f);let p;t[9]!==r||t[10]!==n||t[11]!==s||t[12]!==i?(p=s&&(0,Q.jsx)(tW,{settings:s,entry:n,context:r,worktreeId:i}),t[9]=r,t[10]=n,t[11]=s,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==s||t[15]!==a?(m=!s&&a.kind===`reading`&&(0,Q.jsx)(Be,{label:`Reading deletion settings`}),t[14]=s,t[15]=a,t[16]=m):m=t[16];let h;t[17]!==l||t[18]!==s||t[19]!==a?(h=!s&&a.kind!==`reading`&&l&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),t[17]=l,t[18]=s,t[19]=a,t[20]=h):h=t[20];let g;t[21]===s?g=t[22]:(g=!s&&(0,Q.jsx)(Nz,{children:`Cancel`}),t[21]=s,t[22]=g);let _;return t[23]!==f||t[24]!==p||t[25]!==m||t[26]!==h||t[27]!==g?(_=(0,Q.jsxs)(Oz,{children:[f,p,m,h,g]}),t[23]=f,t[24]=p,t[25]=m,t[26]=h,t[27]=g,t[28]=_):_=t[28],_}function tW(e){let t=(0,$.c)(58),{settings:n,entry:r,context:i,worktreeId:a}=e,{connection:o}=i,s=na(i),{detached:c}=r,l;t[0]!==c||t[1]!==n?(l=()=>gl(n,c),t[0]=c,t[1]=n,t[2]=l):l=t[2];let[u,d]=(0,Z.useState)(l),[f,p]=(0,Z.useState)(),[m,h]=(0,Z.useState)(!1),g;t[3]!==r.projectId||t[4]!==a?(g={projectId:r.projectId,worktreeId:a},t[3]=r.projectId,t[4]=a,t[5]=g):g=t[5];let _;t[6]!==o||t[7]!==g?(_={connection:o,scope:g},t[6]=o,t[7]=g,t[8]=_):_=t[8];let{result:v,submit:y}=HU(_,r,nW),b;t[9]!==m||t[10]!==u||t[11]!==f||t[12]!==y?(b=()=>void y({options:u,...f?{confirmation:{plan:f,discardChanges:m}}:{}},p,()=>{p(void 0),h(!1)}),t[9]=m,t[10]=u,t[11]=f,t[12]=y,t[13]=b):b=t[13];let x=b,S=v.waiting,C=Object.values(u).some(Boolean),w=f&&(f.dirty||f.unpushed),T=f&&!f.worktreePath&&!f.localBranch&&!f.remoteBranch,E=`Review deletion`;f&&(E=`Delete`);let D;t[14]!==c||t[15]!==u||t[16]!==S?(D=Pd.map(e=>{let{key:t,label:n}=e;return(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(Qa,{htmlFor:`delete-${t}`,children:n}),(0,Q.jsx)(bn,{id:`delete-${t}`,checked:u[t],disabled:S||c&&t!==`deleteWorktree`,onCheckedChange:e=>{d(n=>({...n,[t]:e})),p(void 0),h(!1)},className:`cursor-pointer`})]},t)}),t[14]=c,t[15]=u,t[16]=S,t[17]=D):D=t[17];let O;t[18]===c?O=t[19]:(O=c&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This worktree is detached: there is no checked-out branch to delete.`}),t[18]=c,t[19]=O);let k;t[20]!==c||t[21]!==u?(k=!c&&!u.deleteWorktree&&u.deleteLocalBranch&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Keep the worktree folder and its files, detach it from the branch, then delete the local branch.`}),t[20]=c,t[21]=u,t[22]=k):k=t[22];let A;t[23]!==c||t[24]!==u?(A=!c&&u.deleteWorktree&&!u.deleteLocalBranch&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The worktree folder will be deleted. The local branch will be kept.`}),t[23]=c,t[24]=u,t[25]=A):A=t[25];let j;t[26]!==D||t[27]!==O||t[28]!==k||t[29]!==A?(j=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[D,O,k,A]}),t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j):j=t[30];let M;t[31]!==r.path||t[32]!==f?(M=f?(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-all text-xs text-muted-foreground`,children:ol(f)}):(0,Q.jsx)(`p`,{className:`break-all text-xs text-muted-foreground`,children:r.path}),t[31]=r.path,t[32]=f,t[33]=M):M=t[33];let N;t[34]!==m||t[35]!==S||t[36]!==w?(N=w&&(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(Qa,{htmlFor:`delete-discard-changes`,children:`I understand the risk of losing changes and commits`}),(0,Q.jsx)(bn,{id:`delete-discard-changes`,checked:m,disabled:S,onCheckedChange:h,className:`cursor-pointer`})]}),t[34]=m,t[35]=S,t[36]=w,t[37]=N):N=t[37];let P;t[38]===v?P=t[39]:(P=Mi(v)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:bl(Ra(v.cause))}),t[38]=v,t[39]=P);let F;t[40]===S?F=t[41]:(F=(0,Q.jsx)(Nz,{disabled:S,children:`Cancel`}),t[40]=S,t[41]=F);let I=f?`destructive`:`default`,L=!!s||S||!C||!!(T||w&&!m),R;t[42]!==E||t[43]!==x||t[44]!==S||t[45]!==I||t[46]!==L||t[47]!==s?(R=(0,Q.jsx)(ji,{pending:S,"aria-description":s,variant:I,disabled:L,onClick:x,children:E}),t[42]=E,t[43]=x,t[44]=S,t[45]=I,t[46]=L,t[47]=s,t[48]=R):R=t[48];let z;t[49]!==F||t[50]!==R?(z=(0,Q.jsxs)(Az,{children:[F,R]}),t[49]=F,t[50]=R,t[51]=z):z=t[51];let B;return t[52]!==M||t[53]!==N||t[54]!==P||t[55]!==z||t[56]!==j?(B=(0,Q.jsxs)(Q.Fragment,{children:[j,M,N,P,z]}),t[52]=M,t[53]=N,t[54]=P,t[55]=z,t[56]=j,t[57]=B):B=t[57],B}function nW(){return IB.close()}function rW(e){let t=(0,$.c)(42),{environmentId:n,environmentName:r,project:i,icon:a}=e,o;t[0]!==n||t[1]!==i?(o={project:i,remote:n},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s=o,l;t[3]!==i||t[4]!==s?(l=i.available?[]:[{label:`Reconnect project`,icon:sg,run:()=>void AB.open({payload:{...s,...Ia(i)?{path:Ia(i)}:{}}}),destructive:!1}],t[3]=i,t[4]=s,t[5]=l):l=t[5];let u;t[6]===i?u=t[7]:(u={label:`Copy path`,icon:Bs,run:()=>Zt(Ia(i),`project path`),destructive:!1},t[6]=i,t[7]=u);let d;t[8]===s?d=t[9]:(d={label:`Rename project`,icon:ao,run:()=>void MB.open({payload:s}),destructive:!1},t[8]=s,t[9]=d);let f;t[10]===s?f=t[11]:(f={label:`Walkthrough settings`,icon:x_,run:()=>void jB.open({payload:s}),destructive:!1},t[10]=s,t[11]=f);let p;t[12]===s?p=t[13]:(p={label:`Remove from Porcelain`,icon:lg,run:()=>void NB.open({payload:s}),destructive:!0},t[12]=s,t[13]=p);let m;t[14]!==l||t[15]!==u||t[16]!==d||t[17]!==f||t[18]!==p?(m=[...l,u,d,f,p],t[14]=l,t[15]=u,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h=m,g=`Project actions: ${i.name} · ${r}`,_;t[20]===g?_=t[21]:(_=(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":g})}),t[20]=g,t[21]=_);let v;t[22]===a?v=t[23]:(v=a??(0,Q.jsx)(Vh,{}),t[22]=a,t[23]=v);let y;t[24]!==v||t[25]!==_?(y=(0,Q.jsx)(Ze,{render:_,children:v}),t[24]=v,t[25]=_,t[26]=y):y=t[26];let b=a?`Project actions · ${r}`:`Project actions`,x;t[27]===b?x=t[28]:(x=(0,Q.jsx)(Yo,{children:b}),t[27]=b,t[28]=x);let S;t[29]!==y||t[30]!==x?(S=(0,Q.jsxs)(ot,{hoverable:!1,children:[y,x]}),t[29]=y,t[30]=x,t[31]=S):S=t[31];let C;t[32]===i?C=t[33]:(C=!i.available&&(0,Q.jsx)(bc,{children:c(i)}),t[32]=i,t[33]=C);let w;t[34]===h?w=t[35]:(w=h.map(iW),t[34]=h,t[35]=w);let T;t[36]!==C||t[37]!==w?(T=(0,Q.jsx)(Ne,{children:(0,Q.jsxs)(ct,{children:[C,w]})}),t[36]=C,t[37]=w,t[38]=T):T=t[38];let E;return t[39]!==S||t[40]!==T?(E=(0,Q.jsxs)(Wt,{children:[S,T]}),t[39]=S,t[40]=T,t[41]=E):E=t[41],E}function iW(e){let{label:t,icon:n,run:r,destructive:i}=e;return(0,Q.jsxs)(dn,{className:`cursor-pointer`,destructive:i,onSelect:r,children:[(0,Q.jsx)(n,{}),t]},t)}function aW(e){let t=(0,$.c)(2),{environmentName:n}=e,r=`${n} is reconnecting`,i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(Ao,{variant:`secondary`,role:`status`,title:r,children:`Reconnecting`}),t[0]=r,t[1]=i),i}function oW(e){let t=(0,$.c)(11),{projectName:n,environmentName:r,environmentIcon:i,showEnvironment:a,reconnecting:o}=e,s=r?`${n} · ${r}`:n,c;t[0]===n?c=t[1]:(c=(0,Q.jsx)(`div`,{className:`flex min-w-0 text-xs font-semibold`,children:(0,Q.jsx)(fr,{text:n})}),t[0]=n,t[1]=c);let l;t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a?(l=a&&r&&(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-2xs text-muted-foreground`,children:[(0,Q.jsxs)(`div`,{role:`img`,"aria-label":`Computer: ${r}`,className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(Et,{icon:i,className:`size-3 shrink-0`}),(0,Q.jsx)(fr,{text:r})]}),o&&(0,Q.jsx)(aW,{environmentName:r})]}),t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=l):l=t[6];let u;return t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 px-2 py-2`,"aria-label":s,children:[c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function sW(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`window-drag-region`}),e[0]=t):t=e[0],t}function cW(e){let t=(0,$.c)(4),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(sW,{}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:(0,Q.jsx)(fr,{className:`text-sm font-semibold tracking-tight`,text:`Porcelain`})}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Q.jsxs)(`header`,{className:`desktop-sidebar-header relative mt-0.5 flex h-10 shrink-0 items-center gap-2 px-2`,children:[r,i,n]}),t[2]=n,t[3]=a),a}function lW(e){let t=(0,$.c)(23),{remotes:n,onOpenProject:r}=e;if(!n?.length){let e;t[0]===r?e=t[1]:(e=(0,Q.jsx)(KH,{className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,"aria-label":`Open project`,onClick:()=>r(null)}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(d_,{className:`text-muted-foreground`}),t[2]=n):n=t[2];let i;t[3]===e?i=t[4]:(i=(0,Q.jsx)(Ze,{render:e,children:n}),t[3]=e,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open project`}),t[5]=a):a=t[5];let o;return t[6]===i?o=t[7]:(o=(0,Q.jsxs)(ot,{hoverable:!1,children:[i,a]}),t[6]=i,t[7]=o),o}let i;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(KH,{className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,"aria-label":`Open project`})}),children:(0,Q.jsx)(d_,{className:`text-muted-foreground`})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open project`})]}),t[8]=i):i=t[8];let a;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(bc,{children:`Open project on`}),t[9]=a):a=t[9];let o;t[10]===r?o=t[11]:(o=()=>r(null),t[10]=r,t[11]=o);let s;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(da,{}),t[12]=s):s=t[12];let c;t[13]===o?c=t[14]:(c=(0,Q.jsxs)(dn,{onSelect:o,children:[s,`This computer`]}),t[13]=o,t[14]=c);let l;if(t[15]!==r||t[16]!==n){let e;t[18]===r?e=t[19]:(e=e=>(0,Q.jsx)(uW,{entry:e,onOpen:()=>r(e)},e.remote.environmentId),t[18]=r,t[19]=e),l=n.map(e),t[15]=r,t[16]=n,t[17]=l}else l=t[17];let u;return t[20]!==c||t[21]!==l?(u=(0,Q.jsxs)(Wt,{children:[i,(0,Q.jsx)(Ne,{align:`end`,children:(0,Q.jsxs)(ct,{children:[a,c,l]})})]}),t[20]=c,t[21]=l,t[22]=u):u=t[22],u}function uW(e){let t=(0,$.c)(11),{entry:n,onOpen:r}=e,i=wo(n.remote),a=i.kind===`online`,o=!a,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Io,{}),t[0]=s):s=t[0];let c=a?i.name:n.remote.name,l;t[1]===c?l=t[2]:(l=(0,Q.jsx)(fr,{className:`min-w-0`,text:c}),t[1]=c,t[2]=l);let u;t[3]!==a||t[4]!==i?(u=!a&&(0,Q.jsx)(Ao,{variant:_c(i),className:`relative top-0 right-0 ml-auto w-6 cursor-pointer`,children:Cr(i)}),t[3]=a,t[4]=i,t[5]=u):u=t[5];let d;return t[6]!==r||t[7]!==o||t[8]!==l||t[9]!==u?(d=(0,Q.jsxs)(dn,{disabled:o,onSelect:r,children:[s,l,u]}),t[6]=r,t[7]=o,t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function dW(e){return e.main?jg:_g}function fW(e){let t=(0,$.c)(114),{remotes:n,selected:r,onSelect:i,onOpenPullRequest:a,onOpenProject:o,onOpenSettings:s,onManageComputers:l,showRemoteNotice:u,onOpenShortcuts:d}=e,{connection:f}=Di(),p;t[0]===f.environmentId?p=t[1]:(p=kB(f.environmentId),t[0]=f.environmentId,t[1]=p);let m=Ot(p),h=hH(),g=hH(),_=hH(),v=[f,...(n??[]).map(gW)],y=r?{kind:`worktree`,worktreeId:r.worktreeId,environmentId:r.remote??f.environmentId}:void 0,{groups:b,filters:x,loading:S,loadingWithoutSavedRows:C,neverRead:w}=Ot(ic({connections:v,snapshots:ba(n??[]),expandSingleCheckout:!0,groupRepositories:!0,compact:{selected:y}})),T=Ot(Fs),E=Da(Fs),{query:D,filter:O}=T;Lt(Tr(v));let A=Da(Ur(v)),j=$m(),M;t[2]===j.pathname?M=t[3]:(M={pathname:j.pathname,open:!1},t[2]=j.pathname,t[3]=M);let[N,P]=(0,Z.useState)(M),F=N.pathname===j.pathname&&N.open,I;t[4]===E?I=t[5]:(I=e=>E(t=>({...t,query:e})),t[4]=E,t[5]=I);let L=I,R=O.projects!==void 0||O.environments!==void 0,B=D.trim()||R?`No matching worktrees`:`No projects yet`,{setOpenMobile:V,isMobile:H}=BH(),U;t[6]!==r||t[7]!==u?(U=e=>u&&r?.remote===e.connection.environmentId&&r.projectId===e.project.id,t[6]=r,t[7]=u,t[8]=U):U=t[8];let W=U,G;t[9]===E?G=t[10]:(G=(e,t)=>E(n=>({...n,showingAll:{...n.showingAll,[e]:t}})),t[9]=E,t[10]=G);let K=G,q,J;if(t[11]!==b){let e=b.flatMap(hW).filter(mW);q=e[0]?.key,J=e.at(-1)?.key,t[11]=b,t[12]=q,t[13]=J}else q=t[12],J=t[13];let ee=J,ne;t[14]!==f.environmentId||t[15]!==i||t[16]!==V?(ne=e=>{e.worktreeId&&(i({remote:e.environmentId===f.environmentId?null:e.environmentId,projectId:e.projectId,worktreeId:e.worktreeId}),V(!1))},t[14]=f.environmentId,t[15]=i,t[16]=V,t[17]=ne):ne=t[17];let re=ne,ie=HH,ae;t[18]!==o||t[19]!==n?(ae=(0,Q.jsx)(cW,{children:(0,Q.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center`,children:(0,Q.jsx)(lW,{remotes:n,onOpenProject:o})})}),t[18]=o,t[19]=n,t[20]=ae):ae=t[20];let oe=H?``:void 0,se;t[21]===L?se=t[22]:(se=e=>L(e.target.value),t[21]=L,t[22]=se);let ue;t[23]!==g||t[24]!==q||t[25]!==_||t[26]!==ee||t[27]!==D.length||t[28]!==L?(ue=e=>{e.key===`Escape`&&D.length>0&&(e.stopPropagation(),L(``)),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),(e.key===`ArrowDown`||q===ee?g:_).element?.focus())},t[23]=g,t[24]=q,t[25]=_,t[26]=ee,t[27]=D.length,t[28]=L,t[29]=ue):ue=t[29];let de;t[30]!==H||t[31]!==D||t[32]!==oe||t[33]!==se||t[34]!==ue?(de=(0,Q.jsx)(CH,{autoFocus:H,"data-autofocus":oe,type:`search`,"aria-label":`Search worktrees`,placeholder:`Search`,value:D,onChange:se,onKeyDown:ue}),t[30]=H,t[31]=D,t[32]=oe,t[33]=se,t[34]=ue,t[35]=de):de=t[35];let fe;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{})}),t[36]=fe):fe=t[36];let pe;t[37]===de?pe=t[38]:(pe=(0,Q.jsxs)(_H,{className:`min-w-0 flex-1`,children:[de,fe]}),t[37]=de,t[38]=pe);let me;t[39]===j.pathname?me=t[40]:(me=e=>P({pathname:j.pathname,open:e}),t[39]=j.pathname,t[40]=me);let he;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(KH,{"aria-label":`Filter worktrees`,className:`relative top-0 right-0 w-6 cursor-pointer`})}),children:(0,Q.jsx)(Vg,{})}),(0,Q.jsx)(Yo,{children:`Filter worktrees`})]}),t[41]=he):he=t[41];let ge;if(t[42]!==x||t[43]!==E){let e;t[45]===E?e=t[46]:(e=e=>(0,Q.jsxs)(ct,{children:[(0,Q.jsx)(bc,{children:e.label}),e.items.map(t=>(0,Q.jsxs)(le,{value:t.id,className:`cursor-pointer`,checked:t.checked,closeOnSelect:!1,onCheckedChange:()=>E(n=>({...n,filter:{...n.filter,[e.key]:t.next}})),children:[t.icon&&(0,Q.jsx)(Et,{icon:t.icon}),(0,Q.jsx)(fr,{propagateEscape:!0,text:t.label,className:`min-w-0 flex-1`})]},t.id)),(0,Q.jsx)(we,{})]},e.key),t[45]=E,t[46]=e),ge=x.map(e),t[42]=x,t[43]=E,t[44]=ge}else ge=t[44];let _e;t[47]===E?_e=t[48]:(_e=(0,Q.jsx)(dn,{className:`cursor-pointer`,onSelect:()=>E(pW),children:`Clear filters`}),t[47]=E,t[48]=_e);let ve;t[49]!==ge||t[50]!==_e?(ve=(0,Q.jsx)(Ne,{align:`start`,className:`flex max-h-[min(24rem,var(--available-height))] w-80 max-w-[calc(100vw-2rem)] flex-col overflow-y-hidden`,children:(0,Q.jsxs)(`div`,{className:`-m-1 min-h-0 overflow-y-auto p-1`,children:[ge,_e]})}),t[49]=ge,t[50]=_e,t[51]=ve):ve=t[51];let ye;t[52]!==F||t[53]!==me||t[54]!==ve?(ye=(0,Q.jsxs)(Wt,{open:F,onOpenChange:me,children:[he,ve]}),t[52]=F,t[53]=me,t[54]=ve,t[55]=ye):ye=t[55];let be;t[56]!==pe||t[57]!==ye?(be=(0,Q.jsxs)(`div`,{className:`navigator-filters mb-2 flex items-center gap-1 px-2`,children:[pe,ye]}),t[56]=pe,t[57]=ye,t[58]=be):be=t[58];let xe=WH,Se=C?void 0:m,Ce=b.map(e=>{let{key:t,sources:n,members:r,rows:i,more:o,less:s}=e,l=r[0];if(!l)return null;let u=t!==l.key,d=!u&&l.singleCheckout,p=(0,Q.jsx)(rW,{project:l.project,environmentId:l.connection.environmentId===f.environmentId?null:l.connection.environmentId,environmentName:l.environmentName});return(0,Q.jsx)(GH,{"data-navigator-group":t,className:d?`py-0`:`mb-3`,children:(0,Q.jsxs)(zo,{open:l.expanded,onOpenChange:e=>E(n=>({...n,expanded:{...n.expanded,[t]:e}})),className:`group/project`,children:[!d&&(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(oW,{projectName:l.project.name,environmentName:u?void 0:l.environmentName,environmentIcon:l.environmentIcon,showEnvironment:!u&&v.length>1,reconnecting:!u&&W(l)}),u?r.map(e=>(0,Q.jsx)(rW,{project:e.project,environmentId:e.connection.environmentId===f.environmentId?null:e.connection.environmentId,environmentName:e.environmentName,icon:(0,Q.jsx)(Et,{icon:e.environmentIcon})},e.key)):p,(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(pa,{render:(0,Q.jsx)(KH,{className:`relative top-0 right-0 w-6 cursor-pointer`,"aria-label":`${l.expanded?`Collapse`:`Expand`} ${l.project.name}${u?``:` · ${l.environmentName}`}`})}),children:(0,Q.jsx)(sc,{className:`group-data-closed/project:-rotate-90`})}),(0,Q.jsx)(Yo,{children:l.expanded?`Collapse project`:`Expand project`})]})]}),n.map(e=>(0,Q.jsxs)(`div`,{children:[e.saved&&(0,Q.jsx)(`p`,{role:`status`,className:`px-2 py-2 text-xs text-muted-foreground`,children:u?`${e.environmentName} unavailable`:`Computer unavailable`}),!e.saved&&!e.project.available&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-2`,children:[(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:c(e.project)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[`Reconnect`,`Choose folder`].map(t=>(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:()=>void AB.open({payload:{remote:e.connection.environmentId===f.environmentId?null:e.connection.environmentId,project:e.project,...t===`Reconnect`&&Ia(e.project)?{path:Ia(e.project)}:{}}}),children:t},t))})]})]},e.key)),(0,Q.jsx)(co,{children:(0,Q.jsxs)(qH,{children:[i.map(e=>{let{source:t}=e,n=y!==void 0&&Ws(e,y),r=e.pullRequest.state===`available`?e.pullRequest:void 0,i=jn(e),o=te(e),s=dW(e),c=r?.checks?.state===`available`&&r.checks.result===`failed`,l=o?.kind===`pull-request`?` on #${o.number}`:``,m=c?`Checks failed${l}`:void 0,h=d?z(e):void 0,b=[d?e.projectName:void 0,d||u?e.environmentName:void 0,i,e.name===i?void 0:e.name,e.path,d&&e.changes.state===`available`&&e.changes.count>0?tc(e.changes):void 0,h?$a(h,Date.now()):void 0,m].filter(Boolean).join(` · `),x=e.key===ee?_.attach:void 0;e.key===q&&(x=g.attach);let S=`${k(e)}${m?`, ${m.toLowerCase()}`:``}${n?`, Current`:``}`;return(0,Q.jsxs)(JH,{className:d?`flex min-w-0 items-center`:void 0,children:[(0,Q.jsx)(fH,{onRetryChanges:()=>A({environmentId:e.environmentId}),entry:e,context:{connection:v.find(t=>t.environmentId===e.environmentId)??f,remoteStatus:t.connection.environmentId===f.environmentId?void 0:ns(t.connection.environmentId)},children:(0,Q.jsxs)(`div`,{"data-navigator-card":``,className:Y(`relative rounded-md`,n?`bg-selection`:`hover:bg-accent`,d&&`flex min-w-0 items-center`),children:[(0,Q.jsx)(fr,{text:b,disclose:`always`,renderTrigger:(r,a)=>(0,Q.jsxs)(kn,{className:Y(`w-full cursor-pointer text-left text-ui leading-4.5`,d?`min-w-0 flex-1 border-x-0 px-2 py-2`:`py-1.5`),"data-sidebar":`menu-button`,size:`xs`,"aria-label":S,"aria-current":n?`page`:void 0,onClick:()=>re(e),render:(0,Q.jsx)(`button`,{type:`button`,ref:x,disabled:!e.available}),children:[!d&&(0,Q.jsx)(ce,{className:`self-start`,children:(0,Q.jsx)(s,{className:`mt-0.5 size-3.5 text-muted-foreground`})}),(0,Q.jsxs)(Qs,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[a(d?e.projectName:i,Y(`min-w-0`,!d&&`flex-1`,n?`font-semibold`:`font-medium`),!d&&e.displayTitle===void 0?{keep:ri(i)}:`end`),d&&(0,Q.jsx)(Et,{icon:t.environmentIcon,className:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),W(t)&&(d||u&&n)&&(0,Q.jsx)(aW,{environmentName:t.environmentName}),c&&(0,Q.jsx)(Dh,{className:`size-3 shrink-0 text-del-fg`,"aria-hidden":`true`})]}),!d&&(0,Q.jsx)(vW,{entry:e,showEnvironment:u,pullRequest:o?.kind===`pull-request`?o:void 0})]})]})}),o?.kind===`pull-request`&&(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,className:Y(`shrink-0 cursor-pointer`,d?`mr-0.5`:`absolute right-0.5 bottom-1`),"aria-label":`Open PR #${o.number} · ${e.projectName} · ${e.environmentName} · ${xn(r?.checks)}${o.merged?` · Merged`:``}`,"data-merged":o.merged?``:void 0,onClick:()=>{a(e),V(!1)},children:(0,Q.jsx)(_W,{trailing:o})})]})}),d&&p]},e.key)}),(o>0||s)&&(0,Q.jsx)(JH,{children:(0,Q.jsx)(X,{variant:`ghost`,size:`xs`,className:`w-full cursor-pointer justify-start`,onClick:()=>K(t,o>0),children:(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:o>0?`Show ${o} more`:`Show less`})})}),i.length===0&&!S&&(0,Q.jsx)(`p`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:`No matching worktrees`})]})})]})},t)}),Te;t[59]!==b.length||t[60]!==S||t[61]!==w||t[62]!==A?(Te=!S&&b.length===0&&w&&(0,Q.jsxs)(YH,{children:[(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`Couldn’t reach Porcelain`})}),(0,Q.jsx)(QH,{children:(0,Q.jsx)(X,{variant:`outline`,onClick:()=>A(void 0),children:`Try again`})})]}),t[59]=b.length,t[60]=S,t[61]=w,t[62]=A,t[63]=Te):Te=t[63];let Ee;t[64]!==B||t[65]!==b.length||t[66]!==S||t[67]!==w?(Ee=!S&&b.length===0&&!w&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:B}),t[64]=B,t[65]=b.length,t[66]=S,t[67]=w,t[68]=Ee):Ee=t[68];let De;t[69]!==xe||t[70]!==Se||t[71]!==Ce||t[72]!==Te||t[73]!==Ee?(De=(0,Q.jsxs)(xe,{ref:Se,children:[Ce,Te,Ee]}),t[69]=xe,t[70]=Se,t[71]=Ce,t[72]=Te,t[73]=Ee,t[74]=De):De=t[74];let Oe;t[75]===h?Oe=t[76]:(Oe=e=>h.attach(e),t[75]=h,t[76]=Oe);let ke;t[77]!==s||t[78]!==Oe?(ke=(0,Q.jsx)(X,{ref:Oe,variant:`ghost`,className:`min-w-0 shrink`,"aria-label":`Settings`,onClick:s}),t[77]=s,t[78]=Oe,t[79]=ke):ke=t[79];let Ae,je;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(x_,{className:`text-muted-foreground`}),je=(0,Q.jsx)(fr,{text:`Settings`}),t[80]=Ae,t[81]=je):(Ae=t[80],je=t[81]);let Me;t[82]===ke?Me=t[83]:(Me=(0,Q.jsxs)(Ze,{render:ke,children:[Ae,je]}),t[82]=ke,t[83]=Me);let Pe;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Q.jsxs)(Yo,{role:`tooltip`,children:[`Settings `,(0,Q.jsx)(pH,{children:Ad(ou.openSettings)})]}),t[84]=Pe):Pe=t[84];let Fe;t[85]===Me?Fe=t[86]:(Fe=(0,Q.jsxs)(ot,{hoverable:!1,children:[Me,Pe]}),t[85]=Me,t[86]=Fe);let Ie;t[87]!==l||t[88]!==h?(Ie=(0,Q.jsx)(hs,{fallbackFocus:h,onManageComputers:l}),t[87]=l,t[88]=h,t[89]=Ie):Ie=t[89];let Le;t[90]===d?Le=t[91]:(Le=(0,Q.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`Keyboard shortcuts`,onClick:d}),t[90]=d,t[91]=Le);let Re;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Q.jsx)(Ng,{className:`text-muted-foreground`}),t[92]=Re):Re=t[92];let ze;t[93]===Le?ze=t[94]:(ze=(0,Q.jsx)(Ze,{render:Le,children:Re}),t[93]=Le,t[94]=ze);let Be;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Q.jsxs)(Yo,{role:`tooltip`,children:[`Keyboard shortcuts`,` `,(0,Q.jsx)(pH,{children:Ad(ou.openShortcuts)})]}),t[95]=Be):Be=t[95];let Ve;t[96]===ze?Ve=t[97]:(Ve=(0,Q.jsxs)(ot,{hoverable:!1,children:[ze,Be]}),t[96]=ze,t[97]=Ve);let He;t[98]!==Ie||t[99]!==Ve?(He=(0,Q.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[Ie,Ve]}),t[98]=Ie,t[99]=Ve,t[100]=He):He=t[100];let Ue;t[101]!==Fe||t[102]!==He?(Ue=(0,Q.jsxs)(`footer`,{role:`group`,"aria-label":`Navigator controls`,className:`navigator-footer flex shrink-0 items-center gap-1 p-2`,children:[Fe,He]}),t[101]=Fe,t[102]=He,t[103]=Ue):Ue=t[103];let We;t[104]!==ie||t[105]!==ae||t[106]!==be||t[107]!==De||t[108]!==Ue?(We=(0,Q.jsxs)(ie,{role:`navigation`,collapsible:`none`,className:`h-full w-full min-h-0 overflow-hidden`,"aria-label":`Projects and worktrees`,children:[ae,be,De,Ue]}),t[104]=ie,t[105]=ae,t[106]=be,t[107]=De,t[108]=Ue,t[109]=We):We=t[109];let Ge,Ke;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Q.jsx)(QU,{}),Ke=(0,Q.jsx)(GU,{}),t[110]=Ge,t[111]=Ke):(Ge=t[110],Ke=t[111]);let qe;return t[112]===We?qe=t[113]:(qe=(0,Q.jsxs)(`div`,{className:`review-navigator h-full min-h-0 overflow-hidden bg-frame text-ui [--sidebar:var(--frame)] [--sidebar-foreground:var(--foreground)] [--muted:var(--card)] [--secondary:var(--card)] [--sidebar-accent:var(--card)]`,children:[We,Ge,Ke]}),t[112]=We,t[113]=qe),qe}function pW(e){return{...e,filter:dc}}function mW(e){return e.available||e.pullRequest.state===`available`}function hW(e){let{rows:t}=e;return t}function gW(e){return e.connection}function _W(e){let t=(0,$.c)(5),{trailing:n}=e,r;t[0]===n.merged?r=t[1]:(r=n.merged&&(0,Q.jsx)(Cg,{"aria-hidden":`true`}),t[0]=n.merged,t[1]=r);let i;return t[2]!==r||t[3]!==n.text?(i=(0,Q.jsxs)(`span`,{className:`flex items-center gap-0.5 text-2xs text-muted-foreground tabular-nums`,children:[r,n.text]}),t[2]=r,t[3]=n.text,t[4]=i):i=t[4],i}function vW(e){let t=(0,$.c)(25),{entry:n,pullRequest:r,showEnvironment:i}=e,a=n.displayTitle===void 0?void 0:n.branch,o;t[0]===n.changes?o=t[1]:(o=tc(n.changes),t[0]=n.changes,t[1]=o);let s=o,c=s===`—`||s===``?void 0:s,l,u,d,f;if(t[2]!==a||t[3]!==c||t[4]!==n||t[5]!==i){let e=z(n);f=`flex h-4 min-w-0 items-center gap-2 text-2xs leading-4 text-muted-foreground`,l=`flex h-4 min-w-0 flex-1 flex-wrap justify-between gap-x-2 overflow-hidden`,t[10]!==a||t[11]!==c||t[12]!==n.environmentName||t[13]!==i?(u=(a||c||i)&&(0,Q.jsxs)(`span`,{className:`flex max-w-full min-w-0`,children:[i&&(0,Q.jsx)(fr,{className:`max-w-1/2 shrink-0`,text:n.environmentName}),a&&(0,Q.jsx)(fr,{className:i?`min-w-0`:`max-w-full shrink-0`,text:i?`\u00a0· ${a}`:a,cut:{keep:ri(a)}}),c&&(0,Q.jsx)(fr,{className:`min-w-0`,text:a||i?`\u00a0· ${c}`:c})]}),t[10]=a,t[11]=c,t[12]=n.environmentName,t[13]=i,t[14]=u):u=t[14],d=e&&(0,Q.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:$a(e,Date.now())}),t[2]=a,t[3]=c,t[4]=n,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f}else l=t[6],u=t[7],d=t[8],f=t[9];let p;t[15]!==l||t[16]!==u||t[17]!==d?(p=(0,Q.jsxs)(`div`,{className:l,children:[u,d]}),t[15]=l,t[16]=u,t[17]=d,t[18]=p):p=t[18];let m;t[19]===r?m=t[20]:(m=r!==void 0&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:Y(oe({variant:`ghost`,size:`xs`}),`invisible h-4 shrink-0`),children:(0,Q.jsx)(_W,{trailing:r})}),t[19]=r,t[20]=m);let h;return t[21]!==f||t[22]!==p||t[23]!==m?(h=(0,Q.jsxs)(`div`,{className:f,children:[p,m]}),t[21]=f,t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function yW(e,t){let n=(0,$.c)(6),[r,i]=ud(e),a;n[0]!==t||n[1]!==i?(a=e=>i(e).then(t,bW),n[0]=t,n[1]=i,n[2]=a):a=n[2];let o;return n[3]!==r||n[4]!==a?(o={result:r,submit:a},n[3]=r,n[4]=a,n[5]=o):o=n[5],o}function bW(){}function xW(e,t){let n=(0,$.c)(2),r;return n[0]===e?r=n[1]:(r=nn(e),n[0]=e,n[1]=r),yW(r,t)}function SW(e,t){let n=(0,$.c)(2),r;return n[0]===e?r=n[1]:(r=Pr(e),n[0]=e,n[1]=r),yW(r,t)}var CW=en;function wW(e){let t=(0,$.c)(4),{remote:n,connection:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=n===null?i({connection:r,unavailable:void 0}):(0,Q.jsx)(TW,{environmentId:n,children:i}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function TW(e){let t=(0,$.c)(3),{environmentId:n,children:r}=e,i=Fo(n),a;return t[0]!==r||t[1]!==i?(a=i&&(0,Q.jsx)(EW,{entry:i,children:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function EW(e){let t=(0,$.c)(6),{entry:n,children:r}=e,i=wo(n.remote),a;t[0]===i?a=t[1]:(a=i.kind===`online`?void 0:`${Cr(i)}. ${Ue(i)??`Wait for this computer to answer before changing its projects.`}`,t[0]=i,t[1]=a);let o;return t[2]!==r||t[3]!==n.connection||t[4]!==a?(o=r({connection:n.connection,unavailable:a}),t[2]=r,t[3]=n.connection,t[4]=a,t[5]=o):o=t[5],o}function DW(e){let t=(0,$.c)(5),{unavailable:n,result:r}=e,i;t[0]!==r||t[1]!==n?(i=n??(Mi(r)?ue(Ra(r.cause)):void 0),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=a&&(0,Q.jsx)(Ga,{variant:`destructive`,children:(0,Q.jsx)(h,{children:a})}),t[3]=a,t[4]=o),o}function OW(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(Ez,{controller:NB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsx)(Oz,{children:(0,Q.jsx)(kW,{project:e.project,...t},e.project.id)})})}),t[0]=n,t[1]=r),r}function kW(e){let t=(0,$.c)(29),{project:n,connection:r,unavailable:i}=e,a=SW(r,AW),{result:o}=a,s;t[0]===n.name?s=t[1]:(s=(0,Q.jsxs)(jz,{className:`break-all`,children:[`Remove `,n.name,` from Porcelain?`]}),t[0]=n.name,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(Mz,{children:`Removes this project and its reviews and comments from Porcelain; files and Git history stay on disk.`}),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=(0,Q.jsxs)(kz,{children:[s,c]}),t[3]=s,t[4]=l);let u;t[5]===n?u=t[6]:(u=Ia(n),t[5]=n,t[6]=u);let d;t[7]===u?d=t[8]:(d=(0,Q.jsx)(`p`,{className:`break-all font-mono text-xs text-muted-foreground`,children:u}),t[7]=u,t[8]=d);let f;t[9]!==o||t[10]!==i?(f=(0,Q.jsx)(DW,{unavailable:i,result:o}),t[9]=o,t[10]=i,t[11]=f):f=t[11];let p;t[12]===o.waiting?p=t[13]:(p=(0,Q.jsx)(Nz,{disabled:o.waiting,children:`Cancel`}),t[12]=o.waiting,t[13]=p);let m=o.waiting||i!==void 0,h;t[14]!==n.id||t[15]!==a?(h=()=>void a.submit(n.id),t[14]=n.id,t[15]=a,t[16]=h):h=t[16];let g;t[17]!==o.waiting||t[18]!==m||t[19]!==h?(g=(0,Q.jsx)(ji,{"data-slot":`alert-dialog-action`,pending:o.waiting,variant:`destructive`,disabled:m,onClick:h,children:`Remove from Porcelain`}),t[17]=o.waiting,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]!==g||t[22]!==p?(_=(0,Q.jsxs)(Az,{children:[p,g]}),t[21]=g,t[22]=p,t[23]=_):_=t[23];let v;return t[24]!==_||t[25]!==l||t[26]!==d||t[27]!==f?(v=(0,Q.jsxs)(Q.Fragment,{children:[l,d,f,_]}),t[24]=_,t[25]=l,t[26]=d,t[27]=f,t[28]=v):v=t[28],v}function AW(){return NB.close()}function jW(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(vz,{controller:MB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsx)(xz,{children:(0,Q.jsx)(MW,{project:e.project,...t},e.project.id)})})}),t[0]=n,t[1]=r),r}function MW(e){let t=(0,$.c)(40),{project:n,connection:r,unavailable:i}=e,a=xW(r,IW),{result:o}=a,s;t[0]===n.name?s=t[1]:(s={name:n.name},t[0]=n.name,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={onChange:CW},t[2]=c):c=t[2];let l;t[3]!==n.id||t[4]!==a?(l=e=>{let{value:t}=e;return a.submit({projectId:n.id,name:t.name})},t[3]=n.id,t[4]=a,t[5]=l):l=t[5];let u;t[6]!==s||t[7]!==l?(u={defaultValues:s,validators:c,onSubmit:l},t[6]=s,t[7]=l,t[8]=u):u=t[8];let d=Zd(u),f;t[9]===d?f=t[10]:(f=e=>wa(e,()=>d.handleSubmit()),t[9]=d,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(wz,{children:`Rename project`}),(0,Q.jsx)(Tz,{children:`The name is only a label in this sidebar. Nothing on disk changes, and two projects may share one.`})]}),t[11]=p):p=t[11];let m;t[12]===d.Field?m=t[13]:(m=(0,Q.jsx)(d.Field,{name:`name`,children:FW}),t[12]=d.Field,t[13]=m);let h;t[14]===n?h=t[15]:(h=Ia(n),t[14]=n,t[15]=h);let g;t[16]===h?g=t[17]:(g=(0,Q.jsx)(`p`,{className:`break-all font-mono text-xs text-muted-foreground`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==o||t[19]!==i?(_=(0,Q.jsx)(DW,{unavailable:i,result:o}),t[18]=o,t[19]=i,t[20]=_):_=t[20];let v;t[21]!==_||t[22]!==m||t[23]!==g?(v=(0,Q.jsxs)(`div`,{className:`grid gap-2 py-4`,children:[m,g,_]}),t[21]=_,t[22]=m,t[23]=g,t[24]=v):v=t[24];let y;t[25]===o.waiting?y=t[26]:(y=(0,Q.jsx)(X,{type:`button`,variant:`outline`,disabled:o.waiting,onClick:PW,children:`Cancel`}),t[25]=o.waiting,t[26]=y);let b;t[27]!==o.waiting||t[28]!==i?(b=e=>(0,Q.jsx)(ji,{pending:o.waiting,type:`submit`,disabled:!e||o.waiting||i!==void 0,children:`Rename`}),t[27]=o.waiting,t[28]=i,t[29]=b):b=t[29];let x;t[30]!==d.Subscribe||t[31]!==b?(x=(0,Q.jsx)(d.Subscribe,{selector:NW,children:b}),t[30]=d.Subscribe,t[31]=b,t[32]=x):x=t[32];let S;t[33]!==y||t[34]!==x?(S=(0,Q.jsxs)(Cz,{children:[y,x]}),t[33]=y,t[34]=x,t[35]=S):S=t[35];let C;return t[36]!==v||t[37]!==S||t[38]!==f?(C=(0,Q.jsxs)(`form`,{onSubmit:f,children:[p,v,S]}),t[36]=v,t[37]=S,t[38]=f,t[39]=C):C=t[39],C}function NW(e){return e.canSubmit}function PW(){return MB.close()}function FW(e){return(0,Q.jsxs)(Oo,{"data-invalid":e.state.meta.isTouched&&!e.state.meta.isValid,children:[(0,Q.jsx)(Ms,{htmlFor:`project-name`,children:`Name`}),(0,Q.jsx)(ei,{id:`project-name`,name:e.name,value:e.state.value,autoFocus:!0,"data-autofocus":``,"aria-invalid":e.state.meta.isTouched&&!e.state.meta.isValid,"aria-describedby":e.state.meta.isTouched&&!e.state.meta.isValid?`project-name-error`:void 0,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value)}),e.state.meta.isTouched&&!e.state.meta.isValid&&(0,Q.jsx)(bi,{id:`project-name-error`,errors:e.state.value.trim()===``?[{message:`Enter a project name.`}]:e.state.meta.errors})]})}function IW(){return MB.close()}function LW(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function RW(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function zW(e){return e/100*window.innerHeight}function BW(e){return e/100*window.innerWidth}function VW(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function HW({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=VW(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=RW(t,i);break;case`em`:r=LW(t,i);break;case`vh`:r=zW(i);break;case`vw`:r=BW(i)}return r}function UW(e){return parseFloat(e.toFixed(3))}function WW({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function GW(e){let{panels:t}=e,n=WW({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=UW(HW({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=UW(HW({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=UW(HW({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=UW(HW({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function KW(e,t=`Assertion error`){if(!e)throw Error(t)}function qW(e,t){return Array.from(t).sort(e===`horizontal`?JW:YW)}function JW(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function YW(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function XW(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ZW(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function QW({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ZW(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return KW(i,`No rect found`),i}var $W;function eG(){return $W===void 0&&($W=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),$W}function tG(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=qW(n,Array.from(t.children).filter(XW).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,QW({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=eG()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:WW({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var nG=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},rG={cursorFlags:0,state:`inactive`},iG=new nG;function aG(){return rG}function oG(e){return iG.addListener(`change`,e)}function sG(e){let t=rG,n={...rG};n.cursorFlags=e,rG=n,iG.emit(`change`,{prev:t,next:n})}function cG(e){let t=rG;rG=e,iG.emit(`change`,{prev:t,next:e})}var lG=e=>e,uG=()=>{},dG=1,fG=2,pG=4,mG=8,hG=3,gG=12,_G;function vG(){return _G===void 0&&(_G=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(_G=!0)),_G}function yG({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&vG()){let t=(e&dG)!==0,n=(e&fG)!==0,r=(e&pG)!==0,i=(e&mG)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return vG()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var bG=new WeakMap;function xG(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=bG.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=aG();switch(r.state){case`active`:case`hover`:{let e=yG({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}bG.set(e,{prevStyle:t,styleSheet:n})}var SG=new Map,CG=new nG;function wG(e){SG=new Map(SG),SG.delete(e)}function TG(e,t){for(let[t]of SG)if(t.id===e)return t}function EG(e,t){for(let[t,n]of SG)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function DG(){return SG}function OG(e,t){return CG.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function kG(e,t,n){let r=SG.get(e);SG=new Map(SG),SG.set(e,t),CG.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function AG(e){let t=aG(),n=DG(),r=!1;return t.state===`active`&&(cG({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(xG(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=EG(e.group.id,!0);kG(e.group,t,{isUserInteraction:!0})}))),r}function jG(e){e.defaultPrevented||AG(e.currentTarget)}function MG(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ZW(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function NG(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function PG(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:BG(e),b:BG(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();KW(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:zG(RG(n.a)),b:zG(RG(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var FG=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function IG(e){let t=getComputedStyle(VG(e)??e).display;return t===`flex`||t===`inline-flex`}function LG(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||IG(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||FG.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function RG(e){let t=e.length;for(;t--;){let n=e[t];if(KW(n,`Missing node`),LG(n))return n}return null}function zG(e){return e&&Number(getComputedStyle(e).zIndex)||0}function BG(e){let t=[];for(;e;)t.push(e),e=VG(e);return t}function VG(e){let{parentNode:t}=e;return NG(t)?t.host:t}function HG(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function UG({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!XW(n)||n.contains(e)||e.contains(n))return!0;if(PG(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(HG(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function WG(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=tG(r),a=MG(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&UG({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function GG(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KG(e,t,n=0){return Math.abs(UW(e)-UW(t))<=n}function qG(e,t){return KG(e,t)?0:e>t?1:-1}function JG({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(qG(r,c)<0){if(a){let e=(i+c)/2;r=qG(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=UW(r),r}function YG({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(KG(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;KW(u!=null,`Invalid first pivot index`),KW(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];KW(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(KW(n!=null,`Previous layout not found for panel index ${t}`),KG(n,i)){let t=o-n;qG(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];KW(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(KW(n!=null,`Previous layout not found for panel index ${t}`),KG(n,o)){let t=n-i;qG(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];KW(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&qG(i,c)<0){if(e>0){let t=c-o,n=t/2;qG(i+e,c)<0&&(e=qG(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;qG(i-e,c)<0&&(e=qG(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];KW(e!=null,`Previous layout not found for panel index ${r}`);let a=JG({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];KW(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=JG({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!KG(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(GG(c,l))return i;{let t=e<0?d:u,r=s[t];KW(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=JG({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!KG(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];KW(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=JG({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(KG(i,s)||(t-=s-i,l[r]=s),KG(t,0))break;e>0?r--:r++}}}if(!KG(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function XG(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||qG(e[n],t[n])!==0)return!1;return!0}function ZG({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!KG(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];KW(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];KW(i!=null,`No layout data found for index ${e}`);let o=r[e];KW(o!=null,`No layout data found for index ${e}`);let s=JG({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!KG(a,0))for(let e=0;e<t.length;e++){let n=r[e];KW(n!=null,`No layout data found for index ${e}`);let i=n+a,o=JG({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,KG(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function QG({groupId:e,panelId:t}){let n=()=>{let t=DG();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&KG(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:UW(100-e)}}return YG({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=ZG({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});XG(c,u)||kG(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&KG(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=WW({group:t}),o=UW(HW({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function $G(e){e.defaultPrevented||WG(e,DG()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=QG({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function eK(e){let t=DG();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function tK({groupId:e}){let t=()=>{let t=DG();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=ZG({layout:e,panelConstraints:r});return n?o:(XG(o,c)||kG(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function nK(e,t){let n=eK(e),r=EG(n.id,!0),i=n.separators.find(t=>t.element===e);KW(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);KW(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=tK({groupId:n.id}).getLayout(),c=ZG({layout:YG({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});XG(s,c)||kG(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function rK(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=eK(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&nK(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&nK(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&nK(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&nK(t,-5);break;case`End`:e.preventDefault(),nK(t,100);break;case`Enter`:{e.preventDefault();let n=eK(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=EG(n.id,!0),o=n.separators.find(e=>e.element===t);KW(o,`Matching separator not found`);let s=a.get(o);KW(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(KW(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];nK(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=eK(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);KW(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),nK(t,-100)}}function iK(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=DG(),n=WG(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),cG({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function aK({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=YG({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(XG(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?dG:fG;break;case`vertical`:s|=d<0?pG:mG}}else kG(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&hG:c|=s&hG,t.movementY===0?c|=o&gG:c|=s&gG,sG(c),xG(e)}function oK(e){let t=DG(),n=aG();n.state===`active`&&aK({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function sK(e){if(e.defaultPrevented)return;let t=aG(),n=DG();switch(t.state){case`active`:if(e.buttons===0){cG({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=EG(e.group.id,!0);kG(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.isConnected&&!t.hasPointerCapture?.(e.pointerId)&&t.setPointerCapture?.(e.pointerId)}aK({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=WG(e,n);r.length===0?t.state!==`inactive`&&cG({cursorFlags:0,state:`inactive`}):cG({cursorFlags:0,hitRegions:r,state:`hover`}),xG(e.currentTarget);break}}}function cK(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(aG().state){case`hover`:cG({cursorFlags:0,state:`inactive`})}}function lK(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||AG(e.currentTarget)&&e.preventDefault()}function uK(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=UW(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=UW((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function dK(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=WW({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:UW(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function fK(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function pK(e,t){return e.length===t.length&&e.every((e,n)=>fK(e,t[n]))}function mK({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=UW(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=UW((r[e]??0)/a*l);else{let e=UW(l/c.length);for(let t of c)u[t]=e}return u}function hK(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var gK=new Map;function _K(e){let t=!0;KW(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=WW({group:e});if(t===0)return;let n=EG(e.id);if(!n)return;let r=GW(e),i=n.defaultLayoutDeferred?uK(r):n.layout,a=ZG({layout:mK({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&XG(n.layout,a)&&pK(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;kG(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else dK(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{KW(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=WW({group:e}),s=GW(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(hK(e.panels,l)||(l=void 0));let u=ZG({layout:e.mutableState.layouts[c]??l??uK(s),panelConstraints:s}),d=e.element.ownerDocument;gK.set(d,(gK.get(d)??0)+1);let f=new Map;return tG(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),kG(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{KW(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,rK)}),gK.get(d)===1&&(d.addEventListener(`contextmenu`,jG,!0),d.addEventListener(`dblclick`,$G,!0),d.addEventListener(`pointerdown`,iK,!0),d.addEventListener(`pointerleave`,oK),d.addEventListener(`pointermove`,sK),d.addEventListener(`pointerout`,cK),d.addEventListener(`pointerup`,lK,!0)),function(){t=!1,gK.set(d,Math.max(0,(gK.get(d)??0)-1)),wG(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,rK)}),gK.get(d)||(d.removeEventListener(`contextmenu`,jG,!0),d.removeEventListener(`dblclick`,$G,!0),d.removeEventListener(`pointerdown`,iK,!0),d.removeEventListener(`pointerleave`,oK),d.removeEventListener(`pointermove`,sK),d.removeEventListener(`pointerout`,cK),d.removeEventListener(`pointerup`,lK,!0)),a.disconnect()}}function vK(){let[e,t]=(0,Z.useState)({});return[e,(0,Z.useCallback)(()=>t({}),[])]}function yK(e){let t=(0,Z.useId)();return`${e??t}`}var bK=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function xK(e){let t=(0,Z.useRef)(e);return bK(()=>{t.current=e},[e]),(0,Z.useCallback)((...e)=>t.current?.(...e),[t])}function SK(...e){return xK(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function CK(e){let t=(0,Z.useRef)({...e});return bK(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var wK=(0,Z.createContext)(null);function TK(e,t){let n=(0,Z.useRef)({getLayout:()=>({}),setLayout:lG});(0,Z.useImperativeHandle)(t,()=>n.current,[]),bK(()=>{Object.assign(n.current,tK({groupId:e}))})}function EK({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Z.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=xK(e=>{XG(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=xK((e,t)=>{XG(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=yK(s),v=(0,Z.useRef)(null),[y,b]=vK(),x=(0,Z.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=SK(v,a);TK(_,o);let C=xK((e,t)=>{let r=aG(),i=TG(e),a=EG(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=CK({defaultLayout:n,disableCursor:r}),T=(0,Z.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=qW(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=qW(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=TG(_),i=EG(_);r&&i&&kG(r,{...i,derivedPanelConstraints:GW(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Z.useRef)(null);return bK(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=_K(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=EG(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=OG(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=KG(t.collapsedSize,i[t.panelId]),a=KG(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=aG().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Z.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Q.jsx)(wK.Provider,{value:T,children:(0,Q.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}EK.displayName=`Group`;function DK(){let e=(0,Z.useContext)(wK);return KW(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function OK(e,t){let{id:n}=DK(),r=(0,Z.useRef)({collapse:uG,expand:uG,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:uG});(0,Z.useImperativeHandle)(t,()=>r.current,[]),bK(()=>{Object.assign(r.current,QG({groupId:n,panelId:e}))})}function kK({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=yK(c),_=CK({disabled:a}),v=(0,Z.useRef)(null),y=SK(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=DK(),T=d!==null,E=xK((e,t,n)=>{d?.(e,c,n)});bK(()=>{let e=v.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return C(t)}},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Z.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),OK(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Z.useSyncExternalStore)(e=>OG(x,e),D,D),k;return k=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,Q.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...AK,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Q.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}kK.displayName=`Panel`;var AK={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function jK({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=ZG({layout:YG({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=ZG({layout:YG({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function MK({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=yK(a),l=CK({disabled:n,disableDoubleClick:r}),[u,d]=(0,Z.useState)({}),[f,p]=(0,Z.useState)(`inactive`),[m,h]=(0,Z.useState)(!1),g=(0,Z.useRef)(null),_=SK(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=DK(),C=b===`horizontal`?`vertical`:`horizontal`;bK(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=oG(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=OG(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=n.findIndex(t=>t.panelId===e.id);d(jK({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,Z.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,Q.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}MK.displayName=`Separator`;function NK({className:e,...t}){return(0,Q.jsx)(EK,{"data-slot":`resizable-panel-group`,className:Y(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function PK({...e}){return(0,Q.jsx)(kK,{"data-slot":`resizable-panel`,...e})}function FK({withHandle:e,className:t,...n}){return(0,Q.jsx)(MK,{"data-slot":`resizable-handle`,className:Y(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:after:bg-ring aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,Q.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`})})}function IK(e){let t=(0,$.c)(4),{open:n,onOpenChange:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=(0,Q.jsx)(VH,{open:n,onOpenChange:r,children:i}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function LK(e){let t=(0,$.c)(26),{navigator:n,isMobile:r,open:i,children:a}=e,[o,s]=(0,Z.useState)(248),[c,l]=(0,Z.useState)(null),u=hH(),d=(r||!i)&&`desktop-workspace-without-navigator`,f;t[0]===d?f=t[1]:(f=Y(`h-svh min-w-0 flex-1 bg-frame p-2 text-ui text-foreground max-md:p-0`,d),t[0]=d,t[1]=f);let p;t[2]!==u.element||t[3]!==r||t[4]!==c||t[5]!==o||t[6]!==i?(p=(e,t)=>{let{isUserInteraction:n}=t;if(c&&u.element&&!r&&i){if(n){let t=Array.from(u.element.children).reduce(RK,0);s(t*(e.navigator??0)/100)}else c.resize(o)}},t[2]=u.element,t[3]=r,t[4]=c,t[5]=o,t[6]=i,t[7]=p):p=t[7];let m;t[8]!==r||t[9]!==n||t[10]!==o||t[11]!==i?(m=!r&&i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(PK,{id:`navigator`,panelRef:l,groupResizeBehavior:`preserve-pixel-size`,defaultSize:o,minSize:220,maxSize:420,children:(0,Q.jsx)(fW,{...n})}),(0,Q.jsx)(FK,{"aria-label":`Worktree navigator and document panes`,className:`w-2 bg-transparent after:w-2`})]}),t[8]=r,t[9]=n,t[10]=o,t[11]=i,t[12]=m):m=t[12];let h=r?0:420,g;t[13]===a?g=t[14]:(g=(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:a}),t[13]=a,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsx)(PK,{id:`document`,minSize:h,children:g}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==u.attach||t[19]!==p||t[20]!==m||t[21]!==_?(v=(0,Q.jsxs)(NK,{orientation:`horizontal`,elementRef:u.attach,onLayoutChanged:p,children:[m,_]}),t[18]=u.attach,t[19]=p,t[20]=m,t[21]=_,t[22]=v):v=t[22];let y;return t[23]!==f||t[24]!==v?(y=(0,Q.jsx)(`div`,{className:f,children:v}),t[23]=f,t[24]=v,t[25]=y):y=t[25],y}function RK(e,t){return t instanceof HTMLElement&&t.hasAttribute(`data-panel`)?e+t.offsetWidth:e}function zK(e,t,n,r,i){let a=(0,$.c)(17),o;a[0]!==e||a[1]!==n||a[2]!==t?(o=_n({connection:e,projectId:t,number:n}),a[0]=e,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promise`},a[4]=s):s=a[4];let[c,l]=B(o,s),u;a[5]===e?u=a[6]:(u=hr(e),a[5]=e,a[6]=u);let d;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(d={mode:`promise`},a[7]=d):d=a[7];let[,f]=B(u,d),p=Pc(),m;a[8]!==i||a[9]!==p||a[10]!==r||a[11]!==f||a[12]!==l?(m=async e=>{e.confirmation&&i&&i();let t;try{t=await l(e),t.archived&&(await f(),await p({to:`/`,replace:!0}))}catch{return}return t.archived&&r&&r(),t},a[8]=i,a[9]=p,a[10]=r,a[11]=f,a[12]=l,a[13]=m):m=a[13];let h;return a[14]!==c||a[15]!==m?(h={result:c,submit:m},a[14]=c,a[15]=m,a[16]=h):h=a[16],h}function BK(e){let t=(0,$.c)(24),{context:n,projectId:r,number:i,beforeLeave:a}=e,o=a===void 0?VK:a,{connection:s}=n,c=na(n),l=Yu(s),u;t[0]===l?u=t[1]:(u=Cd(l),t[0]=l,t[1]=u);let d=u,f;t[2]!==l||t[3]!==c?(f=c??(l.kind===`reading`?void 0:rd(l)),t[2]=l,t[3]=c,t[4]=f):f=t[4];let p=f,{submit:m}=zK(s,r,i),h;t[5]!==o||t[6]!==n||t[7]!==i||t[8]!==r||t[9]!==d||t[10]!==m||t[11]!==c?(h=()=>{if(!d||c)return;let e=Yl(d);PB.open({payload:{context:n,projectId:r,number:i,options:e,requestId:crypto.randomUUID(),beforeLeave:o}}),m({options:e})},t[5]=o,t[6]=n,t[7]=i,t[8]=r,t[9]=d,t[10]=m,t[11]=c,t[12]=h):h=t[12];let g=h,_=!d||!!c,v;t[13]!==g||t[14]!==_||t[15]!==c?(v=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,disabled:_,"aria-description":c,focusableWhenDisabled:!0,onClick:g,children:`Archive`}),t[13]=g,t[14]=_,t[15]=c,t[16]=v):v=t[16];let y=v;if(d&&!c||!p)return y;let b;t[17]===y?b=t[18]:(b=(0,Q.jsx)(Ze,{render:y}),t[17]=y,t[18]=b);let x;t[19]===p?x=t[20]:(x=(0,Q.jsx)(Yo,{children:p}),t[19]=p,t[20]=x);let S;return t[21]!==b||t[22]!==x?(S=(0,Q.jsxs)(ot,{children:[b,x]}),t[21]=b,t[22]=x,t[23]=S):S=t[23],S}function VK(){}function HK(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:PB,children:UK}),e[0]=t):t=e[0],t}function UK(e){return e&&(0,Q.jsx)(WK,{...e},e.requestId)}function WK(e){let t=(0,$.c)(34),{context:n,projectId:r,number:i,options:a,beforeLeave:o}=e,s=na(n),{result:c,submit:l}=zK(n.connection,r,i,GK,o),[u,d]=(0,Z.useState)(!1),f;t[0]===c?f=t[1]:(f=Bo(c)?c.value:void 0,t[0]=c,t[1]=f);let p=f?.plan,[m,h]=(0,Z.useState)(!1),g=c.waiting&&m,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Be,{label:`Checking the worktree and branches`}),t[2]=_):_=t[2];let v=_;if(Mi(c)&&(v=`Archiving could not be completed.`),p){let e;t[3]===p?e=t[4]:(e=$l(p),t[3]=p,t[4]=e),v=e}let y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(jz,{children:`Archive pull request?`}),t[5]=y):y=t[5];let b;t[6]===v?b=t[7]:(b=(0,Q.jsxs)(kz,{children:[y,(0,Q.jsx)(Mz,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:v})]}),t[6]=v,t[7]=b);let x;t[8]===c?x=t[9]:(x=Mi(c)?(0,Q.jsx)(`p`,{role:`alert`,className:`text-ui text-destructive`,children:ul(Ra(c.cause))}):null,t[8]=c,t[9]=x);let S;t[10]!==u||t[11]!==p?(S=p&&(p.dirty||p.unpushed)?(0,Q.jsxs)(Oo,{orientation:`horizontal`,children:[(0,Q.jsx)(bn,{checked:u,onCheckedChange:d,id:`archive-discard-changes`}),(0,Q.jsx)(Qa,{htmlFor:`archive-discard-changes`,children:`I understand the risk of losing changes and commits`})]}):null,t[10]=u,t[11]=p,t[12]=S):S=t[12];let C;t[13]===g?C=t[14]:(C=(0,Q.jsx)(Nz,{disabled:g,children:`Cancel`}),t[13]=g,t[14]=C);let w=!!s||c.waiting||!p||(p.dirty||p.unpushed)&&!u,T;t[15]!==u||t[16]!==a||t[17]!==p||t[18]!==l||t[19]!==s?(T=()=>{p&&!s&&(h(!0),l({options:a,confirmation:{plan:p,discardChanges:u}}))},t[15]=u,t[16]=a,t[17]=p,t[18]=l,t[19]=s,t[20]=T):T=t[20];let E;t[21]!==g||t[22]!==w||t[23]!==T||t[24]!==s?(E=(0,Q.jsx)(ji,{pending:g,variant:`destructive`,disabled:w,"aria-description":s,onClick:T,children:`Archive pull request`}),t[21]=g,t[22]=w,t[23]=T,t[24]=s,t[25]=E):E=t[25];let D;t[26]!==E||t[27]!==C?(D=(0,Q.jsxs)(Az,{children:[C,E]}),t[26]=E,t[27]=C,t[28]=D):D=t[28];let O;return t[29]!==D||t[30]!==b||t[31]!==x||t[32]!==S?(O=(0,Q.jsxs)(Oz,{children:[b,x,S,D]}),t[29]=D,t[30]=b,t[31]=x,t[32]=S,t[33]=O):O=t[33],O}function GK(){return PB.close()}function KK(e,t,n,r){let i=(0,$.c)(12),a;i[0]!==e||i[1]!==n||i[2]!==t?(a=w({connection:e,projectId:t,number:n}),i[0]=e,i[1]=n,i[2]=t,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=B(a,o),l;i[5]!==n||i[6]!==r||i[7]!==c?(l=async e=>{let t=await c(e);ne(t)&&(r(),ks({title:`Merged #${n}`,type:`success`}))},i[5]=n,i[6]=r,i[7]=c,i[8]=l):l=i[8];let u;return i[9]!==s||i[10]!==l?(u={result:s,submit:l},i[9]=s,i[10]=l,i[11]=u):u=i[11],u}function qK(e){let t=(0,$.c)(27),{context:n,projectId:r,pull:i,review:a,label:o,showBlock:s,reason:c,className:l}=e,u=o===void 0?`Merge`:o,d=s===void 0||s,f=(0,Z.useId)(),p=na(n),m;t[0]!==i||t[1]!==c||t[2]!==a||t[3]!==p?(m=p??gu(sd(i,a),c),t[0]=i,t[1]=c,t[2]=a,t[3]=p,t[4]=m):m=t[4];let h=m,g;t[5]===l?g=t[6]:(g=Y(`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5`,l),t[5]=l,t[6]=g);let _=h!==void 0,v=h?f:void 0,y;t[7]!==n||t[8]!==r||t[9]!==i?(y=()=>void FB.open({payload:{context:n,projectId:r,number:i.number,headSha:i.headSha,headBranch:i.headBranch,baseBranch:i.baseBranch,methods:zc(i).map(JK),requestId:li()}}),t[7]=n,t[8]=r,t[9]=i,t[10]=y):y=t[10];let b;t[11]===h?b=t[12]:(b=h!==void 0&&(0,Q.jsx)(qg,{"aria-hidden":!0}),t[11]=h,t[12]=b);let x;t[13]!==u||t[14]!==_||t[15]!==v||t[16]!==y||t[17]!==b?(x=(0,Q.jsxs)(X,{size:`sm`,disabled:_,focusableWhenDisabled:!0,"aria-describedby":v,onClick:y,children:[b,u]}),t[13]=u,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x):x=t[18];let S;t[19]!==h||t[20]!==f||t[21]!==d?(S=h&&(0,Q.jsx)(`p`,{id:f,className:Y(`min-w-0 text-ui leading-4.5 text-muted-foreground`,!d&&`sr-only`),children:h}),t[19]=h,t[20]=f,t[21]=d,t[22]=S):S=t[22];let C;return t[23]!==S||t[24]!==g||t[25]!==x?(C=(0,Q.jsxs)(`div`,{className:g,children:[x,S]}),t[23]=S,t[24]=g,t[25]=x,t[26]=C):C=t[26],C}function JK(e){let{method:t}=e;return t}function YK(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Ez,{controller:FB,children:XK}),e[0]=t):t=e[0],t}function XK(e){return e&&(0,Q.jsx)(ZK,{...e},e.requestId)}function ZK(e){let t=(0,$.c)(37),{context:n,projectId:r,number:i,headSha:a,headBranch:o,baseBranch:s,methods:c}=e,l=na(n),u=zc({mergeMethods:c}),[d,f]=(0,Z.useState)(u[0]?.method),{result:p,submit:m}=KK(n.connection,r,i,$K),h;t[0]===d?h=t[1]:(h=e=>e.method===d,t[0]=d,t[1]=h);let g=u.find(h),_=Oz,v;t[2]===i?v=t[3]:(v=(0,Q.jsxs)(jz,{children:[`Merge pull request #`,i,`?`]}),t[2]=i,t[3]=v);let y;t[4]===a?y=t[5]:(y=By(a),t[4]=a,t[5]=y);let b;t[6]!==s||t[7]!==o||t[8]!==y?(b=(0,Q.jsxs)(Mz,{className:`[overflow-wrap:anywhere]`,children:[o,` at `,y,` goes into `,s,` on GitHub. A merge cannot be undone.`]}),t[6]=s,t[7]=o,t[8]=y,t[9]=b):b=t[9];let x;t[10]!==v||t[11]!==b?(x=(0,Q.jsxs)(kz,{children:[v,b]}),t[10]=v,t[11]=b,t[12]=x):x=t[12];let S=u.length>1&&(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Q.jsx)(Ms,{htmlFor:`merge-method`,children:`Method`}),(0,Q.jsxs)(oa,{value:d??null,disabled:p.waiting,onValueChange:f,children:[(0,Q.jsx)(ni,{id:`merge-method`,"aria-label":`Merge method`,className:`w-full`,children:(0,Q.jsx)(ec,{children:g?.label})}),(0,Q.jsx)(Zi,{children:u.map(QK)})]})]}),C;t[13]===p?C=t[14]:(C=Mi(p)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-ui text-destructive`,children:sf(Ra(p.cause))}),t[13]=p,t[14]=C);let w;t[15]===p.waiting?w=t[16]:(w=(0,Q.jsx)(Nz,{disabled:p.waiting,children:`Cancel`}),t[15]=p.waiting,t[16]=w);let T=!!l||p.waiting||!g,E;t[17]!==g||t[18]!==a||t[19]!==m||t[20]!==l?(E=()=>{g&&!l&&m({method:g.method,headSha:a})},t[17]=g,t[18]=a,t[19]=m,t[20]=l,t[21]=E):E=t[21];let D=g?.label??`Merge`,O;t[22]!==p.waiting||t[23]!==E||t[24]!==D||t[25]!==T||t[26]!==l?(O=(0,Q.jsx)(ji,{pending:p.waiting,disabled:T,"aria-description":l,onClick:E,children:D}),t[22]=p.waiting,t[23]=E,t[24]=D,t[25]=T,t[26]=l,t[27]=O):O=t[27];let k;t[28]!==O||t[29]!==w?(k=(0,Q.jsxs)(Az,{children:[w,O]}),t[28]=O,t[29]=w,t[30]=k):k=t[30];let A;return t[31]!==_||t[32]!==k||t[33]!==x||t[34]!==S||t[35]!==C?(A=(0,Q.jsxs)(_,{children:[x,S,C,k]}),t[31]=_,t[32]=k,t[33]=x,t[34]=S,t[35]=C,t[36]=A):A=t[36],A}function QK(e){return(0,Q.jsx)(Ps,{value:e.method,children:e.label},e.method)}function $K(){return FB.close()}function eq(e){let t=(0,$.c)(2),{connection:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(vz,{controller:jB,children:e=>e&&(0,Q.jsx)(wW,{remote:e.remote,connection:n,children:t=>(0,Q.jsxs)(xz,{children:[(0,Q.jsxs)(Sz,{children:[(0,Q.jsxs)(wz,{children:[`Walkthroughs for `,e.project.name]}),(0,Q.jsx)(Tz,{children:`Use the default writer or override it for this project. This choice applies to manual and automatic walkthroughs and their answers.`})]}),(0,Q.jsx)(ku,{project:e.project,...t,onSaved:tq},e.project.id)]})})}),t[0]=n,t[1]=r),r}function tq(){return jB.close()}function nq(e,t){return fs(t).filter(t=>{let n=e.getItem(t);return n!==null&&`isExpanded`in n&&n.isExpanded()})}function rq(e){let t=(0,$.c)(32),n=(0,Z.useId)(),r;t[0]===n?r=t[1]:(r=Vc(n),t[0]=n,t[1]=r);let i=r,a=Ot(E),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!0),[u,d]=(0,Z.useState)(null),f;t[2]!==u||t[3]!==e.filter||t[4]!==e.paths?(f=u?.pathsKey===e.paths.join(`\0`)&&u.filter===e.filter,t[2]=u,t[3]=e.filter,t[4]=e.paths,t[5]=f):f=t[5];let p=f;o&&!p&&s(!1);let m;t[6]!==i||t[7]!==a?(m=()=>e=>{if(e)return iq(e,a,i,d,e=>{l(e),s(!1)})},t[6]=i,t[7]=a,t[8]=m):m=t[8];let[h]=(0,Z.useState)(m),g=o&&p,_;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e&&l(!0),s(e)},t[9]=_):_=t[9];let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`}),t[10]=v):v=t[10];let y;t[11]!==i||t[12]!==e||t[13]!==a?(y=(0,Q.jsx)(`span`,{hidden:!0,ref:t=>{t&&a.set(i,Zn(e))}}),t[11]=i,t[12]=e,t[13]=a,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`div`,{ref:h,className:`flex min-h-0 flex-1 flex-col`}),t[15]=b):b=t[15];let x;t[16]===y?x=t[17]:(x=(0,Q.jsxs)(uH,{render:v,children:[y,b]}),t[16]=y,t[17]=x);let S;t[18]!==p||t[19]!==o||t[20]!==u?(S=o&&p&&u&&(0,Q.jsx)(`span`,{hidden:!0,ref:()=>{let{row:e}=u;return e.setAttribute(`aria-haspopup`,`menu`),e.setAttribute(`data-context-menu-open`,``),()=>{e.removeAttribute(`aria-haspopup`),e.removeAttribute(`data-context-menu-open`)}}}),t[18]=p,t[19]=o,t[20]=u,t[21]=S):S=t[21];let C;t[22]!==p||t[23]!==u||t[24]!==e.renderMenu||t[25]!==c?(C=u&&e.renderMenu(u.item,{finalFocus:p&&c?u.finalFocus:`none`,close:u.close},u.rename),t[22]=p,t[23]=u,t[24]=e.renderMenu,t[25]=c,t[26]=C):C=t[26];let w;return t[27]!==S||t[28]!==C||t[29]!==g||t[30]!==x?(w=(0,Q.jsxs)(Wt,{open:g,onOpenChange:_,children:[x,S,C]}),t[27]=S,t[28]=C,t[29]=g,t[30]=x,t[31]=w):w=t[31],w}function iq(e,t,n,r,i){let a=()=>Kt(t.get(n)),o=ad(a().owner),s=t.get(o),c=new Set(s.expanded),l=!a().filter&&s.document===a().selected&&!(document.activeElement instanceof HTMLInputElement),u=!0,d=!1,f=!1,p={selected:s.document,complete:s.document===a().selected},m=null,h,g,_=null,v=new Set;function y(e){let t=requestAnimationFrame(()=>{v.delete(t),u&&e()});v.add(t)}let b=new Ik({paths:a().paths,density:`default`,itemHeight:28,flattenEmptyDirectories:!0,initialExpansion:a().filter?`open`:`closed`,icons:Vk(a().links),unsafeCSS:`[data-icon-name="file-tree-icon-chevron"] { color: var(--trees-fg-muted); } [data-item-git-status]:not([data-item-git-status="ignored"]) > [data-item-section="content"] { color: inherit; } [data-context-menu-open] { outline: 1px solid var(--trees-fg-muted); outline-offset: -1px; border-radius: 4px; } [data-truncate-container] { --truncate-marker-background-color: var(--card); --truncate-marker-opacity: 100%; }`,gitStatus:a().gitStatus,search:!1,renaming:{onError:e=>{m=null,a().onInvalidName(e),queueMicrotask(()=>{u&&b.resetPaths(a().paths)})},onRename:e=>{f=!0;let t=m;m=null,(t?.path.replace(/\/$/,``)===e.sourcePath.replace(/\/$/,``)?a().onCreate(e.destinationPath,t.kind):a().onMove(e.sourcePath,e.destinationPath)).catch(()=>{u&&b.resetPaths(a().paths)})}},dragAndDrop:{canDrag:()=>!a().writeBlock&&(d=!0,queueMicrotask(()=>{d=!1}),!0),canDrop:({draggedPaths:e,target:t})=>!a().writeBlock&&Eo(e,t.directoryPath??``),onDropComplete:e=>{if(a().writeBlock)return;let t=a().onMove;ls(Sa(e.draggedPaths,e.target.directoryPath??``,(e,n)=>Ui({try:()=>t(e,n),catch:e=>new Rt(e)}))).catch(()=>{u&&b.resetPaths(a().paths)})}},renderRowDecoration:({item:e})=>{let t=a().links.find(t=>t.path===e.path);return t?{text:t.kind===`symlink`?`→ ${t.target??`?`}`:`submodule`,title:`Not followed`}:null},onSelectionChange:([e])=>{!d&&!f&&e&&m?.path.replace(/\/$/,``)!==e.replace(/\/$/,``)&&e!==a().selected&&a().onSelect(e)}});function x(){a().bindCollapseAll(()=>{d=!0,c.clear(),l=!1,p={selected:a().selected,complete:!0};let e=ad(a().owner.replace(/:search$/,``));t.set(e,{...t.get(e),expanded:[],document:a().selected,focused:null,anchor:null}),a().onFilterChange(``),b.resetPaths(a().paths,{initialExpandedPaths:[]}),d=!1}),a().bindRename(e=>a().onRequestRename(e))}function S(){let e=a().renameRequest;e&&!a().filter&&g!==e.nonce&&b.getItem(e.path)!==null&&(g=e.nonce,y(()=>{d=!0,b.startRenaming(e.path)&&e.onStart(),d=!1}))}function C(){let{creating:t}=a();if(!t||h===t.nonce)return;h=t.nonce;let n=ki(t.kind,t.folder,e=>b.getItem(e)!==null);m={path:n,kind:t.kind},b.add(n),b.startRenaming(n,{removeIfCanceled:!0}),y(()=>{t.onStart();let n=e.querySelector(`[data-slot="file-tree"]`)?.shadowRoot?.querySelector(`[data-item-rename-input]`);n instanceof HTMLInputElement&&n.focus()})}function w(){let e=nq(b,a().paths).map(e=>e.replace(/\/$/,``));e.length&&!a().filter&&a().onExpand(e)}function T(){a().onContentHeight?.(b.getVisibleCount()*b.getItemHeight())}function E(){if(m)return;let{selected:e}=a(),t=a().paths;p.selected!==e&&(p={selected:e,complete:!1});let n=Ru(t.flatMap(e=>{let t=a().kinds.get(e);return t===void 0?[]:[{path:e,kind:t}]}),new Set([...nq(b,t),...c]),new Set(fs(t).filter(e=>b.getItem(e)!==null))).map(e=>`${e}/`);d=!0;{let r=p.complete?[]:Ji(e);b.resetPaths(t,{initialExpandedPaths:a().filter?fs(t):[...new Set([...n,...r])]});for(let e of c)b.getItem(e)!==null&&c.delete(e);let i=b.getItem(e);!p.complete&&i&&!i.isDirectory()&&(i.select(),p.complete=!0)}if(d=!1,l){d=!0;for(let e of s.selected)b.getItem(e)?.select();s.focused&&b.getItem(s.focused)&&b.focusPath(s.focused),s.anchor&&b.getItem(s.anchor)&&(b.scrollToPath(s.anchor,{focus:!1,offset:`top`}),l=!1),d=!1}w()}let D;function O(){let e=a();x(),D&&D.paths.join(`\0`)===e.paths.join(`\0`)&&D.selected===e.selected||E(),Bn(D?.gitStatus,e.gitStatus)||b.setGitStatus(e.gitStatus),Bn(D?.links,e.links)||b.setIcons(Vk(e.links)),D=e,C(),S(),T()}let k=b.onMutation(`move`,()=>{f=!1}),A=t.subscribe(n,O),j=b.subscribe(()=>{T(),d||w()});function M(e){let t=m;if(!t)return;let n=e.composedPath().find(e=>e instanceof HTMLInputElement&&e.hasAttribute(`data-item-rename-input`));n?.value.trim()===``?(m=null,y(E)):n?.value===Xa(t.path)&&(m=null,a().onCreate(t.path,t.kind).catch(()=>{u&&b.resetPaths(a().paths)}))}function N(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-item-path`)),n=t?.dataset.itemPath,o=n===void 0?null:b.getItem(n);if(!t||!n||!o||t.querySelector(`[data-item-rename-input]`))return null;let s={restore:!0},{paths:c,filter:l}=a();return r({row:t,pathsKey:c.join(`\0`),filter:l,finalFocus:()=>s.restore&&t.isConnected&&t.dataset.itemPath===n?t:null,close:e=>{s.restore=e,i(e)},rename:()=>a().onRequestRename(n),item:{path:n,name:Xa(n),kind:o.isDirectory()?`directory`:`file`}}),t}function P(e){if(e.key===`Escape`&&(_=null),e.key===`F2`&&!m&&!a().writeBlock){let t=b.getFocusedPath();t&&(e.preventDefault(),e.stopPropagation(),a().onRequestRename(t))}e.key===`Enter`&&M(e),e.key===`Escape`&&m&&(m=null,y(E))}function F(e){if(e.button!==0||!e.altKey&&(e.ctrlKey||e.metaKey||e.shiftKey))return;let t=e.composedPath();if(t.some(e=>e instanceof HTMLInputElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-item-path`))?.dataset.itemPath;if(!n||a().kinds.get(n)!==`file`)return;let r=b.getItem(n);if(r&&m?.path!==n){e.preventDefault(),e.stopPropagation(),d=!0;for(let e of b.getSelectedPaths())e!==n&&b.getItem(e)?.deselect();r.select(),d=!1,a().onSelect(n,e.altKey)}}function I(){return!!b.getFileTreeContainer()?.shadowRoot?.querySelector(`[data-is-scrolling]`)}function L(e){let t=N(e);if(!t){e.stopPropagation();return}if(!(e instanceof MouseEvent)||e.button===2||!I())return;e.preventDefault(),e.stopPropagation();let n=t.dataset.itemPath;_=t;let r=()=>{_===t&&(!t.isConnected||t.dataset.itemPath!==n||b.getFocusedPath()!==n?_=null:I()?y(r):(_=null,t.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,composed:!0}))))};y(r)}function R(t){t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(_=null)}return e.addEventListener(`keydown`,P,!0),e.addEventListener(`click`,F,!0),e.addEventListener(`blur`,M,!0),e.addEventListener(`contextmenu`,L,!0),e.addEventListener(`touchstart`,L,!0),e.addEventListener(`focusout`,R,!0),b.render({containerWrapper:e}),b.getFileTreeContainer()?.setAttribute(`class`,`min-h-0 flex-1`),b.getFileTreeContainer()?.setAttribute(`data-slot`,`file-tree`),b.getFileTreeContainer()?.setAttribute(`aria-label`,`Worktree files`),O(),()=>{let n=b.getFileTreeContainer(),r=n?.getBoundingClientRect().top??0,i=[...n?.shadowRoot?.querySelectorAll(`[data-item-path]`)??[]].find(e=>e.getBoundingClientRect().bottom>r)?.dataset.itemPath??null;t.set(o,{expanded:[...new Set([...nq(b,a().paths),...c])],selected:b.getSelectedPaths(),focused:b.getFocusedPath(),anchor:i,document:a().selected}),u=!1;for(let e of v)cancelAnimationFrame(e);A(),j(),k(),a().bindRename(()=>void 0),a().bindCollapseAll(()=>void 0),e.removeEventListener(`keydown`,P,!0),e.removeEventListener(`click`,F,!0),e.removeEventListener(`blur`,M,!0),e.removeEventListener(`contextmenu`,L,!0),e.removeEventListener(`touchstart`,L,!0),e.removeEventListener(`focusout`,R,!0),b.cleanUp(),e.replaceChildren()}}function aq(e,t){t.close(e!==`rename`&&e!==`new-file`&&e!==`new-folder`&&e!==`open-to-side`),e===`rename`?queueMicrotask(t.rename):e===`new-file`?t.onStartCreate(`file`,t.path):e===`new-folder`?t.onStartCreate(`directory`,t.path):e===`open`||e===`open-file`?t.onOpenFile(t.path):e===`open-to-side`?t.onOpenToSide(t.path):e===`open-diff`?t.onOpenDiff(t.path):e===`timeline`?t.onOpenTimeline(t.path):e===`duplicate`?t.onDuplicate(t.path):e===`pin`?t.onTogglePinned(t.path):e===`hide`?t.onSetHidden(t.hiddenEntry??t.path,t.hiddenEntry===null):e===`copy-relative`?Zt(t.path,`relative path`):e===`copy-full`?Zt(`${t.worktreePath.replace(/\/$/,``)}/${t.path}`,`full path`):t.onTrash(t.path)}var oq=Oe(Ns());function sq(e,t,n){let r=(0,$.c)(7),i=n===void 0||n,a;r[0]!==e||r[1]!==i||r[2]!==t?(a=i?oo({connection:e,scope:t}):oq,r[0]=e,r[1]=i,r[2]=t,r[3]=a):a=r[3];let o=a,s=Ot(o),c=l(o),u;return r[4]!==s||r[5]!==c?(u={result:s,refresh:c},r[4]=s,r[5]=c,r[6]=u):u=r[6],u}var cq={"new-file":$h,"new-folder":dg,rename:ao,duplicate:zh,open:Yh,"open-file":Yh,"open-to-side":Lh,"open-diff":Zh,timeline:h_,pin:s_,hide:Gh,"copy-relative":Bs,"copy-full":Bs,trash:N_};function lq(e){let t=(0,$.c)(9),{path:n,finalFocus:r,actions:i,hidden:a,writeBlock:o,onAction:s}=e,c=`${n} actions`,l;t[0]!==i||t[1]!==a||t[2]!==s||t[3]!==o?(l=(0,Q.jsx)(dq,{actions:i,hidden:a,onAction:s,writeBlock:o}),t[0]=i,t[1]=a,t[2]=s,t[3]=o,t[4]=l):l=t[4];let u;return t[5]!==r||t[6]!==c||t[7]!==l?(u=(0,Q.jsx)(dH,{"aria-label":c,className:`w-max max-w-[calc(100vw-2rem)] whitespace-nowrap`,onKeyDownCapture:uq,finalFocus:r,children:l}),t[5]=r,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function uq(e){if(e.key!==`ArrowDown`||e.target!==e.currentTarget)return;let t=e.currentTarget.querySelector(`[role="menuitem"]`);t instanceof HTMLElement&&(e.preventDefault(),e.stopPropagation(),t.focus())}function dq({actions:e,hidden:t,onAction:n,writeBlock:r}){return e.map(e=>(0,Q.jsx)(fq,{action:e,onAction:n,hidden:t,writeBlock:r},e.id))}function fq(e){let t=(0,$.c)(17),{action:n,onAction:r,hidden:i,writeBlock:a}=e,o=[`new-file`,`new-folder`,`rename`,`duplicate`,`pin`,`hide`,`trash`].includes(n.id)?a:void 0,s=n.id===`hide`&&i?qh:cq[n.id],c;t[0]===n.id?c=t[1]:(c=(n.id===`hide`||n.id===`copy-relative`||n.id===`trash`)&&(0,Q.jsx)(we,{}),t[0]=n.id,t[1]=c);let l=!!o,u=n.id===`trash`,d;t[2]!==n.id||t[3]!==r?(d=()=>r(n.id),t[2]=n.id,t[3]=r,t[4]=d):d=t[4];let f;t[5]===s?f=t[6]:(f=(0,Q.jsx)(s,{}),t[5]=s,t[6]=f);let p;t[7]!==n.label||t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Q.jsxs)(dn,{disabled:l,"aria-description":o,destructive:u,onSelect:d,children:[f,n.label]}),t[7]=n.label,t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==c||t[15]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[c,p]}),t[14]=c,t[15]=p,t[16]=m):m=t[16],m}function pq(e){let t=(0,$.c)(7),{label:n,count:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`flex-1`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r===void 0?null:(0,Q.jsx)(`span`,{className:`tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`h3`,{className:`flex h-7 shrink-0 items-center gap-1 px-6 text-2xs font-medium text-muted-foreground`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}var mq={added:`A`,deleted:`D`,modified:`M`,renamed:`R`,untracked:`U`},hq={added:`text-add-fg`,deleted:`text-del-fg`,modified:`text-brand`,renamed:`text-brand`,untracked:`text-add-fg`},gq={resolved:`Not followed`,loading:``,missing:`Missing`,unavailable:`Listing unavailable · Open as file`};function _q(e){let t=(0,$.c)(27),{entries:n,expanded:r,onExpand:i,onRetry:a,renderDirectory:o,statuses:s,selected:c,onOpen:l,onUnpin:u,writeBlock:d,menuFor:f}=e,[p,m]=(0,Z.useState)(!1);if(n.length===0)return null;let h,g,_,v,y;if(t[0]!==n||t[1]!==r||t[2]!==f||t[3]!==i||t[4]!==l||t[5]!==a||t[6]!==u||t[7]!==p||t[8]!==o||t[9]!==c||t[10]!==s||t[11]!==d){let e=new Map(s.flatMap(vq));_=`Pinned files`,v=`shrink-0 pt-1.5 pb-1`,t[17]===n.length?y=t[18]:(y=(0,Q.jsx)(pq,{label:`Pinned`,count:n.length}),t[17]=n.length,t[18]=y),h=`px-4 [--trees-item-height:--spacing(7)]`,g=n.map(t=>{let{path:n}=t,s=t.state===`resolved`&&t.entry.kind===`directory`,h=r.includes(n),g=t.state===`unavailable`||t.state===`resolved`&&(t.entry.kind===`file`||s),_=n.lastIndexOf(`/`)+1,v=f(s?`${n}/`:n);return(0,Q.jsxs)(Wt,{onOpenChange:e=>{e&&m(!1)},children:[(0,Q.jsxs)(uH,{render:(0,Q.jsx)(`li`,{className:`flex flex-wrap items-center gap-0.5`}),children:[(0,Q.jsx)(fr,{text:n,className:`min-w-0`,renderTrigger:(r,a)=>(0,Q.jsxs)(`button`,{type:`button`,"data-file-tree-row":``,"aria-label":t.state===`unavailable`?`Open ${n} as file`:n,"aria-current":n===c?`page`:void 0,"aria-expanded":s?h:void 0,disabled:!g,className:Y(`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 text-left hover:bg-accent`,n===c&&`bg-accent`),onClick:e=>s?i(n,!h):l(n,e.altKey),children:[s?(0,Q.jsx)(Gk,{expanded:h,className:`size-4 shrink-0`}):(0,Q.jsx)(Gk,{path:n,className:`size-4 shrink-0`}),r,_>0&&a(n.slice(0,_-1),`shrink-[100] text-muted-foreground`),e.has(n)&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:Y(`ml-auto shrink-0 pl-1 font-mono text-xs font-medium`,e.get(n)?.tone),children:e.get(n)?.mark})]}),children:n.slice(_)}),(!g||t.state===`unavailable`)&&gq[t.state]&&(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:gq[t.state]}),t.state===`unavailable`&&(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:a,children:`Try again`}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":`Unpin ${n}`,disabled:!!d,"aria-description":d,onClick:()=>u(n)}),children:(0,Q.jsx)(l_,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Unpin ${n}`})]}),s&&h&&(0,Q.jsx)(`div`,{className:`w-full`,children:o(n)})]}),(0,Q.jsx)(dH,{finalFocus:p?`none`:`trigger`,children:(0,Q.jsx)(dq,{writeBlock:d,actions:v.actions,hidden:v.hidden,onAction:e=>{e===`open-to-side`&&(0,th.flushSync)(()=>m(!0)),v.onAction(e)}})})]},n)}),t[0]=n,t[1]=r,t[2]=f,t[3]=i,t[4]=l,t[5]=a,t[6]=u,t[7]=p,t[8]=o,t[9]=c,t[10]=s,t[11]=d,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y}else h=t[12],g=t[13],_=t[14],v=t[15],y=t[16];let b;t[19]!==h||t[20]!==g?(b=(0,Q.jsx)(`ul`,{className:h,children:g}),t[19]=h,t[20]=g,t[21]=b):b=t[21];let x;return t[22]!==_||t[23]!==v||t[24]!==y||t[25]!==b?(x=(0,Q.jsxs)(`section`,{"aria-label":_,className:v,children:[y,b]}),t[22]=_,t[23]=v,t[24]=y,t[25]=b,t[26]=x):x=t[26],x}function vq(e){let t=mq[e.status];return t===void 0?[]:[[e.path,{mark:t,tone:hq[e.status]??``}]]}function yq(e){let t=(0,$.c)(3),{connection:n}=e.context,r=`${n.environmentId}:${e.scope.projectId}:${e.scope.worktreeId}`,i;return t[0]!==e||t[1]!==r?(i=(0,Q.jsx)(bq,{...e},r),t[0]=e,t[1]=r,t[2]=i):i=t[2],i}function bq(e){let t=(0,$.c)(99),{scope:n,context:r,worktreePath:i,selected:a,onOpen:o,onMoved:s,onTrashed:c,sideLabel:l,actionsTarget:u}=e,{connection:d}=r,f=na(r),p=LR(d,n,``),m=yd(d,n),h=Mi(m.result)?Ra(m.result.cause):void 0,[g,_]=(0,Z.useState)(),[v,y]=(0,Z.useState)(),[b,x]=(0,Z.useState)(null),S=de(qr(iB(n,d))),C=KB(d,n.projectId),w=wB(d,n.projectId),T=YB(d,n.projectId),E=TB(d,n.projectId),D=`${d.environmentId}:${n.projectId}:${n.worktreeId}`,O=Pl(D),{showHidden:k,query:A,requested:j,pinnedExpanded:M}=O.state,N;t[0]===A?N=t[1]:(N=A.trim(),t[0]=A,t[1]=N);let P=N!==``,F=sq(d,n,P),I;t[2]===O?I=t[3]:(I=e=>O.set(t=>({...t,showHidden:e})),t[2]=O,t[3]=I);let L=I,R;t[4]===O?R=t[5]:(R=e=>O.set(t=>({...t,query:e})),t[4]=O,t[5]=R);let z=R,B;t[6]===O?B=t[7]:(B=e=>O.set(t=>{let n=e(t.requested);return n===t.requested?t:{...t,requested:n}}),t[6]=O,t[7]=B);let V=B,H=A===``?`Collapse all`:`Clear search and collapse all`,U;t[8]!==T||t[9]!==j||t[10]!==a?(U=zq(zq(zq(j,iu(T.map(Rq))),[``]),Lc(a)),t[8]=T,t[9]=j,t[10]=a,t[11]=U):U=t[11];let W=zR(d,n,U),G=[p,...W.results.flatMap(Lq)],K=Su(Jd(G),G,a),q=P?cu(cl(de(qr(F.result))?.paths??[],C,k),A):[],J=zq(q,q.flatMap(Fq)),ee=[...K],te=new Map(ee.map(Pq));for(let e of J){if(te.has(e))continue;let t=e.endsWith(`/`)?`directory`:`file`;ee.push({path:e,kind:t}),te.set(e,t)}let ne=P?J:ee.map(Nq),re=cl(ne,C,k),ie;t[12]===W.results?ie=t[13]:(ie=W.results.filter(Mi),t[12]=W.results,t[13]=ie);let ae=ie,oe=P?[]:G.flatMap(Mq),se=[{path:``,status:`loaded`,entries:p.entries},...W.states],ce=Zl(cl(T,C,k),se),le=[...ee.filter(jq).map(Aq),...(S?.changes??[]).flatMap(kq).map(Oq)],ue=new Set((S?.changes??[]).map(Dq)),fe=new Set(ee.filter(Eq).map(Tq)),pe;t[14]===o?pe=t[15]:(pe=(e,t)=>o({kind:`file`,path:e},{toSide:t!==void 0&&t}),t[14]=o,t[15]=pe);let me=pe,he=e=>m.duplicate(e,vi(e,e=>te.has(e)),me),ge=BR(),_e;t[16]!==he||t[17]!==m.result.waiting||t[18]!==a||t[19]!==f?(_e=()=>{!f&&!m.result.waiting&&he(a)},t[16]=he,t[17]=m.result.waiting,t[18]=a,t[19]=f,t[20]=_e):_e=t[20];let ve=ge&&fe.has(a),ye;t[21]===ve?ye=t[22]:(ye={enabled:ve,ignoreInputs:!0},t[21]=ve,t[22]=ye),Hu(ou.duplicateFile,_e,ye);let be=(e,t)=>{let n=t!==void 0&&t,r=te.get(e);r===`symlink`||r===`submodule`?o({kind:`file`,path:e},{toSide:n}):r===`file`&&me(e,n)},{collapseAll:xe,renameFile:Se,bindCollapseAll:Ce,bindRename:we}=il(D),Te=e=>{let t=eu(e,C),n=ee.find(t=>Wc(t.path)===Wc(e));return{hidden:t!==null,actions:As(n,{changed:ue.has(e),openToSideLabel:l,hiddenEntry:t,ownHidden:t===Wc(e),hiddenName:t?.replace(/\/$/,``).split(`/`).at(-1)??``,pinned:n?.kind===`file`||n?.kind===`directory`?T.includes(Wc(e)):void 0}),run:(n,r,a)=>aq(n,{path:e,hiddenEntry:t,worktreePath:i,close:r,rename:a,onStartCreate:(e,t)=>{m.result.waiting||(m.reset(),_({kind:e,folder:t,nonce:Date.now()}))},onOpenFile:e=>o({kind:`file`,path:e}),onOpenToSide:e=>me(e,!0),onOpenDiff:e=>o({kind:`change`,path:e}),onOpenTimeline:e=>o({kind:`timeline`,path:e}),onSetHidden:(e,t)=>as(w.submit({path:e,hidden:t})),onTogglePinned:e=>as(E.submit({path:e,pinned:!T.includes(Wc(e))})),onTrash:e=>{m.reset(),x(e)},onDuplicate:e=>{m.result.waiting||(m.reset(),he(e))}})}},Ee;t[23]!==m||t[24]!==z||t[25]!==V||t[26]!==f?(Ee=e=>{f||(m.reset(),V(t=>zq(t,Lc(e))),z(``),y({path:e,nonce:Date.now()}))},t[23]=m,t[24]=z,t[25]=V,t[26]=f,t[27]=Ee):Ee=t[27];let De;t[28]!==m||t[29]!==o||t[30]!==f?(De=(e,t)=>f?Promise.reject(Error(f)):m.create(e,t,e=>o({kind:`file`,path:e})),t[28]=m,t[29]=o,t[30]=f,t[31]=De):De=t[31];let Oe;t[32]!==m||t[33]!==s||t[34]!==V||t[35]!==f?(Oe=(e,t)=>f?Promise.reject(Error(f)):m.move(e,t,(e,t)=>{V(n=>[...new Set(n.map(n=>bd(n,e,t)))]),s(e,t)}),t[32]=m,t[33]=s,t[34]=V,t[35]=f,t[36]=Oe):Oe=t[36];let ke;t[37]===V?ke=t[38]:(ke=e=>V(t=>zq(t,e)),t[37]=V,t[38]=ke);let Ae={owner:P?`${D}:search`:D,filter:P?A:``,onFilterChange:z,paths:re,kinds:te,links:ee.filter(wq),creating:g&&!f?{...g,onStart:()=>_(void 0)}:void 0,writeBlock:f,renameRequest:v&&!f?{...v,onStart:()=>y(void 0)}:void 0,onRequestRename:Ee,onCreate:De,onMove:Oe,gitStatus:le,selected:a,bindRename:we,bindCollapseAll:Ce,onInvalidName:Cq,renderMenu:(e,t,n)=>{let r=e.kind===`directory`&&!e.path.endsWith(`/`)?`${e.path}/`:e.path,i=Te(r);return(0,Q.jsx)(lq,{path:r,finalFocus:t.finalFocus,actions:i.actions,hidden:i.hidden,writeBlock:f,onAction:e=>i.run(e,t.close,n)},r)},onExpand:ke,onSelect:be},je;t[39]===z?je=t[40]:(je=e=>z(e.target.value),t[39]=z,t[40]=je);let Me;t[41]!==A||t[42]!==je?(Me=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 px-2 pt-2`,children:(0,Q.jsx)(ei,{"aria-label":`Search files`,placeholder:`Search...`,value:A,onChange:je,className:`h-7 w-auto min-w-0 flex-1`})}),t[41]=A,t[42]=je,t[43]=Me):Me=t[43];let Pe;t[44]!==u||t[45]!==xe||t[46]!==H||t[47]!==m.result.waiting||t[48]!==f?(Pe=u&&(0,th.createPortal)((0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Wt,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,"aria-label":`Create file or folder`,disabled:m.result.waiting||!!f,"aria-description":f}),children:(0,Q.jsx)(d_,{className:`text-muted-foreground`})})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:f??`Create file or folder`})]}),(0,Q.jsxs)(Ne,{align:`end`,children:[(0,Q.jsxs)(dn,{disabled:!!f,"aria-description":f,onSelect:()=>_({kind:`file`,folder:``,nonce:Date.now()}),children:[(0,Q.jsx)($h,{}),`New file`]}),(0,Q.jsxs)(dn,{disabled:!!f,"aria-description":f,onSelect:()=>_({kind:`directory`,folder:``,nonce:Date.now()}),children:[(0,Q.jsx)(dg,{}),`New folder`]})]})]}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{size:`icon-sm`,variant:`ghost`,"aria-label":H,onClick:()=>xe()}),children:(0,Q.jsx)(zg,{className:`text-muted-foreground`})}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:H})]})]}),u),t[44]=u,t[45]=xe,t[46]=H,t[47]=m.result.waiting,t[48]=f,t[49]=Pe):Pe=t[49];let Fe;t[50]!==O||t[51]!==V?(Fe=(e,t)=>{O.set(n=>({...n,pinnedExpanded:t?zq(n.pinnedExpanded,[e]):n.pinnedExpanded.filter(t=>t!==e)})),t&&V(t=>zq(t,[e]))},t[50]=O,t[51]=V,t[52]=Fe):Fe=t[52];let Ie;t[53]===W?Ie=t[54]:(Ie=()=>W.retry(),t[53]=W,t[54]=Ie);let Le;t[55]===E?Le=t[56]:(Le=e=>as(E.submit({path:e,pinned:!1})),t[55]=E,t[56]=Le);let Re;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Q.jsx)(pq,{label:`All files`}),t[57]=Re):Re=t[57];let ze;t[58]!==F||t[59]!==P?(ze=P&&Mi(F.result)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`px-6 py-2 text-xs`,children:[`Could not search files.`,(0,Q.jsx)(X,{variant:`link`,size:`xs`,onClick:()=>F.refresh(),children:`Try again`})]}),t[58]=F,t[59]=P,t[60]=ze):ze=t[60];let Be=b!==null,Ve;t[61]===m.result.waiting?Ve=t[62]:(Ve=e=>{!e&&!m.result.waiting&&x(null)},t[61]=m.result.waiting,t[62]=Ve);let He;t[63]===b?He=t[64]:(He=(0,Q.jsxs)(jz,{children:[`Move `,b,` to the trash?`]}),t[63]=b,t[64]=He);let Ue=b!=null&&ue.has(b)?`This is part of the agent’s changes. Deleting it changes what you are reviewing, and the agent may write it again. You can restore it from the system trash.`:`You can restore it from the system trash. This changes the files in your worktree.`,We;t[65]===Ue?We=t[66]:(We=(0,Q.jsx)(Mz,{children:Ue}),t[65]=Ue,t[66]=We);let Ge;t[67]!==He||t[68]!==We?(Ge=(0,Q.jsxs)(kz,{children:[He,We]}),t[67]=He,t[68]=We,t[69]=Ge):Ge=t[69];let Ke;t[70]===m.result.waiting?Ke=t[71]:(Ke=(0,Q.jsx)(Nz,{disabled:m.result.waiting,children:`Cancel`}),t[70]=m.result.waiting,t[71]=Ke);let qe=m.result.waiting||!!f,Je;t[72]!==b||t[73]!==m||t[74]!==c||t[75]!==V?(Je=()=>{b&&m.trash(b,()=>{x(null),V(e=>e.filter(e=>!ed(e,b))),c(b)})},t[72]=b,t[73]=m,t[74]=c,t[75]=V,t[76]=Je):Je=t[76];let Ye;t[77]!==qe||t[78]!==Je||t[79]!==f?(Ye=(0,Q.jsx)(X,{variant:`destructive`,disabled:qe,"aria-description":f,onClick:Je,children:`Move to trash`}),t[77]=qe,t[78]=Je,t[79]=f,t[80]=Ye):Ye=t[80];let Xe;t[81]!==Ke||t[82]!==Ye?(Xe=(0,Q.jsxs)(Az,{children:[Ke,Ye]}),t[81]=Ke,t[82]=Ye,t[83]=Xe):Xe=t[83];let Qe=h!==void 0&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:Td(h)}),$e;t[84]!==Ge||t[85]!==Xe||t[86]!==Qe?($e=(0,Q.jsxs)(Oz,{children:[Ge,Xe,Qe]}),t[84]=Ge,t[85]=Xe,t[86]=Qe,t[87]=$e):$e=t[87];let et;t[88]!==Be||t[89]!==Ve||t[90]!==$e?(et=(0,Q.jsx)(Ez,{open:Be,onOpenChange:Ve,children:$e}),t[88]=Be,t[89]=Ve,t[90]=$e,t[91]=et):et=t[91];let tt;t[92]===E.result?tt=t[93]:(tt=Mi(E.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-t px-3 py-2 text-xs text-destructive`,children:Wd(Ra(E.result.cause))}),t[92]=E.result,t[93]=tt);let nt;t[94]===w.result?nt=t[95]:(nt=Mi(w.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-t px-3 py-2 text-xs text-destructive`,children:Wd(Ra(w.result.cause))}),t[94]=w.result,t[95]=nt);let rt;return t[96]!==W||t[97]!==ae.length?(rt=ae.length>0&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Some folders could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,onClick:()=>W.retry(),children:`Try again`})]}),t[96]=W,t[97]=ae.length,t[98]=rt):rt=t[98],(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Me,Pe,(0,Q.jsx)(_q,{entries:ce,expanded:M,onExpand:Fe,onRetry:Ie,renderDirectory:e=>(0,Q.jsx)(Bq,{prefix:`${e}/`,input:Ae}),statuses:le,selected:a,onOpen:me,writeBlock:f,onUnpin:Le,menuFor:e=>{let t=Te(e);return{actions:ce.some(t=>t.path===Wc(e)&&t.state===`resolved`)?t.actions:[],hidden:t.hidden,onAction:n=>t.run(n,Sq,()=>Se(e))}}}),(0,Q.jsxs)(`section`,{"aria-label":`All files`,className:`flex min-h-0 flex-1 flex-col pt-1`,children:[Re,ze,P&&Bo(F.result)&&!F.result.waiting&&q.length===0&&(0,Q.jsx)(`p`,{role:`status`,className:`px-6 py-2 text-xs text-muted-foreground`,children:`No files match your search.`}),(0,Q.jsx)(rq,{...Ae},Ae.owner),oe.map(xq),C.size>0&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 px-3.5 py-2 text-2xs text-muted-foreground`,children:[(0,Q.jsx)(Gh,{className:`size-3.5 shrink-0`}),(0,Q.jsx)(`span`,{children:dl(C,e=>te.get(e)??te.get(`${e}/`))}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(X,{variant:`link`,size:`xs`,onClick:()=>L(!k),children:k?`Hide`:`Show`})]})]}),et,h!==void 0&&!b&&(0,Q.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:Td(h)}),tt,nt,rt]})}function xq(e){return(0,Q.jsx)(`p`,{role:`status`,className:`shrink-0 px-3.5 py-2 text-2xs text-muted-foreground`,children:e},e)}function Sq(){}function Cq(e){return ks({title:`Invalid name`,description:e,type:`error`})}function wq(e){return e.kind===`symlink`||e.kind===`submodule`}function Tq(e){return e.path}function Eq(e){return e.kind===`file`}function Dq(e){return e.path}function Oq(e){return{path:zt(e),status:Id(e)}}function kq(e){return e.comparisons}function Aq(e){return{path:e.path,status:`ignored`}}function jq(e){return e.ignored}function Mq(e){return Ee(Oa(zd(e)))}function Nq(e){return e.path}function Pq(e){return[e.path,e.kind]}function Fq(e){return Lc(e).map(Iq)}function Iq(e){return`${e}/`}function Lq(e){return Ee(qr(e))}function Rq(e){return{path:e,pinned:!0,hidden:!1}}function zq(e,t){let n=[...new Set([...e,...t])].sort();return n.length===e.length&&n.every((t,n)=>t===e[n])?e:n}function Bq(e){let t=(0,$.c)(73),{prefix:n,input:r}=e,[i,a]=(0,Z.useState)(0),o;t[0]===n.length?o=t[1]:(o=e=>e.slice(n.length),t[0]=n.length,t[1]=o);let s=o,c,l,u,d,f,p,m,h,g;if(t[2]!==i||t[3]!==r||t[4]!==n||t[5]!==s){let e;t[15]===n?e=t[16]:(e=e=>e.startsWith(n)&&e!==n,t[15]=n,t[16]=e);let o=r.paths.filter(e);h=`flex max-h-52 min-h-0 flex-col pl-1.5`,t[17]===i?g=t[18]:(g={height:i},t[17]=i,t[18]=g),c=rq,l=r.owner,u=r,d=a,f=`${r.owner}:pin:${n}`,p=o.map(s);let _;t[19]!==r.kinds||t[20]!==s?(_=e=>{let t=r.kinds.get(e);return t===void 0?[]:[[s(e),t]]},t[19]=r.kinds,t[20]=s,t[21]=_):_=t[21],m=new Map(o.flatMap(_)),t[2]=i,t[3]=r,t[4]=n,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;if(t[22]!==r.links||t[23]!==n||t[24]!==s){let e;t[26]===n?e=t[27]:(e=e=>e.path.startsWith(n),t[26]=n,t[27]=e);let i;t[28]===s?i=t[29]:(i=e=>({...e,path:s(e.path)}),t[28]=s,t[29]=i),_=r.links.filter(e).map(i),t[22]=r.links,t[23]=n,t[24]=s,t[25]=_}else _=t[25];let v;if(t[30]!==r.gitStatus||t[31]!==n||t[32]!==s){let e;t[34]===n?e=t[35]:(e=e=>e.path.startsWith(n),t[34]=n,t[35]=e);let i;t[36]===s?i=t[37]:(i=e=>({...e,path:s(e.path)}),t[36]=s,t[37]=i),v=r.gitStatus.filter(e).map(i),t[30]=r.gitStatus,t[31]=n,t[32]=s,t[33]=v}else v=t[33];let y;t[38]!==r.selected||t[39]!==n||t[40]!==s?(y=r.selected.startsWith(n)?s(r.selected):``,t[38]=r.selected,t[39]=n,t[40]=s,t[41]=y):y=t[41];let b,x,S,C,w;t[42]!==r||t[43]!==n?(b=e=>r.onRequestRename(`${n}${e}`),x=(e,t)=>r.onCreate(`${n}${e}`,t),S=(e,t)=>r.onMove(`${n}${e}`,`${n}${t}`),C=(e,t)=>r.onSelect(`${n}${e}`,t),w=e=>r.onExpand(e.map(e=>`${n}${e}`)),t[42]=r,t[43]=n,t[44]=b,t[45]=x,t[46]=S,t[47]=C,t[48]=w):(b=t[44],x=t[45],S=t[46],C=t[47],w=t[48]);let T;t[49]!==r||t[50]!==n?(T=(e,t,i)=>r.renderMenu({...e,path:`${n}${e.path}`},t,i),t[49]=r,t[50]=n,t[51]=T):T=t[51];let E;t[52]!==c||t[53]!==_||t[54]!==v||t[55]!==y||t[56]!==b||t[57]!==x||t[58]!==S||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==l||t[63]!==u||t[64]!==d||t[65]!==f||t[66]!==p||t[67]!==m?(E=(0,Q.jsx)(c,{...u,onContentHeight:d,owner:f,paths:p,kinds:m,links:_,gitStatus:v,selected:y,creating:void 0,renameRequest:void 0,onRequestRename:b,onCreate:x,onMove:S,onSelect:C,onExpand:w,bindRename:Hq,bindCollapseAll:Vq,renderMenu:T},l),t[52]=c,t[53]=_,t[54]=v,t[55]=y,t[56]=b,t[57]=x,t[58]=S,t[59]=C,t[60]=w,t[61]=T,t[62]=l,t[63]=u,t[64]=d,t[65]=f,t[66]=p,t[67]=m,t[68]=E):E=t[68];let D;return t[69]!==E||t[70]!==h||t[71]!==g?(D=(0,Q.jsx)(`div`,{className:h,style:g,children:E}),t[69]=E,t[70]=h,t[71]=g,t[72]=D):D=t[72],D}function Vq(){}function Hq(){}var Uq=cz(),Wq={toggle(){Uq.toggle()},close(){Uq.close()}};function Gq(e,t){let n=(0,$.c)(9),{query:r,setQuery:i}=ml(),a;n[0]!==e||n[1]!==t||n[2]!==i?(a=n=>{t.close(),i(``),e(n)},n[0]=e,n[1]=t,n[2]=i,n[3]=a):a=n[3];let o;return n[4]!==t.toggle||n[5]!==r||n[6]!==i||n[7]!==a?(o={query:r,setQuery:i,toggle:t.toggle,select:a},n[4]=t.toggle,n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],o}function Kq(e){let t=(0,$.c)(2);Hu(ou.findFile,qq);let n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(IU,{controller:Uq,title:`Find a file`,description:`Find a file by name, or enter a relative path to open it.`,children:(0,Q.jsx)(Jq,{...e})}),t[0]=e,t[1]=n),n}function qq(){return Wq.toggle()}function Jq(e){let t=(0,$.c)(11),{scope:n,connection:r,openFiles:i,onOpen:a,bindPopup:o}=e,{query:s,setQuery:c,select:l}=Gq(a,Wq),u=WB(r,n.projectId),d=de(qr(u.result)),f=new Set(d?.preferences.filter(Qq).map(Zq)??[]),p=Pl(`${r.environmentId}:${n.projectId}:${n.worktreeId}`).state.showHidden,m=FU,h=Xq,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(LU,{"aria-label":`Find a file by name`,placeholder:`Find a file by name`,onFocus:Yq}),t[0]=g):g=t[0];let _=d===void 0&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:Mi(u.result)?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`block`,children:`File visibility preferences could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`mt-2`,onClick:()=>u.refresh(),children:`Try again`})]}):(0,Q.jsx)(Be,{label:`Reading file visibility`})}),v=d!==void 0&&s.trim()===``&&(0,Q.jsx)($q,{scope:n,connection:r,openFiles:cl(i,f,p),preferences:d.preferences.filter(e=>p||eu(e.path,f)===null),onSelect:l}),y=d!==void 0&&s.trim()!==``&&(0,Q.jsx)(aJ,{scope:n,connection:r,query:s,hidden:f,showHidden:p,onSelect:l}),b;return t[1]!==m||t[2]!==o||t[3]!==s||t[4]!==c||t[5]!==h||t[6]!==g||t[7]!==_||t[8]!==v||t[9]!==y?(b=(0,Q.jsxs)(m,{ref:o,filter:!1,query:s,onQueryChange:c,onEscape:h,children:[g,_,v,y]}),t[1]=m,t[2]=o,t[3]=s,t[4]=c,t[5]=h,t[6]=g,t[7]=_,t[8]=v,t[9]=y,t[10]=b):b=t[10],b}function Yq(e){return e.currentTarget.select()}function Xq(){return Wq.close()}function Zq(e){return e.path}function Qq(e){return e.hidden}function $q(e){let t=(0,$.c)(2),{scope:n,connection:r,openFiles:i,preferences:a,onSelect:o}=e,s=a.filter(iJ),c=zR(r,n,s.length===0?[]:[``,...iu(s)]),l=Zl(s.map(rJ),c.states).filter(nJ).map(tJ),u=[...new Set([...i,...l])],d;return t[0]===c?d=t[1]:(d=c.states.some(eJ)&&(0,Q.jsxs)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:[`Pinned files could not be loaded.`,(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`ml-2`,onClick:()=>c.retry(),children:`Try again`})]}),t[0]=c,t[1]=d),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(RU,{children:u.map(e=>(0,Q.jsx)(oJ,{path:e,onSelect:o},e))}),u.length===0&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:`Type a file name or relative path.`}),d]})}function eJ(e){return e.status===`unavailable`}function tJ(e){let{path:t}=e;return t}function nJ(e){return e.state===`resolved`&&e.entry.kind===`file`}function rJ(e){let{path:t}=e;return t}function iJ(e){return e.pinned}function aJ(e){let t=(0,$.c)(26),{scope:n,connection:r,query:i,hidden:a,showHidden:o,onSelect:s}=e,c=sq(r,n),l,u,d,f,p,m;if(t[0]!==a||t[1]!==c||t[2]!==s||t[3]!==i||t[4]!==o){let e=mu(cl(de(qr(c.result))?.paths??[],a,o),i),n=Ll(i),r=n!==null&&(o||eu(n,a)===null)&&!e.includes(n)?n:null;t[11]===c?f=t[12]:(f=Mi(c.result)&&(0,Q.jsxs)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`block`,children:`Full file search could not be loaded.`}),(0,Q.jsx)(X,{variant:`outline`,size:`xs`,className:`mt-2`,onClick:()=>c.refresh(),children:`Try again`})]}),t[11]=c,t[12]=f),t[13]===c.result?p=t[14]:(p=Xi(c.result)&&(0,Q.jsx)(`div`,{className:`p-3`,children:(0,Q.jsx)(Be,{label:`Reading file names`})}),t[13]=c.result,t[14]=p),m=!Xi(c.result)&&!Mi(c.result)&&e.length===0&&r===null&&(0,Q.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:`No file matches that name.`}),l=RU,u=r!==null&&(0,Q.jsxs)(VU,{value:r,onSelect:()=>s(r),children:[`Open path `,r]});let h;t[15]===s?h=t[16]:(h=e=>(0,Q.jsx)(oJ,{path:e,onSelect:s},e),t[15]=s,t[16]=h),d=e.map(h),t[0]=a,t[1]=c,t[2]=s,t[3]=i,t[4]=o,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m}else l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10];let h;t[17]!==l||t[18]!==u||t[19]!==d?(h=(0,Q.jsxs)(l,{children:[u,d]}),t[17]=l,t[18]=u,t[19]=d,t[20]=h):h=t[20];let g;return t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,m,h]}),t[21]=f,t[22]=p,t[23]=m,t[24]=h,t[25]=g):g=t[25],g}function oJ(e){let t=(0,$.c)(11),{path:n,onSelect:r}=e,i=n.lastIndexOf(`/`)+1,a;t[0]!==r||t[1]!==n||t[2]!==i?(a=(e,t)=>(0,Q.jsxs)(VU,{value:n,"aria-label":n,onSelect:()=>r(n),children:[e,i>0&&t(n.slice(0,i-1),`shrink-[100] text-muted-foreground`)]}),t[0]=r,t[1]=n,t[2]=i,t[3]=a):a=t[3];let o;t[4]!==n||t[5]!==i?(o=n.slice(i),t[4]=n,t[5]=i,t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==a||t[9]!==o?(s=(0,Q.jsx)(fr,{text:n,className:`min-w-0`,renderTrigger:a,children:o}),t[7]=n,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function sJ(e,t,n){let r=(0,$.c)(7),i;r[0]!==e||r[1]!==t?(i=jl({draft:e,viewer:t}),r[0]=e,r[1]=t,r[2]=i):i=r[2],Lt(i);let a;r[3]!==e||r[4]!==n||r[5]!==t?(a=Qc({draft:e,viewer:t,fingerprint:n}),r[3]=e,r[4]=n,r[5]=t,r[6]=a):a=r[6],Lt(a)}var cJ=`porcelain:quit-check`;L([`open-project`,`open-settings`]),L([`system`,`light`,`dark`]),L([`suspend`,`resume`]),g([Ut({status:An(`idle`)}),Ut({status:An(`checking`)}),Ut({status:An(`unavailable`)}),Ut({status:An(`available`),version:J}),Ut({status:An(`downloading`),version:J}),Ut({status:An(`ready`),version:J}),Ut({status:An(`installing`),version:J}),Ut({status:An(`error`),message:J})]),g([Ut({status:An(`empty`)}),Ut({status:An(`saved`),value:J}),Ut({status:An(`unreadable`),message:J})]),Ut({bounds:Ut({x:Ln.check(Ac()),y:Ln.check(Ac()),width:Ln.check(Ac()).check(yn(0)),height:Ln.check(Ac()).check(yn(0))}),maximized:fi});var lJ=dt(({connection:e,environmentIds:t})=>Oe(n=>{if(!e||t.length===0)return;let r=n(Gt(e)),i=de(qr(r));if(!i)return;let a=e=>{i.hasUnsaved(t)&&e.preventDefault()};window.addEventListener(`beforeunload`,a),window.addEventListener(cJ,a),n.addFinalizer(()=>{window.removeEventListener(`beforeunload`,a),window.removeEventListener(cJ,a)})}));function uJ(e,t){let n=(0,$.c)(3),r;n[0]!==e||n[1]!==t?(r=lJ({connection:e,environmentIds:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],Lt(r)}function dJ(){return new zj({poolSize:4,workerFactory:()=>new Worker(new URL(`/assets/pierre-worker-COmT0LXL.js`,``+import.meta.url),{type:`module`})},{theme:Qu,preferredHighlighter:Gu})}function fJ(e){let t=(0,$.c)(6),{children:n}=e,[r,i]=(0,Z.useState)(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>e=>{if(!e)return;let t=dJ();return i(t),()=>t.terminate()},t[0]=a):a=t[0];let[o]=(0,Z.useState)(a),s;t[1]!==n||t[2]!==r?(s=r&&(0,Q.jsx)(Kj,{value:r,children:n}),t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]===s?c=t[5]:(c=(0,Q.jsx)(`div`,{ref:o,className:`contents`,children:s}),t[4]=s,t[5]=c),c}var pJ=_s(`Comments.read`)(function*({connection:e,scope:t}){return yield*zn(e,e=>e.comments.listComments({params:{worktreeId:t.worktreeId}}))}),mJ=dt(e=>et(e.connection,e.scope,[`comments`],pJ(e),Xn(e.connection)).pipe(sr));function hJ(e,t){return{connection:e,scope:{projectId:t.projectId,worktreeId:t.worktreeId}}}function gJ(e){return{view:de(qr(e)),failed:Mi(e),waiting:e.waiting}}function _J(e){return(e?.comments??[]).filter(e=>e.publication.status===`draft`)}function vJ(e){return e.kind===`lines`||e.kind===`file`?e.path:void 0}function yJ(e){let t=new Map;for(let n of _J(e)){let e=vJ(n.anchor);e!==void 0&&t.set(e,(t.get(e)??0)+1)}return t}function bJ(e,t){return _J(e).filter(e=>t(e.anchor))}function xJ(e,t){return e===t?`Line ${e}`:`Lines ${e}–${t}`}function SJ(e){switch(e.kind){case`lines`:return`${e.path} · ${e.side===`deletions`?`removed `:``}${xJ(e.start,e.end).toLowerCase()}`;case`file`:return e.path;case`step`:return`Step · ${e.title}`;case`node`:return`${e.node} · ${e.title}`}}function CJ(e){switch(e){case`no-pull-request`:return`This branch has no open pull request. Push it and open one, or copy the comments for an agent.`;case`no-comments`:return`There are no open comments to post.`;case`not-github`:return`This project is not on GitHub.`;case`gh-not-installed`:return`Install the GitHub CLI (gh) on the connected computer to post reviews.`;case`no-accounts`:case`no-access`:return`Sign in to GitHub with gh on the connected computer to post reviews.`;case`rate-limited`:return`GitHub is rate limiting requests. Try again in a few minutes.`;case`pull-request-not-found`:return`The pull request could not be found.`;case`offline`:case`invalid-response`:return`GitHub could not be reached. Try again.`}}function wJ(e){let t=new Set(e.flatMap(e=>{let t=vJ(e.anchor);return t===void 0?[]:[t]})).size,n=e.filter(e=>vJ(e.anchor)===void 0).length;return[t>0?`on ${t} ${t===1?`file`:`files`}`:``,n>0?`${n} on the Walkthrough`:``].filter(Boolean).join(`, `)}function TJ(e){return e===1?`1 draft comment`:`${e} draft comments`}function EJ(e){return(e?.comments??[]).filter(e=>e.publication.status===`published`)}function DJ(e){let t=e.startLine===void 0?``:`${e.startLine}-`,n=e.side===`LEFT`?` (removed)`:``;return`${e.path}:${t}${e.line}${n}`}var OJ={"not-in-pull-request":`not in the pull request diff`,outdated:`outdated`,file:`whole file`,step:void 0,node:void 0};function kJ(e){return OJ[e]}function AJ(e){return Object.fromEntries([...e.inline,...e.general].map(e=>[e.id,e.body]))}function jJ(e){let t=Object.entries(e).map(([e,t])=>[e,t.trim()]);return t.some(([,e])=>e.length===0)?void 0:Object.fromEntries(t)}function MJ(e){return{summary:``,bodies:AJ(e)}}function NJ(e,t,n){return{...e,bodies:{...e.bodies,[t]:n}}}function PJ(e,t){let n=jJ(e.bodies);if(n===void 0)return;let{owner:r,repo:i,number:a}=t.pullRequest;return{pullRequest:{owner:r,repo:i,number:a},headOid:t.headOid,summary:e.summary,bodies:n}}var FJ=300;function IJ(e,t){return typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0&&e.message.length<FJ?e.message:t}function LJ(e,t){return`> ${e.replaceAll(`
1344
+ `,`
1345
+ > `)}\n\n${t}`}function RJ(e,t){let n=new Map;for(let r of _J(e))r.anchor.kind===`node`&&r.anchor.title===t&&n.set(r.anchor.node,(n.get(r.anchor.node)??0)+1);return n}var zJ=`GitHub may have received this review. Check the pull request before posting again.`,BJ=new Set([`ReviewChangedError`,`PullRequestReviewFailedError`]);function VJ(e){return Ho(e)?{message:$e,showPullRequest:!1}:{message:typeof e==`object`&&e&&`name`in e&&typeof e.name==`string`&&BJ.has(e.name)?IJ(e,zJ):zJ,showPullRequest:!0}}var HJ=dt(({connection:e,scope:t})=>{let n=Xn(e),r=t.worktreeId,i=lt.reviewSurface(e.environmentId,t,[`comments`]),a=Bi([i]);return{add:n.fn(_s(`Comments.add`)(function*(t){let n=yield*zn(e,e=>e.comments.addComment({params:{worktreeId:r},payload:t}));return yield*a,n})),edit:n.fn(_s(`Comments.edit`)(function*(t){let n=yield*zn(e,e=>e.comments.editComment({params:{worktreeId:r,commentId:t.commentId},payload:{text:t.text}}));return yield*a,n})),remove:n.fn(_s(`Comments.remove`)(function*(t){let n=yield*zn(e,e=>e.comments.deleteComment({params:{worktreeId:r,commentId:t}}));return yield*a,n})),preview:n.fn(_s(`Comments.preview`)(function*(){return yield*zn(e,e=>e.comments.previewCommentReview({params:{worktreeId:r}}))})),publish:n.fn(_s(`Comments.publish`)(function*(n){let a=yield*zn(e,e=>e.comments.publishCommentReview({params:{worktreeId:r},payload:n}));return yield*Bi([i,lt.projectPullRequests(e.environmentId,t.projectId)]),a}))}});function UJ([e,t]){return{waiting:lo(e),run:async e=>{let n=await t(e);if(Mn(n))throw Ra(n.cause);return n.value}}}function WJ([e,t],n){return{summary:e.summary,body:t=>e.bodies[t]??``,setSummary:e=>t(t=>({...t,summary:e})),edit:e=>n=>t(t=>NJ(t,e,n)),request:PJ(e,n)}}function GJ({scope:e,context:t}){return hJ(t.connection,e)}function KJ(e){let t=(0,$.c)(7),n;t[0]===e?n=t[1]:(n=mJ(GJ(e)),t[0]=e,t[1]=n);let r=n,i=Ot(r),a;t[2]===i?a=t[3]:(a=gJ(i),t[2]=i,t[3]=a);let o=l(r),s;return t[4]!==a||t[5]!==o?(s={...a,refresh:o},t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function qJ(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={mode:`promiseExit`},t[0]=n):n=t[0];let r=B(e,n),i;return t[1]===r?i=t[2]:(i=UJ(r),t[1]=r,t[2]=i),i}function JJ(e){let t=(0,$.c)(8),n;t[0]===e?n=t[1]:(n=HJ(GJ(e)),t[0]=e,t[1]=n);let r=n,i=qJ(r.add),a=qJ(r.edit),o=qJ(r.remove),s=qJ(r.preview),c=qJ(r.publish),l;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s||t[6]!==c?(l={add:i,edit:a,remove:o,preview:s,publish:c},t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l):l=t[7],l}function YJ(e,t){let n=(0,$.c)(8),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(),s;n[0]!==t||n[1]!==e||n[2]!==r?(s=async n=>{if(e&&!r){i(!0),o(void 0);try{await e(n),t()}catch(e){o(IJ(e,`The comment was not saved. Try again.`))}i(!1)}},n[0]=t,n[1]=e,n[2]=r,n[3]=s):s=n[3];let c;return n[4]!==a||n[5]!==s||n[6]!==r?(c={waiting:r,failure:a,submit:s},n[4]=a,n[5]=s,n[6]=r,n[7]=c):c=n[7],c}function XJ(e,t){let n=(0,$.c)(7),{preview:r}=JJ(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async()=>{a(void 0);try{let e=await r.run(void 0);e.kind===`available`?t(e):a(CJ(e.reason))}catch(e){a(IJ(e,`GitHub could not be read.`))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==r.waiting||n[4]!==o||n[5]!==i?(s={unavailable:i,waiting:r.waiting,read:o},n[3]=r.waiting,n[4]=o,n[5]=i,n[6]=s):s=n[6],s}function ZJ(e,t){let n=(0,$.c)(7),{publish:r}=JJ(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async e=>{a(void 0);try{t((await r.run(e)).url)}catch(e){a(VJ(e))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==i||n[4]!==r.waiting||n[5]!==o?(s={failure:i,waiting:r.waiting,post:o},n[3]=i,n[4]=r.waiting,n[5]=o,n[6]=s):s=n[6],s}function QJ(e,t){let n=(0,$.c)(7),{remove:r}=JJ(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async()=>{a(void 0);try{await r.run(t)}catch(e){a(IJ(e,`The comment was not deleted.`))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==i||n[4]!==r.waiting||n[5]!==o?(s={failure:i,waiting:r.waiting,remove:o},n[3]=i,n[4]=r.waiting,n[5]=o,n[6]=s):s=n[6],s}var $J=dt(e=>Oe(!1));function eY(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=$J(e),t[0]=e,t[1]=n),B(n)}var tY=8e3;function nY(e){let t=(0,$.c)(31),{owner:n,initial:r,label:i,submitLabel:a,onSaved:o,onSubmit:s,onClose:c}=e,l=r===void 0?``:r,u=a===void 0?`Comment`:a,[d,f]=(0,Z.useState)(l),{waiting:p,failure:m,submit:h}=YJ(s,o??c),g=na(n.context),_;t[0]===d?_=t[1]:(_=d.trim(),t[0]=d,t[1]=_);let v=_,y;t[2]!==h||t[3]!==v||t[4]!==p||t[5]!==g?(y=()=>{!v||p||g||h(v)},t[2]=h,t[3]=v,t[4]=p,t[5]=g,t[6]=y):y=t[6];let b=y,x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>f(e.target.value),t[7]=x):x=t[7];let S;t[8]!==c||t[9]!==b?(S=e=>{e.key===`Escape`&&(e.preventDefault(),c()),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),b())},t[8]=c,t[9]=b,t[10]=S):S=t[10];let C;t[11]!==i||t[12]!==S||t[13]!==d?(C=(0,Q.jsx)(gH,{autoFocus:!0,value:d,maxLength:tY,rows:2,"aria-label":i,placeholder:`Leave a comment`,className:`min-h-14`,onChange:x,onKeyDown:S}),t[11]=i,t[12]=S,t[13]=d,t[14]=C):C=t[14];let w;t[15]===m?w=t[16]:(w=m&&(0,Q.jsx)(`p`,{role:`alert`,className:`mr-auto text-caption text-destructive`,children:m}),t[15]=m,t[16]=w);let T;t[17]===c?T=t[18]:(T=(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,onClick:c,children:`Cancel`}),t[17]=c,t[18]=T);let E=!v||p||!!g,D;t[19]!==b||t[20]!==u||t[21]!==E||t[22]!==g?(D=(0,Q.jsx)(X,{size:`sm`,disabled:E,"aria-description":g,onClick:b,children:u}),t[19]=b,t[20]=u,t[21]=E,t[22]=g,t[23]=D):D=t[23];let O;t[24]!==D||t[25]!==w||t[26]!==T?(O=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[w,T,D]}),t[24]=D,t[25]=w,t[26]=T,t[27]=O):O=t[27];let k;return t[28]!==O||t[29]!==C?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 font-sans`,"data-comment-composer":``,children:[C,O]}),t[28]=O,t[29]=C,t[30]=k):k=t[30],k}function rY(e){let t=(0,$.c)(14),{label:n,icon:r,disabled:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":n,disabled:i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Q.jsx)(r,{}),t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsx)(Ze,{render:o,children:s}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]===n?l=t[10]:(l=(0,Q.jsx)(Yo,{children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(ot,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function iY(e){let t=(0,$.c)(8),{owner:n,anchor:r,navigate:i}=e,a=vB(n.scope,n.context.connection,n.base).result,o=iB(n.scope,n.context.connection);if(!Bo(a)||!Bo(o))return null;let s;if(t[0]!==r||t[1]!==a.value.files){let e;t[3]===r?e=t[4]:(e=e=>e.path===r.path,t[3]=r,t[4]=e),s=a.value.files.some(e),t[0]=r,t[1]=a.value.files,t[2]=s}else s=t[2];let c=s;if(c===o.value.changes.some(e=>e.path===r.path))return null;let l;return t[5]!==c||t[6]!==i?(l=(0,Q.jsx)(aY,{onClick:()=>i(c?`branch-file`:`change`)}),t[5]=c,t[6]=i,t[7]=l):l=t[7],l}function aY(e){let t=(0,$.c)(2),{onClick:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(X,{size:`xs`,variant:`link`,onClick:n,children:`Go to lines`}),t[0]=n,t[1]=r),r}function oY(e){let t=(0,$.c)(49),{owner:n,comment:r,location:i,onLeave:a}=e,[o,s]=(0,Z.useState)(!1),{failure:c,waiting:l,remove:u}=QJ(n,r.id),d=JJ(n),f=na(n.context),p=r.publication.status===`published`,m=r.anchor,h=m.kind===`lines`?m.surface:void 0,g;t[0]!==m||t[1]!==a||t[2]!==n?(g=e=>{m.kind===`lines`&&n.jump&&(a?.(),n.jump(m,e))},t[0]=m,t[1]=a,t[2]=n,t[3]=g):g=t[3];let _=g;if(o){let e;t[4]!==d.edit||t[5]!==r.id?(e=e=>d.edit.run({commentId:r.id,text:e}),t[4]=d.edit,t[5]=r.id,t[6]=e):e=t[6];let i;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>s(!1),t[7]=i):i=t[7];let a;return t[8]!==r.text||t[9]!==n||t[10]!==e?(a=(0,Q.jsx)(nY,{owner:n,initial:r.text,label:`Edit comment`,submitLabel:`Save`,onSubmit:e,onClose:i}),t[8]=r.text,t[9]=n,t[10]=e,t[11]=a):a=t[11],a}let v=i?`Comment on ${i}`:`Comment`,y;t[12]!==r.anchor||t[13]!==i?(y=i&&(0,Q.jsx)(fr,{className:Y(`min-w-0 text-foreground-2`,(r.anchor.kind===`lines`||r.anchor.kind===`file`)&&`font-mono`),text:i}),t[12]=r.anchor,t[13]=i,t[14]=y):y=t[14];let b;t[15]!==r.publication.status||t[16]!==r.publication.url||t[17]!==p?(b=p&&r.publication.status===`published`?(0,Q.jsx)(`a`,{href:r.publication.url,target:`_blank`,rel:`noreferrer`,className:`hover:underline`,children:`Posted`}):(0,Q.jsx)(`span`,{children:`Draft`}),t[15]=r.publication.status,t[16]=r.publication.url,t[17]=p,t[18]=b):b=t[18];let x;t[19]===r.outdated?x=t[20]:(x=r.outdated&&(0,Q.jsx)(`span`,{className:`text-warn`,children:`Outdated · the lines changed`}),t[19]=r.outdated,t[20]=x);let S;t[21]!==p||t[22]!==u||t[23]!==l||t[24]!==f?(S=!p&&(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center`,children:[(0,Q.jsx)(rY,{label:`Edit comment`,icon:ao,disabled:!!f,onClick:()=>s(!0)}),(0,Q.jsx)(rY,{label:`Delete comment`,icon:N_,disabled:!!f||l,onClick:()=>void u()})]}),t[21]=p,t[22]=u,t[23]=l,t[24]=f,t[25]=S):S=t[25];let C;t[26]!==y||t[27]!==b||t[28]!==x||t[29]!==S?(C=(0,Q.jsxs)(`header`,{className:`flex min-h-6 items-center gap-2 text-caption text-muted-foreground`,children:[y,b,x,S]}),t[26]=y,t[27]=b,t[28]=x,t[29]=S,t[30]=C):C=t[30];let w;t[31]===r.text?w=t[32]:(w=(0,Q.jsx)(`p`,{className:`text-ui whitespace-pre-wrap text-foreground`,children:r.text}),t[31]=r.text,t[32]=w);let T;t[33]!==m||t[34]!==r.outdated||t[35]!==i||t[36]!==_||t[37]!==n||t[38]!==h?(T=n.jump&&i&&m.kind===`lines`&&!r.outdated&&(h?(0,Q.jsx)(aY,{onClick:()=>_(h)}):(0,Q.jsx)(iY,{owner:n,anchor:m,navigate:_})),t[33]=m,t[34]=r.outdated,t[35]=i,t[36]=_,t[37]=n,t[38]=h,t[39]=T):T=t[39];let E;t[40]===c?E=t[41]:(E=c&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:c}),t[40]=c,t[41]=E);let D;return t[42]!==r.id||t[43]!==E||t[44]!==v||t[45]!==C||t[46]!==w||t[47]!==T?(D=(0,Q.jsxs)(`article`,{"aria-label":v,"data-draft-comment":r.id,className:`flex flex-col gap-1 rounded-md border bg-card px-3 py-2 font-sans`,children:[C,w,T,E]}),t[42]=r.id,t[43]=E,t[44]=v,t[45]=C,t[46]=w,t[47]=T,t[48]=D):D=t[48],D}function sY(e){let t=(0,$.c)(18),{owner:n,drafts:r,anchor:i,composing:a,onClose:o,className:s}=e,c=JJ(n),[,l]=eY(n.scope.worktreeId);if(r.length===0&&!a)return null;let u;t[0]===s?u=t[1]:(u=Y(`flex flex-col gap-2`,s),t[0]=s,t[1]=u);let d;if(t[2]!==r||t[3]!==n){let e;t[5]===n?e=t[6]:(e=e=>(0,Q.jsx)(oY,{owner:n,comment:e},e.id),t[5]=n,t[6]=e),d=r.map(e),t[2]=r,t[3]=n,t[4]=d}else d=t[4];let f;t[7]!==i||t[8]!==c||t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==l?(f=a&&i&&(0,Q.jsx)(nY,{owner:n,label:`New comment`,onSubmit:e=>c.add.run({anchor:i,text:e}),onClose:o,onSaved:()=>{o(),ks({title:`Saved as draft`,type:`success`,actionProps:{children:`View comment`,onClick:()=>l(!0)}})}}),t[7]=i,t[8]=c,t[9]=a,t[10]=o,t[11]=n,t[12]=l,t[13]=f):f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,Q.jsxs)(`div`,{className:u,children:[d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}var cY=e=>e?.replace(/\r?\n$/,``);function lY(e,t,n){let r=t===`additions`?e.additionLines:e.deletionLines;if(!e.isPartial)return cY(r[n-1]);for(let i of e.hunks){let e=t===`additions`?i.additionStart:i.deletionStart,a=t===`additions`?i.additionCount:i.deletionCount,o=t===`additions`?i.additionLineIndex:i.deletionLineIndex;if(n>=e&&n<e+a)return cY(r[o+n-e])}}function uY(e,t){let n=[];for(let r=t.start;r<=t.end;r+=1)n.push(lY(e,t.side,r)??``);return n.join(`
1346
+ `)}function dY(e,t){return e.split(/\r?\n/).slice(t.start-1,t.end).join(`
1347
+ `)}function fY(e){let t=e.side??`additions`;if((e.endSide??t)===t)return{side:t,start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function pY(e){let t=(0,$.c)(42),{owner:n,path:r,composing:i,onCompose:a,onClose:o}=e,{view:s}=KJ(n),c,l,u,d,f,p,m,h;if(t[0]!==o||t[1]!==n||t[2]!==r||t[3]!==s){let e=r===void 0?[]:bJ(s,e=>vJ(e)===r);l=vz,m=r!==void 0,t[12]===o?h=t[13]:(h=e=>{e||o()},t[12]=o,t[13]=h),c=xz,f=`sm:max-w-[min(92vw,34rem)]`,t[14]===r?p=t[15]:(p=(0,Q.jsx)(Sz,{children:(0,Q.jsx)(wz,{children:(0,Q.jsx)(`span`,{className:`font-mono text-ui`,children:r})})}),t[14]=r,t[15]=p),u=`max-h-[50vh] space-y-2 overflow-auto`;let i;t[16]!==o||t[17]!==n?(i=e=>(0,Q.jsx)(oY,{owner:n,comment:e,location:SJ(e.anchor),onLeave:o},e.id),t[16]=o,t[17]=n,t[18]=i):i=t[18],d=e.map(i),t[0]=o,t[1]=n,t[2]=r,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h}else c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11];let g;t[19]!==u||t[20]!==d?(g=(0,Q.jsx)(`div`,{className:u,children:d}),t[19]=u,t[20]=d,t[21]=g):g=t[21];let _;t[22]!==i||t[23]!==a?(_=!i&&(0,Q.jsx)(X,{size:`sm`,variant:`outline`,onClick:a,children:`Add file comment`}),t[22]=i,t[23]=a,t[24]=_):_=t[24];let v;t[25]!==i||t[26]!==o||t[27]!==n||t[28]!==r?(v=i&&r!==void 0&&(0,Q.jsx)(sY,{owner:n,drafts:[],anchor:{kind:`file`,path:r},composing:!0,onClose:o}),t[25]=i,t[26]=o,t[27]=n,t[28]=r,t[29]=v):v=t[29];let y;t[30]!==c||t[31]!==f||t[32]!==p||t[33]!==g||t[34]!==_||t[35]!==v?(y=(0,Q.jsxs)(c,{className:f,children:[p,g,_,v]}),t[30]=c,t[31]=f,t[32]=p,t[33]=g,t[34]=_,t[35]=v,t[36]=y):y=t[36];let b;return t[37]!==l||t[38]!==y||t[39]!==m||t[40]!==h?(b=(0,Q.jsx)(l,{open:m,onOpenChange:h,children:y}),t[37]=l,t[38]=y,t[39]=m,t[40]=h,t[41]=b):b=t[41],b}function mY(e){let t=(0,$.c)(20),{view:n}=KJ(e),[r,i]=(0,Z.useState)(),[,a]=eY(e.scope.worktreeId),o;t[0]===n?o=t[1]:(o=_J(n),t[0]=n,t[1]=o);let s=o.length,c;t[2]===n?c=t[3]:(c=yJ(n),t[2]=n,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(e,t)=>i({path:e,composing:t}),t[4]=l):l=t[4];let u;t[5]!==s||t[6]!==a?(u=s>0?(0,Q.jsx)(`div`,{className:`shrink-0 border-b px-2 py-1`,children:(0,Q.jsxs)(X,{size:`xs`,variant:`ghost`,onClick:()=>a(!0),children:[`Comments (`,s,`)`]})}):null,t[5]=s,t[6]=a,t[7]=u):u=t[7];let d=r?.path,f=r?.composing??!1,p;t[8]===r?p=t[9]:(p=()=>{r&&i({...r,composing:!0})},t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>i(void 0),t[10]=m):m=t[10];let h;t[11]!==e||t[12]!==d||t[13]!==f||t[14]!==p?(h=(0,Q.jsx)(pY,{owner:e,path:d,composing:f,onCompose:p,onClose:m}),t[11]=e,t[12]=d,t[13]=f,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==c||t[17]!==u||t[18]!==h?(g={counts:c,comment:l,summary:u,dialogs:h},t[16]=c,t[17]=u,t[18]=h,t[19]=g):g=t[19],g}function hY(e){let t=(0,$.c)(23),{owner:n}=e,{view:r}=KJ(n),[,i]=eY(n.scope.worktreeId),a,o,s,c;if(t[0]!==i||t[1]!==r){let e=_J(r);a=e.length;let n;t[6]===r?n=t[7]:(n=EJ(r),t[6]=r,t[7]=n),o=n.length;let l;t[8]===a?l=t[9]:(l=TJ(a),t[8]=a,t[9]=l);let u=l,d;t[10]===i?d=t[11]:(d=(e,t)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`-mx-2 flex min-h-7 items-baseline gap-2 rounded-md px-2 py-1 text-left text-ui hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,Q.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:t})]}),t[10]=i,t[11]=d),s=d,c=a>0&&s((0,Q.jsxs)(Q.Fragment,{children:[u,(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,wJ(e)]})]}),`View comments`),t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c}else a=t[2],o=t[3],s=t[4],c=t[5];let l;t[12]!==a||t[13]!==o||t[14]!==s?(l=a===0&&o>0&&s((0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:o===1?`1 comment posted`:`${o} comments posted`}),`Show`),t[12]=a,t[13]=o,t[14]=s,t[15]=l):l=t[15];let u;t[16]!==a||t[17]!==o?(u=a===0&&o===0&&(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:`No draft comments`}),t[16]=a,t[17]=o,t[18]=u):u=t[18];let d;return t[19]!==c||t[20]!==l||t[21]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[c,l,u]}),t[19]=c,t[20]=l,t[21]=u,t[22]=d):d=t[22],d}var gY=`porcelain comments`;function _Y(e){e?.focus()}function vY(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({arrived:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=n?_Y:void 0,a;return t[3]!==r||t[4]!==i?(a=(0,Q.jsx)(wz,{ref:i,tabIndex:-1,className:`outline-none`,...r}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function yY(e){let t=(0,$.c)(12),{title:n,detail:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`span`,{className:`text-ui font-medium`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,Q.jsx)(`span`,{className:`shrink-0`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 border-t px-4 py-3 first:border-t-0`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function bY(e){let t=(0,$.c)(19),{location:n,code:r,note:i,value:a,onChange:o}=e,s=(r===void 0||r)&&`font-mono`,c;t[0]===s?c=t[1]:(c=Y(`min-w-0 text-foreground-2`,s),t[0]=s,t[1]=c);let l;t[2]!==n||t[3]!==c?(l=(0,Q.jsx)(fr,{className:c,text:n}),t[2]=n,t[3]=c,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i&&(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:i}),t[5]=i,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-2 text-caption`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=`Comment on ${n}`,p;t[10]===o?p=t[11]:(p=e=>o(e.target.value),t[10]=o,t[11]=p);let m;t[12]!==f||t[13]!==p||t[14]!==a?(m=(0,Q.jsx)(gH,{value:a,"aria-label":f,className:`min-h-10`,onChange:p}),t[12]=f,t[13]=p,t[14]=a,t[15]=m):m=t[15];let h;return t[16]!==d||t[17]!==m?(h=(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[d,m]}),t[16]=d,t[17]=m,t[18]=h):h=t[18],h}function xY(e){let t=(0,$.c)(52),{arrived:n,owner:r,preview:i,onBack:a,onPosted:o}=e,{failure:s,waiting:c,post:l}=ZJ(r,o),u=na(r.context),d;t[0]===i?d=t[1]:(d=()=>MJ(i),t[0]=i,t[1]=d);let f=(0,Z.useState)(d),p;t[2]!==i||t[3]!==f?(p=WJ(f,i),t[2]=i,t[3]=f,t[4]=p):p=t[4];let m=p,h;t[5]!==n||t[6]!==i.pullRequest.number||t[7]!==i.pullRequest.title?(h=(0,Q.jsxs)(vY,{arrived:n,children:[`Review on #`,i.pullRequest.number,` · `,i.pullRequest.title]}),t[5]=n,t[6]=i.pullRequest.number,t[7]=i.pullRequest.title,t[8]=h):h=t[8];let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(Tz,{children:`These drafts will be posted as one review if they are still open.`}),t[9]=g):g=t[9];let _;t[10]===h?_=t[11]:(_=(0,Q.jsxs)(Sz,{children:[h,g]}),t[10]=h,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Summary`}),t[12]=v):v=t[12];let y;t[13]===m?y=t[14]:(y=e=>m.setSummary(e.target.value),t[13]=m,t[14]=y);let b;t[15]!==m.summary||t[16]!==y?(b=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[v,(0,Q.jsx)(gH,{value:m.summary,placeholder:`Optional`,className:`min-h-10`,onChange:y})]}),t[15]=m.summary,t[16]=y,t[17]=b):b=t[17];let x;t[18]!==i.inline||t[19]!==m?(x=i.inline.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:[`On their lines · `,i.inline.length]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.inline.map(e=>(0,Q.jsx)(bY,{location:DJ(e),value:m.body(e.id),onChange:m.edit(e.id)},e.id))})]}),t[18]=i.inline,t[19]=m,t[20]=x):x=t[20];let S;t[21]!==i.general||t[22]!==m?(S=i.general.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:[`In the review body · `,i.general.length]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.general.map(e=>(0,Q.jsx)(bY,{location:e.location,code:e.reason!==`step`&&e.reason!==`node`,note:kJ(e.reason),value:m.body(e.id),onChange:m.edit(e.id)},e.id))})]}),t[21]=i.general,t[22]=m,t[23]=S):S=t[23];let C;t[24]!==x||t[25]!==S||t[26]!==b?(C=(0,Q.jsxs)(`div`,{className:`-mx-1 flex max-h-[60vh] flex-col gap-4 overflow-auto px-1`,children:[b,x,S]}),t[24]=x,t[25]=S,t[26]=b,t[27]=C):C=t[27];let w;t[28]===s?w=t[29]:(w=s&&(0,Q.jsx)(`p`,{role:`alert`,className:`mr-auto text-caption text-destructive`,children:s.message}),t[28]=s,t[29]=w);let T;t[30]!==s?.showPullRequest||t[31]!==i.pullRequest.url?(T=s?.showPullRequest&&(0,Q.jsxs)(X,{variant:`outline`,render:(0,Q.jsx)(`a`,{href:i.pullRequest.url,target:`_blank`,rel:`noreferrer`}),children:[`Open pull request`,(0,Q.jsx)(Uh,{"data-icon":`inline-end`})]}),t[30]=s?.showPullRequest,t[31]=i.pullRequest.url,t[32]=T):T=t[32];let E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(_h,{"data-icon":`inline-start`}),t[33]=E):E=t[33];let D;t[34]===a?D=t[35]:(D=(0,Q.jsxs)(X,{variant:`ghost`,onClick:a,children:[E,`Back`]}),t[34]=a,t[35]=D);let O=!m.request||c||!!u,k;t[36]!==l||t[37]!==m.request?(k=()=>{m.request&&l(m.request)},t[36]=l,t[37]=m.request,t[38]=k):k=t[38];let A;t[39]!==O||t[40]!==k||t[41]!==u?(A=(0,Q.jsx)(X,{disabled:O,"aria-description":u,onClick:k,children:`Post review`}),t[39]=O,t[40]=k,t[41]=u,t[42]=A):A=t[42];let j;t[43]!==w||t[44]!==T||t[45]!==D||t[46]!==A?(j=(0,Q.jsxs)(Cz,{children:[w,T,D,A]}),t[43]=w,t[44]=T,t[45]=D,t[46]=A,t[47]=j):j=t[47];let M;return t[48]!==C||t[49]!==j||t[50]!==_?(M=(0,Q.jsxs)(Q.Fragment,{children:[_,C,j]}),t[48]=C,t[49]=j,t[50]=_,t[51]=M):M=t[51],M}function SY(e){let t=(0,$.c)(25),{arrived:n,owner:r,count:i,markdown:a,onBack:o,onReview:s}=e,{unavailable:c,waiting:l,read:u}=XJ(r,s),d=i===1?`1 comment`:`${i} comments`,f;t[0]!==n||t[1]!==d?(f=(0,Q.jsx)(Sz,{children:(0,Q.jsxs)(vY,{arrived:n,children:[`Publish review · `,d]})}),t[0]=n,t[1]=d,t[2]=f):f=t[2];let p=c??`One review, each comment on its file and line.`,m;t[3]===u?m=t[4]:(m=()=>void u(),t[3]=u,t[4]=m);let h;t[5]!==m||t[6]!==l?(h=(0,Q.jsx)(X,{size:`sm`,disabled:l,onClick:m,children:`Preview review`}),t[5]=m,t[6]=l,t[7]=h):h=t[7];let g;t[8]!==p||t[9]!==h?(g=(0,Q.jsx)(yY,{title:`Review on the pull request`,detail:p,action:h}),t[8]=p,t[9]=h,t[10]=g):g=t[10];let _;t[11]===a?_=t[12]:(_=(0,Q.jsx)(yY,{title:`Copy for an agent`,detail:`Markdown with each file, line range and the head commit.`,action:(0,Q.jsx)(X,{size:`sm`,variant:`outline`,onClick:()=>Zt(a,`comments`),children:`Copy Markdown`})}),t[11]=a,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`code`,{className:`font-mono text-foreground`,children:gY}),t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(yY,{title:`From the CLI`,detail:(0,Q.jsxs)(Q.Fragment,{children:[`Run `,v,` `,`in this worktree. Add`,` `,(0,Q.jsx)(`code`,{className:`font-mono text-foreground`,children:`--json`}),` for JSON.`]}),action:(0,Q.jsx)(X,{size:`sm`,variant:`outline`,onClick:CY,children:`Copy command`})}),t[14]=y):y=t[14];let b;t[15]!==g||t[16]!==_?(b=(0,Q.jsxs)(`ul`,{className:`flex flex-col rounded-lg border`,children:[g,_,y]}),t[15]=g,t[16]=_,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(_h,{"data-icon":`inline-start`}),t[18]=x):x=t[18];let S;t[19]===o?S=t[20]:(S=(0,Q.jsx)(Cz,{children:(0,Q.jsxs)(X,{variant:`ghost`,className:`mr-auto`,onClick:o,children:[x,`Comments`]})}),t[19]=o,t[20]=S);let C;return t[21]!==b||t[22]!==S||t[23]!==f?(C=(0,Q.jsxs)(Q.Fragment,{children:[f,b,S]}),t[21]=b,t[22]=S,t[23]=f,t[24]=C):C=t[24],C}function CY(){return Zt(gY,`the command`)}function wY(e){let t=(0,$.c)(45),{arrived:n,owner:r,onPublish:i,onClose:a}=e,{view:o,failed:s,refresh:c}=KJ(r),l,u,d,f,p,m,h,g;if(t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==r||t[4]!==c||t[5]!==o){l=_J(o);let e=EJ(o),i=l.length>0?` · ${l.length}`:``,_;t[14]!==n||t[15]!==i?(_=(0,Q.jsxs)(vY,{arrived:n,children:[`Comments`,i]}),t[14]=n,t[15]=i,t[16]=_):_=t[16];let v;t[17]===o?v=t[18]:(v=o&&(0,Q.jsxs)(Tz,{children:[(0,Q.jsx)(`span`,{className:`font-mono`,children:o.branch||`detached HEAD`}),` `,`at `,(0,Q.jsx)(`span`,{className:`font-mono`,children:o.headOid.slice(0,7)}),`. Nothing is posted until you publish.`]}),t[17]=o,t[18]=v),t[19]!==v||t[20]!==_?(g=(0,Q.jsxs)(Sz,{children:[_,v]}),t[19]=v,t[20]=_,t[21]=g):g=t[21],u=`-mx-1 flex max-h-[60vh] flex-col gap-2 overflow-auto px-1`,t[22]!==s||t[23]!==o?(d=!o&&!s&&(0,Q.jsx)(Be,{label:`Loading comments`}),t[22]=s,t[23]=o,t[24]=d):d=t[24],t[25]!==s||t[26]!==c?(f=s&&(0,Q.jsxs)(`p`,{role:`alert`,className:`text-ui`,children:[`Comments could not be read.`,` `,(0,Q.jsx)(X,{variant:`link`,size:`flush`,onClick:c,children:`Try again`})]}),t[25]=s,t[26]=c,t[27]=f):f=t[27],p=o&&l.length===0&&(0,Q.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`No draft comments. Add one from any diff line, file, step or diagram node.`});let y;t[28]!==a||t[29]!==r?(y=e=>(0,Q.jsx)(oY,{owner:r,comment:e,onLeave:a,location:SJ(e.anchor)},e.id),t[28]=a,t[29]=r,t[30]=y):y=t[30],m=l.map(y),h=e.length>0&&(0,Q.jsxs)(`details`,{className:`mt-2 text-ui`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-default text-caption text-muted-foreground`,children:[`Posted · `,e.length]}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:e.map(e=>(0,Q.jsx)(oY,{owner:r,comment:e,onLeave:a,location:SJ(e.anchor)},e.id))})]}),t[0]=n,t[1]=s,t[2]=a,t[3]=r,t[4]=c,t[5]=o,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[31]!==u||t[32]!==d||t[33]!==f||t[34]!==p||t[35]!==m||t[36]!==h?(_=(0,Q.jsxs)(`div`,{className:u,children:[d,f,p,m,h]}),t[31]=u,t[32]=d,t[33]=f,t[34]=p,t[35]=m,t[36]=h,t[37]=_):_=t[37];let v=l.length===0,y;t[38]!==i||t[39]!==v?(y=(0,Q.jsx)(Cz,{children:(0,Q.jsx)(X,{disabled:v,onClick:i,children:`Share comments`})}),t[38]=i,t[39]=v,t[40]=y):y=t[40];let b;return t[41]!==y||t[42]!==g||t[43]!==_?(b=(0,Q.jsxs)(Q.Fragment,{children:[g,_,y]}),t[41]=y,t[42]=g,t[43]=_,t[44]=b):b=t[44],b}function TY(e){let t=(0,$.c)(22),{owner:n,open:r,onOpenChange:i,initialStep:a}=e,o=a===void 0?`list`:a,[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(),[d,f]=(0,Z.useState)(),[p,m]=(0,Z.useState)(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{m(!0),c(e)},t[0]=h):h=t[0];let g=h,{view:_}=KJ(n),v;t[1]===_?v=t[2]:(v=_J(_),t[1]=_,t[2]=v);let y=v.length,b;t[3]!==p||t[4]!==y||t[5]!==o||t[6]!==i||t[7]!==n||t[8]!==d||t[9]!==l||t[10]!==s||t[11]!==_?.markdown?(b=()=>d?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(vY,{arrived:p,children:`Review posted`}),(0,Q.jsx)(Tz,{children:`The comments are marked as posted.`})]}),(0,Q.jsx)(Cz,{children:(0,Q.jsxs)(X,{variant:`outline`,render:(0,Q.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`}),children:[`Open on GitHub`,(0,Q.jsx)(Uh,{"data-icon":`inline-end`})]})})]}):s===`review`&&l?(0,Q.jsx)(xY,{arrived:p,owner:n,preview:l,onBack:()=>g(`publish`),onPosted:e=>{m(!0),f(e)}}):s===`publish`?(0,Q.jsx)(SY,{arrived:p,owner:n,count:y,markdown:_?.markdown??``,onBack:()=>g(`list`),onReview:e=>{u(e),g(`review`)}}):(0,Q.jsx)(wY,{arrived:p,owner:n,onPublish:()=>g(`publish`),onClose:()=>{c(o),i(!1)}}),t[3]=p,t[4]=y,t[5]=o,t[6]=i,t[7]=n,t[8]=d,t[9]=l,t[10]=s,t[11]=_?.markdown,t[12]=b):b=t[12];let x=b,S;t[13]!==o||t[14]!==i?(S=e=>{e||(c(o),f(void 0),m(!1)),i(e)},t[13]=o,t[14]=i,t[15]=S):S=t[15];let C;t[16]===x?C=t[17]:(C=(0,Q.jsx)(xz,{className:`sm:max-w-[min(92vw,40rem)]`,children:x()}),t[16]=x,t[17]=C);let w;return t[18]!==r||t[19]!==S||t[20]!==C?(w=(0,Q.jsx)(vz,{open:r,onOpenChange:S,children:C}),t[18]=r,t[19]=S,t[20]=C,t[21]=w):w=t[21],w}function EY(e,t){return(0,Q.jsxs)(X,{size:`sm`,variant:`outline`,onClick:t,children:[`Publish review (`,e,`)`]})}function DY(e){let t=(0,$.c)(11),{owner:n,renderTrigger:r}=e,i=r===void 0?EY:r,a=KJ(n),o;t[0]===a.view?o=t[1]:(o=_J(a.view),t[0]=a.view,t[1]=o);let s=o.length,[c,l]=(0,Z.useState)(!1);if(s===0&&!c)return null;let u;t[2]!==s||t[3]!==i?(u=s>0&&i(s,()=>l(!0)),t[2]=s,t[3]=i,t[4]=u):u=t[4];let d;t[5]!==c||t[6]!==n?(d=(0,Q.jsx)(TY,{owner:n,open:c,onOpenChange:l,initialStep:`publish`}),t[5]=c,t[6]=n,t[7]=d):d=t[7];let f;return t[8]!==u||t[9]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[u,d]}),t[8]=u,t[9]=d,t[10]=f):f=t[10],f}function OY(e,t){let n=(0,$.c)(9),r;n[0]!==t.connection||n[1]!==e?(r=Go({connection:t.connection,scope:e}),n[0]=t.connection,n[1]=e,n[2]=r):r=n[2];let i;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promiseExit`},n[3]=i):i=n[3];let[a,o]=B(r,i),s;n[4]===o?s=n[5]:(s=e=>{o(e)},n[4]=o,n[5]=s);let c;return n[6]!==a||n[7]!==s?(c={result:a,dismiss:s},n[6]=a,n[7]=s,n[8]=c):c=n[8],c}function kY(e){let t=new Map;for(let n of e){let e=n.id.split(`:`)[0]||n.id,r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t.entries()]}function AY(e,t){let n=e?.filter(e=>!e.id.endsWith(`:default`));return n?.find(e=>e.id===t)?.id??n?.find(e=>/^codex:(?:.*-)?luna(?:-|$)/.test(e.id))?.id??n?.find(e=>e.id===`claude:haiku`)?.id??n?.find(e=>e.id===`claude:sonnet`)?.id}function jY(e){return e.split(`/`).at(-1)??e}function MY(e,t){let{message:n,stashOid:r,option:i}=t;return e===`stash-create`?{action:e,message:n,includeUntracked:i}:{action:e,stashOid:r,restoreIndex:i}}function NY(e,t,n){return{mode:e===`amend`?`amend`:`single`,message:e===`commit`?t:``,amendMessage:e===`amend`?t:n,excluded:new Set,added:new Set,groups:null}}function PY(e,t,n=new Set){return t.some(t=>!n.has(t.path)&&e.files?.find(e=>e.path===t.path)?.fingerprint!==t.fingerprint)}var FY=[{id:`commit`,label:`Commit…`,description:`Commit selected files`},{id:`amend`,label:`Amend last commit…`,description:`Replace the latest commit`},{id:`push`,label:`Push`,description:`Send committed changes`},{id:`pull`,label:`Pull`,description:`Bring in upstream changes`},{id:`fetch`,label:`Fetch`,description:`Update a remote-tracking branch`},{id:`stash-create`,label:`Stash changes`,description:`Set aside local changes`},{id:`stash-apply`,label:`Apply stash`,description:`Restore a stash and keep it`},{id:`stash-pop`,label:`Pop stash`,description:`Restore, then remove a stash`}],IY=[{id:`commit`,actions:[FY[0],FY[1]]},{id:`sync`,actions:[FY[2],FY[3],FY[4]]},{id:`stash`,actions:[FY[5],FY[7]]}];function LY(e){return FY.find(t=>t.id===e)?.label}function RY(e,t,n){return e===`pull`&&n?n:Bt(e,t)}function zY(e){let t=(0,$.c)(18),{scope:n,context:r}=e,{connection:i}=r,a=de(qr(iB(n,i))),o=na(r),s=OY(n,r),c=a?.interrupted;if(!c)return null;let l=c.action.replaceAll(`-`,` `),u;t[0]===l?u=t[1]:(u=(0,Q.jsxs)(`p`,{className:`font-medium`,children:[`A Git action was interrupted:`,` `,l]}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the current changes before trying again.`}),t[2]=d):d=t[2];let f;t[3]===s.result?f=t[4]:(f=Mi(s.result)&&(0,Q.jsx)(`p`,{role:`alert`,className:`mt-1 text-destructive`,children:Un(Ra(s.result.cause))}),t[3]=s.result,t[4]=f);let p;t[5]!==f||t[6]!==u?(p=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d,f]}),t[5]=f,t[6]=u,t[7]=p):p=t[7];let m=s.result.waiting||!!o,h;t[8]!==s||t[9]!==c.requestId?(h=()=>s.dismiss(c.requestId),t[8]=s,t[9]=c.requestId,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h||t[13]!==o?(g=(0,Q.jsx)(X,{size:`xs`,variant:`ghost`,disabled:m,"aria-description":o,onClick:h,children:`Got it`}),t[11]=m,t[12]=h,t[13]=o,t[14]=g):g=t[14];let _;return t[15]!==p||t[16]!==g?(_=(0,Q.jsxs)(`div`,{role:`status`,className:`flex shrink-0 items-start gap-3 border-b border-graph-4/20 bg-graph-4/10 px-3 py-2 text-xs`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17],_}function BY(e){let t=(0,$.c)(23),{scope:n,context:r,onOpen:i}=e,{connection:a}=r,o=de(qr(iB(n,a))),s=o?.inProgress;if(!s)return null;let c=o.changes.filter(VY),l=`${s===`merge`?`Merge`:`Rebase`} recovery`,u=s===`merge`?`Merge`:`Rebase`,d=c.length?`is waiting for conflict resolution`:`is ready to finish`,f;t[0]!==u||t[1]!==d?(f=(0,Q.jsxs)(`p`,{className:`font-medium`,children:[u,` `,d]}),t[0]=u,t[1]=d,t[2]=f):f=t[2];let p=c.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:c.map(e=>(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:()=>i({kind:`file`,path:e.path}),children:e.path},e.path))}),m=s===`merge`&&o.mergeHeadOid?`Use Commit from the Git menu to finish. The merge commit includes every staged resolution.`:`Stage the resolved files, then continue in a terminal in this worktree.`,h;t[3]===m?h=t[4]:(h=(0,Q.jsxs)(`p`,{children:[`Resolve the files in your editor or with your agent.`,` `,m]}),t[3]=m,t[4]=h);let g;t[5]===s?g=t[6]:(g=s===`rebase`&&(0,Q.jsx)(UY,{command:`git rebase --continue`}),t[5]=s,t[6]=g);let _;t[7]!==o||t[8]!==s?(_=s===`merge`&&!o.mergeHeadOid&&(0,Q.jsx)(UY,{command:`git commit`}),t[7]=o,t[8]=s,t[9]=_):_=t[9];let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{children:`To back out:`}),t[10]=v):v=t[10];let y=`git ${s} --abort`,b;t[11]===y?b=t[12]:(b=(0,Q.jsx)(UY,{command:y}),t[11]=y,t[12]=b);let x;t[13]!==_||t[14]!==b||t[15]!==g?(x=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[g,_,v,b]}),t[13]=_,t[14]=b,t[15]=g,t[16]=x):x=t[16];let S;return t[17]!==l||t[18]!==x||t[19]!==f||t[20]!==p||t[21]!==h?(S=(0,Q.jsxs)(`section`,{"aria-label":l,className:`shrink-0 space-y-2 border-b border-graph-4/20 bg-graph-4/10 px-3 py-2 text-xs`,children:[f,p,h,x]}),t[17]=l,t[18]=x,t[19]=f,t[20]=p,t[21]=h,t[22]=S):S=t[22],S}function VY(e){return e.comparisons.some(HY)}function HY(e){return e.scope===`unmerged`}function UY(e){let t=(0,$.c)(8),{command:n}=e,r=`Copy ${n}`,i,a;t[0]===n?(i=t[1],a=t[2]):(i=()=>Zt(n,`command`),a=(0,Q.jsx)(`code`,{children:n}),t[0]=n,t[1]=i,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(Bs,{}),t[3]=o):o=t[3];let s;return t[4]!==r||t[5]!==i||t[6]!==a?(s=(0,Q.jsxs)(X,{size:`xs`,variant:`outline`,"aria-label":r,onClick:i,children:[a,o]}),t[4]=r,t[5]=i,t[6]=a,t[7]=s):s=t[7],s}function WY(e,t){let n=(0,$.c)(5),r;if(n[0]!==t||n[1]!==e.state){let i;n[3]===t?i=n[4]:(i=e=>e.operations.get(t)??null,n[3]=t,n[4]=i),r=e.state.map(i),n[0]=t,n[1]=e.state,n[2]=r}else r=n[2];return La(r)}var GY=dt(e=>pe({done:new Set,activeGroup:null,ownHead:null,busy:!1,error:null,drafted:{message:null,groups:null},draftedBy:{message:null,groups:null},editingFiles:!1})),KY=dt(e=>new Set);function qY(e,t,n){let r=(0,$.c)(14),{connection:i}=n,{operations:a}=i,o;r[0]!==t||r[1]!==e?(o=ai(e,t),r[0]=t,r[1]=e,r[2]=o):o=r[2];let s=o,c;r[3]!==s||r[4]!==a.state.value.operations?(c=()=>{let e=a.state.value.operations.get(s);return e?.receipt&&pc(e.receipt)?e.requestId:null},r[3]=s,r[4]=a.state.value.operations,r[5]=c):c=r[5];let[l]=(0,Z.useState)(c),u=WY(a,s),d=u?.requestId===l?null:u,f={connection:i,scope:e,action:t},{value:p}=$u(no(f)),m=ea(f),h=la(f),g=Ot(m),_=Ot(h),v;r[6]===d?v=r[7]:(v=d?.receipt&&pc(d.receipt),r[6]=d,r[7]=v);let y=!!v,b;return r[8]!==p||r[9]!==g||r[10]!==d||r[11]!==_||r[12]!==y?(b={...p,execution:g,recovered:_,operation:d,canStartNew:y},r[8]=p,r[9]=g,r[10]=d,r[11]=_,r[12]=y,r[13]=b):b=r[13],b}var JY=dt(({signal:e,submit:t,recover:n})=>Oe(r=>{e!==void 0&&(r.set(t,Le),r.set(n,Le))}));function YY(e,t,n){let r=(0,$.c)(45),{path:i,hunk:a,signal:o,what:s,look:c,readChanges:l,notify:u,dismissNotice:d,close:f}=n,p=qY(e,`discard`,t),m=qY(e,`stash-apply`,t),h=!(!p.operation||p.canStartNew),g;r[0]===l?g=r[1]:(g=()=>Ui({try:l,catch:tX}),r[0]=l,r[1]=g);let _;r[2]!==f||r[3]!==d||r[4]!==u||r[5]!==m||r[6]!==g||r[7]!==s?(_={what:s,readChanges:g,notify:u,dismissNotice:d,close:f,restore:m,restoreTimeoutMs:wt,run:xo},r[2]=f,r[3]=d,r[4]=u,r[5]=m,r[6]=g,r[7]=s,r[8]=_):_=r[8];let v=_,[y]=(0,Z.useState)($Y),[b]=(0,Z.useState)(ZY),x;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(x={mode:`promiseExit`},r[9]=x):x=r[9];let[S,C]=B(y,x),w;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(w={mode:`promiseExit`},r[10]=w):w=r[10];let[T,E]=B(b,w),D=Da(y),O=Da(b),k;r[11]!==b||r[12]!==o||r[13]!==y?(k=JY({signal:o,submit:y,recover:b}),r[11]=b,r[12]=o,r[13]=y,r[14]=k):k=r[14],Lt(k);let A=S.waiting||T.waiting,j=XY,M;r[15]!==T||r[16]!==S?(M=j(S)??j(T),r[15]=T,r[16]=S,r[17]=M):M=r[17];let N;r[18]!==O||r[19]!==D?(N=()=>{D(Le),O(Le)},r[18]=O,r[19]=D,r[20]=N):N=r[20];let P;r[21]!==A||r[22]!==p||r[23]!==v||r[24]!==a||r[25]!==c||r[26]!==i||r[27]!==O||r[28]!==C||r[29]!==h?(P=()=>{A||h||!c||(O(Le),C({run:()=>p.run({action:`discard`,path:i,...a?{hunk:a}:{}},ke(c,[i])),discarding:v}))},r[21]=A,r[22]=p,r[23]=v,r[24]=a,r[25]=c,r[26]=i,r[27]=O,r[28]=C,r[29]=h,r[30]=P):P=r[30];let F;r[31]!==A||r[32]!==p.recover||r[33]!==v||r[34]!==E||r[35]!==D?(F=()=>{A||(D(Le),E({recover:p.recover,discarding:v}))},r[31]=A,r[32]=p.recover,r[33]=v,r[34]=E,r[35]=D,r[36]=F):F=r[36];let I;return r[37]!==A||r[38]!==p.operation||r[39]!==M||r[40]!==N||r[41]!==P||r[42]!==F||r[43]!==h?(I={operation:p.operation,uncertain:h,busy:A,error:M,reset:N,run:P,checkOutcome:F},r[37]=A,r[38]=p.operation,r[39]=M,r[40]=N,r[41]=P,r[42]=F,r[43]=h,r[44]=I):I=r[44],I}function XY(e){return de(qr(e))??(Mi(e)?{text:Un(Ra(e.cause)),moved:!1}:null)}function ZY(){return mn(QY)}function QY(e){return ae(e.recover(),e.discarding)}function $Y(){return mn(eX)}function eX(e){return ae(e.run(),e.discarding)}function tX(e){return new Rt(e,Un(e))}function nX({text:e}){return e.split(/`([^`\n]+)`/).map((e,t)=>t%2?(0,Q.jsx)(`code`,{className:`box-decoration-clone rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]`,children:e},t):e)}function rX(e){let t=(0,$.c)(6),{text:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(qi,{className:`mt-[0.2lh] size-3.5 shrink-0`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Q.jsx)(nX,{text:n}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=(0,Q.jsxs)(`p`,{role:`alert`,className:`flex min-w-0 gap-1.5 text-destructive`,children:[i,(0,Q.jsxs)(`span`,{className:`min-w-0 break-words`,children:[a,r]})]}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function iX(e){let t=(0,$.c)(12),{scope:n,context:r,path:i,hunk:a,variant:o,signal:s,hiddenTrigger:c,children:l}=e,u=o===void 0?`button`:o,d=c!==void 0&&c,{connection:f}=r,p=de(qr(iB(n,f))),m=uB(n,f),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=p,b=y?St(y):null,x=y?.changes.find(e=>e.path===i),S=_??b,C;t[0]===a?C=t[1]:(C=a?sX(a):null,t[0]=a,t[1]=C);let w=C,T=w?`${w} of ${jY(i)}`:jY(i),E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>g(!1),t[2]=E):E=t[2];let D=YY(n,r,{path:i,hunk:a,signal:s,what:T,look:S,readChanges:m,notify:ks,dismissNotice:Ya,close:E}),{busy:O,error:k,uncertain:A}=D,j=na(r),M=!!(S&&(x||h)),[N,P]=(0,Z.useState)();s!==void 0&&s!==N&&b&&(P(s),v(b),g(!0));let[F,I]=(0,Z.useState)(null),L=M&&!d?(0,Q.jsxs)(X,{ref:I,size:u===`button`?`sm`:`xs`,disabled:!!j,"aria-description":j,variant:u===`button`?`destructive`:`ghost`,"aria-label":a?`Discard ${w} of ${jY(i)}`:`Discard changes to ${jY(i)}`,onClick:()=>{D.reset(),v(b),g(!0)},children:[(0,Q.jsx)(F_,{}),cX(u)]}):null,R=M?(0,Q.jsx)(Ez,{open:h,onOpenChange:e=>!O&&g(e),children:(0,Q.jsxs)(Oz,{finalFocus:()=>F,children:[(0,Q.jsxs)(kz,{children:[(0,Q.jsxs)(jz,{children:[`Discard `,T,`?`]}),(0,Q.jsx)(Mz,{children:lX(a!=null,x?.comparisons.some(oX)??!1)})]}),(0,Q.jsx)(fr,{className:`rounded-lg bg-muted/50 px-3 py-2 font-mono text-xs`,render:(0,Q.jsx)(`p`,{}),text:i}),k&&(0,Q.jsx)(rX,{text:k.text,children:k.moved?` Look at the diff again before discarding.`:``}),D.operation?.receipt?.progress.map(aX),A&&!D.operation?.receipt&&(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`The response was lost. Check the existing discard request before trying again.`}),(0,Q.jsxs)(Az,{children:[(0,Q.jsx)(Nz,{disabled:O,children:k?.moved?`Look again`:`Cancel`}),!k?.moved&&(A?(0,Q.jsx)(ji,{pending:O,onClick:D.checkOutcome,children:`Check outcome`}):(0,Q.jsx)(X,{variant:`destructive`,disabled:O||!!j,"aria-description":j,onClick:D.run,children:O?`Discarding…`:`Discard`}))]})]})}):null;if(l){let e;t[3]!==l||t[4]!==L?(e=l(L),t[3]=l,t[4]=L,t[5]=e):e=t[5];let n;return t[6]!==R||t[7]!==e?(n=(0,Q.jsxs)(Q.Fragment,{children:[e,R]}),t[6]=R,t[7]=e,t[8]=n):n=t[8],n}let z;return t[9]!==R||t[10]!==L?(z=(0,Q.jsxs)(Q.Fragment,{children:[L,R]}),t[9]=R,t[10]=L,t[11]=z):z=t[11],z}function aX(e){return(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:e},e)}function oX(e){return e.scope===`untracked`}function sX({startLine:e,endLine:t}){return e===t?`line ${e}`:`lines ${e}–${t}`}function cX(e){return e===`quiet`?(0,Q.jsx)(`span`,{className:`max-narrow:sr-only`,children:`Discard`}):e===`compact`?`Discard selection`:`Discard`}function lX(e,t){return e?`Select one complete changed hunk. Only that hunk is reverted; partial selections are refused. A recovery copy is saved first.`:t?`The new file is deleted. You can restore it.`:`The file goes back to the last commit. You can restore the changes.`}var uX=G(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function dX({className:e,orientation:t,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Y(uX({orientation:t}),e),...n})}function fX(e,t,n){let r=(0,$.c)(32),i=qY(e,`fetch`,t),a=qY(e,`pull`,t),o=qY(e,`push`,t),s=qY(e,`stash-apply`,t),c;r[0]===n.details?c=r[1]:(c=()=>Ui({try:n.details.read,catch:hX}),r[0]=n.details,r[1]=c);let l;r[2]!==n.details||r[3]!==c?(l={...n.details,read:c},r[2]=n.details,r[3]=c,r[4]=l):l=r[4];let u;r[5]!==n||r[6]!==l?(u={...n,details:l},r[5]=n,r[6]=l,r[7]=u):u=r[7];let d=u,f,p;r[8]!==i||r[9]!==a||r[10]!==o?(f={fetch:i,pull:a,push:o},p=[`fetch`,`pull`,`push`].map(e=>({name:e,operation:f[e].operation,canStartNew:f[e].canStartNew,checking:f[e].recovered.waiting})).find(mX),r[8]=i,r[9]=a,r[10]=o,r[11]=f,r[12]=p):(f=r[11],p=r[12]);let m=p,h;r[13]!==d||r[14]!==f||r[15]!==m?(h=()=>{m&&xo(si(d,f[m.name],m.name))},r[13]=d,r[14]=f,r[15]=m,r[16]=h):h=r[16];let g;r[17]!==d||r[18]!==f?(g=(e,t)=>xo(En(d,f[e],e,t)),r[17]=d,r[18]=f,r[19]=g):g=r[19];let _;r[20]!==d||r[21]!==s?(_=e=>xo(oc(d,s,e)),r[20]=d,r[21]=s,r[22]=_):_=r[22];let v;r[23]!==n.onLooked||r[24]!==n.refreshLook?(v=()=>ls(hc(Ui({try:n.refreshLook,catch:pX}),n.onLooked)),r[23]=n.onLooked,r[24]=n.refreshLook,r[25]=v):v=r[25];let y;return r[26]!==m||r[27]!==h||r[28]!==g||r[29]!==_||r[30]!==v?(y={running:m,checkOutcome:h,runNetwork:g,restoreDiscarded:_,lookAgain:v},r[26]=m,r[27]=h,r[28]=g,r[29]=_,r[30]=v,r[31]=y):y=r[31],y}function pX(e){return new Rt(e,Un(e))}function mX(e){let{operation:t,canStartNew:n}=e;return t!=null&&!n}function hX(e){return new Rt(e,Un(e))}function gX(e){let t=(0,$.c)(12),{action:n,className:r}=e;switch(n){case`amend`:{let e;return t[0]===r?e=t[1]:(e=(0,Q.jsx)(h_,{className:r}),t[0]=r,t[1]=e),e}case`push`:{let e;return t[2]===r?e=t[3]:(e=(0,Q.jsx)(yh,{className:r}),t[2]=r,t[3]=e),e}case`pull`:case`fetch`:{let e;return t[4]===r?e=t[5]:(e=(0,Q.jsx)(hh,{className:r}),t[4]=r,t[5]=e),e}case`stash-create`:{let e;return t[6]===r?e=t[7]:(e=(0,Q.jsx)(ph,{className:r}),t[6]=r,t[7]=e),e}case`stash-apply`:case`stash-pop`:{let e;return t[8]===r?e=t[9]:(e=(0,Q.jsx)(dh,{className:r}),t[8]=r,t[9]=e),e}default:{let e;return t[10]===r?e=t[11]:(e=(0,Q.jsx)(yg,{className:r}),t[10]=r,t[11]=e),e}}}function _X(e){let t=e.group?.();if(!t)return;let n=!!e.parent;return{checked:n?t.parentChecked():t.checked(e.value??`on`),name:n?void 0:e.name??t.name(),disabled:!!e.disabled||t.disabled(),readOnly:!!e.readOnly||t.readOnly(),form:e.form??t.form()}}function vX(e){let t=_X(e);return t?{...t,required:!!e.required,value:e.value??`on`}:It(e)}function yX(e){let{store:t,element:n,options:r}=e,i=ht(e),a=()=>r().group?.(),o=()=>!!r().parent,s=Fa(e,i,{owner:a,write(e,n,r){let{reason:a,event:s}=r,c={reason:a===`press`?`item-press`:a,event:s};return(o()?e.setAll(n===!0&&!e.allEnabledChecked(),c):e.setChild(t.get().value,n===!0,c))?(i(`checked`,o()?e.parentChecked():e.checked(t.get().value),r),!0):!1}}),c=!1,l=(e,t)=>t===!1&&e!==!1&&!!n(`indicator`);Gs(e,[`exiting`],(e,t)=>`checked`in e&&e.checked!==t.checked?{exiting:l(t.checked,e.checked)}:void 0);let u=t.get().checked;return t.subscribe(()=>{let{checked:e}=t.get();if(e===u)return;let n=u;u=e,c=!0,t.set({exiting:l(n,e)})}),{...s,isChanged:()=>c,internal:{...s.internal,joinGroup(e){let n=a();if(!n)return()=>{};let i=()=>{let{name:e,disabled:i,readOnly:a,form:s}=_X(r());t.set({checked:o()?n.parentChecked():n.checked(t.get().value),controls:o()&&n.childIds()||void 0,name:e,disabled:i,readOnly:a,form:s})},s=n.subscribe(i);if(i(),o())return s;let c=()=>n.register(t.get().value,e,()=>vc(t.get())),l=c(),{value:u}=t.get(),d=vc(t.get()),f=t.subscribe(()=>{let e=t.get();e.value===u?vc(e)!==d&&n.internal.refreshChildren():(u=e.value,l(),l=c()),d=vc(e)});return()=>{s(),f(),l()}},finishExit(){t.set({exiting:!1})}}}}var bX=yX,xX=e=>({...R(e),indeterminate:e.checked===`indeterminate`}),SX=sa({name:`checkbox`,options:{checked:ee,defaultChecked:ee,onCheckedChange:`callback`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,value:`string`,form:`string`,controller:`value`,parent:`boolean`,group:`value`},state:e=>{let t=_X(e);return{...vt(t?{...e,...t}:e),exiting:!1,controls:void 0}},controlled:[`checked`],live:[`controls`],sync:vX,api:bX,slots:e=>{let{root:t,input:n}=Ea(`checkbox`,e,xX);return{root:e({...t,live:Qo(e=>({"aria-controls":e.controls})),bind:(e,n)=>{let r=n.api.internal.joinGroup(e),i=t.bind?.(e,n);return()=>{i?.(),r()}}}),input:n,indicator:e({props:{keepMounted:`boolean`},present:(e,{props:t})=>!!t.keepMounted||e.checked!==!1||e.exiting,state:xX,attrs:e=>s(e),bind(e,{api:t,store:n,props:r}){let i,a=n.get().checked!==!1;a&&t.isChanged()&&(i=Xe(e));let o=n.subscribe(()=>{let{checked:o,exiting:s}=n.get();e.toggleAttribute(`data-checked`,o===!0),e.toggleAttribute(`data-unchecked`,o===!1),e.toggleAttribute(`data-indeterminate`,o===`indeterminate`),o!==!1!==a&&(a=o!==!1,i?.(),i=void 0,a?i=Xe(e):(s||r.keepMounted)&&(i=kr(e,()=>{i=void 0,t.internal.finishExit()})))});return()=>{o(),i?.()}}})}},agent:{actions:[`setChecked`]}}),CX=he(SX,{root:`button`,indicator:`span`}),wX=Z.createContext(null);function TX(){return tr(SX,`input`,{},{},`input`)}function EX({disabled:e,name:t,render:n,...r}){let i=Z.useContext(wX),a=Us(),o=i?null:a;return(0,Q.jsx)(CX.Root,{...r,disabled:e||o?.disabled,name:t??o?.name,group:i?pt(i,()=>i.api):void 0,render:O(o,`button`,n,(0,Q.jsx)(TX,{}))})}var DX=CX.Indicator;function OX({className:e,...t}){return(0,Q.jsx)(EX,{"data-slot":`checkbox`,className:Y(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,Q.jsx)(DX,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,Q.jsx)(Dn,{})})})}function kX(e,t,n,r){let i=(0,$.c)(40),{expectedStatus:a,onBusy:o,onLookAgain:s}=r,c=qY(e,t,n),[l]=(0,Z.useState)(NX),u;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={mode:`promiseExit`},i[0]=u):u=i[0];let[d,f]=B(l,u),p=Da(l),m=c.execution.waiting||c.recovered.waiting||d.waiting,h=!(!c.operation||c.canStartNew),g=MX,_;i[1]===c.recovered?_=i[2]:(_=g(c.recovered),i[1]=c.recovered,i[2]=_);let v=_,y=v instanceof No&&v.reason===`receipt-unavailable`&&v.requestId===c.operation?.requestId?v.requestId:void 0,b;i[3]===s?b=i[4]:(b=s?Ui({try:s,catch:jX}):to,i[3]=s,i[4]=b);let x=b,S;i[5]!==c||i[6]!==y||i[7]!==x||i[8]!==f?(S=y?()=>{f({read:x,startNew:c.startNew(y)})}:void 0,i[5]=c,i[6]=y,i[7]=x,i[8]=f,i[9]=S):S=i[9];let C=c.operation?.receipt,w;i[10]!==c.execution||i[11]!==d||i[12]!==v?(w=g(d)??v??g(c.execution),i[10]=c.execution,i[11]=d,i[12]=v,i[13]=w):w=i[13];let T;i[14]!==m||i[15]!==a||i[16]!==c||i[17]!==o||i[18]!==p||i[19]!==h?(T=e=>{m||h||(o(!0),p(Le),c.reset(),xo(c.run(e,ke(a,a.files?.map(AX)??[],void 0,!0)).pipe(Br(Es(()=>o(!1))),_a)))},i[14]=m,i[15]=a,i[16]=c,i[17]=o,i[18]=p,i[19]=h,i[20]=T):T=i[20];let E;i[21]!==m||i[22]!==c||i[23]!==s||i[24]!==x||i[25]!==f?(E=()=>{s&&!m&&(c.reset(),f({read:x,startNew:c.startNew()}))},i[21]=m,i[22]=c,i[23]=s,i[24]=x,i[25]=f,i[26]=E):E=i[26];let D;i[27]!==c||i[28]!==p?(D=()=>{c.reset(),p(Le),xo(c.recover().pipe(_a))},i[27]=c,i[28]=p,i[29]=D):D=i[29];let O;return i[30]!==m||i[31]!==c.operation||i[32]!==S||i[33]!==C||i[34]!==w||i[35]!==T||i[36]!==E||i[37]!==D||i[38]!==h?(O={clearUnconfirmed:S,operation:c.operation,messageLimit:rs,outcome:C,busy:m,uncertain:h,error:w,onSubmit:T,lookAgain:E,checkOutcome:D},i[30]=m,i[31]=c.operation,i[32]=S,i[33]=C,i[34]=w,i[35]=T,i[36]=E,i[37]=D,i[38]=h,i[39]=O):O=i[39],O}function AX(e){return e.path}function jX(e){return new Rt(e,Un(e))}function MX(e){return Mi(e)?Ra(e.cause):null}function NX(){return mn(PX)}function PX(e){return zs(e.read,e.startNew)}function FX(e){let t=[],n=[],r=()=>{let e=t.indexOf(null);return e===-1?(t.push(null),t.length-1):e};for(let i of e){let e=t.flatMap((e,t)=>e===i.oid?[t]:[]);for(let n of e)t[n]=null;let a=e.length>0?Math.min(...e):r(),o=i.parentOids.map((e,n)=>{let i=t.indexOf(e),o=n===0?a:i===-1?r():i;return t[o]=e,o});n.push({commit:i,lane:a,outgoing:o,lanesAfter:[...t]})}return n}var IX={laneWidth:16,lastLane:1/0},LX={laneWidth:10,lastLane:3};function RX(e,t=IX){return 13+Math.min(e,t.lastLane)*t.laneWidth}function zX(e,t=IX){let n=e.flatMap(e=>[e.lane,...e.outgoing,...e.lanesAfter.flatMap((e,t)=>e==null?[]:[t])]);return RX(Math.max(0,...n),t)+13}function BX(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:[`th`,`st`,`nd`,`rd`][e%10]??`th`}`}function VX(e){let t=UX(e),n=t.at(-1);return{snapshot:t[0]?.snapshot??null,commits:t.flatMap(e=>e.commits),nextAfter:n?.nextAfter??null,boundary:n?.boundary??null,restarted:n?.restarted??!1}}function HX(e){let t=UX(e),n=t.at(-1);return{commits:t.flatMap(e=>e.commits),tip:t[0]?.tip??null,nextAfter:n?.nextAfter??null,boundary:n?.boundary??null,restarted:t[0]?.restarted??!1}}function UX(e){let t=e.findLastIndex(e=>e.restarted);return t===-1?e:e.slice(t)}var WX=dt(e=>Oe({loaded:0,selected:void 0,scrollOffset:0,graphScrollOffset:0,resetId:0}).pipe(x)),GX=dt(({connection:e,scope:t})=>ve(e,t,[`history`],n=>JX(n,WX({connection:e,scope:t,kind:`commits`}),n=>$o(function*(){let r=yield*(yield*Te(e)).request(e=>e.changes.listCommits({params:{worktreeId:t.worktreeId},query:{after:n?.after,tip:n?.tip}}));return yield*xc(e),r}),e=>e.nextAfter&&e.tip?{after:e.nextAfter,tip:e.tip}:void 0),Xn(e))),KX=dt(({connection:e,scope:t,oid:n,parent:r=1})=>et(e,t,[`commit`,n,r],$o(function*(){let i=yield*(yield*Te(e)).request(e=>e.changes.readCommitFiles({params:{worktreeId:t.worktreeId,oid:n},query:r===1?{}:{parent:r}}));return yield*xc(e,i.commit.oid===n&&(i.comparison.kind===`empty-tree`||i.comparison.parentNumber===r)),i}),Xn(e)).pipe(sr)),qX=dt(({connection:e,scope:t,path:n})=>ve(e,t,[`history`,`file`,n],r=>JX(r,WX({connection:e,scope:t,kind:`file`,path:n}),r=>$o(function*(){let i=yield*(yield*Te(e)).request(e=>e.changes.listFileCommits({params:{worktreeId:t.worktreeId},query:{path:n,limit:100,after:r}}));return yield*xc(e),i}),e=>e.nextAfter),Xn(e)));function JX(e,t,n,r){let i=e.once(t).loaded,a=0;return ti(void 0,o=>$o(function*(){let s=[],c=a,l=o,u=!1;do{let e=yield*n(l);e.restarted&&(c=0,u=!0),c+=e.commits.length,s.push(e),l=r(e)}while(o===void 0&&c<i&&l!==void 0&&!u);a=c;let d=e.once(t);return e.set(t,{...d,loaded:a,...u?{selected:void 0,scrollOffset:0,graphScrollOffset:0,resetId:d.resetId+1}:{}}),[s,l===void 0?y():Zn(l)]}))}var YX=dt(e=>Hn(qX(e),e=>ma(e,e=>HX(e.items))).pipe(sr)),XX=dt(e=>Hn(GX(e),e=>ma(e,e=>VX(e.items))).pipe(sr));dt(e=>wc((t,n)=>{let r=WX({...e,kind:`commit`,oid:t.oid,parent:t.parent}),i=n(r);n.set(r,{...i,selected:t.path,scrollOffset:0,resetId:i.resetId+1})}));function ZX(e,t,n,r){let i=(0,$.c)(5),a=r===void 0?1:r,o;return i[0]!==e||i[1]!==n||i[2]!==a||i[3]!==t?(o=KX({connection:e,scope:t,oid:n,parent:a}),i[0]=e,i[1]=n,i[2]=a,i[3]=t,i[4]=o):o=i[4],$u(o).value}function QX(e){let t=(0,$.c)(28),{tracking:n,title:r}=e,i=r!==void 0&&r,a=i?`mt-0.5 size-4`:`mt-0.5 size-3.5`,o;t[0]===a?o=t[1]:(o=Y(`shrink-0 text-muted-foreground`,a),t[0]=a,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,Q.jsx)(_g,{className:o}),t[2]=o,t[3]=s);let c=i?`text-sm leading-5 font-semibold`:`text-caption font-medium`,l;t[4]===c?l=t[5]:(l=Y(`min-w-0 font-mono text-foreground`,c),t[4]=c,t[5]=l);let u;t[6]===i?u=t[7]:(u=i?{render:(0,Q.jsx)(`h1`,{})}:{},t[6]=i,t[7]=u);let d;t[8]!==l||t[9]!==u||t[10]!==n.name?(d=(0,Q.jsx)(fr,{className:l,text:n.name,...u}),t[8]=l,t[9]=u,t[10]=n.name,t[11]=d):d=t[11];let f;t[12]===n.counts?f=t[13]:(f=n.counts!==null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-2xs text-muted-foreground tabular-nums`,children:n.counts}),t[12]=n.counts,t[13]=f);let p;t[14]!==d||t[15]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let m=i?`text-caption`:`text-2xs`,h;t[17]===m?h=t[18]:(h=Y(`text-muted-foreground`,m),t[17]=m,t[18]=h);let g;t[19]!==h||t[20]!==n.upstream?(g=(0,Q.jsx)(fr,{className:h,text:n.upstream}),t[19]=h,t[20]=n.upstream,t[21]=g):g=t[21];let _;t[22]!==p||t[23]!==g?(_=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[p,g]}),t[22]=p,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==_||t[26]!==s?(v=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[s,_]}),t[25]=_,t[26]=s,t[27]=v):v=t[27],v}function $X(e,t){let n=(0,$.c)(19),r;n[0]!==e||n[1]!==t?(r=GX({connection:e,scope:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i=r,a;n[3]!==e||n[4]!==t?(a=XX({connection:e,scope:t}),n[3]=e,n[4]=t,n[5]=a):a=n[5];let{result:o,value:s}=$u(a),c=Da(i),l;n[6]!==e||n[7]!==t?(l=WX({connection:e,scope:t,kind:`commits`}),n[6]=e,n[7]=t,n[8]=l):l=n[8];let u=l,d=Ot(u,eZ),f=Da(u),p;n[9]===f?p=n[10]:(p=e=>f(t=>({...t,selected:e})),n[9]=f,n[10]=p);let m;n[11]===c?m=n[12]:(m=()=>c(void 0),n[11]=c,n[12]=m);let h;return n[13]!==o||n[14]!==d||n[15]!==p||n[16]!==m||n[17]!==s?(h={...s,result:o,selected:d,select:p,readMore:m},n[13]=o,n[14]=d,n[15]=p,n[16]=m,n[17]=s,n[18]=h):h=n[18],h}function eZ(e){return e.selected}function tZ(e,t){let n=(0,$.c)(13),r=$X(e,t),i=iB(t,e),a,o,s,c;if(n[0]!==r||n[1]!==i){let e=de(qr(i));a=r,o=e,n[6]===i?s=n[7]:(s=Xi(i),n[6]=i,n[7]=s),c=Ky(e?.branch,r.snapshot),n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=c}else a=n[2],o=n[3],s=n[4],c=n[5];let l;return n[8]!==a||n[9]!==o||n[10]!==s||n[11]!==c?(l={history:a,overview:o,overviewPending:s,tracking:c},n[8]=a,n[9]=o,n[10]=s,n[11]=c,n[12]=l):l=n[12],l}function nZ(e){let t=(0,$.c)(3),{enabled:n,onVisible:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`h-px`,ref:e=>{if(!e||!n||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{let[t]=e;t?.isIntersecting&&r()},{rootMargin:`0px 0px 240px 0px`});return t.observe(e),()=>t.disconnect()}}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function rZ(e){let t=(0,$.c)(5),[n,r]=(0,Z.useState)(1),i;t[0]===e?i=t[1]:(i=function(t){if(!t)return;let n=t.querySelector(`[data-ref-measurement]`);if(!n)return;let i=()=>{let i=Array.from(n.children,aZ),a=i.pop()??0,o=Number.parseFloat(getComputedStyle(t).columnGap),s=t.getBoundingClientRect().width;if(i.reduce(iZ,0)+Math.max(0,i.length-1)*o<=s){r(e);return}let c=0,l=0;for(let t of i){c+=t+(l===0?0:o);let n=l+1===e?0:o+a;if(c+n>s)break;l+=1}r(Math.max(1,l))},a=new ResizeObserver(i);return a.observe(t),a.observe(n),i(),()=>a.disconnect()},t[0]=e,t[1]=i);let a=i,o;return t[2]!==a||t[3]!==n?(o={row:a,visibleCount:n},t[2]=a,t[3]=n,t[4]=o):o=t[4],o}function iZ(e,t){return e+t}function aZ(e){return e.getBoundingClientRect().width}var oZ=`min-w-0 max-w-40`;function sZ(e){let t=(0,$.c)(21),{refs:n,current:r,onOpenCommit:i}=e,a=r===void 0?uZ:r,{row:o,visibleCount:s}=rZ(n.length),c;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==o||t[4]!==s){let e=n.slice(s),r;t[6]===n?r=t[7]:(r=n.map(lZ),t[6]=n,t[7]=r);let l;t[8]===n.length?l=t[9]:(l=(0,Q.jsxs)(Ao,{variant:`secondary`,className:oZ,children:[`+`,n.length]}),t[8]=n.length,t[9]=l);let u;t[10]!==r||t[11]!==l?(u=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute inset-0 overflow-hidden`,children:(0,Q.jsxs)(`div`,{"data-ref-measurement":!0,className:`flex w-max gap-1`,children:[r,l]})}),t[10]=r,t[11]=l,t[12]=u):u=t[12];let d;if(t[13]!==a||t[14]!==i||t[15]!==n||t[16]!==s){let e;t[18]!==a||t[19]!==i?(e=e=>(0,Q.jsx)(fr,{text:e.name,renderTrigger:t=>(0,Q.jsxs)(Ao,{render:(0,Q.jsx)(`button`,{type:`button`,onClick:i}),variant:a(e)?`brand-soft`:`outline`,className:`${oZ} pointer-events-auto shrink`,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`}),t]}),children:e.name},`${e.kind}:${e.name}`),t[18]=a,t[19]=i,t[20]=e):e=t[20],d=n.slice(0,s).map(e),t[13]=a,t[14]=i,t[15]=n,t[16]=s,t[17]=d}else d=t[17];c=(0,Q.jsxs)(`div`,{ref:o,className:`pointer-events-none relative flex min-w-0 items-center gap-1`,children:[u,d,e.length>0&&(0,Q.jsxs)(uo,{children:[(0,Q.jsxs)(yo,{render:(0,Q.jsx)(Ao,{render:(0,Q.jsx)(`button`,{type:`button`}),variant:`secondary`,className:`${oZ} pointer-events-auto`,"aria-label":`Show ${e.length} more ${Ua(e.length,`ref`)}`}),children:[`+`,e.length]}),(0,Q.jsxs)(Zo,{align:`start`,className:`max-w-[calc(100vw-2rem)]`,children:[(0,Q.jsx)(Jr,{children:`More refs`}),(0,Q.jsx)(`ul`,{className:`max-h-64 overflow-y-auto text-xs`,children:e.map(cZ)})]})]})]}),t[0]=a,t[1]=i,t[2]=n,t[3]=o,t[4]=s,t[5]=c}else c=t[5];return c}function cZ(e){return(0,Q.jsxs)(`li`,{className:`flex items-center gap-1 py-1 break-all`,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`,className:`size-3 shrink-0`}),e.name]},`${e.kind}:${e.name}`)}function lZ(e){return(0,Q.jsxs)(Ao,{variant:`secondary`,className:oZ,children:[e.kind===`tag`&&(0,Q.jsx)(j_,{"aria-hidden":`true`}),(0,Q.jsx)(`span`,{"data-label":e.name,className:`before:content-[attr(data-label)]`})]},`${e.kind}:${e.name}`)}function uZ(){return!1}function dZ(e){let t=(0,$.c)(73),{commit:n,selected:r,height:i,inset:a,layout:o,head:s,headRef:c,onSelect:l,openToSide:u,children:d}=e,f=o===void 0?`stacked`:o,p=s!==void 0&&s,[m,h]=(0,Z.useState)(!1),g;t[0]!==l||t[1]!==u?(g=e=>l(u!==void 0&&e.altKey),t[0]=l,t[1]=u,t[2]=g):g=t[2];let _=g,v;t[3]===c?v=t[4]:(v=e=>Uy(e,c),t[3]=c,t[4]=v);let y=v,b;if(t[5]!==n.refs||t[6]!==y){let e;t[8]===y?e=t[9]:(e=(e,t)=>Number(y(t))-Number(y(e)),t[8]=y,t[9]=e),b=Hy(n.refs).toSorted(e),t[5]=n.refs,t[6]=y,t[7]=b}else b=t[7];let x=b,S;t[10]===p?S=t[11]:(S=p?(0,Q.jsx)(Ao,{variant:`brand`,className:`relative shrink-0`,children:`HEAD`}):null,t[10]=p,t[11]=S);let C=S,w=f===`stacked`&&`font-medium`,T=(p||r)&&`font-semibold`,E;t[12]!==w||t[13]!==T?(E=Y(`flex min-w-0 items-center gap-1 text-ui leading-4.5 font-normal`,w,T),t[12]=w,t[13]=T,t[14]=E):E=t[14];let D;t[15]===n.parentOids.length?D=t[16]:(D=n.parentOids.length>1&&(0,Q.jsx)(Cg,{"aria-label":`Merge commit`,className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=n.parentOids.length,t[16]=D);let O;t[17]===n.subject?O=t[18]:(O=(0,Q.jsx)(fr,{text:n.subject}),t[17]=n.subject,t[18]=O);let k=f===`stacked`&&C,A;t[19]!==D||t[20]!==O||t[21]!==k||t[22]!==E?(A=(0,Q.jsxs)(`span`,{className:E,children:[D,O,k]}),t[19]=D,t[20]=O,t[21]=k,t[22]=E,t[23]=A):A=t[23];let j=A,M;t[24]===n.author.timestamp?M=t[25]:(M=$a(n.author.timestamp,Date.now()),t[24]=n.author.timestamp,t[25]=M);let N=M,P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e&&h(!1)},t[26]=P):P=t[26];let F;t[27]!==i||t[28]!==a?(F={height:i,paddingLeft:a},t[27]=i,t[28]=a,t[29]=F):F=t[29];let I=f===`stacked`?`flex-col justify-center gap-0.5`:`items-center gap-3`,L=i===void 0&&`py-1.5`,R=r&&`bg-selection hover:bg-selection`,z;t[30]!==I||t[31]!==L||t[32]!==R?(z=Y(`relative flex w-full rounded-lg px-2 text-left transition-colors hover:bg-accent has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-ring/60`,I,L,R),t[30]=I,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==F||t[35]!==z?(B=(0,Q.jsx)(`div`,{style:F,className:z}),t[34]=F,t[35]=z,t[36]=B):B=t[36];let V;t[37]!==N||t[38]!==d||t[39]!==n.author.name||t[40]!==n.oid||t[41]!==y||t[42]!==C||t[43]!==a||t[44]!==f||t[45]!==x||t[46]!==_||t[47]!==r||t[48]!==j?(V=f===`stacked`?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:_,className:`block min-w-0 flex-1 text-left outline-none before:absolute before:inset-0 before:rounded-lg`,children:[j,(0,Q.jsxs)(`span`,{style:{left:a},className:`absolute inset-x-2 mt-0.5 flex min-w-0 gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`code`,{className:`font-mono`,children:By(n.oid)}),(0,Q.jsx)(fr,{text:n.author.name}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:N})]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 block h-4`}),d!==void 0&&(0,Q.jsx)(`span`,{className:`flex min-w-0`,children:d})]}),x.length>0&&(0,Q.jsx)(`div`,{className:`flex h-4.5 max-w-2/5 min-w-0 shrink-0 flex-col justify-center`,children:(0,Q.jsx)(sZ,{refs:x,current:y,onOpenCommit:_})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`code`,{className:`hidden w-16 shrink-0 font-mono text-xs text-muted-foreground @md/graph:block`,children:By(n.oid)}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:_,className:`flex min-w-0 items-center text-left outline-none before:absolute before:inset-0 before:rounded-lg`,children:[j,(0,Q.jsx)(`span`,{className:`sr-only`,children:` ${By(n.oid)} ${n.author.name} ${N}`})]}),C,(0,Q.jsx)(`div`,{className:`max-w-2/5 min-w-0 shrink-0 overflow-hidden`,children:x.length>0&&(0,Q.jsx)(sZ,{refs:x,current:y,onOpenCommit:_})})]}),(0,Q.jsx)(fr,{className:`hidden w-28 shrink-0 text-xs text-muted-foreground @2xl/graph:block @3xl/graph:w-40`,text:n.author.name}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-right text-xs whitespace-nowrap text-muted-foreground tabular-nums`,children:N})]}),t[37]=N,t[38]=d,t[39]=n.author.name,t[40]=n.oid,t[41]=y,t[42]=C,t[43]=a,t[44]=f,t[45]=x,t[46]=_,t[47]=r,t[48]=j,t[49]=V):V=t[49];let H;t[50]!==B||t[51]!==V?(H=(0,Q.jsx)(uH,{render:B,children:V}),t[50]=B,t[51]=V,t[52]=H):H=t[52];let U=m?`none`:`trigger`,W;t[53]===u?W=t[54]:(W=u&&(0,Q.jsxs)(dn,{onSelect:()=>{(0,th.flushSync)(()=>h(!0)),u.open()},children:[(0,Q.jsx)(Lh,{}),u.label]}),t[53]=u,t[54]=W);let G;t[55]===n.oid?G=t[56]:(G=()=>Zt(n.oid,`commit id`),t[55]=n.oid,t[56]=G);let K;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(Bs,{}),t[57]=K):K=t[57];let q;t[58]===G?q=t[59]:(q=(0,Q.jsxs)(dn,{onSelect:G,children:[K,`Copy commit id`]}),t[58]=G,t[59]=q);let J;t[60]===n?J=t[61]:(J=()=>Zt(Iy(n),`commit message`),t[60]=n,t[61]=J);let ee;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(Bs,{}),t[62]=ee):ee=t[62];let te;t[63]===J?te=t[64]:(te=(0,Q.jsxs)(dn,{onSelect:J,children:[ee,`Copy message`]}),t[63]=J,t[64]=te);let ne;t[65]!==U||t[66]!==W||t[67]!==q||t[68]!==te?(ne=(0,Q.jsxs)(dH,{finalFocus:U,children:[W,q,te]}),t[65]=U,t[66]=W,t[67]=q,t[68]=te,t[69]=ne):ne=t[69];let re;return t[70]!==H||t[71]!==ne?(re=(0,Q.jsxs)(Wt,{onOpenChange:P,children:[H,ne]}),t[70]=H,t[71]=ne,t[72]=re):re=t[72],re}var fZ=[`text-graph-1`,`text-graph-2`,`text-graph-3`,`text-graph-4`,`text-graph-5`,`text-graph-6`],pZ=e=>fZ[e%fZ.length]??fZ[0];function mZ(e){let t=(0,$.c)(11),{rows:n,width:r,rowHeight:i,gutter:a}=e,o;t[0]===a?o=t[1]:(o=e=>RX(e,a),t[0]=a,t[1]=o);let s=o,c=n.length*i,l;t[2]!==a||t[3]!==s||t[4]!==i||t[5]!==n?(l=n.map((e,t)=>{let r=t*i+i*.5,o=n[t+1],c=e.lanesAfter.flatMap((r,i)=>{if(r==null||o==null)return[];let a=e.outgoing.includes(i)?s(e.lane):s(i),c=r===o.commit.oid?s(o.lane):s(i),l=[a];return a!==s(i)&&n[t-1]?.lanesAfter[i]===r&&l.push(s(i)),l.map(e=>({lane:i,startX:e,endX:c}))}),l=e.commit.parentOids.length>1;return(0,Q.jsxs)(`g`,{children:[c.map(e=>{let{lane:t,startX:n,endX:o}=e;return(0,Q.jsx)(`path`,{d:n===o?`M ${n} ${r} L ${o} ${r+i}`:`M ${n} ${r} C ${n} ${r+i*.5}, ${o} ${r+i*.5}, ${o} ${r+i}`,fill:`none`,stroke:`currentColor`,strokeWidth:ge,className:pZ(Math.min(t,a.lastLane))},`${t}-${n}`)}),(0,Q.jsx)(`circle`,{cx:s(e.lane),cy:r,r:l?5:4,fill:l?`var(--card)`:`currentColor`,stroke:`currentColor`,strokeWidth:2,className:pZ(Math.min(e.lane,a.lastLane))})]},e.commit.oid)}),t[2]=a,t[3]=s,t[4]=i,t[5]=n,t[6]=l):l=t[6];let u;return t[7]!==c||t[8]!==l||t[9]!==r?(u=(0,Q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-2 left-1.5`,"data-testid":`history-graph`,width:r,height:c,children:l}),t[7]=c,t[8]=l,t[9]=r,t[10]=u):u=t[10],u}function hZ(e){let t=(0,$.c)(49),{label:n,layout:r,history:i,selected:a,onSelect:o,sideLabel:s,highlightHead:c}=e,l=c!==void 0&&c,u,d,f,p,m,h,g,_,v;if(t[0]!==l||t[1]!==i.commits||t[2]!==i.snapshot||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a||t[7]!==s){f=FX(i.commits),u=r===`stacked`?LX:IX,v=zX(f,u),d=r===`columns`?30:44;let e=i.snapshot?.tipOid,c=i.snapshot?.head.kind===`attached`?i.snapshot.head.ref:void 0;_=`relative py-2 pr-3 pl-1.5`,p=n,m=`flex flex-col`,h=gZ;let y;t[17]!==c||t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==d||t[22]!==a||t[23]!==s||t[24]!==e||t[25]!==v?(y=t=>{let{commit:n}=t;return(0,Q.jsx)(`li`,{children:(0,Q.jsx)(dZ,{commit:n,selected:a===n.oid,height:d,inset:v+8,layout:r,head:l&&n.oid===e,headRef:c,onSelect:e=>o(n.oid,e),openToSide:{label:s,open:()=>o(n.oid,!0)}})},n.oid)},t[17]=c,t[18]=l,t[19]=r,t[20]=o,t[21]=d,t[22]=a,t[23]=s,t[24]=e,t[25]=v,t[26]=y):y=t[26],g=f.map(y),t[0]=l,t[1]=i.commits,t[2]=i.snapshot,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=s,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g,t[15]=_,t[16]=v}else u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=t[16];let y;t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g?(y=(0,Q.jsx)(`ol`,{"aria-label":p,className:m,onKeyDown:h,children:g}),t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=y):y=t[31];let b;t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==v?(b=(0,Q.jsx)(mZ,{rows:f,width:v,rowHeight:d,gutter:u}),t[32]=u,t[33]=d,t[34]=f,t[35]=v,t[36]=b):b=t[36];let x;t[37]===v?x=t[38]:(x={paddingLeft:v},t[37]=v,t[38]=x);let S;t[39]===i?S=t[40]:(S=(0,Q.jsx)(_Z,{history:i}),t[39]=i,t[40]=S);let C;t[41]!==S||t[42]!==x?(C=(0,Q.jsx)(`div`,{style:x,children:S}),t[41]=S,t[42]=x,t[43]=C):C=t[43];let w;return t[44]!==C||t[45]!==_||t[46]!==y||t[47]!==b?(w=(0,Q.jsxs)(`div`,{className:_,children:[y,b,C]}),t[44]=C,t[45]=_,t[46]=y,t[47]=b,t[48]=w):w=t[48],w}function gZ(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=Array.from(e.currentTarget.querySelectorAll(`button[aria-pressed]`)),n=e.target instanceof Element?e.target.closest(`li`):null,r=t.findIndex(e=>e.closest(`li`)===n);if(r<0)return;e.preventDefault(),e.stopPropagation();let i=t[r+(e.key===`ArrowDown`?1:-1)];i&&(i.focus(),i.click())}function _Z(e){let t=(0,$.c)(11),{history:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(vZ,{history:n}),t[0]=n,t[1]=r);let i;t[2]!==n.nextAfter||t[3]!==n.result?(i=n.nextAfter!==null&&n.nextAfter!==void 0&&!n.result.waiting&&!Mi(n.result),t[2]=n.nextAfter,t[3]=n.result,t[4]=i):i=t[4];let a;t[5]!==n.readMore||t[6]!==i?(a=(0,Q.jsx)(nZ,{enabled:i,onVisible:n.readMore}),t[5]=n.readMore,t[6]=i,t[7]=a):a=t[7];let o;return t[8]!==r||t[9]!==a?(o=(0,Q.jsxs)(Q.Fragment,{children:[r,a]}),t[8]=r,t[9]=a,t[10]=o):o=t[10],o}function vZ(e){let t=(0,$.c)(8),{history:n}=e;if(n.result.waiting){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`px-2 py-3`,children:(0,Q.jsx)(Be,{label:`Reading older commits`})}),t[0]=e):e=t[0],e}if(Mi(n.result)){let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{children:`Older commits could not be loaded.`}),t[1]=e):e=t[1];let r;return t[2]===n.readMore?r=t[3]:(r=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-2 text-2xs text-muted-foreground`,children:[e,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:n.readMore,children:`Try again`})]}),t[2]=n.readMore,t[3]=r),r}if(n.nextAfter===null||n.nextAfter===void 0){let e;t[4]===n.boundary?e=t[5]:(e=Gy(n.boundary),t[4]=n.boundary,t[5]=e);let r;return t[6]===e?r=t[7]:(r=(0,Q.jsx)(`p`,{className:`px-2 py-3 text-2xs text-muted-foreground`,children:e}),t[6]=e,t[7]=r),r}return null}function yZ(e,t){let n=(0,$.c)(4),r=t===void 0?`scrollOffset`:t,i=Ot(E),a;return n[0]!==e||n[1]!==r||n[2]!==i?(a={ref:t=>{if(!t)return;let n=t.querySelector(`[data-slot="scroll-area-viewport"]`)??t;n.scrollTop=i.get(e)[r]},onScrollCapture:t=>{t.target instanceof HTMLElement&&i.set(e,{...i.get(e),[r]:t.target.scrollTop})}},n[0]=e,n[1]=r,n[2]=i,n[3]=a):a=n[3],a}function bZ(e){let t=(0,$.c)(32),{scope:n,connection:r,selected:i,onSelect:a,sideLabel:o,onOpenGraph:s,onOpenChanges:c}=e,{history:l,overview:u,overviewPending:d,tracking:f}=tZ(r,n),p=u?.changes.length??0,m;t[0]!==r||t[1]!==n?(m=WX({connection:r,scope:n,kind:`commits`}),t[0]=r,t[1]=n,t[2]=m):m=t[2];let h=yZ(m),g;t[3]===f?g=t[4]:(g=(0,Q.jsx)(`section`,{"aria-label":`Branch`,className:`flex shrink-0 border-b px-3.5 py-2.5`,children:(0,Q.jsx)(QX,{tracking:f})}),t[3]=f,t[4]=g);let _;t[5]===l?_=t[6]:(_=(0,Q.jsx)(SZ,{history:l}),t[5]=l,t[6]=_);let v;t[7]!==c||t[8]!==p?(v=p>0&&(0,Q.jsx)(`div`,{className:`pt-2 pr-3 pl-1.5`,children:(0,Q.jsxs)(`button`,{type:`button`,onClick:c,className:`flex h-9 w-full items-center gap-2 rounded-lg px-2 text-left text-caption transition-colors hover:bg-accent`,children:[(0,Q.jsx)(kh,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{className:`flex-1`,text:`Uncommitted changes`}),(0,Q.jsx)(`span`,{className:`text-2xs text-muted-foreground tabular-nums`,children:Vt(p,`file`)})]})}),t[7]=c,t[8]=p,t[9]=v):v=t[9];let y;t[10]!==l.commits.length||t[11]!==d?(y=!d&&l.commits.length===0&&(0,Q.jsx)(CZ,{}),t[10]=l.commits.length,t[11]=d,t[12]=y):y=t[12];let b;t[13]!==l||t[14]!==a||t[15]!==d||t[16]!==i||t[17]!==o?(b=!d&&l.commits.length>0&&(0,Q.jsx)(hZ,{label:`Commits`,layout:`stacked`,history:l,selected:i||l.selected||``,onSelect:(e,t)=>{l.select(e),a(e,t)},sideLabel:o}),t[13]=l,t[14]=a,t[15]=d,t[16]=i,t[17]=o,t[18]=b):b=t[18];let x;t[19]!==h||t[20]!==v||t[21]!==y||t[22]!==b?(x=(0,Q.jsxs)(JV,{className:`min-h-0 flex-initial`,role:`region`,"aria-label":`History reading area`,...h,children:[v,y,b]}),t[19]=h,t[20]=v,t[21]=y,t[22]=b,t[23]=x):x=t[23];let S;t[24]!==l.commits.length||t[25]!==s?(S=l.commits.length>0&&(0,Q.jsx)(`div`,{className:`shrink-0 border-t p-1.5`,children:(0,Q.jsxs)(X,{variant:`ghost`,className:`w-full justify-start`,onClick:s,children:[(0,Q.jsx)(xg,{}),`Open graph`,(0,Q.jsx)(ci,{className:`ml-auto text-muted-foreground`})]})}),t[24]=l.commits.length,t[25]=s,t[26]=S):S=t[26];let C;return t[27]!==g||t[28]!==_||t[29]!==x||t[30]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[g,_,x,S]}),t[27]=g,t[28]=_,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function xZ(e){let t=(0,$.c)(7),{history:n}=e,r;t[0]===n.snapshot?r=t[1]:(r=n.snapshot!==null&&n.snapshot!==void 0&&(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b px-3.5 font-mono text-caption leading-4 text-muted-foreground`,children:[(0,Q.jsx)(_g,{className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1 font-medium text-foreground`,text:Wy(n.snapshot)})]}),t[0]=n.snapshot,t[1]=r);let i;t[2]===n?i=t[3]:(i=(0,Q.jsx)(SZ,{history:n}),t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(Q.Fragment,{children:[r,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function SZ(e){let t=(0,$.c)(1),{history:n}=e;if(!n.restarted)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`p`,{role:`status`,className:`shrink-0 border-b bg-muted/40 px-3.5 py-2 text-2xs text-muted-foreground`,children:`History changed. Showing it from the top.`}),t[0]=r):r=t[0],r}function CZ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(YH,{children:(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`No commits yet`})})}),e[0]=t):t=e[0],t}function wZ(e){let t=(0,$.c)(14),{scope:n,connection:r,onSelect:i,sideLabel:a}=e,o=$X(r,n),s=TH(),c;t[0]!==r||t[1]!==n?(c=WX({connection:r,scope:n,kind:`commits`}),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=yZ(c,`graphScrollOffset`),u;t[3]===o?u=t[4]:(u=(0,Q.jsx)(xZ,{history:o}),t[3]=o,t[4]=u);let d;t[5]!==o||t[6]!==i||t[7]!==s||t[8]!==a?(d=o.commits.length===0?(0,Q.jsx)(CZ,{}):(0,Q.jsx)(hZ,{label:`Commit graph`,highlightHead:!0,layout:s?`stacked`:`columns`,history:o,selected:o.selected??``,onSelect:(e,t)=>{o.select(e),i(e,t)},sideLabel:a}),t[5]=o,t[6]=i,t[7]=s,t[8]=a,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(`div`,{className:`@container/graph flex min-h-0 flex-1 flex-col overflow-auto`,role:`region`,"aria-label":`Graph reading area`,...l,children:[u,d]}),t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function TZ(e,t,n){let r=(0,$.c)(6),i={connection:e,scope:t,path:n},{value:a,result:o}=$u(YX(i)),s=Da(qX(i)),c;r[0]===s?c=r[1]:(c=()=>s(void 0),r[0]=s,r[1]=c);let l;return r[2]!==o||r[3]!==c||r[4]!==a?(l={...a,result:o,readMore:c},r[2]=o,r[3]=c,r[4]=a,r[5]=l):l=r[5],l}function EZ(e){let t=(0,$.c)(34),{scope:n,connection:r,path:i,onSelect:a,sideLabel:o}=e,s=TZ(r,n,i),c;t[0]!==r||t[1]!==i||t[2]!==n?(c=WX({connection:r,scope:n,kind:`file`,path:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=c):c=t[3];let l=c,u=Ot(l,DZ),d=Da(l),f=yZ(l),p;t[4]!==a||t[5]!==d?(p=(e,t)=>{d(t=>({...t,selected:e.commit.oid})),a({oid:e.commit.oid,path:e.path},t)},t[4]=a,t[5]=d,t[6]=p):p=t[6];let m=p;if(s.commits.length===0&&s.nextAfter===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(YH,{children:(0,Q.jsx)(XH,{children:(0,Q.jsx)(ZH,{children:`No commits touch this file`})})}),t[7]=e):e=t[7],e}let h=`Timeline of ${i}`,g;if(t[8]!==m||t[9]!==i||t[10]!==u||t[11]!==o||t[12]!==s.commits){let e;t[14]!==m||t[15]!==i||t[16]!==u||t[17]!==o?(e=e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(dZ,{commit:e.commit,selected:u===e.commit.oid,onSelect:t=>m(e,t),openToSide:{label:o,open:()=>m(e,!0)},children:(0,Q.jsx)(fr,{className:`text-2xs text-muted-foreground`,text:Fy(e,i)})})},e.commit.oid),t[14]=m,t[15]=i,t[16]=u,t[17]=o,t[18]=e):e=t[18],g=s.commits.map(e),t[8]=m,t[9]=i,t[10]=u,t[11]=o,t[12]=s.commits,t[13]=g}else g=t[13];let _;t[19]===s.restarted?_=t[20]:(_=s.restarted&&(0,Q.jsx)(`span`,{role:`status`,children:`History changed. Showing it from the top.`}),t[19]=s.restarted,t[20]=_);let v;t[21]===s?v=t[22]:(v=(0,Q.jsx)(OZ,{timeline:s}),t[21]=s,t[22]=v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`A merge appears only when its own result changed the file.`}),t[23]=y):y=t[23];let b;t[24]!==_||t[25]!==v?(b=(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-3 text-2xs text-muted-foreground`,children:[_,v,y]}),t[24]=_,t[25]=v,t[26]=b):b=t[26];let x;t[27]!==h||t[28]!==g||t[29]!==b?(x=(0,Q.jsxs)(`ol`,{"aria-label":h,className:`flex flex-col p-2`,children:[g,b]}),t[27]=h,t[28]=g,t[29]=b,t[30]=x):x=t[30];let S;return t[31]!==f||t[32]!==x?(S=(0,Q.jsx)(`div`,{role:`region`,"aria-label":`Timeline reading area`,className:`min-h-0 flex-1 overflow-auto`,...f,children:x}),t[31]=f,t[32]=x,t[33]=S):S=t[33],S}function DZ(e){return e.selected}function OZ(e){let t=(0,$.c)(7),{timeline:n}=e;if(Mi(n.result)){let e;return t[0]===n.readMore?e=t[1]:(e=(0,Q.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2`,children:[`Older commits could not be loaded.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:n.readMore,children:`Try again`})]}),t[0]=n.readMore,t[1]=e),e}if(n.nextAfter){let e;return t[2]!==n.readMore||t[3]!==n.result.waiting?(e=(0,Q.jsx)(ji,{pending:n.result.waiting,size:`sm`,variant:`outline`,className:`self-start`,onClick:n.readMore,children:`Load older commits`}),t[2]=n.readMore,t[3]=n.result.waiting,t[4]=e):e=t[4],e}let r=n.boundary===`shallow`?`Shallow clone: older history is not available.`:`Start of this file’s history.`,i;return t[5]===r?i=t[6]:(i=(0,Q.jsx)(`span`,{children:r}),t[5]=r,t[6]=i),i}function kZ(e){let t=(0,$.c)(15),{scope:n,connection:r,sideLabel:i,status:a,onOpenCommit:o,onOpenGraph:s}=e,{history:c,tracking:l}=tZ(r,n),u=c.snapshot?.head.kind===`attached`?c.snapshot.head.ref:void 0,d;if(t[0]!==u||t[1]!==c.commits||t[2]!==o||t[3]!==s||t[4]!==i||t[5]!==a||t[6]!==l){let e=c.commits.slice(0,8),n;t[8]===l?n=t[9]:(n=(0,Q.jsx)(QX,{tracking:l,title:!0}),t[8]=l,t[9]=n);let r;t[10]===a?r=t[11]:(r=(0,Q.jsx)(`div`,{className:`pl-6`,children:a}),t[10]=a,t[11]=r);let f;t[12]!==n||t[13]!==r?(f=(0,Q.jsxs)(`section`,{"aria-label":`Branch`,className:`flex flex-col gap-3 px-2`,children:[n,r]}),t[12]=n,t[13]=r,t[14]=f):f=t[14],d=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[f,e.length>0&&(0,Q.jsxs)(`section`,{"aria-labelledby":`recent-commits`,className:`@container/graph flex flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex h-8 items-center gap-2 border-b px-2`,children:[(0,Q.jsx)(`h2`,{id:`recent-commits`,className:`min-w-0 flex-1 text-caption font-medium text-muted-foreground`,children:`Recent commits`}),(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,onClick:s,children:[`Open graph`,(0,Q.jsx)(ci,{className:`text-muted-foreground`})]})]}),(0,Q.jsx)(`ol`,{"aria-label":`Recent commits`,className:`flex flex-col pt-1`,children:e.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(dZ,{commit:e,selected:!1,height:30,inset:8,layout:`columns`,headRef:u,onSelect:t=>o(e.oid,t),openToSide:{label:i,open:()=>o(e.oid,!0)}})},e.oid))})]})]}),t[0]=u,t[1]=c.commits,t[2]=o,t[3]=s,t[4]=i,t[5]=a,t[6]=l,t[7]=d}else d=t[7];return d}function AZ(e){let t=(0,$.c)(2),n;return t[0]===e.connection?n=t[1]:(n=_r(e.connection),t[0]=e.connection,t[1]=n),Ot(n)}var jZ=_s(`BrowserCommitDraft.submit`)(function*(e,t,n){return yield*hi($o(function*(){let r=yield*Xo(rc(),e=>ii(e,V)),i=new AbortController,a=()=>{xo(ii(r,V))};return yield*Xo(Es(()=>{t.add(i),i.signal.addEventListener(`abort`,a,{once:!0})}),()=>Es(()=>{i.signal.removeEventListener(`abort`,a),t.delete(i)})),yield*e(n,r)}))});function MZ(e,t,n){let r=(0,$.c)(12),i;r[0]!==t.connection||r[1]!==e?(i=Er({connection:t.connection,scope:e}),r[0]=t.connection,r[1]=e,r[2]=i):i=r[2];let{value:a}=$u(i),o;r[3]!==t.connection||r[4]!==e?(o=qe({connection:t.connection,scope:e}),r[3]=t.connection,r[4]=e,r[5]=o):o=r[5];let s=Ot(o),c;r[6]!==n||r[7]!==a?(c=e=>jZ(a,n,e),r[6]=n,r[7]=a,r[8]=c):c=r[8];let l;return r[9]!==s||r[10]!==c?(l={result:s,submit:c},r[9]=s,r[10]=c,r[11]=l):l=r[11],l}function NZ(e,t,n,r){let i=(0,$.c)(121),{scope:a,status:o,action:s,onBusy:c,onLookAgain:l,initialMessage:u,lastCommitMessage:d}=e,f=s===void 0?`commit`:s,p=u===void 0?``:u,m=d===void 0?``:d,h;i[0]!==f||i[1]!==p||i[2]!==m?(h=NY(f,p,m),i[0]=f,i[1]=p,i[2]=m,i[3]=h):h=i[3];let g;i[4]===h?g=i[5]:(g={defaultValues:h},i[4]=h,i[5]=g);let _=Zd(g),v;i[6]===_?v=i[7]:(v=GY(_),i[6]=_,i[7]=v);let y=v,b;i[8]===_?b=i[9]:(b=KY(_),i[8]=_,i[9]=b);let x=b,{mode:S,message:C,amendMessage:w,excluded:T,added:E,groups:D}=Pu(_.store,zZ),{done:O,activeGroup:k,ownHead:A,busy:j,error:M,drafted:N,draftedBy:P,editingFiles:F}=La(y),I;i[10]===_?I=i[11]:(I=e=>_.setFieldValue(`mode`,e),i[10]=_,i[11]=I);let L=I,R;i[12]===_?R=i[13]:(R=e=>_.setFieldValue(`message`,e),i[12]=_,i[13]=R);let z=R,B;i[14]===_?B=i[15]:(B=e=>_.setFieldValue(`amendMessage`,e),i[14]=_,i[15]=B);let V=B,H;i[16]===_?H=i[17]:(H=e=>_.setFieldValue(`excluded`,e),i[16]=_,i[17]=H);let U=H,W;i[18]===_?W=i[19]:(W=e=>_.setFieldValue(`added`,e),i[18]=_,i[19]=W);let G=W,K;i[20]===_?K=i[21]:(K=e=>_.setFieldValue(`groups`,e),i[20]=_,i[21]=K);let q=K,J;i[22]===y?J=i[23]:(J=e=>y.update(t=>({...t,done:typeof e==`function`?e(t.done):e})),i[22]=y,i[23]=J);let ee=J,te;i[24]===y?te=i[25]:(te=e=>y.update(t=>({...t,activeGroup:e})),i[24]=y,i[25]=te);let ne=te,re;i[26]===y?re=i[27]:(re=e=>y.update(t=>({...t,ownHead:e})),i[26]=y,i[27]=re);let ie=re,ae;i[28]===y?ae=i[29]:(ae=e=>y.update(t=>({...t,busy:e})),i[28]=y,i[29]=ae);let oe=ae,se;i[30]===y?se=i[31]:(se=e=>y.update(t=>({...t,error:e})),i[30]=y,i[31]=se);let ce=se,le=(e,t)=>{let n=t?.length===1?`1 selected file`:`${t?.length} selected files`;y.update(r=>({...r,drafted:{...r.drafted,[e]:t},draftedBy:{...r.draftedBy,[e]:t?`Generated by ${de(qr(me))?.find(e=>e.id===he)?.label??he} from ${n}`:null}}))},ue=S===`amend`?`amend`:`commit`,fe=qY(a,ue,t),pe=MZ(a,t,x),me=AZ(t),he=AY(de(qr(me)),r.value),ge;if(i[32]!==T||i[33]!==n){let e;i[35]===T?e=i[36]:(e=e=>!T.has(e.path),i[35]=T,i[36]=e),ge=new Set(n.filter(e).flatMap(RZ)),i[32]=T,i[33]=n,i[34]=ge}else ge=i[34];let _e;i[37]===ge?_e=i[38]:(_e=[...ge],i[37]=ge,i[38]=_e);let ve=_e,ye;if(i[39]!==E||i[40]!==n){let e;i[42]===E?e=i[43]:(e=e=>E.has(e.path),i[42]=E,i[43]=e),ye=new Set(n.filter(e).flatMap(LZ)),i[39]=E,i[40]=n,i[41]=ye}else ye=i[41];let be;i[44]===ye?be=i[45]:(be=[...ye],i[44]=ye,i[45]=be);let xe=ue===`amend`?be:ve,Se=ue===`amend`?w:C,Ce=!(!fe.operation||fe.canStartNew),we=fe.operation?.receipt,Te=j||pe.result.waiting||fe.recovered.waiting,Ee=D?N.groups:N.message,De;i[46]!==Ee||i[47]!==ue||i[48]!==O||i[49]!==D||i[50]!==o?(De=ue===`commit`&&Ee!=null&&PY(o,Ee,new Set((D??[]).filter(e=>O.has(e.id)).flatMap(IZ))),i[46]=Ee,i[47]=ue,i[48]=O,i[49]=D,i[50]=o,i[51]=De):De=i[51];let Oe=De,ke;i[52]!==n||i[53]!==D?(ke=D?n.filter(e=>!D.some(t=>t.paths.includes(e.path))):[],i[52]=n,i[53]=D,i[54]=ke):ke=i[54];let Ae=ke,je;i[55]!==ue||i[56]!==Se||i[57]!==O||i[58]!==D||i[59]!==S||i[60]!==xe||i[61]!==Oe||i[62]!==o?(je=Oe||(S===`groups`?!D?.length||D.filter(e=>!O.has(e.id)).some(FZ):!Se.trim()||ue!==`amend`&&o.inProgress!==`merge`&&!xe.length),i[55]=ue,i[56]=Se,i[57]=O,i[58]=D,i[59]=S,i[60]=xe,i[61]=Oe,i[62]=o,i[63]=je):je=i[63];let Me=je,Ne;i[64]===o?Ne=i[65]:(Ne=Bt(`commit`,o),i[64]=o,i[65]=Ne);let Pe=Ne,Fe;i[66]===o?Fe=i[67]:(Fe=Bt(`amend`,o),i[66]=o,i[67]=Fe);let Ie=Fe,Le;i[68]===l?Le=i[69]:(Le=l?Ui({try:l,catch:PZ}):void 0,i[68]=l,i[69]=Le);let Re;return i[70]!==k||i[71]!==E||i[72]!==w||i[73]!==Ie||i[74]!==Me||i[75]!==j||i[76]!==ue||i[77]!==Pe||i[78]!==ve||i[79]!==x||i[80]!==Se||i[81]!==O||i[82]!==N||i[83]!==P||i[84]!==F||i[85]!==M||i[86]!==T||i[87]!==n||i[88]!==_||i[89]!==pe||i[90]!==fe||i[91]!==D||i[92]!==Ae||i[93]!==C||i[94]!==S||i[95]!==he||i[96]!==me||i[97]!==c||i[98]!==A||i[99]!==xe||i[100]!==we||i[101]!==a||i[102]!==ne||i[103]!==G||i[104]!==V||i[105]!==oe||i[106]!==ee||i[107]!==le||i[108]!==ce||i[109]!==U||i[110]!==q||i[111]!==z||i[112]!==L||i[113]!==ie||i[114]!==Oe||i[115]!==y||i[116]!==o||i[117]!==Le||i[118]!==Ce||i[119]!==Te?(Re={scope:a,status:o,onBusy:c,onLookAgain:Le,createId:li,mode:S,commitAction:ue,git:fe,generator:pe,models:me,model:he,message:C,amendMessage:w,editingFiles:F,excluded:T,added:E,groups:D,done:O,activeGroup:k,ownHead:A,busy:j,error:M,drafted:N,draftedBy:P,files:n,commitPaths:ve,paths:xe,currentMessage:Se,uncertain:Ce,receipt:we,working:Te,staleDraft:Oe,leftUncommitted:Ae,blocker:Me,commitModeBlocker:Pe,amendModeBlocker:Ie,controllers:x,form:_,setMode:L,setMessage:z,setAmendMessage:V,setExcluded:U,setAdded:G,setGroups:q,setDone:ee,setActiveGroup:ne,setOwnHead:ie,setBusy:oe,setError:ce,setDrafted:le,state:y},i[70]=k,i[71]=E,i[72]=w,i[73]=Ie,i[74]=Me,i[75]=j,i[76]=ue,i[77]=Pe,i[78]=ve,i[79]=x,i[80]=Se,i[81]=O,i[82]=N,i[83]=P,i[84]=F,i[85]=M,i[86]=T,i[87]=n,i[88]=_,i[89]=pe,i[90]=fe,i[91]=D,i[92]=Ae,i[93]=C,i[94]=S,i[95]=he,i[96]=me,i[97]=c,i[98]=A,i[99]=xe,i[100]=we,i[101]=a,i[102]=ne,i[103]=G,i[104]=V,i[105]=oe,i[106]=ee,i[107]=le,i[108]=ce,i[109]=U,i[110]=q,i[111]=z,i[112]=L,i[113]=ie,i[114]=Oe,i[115]=y,i[116]=o,i[117]=Le,i[118]=Ce,i[119]=Te,i[120]=Re):Re=i[120],Re}function PZ(e){return new Rt(e,Un(e))}function FZ(e){return!e.message.trim()||!e.paths.length}function IZ(e){return e.paths}function LZ(e){return e.paths}function RZ(e){return e.paths}function zZ(e){return e.values}function BZ(e,t,n,r){let i=(0,$.c)(46),a=NZ(e,t,n,r),{state:o,form:s,commitAction:c,setMode:l,setGroups:u,setDrafted:d,setAmendMessage:f,setMessage:p,setAdded:m,setExcluded:h}=a,g,_,v,y;i[0]===a?(g=i[1],_=i[2],v=i[3],y=i[4]):(g=()=>xo(me(a)),_=()=>xo(Re(a,a.mode===`groups`?`groups`:`message`)),v=()=>xo(ft(a)),y=()=>xo(hn(a)),i[0]=a,i[1]=g,i[2]=_,i[3]=v,i[4]=y);let b;i[5]===o?b=i[6]:(b=()=>o.update(VZ),i[5]=o,i[6]=b);let x;i[7]!==c||i[8]!==f||i[9]!==p?(x=e=>{c===`amend`?f(e):p(e)},i[7]=c,i[8]=f,i[9]=p,i[10]=x):x=i[10];let S;i[11]!==d||i[12]!==u||i[13]!==l?(S=e=>{(e===`single`||e===`amend`||e===`groups`)&&(l(e),e===`single`&&(u(null),d(`groups`,null)))},i[11]=d,i[12]=u,i[13]=l,i[14]=S):S=i[14];let C;i[15]!==c||i[16]!==s||i[17]!==m||i[18]!==h?(C=(e,t)=>{if(c===`amend`){let n=new Set(s.state.values.added);t?n.add(e):n.delete(e),m(n)}else{let n=new Set(s.state.values.excluded);t?n.delete(e):n.add(e),h(n)}},i[15]=c,i[16]=s,i[17]=m,i[18]=h,i[19]=C):C=i[19];let w,T,E,D;i[20]!==s||i[21]!==u?(E=e=>u(s.state.values.groups?.filter(t=>t.id!==e)??null),D=(e,t)=>u(s.state.values.groups?.map(n=>n.id===e?{...n,message:t}:n)??null),w=(e,t)=>u(s.state.values.groups?.map(n=>({...n,paths:[...n.paths.filter(t=>!e.includes(t)),...n.id===t?e:[]]}))??null),T=()=>u([...s.state.values.groups??[],{id:li(),message:``,paths:[]}]),i[20]=s,i[21]=u,i[22]=w,i[23]=T,i[24]=E,i[25]=D):(w=i[22],T=i[23],E=i[24],D=i[25]);let O;i[26]!==d||i[27]!==u||i[28]!==l?(O=()=>{l(`single`),u(null),d(`groups`,null)},i[26]=d,i[27]=u,i[28]=l,i[29]=O):O=i[29];let k;return i[30]!==r.set||i[31]!==a||i[32]!==g||i[33]!==_||i[34]!==w||i[35]!==T||i[36]!==O||i[37]!==v||i[38]!==y||i[39]!==b||i[40]!==x||i[41]!==S||i[42]!==C||i[43]!==E||i[44]!==D?(k={...a,messageLimit:rs,groupLimit:20,commit:g,generate:_,lookAgain:v,checkOutcome:y,setModel:r.set,toggleEditingFiles:b,setCurrentMessage:x,setMode:S,setIncluded:C,removeGroup:E,setGroupMessage:D,moveFile:w,addGroup:T,clearGroups:O},i[30]=r.set,i[31]=a,i[32]=g,i[33]=_,i[34]=w,i[35]=T,i[36]=O,i[37]=v,i[38]=y,i[39]=b,i[40]=x,i[41]=S,i[42]=C,i[43]=E,i[44]=D,i[45]=k):k=i[45],k}function VZ(e){return{...e,editingFiles:!e.editingFiles}}var HZ=dt(e=>Oe(t=>{t.addFinalizer(()=>{for(let t of e)t.abort();e.clear()})}));function UZ(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=HZ(e),t[0]=e,t[1]=n),Lt(n)}function WZ(e){let t=(0,$.c)(113),{status:n,liveBranch:r,onLookAgain:i}=e,{preferences:a,setPreference:o}=Bu(),s=e.context,c;t[0]===e.status.changes?c=t[1]:(c=$v(e.status.changes),t[0]=e.status.changes,t[1]=c);let l;t[2]===o?l=t[3]:(l=e=>o(`commitModel`,e),t[2]=o,t[3]=l);let u;t[4]!==a.commitModel||t[5]!==l?(u={value:a.commitModel,set:l},t[4]=a.commitModel,t[5]=l,t[6]=u):u=t[6];let d=BZ(e,s,c,u);UZ(d.controllers);let[f,p]=(0,Z.useState)(d.mode===`groups`),m=na(e.context),{mode:h,commitAction:g,git:_,model:v,groups:y,done:b,commitPaths:x,uncertain:S,receipt:C,working:w,error:T,staleDraft:E,blocker:D,commitModeBlocker:O,amendModeBlocker:k}=d,A=O!=null,j=!A,M;t[7]===j?M=t[8]:(M={value:`single`,label:`Single commit`,available:j},t[7]=j,t[8]=M);let N=k==null,P;t[9]===N?P=t[10]:(P={value:`amend`,label:`Amend last`,available:N},t[9]=N,t[10]=P);let F=!A&&!!v,I=x.length>0,L;t[11]!==F||t[12]!==I?(L={value:`groups`,label:`Use groups`,available:F,ready:I},t[11]=F,t[12]=I,t[13]=L):L=t[13];let R;t[14]!==L||t[15]!==M||t[16]!==P?(R=[M,P,L],t[14]=L,t[15]=M,t[16]=P,t[17]=R):R=t[17];let z;t[18]!==h||t[19]!==R?(z=R.filter(e=>e.available||e.value===h),t[18]=h,t[19]=R,t[20]=z):z=t[20];let B=z,V,H;t[21]!==D||t[22]!==d||t[23]!==S||t[24]!==w||t[25]!==m?(V=e=>{e.preventDefault(),m||D||w||S||d.commit()},H=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),m||D||w||S||d.commit())},t[21]=D,t[22]=d,t[23]=S,t[24]=w,t[25]=m,t[26]=V,t[27]=H):(V=t[26],H=t[27]);let U=g===`amend`?`Amend last commit`:`Commit changes`,W;t[28]===U?W=t[29]:(W=(0,Q.jsx)(wz,{children:U}),t[28]=U,t[29]=W);let G=g===`amend`?`The last commit is replaced by one with this message and the files you add.`:`Committed steps fold away in the review and show up in History.`,K;t[30]===G?K=t[31]:(K=(0,Q.jsx)(Tz,{children:G}),t[30]=G,t[31]=K);let q;t[32]!==W||t[33]!==K?(q=(0,Q.jsxs)(Sz,{children:[W,K]}),t[32]=W,t[33]=K,t[34]=q):q=t[34];let J=r??void 0,ee;t[35]===J?ee=t[36]:(ee=Ky(J,null),t[35]=J,t[36]=ee);let te;t[37]===ee?te=t[38]:(te=(0,Q.jsx)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2 text-caption`,children:(0,Q.jsx)(QX,{tracking:ee})}),t[37]=ee,t[38]=te);let ne;t[39]!==d.setMode||t[40]!==h||t[41]!==B||t[42]!==n.inProgress||t[43]!==w?(ne=n.inProgress!==`merge`&&B.length>1&&(0,Q.jsx)(Nu,{value:h,onValueChange:d.setMode,children:(0,Q.jsx)(kd,{className:`w-full`,children:B.map(e=>(0,Q.jsx)(hd,{value:e.value,className:`flex-1`,disabled:w||!e.available||e.ready===!1,children:e.label},e.value))})}),t[39]=d.setMode,t[40]=h,t[41]=B,t[42]=n.inProgress,t[43]=w,t[44]=ne):ne=t[44];let re=w||S,ie;t[45]!==d||t[46]!==f||t[47]!==h?(ie=h===`groups`?(0,Q.jsx)(nQ,{form:d}):(0,Q.jsx)(qZ,{form:d,onMessage:f?void 0:e=>{e.focus(),p(!0)}}),t[45]=d,t[46]=f,t[47]=h,t[48]=ie):ie=t[48];let ae;t[49]!==re||t[50]!==ie?(ae=(0,Q.jsx)(`fieldset`,{disabled:re,className:`flex min-w-0 flex-col gap-3`,children:ie}),t[49]=re,t[50]=ie,t[51]=ae):ae=t[51];let oe;t[52]!==g||t[53]!==d||t[54]!==m?(oe=g===`commit`&&(0,Q.jsx)(JZ,{form:d,writeBlock:m}),t[52]=g,t[53]=d,t[54]=m,t[55]=oe):oe=t[55];let se;t[56]===E?se=t[57]:(se=E&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-graph-4`,children:`The worktree changed since this draft was proposed. Generate it again before committing.`}),t[56]=E,t[57]=se);let ce;t[58]!==g||t[59]!==e?(ce=cQ(e,g)&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:cQ(e,g)}),t[58]=g,t[59]=e,t[60]=ce):ce=t[60];let le;t[61]!==T||t[62]!==C?(le=C&&!(T&&lr(C))&&(0,Q.jsxs)(`div`,{role:`status`,className:`text-sm`,children:[(0,Q.jsx)(`p`,{children:C.state}),C.progress.map(KZ)]}),t[61]=T,t[62]=C,t[63]=le):le=t[63];let ue;t[64]!==C||t[65]!==S?(ue=S&&!C&&(0,Q.jsx)(`p`,{role:`status`,children:`Outcome not yet confirmed`}),t[64]=C,t[65]=S,t[66]=ue):ue=t[66];let de;t[67]===T?de=t[68]:(de=T?(0,Q.jsx)(rX,{text:Un(T)}):null,t[67]=T,t[68]=de);let fe;t[69]!==d.lookAgain||t[70]!==i||t[71]!==C||t[72]!==E||t[73]!==w?(fe=(E||C&&Tc(C))&&i&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:w,onClick:d.lookAgain,children:`Look again`}),t[69]=d.lookAgain,t[70]=i,t[71]=C,t[72]=E,t[73]=w,t[74]=fe):fe=t[74];let pe;t[75]!==d.checkOutcome||t[76]!==_.operation||t[77]!==C||t[78]!==w?(pe=_.operation&&!w&&!(C&&ye(C))&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,onClick:d.checkOutcome,children:`Check outcome`}),t[75]=d.checkOutcome,t[76]=_.operation,t[77]=C,t[78]=w,t[79]=pe):pe=t[79];let me;t[80]!==D||t[81]!==b||t[82]!==y||t[83]!==h||t[84]!==C||t[85]!==n.changes||t[86]!==n.inProgress||t[87]!==S||t[88]!==w||t[89]!==m?(me=!!m||w||S||!!(C&&Tc(C))||D||n.inProgress!==`merge`&&n.changes.some(GZ)||!!(h===`groups`&&y?.every(e=>b.has(e.id))),t[80]=D,t[81]=b,t[82]=y,t[83]=h,t[84]=C,t[85]=n.changes,t[86]=n.inProgress,t[87]=S,t[88]=w,t[89]=m,t[90]=me):me=t[90];let he;t[91]===d?he=t[92]:(he=lQ(d),t[91]=d,t[92]=he);let ge;t[93]!==me||t[94]!==he||t[95]!==m?(ge=(0,Q.jsx)(X,{type:`submit`,className:`self-end`,"aria-description":m,disabled:me,children:he}),t[93]=me,t[94]=he,t[95]=m,t[96]=ge):ge=t[96];let _e;return t[97]!==V||t[98]!==H||t[99]!==q||t[100]!==te||t[101]!==ne||t[102]!==ae||t[103]!==oe||t[104]!==se||t[105]!==ce||t[106]!==le||t[107]!==ue||t[108]!==de||t[109]!==fe||t[110]!==pe||t[111]!==ge?(_e=(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:V,onKeyDown:H,children:[q,te,ne,ae,oe,se,ce,le,ue,de,fe,pe,ge]}),t[97]=V,t[98]=H,t[99]=q,t[100]=te,t[101]=ne,t[102]=ae,t[103]=oe,t[104]=se,t[105]=ce,t[106]=le,t[107]=ue,t[108]=de,t[109]=fe,t[110]=pe,t[111]=ge,t[112]=_e):_e=t[112],_e}function GZ(e){return e.scope===`unmerged`}function KZ(e){return(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function qZ(e){let t=(0,$.c)(50),{form:n,onMessage:r}=e,{commitAction:i,editingFiles:a,excluded:o,added:s,files:c,paths:l,currentMessage:u,working:d}=n,f=i===`amend`?`Files to add`:`Files`,p;t[0]===f?p=t[1]:(p=(0,Q.jsx)(`span`,{className:`font-medium`,children:f}),t[0]=f,t[1]=p);let m;t[2]!==c.length||t[3]!==l.length?(m=(0,Q.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,l.length,` of `,c.length,`)`]}),t[2]=c.length,t[3]=l.length,t[4]=m):m=t[4];let h;t[5]!==i||t[6]!==a||t[7]!==c.length||t[8]!==n||t[9]!==d?(h=i===`commit`&&c.length>0&&(0,Q.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,className:`ml-auto`,disabled:d,onClick:()=>n.toggleEditingFiles(),children:a?`Done`:`Edit`}),t[5]=i,t[6]=a,t[7]=c.length,t[8]=n,t[9]=d,t[10]=h):h=t[10];let g;t[11]!==p||t[12]!==m||t[13]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-caption`,children:[p,m,h]}),t[11]=p,t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;if(t[15]!==s||t[16]!==i||t[17]!==a||t[18]!==o||t[19]!==c||t[20]!==n){let e;t[22]!==s||t[23]!==i||t[24]!==a||t[25]!==o||t[26]!==n?(e=e=>{let t=i===`amend`?s.has(e.path):!o.has(e.path),r=i===`amend`||a,c=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Gk,{path:e.path,className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:e.path}),(0,Q.jsx)(`span`,{"aria-hidden":r,className:`shrink-0 text-muted-foreground`,children:oQ(e.kind,t,i)})]});return r?(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 rounded-lg px-2 py-1 text-xs hover:bg-muted`,children:[(0,Q.jsx)(OX,{checked:t,onCheckedChange:t=>n.setIncluded(e.path,t===!0)}),c]},e.path):(0,Q.jsx)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-lg px-2 py-1 text-xs`,children:c},e.path)},t[22]=s,t[23]=i,t[24]=a,t[25]=o,t[26]=n,t[27]=e):e=t[27],_=c.map(e),t[15]=s,t[16]=i,t[17]=a,t[18]=o,t[19]=c,t[20]=n,t[21]=_}else _=t[21];let v;t[28]===_?v=t[29]:(v=(0,Q.jsx)(`div`,{className:`max-h-40 overflow-auto rounded-xl border p-1`,children:_}),t[28]=_,t[29]=v);let y;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(Qa,{htmlFor:`commit-message`,children:`Message`}),t[30]=y):y=t[30];let b;t[31]!==i||t[32]!==n.draftedBy?(b=i===`commit`&&n.draftedBy.message&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.draftedBy.message}),t[31]=i,t[32]=n.draftedBy,t[33]=b):b=t[33];let x;t[34]===r?x=t[35]:(x=e=>{e&&r?.(e)},t[34]=r,t[35]=x);let S;t[36]===n?S=t[37]:(S=e=>n.setCurrentMessage(e.target.value),t[36]=n,t[37]=S);let C;t[38]!==u||t[39]!==n.messageLimit||t[40]!==x||t[41]!==S?(C=(0,Q.jsx)(gH,{"data-autofocus":``,ref:x,id:`commit-message`,value:u,onChange:S,rows:4,maxLength:n.messageLimit,placeholder:`Describe what changed and why`}),t[38]=u,t[39]=n.messageLimit,t[40]=x,t[41]=S,t[42]=C):C=t[42];let w;t[43]!==C||t[44]!==b?(w=(0,Q.jsxs)(Oo,{children:[y,b,C]}),t[43]=C,t[44]=b,t[45]=w):w=t[45];let T;return t[46]!==w||t[47]!==g||t[48]!==v?(T=(0,Q.jsxs)(Q.Fragment,{children:[g,v,w]}),t[46]=w,t[47]=g,t[48]=v,t[49]=T):T=t[49],T}function JZ(e){let t=(0,$.c)(31),{form:n,writeBlock:r}=e,{models:i,model:a}=n,o,s,c,l,u;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r){let e=de(qr(i));o=!e&&!Mi(i);let d;t[9]!==n||t[10]!==r?(d=r??$Z(n),t[9]=n,t[10]=r,t[11]=d):d=t[11],s=d;let f;t[12]!==n||t[13]!==r?(f=!!r||eQ(n),t[12]=n,t[13]=r,t[14]=f):f=t[14];let p=f;c=`flex flex-wrap items-center gap-2`;let m=o||p||n.working||n.uncertain,h;t[15]===n?h=t[16]:(h=()=>n.generate(),t[15]=n,t[16]=h);let g;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(T_,{}),t[17]=g):g=t[17];let _=n.generator.result.waiting?`Generating…`:`Generate with AI`;t[18]!==m||t[19]!==h||t[20]!==_||t[21]!==r?(l=(0,Q.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,disabled:m,"aria-description":r,onClick:h,children:[g,_]}),t[18]=m,t[19]=h,t[20]=_,t[21]=r,t[22]=l):l=t[22],u=(o||!!e?.length)&&(0,Q.jsxs)(oa,{items:e?.map(QZ)??[],value:a??null,reselect:!0,disabled:!e?.length||n.working||n.uncertain,onValueChange:n.setModel,children:[(0,Q.jsx)(ni,{"aria-label":`Commit model`,className:`w-auto max-w-48`,size:`sm`,children:(0,Q.jsx)(ec,{placeholder:o||e?.length?`Choose a model`:`No coding CLI available`})}),(0,Q.jsx)(Zi,{children:kY(e?.filter(ZZ)??[]).map(YZ)})]}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];let d;t[23]!==o||t[24]!==s?(d=!o&&s&&(0,Q.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,role:`status`,children:s}),t[23]=o,t[24]=s,t[25]=d):d=t[25];let f;return t[26]!==c||t[27]!==l||t[28]!==u||t[29]!==d?(f=(0,Q.jsxs)(`div`,{className:c,children:[l,u,d]}),t[26]=c,t[27]=l,t[28]=u,t[29]=d,t[30]=f):f=t[30],f}function YZ(e){let[t,n]=e;return(0,Q.jsxs)(Vr,{children:[(0,Q.jsx)(uc,{children:t}),n.map(XZ)]},t)}function XZ(e){return(0,Q.jsx)(Ps,{value:e.id,children:e.label},e.id)}function ZZ(e){return!e.id.endsWith(`:default`)}function QZ(e){return{value:e.id,label:e.label}}function $Z({models:e,model:t}){if(Mi(e))return`Could not load coding CLI models.`;let n=de(qr(e));return!n||t||n.some(e=>!e.id.endsWith(`:default`))?null:`No coding CLI available.`}function eQ(e){return $Z(e)!==null||!e.model||e.paths.length===0}function tQ(e,t){return e?`Groups were not proposed.`:t?`Proposing commits…`:`Generate groups with AI, then review each message and file before committing.`}function nQ(e){let t=(0,$.c)(34),{form:n}=e,{groups:r,done:i,activeGroup:a,files:o,leftUncommitted:s,error:c}=n;if(r===null){let e;t[0]!==c||t[1]!==n.working?(e=tQ(c,n.working),t[0]=c,t[1]=n.working,t[2]=e):e=t[2];let r;return t[3]===e?r=t[4]:(r=(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:e}),t[3]=e,t[4]=r),r}let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={value:`uncommitted`,label:`Leave uncommitted`},t[5]=l):l=t[5];let u;t[6]===r?u=t[7]:(u=[l,...r.map(aQ)],t[6]=r,t[7]=u);let d=u,f;t[8]===n.draftedBy.groups?f=t[9]:(f=n.draftedBy.groups&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.draftedBy.groups}),t[8]=n.draftedBy.groups,t[9]=f);let p;t[10]!==a||t[11]!==d||t[12]!==i||t[13]!==o||t[14]!==n||t[15]!==r?(p=r.map((e,t)=>(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-lg border p-3`,"aria-label":`Commit ${t+1}`,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Commit `,t+1,sQ(e.id,i,a)]}),e.paths.length===0&&i.size===0&&(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n.removeGroup(e.id),children:`Remove empty group`}),(0,Q.jsx)(gH,{"aria-label":`Message for commit ${t+1}`,value:e.message,disabled:i.has(e.id),required:!0,maxLength:n.messageLimit,onChange:t=>n.setGroupMessage(e.id,t.target.value)}),o.filter(t=>e.paths.includes(t.path)).map(t=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:t.path}),(0,Q.jsxs)(oa,{items:d,value:e.id,disabled:i.size>0,onValueChange:e=>{e&&n.moveFile(t.paths,e)},children:[(0,Q.jsx)(ni,{size:`sm`,"aria-label":`Commit for ${t.path}`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsxs)(Zi,{children:[(0,Q.jsx)(Ps,{value:`uncommitted`,children:`Leave uncommitted`}),r.map(iQ)]})]})]},t.path))]},e.id)),t[10]=a,t[11]=d,t[12]=i,t[13]=o,t[14]=n,t[15]=r,t[16]=p):p=t[16];let m;t[17]!==d||t[18]!==i.size||t[19]!==n||t[20]!==r||t[21]!==s?(m=s.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-lg border border-dashed p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Left uncommitted`}),s.map(e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:e.path}),(0,Q.jsxs)(oa,{items:d,value:`uncommitted`,disabled:i.size>0,onValueChange:t=>{t&&n.moveFile(e.paths,t)},children:[(0,Q.jsx)(ni,{size:`sm`,"aria-label":`Commit for ${e.path}`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsxs)(Zi,{children:[(0,Q.jsx)(Ps,{value:`uncommitted`,children:`Leave uncommitted`}),r.map(rQ)]})]})]},e.path))]}),t[17]=d,t[18]=i.size,t[19]=n,t[20]=r,t[21]=s,t[22]=m):m=t[22];let h;t[23]!==i.size||t[24]!==n.addGroup||t[25]!==n.clearGroups||t[26]!==n.groupLimit||t[27]!==r.length?(h=i.size===0&&(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,disabled:r.length>=n.groupLimit,onClick:n.addGroup,children:[(0,Q.jsx)(d_,{}),`Add group`]}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:n.clearGroups,children:`Single commit`})]}),t[23]=i.size,t[24]=n.addGroup,t[25]=n.clearGroups,t[26]=n.groupLimit,t[27]=r.length,t[28]=h):h=t[28];let g;return t[29]!==f||t[30]!==p||t[31]!==m||t[32]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,m,h]}),t[29]=f,t[30]=p,t[31]=m,t[32]=h,t[33]=g):g=t[33],g}function rQ(e,t){return(0,Q.jsxs)(Ps,{value:e.id,children:[`Commit `,t+1]},e.id)}function iQ(e,t){return(0,Q.jsxs)(Ps,{value:e.id,children:[`Commit `,t+1]},e.id)}function aQ(e,t){return{value:e.id,label:`Commit ${t+1}`}}function oQ(e,t,n){return t?e.replaceAll(`-`,` `):n===`amend`?`Not added`:`Excluded`}function sQ(e,t,n){return t.has(e)?` · committed`:n===e?` · in progress`:``}function cQ({status:e,liveBranch:t,replacedSubject:n},r){return r===`amend`?`Amending replaces the last commit${n?`: ${n}`:``}. ${t?.upstream&&t.ahead===0?`This commit is already on the known upstream; amending rewrites shared history.`:`Unselected staged changes stay staged.`}`:e.inProgress===`merge`?`This finishes the merge and commits every staged resolution, including staged files outside your selection.`:Yt(e)}function lQ({working:e,generator:t,groups:n,commitAction:r}){return e&&!t.result.waiting?r===`amend`?`Amending…`:`Committing…`:n&&r===`commit`?`Commit groups in order`:r===`amend`?`Amend last commit`:`Commit selected files`}function uQ(e){let t=(0,$.c)(15),{scope:n,context:r,entry:i,status:a,current:o,onBusy:s,onLookAgain:c}=e;if(i===`switch`||i===`discard`||i===`fetch`||i===`pull`||i===`push`)return null;if(i===`commit`||i===`amend`){let e;return t[0]!==r||t[1]!==i||t[2]!==s||t[3]!==c||t[4]!==n||t[5]!==a?(e=(0,Q.jsx)(dQ,{scope:n,context:r,action:i,status:a,onBusy:s,onLookAgain:c}),t[0]=r,t[1]=i,t[2]=s,t[3]=c,t[4]=n,t[5]=a,t[6]=e):e=t[6],e}let l;return t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==s||t[11]!==c||t[12]!==n||t[13]!==a?(l=(0,Q.jsx)(pQ,{scope:n,context:r,action:i,status:a,current:o,onBusy:s,onLookAgain:c},i),t[7]=r,t[8]=o,t[9]=i,t[10]=s,t[11]=c,t[12]=n,t[13]=a,t[14]=l):l=t[14],l}function dQ(e){let t=(0,$.c)(17),{scope:n,context:r,action:i,status:a,onBusy:o,onLookAgain:s}=e,c;t[0]===i?c=t[1]:(c=(0,Q.jsx)(fQ,{action:i}),t[0]=i,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Be,{label:`Reading commit details`}),t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=(0,Q.jsxs)(Q.Fragment,{children:[c,l]}),t[3]=c,t[4]=u);let d;t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s||t[9]!==n||t[10]!==a?(d=e=>{let t=e.headCommit;return i===`amend`&&!t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(fQ,{action:i}),(0,Q.jsx)(`p`,{role:`alert`,children:`The last commit could not be read. Close and try again.`})]}):(0,Q.jsx)(WZ,{scope:n,context:r,action:i,status:a,liveBranch:e.branch??a.branch,initialMessage:i===`amend`&&t?[t.subject,t.body].filter(Boolean).join(`
1344
1348
 
1345
1349
  `):``,lastCommitMessage:t?[t.subject,t.body].filter(Boolean).join(`
1346
1350
 
1347
- `):``,...t?{replacedSubject:t.subject}:{},onBusy:o,onLookAgain:s})},t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=n,t[10]=a,t[11]=d):d=t[11];let f;return t[12]!==r||t[13]!==n||t[14]!==u||t[15]!==d?(f=(0,Q.jsx)($X,{scope:n,context:r,pending:u,children:d}),t[12]=r,t[13]=n,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function ZX(e){let t=(0,$.c)(7),{action:n}=e,r=n===`amend`?`Amend last commit`:`Commit changes`,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(wz,{children:r}),t[0]=r,t[1]=i);let a=n===`amend`?`The last commit is replaced by one with this message and the files you add.`:`Committed steps fold away in the review and show up in History.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Tz,{children:a}),t[2]=a,t[3]=o);let s;return t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Sz,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6],s}function QX(e){let t=(0,$.c)(13),{scope:n,context:r,action:i,status:a,current:o,onBusy:s,onLookAgain:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Be,{label:`Reading the branch`}),t[0]=l):l=t[0];let u;t[1]!==i||t[2]!==r||t[3]!==o||t[4]!==s||t[5]!==c||t[6]!==n||t[7]!==a?(u=e=>(0,Q.jsx)(eZ,{scope:n,context:r,action:i,status:{...a,branch:e.branch??a.branch},expectedStatus:a,current:o,onBusy:s,onLookAgain:c}),t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=n,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==n||t[11]!==u?(d=(0,Q.jsx)($X,{scope:n,context:r,pending:l,children:u}),t[9]=r,t[10]=n,t[11]=u,t[12]=d):d=t[12],d}function $X(e){let t=(0,$.c)(12),{scope:n,context:r,pending:i,children:a}=e,o=sB(n,r.connection);if(Mi(o.result)){let e;t[0]===o.result.cause?e=t[1]:(e=Un(Ra(o.result.cause)),t[0]=o.result.cause,t[1]=e);let n;t[2]===e?n=t[3]:(n=(0,Q.jsx)(HJ,{text:e}),t[2]=e,t[3]=n);let r;t[4]===o.refresh?r=t[5]:(r=(0,Q.jsx)(X,{variant:`outline`,onClick:o.refresh,children:`Read status again`}),t[4]=o.refresh,t[5]=r);let i;return t[6]!==n||t[7]!==r?(i=(0,Q.jsxs)(Q.Fragment,{children:[n,r]}),t[6]=n,t[7]=r,t[8]=i):i=t[8],i}if(!Bo(o.result))return i;let s;return t[9]!==a||t[10]!==o.result.value?(s=a(o.result.value),t[9]=a,t[10]=o.result.value,t[11]=s):s=t[11],s}function eZ(e){let t=(0,$.c)(77),{scope:n,context:r,action:i,status:a,expectedStatus:o,current:s,onBusy:c,onLookAgain:l}=e,u=o===void 0?a:o,d=s===void 0?a:s,f=a.branch,[p,m]=(0,Z.useState)(`Porcelain review`),[h,g]=(0,Z.useState)(f?.stashes?.[0]?.oid??``),[_,v]=(0,Z.useState)(i===`stash-create`),y=na(r),b;t[0]!==u||t[1]!==c||t[2]!==l?(b={expectedStatus:u,onBusy:c,onLookAgain:l},t[0]=u,t[1]=c,t[2]=l,t[3]=b):b=t[3];let x=mY(n,i,r,b),{busy:C,uncertain:w,outcome:T,error:E}=x,D;t[4]===T?D=t[5]:(D=T&&Tc(T),t[4]=T,t[5]=D);let O=!!D,k;t[6]!==i||t[7]!==x||t[8]!==p||t[9]!==_||t[10]!==h||t[11]!==y?(k=e=>{e.preventDefault(),y||x.onSubmit(_J(i,{message:p,stashOid:h,option:_}))},t[6]=i,t[7]=x,t[8]=p,t[9]=_,t[10]=h,t[11]=y,t[12]=k):k=t[12];let A=C||w,j;t[13]!==i||t[14]!==_?(j=i===`stash-create`&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_?`Tracked changes and new files are set aside until you pop the stash.`:`Tracked changes are set aside. New files stay in the worktree.`}),t[13]=i,t[14]=_,t[15]=j):j=t[15];let M;t[16]!==i||t[17]!==x.messageLimit||t[18]!==p?(M=i===`stash-create`&&(0,Q.jsxs)(Oo,{children:[(0,Q.jsx)(Qa,{htmlFor:`git-message`,children:`Message`}),(0,Q.jsx)(gH,{id:`git-message`,value:p,onChange:e=>m(e.target.value),required:!0,maxLength:x.messageLimit})]}),t[16]=i,t[17]=x.messageLimit,t[18]=p,t[19]=M):M=t[19];let N;t[20]!==i||t[21]!==f||t[22]!==h?(N=(i===`stash-apply`||i===`stash-pop`)&&(0,Q.jsxs)(Oo,{children:[(0,Q.jsx)(Qa,{htmlFor:`git-stash`,children:`Stash`}),f?.stashes?.length?(0,Q.jsxs)(oa,{items:f.stashes.map(nZ),value:h,onValueChange:e=>{e&&g(e)},children:[(0,Q.jsx)(ni,{id:`git-stash`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsx)(Zi,{children:f.stashes.map(tZ)})]}):(0,Q.jsx)(ei,{id:`git-stash`,value:h,onChange:e=>g(e.target.value),required:!0,pattern:`([a-f0-9]{40}|[a-f0-9]{64})`})]}),t[20]=i,t[21]=f,t[22]=h,t[23]=N):N=t[23];let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>v(e===!0),t[24]=P):P=t[24];let F;t[25]===_?F=t[26]:(F=(0,Q.jsx)(pY,{checked:_,onCheckedChange:P}),t[25]=_,t[26]=F);let I=i===`stash-create`?`Include untracked files`:`Restore staged changes`,L;t[27]!==F||t[28]!==I?(L=(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[F,I]}),t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]!==L||t[31]!==A||t[32]!==j||t[33]!==M||t[34]!==N?(R=(0,Q.jsxs)(`fieldset`,{disabled:A,className:`flex min-w-0 flex-col gap-4`,children:[j,M,N,L]}),t[30]=L,t[31]=A,t[32]=j,t[33]=M,t[34]=N,t[35]=R):R=t[35];let z;t[36]!==d||t[37]!==u||t[38]!==T||t[39]!==O?(z=O?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm`,children:er(S(u,d))}):(0,Q.jsx)(rZ,{outcome:T}),t[36]=d,t[37]=u,t[38]=T,t[39]=O,t[40]=z):z=t[40];let B;t[41]!==T||t[42]!==w?(B=w&&!T&&(0,Q.jsx)(`p`,{role:`status`,children:`Outcome not yet confirmed`}),t[41]=T,t[42]=w,t[43]=B):B=t[43];let V;t[44]===E?V=t[45]:(V=E?(0,Q.jsx)(HJ,{text:Un(E)}):null,t[44]=E,t[45]=V);let H;t[46]!==C||t[47]!==x.lookAgain||t[48]!==l||t[49]!==O?(H=O&&l&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:C,onClick:x.lookAgain,children:`Look again`}),t[46]=C,t[47]=x.lookAgain,t[48]=l,t[49]=O,t[50]=H):H=t[50];let U;t[51]!==C||t[52]!==x.checkOutcome||t[53]!==x.operation||t[54]!==T?(U=x.operation&&!C&&!(T&&ye(T))&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,onClick:x.checkOutcome,children:`Check outcome`}),t[51]=C,t[52]=x.checkOutcome,t[53]=x.operation,t[54]=T,t[55]=U):U=t[55];let W;t[56]!==C||t[57]!==x.clearUnconfirmed||t[58]!==y?(W=x.clearUnconfirmed&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:C||!!y,onClick:x.clearUnconfirmed,children:`Clear unconfirmed action`}),t[56]=C,t[57]=x.clearUnconfirmed,t[58]=y,t[59]=W):W=t[59];let G=!!y||C||w||O,K;t[60]!==i||t[61]!==C?(K=C?`Working…`:SJ(i),t[60]=i,t[61]=C,t[62]=K):K=t[62];let q;t[63]!==G||t[64]!==K||t[65]!==y?(q=(0,Q.jsx)(X,{type:`submit`,className:`self-end`,"aria-description":y,disabled:G,children:K}),t[63]=G,t[64]=K,t[65]=y,t[66]=q):q=t[66];let ee;return t[67]!==R||t[68]!==z||t[69]!==B||t[70]!==V||t[71]!==H||t[72]!==U||t[73]!==W||t[74]!==q||t[75]!==k?(ee=(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:k,children:[R,z,B,V,H,U,W,q]}),t[67]=R,t[68]=z,t[69]=B,t[70]=V,t[71]=H,t[72]=U,t[73]=W,t[74]=q,t[75]=k,t[76]=ee):ee=t[76],ee}function tZ(e){return(0,Q.jsxs)(Ps,{value:e.oid,children:[(0,Q.jsx)(fr,{text:e.message}),(0,Q.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:By(e.oid)})]},e.oid)}function nZ(e){return{value:e.oid,label:`${e.message} · ${By(e.oid)}`}}function rZ(e){let t=(0,$.c)(9),{outcome:n}=e;if(!n)return null;if(lr(n)&&n.state!==`running`){let e;t[0]===n?e=t[1]:(e=nt(n),t[0]=n,t[1]=e);let r;return t[2]===e?r=t[3]:(r=(0,Q.jsx)(HJ,{text:e}),t[2]=e,t[3]=r),r}let r=n.state,i;t[4]===n?i=t[5]:(i=iZ(n),t[4]=n,t[5]=i);let a;return t[6]!==n.state||t[7]!==i?(a=(0,Q.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[r,i]}),t[6]=n.state,t[7]=i,t[8]=a):a=t[8],a}function iZ({message:e,reason:t}){return e?` · ${e}`:t?` · ${t.replaceAll(`_`,` `).toLowerCase()}`:``}function aZ(e){let t=(0,$.c)(76),{scope:n,context:r}=e,{connection:i}=r,{operations:a}=La(i.operations.state),o=de(qr(iB(n,i))),[s,c]=(0,Z.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>e=>{if(!e)return;let t=()=>c(e.getClientRects().length===0);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[0]=l):l=t[0];let[u]=(0,Z.useState)(l),[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=o!=null&&p(St(o)).kind===`hint`,_=d||g,v=sB(n,i,_),y=de(qr(v.result)),b=dB(n,i),x=Yu(i),S;t[1]===x?S=t[2]:(S=Hd(x),t[1]=x,t[2]=S);let C=S,w;t[3]!==C||t[4]!==x?(w=C?void 0:rd(x),t[3]=C,t[4]=x,t[5]=w):w=t[5];let T=w,[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(null),[M,P]=(0,Z.useState)(null),F=hH(),[I,L]=(0,Z.useState)(null),[R,z]=(0,Z.useState)(null),B=na(r),V=sZ,H;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>f(!0),t[6]=H):H=t[6];let U;t[7]!==T||t[8]!==C?(U=C?{kind:`ready`,strategy:C}:{kind:`blocked`,reason:T??`Changes & Git settings for this computer are unavailable.`},t[7]=T,t[8]=C,t[9]=U):U=t[9];let G,K;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{e&&j(null),k(e)},K=e=>{j(e.type===`error`?e:null),e.type!==`error`&&V(e)},t[10]=G,t[11]=K):(G=t[10],K=t[11]);let q;t[12]!==v||t[13]!==b||t[14]!==U?(q={details:v,enableDetails:H,pull:U,notify:V,onProgress:G,onResult:K,refreshLook:b,onLooked:z},t[12]=v,t[13]=b,t[14]=U,t[15]=q):q=t[15];let ee=ZJ(n,r,q);if(o==null){let e,n,r;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(oe({variant:`outline`}),`rounded-r-none @max-lg/pane:w-7 @max-lg/pane:px-0`),e=(0,Q.jsx)(tY,{action:`commit`,className:`size-3.5`}),n=(0,Q.jsx)(`span`,{className:`hidden @min-lg/pane:inline`,children:`Commit`}),t[16]=e,t[17]=n,t[18]=r):(e=t[16],n=t[17],r=t[18]);let i;t[19]===r?i=t[20]:(i=(0,Q.jsxs)(`span`,{className:r,children:[e,n]}),t[19]=r,t[20]=i);let a;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`span`,{className:Y(oe({variant:`outline`,size:`icon`}),`rounded-l-none border-l-0`)}),t[21]=a):a=t[21];let o;return t[22]!==i||t[23]!==a?(o=(0,Q.jsxs)(`span`,{"aria-hidden":`true`,className:`invisible flex shrink-0`,children:[i,a]}),t[22]=i,t[23]=a,t[24]=o):o=t[24],o}let J={...St(o),branch:ja(o.branch,_?y?.branch:void 0)},te;t[25]===M?te=t[26]:(te=e=>e.id===M,t[25]=M,t[26]=te);let ne=bJ.find(te),re=p(J),ie=re.kind===`run`&&re.action===`pull`&&!C,ae=B??(ie&&T?T:Fn(re,J)),se=Mt(re,J),ce=W(J),le=ee.running,ue;t[27]!==v.result||t[28]!==_?(ue=_&&Xi(v.result),t[27]=v.result,t[28]=_,t[29]=ue):ue=t[29];let fe=ue,pe=fe?xJ.slice(0,1):xJ,me=e=>{B||(N(e)?ee.runNetwork(e,J.branch):(L(document.activeElement instanceof HTMLElement?document.activeElement:null),z(J),P(e)))},he;t[30]===le?he=t[31]:(he=e=>{e||j(null),le&&k(e)},t[30]=le,t[31]=he);let ge=!!le,_e;t[32]===re?_e=t[33]:(_e=cZ(re),t[32]=re,t[33]=_e);let ve;t[34]===_e?ve=t[35]:(ve=(0,Q.jsx)(tY,{action:_e,className:`size-3.5`}),t[34]=_e,t[35]=ve);let ye;t[36]!==ge||t[37]!==ve?(ye=(0,Q.jsx)(Yi,{pending:ge,children:ve}),t[36]=ge,t[37]=ve,t[38]=ye):ye=t[38];let be=le?`${Ys(le.name)}…`:re.label,xe=!le&&se!=null&&` ${se}`,Se;t[39]!==be||t[40]!==xe?(Se=(0,Q.jsxs)(`span`,{ref:u,"aria-hidden":`true`,className:`hidden @min-lg/pane:inline`,children:[be,xe]}),t[39]=be,t[40]=xe,t[41]=Se):Se=t[41];let Ce;t[42]!==ee.checkOutcome||t[43]!==A||t[44]!==le?(Ce=(0,Q.jsx)(Zo,{align:`end`,className:`w-80`,children:A&&!le?(0,Q.jsxs)(ha,{children:[(0,Q.jsx)(Jr,{children:A.title}),A.description!==void 0&&(0,Q.jsx)(HJ,{text:A.description})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,Q.jsx)(Jr,{children:le?`${Ys(le.name)}…`:`Git action…`}),(0,Q.jsx)(`ol`,{className:`flex flex-col gap-0.5 font-mono text-2xs leading-4`,children:le?.operation?.receipt?.progress.length?le.operation.receipt.progress.slice(-4).map(oZ):(0,Q.jsx)(`li`,{className:`text-muted-foreground`,children:`Waiting for Git…`})}),le&&A?.description&&(0,Q.jsx)(HJ,{text:A.description}),le&&(0,Q.jsx)(ji,{variant:`outline`,className:`self-start`,pending:le.checking,onClick:ee.checkOutcome,children:`Check outcome`})]})}),t[42]=ee.checkOutcome,t[43]=A,t[44]=le,t[45]=Ce):Ce=t[45];let Te;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>{h(e),e&&f(!0)},t[46]=Te):Te=t[46];let Ee;t[47]===F?Ee=t[48]:(Ee=e=>F.attach(e),t[47]=F,t[48]=Ee);let De=!!B||le!=null,Oe;t[49]!==Ee||t[50]!==De||t[51]!==B?(Oe=(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{ref:Ee,variant:`outline`,size:`icon`,"aria-label":`Git actions`,disabled:De,"aria-description":B})}),t[49]=Ee,t[50]=De,t[51]=B,t[52]=Oe):Oe=t[52];let ke;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsx)(sc,{className:`size-3.5`}),t[53]=ke):ke=t[53];let Ae;t[54]===Oe?Ae=t[55]:(Ae=(0,Q.jsx)(Ze,{render:Oe,children:ke}),t[54]=Oe,t[55]=Ae);let je=B??`Git actions`,Me;t[56]===je?Me=t[57]:(Me=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:je}),t[56]=je,t[57]=Me);let Pe;t[58]!==Ae||t[59]!==Me?(Pe=(0,Q.jsxs)(ot,{children:[Ae,Me]}),t[58]=Ae,t[59]=Me,t[60]=Pe):Pe=t[60];let Fe=ce?(0,Q.jsx)(LY,{tracking:Ky(ce,null)}):(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(_g,{className:`size-3.5 shrink-0`}),`Git actions`]}),Ie;t[61]===Fe?Ie=t[62]:(Ie=(0,Q.jsx)(ct,{children:(0,Q.jsx)(bc,{children:Fe})}),t[61]=Fe,t[62]=Ie);let Le;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,Q.jsx)(we,{}),t[63]=Le):Le=t[63];let Re=pe.map((e,t)=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(ct,{children:e.actions.map(e=>{let t=a.get(ai(n,e.id)),r=e.id.startsWith(`stash-`)&&t&&(!t.receipt||!pc(t.receipt)),i=r?null:CJ(e.id,J,T),o=B??(i?void 0:Va(e.id,J));return(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(dn,{className:`data-disabled:pointer-events-auto`,disabled:!!B||i!=null,"aria-description":B,onSelect:()=>me(e.id)}),children:[(0,Q.jsx)(tY,{action:e.id}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsx)(fr,{text:e.label}),(r||i)&&(0,Q.jsx)(`span`,{className:`text-xs whitespace-normal text-muted-foreground`,children:r?`Check the previous outcome.`:i})]})]}),(0,Q.jsxs)(Yo,{children:[e.description,o&&` ${o}`]})]},e.id)})}),(fe||t<pe.length-1)&&(0,Q.jsx)(we,{})]},e.id)),ze;t[64]===fe?ze=t[65]:(ze=fe&&(0,Q.jsx)(Be,{label:`Reading Git status`,className:`mx-2 my-1`}),t[64]=fe,t[65]=ze);let Ve=!fe&&(ce?.discarded?.length??0)>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(we,{}),(0,Q.jsxs)(ct,{children:[(0,Q.jsx)(bc,{children:`Discarded`}),ce?.discarded?.map(e=>{let t=e.kind===`rename`?`Restore discarded rename of ${e.path}`:`Restore discarded hunk of ${e.path}`;return(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(dn,{onSelect:()=>{h(!1),ee.restoreDiscarded(e)}}),children:[(0,Q.jsx)(F_,{}),(0,Q.jsx)(fr,{className:`min-w-0`,text:t,propagateEscape:!0})]}),(0,Q.jsxs)(Yo,{children:[t,` · Kept until you restore it`]})]},e.oid)})]})]}),He;t[66]!==fe||t[67]!==Ie||t[68]!==Re||t[69]!==ze||t[70]!==Ve?(He=(0,Q.jsxs)(Ne,{align:`end`,className:`w-76`,"aria-busy":fe,children:[Ie,Le,Re,ze,Ve]}),t[66]=fe,t[67]=Ie,t[68]=Re,t[69]=ze,t[70]=Ve,t[71]=He):He=t[71];let Ue;return t[72]!==m||t[73]!==Pe||t[74]!==He?(Ue=(0,Q.jsxs)(Wt,{open:m,onOpenChange:Te,children:[Pe,He]}),t[72]=m,t[73]=Pe,t[74]=He,t[75]=Ue):Ue=t[75],(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(XJ,{"aria-label":`Git controls`,className:`shrink-0`,children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(uo,{open:le!=null&&O||A!=null,onOpenChange:he,children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(yo,{render:(0,Q.jsx)(X,{variant:`outline`,size:s?`icon`:`default`,"aria-label":le?`${Ys(le.name)} in progress: show progress`:re.label,disabled:le==null&&(re.kind===`hint`||ie||!!B),"aria-busy":!!le,"aria-description":B,focusableWhenDisabled:!0,className:`aria-disabled:cursor-default`,onClick:()=>{le||A||B||(re.kind===`commit`?me(`commit`):re.kind===`stash`?me(`stash-apply`):re.kind===`run`&&ee.runNetwork(re.action,J.branch))}})}),children:[ye,Se]}),Ce]}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:le?`${Ys(le.name)} in progress: show progress`:ae})]}),Ue]}),M==null?null:(0,Q.jsx)(vz,{open:!0,closeOnOutsidePress:!1,onOpenChange:e=>{!e&&!E&&P(null)},children:(0,Q.jsxs)(xz,{finalFocus:()=>I?.isConnected?I:F.element,"aria-busy":E,className:`max-h-[min(90svh,48rem)] overflow-y-auto sm:max-w-2xl`,children:[ne?.id!==`commit`&&ne?.id!==`amend`&&(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(wz,{children:ne?.label??`Git action`}),ne?.id!==`stash-create`&&(0,Q.jsx)(Tz,{children:lZ(ne?.id)})]}),(0,Q.jsx)(YX,{scope:n,context:r,entry:M,status:R??J,current:J,onBusy:D,onLookAgain:ee.lookAgain})]})})]})}function oZ(e){return(0,Q.jsx)(fr,{render:(0,Q.jsx)(`li`,{}),text:e},e)}function sZ(e){let{title:t,description:n,type:r}=e;return ks({title:t,description:n===void 0?void 0:(0,Q.jsx)(VJ,{text:n}),type:r})}function cZ(e){return e.kind===`run`?e.action:e.kind===`stash`?`stash-apply`:`commit`}function lZ(e){return e===`stash-pop`?`Its changes come back into the working tree and the stash is dropped.`:e===`stash-apply`?`Its changes come back into the working tree and the stash is kept.`:`Every change, new files included, is set aside until you pop the stash.`}function uZ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Me(`(min-width: 1280px)`),e[0]=t):t=e[0],Ot(t)}var dZ={kind:`review`},fZ=[`review`,`handoff`,`walkthrough`,`walkthrough-changes`],pZ={kind:`all-changes`},mZ={kind:`specs`},hZ={kind:`branch`},gZ={kind:`graph`};function _Z(e){return{kind:`pull-request`,projectId:e.projectId,number:e.number,...e.environmentId===e.shownOn?{}:{environmentId:e.environmentId}}}function vZ(e){switch(e.kind){case`review`:return`review`;case`all-changes`:return`all-changes`;case`specs`:return`specs`;case`change`:return`change:${e.path}`;case`file`:return`file:${e.path}`;case`commit`:return`commit:${e.oid}`;case`pull-request`:return`pull-request:${e.projectId}:${e.number}${e.environmentId?`:environment=${encodeURIComponent(e.environmentId)}`:``}`;case`branch`:return`branch`;case`branch-file`:return`branch:${e.path}`;case`graph`:return`graph`;case`timeline`:return`timeline:${e.path}`;case`walkthrough-step`:return`walkthrough-step:${e.step}`}}function yZ(e){if(e==null||e===``)return null;if(fZ.includes(e))return dZ;if(e===`all-changes`)return pZ;if(e===`specs`)return mZ;if(e===`branch`)return hZ;if(e===`graph`)return gZ;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);if(r===``)return null;switch(n){case`change`:case`file`:case`timeline`:return{kind:n,path:r};case`branch`:return{kind:`branch-file`,path:r};case`walkthrough-step`:return/^[1-9][0-9]*$/.test(r)&&Number.isSafeInteger(Number(r))?{kind:n,step:Number(r)}:null;case`commit`:return/^[0-9a-f]{4,64}$/.test(r)?{kind:n,oid:r}:null;case`pull-request`:{let[e,t,i,a]=r.split(`:`);return e!==void 0&&e.length>0&&t!==void 0&&a===void 0&&(i===void 0||/^environment=[a-zA-Z0-9_-]+$/.test(i))&&/^[1-9][0-9]*$/.test(t)&&Number.isSafeInteger(Number(t))?{kind:n,projectId:e,number:Number(t),...i?{environmentId:i.slice(12)}:{}}:null}default:return null}}function bZ(e){switch(e?.kind){case void 0:return`This worktree`;case`review`:return`The Walkthrough`;case`walkthrough-step`:return`This step`;case`file`:return`This file`;case`commit`:return`This commit`;case`pull-request`:return`This pull request`;case`graph`:return`The commit graph`;case`timeline`:return`This file history`;case`all-changes`:case`specs`:case`change`:case`branch`:case`branch-file`:return`These changes`}}function xZ(e){let t=yZ(e);return t?vZ(t):void 0}function SZ(e,t,n){if(e.includes(t))return[...e];let r=n==null?-1:e.indexOf(n),i=[...e];return i.splice(r===-1?i.length:r+1,0,t),i}var CZ={changes:`Changes`,files:`Files`,history:`History`};function wZ(e){switch(e.kind){case`review`:return`Review`;case`all-changes`:return`All changes`;case`specs`:return`Specs`;case`branch`:return`All branch changes`;case`graph`:return`Commit graph`;case`commit`:return By(e.oid);case`pull-request`:return`PR #${e.number}`;case`change`:case`file`:case`branch-file`:return e.path.split(`/`).at(-1)??e.path;case`timeline`:return`Timeline of ${e.path.split(`/`).at(-1)??e.path}`;case`walkthrough-step`:return`Step ${e.step}`}}function TZ(e){let t=yZ(e.entry),n=(e.firstDocument!==void 0&&(!t||t.kind===`review`)?e.firstDocument:void 0)??(t?wZ(t):CZ[e.surface??`files`]),r=e.project?`${n} — ${e.project}`:n;return e.environment?`${r} · ${e.environment}`:r}var EZ=()=>({tabs:[],pinned:[]}),DZ=`review`;function OZ(e){return e===DZ}function kZ(e,t){let n=`${e}-${encodeURIComponent(t)}`;return{tab:`${n}-tab`,panel:`${n}-panel`}}function AZ(e,t){let n=xZ(e);return n===void 0||!OZ(n)?n:t?PZ(jZ(t)).at(-1):void 0}function jZ(e){return{tabs:e.tabs.filter(e=>!OZ(e)),pinned:e.pinned.filter(e=>!OZ(e))}}function MZ(e){return{tabs:[DZ,...e.tabs.filter(e=>!OZ(e))],pinned:e.pinned.filter(e=>!OZ(e))}}function NZ(e,t,n){if(e[t]?.tabs.includes(n))return t;let r=+(t===0);return e[r]?.tabs.includes(n)?r:t}function PZ(e){return[...e.tabs.filter(OZ),...e.pinned.filter(t=>!OZ(t)&&e.tabs.includes(t)),...e.tabs.filter(t=>!OZ(t)&&!e.pinned.includes(t))]}function FZ(e,t,n){return e.tabs.includes(t)?e:{...e,tabs:SZ(e.tabs,t,n)}}function IZ(e,t){return OZ(t)?e:{tabs:e.tabs.filter(e=>e!==t),pinned:e.pinned.filter(e=>e!==t)}}function LZ(e,t){return{...e,tabs:e.tabs.filter(n=>OZ(n)||n===t||e.pinned.includes(n))}}function RZ(e){return{...e,tabs:e.tabs.filter(t=>OZ(t)||e.pinned.includes(t))}}function zZ(e,t){return OZ(t)?e:e.pinned.includes(t)?{...e,pinned:e.pinned.filter(e=>e!==t)}:{...e,pinned:[...e.pinned,t]}}function BZ(e,t,n){let r=yZ(e);return r?.kind===`file`&&ed(r.path,t)?vZ({kind:`file`,path:bd(r.path,t,n)}):e}function VZ(e,t,n){let r=e=>[...new Set(e.map(e=>BZ(e,t,n)))];return{tabs:r(e.tabs),pinned:r(e.pinned)}}function HZ(e,t){let n=yZ(e);return n?.kind===`file`&&ed(n.path,t)}function UZ(e,t){return{tabs:e.tabs.filter(e=>!HZ(e,t)),pinned:e.pinned.filter(e=>!HZ(e,t))}}function WZ(e,t,n){if(n.tabs.includes(t))return t;let r=PZ(e),i=new Set(PZ(n)),a=r.indexOf(t);return a===-1?null:[...r.slice(a+1),...r.slice(0,a).reverse()].find(e=>i.has(e)&&!OZ(e))??e.tabs.find(e=>i.has(e))??null}function GZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function KZ(e){return Array.isArray(e)?[...new Set(e.flatMap(e=>{let t=typeof e==`string`?xZ(e):void 0;return t===void 0?[]:[t]}))]:[]}function qZ(e){if(!GZ(e)||!Array.isArray(e.panes))return null;let t=e.panes.map(e=>{let t=KZ(GZ(e)?e.tabs:void 0);return{tabs:t,pinned:KZ(GZ(e)?e.pinned:void 0).filter(e=>t.includes(e))}}).map((e,t)=>t===0?e:jZ(e)).filter((e,t)=>t===0||e.tabs.length>0);return t.length>0?t:null}function JZ(e){return e===null?`Open to the side`:e===`left`?`Open in the right pane`:`Open in the left pane`}function YZ(e,t,n){let r=t.flatMap(e=>PZ(e)),i=n===null?e:[n,...e],a=new Set(r);return[...new Set([...i,...r])].filter(e=>a.has(e))}function XZ(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function ZZ(e){return!e||typeof e!=`object`||!(`folded`in e)||!(`expanded`in e)?{folded:[],expanded:[]}:XZ(e.folded)&&XZ(e.expanded)?{folded:e.folded,expanded:e.expanded}:{folded:[],expanded:[]}}function QZ(e,t,n=!1){return e.folded.includes(t)||n&&!e.expanded.includes(t)}function $Z(e,t,n){let r=new Set(e.folded),i=new Set(e.expanded);for(let e of t)n?(r.add(e),i.delete(e)):(r.delete(e),i.add(e));return{folded:[...r],expanded:[...i]}}function eQ(e,t){return e?.owner===t?void 0:e}var tQ=Qt(Ut({saved:fi})),nQ=Qt(Ut({focused:L([0,1])})),rQ=Ka([$s(ee),$s(ee)]),iQ=Qt(Ut({activeEntries:rQ})),aQ=Pa.pipe(Ft(Ut({panes:$s(yc(Ut({tabs:yc(ee),pinned:yc(ee)}))),saved:fi,focused:L([0,1]),activeEntries:$s(rQ)}),{decode:pr(e=>({panes:qZ(e),saved:tQ(e).pipe(fn(e=>e.saved),bt(()=>!0)),focused:nQ(e).pipe(fn(e=>e.focused),bt(()=>0)),activeEntries:iQ(e).pipe(fn(e=>e.activeEntries),kt)})),encode:Jn()})),oQ=Pa.pipe(Ft(Ut({folded:yc(ee),expanded:yc(ee)}),{decode:pr(ZZ),encode:Jn()})),sQ=dt(e=>$n({runtime:Od,key:`porcelain.tabs.${e}`,schema:aQ,defaultValue:()=>({panes:null,saved:!1,focused:0,activeEntries:null})})),cQ=dt(e=>Oe({recent:[],actives:null}).pipe(x)),lQ=dt(e=>$n({runtime:Od,key:e,schema:oQ,defaultValue:()=>({folded:[],expanded:[]})}));function uQ(e){let t=(0,$.c)(25),n;t[0]===e?n=t[1]:(n=sQ(e),t[0]=e,t[1]=n);let r=n,{panes:i,saved:a,focused:o,activeEntries:s}=Ot(r),c=Da(r),l=Ot(E),u;t[2]===e?u=t[3]:(u=cQ(e),t[2]=e,t[3]=u);let d=u,f;t[4]!==r||t[5]!==l?(f=e=>{let t=l.get(r);t.focused!==e&&l.set(r,{...t,focused:e})},t[4]=r,t[5]=l,t[6]=f):f=t[6];let p;t[7]===c?p=t[8]:(p=e=>c(t=>({...t,panes:e,saved:!0})),t[7]=c,t[8]=p);let m;t[9]!==d||t[10]!==r||t[11]!==l?(m=()=>({panes:l.get(r).panes,actives:l.get(d).actives}),t[9]=d,t[10]=r,t[11]=l,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==l?(h=e=>{l.set(d,{...l.get(d),actives:e})},t[13]=d,t[14]=l,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==o||t[18]!==i||t[19]!==a||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g={panes:i,saved:a,focused:o,activeEntries:s,setFocused:f,save:p,latest:m,saveActives:h},t[16]=s,t[17]=o,t[18]=i,t[19]=a,t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}function dQ(e,t){let n=(0,$.c)(7),r=`porcelain.folds.${e}.${t}`,i;n[0]===r?i=n[1]:(i=lQ(r),n[0]=r,n[1]=i);let a=i,o=Ot(a),s=Da(a),c;n[2]===s?c=n[3]:(c=(e,t)=>s(n=>$Z(n,e,t)),n[2]=s,n[3]=c);let l;return n[4]!==c||n[5]!==o?(l={folds:o,setCollapsed:c},n[4]=c,n[5]=o,n[6]=l):l=n[6],l}var fQ=dt(e=>Oe(25).pipe(x)),pQ=dt(e=>Oe({viewer:null,restored:null})),mQ=dt(e=>Oe({scrollTop:0,selection:null,focused:void 0}).pipe(x));function hQ(e){let t=(0,$.c)(33),n=(0,Z.useId)(),r;t[0]===n?r=t[1]:(r=pQ(n),t[0]=n,t[1]=r);let i=r;Lt(i);let a=Ot(E),o;t[2]===e?o=t[3]:(o=mQ(e),t[2]=e,t[3]=o);let s=o,c,l,u,d,f,p;t[4]!==s||t[5]!==a?(c=()=>a.get(s).scrollTop,l=()=>a.get(s).selection,u=()=>a.get(s).focused,d=e=>a.set(s,{...a.get(s),focused:e}),f=e=>{a.set(s,{...a.get(s),scrollTop:e})},p=e=>{a.set(s,{...a.get(s),selection:e})},t[4]=s,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):(c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11]);let m;t[12]!==i||t[13]!==a?(m=e=>a.get(i).viewer?.scrollTo(e),t[12]=i,t[13]=a,t[14]=m):m=t[14];let h;t[15]!==i||t[16]!==e||t[17]!==s||t[18]!==a?(h=(t,n)=>{let r=a.get(i);(r.restored?.viewer!==t||r.restored.owner!==e)&&(t.scrollTo({type:`position`,position:a.get(s).scrollTop+n,behavior:`instant`}),a.set(i,{...r,restored:{viewer:t,owner:e}}))},t[15]=i,t[16]=e,t[17]=s,t[18]=a,t[19]=h):h=t[19];let g;t[20]!==i||t[21]!==a?(g=e=>{if(e)return a.set(i,{...a.get(i),viewer:e}),()=>{let t=a.get(i);t.viewer===e&&a.set(i,{...t,viewer:null})}},t[20]=i,t[21]=a,t[22]=g):g=t[22];let _;return t[23]!==h||t[24]!==g||t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==d||t[29]!==f||t[30]!==p||t[31]!==m?(_={position:c,selection:l,focused:u,rememberFocus:d,rememberPosition:f,rememberSelection:p,scrollTo:m,restorePosition:h,attach:g},t[23]=h,t[24]=g,t[25]=c,t[26]=l,t[27]=u,t[28]=d,t[29]=f,t[30]=p,t[31]=m,t[32]=_):_=t[32],_}var gQ=dt(e=>Oe(null).pipe(x)),_Q=dt(e=>Oe(t=>{let n=gQ({worktreeId:e.worktreeId,entry:e.entry});t.set(n,e.path),t.addFinalizer(()=>{t.registry.getNodes().has(n)&&t.registry.get(n)===e.path&&t.registry.set(n,null)})})),vQ=Oe(null);function yQ(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=e?_Q(e):vQ,t[0]=e,t[1]=n),Lt(n)}function bQ(e,t){return Ot(gQ({worktreeId:e,entry:t??``}))??void 0}var xQ=$n({runtime:Od,key:`porcelain.review-panel.open`,schema:fi,defaultValue:()=>!0}).pipe(x);function SQ(){let e=(0,$.c)(3),t=Ot(xQ),n=Da(xQ),r;return e[0]!==t||e[1]!==n?(r={open:t,setOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}var CQ=dt(e=>Oe(void 0).pipe(x)),wQ=new Map,TQ=dt(e=>Oe(t=>{let n=Symbol();wQ.set(e.worktreeId,{owner:n,title:e.title}),t.set(CQ(e.worktreeId),e.title),t.addFinalizer(()=>{eQ(wQ.get(e.worktreeId),n)||(wQ.delete(e.worktreeId),t.set(CQ(e.worktreeId),void 0))})})),EQ=Oe(aa(0)),DQ=Oe(vo($i).pipe(Cs(ko(`1 second`).pipe(Ta(()=>$i)))));function OQ(e){let t=(0,$.c)(2),n=Ot(e?DQ:EQ),r;return t[0]===n?r=t[1]:(r=bt(qr(n),kQ),t[0]=n,t[1]=r),r}function kQ(){return 0}var AQ=Oe(void 0).pipe(x),jQ=dt(e=>Oe(null).pipe(x));function MQ(e){let t=(0,$.c)(8),{worktreeId:n,entry:r,side:i,onSearch:a,fallback:o,focused:s,setFocused:c,ready:l,focusBoundary:u,focusBoundaryOpen:d}=e,{panes:f,activeEntries:p,save:m,latest:h,saveActives:g}=uQ(n),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[void 0,void 0],t[0]=_):_=t[0];let[v,y]=(0,Z.useState)(_),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[null,null],t[1]=b):b=t[1];let[x,S]=(0,Z.useState)(b),C=(0,Z.useId)(),w;t[2]===C?w=t[3]:(w=PQ(C),t[2]=C,t[3]=w);let T=Ot(w),E=T.cancel,D=[MZ(f?.[0]??EZ()),...f?.slice(1)??[]],O=AZ(i,D[1]),k=[xZ(r),O],A=e=>{let t=v[e];return t===void 0?k[e]:t??void 0},j=e=>{let t=D[e];if(!t)return null;let n=p?.[e];return n&&t.tabs.includes(n)?n:PZ(t).at(-1)??null},M=[A(0)??(f===null?o:j(0))??`review`,A(1)??(A(0)===void 0?j(1):null)];Lt(FQ({ready:l&&v[0]===void 0&&v[1]===void 0,entry:r,side:i,fallback:o,actives:M,onSearch:a}));let N=[FZ(D[0]??EZ(),M[0],x[0])];M[1]!==null&&M[1]!==void 0&&(N[1]=FZ(D[1]??EZ(),M[1],x[1]));let P=N.length>1;if(l){let e=v.map((e,t)=>e!==void 0&&(k[t]??null)===(e??null)?void 0:e);(e[0]!==v[0]||e[1]!==v[1])&&y([e[0],e[1]]),(x[0]!==M[0]||x[1]!==M[1])&&S(M)}Lt(IQ({worktreeId:n,panes:N,actives:M,ready:l}));let F;t[4]===n?F=t[5]:(F=cQ(n),t[4]=n,t[5]=F);let{recent:I}=Ot(F),L=M[s]??null;Lt(LQ({worktreeId:n,panes:N,actives:M,active:L,ready:l}));let R=YZ(I,N,L).flatMap(NQ),z=e=>{E();let t=h().actives??M;g([`entry`in e?e.entry??null:t[0],`side`in e?e.side??null:t[1]]),y(t=>[`entry`in e?e.entry??null:t[0],`side`in e?e.side??null:t[1]]),a({...`entry`in e?{entry:e.entry??void 0}:{},...`side`in e?{side:e.side??void 0}:{}})},B;t[6]===z?B=t[7]:(B=(e,t)=>z(e===0?{entry:t}:{side:t}),t[6]=z,t[7]=B);let V=B,H=(e,t)=>N.map((n,r)=>r===e?t:n),U=e=>{let t=h(),n=t.panes?[MZ(t.panes[0]??EZ()),...t.panes.slice(1)]:N,r=t.actives??M,{next:i,after:a}=e(n,r);if(i.length>1&&(i[1]?.tabs.length??0)===0){m([i[0]??EZ()]),c(0),z({entry:a[0]??null,side:null});return}m(i);let o={};(a[0]??null)!==(r[0]??null)&&(o.entry=a[0]??null),i.length>1&&(a[1]??null)!==(r[1]??null)&&(o.side=a[1]??null),Object.keys(o).length>0&&z(o)},W=(e,t,n)=>{if(E(),P&&t.tabs.length===0){let t=+(e===0);m([N[t]??EZ()]),c(0),z({entry:M[t],side:null})}else m(H(e,t)),n!==M[e]&&V(e,n)};return{recentFiles:R,bindQuickOpen:T.bindQuickOpen,focusDestination:T.schedule,hasDestinationFocus(){return T.current()!==null},selectPane(e){E(),c(e)},focusPane(e,t){if(d||T.restoringQuickOpen&&t.getAttribute(`role`)===`tab`)return;let n=T.destination;n!==null&&(n.pane!==e||t.getAttribute(`role`)!==`tab`||t.getAttribute(`data-entry`)!==n.key)&&E(),c(e)},bindPane(e,t){return T.bind(e,t,{focused:s,actives:M,panes:N,focusBoundary:u})},split:P,panes:N.map((e,t)=>({tabs:PZ(e),pinned:e.pinned,active:M[t]??null})),activate(e,t){c(e),V(e,t)},open(e,t,n){let r=n!==void 0&&n,i=NZ(N,e,t);return V(i,t),r?T.cancel():T.request({pane:i,key:t}),c(i),i},closePane(e){P&&W(e,EZ(),null)},close(e,t,n){let r=n!==void 0&&n;if(OZ(t))return;let i=N[e]??EZ(),a=IZ(i,t),o=t===M[e]?WZ(i,t,a):M[e],s=r||T.isTabFocused(e,t);if(W(e,a,o),!s)return;let c=P&&a.tabs.length===0?M[0]:o;c!==null&&T.request({pane:a.tabs.length===0?0:e,key:c})},closeOthers(e,t){W(e,LZ(N[e]??EZ(),t),t)},closeUnpinned(e){let t=RZ(N[e]??EZ()),n=M[e];W(e,t,n!=null&&t.tabs.includes(n)?n:PZ(t)[0]??null)},moveFiles(e,t){U((n,r)=>({next:n.map(n=>VZ(n,e,t)),after:r.map(n=>n===null?null:BZ(n,e,t))}))},closeRemovedFiles(e){U((t,n)=>{let r=t.map(t=>UZ(t,e));return{next:r,after:n.map((n,i)=>n!==null&&HZ(n,e)?WZ(t[i]??EZ(),n,r[i]??EZ()):n)}})},togglePin(e,t){m(H(e,zZ(N[e]??EZ(),t)))},openToSide(e,t){if(OZ(t))return;let n=+(e===0),r=[...N];r[n]=FZ(N[n]??EZ(),t,M[n]),m(r),V(n,t),T.request({pane:n,key:t}),c(n)},step(e,t){E();let n=PZ(N[e]??EZ());if(n.length===0)return;let r=n[((M[e]===null||M[e]===void 0?-1:n.indexOf(M[e]))+t+n.length)%n.length]??null,i=T.isTabFocused(e);V(e,r),i&&r!==null&&T.request({pane:e,key:r})}}}function NQ(e){let t=yZ(e);return t?.kind===`file`?[t.path]:[]}var PQ=dt(e=>Oe(e=>{let t=[null,null],n=null,r=!1,i=null,a,o=null,s=()=>{o!==null&&cancelAnimationFrame(o),o=null},c=()=>{i=null,r=!1,s()},l=()=>i&&a&&(a.focused!==i.pane||a.actives[i.pane]!==i.key||!a.panes[i.pane]?.tabs.includes(i.key))?null:i,u=()=>{i&&o===null&&(o=requestAnimationFrame(()=>{o=null;let e=l();if(!e||a?.focusBoundary?.isConnected||n?.isConnected)return;let s=[...t[e.pane]?.querySelectorAll(`[role="tab"]`)??[]].find(t=>t.dataset.entry===e.key);s?.isConnected&&(s.focus(),s.ownerDocument.activeElement===s&&i===e&&(i=null,r=!1))}))};return e.addFinalizer(c),{get destination(){return i},get restoringQuickOpen(){return r},current:l,isTabFocused(e,n){let r=t[e],i=r?.ownerDocument.activeElement?.closest(`[role="tab"][data-entry]`);return!i||!r?.contains(i)?!1:n===void 0||i.dataset.entry===n},cancel:c,schedule:u,bindQuickOpen:e=>{n=e,e===null&&u()},request(e){i=e,r=n?.isConnected===!0},bind(e,n,r){if(s(),a=r,t[e]=n,l(),n)return u(),()=>{t[e]===n&&(t[e]=null),s()}}}})),FQ=dt(({ready:e,entry:t,side:n,fallback:r,actives:i,onSearch:a})=>Oe(()=>{if(!e)return;let[o,s]=i,c=s??void 0;t===void 0&&n===void 0&&r===null&&o===`review`&&c===void 0?a({},{replace:!0,implicitReview:!0}):(t!==o||n!==c)&&a({entry:o,side:c},{replace:!0})})),IQ=dt(({worktreeId:e,panes:t,actives:n,ready:r})=>Oe(i=>{if(!r)return;let a=sQ(e),o=i.once(a);o.saved&&JSON.stringify(o.panes)===JSON.stringify(t)&&o.activeEntries?.[0]===n[0]&&o.activeEntries[1]===n[1]&&(t.length>1||o.focused===0)||i.set(a,{...o,panes:t,saved:!0,focused:t.length>1?o.focused:0,activeEntries:n})})),LQ=dt(({worktreeId:e,panes:t,actives:n,active:r,ready:i})=>Oe(a=>{if(!i)return;let o=cQ(e),s=a.once(o),c=YZ(s.recent,t,r);s.actives?.[0]===n[0]&&s.actives[1]===n[1]&&s.recent.length===c.length&&s.recent.every((e,t)=>e===c[t])||a.set(o,{recent:c,actives:n})}));function RQ(e,t){return{onActivate:n=>e.activate(t,n),onClose:(n,r)=>e.close(t,n,r),onCloseOthers:n=>e.closeOthers(t,n),onCloseUnpinned:()=>e.closeUnpinned(t),onTogglePin:n=>e.togglePin(t,n),onOpenToSide:n=>e.openToSide(t,n),onClosePane:e.split?()=>e.closePane(t):void 0}}function zQ(e){let t=e?.closest(`[data-tab-viewport]`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.left<r.left?n.left-r.left:Math.max(0,n.right-r.right);t.scrollBy({left:i})}function BQ(e){let t=yZ(e);switch(t?.kind){case`review`:return{Icon:Lg,title:`Review`,hint:`The branch's review`};case`walkthrough-step`:return{Icon:Zh,title:`Step ${t.step}`,hint:`Changes in step ${t.step}`};case`all-changes`:return{Icon:Zh,title:`All changes`,hint:`Every changed file, including specs`};case`specs`:return{Icon:ag,title:`Specs`,hint:`Changed spec and test files`};case`change`:case`branch-file`:{let e=t.kind===`change`?`uncommitted diff`:`branch diff`,n=`${t.path} · ${e}`;return{Icon:Zh,title:dy(t.path),accessibleName:n,hint:n}}case`file`:return{Icon:Yh,title:dy(t.path),accessibleName:t.path,hint:t.path};case`commit`:return{Icon:yg,title:By(t.oid),hint:`Commit ${t.oid}`};case`branch`:return{Icon:_g,title:`All branch changes`,hint:`Every change on the branch`};case`pull-request`:return{Icon:Dg,title:`PR #${t.number}`,hint:`Pull request #${t.number}`};case`graph`:return{Icon:_g,title:`Graph`,hint:`Commit graph of the checked-out branch`};case`timeline`:return{Icon:h_,title:`Timeline of ${dy(t.path)}`,accessibleName:`Timeline of ${t.path}`,hint:`${t.path} · timeline`};default:return{Icon:tg,title:e,hint:e}}}function VQ(e){let t=(0,$.c)(66),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({tabs:l,pinned:s,active:r,side:c,leading:o,trailing:u,commitContext:i,ids:a,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let[d,f]=(0,Z.useState)(null);d!==null&&d.active!==r&&f(null);let p;t[10]!==r||t[11]!==d||t[12]!==l?(p=d!==null&&l.includes(d.key)?d.key:r??l[0],t[10]=r,t[11]=d,t[12]=l,t[13]=p):p=t[13];let m=p,h;t[14]===r?h=t[15]:(h=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=[...e.currentTarget.querySelectorAll(`[role="tab"]`)],n=t.findIndex(t=>t===e.target);if(n<0)return;e.preventDefault();let i=t[(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length],a=i?.dataset.entry;i&&a!==void 0&&(f({active:r,key:a}),i.focus({preventScroll:!0}),zQ(i))},t[14]=r,t[15]=h);let g=h,v;t[16]===n?v=t[17]:(v=e=>{f(null),n.onActivate(e)},t[16]=n,t[17]=v);let y=v,b=c!=null&&`gap-2`,x;t[18]===b?x=t[19]:(x=Y(`relative flex h-12 shrink-0 items-center gap-1.5 border-b px-2.5 text-ui`,b),t[18]=b,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(sW,{}),t[20]=S):S=t[20];let C;t[21]===o?C=t[22]:(C=o!=null&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center`,children:o}),t[21]=o,t[22]=C);let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e.currentTarget.contains(e.relatedTarget)||f(null)},t[23]=w):w=t[23];let T=c==null?`Open documents`:`Open documents, ${c} pane`,E;t[24]!==n||t[25]!==y||t[26]!==r||t[27]!==a||t[28]!==s||t[29]!==c||t[30]!==m||t[31]!==l?(E=l.includes(`review`)&&(0,Q.jsx)(`span`,{className:`flex shrink-0`,children:(0,Q.jsx)(WQ,{tabKey:`review`,ids:a(`review`),active:r===`review`,tabStop:m===`review`,pinned:!1,hasUnpinned:l.some(e=>!OZ(e)&&!s.includes(e)),hasOthers:l.some(e=>!OZ(e)&&!s.includes(e)),side:c,...n,onActivate:y})}),t[24]=n,t[25]=y,t[26]=r,t[27]=a,t[28]=s,t[29]=c,t[30]=m,t[31]=l,t[32]=E):E=t[32];let D;t[33]!==n||t[34]!==y||t[35]!==r||t[36]!==i||t[37]!==a||t[38]!==s||t[39]!==c||t[40]!==m||t[41]!==l?(D=l.filter(HQ).map((e,t)=>{let o=s.includes(e),u=o&&!s.includes(l[t+1]??``)&&t<l.length-1,d=yZ(e),f={tabKey:e,ids:a(e),active:e===r,tabStop:e===m,pinned:o,hasUnpinned:l.some(e=>!OZ(e)&&!s.includes(e)),hasOthers:l.some(t=>t!==e&&!OZ(t)&&!s.includes(t)),side:c,...n,onActivate:y};return(0,Q.jsxs)(`span`,{className:Y(`flex items-center`,e===r?`shrink-0`:`min-w-18 shrink`),children:[i&&d?.kind===`commit`?(0,Q.jsx)(GQ,{...f,commitContext:i,oid:d.oid}):(0,Q.jsx)(WQ,{...f}),u&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-4 w-px shrink-0 bg-border`})]},e)}),t[33]=n,t[34]=y,t[35]=r,t[36]=i,t[37]=a,t[38]=s,t[39]=c,t[40]=m,t[41]=l,t[42]=D):D=t[42];let O;t[43]===D?O=t[44]:(O=(0,Q.jsx)(XV,{"data-tab-viewport":``,tabIndex:-1,className:`size-full overflow-y-hidden`,ref:UQ,children:(0,Q.jsx)(`div`,{className:`flex h-full w-full items-center gap-1 px-1.5`,children:D})}),t[43]=D,t[44]=O);let k;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(YV,{orientation:`horizontal`,className:`absolute inset-x-0 bottom-0 data-horizontal:h-1.5`}),t[45]=k):k=t[45];let A;t[46]===O?A=t[47]:(A=(0,Q.jsxs)(UV,{className:`@container/tabs relative h-full min-w-0 flex-1`,children:[O,k]}),t[46]=O,t[47]=A);let j;t[48]!==g||t[49]!==E||t[50]!==A||t[51]!==T?(j=(0,Q.jsxs)(`div`,{role:`tablist`,onKeyDown:g,onBlur:w,"aria-label":T,className:`flex h-full min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[E,A]}),t[48]=g,t[49]=E,t[50]=A,t[51]=T,t[52]=j):j=t[52];let M;t[53]!==n||t[54]!==r||t[55]!==s||t[56]!==l?(M=l.length>1&&(0,Q.jsxs)(Wt,{children:[(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,"aria-label":`Open document list`})}),children:[(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[l.length,(0,Q.jsx)(`span`,{className:`max-sm:hidden`,children:` tabs`})]}),(0,Q.jsx)(sc,{"data-icon":`inline-end`})]}),(0,Q.jsx)(Yo,{children:`Open document list`})]}),(0,Q.jsx)(Ne,{align:`end`,children:(0,Q.jsx)(_,{value:r??``,onValueChange:e=>{typeof e==`string`&&l.includes(e)&&n.onActivate(e)},children:l.map(e=>{let{Icon:t,title:n,hint:r,accessibleName:i}=BQ(e);return(0,Q.jsxs)(Yn,{value:e,closeOnSelect:!0,"aria-label":i===void 0?n:i,className:`items-start`,children:[(0,Q.jsx)(t,{className:`mt-0.5`}),(0,Q.jsx)(`span`,{className:`min-w-0 whitespace-normal break-all`,children:r}),s.includes(e)&&(0,Q.jsx)(s_,{"aria-label":`Pinned`,className:`mt-0.5`})]},e)})})})]}),t[53]=n,t[54]=r,t[55]=s,t[56]=l,t[57]=M):M=t[57];let N;t[58]===u?N=t[59]:(N=u!=null&&(0,Q.jsx)(`div`,{className:`relative flex shrink-0 items-center gap-1`,children:u}),t[58]=u,t[59]=N);let P;return t[60]!==j||t[61]!==M||t[62]!==N||t[63]!==x||t[64]!==C?(P=(0,Q.jsxs)(`div`,{"data-pane-bar":``,className:x,children:[S,C,j,M,N]}),t[60]=j,t[61]=M,t[62]=N,t[63]=x,t[64]=C,t[65]=P):P=t[65],P}function HQ(e){return!OZ(e)}function UQ(e){if(!e)return;let t=()=>zQ(e.querySelector(`[role="tab"][aria-selected="true"]`)),n=0,r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(t)});return r.observe(e),()=>{cancelAnimationFrame(n),r.disconnect()}}function WQ(e){let t=(0,$.c)(87),{tabKey:n,commitSubject:r,ids:i,active:a,tabStop:o,pinned:s,hasUnpinned:c,hasOthers:l,side:u,onActivate:d,onClose:f,onCloseOthers:p,onCloseUnpinned:m,onTogglePin:h,onOpenToSide:g,onClosePane:_}=e,v;t[0]===n?v=t[1]:(v=BQ(n),t[0]=n,t[1]=v);let{Icon:y,title:b,hint:x,accessibleName:S}=v,C=S===void 0?b:S,w=r?`${b} ${r}`:b,T=r?`${x} · ${r}`:x,[E,D]=(0,Z.useState)(!1),O;t[2]===u?O=t[3]:(O=JZ(u),t[2]=u,t[3]=O);let k=O,A;t[4]!==d||t[5]!==n?(A=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d(n))},t[4]=d,t[5]=n,t[6]=A):A=t[6];let j=A,M;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e&&D(!1)},t[7]=M):M=t[7];let N=s?`${T} · pinned`:T,P;t[8]!==y||t[9]!==C||t[10]!==j||t[11]!==a||t[12]!==r||t[13]!==i.panel||t[14]!==i.tab||t[15]!==d||t[16]!==f||t[17]!==h||t[18]!==s||t[19]!==n||t[20]!==o||t[21]!==w||t[22]!==b?(P=e=>(0,Q.jsxs)(uH,{render:(0,Q.jsx)(`div`,{ref:e=>{a&&zQ(e)},role:`tab`,id:i.tab,"aria-controls":a?i.panel:void 0,tabIndex:o?0:-1,"aria-selected":a,"aria-label":r?w:C,"data-entry":n,className:Y(`group flex h-7 min-w-0 max-w-[min(100cqw,calc(var(--spacing)*45))] cursor-default items-center gap-1.5 rounded-md px-2 text-xs font-medium outline-none transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring`,a?`bg-muted text-foreground ring-1 ring-border ring-inset`:`text-muted-foreground hover:bg-accent hover:text-foreground`,a&&!OZ(n)&&!s&&`pr-0.5`),onClick:()=>d(n),onAuxClick:e=>{e.button===1&&!s&&!OZ(n)&&(e.preventDefault(),f(n))},onKeyDown:e=>{e.target===e.currentTarget&&j(e)}}),children:[(0,Q.jsx)(y,{className:`size-3.5 shrink-0`,strokeWidth:OZ(n)?1.75:void 0}),e,!OZ(n)&&s&&(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{type:`button`,tabIndex:-1,"aria-label":`Unpin ${b}`,onClick:e=>{e.stopPropagation(),h(n)},variant:`ghost`,size:`icon-xs`}),children:(0,Q.jsx)(s_,{className:`size-3`})}),(0,Q.jsx)(Yo,{children:`Unpin ${b}`})]}),!OZ(n)&&a&&(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{type:`button`,tabIndex:-1,"aria-label":`Close ${b}`,onClick:e=>{e.stopPropagation(),f(n)},variant:`ghost`,size:`icon-xs`,className:`mr-0.5`}),children:(0,Q.jsx)(Oi,{className:`size-3`})}),(0,Q.jsxs)(Yo,{children:[`Close ${b}`,(0,Q.jsx)(pH,{children:Ad(ou.closeTab)})]})]})]}),t[8]=y,t[9]=C,t[10]=j,t[11]=a,t[12]=r,t[13]=i.panel,t[14]=i.tab,t[15]=d,t[16]=f,t[17]=h,t[18]=s,t[19]=n,t[20]=o,t[21]=w,t[22]=b,t[23]=P):P=t[23];let F;t[24]!==N||t[25]!==P||t[26]!==w?(F=(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:N,disclose:`always`,renderTrigger:P,children:w}),t[24]=N,t[25]=P,t[26]=w,t[27]=F):F=t[27];let I=E?`none`:`trigger`,L;t[28]===n?L=t[29]:(L=OZ(n),t[28]=n,t[29]=L);let R;t[30]!==h||t[31]!==n?(R=()=>h(n),t[30]=h,t[31]=n,t[32]=R):R=t[32];let z;t[33]===s?z=t[34]:(z=s?(0,Q.jsx)(l_,{}):(0,Q.jsx)(s_,{}),t[33]=s,t[34]=z);let B=s?`Unpin`:`Pin`,V;t[35]!==L||t[36]!==R||t[37]!==z||t[38]!==B?(V=(0,Q.jsxs)(dn,{disabled:L,onSelect:R,children:[z,B]}),t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V):V=t[39];let H;t[40]!==g||t[41]!==n?(H=g===void 0||OZ(n),t[40]=g,t[41]=n,t[42]=H):H=t[42];let U;t[43]!==g||t[44]!==n?(U=()=>{(0,th.flushSync)(()=>D(!0)),g?.(n)},t[43]=g,t[44]=n,t[45]=U):U=t[45];let W;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(Lh,{}),t[46]=W):W=t[46];let G;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(Rn,{children:Ad(ou.openToSide)}),t[47]=G):G=t[47];let K;t[48]!==k||t[49]!==H||t[50]!==U?(K=(0,Q.jsxs)(dn,{disabled:H,onSelect:U,children:[W,k,G]}),t[48]=k,t[49]=H,t[50]=U,t[51]=K):K=t[51];let q;t[52]===_?q=t[53]:(q=_&&(0,Q.jsxs)(dn,{onSelect:_,children:[(0,Q.jsx)(Lh,{}),`Close pane`]}),t[52]=_,t[53]=q);let ee;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(we,{}),t[54]=ee):ee=t[54];let J;t[55]===n?J=t[56]:(J=OZ(n),t[55]=n,t[56]=J);let te;t[57]!==f||t[58]!==n?(te=()=>f(n,!0),t[57]=f,t[58]=n,t[59]=te):te=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(Oi,{}),t[60]=ne):ne=t[60];let re;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(Rn,{children:Ad(ou.closeTab)}),t[61]=re):re=t[61];let ie;t[62]!==J||t[63]!==te?(ie=(0,Q.jsxs)(dn,{disabled:J,onSelect:te,children:[ne,`Close`,re]}),t[62]=J,t[63]=te,t[64]=ie):ie=t[64];let ae=!l,oe;t[65]!==p||t[66]!==n?(oe=()=>p(n),t[65]=p,t[66]=n,t[67]=oe):oe=t[67];let se;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(D_,{}),t[68]=se):se=t[68];let ce;t[69]!==ae||t[70]!==oe?(ce=(0,Q.jsxs)(dn,{disabled:ae,onSelect:oe,children:[se,`Close others`]}),t[69]=ae,t[70]=oe,t[71]=ce):ce=t[71];let le=!c,ue;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Q.jsx)(Gg,{}),t[72]=ue):ue=t[72];let de;t[73]!==m||t[74]!==le?(de=(0,Q.jsxs)(dn,{disabled:le,onSelect:m,children:[ue,`Close unpinned`]}),t[73]=m,t[74]=le,t[75]=de):de=t[75];let fe;t[76]!==V||t[77]!==K||t[78]!==q||t[79]!==ie||t[80]!==ce||t[81]!==de||t[82]!==I?(fe=(0,Q.jsxs)(dH,{finalFocus:I,children:[V,K,q,ee,ie,ce,de]}),t[76]=V,t[77]=K,t[78]=q,t[79]=ie,t[80]=ce,t[81]=de,t[82]=I,t[83]=fe):fe=t[83];let pe;return t[84]!==fe||t[85]!==F?(pe=(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 flex-1`,children:(0,Q.jsxs)(Wt,{onOpenChange:M,children:[F,fe]})}),t[84]=fe,t[85]=F,t[86]=pe):pe=t[86],pe}function GQ(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({commitContext:n,oid:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=jY({...n,oid:r,parent:1}),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o=Ot(a),s;t[7]===o?s=t[8]:(s=de(qr(o)),t[7]=o,t[8]=s);let c=s?.commit.subject,l;return t[9]!==c||t[10]!==i?(l=(0,Q.jsx)(WQ,{...i,commitSubject:c}),t[9]=c,t[10]=i,t[11]=l):l=t[11],l}function KQ(e,t,n){let r=(0,$.c)(4),i;r[0]!==e||r[1]!==n||r[2]!==t?(i=qs({connection:e,projectId:t,number:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3];let a=de(qr(Ot(i))),o=QB(e);if(a?.kind===`available`)return el(o.projects,t,a.pullRequest.headBranch)}function qQ(e){let t=(0,$.c)(13),{label:n,description:r,icon:i,shortcut:a,onClick:o,disabled:s,pressed:c,variant:l,iconOnly:u}=e,d=s!==void 0&&s,f=l===void 0?`ghost`:l,p=u!==void 0&&u,m;t[0]===p?m=t[1]:(m=p?[`compact`]:[`compact`,`key`,`full`],t[0]=p,t[1]=m);let h;return t[2]!==i||t[3]!==r||t[4]!==d||t[5]!==p||t[6]!==n||t[7]!==o||t[8]!==c||t[9]!==a||t[10]!==m||t[11]!==f?(h=(0,Q.jsx)(Q.Fragment,{children:m.map(e=>(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(X,{variant:f,size:e===`compact`?`icon`:`default`,className:Y(!p&&e===`compact`&&`@min-lg/pane:hidden`,e===`key`&&`hidden @min-lg/pane:inline-flex @min-3xl/pane:hidden`,e===`full`&&`hidden @min-3xl/pane:inline-flex`),"aria-label":n,"aria-keyshortcuts":a,"aria-pressed":c,disabled:d,focusableWhenDisabled:!0,onClick:o}),children:[c===!1?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0 rounded-sm border-[--spacing(0.375)] border-border-strong bg-background`}):(0,Q.jsx)(i,{className:`size-3.5`}),e===`full`&&(0,Q.jsx)(`span`,{children:n}),a&&e!==`compact`&&(0,Q.jsx)(pH,{children:Ad(a)})]}),(0,Q.jsxs)(Yo,{role:`tooltip`,children:[r??n,a&&(0,Q.jsx)(pH,{children:Ad(a)})]})]},e))}),t[2]=i,t[3]=r,t[4]=d,t[5]=p,t[6]=n,t[7]=o,t[8]=c,t[9]=a,t[10]=m,t[11]=f,t[12]=h):h=t[12],h}function JQ(e,t,n){let r=(0,$.c)(4),i=n===void 0?fy:n,a;return r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=eB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3],$u(a).value}function YQ(e,t,n){let r=(0,$.c)(4),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=eB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3],Lt(a)}function XQ(e,t,n,r){let i=(0,$.c)(4),a=JQ(e,t),o;return i[0]!==n||i[1]!==r||i[2]!==a?(o=oy(n,a,r),i[0]=n,i[1]=r,i[2]=a,i[3]=o):o=i[3],o}function ZQ(e){let t=(0,$.c)(14),{scope:n,context:r,base:i,quiet:a,children:o}=e,s=a!==void 0&&a,c;t[0]===s?c=t[1]:(c=s?null:(0,Q.jsx)(kc,{label:`Comparing the branch`}),t[0]=s,t[1]=c);let l=c,u=vB(n,r.connection,i);if(Mi(u.result)){let e;t[2]===u.result.cause?e=t[3]:(e=Qv(Ra(u.result.cause)),t[2]=u.result.cause,t[3]=e);let n;return t[4]!==u.refresh||t[5]!==e?(n=(0,Q.jsx)(gt,{description:e,onRetry:u.refresh}),t[4]=u.refresh,t[5]=e,t[6]=n):n=t[6],n}if(!Bo(u.result))return l;if(u.result.value.base===void 0){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`Choose the branch this one is compared against in the Branch list.`}),t[7]=e):e=t[7],e}let d;t[8]!==u.result.value||t[9]!==o?(d=o(u.result.value),t[8]=u.result.value,t[9]=o,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==d?(f=(0,Q.jsx)(Z.Suspense,{fallback:l,children:d}),t[11]=l,t[12]=d,t[13]=f):f=t[13],f}function QQ(e,t,n,r){return{id:e,kind:`file`,path:t,contents:n,version:bu(n),...r?{note:r}:{}}}var $Q=new Map,e$=new Map;function t$(e){if(e.kind===`diff`){let t=$Q.get(e.id);return t?.cacheKey!==void 0&&t.cacheKey===e.fileDiff.cacheKey?{type:`diff`,fileDiff:t}:($Q.set(e.id,e.fileDiff),{type:`diff`,fileDiff:e.fileDiff})}let t=e$.get(e.id);if(t?.file.name===e.path&&t.file.contents===e.contents)return{type:`file`,file:t.file};let n=(t?.revision??0)+1;if(!Number.isSafeInteger(n))throw Error(`File highlighting exhausted its revision identifiers.`);let r={name:e.path,contents:e.contents,cacheKey:JSON.stringify([e.id,e.path,n])};return e$.set(e.id,{file:r,revision:n}),{type:`file`,file:r}}function n$(e){let t=new Map;for(let n of e){let e=t.get(n.path)??{additions:0,deletions:0},r=r$(n);e.additions+=r.additions,e.deletions+=r.deletions,t.set(n.path,e)}return t}function r$(e){return e.kind===`file`?{additions:e.contents.split(`
1348
- `).filter((e,t,n)=>t<n.length-1||e).length,deletions:0}:e.fileDiff.hunks.reduce((e,t)=>({additions:e.additions+t.additionLines,deletions:e.deletions+t.deletionLines}),{additions:0,deletions:0})}function i$(e){let t=(0,$.c)(7),{counts:n}=e,r;t[0]===n.additions?r=t[1]:(r=(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,n.additions]}),t[0]=n.additions,t[1]=r);let i;t[2]===n.deletions?i=t[3]:(i=(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,n.deletions]}),t[2]=n.deletions,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(`span`,{className:`shrink-0 font-mono text-xs leading-4 font-medium tabular-nums`,children:[r,` `,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function a$(e){return e?e.hunks.flatMap(e=>{let t=e.additionStart;return e.hunkContent.flatMap(e=>{if(e.type===`context`)return t+=e.lines,[];let n=t;return t+=e.additions,Array.from({length:e.additions},(e,t)=>`[data-code] [data-line="${n+t}"] { box-shadow: inset calc(var(--spacing) * 0.75) 0 var(--add-fg); }`)})}).join(`
1349
- `):``}var o$=6;function s$(e,t){let n=e.shadowRoot?.querySelector(`[data-line="${t.line}"]`),r=n?.closest(`[data-code]`);if(!n||!r||r.clientWidth===0)return!1;if(r.scrollWidth<=r.clientWidth)return!0;let i=c$(n,t);if(!i)return!1;let a=i.getBoundingClientRect(),o=r.getBoundingClientRect(),s=r.querySelector(`[data-gutter]`),c=o.left+(s?.offsetWidth??0)+o$,l=o.left+r.clientWidth-o$;return a.left<c||a.width>l-c?r.scrollLeft=a.right+r.scrollLeft<=l?0:r.scrollLeft+a.left-c:a.right>l&&(r.scrollLeft+=a.right-l),!0}function c$(e,{column:t,length:n}){let r=document.createRange(),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=0;for(let e=i.nextNode();e instanceof Text;e=i.nextNode()){let i=a+e.length;if(t>=a&&t<i&&r.setStart(e,t-a),t+n<=i)return r.setEnd(e,t+n-a),r;a=i}}function l$(e,t,n){let r=(0,$.c)(9),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.set,s;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promiseExit`},r[4]=s):s=r[4];let[c,l]=B(o,s),u=Da(o),d;return r[5]!==c||r[6]!==l||r[7]!==u?(d={result:c,submit:l,start:u},r[5]=c,r[6]=l,r[7]=u,r[8]=d):d=r[8],d}function u$(e,t,n){let r=(0,$.c)(9),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.remove,s;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promiseExit`},r[4]=s):s=r[4];let[c,l]=B(o,s),u=Da(o),d;return r[5]!==c||r[6]!==l||r[7]!==u?(d={result:c,submit:l,start:u},r[5]=c,r[6]=l,r[7]=u,r[8]=d):d=r[8],d}function d$(e,t,n){let r=(0,$.c)(12),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.bulk,[s,c]=B(o),l;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={mode:`promiseExit`},r[4]=l):l=r[4];let u=Da(o,l),d;r[5]===s?d=r[6]:(d=de(qr(s)),r[5]=s,r[6]=d);let f=d,p=!s.waiting&&f?.kind===`mark`?f.report:null,m;return r[7]!==s||r[8]!==c||r[9]!==u||r[10]!==p?(m={result:s,submit:u,report:p,start:c},r[7]=s,r[8]=c,r[9]=u,r[10]=p,r[11]=m):m=r[11],m}function f$(e,t,n,r){let i=(0,$.c)(5),a=r===void 0?fy:r,o=na(t),s=l$(e,t,a),c=u$(e,t,a),l;return i[0]!==s||i[1]!==n||i[2]!==c||i[3]!==o?(l={writeBlock:o,toggle(e){if(o)return;let t=wy(e,s.result.waiting||c.result.waiting);t&&(t.kind===`unmark`?c.submit(t.path):s.submit(t.input)).then(e=>{Mn(e)&&n({title:`Could not update review`,description:cy(Ra(e.cause)),type:`error`})})}},i[0]=s,i[1]=n,i[2]=c,i[3]=o,i[4]=l):l=i[4],l}function p$(e,t,n,r,i,a){let o=(0,$.c)(22),s=na(t),c;o[0]===r?c=o[1]:(c=Sy(r),o[0]=r,o[1]=c);let l=c,u;o[2]===i?u=o[3]:(u=Sy(i),o[2]=i,o[3]=u);let d=u,f=d$(e,t,n),p=d$(e,t),m;if(o[4]!==r||o[5]!==i){let e=[...r,...i];m=e.length>0&&e.every(h$),o[4]=r,o[5]=i,o[6]=m}else m=o[6];let h=m,g=f.result.waiting||p.result.waiting,_=!!s||g||l.blocked&&d.blocked,v;o[7]!==r||o[8]!==f||o[9]!==l||o[10]!==_||o[11]!==a||o[12]!==h||o[13]!==i||o[14]!==p||o[15]!==d?(v=()=>{if(_)return;let e=[{entries:r,plan:l,command:f},{entries:i,plan:d,command:p}].filter(m$).map(e=>e.command.submit(h?{kind:`unmark`,paths:e.plan.reviewedPaths}:{kind:`mark`,entries:e.entries}));Promise.all(e).then(e=>{let t=e.find(Mn);if(t){a({title:`Could not update review`,description:cy(Ra(t.cause)),type:`error`});return}let n={marked:[],skipped:[],failed:[]};for(let t of e)ne(t)&&t.value.kind===`mark`&&(n.marked.push(...t.value.report.marked),n.skipped.push(...t.value.report.skipped),n.failed.push(...t.value.report.failed));a(xy(n)??{title:h?`Step marked unreviewed`:`Step marked reviewed`,type:`success`})})},o[7]=r,o[8]=f,o[9]=l,o[10]=_,o[11]=a,o[12]=h,o[13]=i,o[14]=p,o[15]=d,o[16]=v):v=o[16];let y=v,b;return o[17]!==_||o[18]!==h||o[19]!==y||o[20]!==s?(b={reviewed:h,disabled:_,toggle:y,writeBlock:s},o[17]=_,o[18]=h,o[19]=y,o[20]=s,o[21]=b):b=o[21],b}function m$(e){return e.entries.length>0}function h$(e){return e.reviewStatus===`reviewed`}function g$(e){if(!(!e||e.side===`deletions`||e.endSide!==void 0&&e.endSide!==e.side))return{startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)}}var _$=_s(`Comments.read`)(function*({connection:e,scope:t}){return yield*zn(e,e=>e.comments.listComments({params:{worktreeId:t.worktreeId}}))}),v$=dt(e=>et(e.connection,e.scope,[`comments`],_$(e),Xn(e.connection)).pipe(sr));function y$(e,t){return{connection:e,scope:{projectId:t.projectId,worktreeId:t.worktreeId}}}function b$(e){return{view:de(qr(e)),failed:Mi(e),waiting:e.waiting}}function x$(e){return(e?.comments??[]).filter(e=>e.publication.status===`draft`)}function S$(e){return e.kind===`lines`||e.kind===`file`?e.path:void 0}function C$(e){let t=new Map;for(let n of x$(e)){let e=S$(n.anchor);e!==void 0&&t.set(e,(t.get(e)??0)+1)}return t}function w$(e,t){return x$(e).filter(e=>t(e.anchor))}function T$(e,t){return e===t?`Line ${e}`:`Lines ${e}–${t}`}function E$(e){switch(e.kind){case`lines`:return`${e.path} · ${e.side===`deletions`?`removed `:``}${T$(e.start,e.end).toLowerCase()}`;case`file`:return e.path;case`step`:return`Step · ${e.title}`;case`node`:return`${e.node} · ${e.title}`}}function D$(e){switch(e){case`no-pull-request`:return`This branch has no open pull request. Push it and open one, or copy the comments for an agent.`;case`no-comments`:return`There are no open comments to post.`;case`not-github`:return`This project is not on GitHub.`;case`gh-not-installed`:return`Install the GitHub CLI (gh) on the connected computer to post reviews.`;case`no-accounts`:case`no-access`:return`Sign in to GitHub with gh on the connected computer to post reviews.`;case`rate-limited`:return`GitHub is rate limiting requests. Try again in a few minutes.`;case`pull-request-not-found`:return`The pull request could not be found.`;case`offline`:case`invalid-response`:return`GitHub could not be reached. Try again.`}}function O$(e){let t=new Set(e.flatMap(e=>{let t=S$(e.anchor);return t===void 0?[]:[t]})).size,n=e.filter(e=>S$(e.anchor)===void 0).length;return[t>0?`on ${t} ${t===1?`file`:`files`}`:``,n>0?`${n} on the Walkthrough`:``].filter(Boolean).join(`, `)}function k$(e){return e===1?`1 draft comment`:`${e} draft comments`}function A$(e){return(e?.comments??[]).filter(e=>e.publication.status===`published`)}function j$(e){let t=e.startLine===void 0?``:`${e.startLine}-`,n=e.side===`LEFT`?` (removed)`:``;return`${e.path}:${t}${e.line}${n}`}var M$={"not-in-pull-request":`not in the pull request diff`,outdated:`outdated`,file:`whole file`,step:void 0,node:void 0};function N$(e){return M$[e]}function P$(e){return Object.fromEntries([...e.inline,...e.general].map(e=>[e.id,e.body]))}function F$(e){let t=Object.entries(e).map(([e,t])=>[e,t.trim()]);return t.some(([,e])=>e.length===0)?void 0:Object.fromEntries(t)}function I$(e){return{summary:``,bodies:P$(e)}}function L$(e,t,n){return{...e,bodies:{...e.bodies,[t]:n}}}function R$(e,t){let n=F$(e.bodies);if(n===void 0)return;let{owner:r,repo:i,number:a}=t.pullRequest;return{pullRequest:{owner:r,repo:i,number:a},headOid:t.headOid,summary:e.summary,bodies:n}}var z$=300;function B$(e,t){return typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0&&e.message.length<z$?e.message:t}function V$(e,t){return`> ${e.replaceAll(`
1350
- `,`
1351
- > `)}\n\n${t}`}function H$(e,t){let n=new Map;for(let r of x$(e))r.anchor.kind===`node`&&r.anchor.title===t&&n.set(r.anchor.node,(n.get(r.anchor.node)??0)+1);return n}var U$=`GitHub may have received this review. Check the pull request before posting again.`,W$=new Set([`ReviewChangedError`,`PullRequestReviewFailedError`]);function G$(e){return Ho(e)?{message:$e,showPullRequest:!1}:{message:typeof e==`object`&&e&&`name`in e&&typeof e.name==`string`&&W$.has(e.name)?B$(e,U$):U$,showPullRequest:!0}}var K$=dt(({connection:e,scope:t})=>{let n=Xn(e),r=t.worktreeId,i=lt.reviewSurface(e.environmentId,t,[`comments`]),a=Bi([i]);return{add:n.fn(_s(`Comments.add`)(function*(t){let n=yield*zn(e,e=>e.comments.addComment({params:{worktreeId:r},payload:t}));return yield*a,n})),edit:n.fn(_s(`Comments.edit`)(function*(t){let n=yield*zn(e,e=>e.comments.editComment({params:{worktreeId:r,commentId:t.commentId},payload:{text:t.text}}));return yield*a,n})),remove:n.fn(_s(`Comments.remove`)(function*(t){let n=yield*zn(e,e=>e.comments.deleteComment({params:{worktreeId:r,commentId:t}}));return yield*a,n})),preview:n.fn(_s(`Comments.preview`)(function*(){return yield*zn(e,e=>e.comments.previewCommentReview({params:{worktreeId:r}}))})),publish:n.fn(_s(`Comments.publish`)(function*(n){let a=yield*zn(e,e=>e.comments.publishCommentReview({params:{worktreeId:r},payload:n}));return yield*Bi([i,lt.projectPullRequests(e.environmentId,t.projectId)]),a}))}});function q$([e,t]){return{waiting:lo(e),run:async e=>{let n=await t(e);if(Mn(n))throw Ra(n.cause);return n.value}}}function J$([e,t],n){return{summary:e.summary,body:t=>e.bodies[t]??``,setSummary:e=>t(t=>({...t,summary:e})),edit:e=>n=>t(t=>L$(t,e,n)),request:R$(e,n)}}function Y$({scope:e,context:t}){return y$(t.connection,e)}function X$(e){let t=(0,$.c)(7),n;t[0]===e?n=t[1]:(n=v$(Y$(e)),t[0]=e,t[1]=n);let r=n,i=Ot(r),a;t[2]===i?a=t[3]:(a=b$(i),t[2]=i,t[3]=a);let o=l(r),s;return t[4]!==a||t[5]!==o?(s={...a,refresh:o},t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function Z$(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={mode:`promiseExit`},t[0]=n):n=t[0];let r=B(e,n),i;return t[1]===r?i=t[2]:(i=q$(r),t[1]=r,t[2]=i),i}function Q$(e){let t=(0,$.c)(8),n;t[0]===e?n=t[1]:(n=K$(Y$(e)),t[0]=e,t[1]=n);let r=n,i=Z$(r.add),a=Z$(r.edit),o=Z$(r.remove),s=Z$(r.preview),c=Z$(r.publish),l;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s||t[6]!==c?(l={add:i,edit:a,remove:o,preview:s,publish:c},t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l):l=t[7],l}function $$(e,t){let n=(0,$.c)(8),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(),s;n[0]!==t||n[1]!==e||n[2]!==r?(s=async n=>{if(e&&!r){i(!0),o(void 0);try{await e(n),t()}catch(e){o(B$(e,`The comment was not saved. Try again.`))}i(!1)}},n[0]=t,n[1]=e,n[2]=r,n[3]=s):s=n[3];let c;return n[4]!==a||n[5]!==s||n[6]!==r?(c={waiting:r,failure:a,submit:s},n[4]=a,n[5]=s,n[6]=r,n[7]=c):c=n[7],c}function e1(e,t){let n=(0,$.c)(7),{preview:r}=Q$(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async()=>{a(void 0);try{let e=await r.run(void 0);e.kind===`available`?t(e):a(D$(e.reason))}catch(e){a(B$(e,`GitHub could not be read.`))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==r.waiting||n[4]!==o||n[5]!==i?(s={unavailable:i,waiting:r.waiting,read:o},n[3]=r.waiting,n[4]=o,n[5]=i,n[6]=s):s=n[6],s}function t1(e,t){let n=(0,$.c)(7),{publish:r}=Q$(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async e=>{a(void 0);try{t((await r.run(e)).url)}catch(e){a(G$(e))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==i||n[4]!==r.waiting||n[5]!==o?(s={failure:i,waiting:r.waiting,post:o},n[3]=i,n[4]=r.waiting,n[5]=o,n[6]=s):s=n[6],s}function n1(e,t){let n=(0,$.c)(7),{remove:r}=Q$(e),[i,a]=(0,Z.useState)(),o;n[0]!==t||n[1]!==r?(o=async()=>{a(void 0);try{await r.run(t)}catch(e){a(B$(e,`The comment was not deleted.`))}},n[0]=t,n[1]=r,n[2]=o):o=n[2];let s;return n[3]!==i||n[4]!==r.waiting||n[5]!==o?(s={failure:i,waiting:r.waiting,remove:o},n[3]=i,n[4]=r.waiting,n[5]=o,n[6]=s):s=n[6],s}var r1=8e3;function i1(e){let t=(0,$.c)(31),{owner:n,initial:r,label:i,submitLabel:a,onSubmit:o,onClose:s}=e,c=r===void 0?``:r,l=a===void 0?`Comment`:a,[u,d]=(0,Z.useState)(c),{waiting:f,failure:p,submit:m}=$$(o,s),h=na(n.context),g;t[0]===u?g=t[1]:(g=u.trim(),t[0]=u,t[1]=g);let _=g,v;t[2]!==m||t[3]!==_||t[4]!==f||t[5]!==h?(v=()=>{!_||f||h||m(_)},t[2]=m,t[3]=_,t[4]=f,t[5]=h,t[6]=v):v=t[6];let y=v,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>d(e.target.value),t[7]=b):b=t[7];let x;t[8]!==s||t[9]!==y?(x=e=>{e.key===`Escape`&&(e.preventDefault(),s()),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),y())},t[8]=s,t[9]=y,t[10]=x):x=t[10];let S;t[11]!==i||t[12]!==x||t[13]!==u?(S=(0,Q.jsx)(gH,{autoFocus:!0,value:u,maxLength:r1,rows:2,"aria-label":i,placeholder:`Leave a comment`,className:`min-h-14`,onChange:b,onKeyDown:x}),t[11]=i,t[12]=x,t[13]=u,t[14]=S):S=t[14];let C;t[15]===p?C=t[16]:(C=p&&(0,Q.jsx)(`p`,{role:`alert`,className:`mr-auto text-caption text-destructive`,children:p}),t[15]=p,t[16]=C);let w;t[17]===s?w=t[18]:(w=(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,onClick:s,children:`Cancel`}),t[17]=s,t[18]=w);let T=!_||f||!!h,E;t[19]!==y||t[20]!==l||t[21]!==T||t[22]!==h?(E=(0,Q.jsx)(X,{size:`sm`,disabled:T,"aria-description":h,onClick:y,children:l}),t[19]=y,t[20]=l,t[21]=T,t[22]=h,t[23]=E):E=t[23];let D;t[24]!==E||t[25]!==C||t[26]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[C,w,E]}),t[24]=E,t[25]=C,t[26]=w,t[27]=D):D=t[27];let O;return t[28]!==D||t[29]!==S?(O=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 font-sans`,"data-comment-composer":``,children:[S,D]}),t[28]=D,t[29]=S,t[30]=O):O=t[30],O}function a1(e){let t=(0,$.c)(14),{label:n,icon:r,disabled:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":n,disabled:i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Q.jsx)(r,{}),t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsx)(Ze,{render:o,children:s}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]===n?l=t[10]:(l=(0,Q.jsx)(Yo,{children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(ot,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function o1(e){let t=(0,$.c)(37),{owner:n,comment:r,location:i}=e,[a,o]=(0,Z.useState)(!1),{failure:s,waiting:c,remove:l}=n1(n,r.id),u=Q$(n),d=na(n.context),f=r.publication.status===`published`;if(a){let e;t[0]!==u.edit||t[1]!==r.id?(e=e=>u.edit.run({commentId:r.id,text:e}),t[0]=u.edit,t[1]=r.id,t[2]=e):e=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>o(!1),t[3]=i):i=t[3];let a;return t[4]!==r.text||t[5]!==n||t[6]!==e?(a=(0,Q.jsx)(i1,{owner:n,initial:r.text,label:`Edit comment`,submitLabel:`Save`,onSubmit:e,onClose:i}),t[4]=r.text,t[5]=n,t[6]=e,t[7]=a):a=t[7],a}let p=i?`Comment on ${i}`:`Comment`,m;t[8]!==r.anchor||t[9]!==i?(m=i&&(0,Q.jsx)(fr,{className:Y(`min-w-0 text-foreground-2`,(r.anchor.kind===`lines`||r.anchor.kind===`file`)&&`font-mono`),text:i}),t[8]=r.anchor,t[9]=i,t[10]=m):m=t[10];let h;t[11]!==r.publication.status||t[12]!==r.publication.url||t[13]!==f?(h=f&&r.publication.status===`published`?(0,Q.jsx)(`a`,{href:r.publication.url,target:`_blank`,rel:`noreferrer`,className:`hover:underline`,children:`Posted`}):(0,Q.jsx)(`span`,{children:`Draft`}),t[11]=r.publication.status,t[12]=r.publication.url,t[13]=f,t[14]=h):h=t[14];let g;t[15]===r.outdated?g=t[16]:(g=r.outdated&&(0,Q.jsx)(`span`,{className:`text-warn`,children:`Outdated · the lines changed`}),t[15]=r.outdated,t[16]=g);let _;t[17]!==f||t[18]!==l||t[19]!==c||t[20]!==d?(_=!f&&(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center`,children:[(0,Q.jsx)(a1,{label:`Edit comment`,icon:ao,disabled:!!d,onClick:()=>o(!0)}),(0,Q.jsx)(a1,{label:`Delete comment`,icon:N_,disabled:!!d||c,onClick:()=>void l()})]}),t[17]=f,t[18]=l,t[19]=c,t[20]=d,t[21]=_):_=t[21];let v;t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==_?(v=(0,Q.jsxs)(`header`,{className:`flex min-h-6 items-center gap-2 text-caption text-muted-foreground`,children:[m,h,g,_]}),t[22]=m,t[23]=h,t[24]=g,t[25]=_,t[26]=v):v=t[26];let y;t[27]===r.text?y=t[28]:(y=(0,Q.jsx)(`p`,{className:`text-ui whitespace-pre-wrap text-foreground`,children:r.text}),t[27]=r.text,t[28]=y);let b;t[29]===s?b=t[30]:(b=s&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:s}),t[29]=s,t[30]=b);let x;return t[31]!==r.id||t[32]!==p||t[33]!==v||t[34]!==y||t[35]!==b?(x=(0,Q.jsxs)(`article`,{"aria-label":p,"data-draft-comment":r.id,className:`flex flex-col gap-1 rounded-md border bg-card px-3 py-2 font-sans`,children:[v,y,b]}),t[31]=r.id,t[32]=p,t[33]=v,t[34]=y,t[35]=b,t[36]=x):x=t[36],x}function s1(e){let t=(0,$.c)(17),{owner:n,drafts:r,anchor:i,composing:a,onClose:o,className:s}=e,c=Q$(n);if(r.length===0&&!a)return null;let l;t[0]===s?l=t[1]:(l=Y(`flex flex-col gap-2`,s),t[0]=s,t[1]=l);let u;if(t[2]!==r||t[3]!==n){let e;t[5]===n?e=t[6]:(e=e=>(0,Q.jsx)(o1,{owner:n,comment:e},e.id),t[5]=n,t[6]=e),u=r.map(e),t[2]=r,t[3]=n,t[4]=u}else u=t[4];let d;t[7]!==i||t[8]!==c||t[9]!==a||t[10]!==o||t[11]!==n?(d=a&&i&&(0,Q.jsx)(i1,{owner:n,label:`New comment`,onSubmit:e=>c.add.run({anchor:i,text:e}),onClose:o}),t[7]=i,t[8]=c,t[9]=a,t[10]=o,t[11]=n,t[12]=d):d=t[12];let f;return t[13]!==l||t[14]!==u||t[15]!==d?(f=(0,Q.jsxs)(`div`,{className:l,children:[u,d]}),t[13]=l,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}var c1=e=>e?.replace(/\r?\n$/,``);function l1(e,t,n){let r=t===`additions`?e.additionLines:e.deletionLines;if(!e.isPartial)return c1(r[n-1]);for(let i of e.hunks){let e=t===`additions`?i.additionStart:i.deletionStart,a=t===`additions`?i.additionCount:i.deletionCount,o=t===`additions`?i.additionLineIndex:i.deletionLineIndex;if(n>=e&&n<e+a)return c1(r[o+n-e])}}function u1(e,t){let n=[];for(let r=t.start;r<=t.end;r+=1)n.push(l1(e,t.side,r)??``);return n.join(`
1352
- `)}function d1(e,t){return e.split(/\r?\n/).slice(t.start-1,t.end).join(`
1353
- `)}function f1(e){let t=e.side??`additions`;if((e.endSide??t)===t)return{side:t,start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}var p1=`porcelain comments`;function m1(e){e?.focus()}function h1(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({arrived:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=n?m1:void 0,a;return t[3]!==r||t[4]!==i?(a=(0,Q.jsx)(wz,{ref:i,tabIndex:-1,className:`outline-none`,...r}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function g1(e){let t=(0,$.c)(12),{title:n,detail:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`span`,{className:`text-ui font-medium`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,Q.jsx)(`span`,{className:`shrink-0`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 border-t px-4 py-3 first:border-t-0`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function _1(e){let t=(0,$.c)(19),{location:n,code:r,note:i,value:a,onChange:o}=e,s=(r===void 0||r)&&`font-mono`,c;t[0]===s?c=t[1]:(c=Y(`min-w-0 text-foreground-2`,s),t[0]=s,t[1]=c);let l;t[2]!==n||t[3]!==c?(l=(0,Q.jsx)(fr,{className:c,text:n}),t[2]=n,t[3]=c,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i&&(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:i}),t[5]=i,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-2 text-caption`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=`Comment on ${n}`,p;t[10]===o?p=t[11]:(p=e=>o(e.target.value),t[10]=o,t[11]=p);let m;t[12]!==f||t[13]!==p||t[14]!==a?(m=(0,Q.jsx)(gH,{value:a,"aria-label":f,className:`min-h-10`,onChange:p}),t[12]=f,t[13]=p,t[14]=a,t[15]=m):m=t[15];let h;return t[16]!==d||t[17]!==m?(h=(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[d,m]}),t[16]=d,t[17]=m,t[18]=h):h=t[18],h}function v1(e){let t=(0,$.c)(52),{arrived:n,owner:r,preview:i,onBack:a,onPosted:o}=e,{failure:s,waiting:c,post:l}=t1(r,o),u=na(r.context),d;t[0]===i?d=t[1]:(d=()=>I$(i),t[0]=i,t[1]=d);let f=(0,Z.useState)(d),p;t[2]!==i||t[3]!==f?(p=J$(f,i),t[2]=i,t[3]=f,t[4]=p):p=t[4];let m=p,h;t[5]!==n||t[6]!==i.pullRequest.number||t[7]!==i.pullRequest.title?(h=(0,Q.jsxs)(h1,{arrived:n,children:[`Review on #`,i.pullRequest.number,` · `,i.pullRequest.title]}),t[5]=n,t[6]=i.pullRequest.number,t[7]=i.pullRequest.title,t[8]=h):h=t[8];let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(Tz,{children:`These drafts will be posted as one review if they are still open.`}),t[9]=g):g=t[9];let _;t[10]===h?_=t[11]:(_=(0,Q.jsxs)(Sz,{children:[h,g]}),t[10]=h,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Summary`}),t[12]=v):v=t[12];let y;t[13]===m?y=t[14]:(y=e=>m.setSummary(e.target.value),t[13]=m,t[14]=y);let b;t[15]!==m.summary||t[16]!==y?(b=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[v,(0,Q.jsx)(gH,{value:m.summary,placeholder:`Optional`,className:`min-h-10`,onChange:y})]}),t[15]=m.summary,t[16]=y,t[17]=b):b=t[17];let x;t[18]!==i.inline||t[19]!==m?(x=i.inline.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:[`On their lines · `,i.inline.length]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.inline.map(e=>(0,Q.jsx)(_1,{location:j$(e),value:m.body(e.id),onChange:m.edit(e.id)},e.id))})]}),t[18]=i.inline,t[19]=m,t[20]=x):x=t[20];let S;t[21]!==i.general||t[22]!==m?(S=i.general.length>0&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:[`In the review body · `,i.general.length]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.general.map(e=>(0,Q.jsx)(_1,{location:e.location,code:e.reason!==`step`&&e.reason!==`node`,note:N$(e.reason),value:m.body(e.id),onChange:m.edit(e.id)},e.id))})]}),t[21]=i.general,t[22]=m,t[23]=S):S=t[23];let C;t[24]!==x||t[25]!==S||t[26]!==b?(C=(0,Q.jsxs)(`div`,{className:`-mx-1 flex max-h-[60vh] flex-col gap-4 overflow-auto px-1`,children:[b,x,S]}),t[24]=x,t[25]=S,t[26]=b,t[27]=C):C=t[27];let w;t[28]===s?w=t[29]:(w=s&&(0,Q.jsx)(`p`,{role:`alert`,className:`mr-auto text-caption text-destructive`,children:s.message}),t[28]=s,t[29]=w);let T;t[30]!==s?.showPullRequest||t[31]!==i.pullRequest.url?(T=s?.showPullRequest&&(0,Q.jsxs)(X,{variant:`outline`,render:(0,Q.jsx)(`a`,{href:i.pullRequest.url,target:`_blank`,rel:`noreferrer`}),children:[`Open pull request`,(0,Q.jsx)(Uh,{"data-icon":`inline-end`})]}),t[30]=s?.showPullRequest,t[31]=i.pullRequest.url,t[32]=T):T=t[32];let E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(_h,{"data-icon":`inline-start`}),t[33]=E):E=t[33];let D;t[34]===a?D=t[35]:(D=(0,Q.jsxs)(X,{variant:`ghost`,onClick:a,children:[E,`Back`]}),t[34]=a,t[35]=D);let O=!m.request||c||!!u,k;t[36]!==l||t[37]!==m.request?(k=()=>{m.request&&l(m.request)},t[36]=l,t[37]=m.request,t[38]=k):k=t[38];let A;t[39]!==O||t[40]!==k||t[41]!==u?(A=(0,Q.jsx)(X,{disabled:O,"aria-description":u,onClick:k,children:`Post review`}),t[39]=O,t[40]=k,t[41]=u,t[42]=A):A=t[42];let j;t[43]!==w||t[44]!==T||t[45]!==D||t[46]!==A?(j=(0,Q.jsxs)(Cz,{children:[w,T,D,A]}),t[43]=w,t[44]=T,t[45]=D,t[46]=A,t[47]=j):j=t[47];let M;return t[48]!==C||t[49]!==j||t[50]!==_?(M=(0,Q.jsxs)(Q.Fragment,{children:[_,C,j]}),t[48]=C,t[49]=j,t[50]=_,t[51]=M):M=t[51],M}function y1(e){let t=(0,$.c)(25),{arrived:n,owner:r,count:i,markdown:a,onBack:o,onReview:s}=e,{unavailable:c,waiting:l,read:u}=e1(r,s),d=i===1?`1 comment`:`${i} comments`,f;t[0]!==n||t[1]!==d?(f=(0,Q.jsx)(Sz,{children:(0,Q.jsxs)(h1,{arrived:n,children:[`Publish review · `,d]})}),t[0]=n,t[1]=d,t[2]=f):f=t[2];let p=c??`One review, each comment on its file and line.`,m;t[3]===u?m=t[4]:(m=()=>void u(),t[3]=u,t[4]=m);let h;t[5]!==m||t[6]!==l?(h=(0,Q.jsx)(X,{size:`sm`,disabled:l,onClick:m,children:`Preview review`}),t[5]=m,t[6]=l,t[7]=h):h=t[7];let g;t[8]!==p||t[9]!==h?(g=(0,Q.jsx)(g1,{title:`Review on the pull request`,detail:p,action:h}),t[8]=p,t[9]=h,t[10]=g):g=t[10];let _;t[11]===a?_=t[12]:(_=(0,Q.jsx)(g1,{title:`Copy for an agent`,detail:`Markdown with each file, line range and the head commit.`,action:(0,Q.jsx)(X,{size:`sm`,variant:`outline`,onClick:()=>Zt(a,`comments`),children:`Copy Markdown`})}),t[11]=a,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`code`,{className:`font-mono text-foreground`,children:p1}),t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(g1,{title:`From the CLI`,detail:(0,Q.jsxs)(Q.Fragment,{children:[`Run `,v,` `,`in this worktree. Add`,` `,(0,Q.jsx)(`code`,{className:`font-mono text-foreground`,children:`--json`}),` for JSON.`]}),action:(0,Q.jsx)(X,{size:`sm`,variant:`outline`,onClick:b1,children:`Copy command`})}),t[14]=y):y=t[14];let b;t[15]!==g||t[16]!==_?(b=(0,Q.jsxs)(`ul`,{className:`flex flex-col rounded-lg border`,children:[g,_,y]}),t[15]=g,t[16]=_,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(_h,{"data-icon":`inline-start`}),t[18]=x):x=t[18];let S;t[19]===o?S=t[20]:(S=(0,Q.jsx)(Cz,{children:(0,Q.jsxs)(X,{variant:`ghost`,className:`mr-auto`,onClick:o,children:[x,`Comments`]})}),t[19]=o,t[20]=S);let C;return t[21]!==b||t[22]!==S||t[23]!==f?(C=(0,Q.jsxs)(Q.Fragment,{children:[f,b,S]}),t[21]=b,t[22]=S,t[23]=f,t[24]=C):C=t[24],C}function b1(){return Zt(p1,`the command`)}function x1(e){let t=(0,$.c)(43),{arrived:n,owner:r,onPublish:i}=e,{view:a,failed:o,refresh:s}=X$(r),c,l,u,d,f,p,m,h;if(t[0]!==n||t[1]!==o||t[2]!==r||t[3]!==s||t[4]!==a){c=x$(a);let e=A$(a),i=c.length>0?` · ${c.length}`:``,g;t[13]!==n||t[14]!==i?(g=(0,Q.jsxs)(h1,{arrived:n,children:[`Comments`,i]}),t[13]=n,t[14]=i,t[15]=g):g=t[15];let _;t[16]===a?_=t[17]:(_=a&&(0,Q.jsxs)(Tz,{children:[(0,Q.jsx)(`span`,{className:`font-mono`,children:a.branch||`detached HEAD`}),` `,`at `,(0,Q.jsx)(`span`,{className:`font-mono`,children:a.headOid.slice(0,7)}),`. Nothing is posted until you publish.`]}),t[16]=a,t[17]=_),t[18]!==_||t[19]!==g?(h=(0,Q.jsxs)(Sz,{children:[g,_]}),t[18]=_,t[19]=g,t[20]=h):h=t[20],l=`-mx-1 flex max-h-[60vh] flex-col gap-2 overflow-auto px-1`,t[21]!==o||t[22]!==a?(u=!a&&!o&&(0,Q.jsx)(Be,{label:`Loading comments`}),t[21]=o,t[22]=a,t[23]=u):u=t[23],t[24]!==o||t[25]!==s?(d=o&&(0,Q.jsxs)(`p`,{role:`alert`,className:`text-ui`,children:[`Comments could not be read.`,` `,(0,Q.jsx)(X,{variant:`link`,size:`flush`,onClick:s,children:`Try again`})]}),t[24]=o,t[25]=s,t[26]=d):d=t[26],f=a&&c.length===0&&(0,Q.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`No draft comments. Add one from any diff line, file, step or diagram node.`});let v;t[27]===r?v=t[28]:(v=e=>(0,Q.jsx)(o1,{owner:r,comment:e,location:E$(e.anchor)},e.id),t[27]=r,t[28]=v),p=c.map(v),m=e.length>0&&(0,Q.jsxs)(`details`,{className:`mt-2 text-ui`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-default text-caption text-muted-foreground`,children:[`Posted · `,e.length]}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:e.map(e=>(0,Q.jsx)(o1,{owner:r,comment:e,location:E$(e.anchor)},e.id))})]}),t[0]=n,t[1]=o,t[2]=r,t[3]=s,t[4]=a,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h}else c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12];let g;t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==f||t[33]!==p||t[34]!==m?(g=(0,Q.jsxs)(`div`,{className:l,children:[u,d,f,p,m]}),t[29]=l,t[30]=u,t[31]=d,t[32]=f,t[33]=p,t[34]=m,t[35]=g):g=t[35];let _=c.length===0,v;t[36]!==i||t[37]!==_?(v=(0,Q.jsx)(Cz,{children:(0,Q.jsx)(X,{disabled:_,onClick:i,children:`Publish review`})}),t[36]=i,t[37]=_,t[38]=v):v=t[38];let y;return t[39]!==v||t[40]!==h||t[41]!==g?(y=(0,Q.jsxs)(Q.Fragment,{children:[h,g,v]}),t[39]=v,t[40]=h,t[41]=g,t[42]=y):y=t[42],y}function S1(e){let t=(0,$.c)(20),{owner:n,open:r,onOpenChange:i,initialStep:a}=e,o=a===void 0?`list`:a,[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(),[d,f]=(0,Z.useState)(),[p,m]=(0,Z.useState)(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{m(!0),c(e)},t[0]=h):h=t[0];let g=h,{view:_}=X$(n),v;t[1]===_?v=t[2]:(v=x$(_),t[1]=_,t[2]=v);let y=v.length,b;t[3]!==p||t[4]!==y||t[5]!==n||t[6]!==d||t[7]!==l||t[8]!==s||t[9]!==_?.markdown?(b=()=>d?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(h1,{arrived:p,children:`Review posted`}),(0,Q.jsx)(Tz,{children:`The comments are marked as posted.`})]}),(0,Q.jsx)(Cz,{children:(0,Q.jsxs)(X,{variant:`outline`,render:(0,Q.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`}),children:[`Open on GitHub`,(0,Q.jsx)(Uh,{"data-icon":`inline-end`})]})})]}):s===`review`&&l?(0,Q.jsx)(v1,{arrived:p,owner:n,preview:l,onBack:()=>g(`publish`),onPosted:e=>{m(!0),f(e)}}):s===`publish`?(0,Q.jsx)(y1,{arrived:p,owner:n,count:y,markdown:_?.markdown??``,onBack:()=>g(`list`),onReview:e=>{u(e),g(`review`)}}):(0,Q.jsx)(x1,{arrived:p,owner:n,onPublish:()=>g(`publish`)}),t[3]=p,t[4]=y,t[5]=n,t[6]=d,t[7]=l,t[8]=s,t[9]=_?.markdown,t[10]=b):b=t[10];let x=b,S;t[11]!==o||t[12]!==i?(S=e=>{e||(c(o),f(void 0),m(!1)),i(e)},t[11]=o,t[12]=i,t[13]=S):S=t[13];let C;t[14]===x?C=t[15]:(C=(0,Q.jsx)(xz,{className:`sm:max-w-[min(92vw,40rem)]`,children:x()}),t[14]=x,t[15]=C);let w;return t[16]!==r||t[17]!==S||t[18]!==C?(w=(0,Q.jsx)(vz,{open:r,onOpenChange:S,children:C}),t[16]=r,t[17]=S,t[18]=C,t[19]=w):w=t[19],w}function C1(e){let t=(0,$.c)(19),{owner:n,path:r,onClose:i}=e,{view:a}=X$(n),o;t[0]!==r||t[1]!==a?(o=r===void 0?[]:w$(a,e=>e.kind===`file`&&e.path===r),t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=r!==void 0,l;t[3]===i?l=t[4]:(l=e=>{e||i()},t[3]=i,t[4]=l);let u;t[5]===r?u=t[6]:(u=(0,Q.jsx)(Sz,{children:(0,Q.jsx)(wz,{children:(0,Q.jsx)(`span`,{className:`font-mono text-ui`,children:r})})}),t[5]=r,t[6]=u);let d;t[7]!==s||t[8]!==i||t[9]!==n||t[10]!==r?(d=r!==void 0&&(0,Q.jsx)(s1,{owner:n,drafts:s,anchor:{kind:`file`,path:r},composing:!0,onClose:i}),t[7]=s,t[8]=i,t[9]=n,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==u||t[13]!==d?(f=(0,Q.jsxs)(xz,{className:`sm:max-w-[min(92vw,34rem)]`,children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==c||t[16]!==l||t[17]!==f?(p=(0,Q.jsx)(vz,{open:c,onOpenChange:l,children:f}),t[15]=c,t[16]=l,t[17]=f,t[18]=p):p=t[18],p}function w1(e){let t=(0,$.c)(21),{view:n}=X$(e),[r,i]=(0,Z.useState)(),[a,o]=(0,Z.useState)(!1),s;t[0]===n?s=t[1]:(s=x$(n),t[0]=n,t[1]=s);let c=s.length,l;t[2]===n?l=t[3]:(l=C$(n),t[2]=n,t[3]=l);let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>i(e),t[4]=u):u=t[4];let d;t[5]===c?d=t[6]:(d=c>0?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-2 pb-1.5 text-2xs text-muted-foreground tabular-nums`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:c===1?`1 draft comment`:`${c} draft comments`}),(0,Q.jsx)(X,{size:`xs`,variant:`ghost`,onClick:()=>o(!0),children:`Publish review`})]}):null,t[5]=c,t[6]=d);let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>i(void 0),t[7]=f):f=t[7];let p;t[8]!==e||t[9]!==r?(p=(0,Q.jsx)(C1,{owner:e,path:r,onClose:f}),t[8]=e,t[9]=r,t[10]=p):p=t[10];let m;t[11]!==a||t[12]!==e?(m=(0,Q.jsx)(S1,{owner:e,open:a,onOpenChange:o}),t[11]=a,t[12]=e,t[13]=m):m=t[13];let h;t[14]!==p||t[15]!==m?(h=(0,Q.jsxs)(Q.Fragment,{children:[p,m]}),t[14]=p,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==l||t[18]!==d||t[19]!==h?(g={counts:l,comment:u,summary:d,dialogs:h},t[17]=l,t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function T1(e){let t=(0,$.c)(23),{owner:n}=e,{view:r}=X$(n),[i,a]=(0,Z.useState)(!1),o,s,c,l;if(t[0]!==r){let e=x$(r);o=e.length,s=A$(r).length;let n;t[5]===o?n=t[6]:(n=k$(o),t[5]=o,t[6]=n);let i=n,u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(e,t)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),className:`-mx-2 flex min-h-7 items-baseline gap-2 rounded-md px-2 py-1 text-left text-ui hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,Q.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:t})]}),t[7]=u):u=t[7],c=u,l=o>0&&c((0,Q.jsxs)(Q.Fragment,{children:[i,(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,O$(e)]})]}),`Publish review`),t[0]=r,t[1]=o,t[2]=s,t[3]=c,t[4]=l}else o=t[1],s=t[2],c=t[3],l=t[4];let u;t[8]!==o||t[9]!==s||t[10]!==c?(u=o===0&&s>0&&c((0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:s===1?`1 comment posted`:`${s} comments posted`}),`Show`),t[8]=o,t[9]=s,t[10]=c,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==s?(d=o===0&&s===0&&(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:`No draft comments`}),t[12]=o,t[13]=s,t[14]=d):d=t[14];let f;t[15]!==i||t[16]!==n?(f=(0,Q.jsx)(S1,{owner:n,open:i,onOpenChange:a}),t[15]=i,t[16]=n,t[17]=f):f=t[17];let p;return t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,u,d,f]}),t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function E1(e,t){return(0,Q.jsxs)(X,{size:`sm`,variant:`outline`,onClick:t,children:[`Publish review (`,e,`)`]})}function D1(e){let t=(0,$.c)(11),{owner:n,renderTrigger:r}=e,i=r===void 0?E1:r,a=X$(n),o;t[0]===a.view?o=t[1]:(o=x$(a.view),t[0]=a.view,t[1]=o);let s=o.length,[c,l]=(0,Z.useState)(!1);if(s===0&&!c)return null;let u;t[2]!==s||t[3]!==i?(u=s>0&&i(s,()=>l(!0)),t[2]=s,t[3]=i,t[4]=u):u=t[4];let d;t[5]!==c||t[6]!==n?(d=(0,Q.jsx)(S1,{owner:n,open:c,onOpenChange:l,initialStep:`publish`}),t[5]=c,t[6]=n,t[7]=d):d=t[7];let f;return t[8]!==u||t[9]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[u,d]}),t[8]=u,t[9]=d,t[10]=f):f=t[10],f}function O1(e){let t=(0,$.c)(14),n=f$(e.scope,e.context,k1,e.range),r;t[0]!==e||t[1]!==n?(r=t=>{n.writeBlock||t.review?.current===!1||(e.onReview?e.onReview(t):n.toggle(t.review))},t[0]=e,t[1]=n,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n.writeBlock||t[5]!==r?(i={...e,writeBlock:n.writeBlock,onToggleReviewed:r},t[3]=e,t[4]=n.writeBlock,t[5]=r,t[6]=i):i=t[6];let a=i,o;t[7]!==e.interaction.entry||t[8]!==e.range?(o=JSON.stringify([e.interaction.entry,e.range]),t[7]=e.interaction.entry,t[8]=e.range,t[9]=o):o=t[9];let s=o,c;return t[10]!==s||t[11]!==e.comments||t[12]!==a?(c=e.comments?(0,Q.jsx)(A1,{...a},s):(0,Q.jsx)(M1,{...a},s),t[10]=s,t[11]=e.comments,t[12]=a,t[13]=c):c=t[13],c}function k1(e){return ks(e)}function A1(e){let t=(0,$.c)(10),n;t[0]!==e.context||t[1]!==e.scope?(n={scope:e.scope,context:e.context},t[0]=e.context,t[1]=e.scope,t[2]=n):n=t[2];let{view:r}=X$(n),i;t[3]===r?.comments?i=t[4]:(i=r?.comments??[],t[3]=r?.comments,t[4]=i);let a;t[5]===i?a=t[6]:(a=i.filter(j1),t[5]=i,t[6]=a);let o=a,s;return t[7]!==o||t[8]!==e?(s=(0,Q.jsx)(M1,{...e,commentDrafts:o}),t[7]=o,t[8]=e,t[9]=s):s=t[9],s}function j1(e){return e.publication.status===`draft`}function M1(e){let t=(0,$.c)(151),{entries:n,listed:r,paths:i,scope:a,context:o,interaction:s,header:c,footer:l,headerLeading:u,headerActions:d,emptyActions:f,toolbar:p,foundMatch:m,disableFileHeader:h,fileDiff:g,compactThreads:_,fullHeight:v,compactHeight:y,collapsible:b,decision:x,column:S,readingColumn:C,framed:w,range:T,onToggleReviewed:E,writeBlock:D,commentDrafts:O}=e,k=h!==void 0&&h,A=_!==void 0&&_,j=v!==void 0&&v,M=y!==void 0&&y,N=b!==void 0&&b,P=x!==void 0&&x,F=S!==void 0&&S,I=C===void 0?F:C,L=w!==void 0&&w,[R,z]=(0,Z.useState)(null),{dark:B}=Xd(),{preferences:V}=Bu(),H=Ku(o.connection),U=P?n:Ay(n,H),W=r??U.map(U1),G=r===void 0||P?W:Ay(W,H),K=G.filter(H1),q=dQ(s.worktreeId,s.entry),ee;t[0]!==o.connection.environmentId||t[1]!==s.entry||t[2]!==s.worktreeId||t[3]!==T?(ee=JSON.stringify([o.connection.environmentId,s.worktreeId,s.entry,T]),t[0]=o.connection.environmentId,t[1]=s.entry,t[2]=s.worktreeId,t[3]=T,t[4]=ee):ee=t[4];let J=hQ(ee),te;t[5]===J?te=t[6]:(te=()=>J.selection(),t[5]=J,t[6]=te);let[ne,re]=(0,Z.useState)(te),ie=ne?U.find(e=>e.id===ne.lines.id):void 0,ae=ne!==null&&ie?.version!==ne.version,oe=ae?null:ne?.lines??null,se=e=>{let t=e?U.find(t=>t.id===e.id):void 0,n=e&&t?{lines:e,version:t.version}:null;re(n),J.rememberSelection(n)},ce=oe?.range,le;t[7]===ce?le=t[8]:(le=g$(ce),t[7]=ce,t[8]=le);let ue=le,de;t[9]===J?de=t[10]:(de=()=>J.focused(),t[9]=J,t[10]=de);let[fe,pe]=(0,Z.useState)(de),[me,he]=(0,Z.useState)();me===void 0||s.active&&(i?.includes(me.path)||G.some(e=>e.path===me.path))||he(void 0);let ge=me&&s.active?_e(me):void 0;function _e(e){let t=G.find(t=>t.id===e.id);if(t?.state===`code`||t?.state===`pending`)return t;let n=G.filter(t=>t.path===e.path),r=n[0];return r?.state===`omitted`?n.find(V1)??n.find(B1)??r:r}let ve;t[11]!==he||t[12]!==J?(ve=e=>{he(void 0),pe(e),J.rememberFocus(e)},t[11]=he,t[12]=J,t[13]=ve):ve=t[13];let ye=ve,be;t[14]===fe?be=t[15]:(be=e=>e.id===fe,t[14]=fe,t[15]=be);let xe=Math.max(K.findIndex(be),0),Se=U.find(e=>e.id===K[xe]?.id),Ce=K[xe]?.path;yQ(s.active&&Ce!==void 0&&K.length>1?{worktreeId:s.worktreeId,entry:s.entry,path:Ce}:void 0);let we=e=>{let t=e.getScrollTop(),n=t+e.getHeight()>=e.getScrollHeight()-1;if(me!==void 0||n)return;let r=t+G1,i;for(let t of e.getRenderedItems()){let n=e.getTopForItem(t.id);n!==void 0&&n<=r&&(i=t.id)}i===void 0&&t===0&&(i=K[0]?.id),i!==void 0&&i!==K[xe]?.id&&K.some(e=>e.id===i)&&(pe(i),J.rememberFocus(i))},Te=new Set(U.filter(e=>QZ(q.folds,e.id,U.length>1&&e.review?.reviewed===!0||(N||U.length>1)&&H&&ky(e.path))).map(z1)),[Ee,De]=(0,Z.useState)(),[Oe,ke]=(0,Z.useState)(),Ae;t[16]!==m||t[17]!==V||t[18]!==Oe?(Ae=e=>{m&&V.lineOverflow===`scroll`&&Oe!==m.nonce&&s$(e,m)&&ke(m.nonce)},t[16]=m,t[17]=V,t[18]=Oe,t[19]=Ae):Ae=t[19];let je=Ae,[Me,Ne]=(0,Z.useState)(),Pe=e=>{let t=K[e];t&&(ye(t.id),U.some(e=>e.id===t.id)?J.scrollTo({type:`item`,id:t.id,align:`start`}):he({path:t.path,id:t.id}))},Fe;t[20]!==he||t[21]!==me?(Fe=()=>{me!==void 0&&he(void 0)},t[20]=he,t[21]=me,t[22]=Fe):Fe=t[22];let Ie=Fe,Le=new Map(U.map(R1)),Re;t[23]!==O||t[24]!==R?(Re=e=>{if(O===void 0)return[];let t=new Map,n=(e,n)=>{let r=`${e}:${n}`,i=t.get(r)??{side:e,line:n,drafts:[]};return t.set(r,i),i};for(let t of O){let r=t.anchor;r.kind===`lines`&&r.path===e.path&&(e.kind!==`file`||r.side===`additions`)&&n(r.side,r.end).drafts.push(t)}return R?.id===e.id&&(n(R.side,R.end).composing={side:R.side,start:R.start,end:R.end}),[...t.values()]},t[23]=O,t[24]=R,t[25]=Re):Re=t[25];let ze=Re,Be=U.map(e=>{let t=ze(e),n={id:e.id,collapsed:Te.has(e.id),version:bu(JSON.stringify([e.version,Te.has(e.id),t]))},r=t$(e);return r.type===`diff`?{...n,...r,annotations:t.map(L1)}:{...n,...r,annotations:t.map(I1)}}),Ve=U.filter(F1),He=new Set(Ve.map(P1)).size,Ue=Ve[0]?.id,We=new Map;for(let e of U)e.review&&!We.has(e.review.path)&&We.set(e.review.path,e.id);let Ge=j||l?12:160,Ke=P||F||L,qe=B?`dark`:`light`,Je=V.lineOverflow,Ye=V.diffStyle,Xe=!k&&!j,Ze=k||M,Qe=O!==void 0,$e;t[26]!==O||t[27]!==q?($e=(e,t)=>{let n=f1(e);n&&O!==void 0&&(t.item.type!==`file`||n.side===`additions`)&&(q.setCollapsed([t.item.id],!1),z({id:t.item.id,...n}))},t[26]=O,t[27]=q,t[28]=$e):$e=t[28];let et,tt;t[29]===ye?(et=t[30],tt=t[31]):(et=(e,t)=>ye(t.item.id),tt=(e,t)=>ye(t.item.id),t[29]=ye,t[30]=et,t[31]=tt);let nt;t[32]===je?nt=t[33]:(nt=(e,t,n,r)=>{r.item.type===`file`&&n!==`unmount`&&je(e)},t[32]=je,t[33]=nt);let rt;t[34]===g?rt=t[35]:(rt=a$(g),t[34]=g,t[35]=rt);let it=`${A?`[data-line-annotation]:has([data-file-thread-marker]) { margin-left: 0; }`:``}${rt}${Ke?qd:``}${F?Mu:``}${vd}${O===void 0?``:md}${k||M?`[data-code] { padding-top: 0 !important; }`:Lu}${k||M||Ke?``:Nd}${A?tf:``}${M?`[data-diffs-header], pre { border: 0; border-radius: 0; }`:``}`,at;t[36]===F?at=t[37]:(at=F?{itemMetrics:{lineHeight:22,diffHeaderHeight:41}}:{},t[36]=F,t[37]=at);let ot;t[38]!==M||t[39]!==k?(ot=k||M?{itemMetrics:{paddingTop:0}}:{},t[38]=M,t[39]=k,t[40]=ot):ot=t[40];let st=k||M?0:12,ct=M?0:Ge,lt;t[41]!==st||t[42]!==ct?(lt={paddingTop:st,paddingBottom:ct,gap:12},t[41]=st,t[42]=ct,t[43]=lt):lt=t[43];let ut;t[44]!==V.diffStyle||t[45]!==V.lineOverflow||t[46]!==qe||t[47]!==Xe||t[48]!==Ze||t[49]!==Qe||t[50]!==$e||t[51]!==et||t[52]!==tt||t[53]!==nt||t[54]!==it||t[55]!==at||t[56]!==ot||t[57]!==lt?(ut={preferredHighlighter:Gu,theme:Qu,themeType:qe,overflow:Je,diffStyle:Ye,diffIndicators:`classic`,hunkSeparators:`line-info`,stickyHeaders:Xe,disableFileHeader:Ze,enableLineSelection:!0,enableGutterUtility:Qe,onGutterUtilityClick:$e,onLineClick:et,onLineNumberClick:tt,onPostRender:nt,lineHoverHighlight:`number`,unsafeCSS:it,...at,...ot,layout:lt},t[44]=V.diffStyle,t[45]=V.lineOverflow,t[46]=qe,t[47]=Xe,t[48]=Ze,t[49]=Qe,t[50]=$e,t[51]=et,t[52]=tt,t[53]=nt,t[54]=it,t[55]=at,t[56]=ot,t[57]=lt,t[58]=ut):ut=t[58];let dt=ut,ft=U.length>0&&U.every(e=>Te.has(e.id)),pt;t[59]!==U||t[60]!==q?(pt=e=>q.setCollapsed(U.map(N1),e),t[59]=U,t[60]=q,t[61]=pt):pt=t[61];let mt=pt,ht=e=>{ye(e),q.setCollapsed([e],!Te.has(e))},gt;t[62]===ft?gt=t[63]:(gt=ft?(0,Q.jsx)(Th,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,Q.jsx)(Ch,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[62]=ft,t[63]=gt);let _t=gt,vt=ft?`Expand all files`:`Collapse all files`,yt;t[64]!==ft||t[65]!==mt?(yt=()=>mt(!ft),t[64]=ft,t[65]=mt,t[66]=yt):yt=t[66];let bt;t[67]!==_t||t[68]!==vt||t[69]!==yt?(bt=(0,Q.jsxs)(X,{size:`sm`,variant:`ghost`,onClick:yt,children:[_t,vt]}),t[67]=_t,t[68]=vt,t[69]=yt,t[70]=bt):bt=t[70];let xt=bt,St=U.length>1?xt:null,Ct;t[71]!==s.entry||t[72]!==s.toolbarTarget?(Ct=s.toolbarTarget!==void 0&&/^(file|review-file|review-change|change|branch):/.test(s.entry),t[71]=s.entry,t[72]=s.toolbarTarget,t[73]=Ct):Ct=t[73];let wt=Ct,Tt;t[74]!==f||t[75]!==Se||t[76]!==d||t[77]!==E||t[78]!==wt||t[79]!==D?(Tt=wt&&(Se?(0,Q.jsxs)(Q.Fragment,{children:[Se.review&&(0,Q.jsx)(qQ,{label:`Reviewed`,variant:`outline`,icon:Se?.review?.reviewed?Dn:k_,shortcut:ou.toggleReviewed,description:D,disabled:!!D||Se.review.current===!1||!Se.review.fingerprint,pressed:Se?.review?.reviewed,onClick:()=>{Se&&E(Se)}}),d]}):f??d),t[74]=f,t[75]=Se,t[76]=d,t[77]=E,t[78]=wt,t[79]=D,t[80]=Tt):Tt=t[80];let Et=Tt,Dt;t[81]!==he||t[82]!==me?.path||t[83]!==St||t[84]!==U||t[85]!==xe||t[86]!==q||t[87]!==c||t[88]!==_e||t[89]!==ge||t[90]!==K||t[91]!==ye||t[92]!==J?(Dt=c&&(()=>c({collapse:St,current:K[xe]?.path,counts:n$(U),open:e=>{let t=K.find(t=>t.path===e);t&&(q.setCollapsed([t.id],!1),ye(t.id));let n=_e({path:e});n?.state===`code`?J.scrollTo({type:`item`,id:n.id,align:`start`}):he({path:e})},awaiting:ge?.state===`omitted`?ge.path:void 0,landed:e=>{me?.path===e&&he(void 0)}})),t[81]=he,t[82]=me?.path,t[83]=St,t[84]=U,t[85]=xe,t[86]=q,t[87]=c,t[88]=_e,t[89]=ge,t[90]=K,t[91]=ye,t[92]=J,t[93]=Dt):Dt=t[93];let Ot=Dt,kt;t[94]===Ie?kt=t[95]:(kt=e=>{K1.has(e.key)&&Ie()},t[94]=Ie,t[95]=kt);let At=(P||F||A||L)&&`decision-code`,jt=A&&`file-code`,Mt=L&&`commit-code`,Nt=M&&`overflow-hidden rounded-lg border`,Pt;t[96]!==At||t[97]!==jt||t[98]!==Mt||t[99]!==Nt?(Pt=Y(`@container/code relative flex min-h-0 flex-1 flex-col`,At,jt,Mt,Nt),t[96]=At,t[97]=jt,t[98]=Mt,t[99]=Nt,t[100]=Pt):Pt=t[100];let Ft;t[101]!==s.toolbarTarget||t[102]!==Et?(Ft=s.toolbarTarget&&Et&&(0,th.createPortal)(Et,s.toolbarTarget),t[101]=s.toolbarTarget,t[102]=Et,t[103]=Ft):Ft=t[103];let It;t[104]!==O||t[105]!==U||t[106]!==Pe||t[107]!==xe||t[108]!==Se||t[109]!==q||t[110]!==s.active||t[111]!==s.entry||t[112]!==K||t[113]!==E||t[114]!==oe?(It=s.active&&K.length>0&&(0,Q.jsx)(J1,{reviewEnabled:!s.entry.startsWith(`walkthrough-step:`),next:()=>Pe(Math.min(xe+1,K.length-1)),previous:()=>Pe(Math.max(xe-1,0)),review:()=>{Se?.review&&E(Se)},comment:()=>{let e=oe?f1(oe.range):null;oe&&e&&O!==void 0&&(U.find(e=>e.id===oe.id)?.kind!==`file`||e.side===`additions`)&&(q.setCollapsed([oe.id],!1),z({id:oe.id,...e}))}}),t[104]=O,t[105]=U,t[106]=Pe,t[107]=xe,t[108]=Se,t[109]=q,t[110]=s.active,t[111]=s.entry,t[112]=K,t[113]=E,t[114]=oe,t[115]=It):It=t[115];let Lt;t[116]===ae?Lt=t[117]:(Lt=ae&&(0,Q.jsx)(`p`,{role:`status`,className:`absolute bottom-3 left-3 z-10 rounded-lg border bg-popover p-2 text-xs`,children:`Code changed since these lines were selected. Select lines again.`}),t[116]=ae,t[117]=Lt);let Rt;t[118]!==ue||t[119]!==o||t[120]!==a||t[121]!==ie?(Rt=ue&&ie?.discardScope&&ie.current!==!1&&(0,Q.jsx)(`div`,{className:`absolute bottom-3 left-3 z-10 rounded-lg border bg-popover p-2`,children:(0,Q.jsx)(UJ,{scope:a,context:o,path:ie.path,hunk:{scope:ie.discardScope,...ue},variant:`compact`})}),t[118]=ue,t[119]=o,t[120]=a,t[121]=ie,t[122]=Rt):Rt=t[122];let zt;t[123]!==St||t[124]!==F||t[125]!==p?(zt=p?p(St):!F&&St&&(0,Q.jsx)(`div`,{className:`flex shrink-0 justify-end px-3`,children:St}),t[123]=St,t[124]=F,t[125]=p,t[126]=zt):zt=t[126];let Bt;t[127]!==U.length||t[128]!==l||t[129]!==c||t[130]!==d||t[131]!==u||t[132]!==wt||t[133]!==I||t[134]!==Ot?(Bt=U.length===0&&(c||d||l)&&(0,Q.jsxs)(`div`,{className:Y(`min-h-0 flex-1 overflow-auto`,I&&q1),"data-testid":`empty-code-document`,children:[u&&(0,Q.jsx)(`div`,{className:`flex items-center gap-1 px-3.5 py-2`,children:u}),Ot?.(),l?.(),!wt&&d&&(0,Q.jsx)(`div`,{className:`flex justify-end px-3.5 py-2`,children:(0,Q.jsx)(XJ,{children:d})})]}),t[127]=U.length,t[128]=l,t[129]=c,t[130]=d,t[131]=u,t[132]=wt,t[133]=I,t[134]=Ot,t[135]=Bt):Bt=t[135];let Ht;t[136]!==M||t[137]!==U[0]?(Ht=M&&U[0]&&(0,Q.jsx)(`div`,{className:`flex min-h-10 shrink-0 items-center gap-2 border-b bg-muted px-2 py-1`,children:(0,Q.jsx)(fr,{className:`min-w-0 flex-1 font-mono text-caption font-medium`,text:U[0].path})}),t[136]=M,t[137]=U[0],t[138]=Ht):Ht=t[138];let Ut=U.length>0&&(0,Q.jsx)(BF,{ref:e=>{if(!e)return;let t=e.getInstance();if(!t)return;let n=J.attach(t),r=requestAnimationFrame(()=>{J.restorePosition(t,dt.stickyHeaders&&!dt.disableFileHeader?dt.itemMetrics?.diffHeaderHeight??_d.diffHeaderHeight:0);let n=ge?.state===`code`?U.find(e=>e.id===ge.id):void 0;n&&(e.scrollTo({type:`item`,id:n.id,align:`start`}),ye(n.id));let r=s.fileTarget,i=r?U.find(e=>r.entry===void 0?e.path===r.path:e.id===r.entry):void 0;r&&i&&r.nonce!==Me&&(q.setCollapsed([i.id],!1),e.scrollTo({type:`item`,id:i.id,align:`start`}),ye(i.id),Ne(r.nonce));let a=U[0];if(m&&a&&Ee!==m.nonce){se({id:a.id,range:{start:m.line,end:m.line}}),e.scrollTo({type:`line`,id:a.id,lineNumber:m.line,align:`center`});let n=t.getRenderedItems()[0];n?.type===`file`&&je(n.element),De(m.nonce)}});return()=>{cancelAnimationFrame(r),n?.()}},items:Be,onScroll:(e,t)=>{J.rememberPosition(e),we(t)},selectedLines:oe,onSelectedLinesChange:e=>{se(e),e&&ye(e.id)},renderAnnotation:(...e)=>{let[t]=e,n=t.metadata,r=U.find(e=>e.id===R?.id),i=n.composing,s=i&&r?{kind:`lines`,path:r.path,...i,text:r.kind===`diff`?u1(r.fileDiff,i):d1(r.contents,i)}:void 0;return(0,Q.jsx)(s1,{owner:{scope:a,context:o},drafts:n.drafts,anchor:s,composing:i!==void 0,onClose:()=>{z(null),se(null)},className:`mx-3 my-2 max-w-[min(100%,48rem)]`})},renderHeaderMetadata:e=>{let t=Le.get(e.id);if(k||!t)return null;let n=e.id===U[0]?.id,r=!wt&&n?d:null,i=e.id===U[0]?.id?u:null,a=t.review?.stale?(0,Q.jsx)(`span`,{className:`rounded-md bg-graph-4/15 px-1.5 py-0.5 font-sans text-2xs text-graph-4`,children:`Changed since reviewed`}):null;return F?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[a,(0,Q.jsx)(i$,{counts:r$(t)})]}):!a&&!i&&!r?null:(0,Q.jsxs)(`div`,{className:Y(`flex max-w-full items-center justify-end gap-1.5`,!P&&`flex-wrap`),children:[a,i,r&&(0,Q.jsx)(XJ,{children:r})]})},options:dt,className:Y(M&&`max-h-48 flex-none overflow-auto`,!M&&j&&`flex-none overflow-visible`,!M&&!j&&`min-h-0 flex-1 overflow-auto`,I&&q1),...Ot?{renderCodeViewHeader:Ot}:{},...l?{renderCodeViewFooter:l}:{},renderHeaderPrefix:e=>{let t=Le.get(e.id);if(!t)return null;let n=Te.has(e.id),r=t.review,i=r&&!wt&&We.get(r.path)===t.id?r.control:null;return(0,Q.jsxs)(`span`,{className:Y(`flex items-center`,F?`gap-2`:`gap-1`),children:[!P&&H&&e.id===Ue&&U.length>Ve.length&&(0,Q.jsxs)(`span`,{className:`mr-2 border-r pr-2 font-sans text-xs font-medium`,children:[`Specs · `,Vt(He,`file`)]}),(F||N||U.length>1)&&(0,Q.jsx)(X1,{label:`${n?`Expand`:`Collapse`} ${t.path}`,icon:n?ci:sc,expanded:!n,onClick:()=>ht(e.id)}),i]})},renderHeaderFilenameSuffix:e=>{let t=Le.get(e.id);return t&&t.note&&!W1.has(t.note)?(0,Q.jsx)(fr,{className:`ml-2 hidden max-w-48 font-sans text-xs text-muted-foreground @code-wide/code:block`,text:t.note}):null}}),Wt;return t[139]!==Ie||t[140]!==kt||t[141]!==Pt||t[142]!==Ft||t[143]!==It||t[144]!==Lt||t[145]!==Rt||t[146]!==zt||t[147]!==Bt||t[148]!==Ht||t[149]!==Ut?(Wt=(0,Q.jsxs)(`div`,{role:`region`,"aria-label":`Code content`,onWheel:Ie,onTouchMove:Ie,onPointerDown:Ie,onKeyDown:kt,className:Pt,children:[Ft,It,Lt,Rt,zt,Bt,Ht,Ut]}),t[139]=Ie,t[140]=kt,t[141]=Pt,t[142]=Ft,t[143]=It,t[144]=Lt,t[145]=Rt,t[146]=zt,t[147]=Bt,t[148]=Ht,t[149]=Ut,t[150]=Wt):Wt=t[150],Wt}function N1(e){return e.id}function P1(e){return e.path}function F1(e){return ky(e.path)}function I1(e){return{lineNumber:e.line,metadata:e}}function L1(e){return{side:e.side,lineNumber:e.line,metadata:e}}function R1(e){return[e.id,e]}function z1(e){return e.id}function B1(e){return e.state===`code`}function V1(e){return e.state===`pending`}function H1(e){return e.state!==`omitted`}function U1(e){return{id:e.id,path:e.path,state:`code`}}var W1=new Set([`added`,`deleted`,`modified`,`renamed`]),G1=8,K1=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]),q1=`px-[max(--spacing(4),calc((100%-var(--container-reading))/2))] @2xl/pane:px-[max(--spacing(7),calc((100%-var(--container-reading))/2))]`;function J1(e){let t=(0,$.c)(4),{reviewEnabled:n,next:r,previous:i,review:a,comment:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={ignoreInputs:!0},t[0]=s):s=t[0];let c=s;Hu(ou.nextFile,r,c),Hu(ou.previousFile,i,c),Hu(ou.comment,o,c);let l;return t[1]!==a||t[2]!==n?(l=n?(0,Q.jsx)(Y1,{review:a}):null,t[1]=a,t[2]=n,t[3]=l):l=t[3],l}function Y1(e){let t=(0,$.c)(1),{review:n}=e,r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={ignoreInputs:!0},t[0]=r):r=t[0],Hu(ou.toggleReviewed,n,r),null}function X1(e){let t=(0,$.c)(14),{label:n,icon:r,expanded:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":n,"aria-expanded":i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Q.jsx)(r,{}),t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsx)(Ze,{render:o,children:s}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]===n?l=t[10]:(l=(0,Q.jsx)(Yo,{children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(ot,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z1(e){let t=(0,$.c)(57),{target:n,barActions:r,title:i,titleLabel:a,subtitle:o,aside:s,children:c,className:l,inline:u}=e;if(u!==void 0&&u){let e=a??(typeof i==`string`?i:``),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(`h1`,{}),t[0]=n):n=t[0];let r;t[1]!==e||t[2]!==i?(r=(0,Q.jsx)(fr,{text:e,render:n,className:`min-w-0 text-ui font-semibold`,children:i}),t[1]=e,t[2]=i,t[3]=r):r=t[3];let s;t[4]===o?s=t[5]:(s=o&&(0,Q.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:o}),t[4]=o,t[5]=s);let l;t[6]!==r||t[7]!==s?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-64 items-baseline gap-2`,children:[r,s]}),t[6]=r,t[7]=s,t[8]=l):l=t[8];let u;t[9]===c?u=t[10]:(u=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c}),t[9]=c,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(`header`,{"data-testid":`document-toolbar`,className:`flex min-h-11 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-1.5`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}if(n!==void 0){let e;t[14]!==r||t[15]!==c||t[16]!==n?(e=n&&(0,th.createPortal)(r===void 0?c:r,n),t[14]=r,t[15]=c,t[16]=n,t[17]=e):e=t[17];let l=a??(typeof i==`string`?i:``),u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(`h1`,{}),t[18]=u):u=t[18];let d;t[19]!==l||t[20]!==i?(d=(0,Q.jsx)(fr,{text:l,render:u,className:`min-w-0 text-ui font-semibold`,children:i}),t[19]=l,t[20]=i,t[21]=d):d=t[21];let f;t[22]!==s||t[23]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[d,s]}),t[22]=s,t[23]=d,t[24]=f):f=t[24];let p;t[25]===o?p=t[26]:(p=o&&(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:o}),t[25]=o,t[26]=p);let m;t[27]!==r||t[28]!==c?(m=r!==void 0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:c}),t[27]=r,t[28]=c,t[29]=m):m=t[29];let h;t[30]!==f||t[31]!==p||t[32]!==m?(h=(0,Q.jsxs)(`div`,{className:`shrink-0 px-3.5 py-2`,children:[f,p,m]}),t[30]=f,t[31]=p,t[32]=m,t[33]=h):h=t[33];let g;return t[34]!==e||t[35]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[e,h]}),t[34]=e,t[35]=h,t[36]=g):g=t[36],g}let d;t[37]===l?d=t[38]:(d=Y(`flex min-h-11 shrink-0 flex-wrap items-center gap-x-2.5 gap-y-1 border-b px-3.5`,l),t[37]=l,t[38]=d);let f=a??(typeof i==`string`?i:``),p;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`h1`,{}),t[39]=p):p=t[39];let m;t[40]!==f||t[41]!==i?(m=(0,Q.jsx)(fr,{text:f,render:p,className:`min-w-0 text-ui leading-tight font-semibold`,children:i}),t[40]=f,t[41]=i,t[42]=m):m=t[42];let h;t[43]!==s||t[44]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[m,s]}),t[43]=s,t[44]=m,t[45]=h):h=t[45];let g;t[46]===o?g=t[47]:(g=o!=null&&(0,Q.jsx)(fr,{text:o,render:(0,Q.jsx)(`p`,{}),className:`text-2xs leading-tight text-muted-foreground`}),t[46]=o,t[47]=g);let _;t[48]!==h||t[49]!==g?(_=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-auto flex-col`,children:[h,g]}),t[48]=h,t[49]=g,t[50]=_):_=t[50];let v;t[51]===c?v=t[52]:(v=(0,Q.jsx)(`div`,{className:`ml-auto flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1.5`,children:c}),t[51]=c,t[52]=v);let y;return t[53]!==d||t[54]!==_||t[55]!==v?(y=(0,Q.jsxs)(`header`,{"data-testid":`document-toolbar`,className:d,children:[_,v]}),t[53]=d,t[54]=_,t[55]=v,t[56]=y):y=t[56],y}function Q1(e){let t=(0,$.c)(4),{more:n,total:r,pending:i,onReadMore:a}=e;if(n<=0)return null;let o=`Read ${Math.min(n,25)} more of ${r}`,s;return t[0]!==a||t[1]!==i||t[2]!==o?(s=(0,Q.jsx)(`div`,{className:`border-t px-4 py-3 text-center`,children:(0,Q.jsx)(ji,{pending:i,variant:`outline`,size:`sm`,onClick:a,children:o})}),t[0]=a,t[1]=i,t[2]=o,t[3]=s):s=t[3],s}function $1(e){let t=(0,$.c)(2),{count:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`flex flex-col`,children:Array.from({length:n},e0)}),t[0]=n,t[1]=r),r}function e0(e,t){return(0,Q.jsx)(`div`,{className:`min-h-40`},t)}function t0(e,t,n,r=!0){return{path:n.path,fingerprint:n.fingerprint??null,reviewed:n.reviewStatus===`reviewed`,stale:n.reviewStatus===`stale`,current:r,control:(0,Q.jsx)(n0,{scope:e,context:t,path:n.path,fingerprint:n.fingerprint,status:n.reviewStatus,current:r,compact:!0},`review:${n.path}`)}}function n0(e){let t=(0,$.c)(48),{scope:n,context:r,path:i,fingerprint:a,status:o,current:s,compact:c,range:l}=e,u=s===void 0||s,d=c!==void 0&&c,f=l===void 0?fy:l,p=na(r),m=l$(n,r,f),h=u$(n,r,f),g=m.result.waiting||h.result.waiting,_,v;if(t[0]!==d||t[1]!==u||t[2]!==a||t[3]!==m||t[4]!==i||t[5]!==g||t[6]!==o||t[7]!==h||t[8]!==p){v=Symbol.for(`react.early_return_sentinel`);bb0:{let e=nB(m.result,h.result);if(a==null){let e;t[11]===i?e=t[12]:(e=yy([i]),t[11]=i,t[12]=e);let n;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Gh,{className:`size-3`,"aria-hidden":`true`}),t[13]=n):n=t[13];let r=d?`Not reviewable`:`Not reviewable: too large or unreadable`,a;t[14]!==e||t[15]!==r?(a=(0,Q.jsxs)(`span`,{title:e,className:`inline-flex items-center gap-1 text-2xs text-muted-foreground`,children:[n,r]}),t[14]=e,t[15]=r,t[16]=a):a=t[16],v=a;break bb0}let n=o===`reviewed`,r;t[17]!==i||t[18]!==o?(r=Cy(i,o),t[17]=i,t[18]=o,t[19]=r):r=t[19];let s=r,c=d?`icon-xs`:`xs`,l=n?`ghost`:`outline`,f=g||!!p||!u,y;t[20]!==a||t[21]!==m||t[22]!==i||t[23]!==n||t[24]!==h?(y=()=>{n?h.start(i):m.start({path:i,fingerprint:a})},t[20]=a,t[21]=m,t[22]=i,t[23]=n,t[24]=h,t[25]=y):y=t[25];let b;t[26]!==d||t[27]!==g||t[28]!==o?(b=(0,Q.jsx)(c0,{pending:g,status:o,compact:d}),t[26]=d,t[27]=g,t[28]=o,t[29]=b):b=t[29];let x;t[30]!==d||t[31]!==o?(x=!d&&l0(o),t[30]=d,t[31]=o,t[32]=x):x=t[32];let S;t[33]!==s||t[34]!==n||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==c||t[39]!==l||t[40]!==f||t[41]!==p?(S=(0,Q.jsx)(Ze,{render:(0,Q.jsxs)(X,{type:`button`,size:c,variant:l,"aria-pressed":n,disabled:f,focusableWhenDisabled:!0,"aria-description":p,"aria-label":s,onClick:y,children:[b,x]})}),t[33]=s,t[34]=n,t[35]=y,t[36]=b,t[37]=x,t[38]=c,t[39]=l,t[40]=f,t[41]=p,t[42]=S):S=t[42];let C=p??s,w;t[43]===C?w=t[44]:(w=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:C}),t[43]=C,t[44]=w);let T;t[45]!==S||t[46]!==w?(T=(0,Q.jsxs)(ot,{children:[S,w]}),t[45]=S,t[46]=w,t[47]=T):T=t[47],_=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[T,e!==void 0&&(0,Q.jsx)(fr,{className:`max-w-52 text-2xs text-destructive`,render:(0,Q.jsx)(`span`,{role:`alert`}),text:cy(e)})]})}t[0]=d,t[1]=u,t[2]=a,t[3]=m,t[4]=i,t[5]=g,t[6]=o,t[7]=h,t[8]=p,t[9]=_,t[10]=v}else _=t[9],v=t[10];return v===Symbol.for(`react.early_return_sentinel`)?_:v}function r0(e){let t=(0,$.c)(25),{scope:n,context:r,path:i,fingerprint:a,status:o,latest:s,onStart:c}=e,l=na(r),u=l$(n,r,fy),d=u$(n,r,fy),f=u.result.waiting||d.result.waiting,p=nB(u.result,d.result),m=s?p:void 0,h=(0,Z.useId)(),g=o===`reviewed`,_=a!=null,v=o===`stale`?`Changed since reviewed`:`Toggle reviewed`,y;t[0]!==i||t[1]!==_||t[2]!==v||t[3]!==l?(y=l??(_?v:yy([i])),t[0]=i,t[1]=_,t[2]=v,t[3]=l,t[4]=y):y=t[4];let b=y,x=`${i} reviewed`,S=m!==void 0,C=f||!_||!!l,w;t[5]!==f||t[6]!==a||t[7]!==u||t[8]!==c||t[9]!==i||t[10]!==g||t[11]!==d||t[12]!==l?(w=()=>{l||f||a==null||(c(),g?d.start(i):u.start({path:i,fingerprint:a}))},t[5]=f,t[6]=a,t[7]=u,t[8]=c,t[9]=i,t[10]=g,t[11]=d,t[12]=l,t[13]=w):w=t[13];let T;t[14]!==f||t[15]!==h||t[16]!==g||t[17]!==x||t[18]!==S||t[19]!==C||t[20]!==w?(T=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(pY,{checked:g,"aria-label":x,"aria-describedby":h,"aria-invalid":S,disabled:C,"aria-busy":f,onCheckedChange:w})}),t[14]=f,t[15]=h,t[16]=g,t[17]=x,t[18]=S,t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;return t[22]!==b||t[23]!==h?(E=(0,Q.jsx)(`span`,{id:h,hidden:!0,children:b}),t[22]=b,t[23]=h,t[24]=E):E=t[24],(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ot,{children:[T,(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:m===void 0?b:cy(m)})]}),E,m!==void 0&&(0,Q.jsx)(`span`,{role:`alert`,className:`sr-only`,children:cy(m)})]})}function i0(e){let t=(0,$.c)(22),{scope:n,context:r,interaction:i,branchFiles:a,changes:o,committed:s,dirty:c,range:l}=e,u=JQ(n,r,l),d;t[0]!==a||t[1]!==s||t[2]!==u?(d=sy(a,u,s),t[0]=a,t[1]=s,t[2]=u,t[3]=d):d=t[3];let f=d,p=JQ(n,r),m;t[4]!==o||t[5]!==c||t[6]!==p?(m=oy(o,p,c),t[4]=o,t[5]=c,t[6]=p,t[7]=m):m=t[7];let{reviewed:h,disabled:g,toggle:_,writeBlock:v}=p$(n,r,l,f,m,a0);if(!i.toolbarTarget)return null;let y;t[8]!==i.active||t[9]!==_?(y=i.active&&(0,Q.jsx)(o0,{toggle:_}),t[8]=i.active,t[9]=_,t[10]=y):y=t[10];let b=v??(h?`Mark this step unreviewed`:`Mark this step reviewed`),x;t[11]!==g||t[12]!==h||t[13]!==b||t[14]!==_?(x=(0,Q.jsx)(qQ,{label:`Reviewed`,description:b,variant:`outline`,icon:Dn,shortcut:ou.toggleReviewed,pressed:h,disabled:g,onClick:_}),t[11]=g,t[12]=h,t[13]=b,t[14]=_,t[15]=x):x=t[15];let S;t[16]!==y||t[17]!==x?(S=(0,Q.jsxs)(Q.Fragment,{children:[y,x]}),t[16]=y,t[17]=x,t[18]=S):S=t[18];let C;return t[19]!==i.toolbarTarget||t[20]!==S?(C=(0,th.createPortal)(S,i.toolbarTarget),t[19]=i.toolbarTarget,t[20]=S,t[21]=C):C=t[21],C}function a0(e){return ks(e)}function o0(e){let t=(0,$.c)(1),{toggle:n}=e,r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={ignoreInputs:!0},t[0]=r):r=t[0],Hu(ou.toggleReviewed,n,r),null}function s0(e){let t=(0,$.c)(6),{scope:n,context:r,entries:i,compact:a,range:o}=e,s=a!==void 0&&a,c=d$(n,r,o===void 0?fy:o),l=Sy(i),u=c.result.waiting,d=na(r),f=l.blocked||u||!!d,p=()=>{f||(l.unmarking?c.start({kind:`unmark`,paths:l.reviewedPaths}):c.start({kind:`mark`,entries:l.entries}))},m=d??l.label,h;t[0]===m?h=t[1]:(h=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:m}),t[0]=m,t[1]=h);let g;t[2]===c.report?g=t[3]:(g=c.report&&(0,Q.jsx)(f0,{report:c.report}),t[2]=c.report,t[3]=g);let _;return t[4]===c.result?_=t[5]:(_=Mi(c.result)&&(0,Q.jsx)(`span`,{role:`alert`,className:`max-w-64 text-right text-2xs text-destructive`,children:cy(Ra(c.result.cause))}),t[4]=c.result,t[5]=_),(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 flex-col items-end gap-1`,children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsxs)(X,{type:`button`,size:s?`icon-xs`:`sm`,variant:`outline`,disabled:f,focusableWhenDisabled:!0,"aria-label":l.label,"aria-description":d,onClick:p,children:[(0,Q.jsx)(u0,{pending:u,unmarking:l.unmarking}),!s&&d0(u,l.unmarking,l.text)]})}),h]}),g,_]})}function c0(e){let t=(0,$.c)(7),{pending:n,status:r,compact:i}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(ra,{className:`animate-spin`}),t[0]=e):e=t[0],e}if(r===`reviewed`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Dn,{}),t[1]=e):e=t[1],e}if(r===`stale`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Au,{}),t[2]=e):e=t[2],e}let a=i&&`invisible`,o;t[3]===a?o=t[4]:(o=Y(a),t[3]=a,t[4]=o);let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(Dn,{className:o}),t[5]=o,t[6]=s),s}function l0(e){return e===`reviewed`?`Reviewed`:e===`stale`?`Review again`:`Mark reviewed`}function u0(e){let t=(0,$.c)(3),{pending:n,unmarking:r}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(ra,{className:`animate-spin`}),t[0]=e):e=t[0],e}if(r){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Au,{}),t[1]=e):e=t[1],e}let i;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dn,{}),t[2]=i):i=t[2],i}function d0(e,t,n){return e?t?`Unmarking…`:`Marking…`:n}function f0(e){let t=(0,$.c)(11),{report:n}=e,r=n.failed.length,i=r>0?`alert`:`status`,a=r>0?`text-destructive`:`text-muted-foreground`,o;t[0]===a?o=t[1]:(o=Y(`max-w-64 text-right text-2xs leading-tight`,a),t[0]=a,t[1]=o);let s;t[2]===r?s=t[3]:(s=r>0&&(0,Q.jsx)(Dh,{className:`mr-1 inline size-3`}),t[2]=r,t[3]=s);let c;t[4]===n?c=t[5]:(c=vy(n),t[4]=n,t[5]=c);let l;return t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,Q.jsxs)(`span`,{role:i,className:o,children:[s,c]}),t[6]=i,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function p0(e){let t=(0,$.c)(9),n,r;if(t[0]===e?(n=t[1],r=t[2]):({compared:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n){let e=r.fullHeight??!1,i;return t[3]!==n||t[4]!==r||t[5]!==e?(i=(0,Q.jsx)(g0,{...r,branch:n,path:void 0,fullHeight:e}),t[3]=n,t[4]=r,t[5]=e,t[6]=i):i=t[6],i}let i;return t[7]===r?i=t[8]:(i=(0,Q.jsx)(h0,{...r,path:void 0}),t[7]=r,t[8]=i),i}function m0(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({path:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Q.jsx)(h0,{...r,path:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function h0(e){let t=(0,$.c)(14),{scope:n,context:r,interaction:i,base:a,path:o,only:s,heading:c,fullHeight:l,onOpen:u}=e,d=l!==void 0&&l,f;t[0]!==r||t[1]!==d||t[2]!==c||t[3]!==i||t[4]!==u||t[5]!==s||t[6]!==o||t[7]!==n?(f=e=>(0,Q.jsx)(g0,{scope:n,context:r,interaction:i,onOpen:u,branch:e,path:o,only:s,heading:c,fullHeight:d}),t[0]=r,t[1]=d,t[2]=c,t[3]=i,t[4]=u,t[5]=s,t[6]=o,t[7]=n,t[8]=f):f=t[8];let p;return t[9]!==a||t[10]!==r||t[11]!==n||t[12]!==f?(p=(0,Q.jsx)(ZQ,{scope:n,context:r,base:a,children:f}),t[9]=a,t[10]=r,t[11]=n,t[12]=f,t[13]=p):p=t[13],p}function g0(e){let t=(0,$.c)(33),{scope:n,context:r,interaction:i,branch:a,path:o,only:s,heading:c,fullHeight:l,onOpen:u}=e,d=l!==void 0&&l,f;t[0]===a?f=t[1]:(f=py(a),t[0]=a,t[1]=f);let p=f,m=JQ(n,r,p);if(a.base===null||a.base===void 0)return null;let h;t[2]!==a.files||t[3]!==s||t[4]!==o?(h=()=>s?a.files.filter(e=>s.includes(e.path)||e.oldPath!==void 0&&s.includes(e.oldPath)).map(_0):o==null?void 0:[o],t[2]=a.files,t[3]=s,t[4]=o,t[5]=h):h=t[5];let g=h,_;t[6]!==a.files||t[7]!==m||t[8]!==g?(_=sy(a.files,m,g()),t[6]=a.files,t[7]=m,t[8]=g,t[9]=_):_=t[9];let v=_;if(o!=null&&v.length===0){let e;t[10]===a.base.ref?e=t[11]:(e=Vy(a.base.ref),t[10]=a.base.ref,t[11]=e);let n=`${o} has no committed change since ${e}.`,r;return t[12]===n?r=t[13]:(r=(0,Q.jsx)(vn,{message:n}),t[12]=n,t[13]=r),r}let y=o!=null,b=a.base.ref,x=a.head,S=a.mergeBaseOid??``,C=a.commits,w;t[14]===a?w=t[15]:(w=Zv(a),t[14]=a,t[15]=w);let T;t[16]!==a.base.ref||t[17]!==a.commits||t[18]!==a.head||t[19]!==w||t[20]!==S?(T={base:b,head:x,mergeBaseOid:S,commits:C,diffRange:w},t[16]=a.base.ref,t[17]=a.commits,t[18]=a.head,t[19]=w,t[20]=S,t[21]=T):T=t[21];let E;return t[22]!==r||t[23]!==d||t[24]!==c||t[25]!==i||t[26]!==v||t[27]!==u||t[28]!==p||t[29]!==n||t[30]!==T||t[31]!==y?(E=(0,Q.jsx)(v0,{scope:n,context:r,interaction:i,onOpen:u,range:p,items:v,single:y,heading:c,fullHeight:d,branch:T}),t[22]=r,t[23]=d,t[24]=c,t[25]=i,t[26]=v,t[27]=u,t[28]=p,t[29]=n,t[30]=T,t[31]=y,t[32]=E):E=t[32],E}function _0(e){return e.path}function v0(e){let t=(0,$.c)(63),{scope:n,context:r,interaction:i,range:a,items:o,single:s,heading:c,fullHeight:l,branch:u,onOpen:d}=e,f=l!==void 0&&l,{connection:p}=r,m=de(qr(iB(n,p))),h=JSON.stringify([u.base,u.head.branch]),[g,_]=B(fQ(JSON.stringify([p.environmentId,n.projectId,n.worktreeId,h]))),v=o.slice(0,g),y=bB(n,p,u.diffRange,v.map(Ly)),b=JSON.stringify([u.diffRange,v.map(x0)]),[x,S]=(0,Z.useState)({version:``,comparison:h,count:v.length,patches:new Map});if(!y.pending&&!y.failed&&x.version!==b){let e;t[0]===y.patches?e=t[1]:(e=e=>{let t=y.patches.get(Ly(e).join(`\0`));return t?[[e.fingerprint,t]]:[]},t[0]=y.patches,t[1]=e),S({version:b,comparison:h,count:v.length,patches:new Map(v.flatMap(e))})}let C=e=>y.patches.get(Ly(e).join(`\0`))??(x.comparison===h?x.patches.get(e.fingerprint):void 0),w;t[2]!==r||t[3]!==a||t[4]!==n?(w=(e,t)=>(0,Q.jsx)(n0,{scope:n,context:r,path:e.path,fingerprint:e.fingerprint,status:e.reviewStatus,range:a,compact:t},`review:${e.path}`),t[2]=r,t[3]=a,t[4]=n,t[5]=w):w=t[5];let T=w,E;t[6]!==u.head.oid||t[7]!==T||t[8]!==C?(E=e=>{let t=lB(u.head.oid,e,C(e));return t==null?[]:[{...t,id:`branch:${e.path}`,review:{path:e.path,fingerprint:e.fingerprint,reviewed:e.reviewStatus===`reviewed`,stale:e.reviewStatus===`stale`,control:T(e,!0)}}]},t[6]=u.head.oid,t[7]=T,t[8]=C,t[9]=E):E=t[9];let D=v.flatMap(E),O=new Set(D.map(b0)),k=v.filter(e=>!O.has(e.path)&&(i.quiet!==!0||y.failed||C(e)!==void 0)),A=y.pending&&x.comparison===h?x.count:v.length,j=o.length-A,M=m?.changes.length??0,[N]=o,P=c!==void 0;if(i.quiet===!0&&D.length===0&&y.pending){let e;return t[10]===v.length?e=t[11]:(e=(0,Q.jsx)($1,{count:v.length}),t[10]=v.length,t[11]=e),e}let F=!s&&!P,I;t[12]!==N||t[13]!==d||t[14]!==s?(I=s&&N?(0,Q.jsx)(qQ,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>d({kind:`timeline`,path:N.path})}):void 0,t[12]=N,t[13]=d,t[14]=s,t[15]=I):I=t[15];let L;t[16]!==u.base||t[17]!==u.commits||t[18]!==u.head.branch||t[19]!==r||t[20]!==T||t[21]!==D||t[22]!==N||t[23]!==c||t[24]!==i.toolbarTarget||t[25]!==o||t[26]!==a||t[27]!==n||t[28]!==s||t[29]!==P?(L=e=>s&&N&&P?null:s&&N?(0,Q.jsx)(Z1,{target:i.toolbarTarget,barActions:null,title:dy(N.path),subtitle:`${[N.oldPath,N.path].filter(y0).join(` → `)} · on the branch`,aside:D[0]&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i$,{counts:r$(D[0])}),N.reviewStatus===`stale`&&(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md bg-graph-4/15 px-1.5 py-0.5 text-2xs text-graph-4`,children:`Changed since reviewed`})]}),children:i.toolbarTarget===void 0&&T(N,!1)}):P?(0,Q.jsxs)(Z1,{inline:!0,...c?{title:c.title,titleLabel:c.titleLabel}:{title:`All changes`},subtitle:Vt(o.length,`file`),children:[e,c?.after]}):(0,Q.jsxs)(Z1,{inline:!0,title:`${u.head.branch?Vy(u.head.branch):`This commit`} since ${Vy(u.base)}`,subtitle:`${Vt(o.length,`file`)} · ${Vt(u.commits,`commit`)}`,children:[e,(0,Q.jsx)(s0,{scope:n,context:r,entries:o,range:a})]}),t[16]=u.base,t[17]=u.commits,t[18]=u.head.branch,t[19]=r,t[20]=T,t[21]=D,t[22]=N,t[23]=c,t[24]=i.toolbarTarget,t[25]=o,t[26]=a,t[27]=n,t[28]=s,t[29]=P,t[30]=L):L=t[30];let R;t[31]!==T||t[32]!==y.failed||t[33]!==y.retry||t[34]!==k||t[35]!==C||t[36]!==s||t[37]!==P||t[38]!==M?(R=()=>(0,Q.jsx)(S0,{single:s,singleHeader:P,uncommitted:M,omitted:k,patchOf:C,failed:y.failed,onRetry:y.retry,control:e=>T(e,!0)}),t[31]=T,t[32]=y.failed,t[33]=y.retry,t[34]=k,t[35]=C,t[36]=s,t[37]=P,t[38]=M,t[39]=R):R=t[39];let z;t[40]!==r||t[41]!==D||t[42]!==f||t[43]!==i||t[44]!==a||t[45]!==n||t[46]!==s||t[47]!==F||t[48]!==I||t[49]!==L||t[50]!==R?(z=(0,Q.jsx)(O1,{comments:!0,fullHeight:f,disableFileHeader:s,readingColumn:F,scope:n,context:r,interaction:i,range:a,headerActions:I,entries:D,toolbar:L,header:R}),t[40]=r,t[41]=D,t[42]=f,t[43]=i,t[44]=a,t[45]=n,t[46]=s,t[47]=F,t[48]=I,t[49]=L,t[50]=R,t[51]=z):z=t[51];let V;t[52]!==_||t[53]!==g?(V=()=>_(g+25),t[52]=_,t[53]=g,t[54]=V):V=t[54];let H;t[55]!==y.pending||t[56]!==o.length||t[57]!==j||t[58]!==V?(H=(0,Q.jsx)(Q1,{more:j,total:o.length,pending:y.pending,onReadMore:V}),t[55]=y.pending,t[56]=o.length,t[57]=j,t[58]=V,t[59]=H):H=t[59];let U;return t[60]!==H||t[61]!==z?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[z,H]}),t[60]=H,t[61]=z,t[62]=U):U=t[62],U}function y0(e,t,n){return e!==void 0&&n.indexOf(e)===t}function b0(e){return e.path}function x0(e){return e.fingerprint}function S0(e){let t=(0,$.c)(18),{single:n,singleHeader:r,uncommitted:i,omitted:a,patchOf:o,failed:s,onRetry:c,control:l}=e,u=i>0&&!r;if(!u&&!s&&a.length===0)return null;let d=n&&`mb-3`,f;t[0]===d?f=t[1]:(f=Y(`mx-4 mt-3 flex flex-col gap-3`,d),t[0]=d,t[1]=f);let p;t[2]===u?p=t[3]:(p=u&&(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Uncommitted changes are not part of the branch review. Review them under Uncommitted.`}),t[2]=u,t[3]=p);let m;t[4]!==s||t[5]!==c?(m=s&&(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[`Some patches could not be read.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:c,children:`Try again`})]}),t[4]=s,t[5]=c,t[6]=m):m=t[6];let h;t[7]!==l||t[8]!==s||t[9]!==a||t[10]!==o||t[11]!==n?(h=a.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Changes without code preview`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 rounded-lg border bg-muted/25 px-3 py-2 text-xs`,children:[l(e),!n&&(0,Q.jsx)(fr,{className:`font-mono font-medium`,text:e.path}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.status,o(e)!==void 0||s?` · ${W_(e,o(e),s)??`No code change`}`:``]})]},e.path))}),t[7]=l,t[8]=s,t[9]=a,t[10]=o,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==h?(g=(0,Q.jsxs)(`section`,{className:f,children:[p,m,h]}),t[13]=f,t[14]=p,t[15]=m,t[16]=h,t[17]=g):g=t[17],g}var C0=e=>Ly(e).join(`\0`);function w0(e){let t=(0,$.c)(52),{scope:n,context:r,interaction:i,oid:a,onOpen:o}=e,{connection:s}=r,[c,l]=(0,Z.useState)(1),[,u]=(0,Z.useTransition)(),d=IY(s,n,a,c),f;t[0]!==s||t[1]!==n?(f=FY({connection:s,scope:n}),t[0]=s,t[1]=n,t[2]=f):f=t[2];let p=de(qr(Ot(f))),m=p?.snapshot?.head.kind===`attached`&&p.commits.some(e=>e.oid===a)?Vy(p.snapshot.head.ref):void 0,h=`${a}:${c}`,g;t[3]===h?g=t[4]:(g={of:h,shown:25},t[3]=h,t[4]=g);let[_,v]=(0,Z.useState)(g),y=_.of===`${a}:${c}`?_.shown:25,b;t[5]!==a||t[6]!==c||t[7]!==y?(b=()=>v({of:`${a}:${c}`,shown:y+25}),t[5]=a,t[6]=c,t[7]=y,t[8]=b):b=t[8];let x=b,S=d.files.slice(0,y),C=SB(s,n,a,c,S.map(O0)),w;t[9]===C.patches?w=t[10]:(w=e=>C.patches.get(C0(e)),t[9]=C.patches,t[10]=w);let T=w,E;t[11]!==a||t[12]!==c||t[13]!==T?(E=e=>{let t=lB(a,e,T(e));return t==null?[]:[{...t,id:`${t.id}:${c}`}]},t[11]=a,t[12]=c,t[13]=T,t[14]=E):E=t[14];let D=S.flatMap(E),O;t[15]!==a||t[16]!==T?(O=e=>(lB(a,e,T(e))??null)===null,t[15]=a,t[16]=T,t[17]=O):O=t[17];let k=S.filter(O),A=d.files.length-S.length,j;t[18]!==d.commit.subject||t[19]!==a?(j=d.commit.subject||`Commit ${By(a)}`,t[18]=d.commit.subject,t[19]=a,t[20]=j):j=t[20];let M=j,N=new Map(D.map(D0));for(let e of S)T(e)?.kind===`metadata-only`&&N.set(Ry(e),{added:0,removed:0});let P=A===0&&d.files.every(e=>{let t=T(e);return N.has(Ry(e))||t?.kind===`binary`})?[...N.values()].reduce(E0,{added:0,removed:0}):void 0,F;t[21]===a?F=t[22]:(F=(0,Q.jsx)(qQ,{label:`Copy hash`,icon:Bs,onClick:()=>Zt(a,`commit id`)}),t[21]=a,t[22]=F);let I;t[23]===o?I=t[24]:(I=(0,Q.jsx)(qQ,{label:`Open in graph`,icon:_g,onClick:()=>o({kind:`graph`})}),t[23]=o,t[24]=I);let L;t[25]!==I||t[26]!==F?(L=(0,Q.jsxs)(Q.Fragment,{children:[F,I]}),t[25]=I,t[26]=F,t[27]=L):L=t[27];let R=L,z;t[28]!==R||t[29]!==m||t[30]!==d.commit||t[31]!==i.toolbarTarget||t[32]!==a||t[33]!==c||t[34]!==u||t[35]!==M?(z=e=>(0,Q.jsxs)(`header`,{className:`mx-auto w-full max-w-commit px-7 pt-10`,children:[i.toolbarTarget?(0,th.createPortal)(R,i.toolbarTarget):(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:R}),(0,Q.jsxs)(`div`,{className:`flex min-h-5.5 min-w-0 flex-wrap items-center gap-x-2 text-ui leading-5.5 font-medium text-muted-foreground`,children:[(0,Q.jsx)(yg,{className:`size-3.5 shrink-0`}),(0,Q.jsxs)(`span`,{children:[`Commit`,` `,(0,Q.jsx)(fr,{text:a,disclose:`always`,className:`font-mono text-caption text-foreground`,children:By(a)})]}),m&&(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`on`,` `,(0,Q.jsx)(fr,{text:m,className:`font-mono text-caption font-normal`})]})]}),(0,Q.jsx)(fr,{text:M,render:(0,Q.jsx)(`h1`,{}),className:`mt-3 text-2xl leading-tight font-semibold tracking-tight`}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[d.commit.parentOids.length>1&&(0,Q.jsx)(Nu,{value:String(c),onValueChange:e=>u(()=>l(Number(e))),children:(0,Q.jsx)(kd,{children:d.commit.parentOids.map(T0)})}),(0,Q.jsx)(qQ,{label:`Copy message`,icon:Bs,onClick:()=>Zt(Iy(d.commit),`commit message`)}),e]})]}),t[28]=R,t[29]=m,t[30]=d.commit,t[31]=i.toolbarTarget,t[32]=a,t[33]=c,t[34]=u,t[35]=M,t[36]=z):z=t[36];let B=()=>(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(k0,{commit:d,branch:m,counts:N,total:P,omitted:k,patchOf:T,failed:C.failed,onRetry:C.retry})}),V;t[37]!==r||t[38]!==D||t[39]!==i||t[40]!==n||t[41]!==z||t[42]!==B?(V=(0,Q.jsx)(O1,{toolbar:z,framed:!0,scope:n,context:r,interaction:i,entries:D,header:B}),t[37]=r,t[38]=D,t[39]=i,t[40]=n,t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]!==d.files.length||t[45]!==C.pending||t[46]!==A||t[47]!==x?(H=(0,Q.jsx)(Q1,{more:A,total:d.files.length,pending:C.pending,onReadMore:x}),t[44]=d.files.length,t[45]=C.pending,t[46]=A,t[47]=x,t[48]=H):H=t[48];let U;return t[49]!==V||t[50]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[V,H]}),t[49]=V,t[50]=H,t[51]=U):U=t[51],U}function T0(e,t){return(0,Q.jsxs)(hd,{value:String(t+1),children:[TY(t+1),` parent ·`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:By(e)})]},e)}function E0(e,t){return{added:e.added+t.added,removed:e.removed+t.removed}}function D0(e){return[e.path,e.lineCounts]}function O0(e){return Ly(e)}function k0(e){let t=(0,$.c)(62),{commit:n,omitted:r,patchOf:i,failed:a,onRetry:o,branch:s,counts:c,total:l}=e,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-5 shrink-0 place-items-center rounded-sm border border-border-strong text-foreground`,children:(0,Q.jsx)(L_,{className:`size-3`})}),t[0]=u):u=t[0];let d;t[1]===n.commit.author.name?d=t[2]:(d=(0,Q.jsx)(fr,{text:n.commit.author.name,className:`font-medium text-foreground`}),t[1]=n.commit.author.name,t[2]=d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),t[3]=f):f=t[3];let p;t[4]===n.commit.author.timestamp?p=t[5]:(p=$a(n.commit.author.timestamp,Date.now()),t[4]=n.commit.author.timestamp,t[5]=p);let m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`span`,{children:p}),t[6]=p,t[7]=m);let h;t[8]!==n.commit.parentOids||t[9]!==n.comparison.baseOid||t[10]!==n.comparison.kind||t[11]!==n.comparison.parentNumber?(h=n.comparison.kind===`parent`?(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`· `}),`parent`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption leading-5 text-foreground`,children:By(n.comparison.baseOid)}),n.commit.parentOids.length>1&&` (${TY(n.comparison.parentNumber)} parent of a merge)`]}):(0,Q.jsx)(`span`,{children:`root commit`}),t[8]=n.commit.parentOids,t[9]=n.comparison.baseOid,t[10]=n.comparison.kind,t[11]=n.comparison.parentNumber,t[12]=h):h=t[12];let g;t[13]!==d||t[14]!==m||t[15]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-ui leading-5 text-muted-foreground`,children:[u,d,f,m,h]}),t[13]=d,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;if(t[17]!==s||t[18]!==n.commit.refs){let e;t[20]===s?e=t[21]:(e=e=>e.kind!==`local-branch`||e.name!==s,t[20]=s,t[21]=e),_=Hy(n.commit.refs).filter(e).map(A0),t[17]=s,t[18]=n.commit.refs,t[19]=_}else _=t[19];let v;t[22]===_?v=t[23]:(v=(0,Q.jsx)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-caption text-muted-foreground`,children:_}),t[22]=_,t[23]=v);let y;t[24]===n.commit.body?y=t[25]:(y=n.commit.body!==null&&n.commit.body!==void 0&&(0,Q.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap text-ui leading-relaxed wrap-anywhere text-muted-foreground`,children:n.commit.body}),t[24]=n.commit.body,t[25]=y);let b;t[26]!==n.commit.bodyTruncated||t[27]!==n.commit.subjectTruncated?(b=(n.commit.subjectTruncated||n.commit.bodyTruncated)&&(0,Q.jsx)(`p`,{className:`mt-1 text-caption text-muted-foreground`,children:`Commit message truncated`}),t[26]=n.commit.bodyTruncated,t[27]=n.commit.subjectTruncated,t[28]=b):b=t[28];let x;t[29]===n.files.length?x=t[30]:(x=Vt(n.files.length,`file`),t[29]=n.files.length,t[30]=x);let S;t[31]===x?S=t[32]:(S=(0,Q.jsxs)(`span`,{children:[x,` changed`]}),t[31]=x,t[32]=S);let C;t[33]===l?C=t[34]:(C=l&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`mx-2 font-normal text-muted-foreground`,children:`·`}),(0,Q.jsx)(P0,{count:l})]}),t[33]=l,t[34]=C);let w;t[35]!==n.files.length||t[36]!==a||t[37]!==l?(w=!l&&n.files.length>0&&(0,Q.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:a?`Line counts unavailable`:`Line counts incomplete`}),t[35]=n.files.length,t[36]=a,t[37]=l,t[38]=w):w=t[38];let T;t[39]!==S||t[40]!==C||t[41]!==w?(T=(0,Q.jsxs)(`p`,{className:`border-b pb-1.5 text-xs font-medium tabular-nums`,children:[S,C,w]}),t[39]=S,t[40]=C,t[41]=w,t[42]=T):T=t[42];let E;t[43]!==n.files||t[44]!==c||t[45]!==i?(E=n.files.length>1&&(0,Q.jsx)(`ul`,{className:`max-h-64 divide-y overflow-y-auto border-b`,"aria-label":`Changed files`,children:n.files.map(e=>(0,Q.jsxs)(`li`,{className:`flex h-8 min-w-0 items-center gap-2.5 rounded-sm pr-1.5 pl-1 text-caption leading-4`,children:[(0,Q.jsx)(`span`,{"aria-label":e.status,className:`w-4 shrink-0 text-center font-mono text-xs font-semibold text-brand`,children:e.status.slice(0,1).toUpperCase()}),(0,Q.jsx)(fr,{text:Ly(e).join(` → `),className:`flex-1 font-mono font-medium`}),(0,Q.jsx)(P0,{count:c.get(Ry(e))}),i(e)?.kind===`binary`&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Binary`})]},C0(e)))}),t[43]=n.files,t[44]=c,t[45]=i,t[46]=E):E=t[46];let D;t[47]!==T||t[48]!==E?(D=(0,Q.jsxs)(`section`,{"aria-label":`Files changed`,className:`mt-7`,children:[T,E]}),t[47]=T,t[48]=E,t[49]=D):D=t[49];let O;t[50]!==a||t[51]!==r||t[52]!==o||t[53]!==i?(O=r.length>0&&(0,Q.jsx)(j0,{changes:r,patchOf:i,failed:a,onRetry:o}),t[50]=a,t[51]=r,t[52]=o,t[53]=i,t[54]=O):O=t[54];let k;return t[55]!==y||t[56]!==b||t[57]!==D||t[58]!==O||t[59]!==g||t[60]!==v?(k=(0,Q.jsxs)(`section`,{className:`mx-auto mt-1 mb-6 w-full max-w-commit min-w-0 px-7`,children:[g,v,y,b,D,O]}),t[55]=y,t[56]=b,t[57]=D,t[58]=O,t[59]=g,t[60]=v,t[61]=k):k=t[61],k}function A0(e){return(0,Q.jsx)(fr,{text:e.name,className:`font-mono`},`${e.kind}:${e.name}`)}function j0(e){let t=(0,$.c)(15),{changes:n,patchOf:r,failed:i,onRetry:a}=e,o;t[0]!==i||t[1]!==a?(o=i&&(0,Q.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-xs text-muted-foreground`,children:[`Some patches could not be read.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:a,children:`Try again`})]}),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;if(t[3]!==n||t[4]!==i||t[5]!==r){let e;t[7]!==i||t[8]!==r?(e=e=>{let t=Ry(e),n=r(e),a=z_(e),o=n===void 0&&!i?void 0:W_(e,n,i)??`No code change`;return(0,Q.jsxs)(`li`,{className:`rounded-lg border bg-muted/25 px-3 py-2 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(fr,{className:`font-mono font-medium`,text:t}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.status,o&&` · ${o}`]})]}),a&&n?.kind===`text`&&(0,Q.jsx)(`pre`,{className:`mt-1 overflow-x-auto whitespace-pre-wrap font-mono text-2xs text-muted-foreground`,children:n.patch.split(`
1354
- `).filter(N0).map(M0).join(`
1355
- `)})]},`${e.oldPath}->${e.newPath}:${e.status}`)},t[7]=i,t[8]=r,t[9]=e):e=t[9],s=n.map(e),t[3]=n,t[4]=i,t[5]=r,t[6]=s}else s=t[6];let c;t[10]===s?c=t[11]:(c=(0,Q.jsx)(`ul`,{className:`mt-3 space-y-1.5`,"aria-label":`Changes without code preview`,children:s}),t[10]=s,t[11]=c);let l;return t[12]!==o||t[13]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[o,c]}),t[12]=o,t[13]=c,t[14]=l):l=t[14],l}function M0(e){return e.slice(1)}function N0(e){return/^[+-]Subproject commit /.test(e)}function P0(e){let t=(0,$.c)(7),{count:n}=e;if(!n)return null;let r;t[0]===n.added?r=t[1]:(r=(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,n.added]}),t[0]=n.added,t[1]=r);let i;t[2]===n.removed?i=t[3]:(i=(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,n.removed]}),t[2]=n.removed,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(`span`,{className:`shrink-0 space-x-1 font-mono text-xs font-medium tabular-nums`,children:[r,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function F0(e){let t=(0,$.c)(33),{scope:n,context:r,label:i,items:a,rows:o,controls:s,actions:c,actionsOpen:l,onActionsOpenChange:u}=e,[d,f]=(0,Z.useState)(),p;t[0]===a?p=t[1]:(p=a.filter(I0),t[0]=a,t[1]=p);let m=p.length,h;t[2]===a.length?h=t[3]:(h=Vt(a.length,`file`),t[2]=a.length,t[3]=h);let g=`${m} of ${h} reviewed`,_;t[4]===i?_=t[5]:(_=(0,Q.jsx)(`h2`,{className:`text-ui leading-4 font-medium text-foreground`,children:i}),t[4]=i,t[5]=_);let v=`File review actions: ${g}`,y;t[6]===v?y=t[7]:(y=(0,Q.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,className:`ml-auto`,"aria-label":v}),t[6]=v,t[7]=y);let b;t[8]!==g||t[9]!==y?(b=(0,Q.jsx)(yo,{render:y,children:g}),t[8]=g,t[9]=y,t[10]=b):b=t[10];let x;t[11]!==c||t[12]!==s.collapse?(x=(0,Q.jsxs)(Zo,{"aria-label":`File review actions`,align:`end`,children:[s.collapse,c]}),t[11]=c,t[12]=s.collapse,t[13]=x):x=t[13];let S;t[14]!==l||t[15]!==u||t[16]!==b||t[17]!==x?(S=(0,Q.jsxs)(uo,{open:l,onOpenChange:u,children:[b,x]}),t[14]=l,t[15]=u,t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==_||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex min-h-6 flex-wrap items-center gap-x-3.5 gap-y-1 border-b pb-1.5 text-xs text-muted-foreground tabular-nums`,children:[_,S]}),t[19]=_,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==r||t[23]!==s||t[24]!==a||t[25]!==d||t[26]!==o||t[27]!==n?(w=!(a.length===1&&s.counts.has(a[0]?.path??``))&&(0,Q.jsx)(`ol`,{children:a.slice(0,o??a.length).map(e=>{let t=e.path.lastIndexOf(`/`)+1,i=s.counts.get(e.path);return(0,Q.jsxs)(`li`,{className:`box-content flex h-8 items-center gap-3 border-t pl-1 first:border-t-0 last:border-b`,children:[(0,Q.jsx)(r0,{scope:n,context:r,path:e.path,fingerprint:e.fingerprint,status:e.reviewStatus,latest:d===e.path,onStart:()=>f(e.path)}),(0,Q.jsx)(fr,{text:e.path,renderTrigger:(n,r)=>(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`${e.path}${i?` +${i.additions} −${i.deletions}`:``}`,"aria-current":s.current===e.path?`true`:void 0,onClick:()=>s.open(e.path),className:`flex h-8 min-w-0 flex-1 items-center gap-3 rounded-sm px-1.5 text-left whitespace-nowrap text-foreground outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 font-mono text-caption leading-4`,children:[t>0&&r(e.path.slice(0,t),`shrink-[100] text-muted-foreground`,`start`),r(e.path.slice(t),`shrink-0 max-w-full`)]}),i&&(0,Q.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Q.jsx)(i$,{counts:i})})]})})]},e.path)})}),t[22]=r,t[23]=s,t[24]=a,t[25]=d,t[26]=o,t[27]=n,t[28]=w):w=t[28];let T;return t[29]!==i||t[30]!==w||t[31]!==C?(T=(0,Q.jsxs)(`section`,{"aria-label":i,className:`pb-3.25`,children:[C,w]}),t[29]=i,t[30]=w,t[31]=C,t[32]=T):T=t[32],T}function I0(e){return e.reviewStatus===`reviewed`}function L0(e){let t=(0,$.c)(41),{path:n,note:r,diff:i,children:a}=e,o,s,c,l,u,d,f,p,m,h;if(t[0]!==i?.hunks||t[1]!==n){let e=n.split(`/`);l=e.pop()??n;let r;t[12]===i?.hunks?r=t[13]:(r=i?.hunks.reduce(z0,0),t[12]=i?.hunks,t[13]=r),s=r;let a;t[14]===i?.hunks?a=t[15]:(a=i?.hunks.reduce(R0,0),t[14]=i?.hunks,t[15]=a),c=a,m=``,h=`@container/file-heading flex min-h-11 shrink-0 items-center gap-2.5 px-4 text-ui leading-[1.4] whitespace-nowrap text-foreground`,o=fr,u=n,d=`min-w-0 font-mono text-caption leading-4 text-muted-foreground`,t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`h1`,{}),t[16]=f):f=t[16],p=e.length>0&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.join(` / `),` / `]}),t[0]=i?.hunks,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h}else o=t[2],s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11];let g;t[17]===l?g=t[18]:(g=(0,Q.jsx)(`span`,{className:`font-medium text-foreground`,children:l}),t[17]=l,t[18]=g);let _;t[19]!==o||t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p||t[24]!==g?(_=(0,Q.jsxs)(o,{text:u,className:d,render:f,children:[p,g]}),t[19]=o,t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=g,t[25]=_):_=t[25];let v;t[26]===r?v=t[27]:(v=r&&(0,Q.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground @md/file-heading:inline`,children:r}),t[26]=r,t[27]=v);let y;t[28]!==s||t[29]!==c||t[30]!==i?(y=i&&(0,Q.jsxs)(`span`,{"aria-label":`${s} additions, ${c} deletions`,className:`font-mono text-xs font-medium tabular-nums`,children:[(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,s]}),` `,(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,c]})]}),t[28]=s,t[29]=c,t[30]=i,t[31]=y):y=t[31];let b;t[32]!==a||t[33]!==y?(b=(0,Q.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[y,a]}),t[32]=a,t[33]=y,t[34]=b):b=t[34];let x;return t[35]!==b||t[36]!==m||t[37]!==h||t[38]!==_||t[39]!==v?(x=(0,Q.jsxs)(`header`,{"data-file-heading":m,className:h,children:[_,v,b]}),t[35]=b,t[36]=m,t[37]=h,t[38]=_,t[39]=v,t[40]=x):x=t[40],x}function R0(e,t){return e+t.deletionLines}function z0(e,t){return e+t.additionLines}function B0(e,t,n){if(t===``)return[];let r=t.toLocaleLowerCase(),i=[],a=e.split(`
1356
- `);for(let[e,t]of a.entries()){let a=t.toLocaleLowerCase(),o=a.indexOf(r);for(;o!==-1;){if(i.length===n)return i;i.push({line:e+1,column:o}),o=a.indexOf(r,o+r.length)}}return i}function V0(e,t){return Math.max(0,Math.min(e,t-1))}function H0(e,t,n){return t===0?0:(V0(e,t)+n+t)%t}function U0(e,t,n){if(t===0)return`No results`;let r=t===n?`+`:``;return`${V0(e,t)+1} of ${t}${r}`}function W0(e){let t=(0,$.c)(65),{text:n,focusRequest:r,onReveal:i,onClose:a}=e,[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(0),u;t[0]!==o||t[1]!==n?(u=B0(n,o,Pt),t[0]=o,t[1]=n,t[2]=u):u=t[2];let d=u,[f,p]=(0,Z.useState)(),m;t[3]===i?m=t[4]:(m=(e,t,n)=>{l(e);let r=t[e];r&&i({...r,length:n})},t[3]=i,t[4]=m);let h=m,g;t[5]!==c||t[6]!==d||t[7]!==o.length||t[8]!==h?(g=e=>h(H0(c,d.length,e),d,o.length),t[5]=c,t[6]=d,t[7]=o.length,t[8]=h,t[9]=g):g=t[9];let _=g,v;t[10]===a?v=t[11]:(v=e=>{e.key===`Escape`&&(e.preventDefault(),a())},t[10]=a,t[11]=v);let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{})}),t[12]=y):y=t[12];let b;t[13]!==r||t[14]!==f?(b=e=>{e&&f!==r&&(e.focus(),e.select(),p(r))},t[13]=r,t[14]=f,t[15]=b):b=t[15];let x;t[16]!==h||t[17]!==n?(x=e=>{let t=e.target.value;s(t),h(0,B0(n,t,Pt),t.length)},t[16]=h,t[17]=n,t[18]=x):x=t[18];let S;t[19]===_?S=t[20]:(S=e=>{e.key===`Enter`&&(e.preventDefault(),_(e.shiftKey?-1:1))},t[19]=_,t[20]=S);let C;t[21]!==o||t[22]!==b||t[23]!==x||t[24]!==S?(C=(0,Q.jsx)(CH,{ref:b,"aria-label":`Find in file`,placeholder:`Find in file`,value:o,onChange:x,onKeyDown:S}),t[21]=o,t[22]=b,t[23]=x,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==c||t[27]!==d.length||t[28]!==o?(w=o!==``&&(0,Q.jsx)(SH,{role:`status`,children:U0(c,d.length,1e4)}),t[26]=c,t[27]=d.length,t[28]=o,t[29]=w):w=t[29];let T=d.length===0,E;t[30]===_?E=t[31]:(E=()=>_(-1),t[30]=_,t[31]=E);let D;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(xh,{}),t[32]=D):D=t[32];let O;t[33]!==T||t[34]!==E?(O=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Previous match`,disabled:T,onClick:E,children:D})}),t[33]=T,t[34]=E,t[35]=O):O=t[35];let k;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Previous match`}),t[36]=k):k=t[36];let A;t[37]===O?A=t[38]:(A=(0,Q.jsxs)(ot,{children:[O,k]}),t[37]=O,t[38]=A);let j=d.length===0,M;t[39]===_?M=t[40]:(M=()=>_(1),t[39]=_,t[40]=M);let N;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(sc,{}),t[41]=N):N=t[41];let P;t[42]!==j||t[43]!==M?(P=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Next match`,disabled:j,onClick:M,children:N})}),t[42]=j,t[43]=M,t[44]=P):P=t[44];let F;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Next match`}),t[45]=F):F=t[45];let I;t[46]===P?I=t[47]:(I=(0,Q.jsxs)(ot,{children:[P,F]}),t[46]=P,t[47]=I);let L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Oi,{}),t[48]=L):L=t[48];let R;t[49]===a?R=t[50]:(R=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Close find`,onClick:a,children:L})}),t[49]=a,t[50]=R);let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Close find`}),t[51]=z):z=t[51];let B;t[52]===R?B=t[53]:(B=(0,Q.jsxs)(ot,{children:[R,z]}),t[52]=R,t[53]=B);let V;t[54]!==w||t[55]!==A||t[56]!==I||t[57]!==B?(V=(0,Q.jsxs)(yH,{align:`inline-end`,children:[w,A,I,B]}),t[54]=w,t[55]=A,t[56]=I,t[57]=B,t[58]=V):V=t[58];let H;t[59]!==V||t[60]!==C?(H=(0,Q.jsxs)(_H,{className:`w-full max-w-sm`,children:[y,C,V]}),t[59]=V,t[60]=C,t[61]=H):H=t[61];let U;return t[62]!==H||t[63]!==v?(U=(0,Q.jsx)(`div`,{role:`search`,className:`flex shrink-0 justify-end border-b px-3 py-1.5`,onKeyDown:v,children:H}),t[62]=H,t[63]=v,t[64]=U):U=t[64],U}function G0(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=qy(e.path)?(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:[(0,Q.jsx)(i2,{...e}),(0,Q.jsx)($0,{path:e.path,copy:!1,children:(0,Q.jsxs)(XJ,{className:`max-w-full flex-wrap justify-end`,children:[(0,Q.jsx)(e2,{path:e.path,onOpen:e.onOpen}),(0,Q.jsx)(t2,{path:e.path})]})}),(0,Q.jsx)(Xk,{scope:e.scope,path:e.path,connection:e.context.connection})]}):(0,Q.jsx)(K0,{...e}),t[0]=e,t[1]=n),n}function K0(e){let t=(0,$.c)(17),n;t[0]===e.path?n=t[1]:(n=e.path.split(`/`).slice(0,-1).join(`/`),t[0]=e.path,t[1]=n);let r=n,{connection:i}=e.context,a=RR(i,e.scope,r);if(a===void 0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(J0,{}),t[2]=e):e=t[2],e}let o;t[3]===e.path?o=t[4]:(o=e.path.split(`/`).at(-1),t[3]=e.path,t[4]=o);let s=o,c;if(t[5]!==a.entries||t[6]!==s){let e;t[8]===s?e=t[9]:(e=e=>e.name===s,t[8]=s,t[9]=e),c=a.entries.find(e),t[5]=a.entries,t[6]=s,t[7]=c}else c=t[7];let l=c;if(l?.kind===`symlink`){let n=`Not followed: symlink to ${l.target??`an unknown target`}`,r;return t[10]!==e||t[11]!==n?(r=(0,Q.jsx)(q0,{...e,message:n}),t[10]=e,t[11]=n,t[12]=r):r=t[12],r}if(l?.kind===`submodule`){let n;return t[13]===e?n=t[14]:(n=(0,Q.jsx)(q0,{...e,message:`Not followed: submodule`}),t[13]=e,t[14]=n),n}let u;return t[15]===e?u=t[16]:(u=(0,Q.jsx)(Y0,{...e}),t[15]=e,t[16]=u),u}function q0(e){let t=(0,$.c)(13),n,r;t[0]===e?(n=t[1],r=t[2]):({message:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===r?i=t[4]:(i=(0,Q.jsx)(i2,{...r}),t[3]=r,t[4]=i);let a;t[5]===r.path?a=t[6]:(a=(0,Q.jsx)($0,{path:r.path}),t[5]=r.path,t[6]=a);let o;t[7]===n?o=t[8]:(o=(0,Q.jsx)(`div`,{className:`grid min-h-48 flex-1 place-items-center p-6`,children:(0,Q.jsx)(vn,{message:n})}),t[7]=n,t[8]=o);let s;return t[9]!==i||t[10]!==a||t[11]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[i,a,o]}),t[9]=i,t[10]=a,t[11]=o,t[12]=s):s=t[12],s}function J0(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{"aria-busy":`true`,className:`grid min-h-24 flex-1 place-items-center`,children:(0,Q.jsx)(Be,{label:`Loading file`})}),e[0]=t):t=e[0],t}function Y0(e){let t=(0,$.c)(3),n=Rd(e.context,e.scope,e.path),r;return t[0]!==e||t[1]!==n?(r=n?(0,Q.jsx)(X0,{...e,read:n}):(0,Q.jsx)(J0,{}),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function X0(e){let t=(0,$.c)(19),n,r;t[0]===e?(n=t[1],r=t[2]):({read:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let{file:i,draft:a,reset:o,edit:s}=r,c=Ol(a),l=`kind`in i;if(l&&c.owner===null&&c.text===c.savedText){let e;return t[3]!==i.reason||t[4]!==n?(e=(0,Q.jsx)(q0,{...n,message:i.reason}),t[3]=i.reason,t[4]=n,t[5]=e):e=t[5],e}let u;t[6]===l?u=t[7]:(u=l&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-b bg-graph-4/10 px-3.5 py-2 text-xs text-graph-4`,children:`The file is no longer readable. Your unsaved draft is still available below.`}),t[6]=l,t[7]=u);let d=l?c.savedText:i.text,f=l?c.fingerprint:i.contentFingerprint,p;t[8]!==a||t[9]!==s||t[10]!==n||t[11]!==o||t[12]!==c||t[13]!==d||t[14]!==f?(p=(0,Q.jsx)(Z0,{...n,text:d,contentFingerprint:f,draft:a,draftState:c,reset:o,edit:s}),t[8]=a,t[9]=s,t[10]=n,t[11]=o,t[12]=c,t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;return t[16]!==u||t[17]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,p]}),t[16]=u,t[17]=p,t[18]=m):m=t[18],m}function Z0(e){let t=(0,$.c)(120),{scope:n,context:r,interaction:i,path:a,text:o,contentFingerprint:s,draft:c,draftState:l,reset:u,edit:d,onOpen:f}=e,{preferences:p}=Bu(),m=na(r),{connection:h}=r,g=de(qr(iB(n,h))),_;t[0]===a?_=t[1]:(_=n2(a),t[0]=a,t[1]=_);let v=_,y=g?.changes.find(e=>e.path===a),b=y?.comparisons??[],x=b.find(Q0)??b[0],S=x?G_(x):void 0,C=aB(n,h,g?.statusToken??``,g?.read??0,y?[{path:a,fingerprint:y.fingerprint}]:[],S?[S]:[]),w=S?C.diffs.get(za(S)):void 0,T=x&&x.scope!==`untracked`&&x.scope!==`unmerged`&&w?cB(x,w)?.fileDiff:void 0,E=x&&`kind`in x?`${x.scope} · ${x.kind}`:x?.scope,D=y!==void 0,O=v===`markdown`&&o.length>262144,[k,A]=(0,Z.useState)(!1),j;t[2]!==v||t[3]!==O||t[4]!==p?(j=()=>O?`source`:r2(v,p),t[2]=v,t[3]=O,t[4]=p,t[5]=j):j=t[5];let[M,N]=(0,Z.useState)(j),{active:P}=i,[F,I]=(0,Z.useState)(!1),[L,R]=(0,Z.useState)(),[z,B]=(0,Z.useState)(),{element:V,attach:H}=hH(),{element:U,attach:W}=hH(),G=!F&&v===`markdown`&&M===`rendered`&&(!O||k),K;t[6]!==G||t[7]!==o?(K=G?dR(o):void 0,t[6]=G,t[7]=o,t[8]=K):K=t[8];let q=K,ee=wl(),J;t[9]!==f||t[10]!==a||t[11]!==ee||t[12]!==U||t[13]!==n?(J=(e,t)=>{if(e!==a){ee.openAt(`${n.worktreeId}:${e}`,t),f({kind:`file`,path:e});return}let r=U?.querySelector(`[data-markdown-root]`);t&&r&&nR(r,t)},t[9]=f,t[10]=a,t[11]=ee,t[12]=U,t[13]=n,t[14]=J):J=t[14];let te=J,ne=(0,Z.useId)();sJ(c,ne,s);let re=v===`code`||M===`source`,ie=BR(),ae;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>R(Date.now()),t[15]=ae):ae=t[15];let oe=ie&&P&&re&&!F,se;t[16]===oe?se=t[17]:(se={enabled:oe,ignoreInputs:!1,conflictBehavior:`allow`},t[16]=oe,t[17]=se),Hu(ou.findInFile,ae,se);let ce=l.diskChanged.has(ne)?`Changed on disk just now`:``,le;t[18]===ce?le=t[19]:(le=(0,Q.jsx)(`span`,{"aria-live":`polite`,className:`hidden text-xs text-muted-foreground xl:inline`,children:ce}),t[18]=ce,t[19]=le);let ue;t[20]!==q||t[21]!==U?(ue=q&&(0,Q.jsx)(mR,{outline:q.outline,root:U}),t[20]=q,t[21]=U,t[22]=ue):ue=t[22];let fe;t[23]!==v||t[24]!==M?(fe=v!==`code`&&(0,Q.jsx)(Nu,{value:M,onValueChange:e=>{(e===`rendered`||e===`source`)&&N(e)},children:(0,Q.jsxs)(kd,{children:[(0,Q.jsx)(hd,{value:`rendered`,children:v===`markdown`?`Reader`:`Preview`}),(0,Q.jsx)(hd,{value:`source`,children:`Source`})]})}),t[23]=v,t[24]=M,t[25]=fe):fe=t[25];let pe;t[26]!==ue||t[27]!==fe||t[28]!==le?(pe=(0,Q.jsxs)(Q.Fragment,{children:[le,ue,fe]}),t[26]=ue,t[27]=fe,t[28]=le,t[29]=pe):pe=t[29];let me=pe,he;t[30]!==s||t[31]!==l.owner||t[32]!==l.savedText||t[33]!==l.text||t[34]!==d||t[35]!==ne||t[36]!==m?(he=s&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,disabled:!!m||l.owner!==null&&l.owner!==ne,"aria-description":m,"aria-label":l.text===l.savedText?`Edit`:`Resume edit`,onClick:()=>{d(ne)&&I(!0)}}),children:(0,Q.jsx)(ao,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:m??(l.owner!==null&&l.owner!==ne?`Editing in another pane`:`Edit`)})]}),t[30]=s,t[31]=l.owner,t[32]=l.savedText,t[33]=l.text,t[34]=d,t[35]=ne,t[36]=m,t[37]=he):he=t[37];let ge;t[38]!==D||t[39]!==f||t[40]!==a?(ge=D&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open diff`,onClick:()=>f({kind:`change`,path:a})}),children:(0,Q.jsx)(Zh,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open diff`})]}),t[38]=D,t[39]=f,t[40]=a,t[41]=ge):ge=t[41];let _e;t[42]!==i.toolbarTarget||t[43]!==f||t[44]!==a?(_e=i.toolbarTarget===void 0&&(0,Q.jsx)(e2,{path:a,onOpen:f}),t[42]=i.toolbarTarget,t[43]=f,t[44]=a,t[45]=_e):_e=t[45];let ve;t[46]===a?ve=t[47]:(ve=(0,Q.jsx)(t2,{path:a}),t[46]=a,t[47]=ve);let ye;t[48]!==he||t[49]!==ge||t[50]!==_e||t[51]!==ve?(ye=(0,Q.jsxs)(Q.Fragment,{children:[he,ge,_e,ve]}),t[48]=he,t[49]=ge,t[50]=_e,t[51]=ve,t[52]=ye):ye=t[52];let be=ye;if(F){let e;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>I(!1),t[53]=e):e=t[53];let n;t[54]!==s||t[55]!==u||t[56]!==o?(n=()=>{u(o,s??``),I(!1)},t[54]=s,t[55]=u,t[56]=o,t[57]=n):n=t[57];let r;t[58]===a?r=t[59]:(r=e=>(0,Q.jsx)($0,{path:a,children:e}),t[58]=a,t[59]=r);let i;return t[60]!==P||t[61]!==D||t[62]!==c||t[63]!==l||t[64]!==ne||t[65]!==a||t[66]!==n||t[67]!==r||t[68]!==m?(i=(0,Q.jsx)(SR,{owner:ne,path:a,draft:c,state:l,active:P,writeBlock:m,changed:D,onDone:e,onDiscard:n,renderToolbar:r}),t[60]=P,t[61]=D,t[62]=c,t[63]=l,t[64]=ne,t[65]=a,t[66]=n,t[67]=r,t[68]=m,t[69]=i):i=t[69],i}let xe=null;bb0:switch(v){case`markdown`:if(O&&!k){let e;t[70]===o.length?e=t[71]:(e=Math.round(o.length/1024),t[70]=o.length,t[71]=e);let n=`This Markdown file is ${e} KB. Rendering it can take a few seconds.`,r;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>A(!0),children:`Render it`}),t[72]=r):r=t[72];let i;t[73]===n?i=t[74]:(i=(0,Q.jsx)(`div`,{className:`grid min-h-48 flex-1 place-items-center p-6`,children:(0,Q.jsx)(vn,{message:n,action:r})}),t[73]=n,t[74]=i),xe=i}else if(q){let e;t[75]!==r.connection||t[76]!==te||t[77]!==a||t[78]!==n?(e={path:a,scope:n,connection:r.connection,openPath:te},t[75]=r.connection,t[76]=te,t[77]=a,t[78]=n,t[79]=e):e=t[79];let i;t[80]!==W||t[81]!==q.document||t[82]!==q.outline||t[83]!==a||t[84]!==e?(i=(0,Q.jsx)(_R,{document:q.document,outline:q.outline,attach:W,file:e},a),t[80]=W,t[81]=q.document,t[82]=q.outline,t[83]=a,t[84]=e,t[85]=i):i=t[85],xe=i}break bb0;case`html`:{let e;t[86]===te?e=t[87]:(e=e=>te(e,``),t[86]=te,t[87]=e);let i;t[88]!==r.connection||t[89]!==a||t[90]!==n||t[91]!==e||t[92]!==o?(i=(0,Q.jsx)(NR,{scope:n,path:a,html:o,connection:r.connection,onOpenPath:e},a),t[88]=r.connection,t[89]=a,t[90]=n,t[91]=e,t[92]=o,t[93]=i):i=t[93],xe=i;break bb0}case`code`:break bb0;default:return v}let Se;t[94]!==i.toolbarTarget||t[95]!==f||t[96]!==a||t[97]!==re?(Se=i.toolbarTarget&&!re&&(0,th.createPortal)((0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(e2,{path:a,onOpen:f})}),i.toolbarTarget),t[94]=i.toolbarTarget,t[95]=f,t[96]=a,t[97]=re,t[98]=Se):Se=t[98];let Ce;t[99]!==H||t[100]!==V||t[101]!==be||t[102]!==r||t[103]!==T||t[104]!==L||t[105]!==z||t[106]!==i||t[107]!==v||t[108]!==me||t[109]!==M||t[110]!==E||t[111]!==f||t[112]!==a||t[113]!==xe||t[114]!==n||t[115]!==o?(Ce=M===`rendered`&&v!==`code`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)($0,{path:a,copy:!1,children:[me,(0,Q.jsx)(XJ,{className:`max-w-full flex-wrap justify-end`,children:be})]}),xe]}):(0,Q.jsxs)(`div`,{ref:H,className:`flex min-h-0 flex-1 flex-col`,children:[L!==void 0&&(0,Q.jsx)(W0,{text:o,focusRequest:L,onReveal:e=>B({...e,nonce:Date.now()}),onClose:()=>{R(void 0),V?.querySelector(`[aria-label="Code content"] [tabindex="-1"]`)?.focus({preventScroll:!0})}}),(0,Q.jsxs)(L0,{path:a,note:E,diff:T,children:[me,be]}),(0,Q.jsx)(O1,{comments:!0,disableFileHeader:!0,compactThreads:!0,fileDiff:T,scope:n,context:r,interaction:i,headerActions:i.toolbarTarget===void 0?void 0:(0,Q.jsx)(e2,{path:a,onOpen:f}),...z===void 0?{}:{foundMatch:z},entries:[{...QQ(`file:${a}`,a,o)}]})]}),t[99]=H,t[100]=V,t[101]=be,t[102]=r,t[103]=T,t[104]=L,t[105]=z,t[106]=i,t[107]=v,t[108]=me,t[109]=M,t[110]=E,t[111]=f,t[112]=a,t[113]=xe,t[114]=n,t[115]=o,t[116]=Ce):Ce=t[116];let we;return t[117]!==Se||t[118]!==Ce?(we=(0,Q.jsxs)(`div`,{className:`@container/document flex min-h-0 flex-1 flex-col bg-card`,children:[Se,Ce]}),t[117]=Se,t[118]=Ce,t[119]=we):we=t[119],we}function Q0(e){return e.scope===`unstaged`}function $0(e){let t=(0,$.c)(7),{path:n,children:r,copy:i}=e,a=i===void 0||i,o;t[0]!==a||t[1]!==n?(o=a&&(0,Q.jsx)(t2,{path:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n||t[5]!==o?(s=(0,Q.jsxs)(L0,{path:n,children:[r,o]}),t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6],s}function e2(e){let t=(0,$.c)(3),{path:n,onOpen:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Q.jsx)(qQ,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>r({kind:`timeline`,path:n})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function t2(e){let t=(0,$.c)(8),{path:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Copy path`,onClick:()=>Zt(n,`path`)}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Bs,{}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,Q.jsx)(Ze,{render:r,children:i}),t[3]=r,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Copy path`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,Q.jsxs)(ot,{children:[a,o]}),t[6]=a,t[7]=s),s}function n2(e){let t=e.toLowerCase();return t.endsWith(`.md`)||t.endsWith(`.mdx`)?`markdown`:t.endsWith(`.html`)||t.endsWith(`.htm`)?`html`:`code`}function r2(e,t){return e===`markdown`||e===`html`?t.documentsDefault:`source`}function i2(e){let t=(0,$.c)(6),{interaction:n,path:r,onOpen:i}=e;if(!n.toolbarTarget)return null;let a;t[0]!==i||t[1]!==r?(a=(0,Q.jsx)(e2,{path:r,onOpen:i}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n.toolbarTarget||t[4]!==a?(o=(0,th.createPortal)(a,n.toolbarTarget),t[3]=n.toolbarTarget,t[4]=a,t[5]=o):o=t[5],o}function a2(e,t){let[n,r]=(0,Z.useState)(e);return!t&&n!==e&&r(e),t?n:e}function o2(e){return[...new Set(e)].join(`, `)}var s2=e=>e.shown&&!e.current;function c2(e){return e.unsupported?{shown:!1,current:!1}:{shown:e.shown,current:e.current}}function l2(e){return!e.some(s2)}function u2(e,t){return{discard:!s2(t),review:l2(e)}}function d2(e){let t=(0,$.c)(51),{scope:n,context:r,interaction:i,paths:a,files:o,focus:s,header:c,headerActions:l,headerLeading:u,toolbar:d,footer:f,column:p,fullHeight:m,windowLimit:h}=e,g=o===void 0?[]:o,_=p!==void 0&&p,v=m!==void 0&&m,{connection:y}=r;YQ(n,r);let b=i.quiet===!0,x=ry(XQ(n,r,a2(rB(n,y),i.hidden===!0),a),g),S=aB(n,y,x[0]?.statusToken??``,x[0]?.read??0,x.flatMap(x2),x.flatMap(y2)),C=bR(y,n,i.hidden===!0?[]:x.flatMap(_2)),[w,T]=(0,Z.useState)(h),E=h!==void 0&&w!==void 0&&h>w;!E||S.pending||S.failed||C.pending||C.failed||T(h);let D=b||E,[O,k]=(0,Z.useState)(C.contents);i.hidden===!0||C.pending||C.failed||C2(O,C.contents)||k(C.contents);let A;t[0]!==D||t[1]!==O||t[2]!==C.contents||t[3]!==C.failed?(A=e=>C.contents.get(e)??(D||C.failed?O.get(e):void 0),t[0]=D,t[1]=O,t[2]=C.contents,t[3]=C.failed,t[4]=A):A=t[4];let j=A,[M,N]=(0,Z.useState)(S.diffs);!S.pending&&!S.failed&&M!==S.diffs&&N(S.diffs);let P;t[5]===S.diffs?P=t[6]:(P=e=>{let t=G_(e);return t?S.diffs.get(za(t)):void 0},t[5]=S.diffs,t[6]=P);let F=P,I;t[7]!==S.recovering||t[8]!==F?(I=e=>S.recovering?void 0:F(e),t[7]=S.recovering,t[8]=F,t[9]=I):I=t[9];let L=I,R;t[10]!==S.failed||t[11]!==D||t[12]!==M||t[13]!==F?(R=e=>{let t=G_(e);if(t)return F(e)??(D||S.failed?M.get(za(t)):void 0)},t[10]=S.failed,t[11]=D,t[12]=M,t[13]=F,t[14]=R):R=t[14];let z=R,B=!b&&(S.pending||C.pending),V=!S.pending&&!C.pending&&(S.failed&&(E||M.size===0)||C.failed&&(E||O.size===0)),H;t[15]!==L||t[16]!==z||t[17]!==j||t[18]!==C.contents?(H=e=>e.scope===`untracked`?{shown:j(e.path)!==void 0,current:C.contents.has(e.path)}:c2({unsupported:e.scope!==`unmerged`&&!e.supported,shown:z(e)!==void 0,current:L(e)!==void 0}),t[15]=L,t[16]=z,t[17]=j,t[18]=C.contents,t[19]=H):H=t[19];let U=H,W=new Map(g.map(g2)),G;t[20]!==z||t[21]!==U||t[22]!==j||t[23]!==C.pending?(G=e=>{let t=e.comparisons.flatMap(e=>{if(e.scope===`unmerged`)return[`Conflict`];if(e.scope===`untracked`)return j(e.path)!==void 0||C.pending?[]:[`Not readable`];if(!e.supported)return[`Unsupported comparison`];let t=z(e);return t?t.kind===`binary`?[`Binary change`]:t.kind===`omitted`?[`Content omitted: ${H_(t.reason)}`]:cB(e,t)?[]:[`No single-file textual patch`]:[]}),n=l2(e.comparisons.map(U));return t.length>0?[{item:e,reasons:t,current:n}]:[]},t[20]=z,t[21]=U,t[22]=j,t[23]=C.pending,t[24]=G):G=t[24];let K=x.flatMap(G),q=x.flatMap(e=>e.comparisons.flatMap(t=>{let i=u2(e.comparisons.map(U),U(t)),a=t0(n,r,e,i.review);if(t.scope===`untracked`){let n=j(t.path);return n===void 0?[]:[{...QQ(Xv(t),e.path,n,W.get(e.path)??`untracked`),current:i.discard,review:a}]}if(t.scope===`unmerged`||!t.supported)return[];let o=T2(z(t),s?.[e.path]),c=o?cB(t,o):null,l=W.get(e.path);return c?[{...c,...l?{note:l}:{},current:i.discard,review:a,discardScope:t.scope}]:[]})),ee=new Map(q.map(h2)),J=new Set(K.map(m2)),te=x.flatMap(e=>e.comparisons.flatMap(t=>{let n=Xv(t),r=ee.get(n);return r===void 0?(t.scope===`untracked`?C.pending&&j(t.path)===void 0:t.scope!==`unmerged`&&t.supported&&S.pending&&z(t)===void 0)?[{id:n,path:t.scope===`untracked`?e.path:zt(t),state:`pending`}]:J.has(e.path)?[{id:n,path:e.path,state:`omitted`}]:[]:[{id:n,path:r,state:`code`}]})),ne=new Set(q.map(p2)),re=i.toolbarTarget!==void 0&&/^(file|change|branch):/.test(i.entry)&&q.length===0&&x.length===1?K[0]?.item:void 0,ie=c||B||V||K.length>0?e=>(0,Q.jsxs)(Q.Fragment,{children:[c?.(e),V&&(0,Q.jsx)(E2,{column:_,retry:()=>{S.retry(),C.retry()}}),K.length>0&&(0,Q.jsx)(D2,{changes:K,column:_,onTarget:(t,n)=>{n&&e.awaiting===t&&(e.landed(t),n.focus({preventScroll:!0}),n.scrollIntoView({block:`start`}))},renderedPaths:ne,scope:n,context:r,paneFile:!!re})]}):void 0;if(b&&q.length===0&&(S.pending||C.pending))return(0,Q.jsx)($1,{count:x.length});let ae=O1,oe=re?(0,Q.jsx)(O2,{scope:n,context:r,item:re,current:K[0]?.current??!0,active:i.active,children:l}):void 0,se=x.map(f2),ce;t[25]===f?ce=t[26]:(ce=f?{footer:f}:{},t[25]=f,t[26]=ce);let le;t[27]===ie?le=t[28]:(le=ie?{header:ie}:{},t[27]=ie,t[28]=le);let ue;t[29]===l?ue=t[30]:(ue=l?{headerActions:l}:{},t[29]=l,t[30]=ue);let de;t[31]===u?de=t[32]:(de=u?{headerLeading:u}:{},t[31]=u,t[32]=de);let fe;t[33]===d?fe=t[34]:(fe=d?{toolbar:d}:{},t[33]=d,t[34]=fe);let pe;return t[35]!==ae||t[36]!==_||t[37]!==r||t[38]!==q||t[39]!==v||t[40]!==i||t[41]!==te||t[42]!==n||t[43]!==oe||t[44]!==se||t[45]!==ce||t[46]!==le||t[47]!==ue||t[48]!==de||t[49]!==fe?(pe=(0,Q.jsx)(ae,{comments:!0,fullHeight:v,emptyActions:oe,scope:n,context:r,interaction:i,entries:q,listed:te,paths:se,column:_,...ce,...le,...ue,...de,...fe}),t[35]=ae,t[36]=_,t[37]=r,t[38]=q,t[39]=v,t[40]=i,t[41]=te,t[42]=n,t[43]=oe,t[44]=se,t[45]=ce,t[46]=le,t[47]=ue,t[48]=de,t[49]=fe,t[50]=pe):pe=t[50],pe}function f2(e){return e.path}function p2(e){return e.path}function m2(e){let{item:t}=e;return t.path}function h2(e){return[e.id,e.path]}function g2(e){return[e.path,e.note]}function _2(e){return e.comparisons.flatMap(v2)}function v2(e){return e.scope===`untracked`?[e.path]:[]}function y2(e){return e.comparisons.flatMap(b2)}function b2(e){let t=G_(e);return t?[t]:[]}function x2(e){return e.comparisons.some(S2)?[{path:e.path,fingerprint:e.fingerprint}]:[]}function S2(e){return e.scope===`staged`||e.scope===`unstaged`}function C2(e,t){return e.size===t.size&&[...t].every(([t,n])=>e.get(t)===n)}var w2=new WeakMap;function T2(e,t){if(!e||!t?.length||e.kind!==`text`)return e;let n=t.map(e=>`${e.startLine}-${e.endLine}`).join(`,`),r=w2.get(e),i=r?.get(n);if(i)return i;let a=Yv(e.patch,t),o=a?{...e,patch:a}:e;return r??=new Map,r.set(n,o),w2.set(e,r),o}function E2(e){let t=(0,$.c)(8),{column:n,retry:r}=e,i=!n&&`mx-4`,a;t[0]===i?a=t[1]:(a=Y(`mt-3 flex items-center gap-3 rounded-lg border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,i),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`span`,{children:`The changes in this document could not be read.`}),t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,Q.jsxs)(`section`,{role:`alert`,className:a,children:[o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}function D2(e){let t=(0,$.c)(21),{changes:n,column:r,onTarget:i,renderedPaths:a,scope:o,context:s,paneFile:c}=e,l=!r&&`mx-4`,u;t[0]===l?u=t[1]:(u=Y(`mt-3 rounded-lg border bg-muted/40 px-4 py-3`,l),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:`Non-text content`}),t[2]=d):d=t[2];let f;if(t[3]!==n||t[4]!==s||t[5]!==i||t[6]!==c||t[7]!==a||t[8]!==o){let e;t[10]!==s||t[11]!==i||t[12]!==c||t[13]!==a||t[14]!==o?(e=e=>{let{item:t,reasons:n,current:r}=e;return(0,Q.jsxs)(`li`,{"aria-label":`${t.path}: ${o2(n)}`,tabIndex:-1,ref:e=>i(t.path,e),className:`flex min-w-0 scroll-mt-3 flex-wrap items-center gap-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsx)(fr,{className:`min-w-0 basis-full`,text:t.path}),qy(t.path)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`Current worktree image`}),(0,Q.jsx)(Xk,{scope:o,path:t.path,connection:s.connection})]}),(0,Q.jsx)(Ao,{variant:`outline`,className:`h-auto max-w-full text-left whitespace-normal`,children:o2(n)}),!c&&!a.has(t.path)&&(0,Q.jsx)(n0,{scope:o,context:s,path:t.path,fingerprint:t.fingerprint,status:t.reviewStatus,current:r,compact:!!t.fingerprint})]},t.path)},t[10]=s,t[11]=i,t[12]=c,t[13]=a,t[14]=o,t[15]=e):e=t[15],f=n.map(e),t[3]=n,t[4]=s,t[5]=i,t[6]=c,t[7]=a,t[8]=o,t[9]=f}else f=t[9];let p;t[16]===f?p=t[17]:(p=(0,Q.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2 text-xs text-muted-foreground`,children:f}),t[16]=f,t[17]=p);let m;return t[18]!==u||t[19]!==p?(m=(0,Q.jsxs)(`section`,{className:u,children:[d,p]}),t[18]=u,t[19]=p,t[20]=m):m=t[20],m}function O2(e){let t=(0,$.c)(19),{scope:n,context:r,item:i,current:a,active:o,children:s}=e,c=f$(n,r,k2),l;t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n?(l=t0(n,r,i,a),t[0]=r,t[1]=a,t[2]=i,t[3]=n,t[4]=l):l=t[4];let u=l,d=BR(),f;t[5]!==c||t[6]!==u?(f=()=>c.toggle(u),t[5]=c,t[6]=u,t[7]=f):f=t[7];let p=f,m=d&&o&&a,h;t[8]===m?h=t[9]:(h={enabled:m,ignoreInputs:!0},t[8]=m,t[9]=h),Hu(ou.toggleReviewed,p,h);let g=u.reviewed?Dn:k_,_=!!c.writeBlock||!a||!u.fingerprint,v;t[10]!==c.writeBlock||t[11]!==g||t[12]!==_||t[13]!==u.reviewed||t[14]!==p?(v=(0,Q.jsx)(qQ,{label:`Reviewed`,variant:`outline`,icon:g,shortcut:ou.toggleReviewed,description:c.writeBlock,disabled:_,pressed:u.reviewed,onClick:p}),t[10]=c.writeBlock,t[11]=g,t[12]=_,t[13]=u.reviewed,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==s||t[17]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[v,s]}),t[16]=s,t[17]=v,t[18]=y):y=t[18],y}function k2(e){return ks(e)}function A2(e,t){return t?e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`:`error`}var j2=Ny({position:`absolute`,width:`1px`,height:`1px`,opacity:0,"pointer-events":`none`});function M2(e){return{"data-loading-status":e.loadingStatus}}function N2(e){return!!(e.getAttribute(`src`)||e.getAttribute(`srcset`))}var P2=he(sa({name:`avatar`,options:{onLoadingStatusChange:`callback`,fallbackDelay:`number`},state:e=>({loadingStatus:`idle`,delayElapsed:!1}),controlled:[],api:e=>{let{store:t,props:n,element:r,options:i}=e,a=Oc(e,e=>A(e)),o=(e,t,n)=>a(`loadingStatus`,e,{reason:t,event:n}),s=()=>{t.get().loadingStatus!==`loaded`&&o(`loading`,`src-change`)};return{internal:{watchImage(e){let t=()=>{let t=A2(e,N2(e));t===`loading`?s():o(t,t===`loaded`?`image-load`:`image-error`)};t();let n=new MutationObserver(t);n.observe(e,{attributeFilter:[`src`,`srcset`,`sizes`,`crossorigin`]});let i=[Ef(e,`load`,e=>o(`loaded`,`image-load`,e)),Ef(e,`error`,e=>o(`error`,`image-error`,e)),()=>n.disconnect()];return()=>{i.forEach(e=>e()),queueMicrotask(()=>{r(`image`)||o(`idle`,`src-change`)})}},watchImageRemoval(e){let n=new MutationObserver(()=>{t.get().loadingStatus!==`idle`&&!r(`image`)&&o(`idle`,`src-change`)});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()},startDelay(){let e,r=!0;return queueMicrotask(()=>{if(!r)return;let a=n(`fallback`)?.delay??i().fallbackDelay??0;a>0&&(e=setTimeout(()=>t.set({delayElapsed:!0}),a))}),()=>{r=!1,clearTimeout(e)}}}}},slots:e=>({root:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:M2,bind:(e,{api:t})=>{let n=[t.internal.startDelay(),t.internal.watchImageRemoval(e)];return()=>n.forEach(e=>e())}}),image:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:e=>({...M2(e),"aria-hidden":e.loadingStatus===`loaded`?void 0:`true`,style:e.loadingStatus===`loaded`?void 0:j2}),bind:(e,{api:t})=>t.internal.watchImage(e)}),fallback:e({props:{delay:`number`},present:(e,{props:t})=>e.loadingStatus!==`loaded`&&(!(t.delay&&t.delay>0)||e.delayElapsed),state:e=>({loadingStatus:e.loadingStatus}),attrs:M2})})}),{root:`span`,image:`img`,fallback:`span`}),F2=P2.Root,I2=P2.Image,L2=P2.Fallback;function R2({className:e,size:t=`default`,...n}){return(0,Q.jsx)(F2,{"data-slot":`avatar`,"data-size":t,className:Y(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function z2({className:e,...t}){return(0,Q.jsx)(I2,{"data-slot":`avatar-image`,className:Y(`aspect-square size-full rounded-full object-cover`,e),...t})}function B2({className:e,...t}){return(0,Q.jsx)(L2,{"data-slot":`avatar-fallback`,className:Y(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var V2={open:Dg,draft:kg,merged:Cg,closed:Tg};function H2(e){let t=(0,$.c)(10),{pull:n}=e,r;t[0]===n?r=t[1]:(r=Nl(n),t[0]=n,t[1]=r);let i=r,a=V2[i],o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(a,{"aria-hidden":`true`}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=rl(n),t[4]=n,t[5]=s);let c;return t[6]!==i||t[7]!==o||t[8]!==s?(c=(0,Q.jsxs)(Ao,{variant:i,children:[o,s]}),t[6]=i,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var U2={passed:{Icon:gc,label:`Passed`,color:`text-add-fg`},failed:{Icon:Nh,label:`Failed`,color:`text-del-fg`},running:{Icon:ra,label:`Running`,color:`text-muted-foreground`},none:{Icon:jh,label:`Unknown`,color:`text-muted-foreground`}};function W2(e){let t=(0,$.c)(6),{tone:n,label:r}=e,{Icon:i,label:a,color:o}=U2[n],s=r??a,c;t[0]===o?c=t[1]:(c=Y(`size-3.5 shrink-0`,o),t[0]=o,t[1]=c);let l;return t[2]!==i||t[3]!==s||t[4]!==c?(l=(0,Q.jsx)(i,{role:`img`,"aria-label":s,className:c}),t[2]=i,t[3]=s,t[4]=c,t[5]=l):l=t[5],l}function G2(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground`,children:`·`}),e[0]=t):t=e[0],t}var K2=XR();function q2(e){return Gl(Ra(e))}function J2(e,t,n){let r=(0,$.c)(10),i;r[0]!==e||r[1]!==n||r[2]!==t?(i=nr({connection:e,projectId:t,number:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3];let a;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(a={mode:`promiseExit`},r[4]=a):a=r[4];let[o,s]=B(i,a),c;r[5]===s?c=r[6]:(c=async(e,t,n)=>{let r=await s({payload:{headSha:e.headSha,target:t},reruns:n.map(t=>({key:t,jobId:e.checks.find(e=>e.key===t)?.jobId}))});ne(r)||ks({title:`Re-run refused`,description:q2(r.cause),type:`error`})},r[5]=s,r[6]=c);let l;return r[7]!==o.waiting||r[8]!==c?(l={pending:o.waiting,rerun:c},r[7]=o.waiting,r[8]=c,r[9]=l):l=r[9],l}function Y2(e,t,n,r){let i=(0,$.c)(12),a;i[0]!==e||i[1]!==n||i[2]!==t?(a=Dc({connection:e,projectId:t,number:n}),i[0]=e,i[1]=n,i[2]=t,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=B(a,o),l;i[5]!==n||i[6]!==r||i[7]!==c?(l=async(e,t)=>{let i=await c({repository:e,comment:t});ne(i)&&(r(),ks({title:`Commented on #${n}`,type:`success`}))},i[5]=n,i[6]=r,i[7]=c,i[8]=l):l=i[8];let u;return i[9]!==s||i[10]!==l?(u={result:s,submit:l},i[9]=s,i[10]=l,i[11]=u):u=i[11],u}async function X2(e){try{await navigator.clipboard.writeText(e),ks({title:`Copied the log lines`,type:`success`})}catch{ks({title:`Could not copy the log lines`,type:`error`})}}function Z2(e){let t=e.side===`old`?`Old`:`New`;return e.start===e.end?`${t} line ${e.start}`:`${t} lines ${e.start}–${e.end}`}function Q2(e,t){return{title:e.title,layout:e.layout,edges:e.edges,nodes:e.nodes.map(({anchor:e,...n})=>({...n,anchor:e===void 0?void 0:e.lines===void 0?{kind:`file`,path:e.path}:{kind:`lines`,excerpt:{path:e.path,...e.lines,caption:n.note??``,position:t,node:n.id,lines:Z2(e.lines),span:{startLine:e.lines.start,endLine:e.lines.end}}}}))}}function $2({title:e,explanation:t,blocks:n}){let r=[],i=[],a=0;return n.forEach((e,t)=>{switch(e.kind){case`diff_excerpt`:r.push({kind:`excerpt`,excerpt:{path:e.path,side:e.side,start:e.start,end:e.end,caption:e.caption,position:t+1,lines:Z2(e),span:{startLine:e.start,endLine:e.end}}});return;case`before_after`:r.push({kind:`images`,screenshots:[{...e.before,label:`Before`,enlarge:`Enlarge before screenshot`},{...e.after,label:`After`,enlarge:`Enlarge after screenshot`}],first:a}),a+=2;return;case`files`:e.files.length>0&&r.push({kind:`files`,files:e.files});return;case`checks`:if(e.results.length===0&&!e.checksTruncated)return;r.push({kind:`checks`,checks:{headOid:e.headOid,state:e.state,checksTruncated:e.checksTruncated,results:e.results}});return;case`diagram`:r.push({kind:`diagram`,diagram:Q2(e,t+1)});return;case`callout`:i.push({attention:e.attention,comparison:e.comparison});return}}),{title:e,explanation:t,blocks:r,callouts:i}}function e4(e){return e.blocks.flatMap(e=>e.kind===`excerpt`?[e.excerpt.path]:e.kind===`files`?e.files.map(e=>e.path):[])}function t4(e){return{...e,stops:e.stops.map($2)}}function n4(e){let t=e.walkthrough;if(t===void 0)return{kind:`unwritten`};switch(t.state.status){case`queued`:case`running`:return{kind:`writing`,run:t};case`failed`:return{kind:`failed`,run:t,failure:t.state.failure};case`ready`:return{kind:`ready`,run:t,content:t4(t.state.content),freshness:e.freshness,attempt:e.attempt}}}function r4(e){return e.walkthrough===void 0?`changes`:`walkthrough`}function i4(e){return e.stops.flatMap((e,t)=>e.callouts.map((n,r)=>({...n,stop:e,step:t+1,callIndex:r})))}var a4=(e,t,n)=>e.some(e=>e.step===t&&e.call===n);function o4(e,t){let n=i4(e);return{total:n.length,decided:n.filter(e=>a4(t??[],e.step,e.callIndex)).length}}function s4(e,t){let n=o4(e,t);return n.total-n.decided}function c4(e,t,n=!1){if(i4(e).length!==0)return t?i4(e).find(e=>!a4(t,e.step,e.callIndex))?.step:n?`unreadable`:`reading`}function l4(e,t=[]){let n=e4(e),r=t.flatMap(e=>e.oldPath!==void 0&&n.includes(e.oldPath)?[e.path]:[]);return[...new Set([...n,...r])]}function u4(e){return new Set(e.stops.flatMap(e=>l4(e))).size}var d4={claude:`Claude`,codex:`Codex`},f4={claude:`claude auth login`,codex:`codex login`};function p4(e,t){let n=d4[t.provider];switch(e.kind){case`signed_out`:return{title:`Sign in to ${n} again with ${f4[t.provider]}, then try again.`,message:``,command:f4[t.provider]};case`agent_not_installed`:return{title:`${n} isn't installed here.`,message:e.message};case`timed_out`:return{title:`The walkthrough took too long.`,message:e.message};case`unusable_output`:return{title:`${n} wrote something unreadable.`,message:e.message};case`other`:return{title:`The walkthrough didn't finish.`,message:e.message}}}var m4=new Set([`signed_out`,`agent_not_installed`,`timed_out`,`unusable_output`,`other`]);function h4(e){return typeof e==`string`&&m4.has(e)}function g4(e){return typeof e==`object`&&e&&`kind`in e&&`message`in e&&h4(e.kind)&&typeof e.message==`string`?{kind:e.kind,message:e.message}:{kind:`other`,message:e instanceof Error&&e.message!==``?e.message:`Porcelain could not start the walkthrough.`}}function _4(e){let t=(e.branch===void 0?void 0:e.pullRequests?.find(t=>t.headBranch===e.branch&&t.state===`open`)?.number)??e.displayedRun?.pullRequestNumber;return{...e.base===void 0?{}:{base:e.base},...t===void 0?{}:{pullRequestNumber:t},...e.writer===void 0?{}:{writer:e.writer}}}function v4(e){let t=n4(e);return t.kind===`ready`?y4(t.content.title).replace(/\.$/,``):`Review`}function y4(e){return e.replaceAll("`",``)}function b4(e){return e.split(/(`[^`]+`)/).filter(e=>e!==``).map(e=>e.length>2&&e.startsWith("`")&&e.endsWith("`")?{kind:`code`,text:e.slice(1,-1)}:{kind:`text`,text:e})}function x4({branch:e,worktree:t,only:n}){let r=e=>[...new Set(e.filter(e=>n===void 0||n.includes(e.path)||e.oldPath!==void 0&&n.includes(e.oldPath)).map(e=>e.path))],i=t.flatMap(e=>[e,...(e.comparisons??[]).flatMap(t=>`oldPath`in t?[{path:e.path,oldPath:t.oldPath}]:[])]);return{branch:r(e),worktree:r(i)}}function S4(e){return new Set([...e.branch,...e.worktree]).size}function C4(e,t){let n=new Set(e[t]),r=t===`branch`?e.worktree:e.branch;return{here:e[t],elsewhere:r.filter(e=>!n.has(e))}}function w4(e,t,n){let r=0,i=e=>{let i=r<n;return r+=(t?e.branch.length:0)+e.worktree.length,i};return{steps:e.steps.map(i),outside:i(e.outside)}}function T4(e,t){return[...e.flatMap(({oldPath:e,path:t})=>e===void 0?[]:[[e,t]]),...t.flatMap(e=>(e.comparisons??[]).flatMap(t=>{let n=`oldPath`in t?t.oldPath:void 0;return n===void 0?[]:[[n,e.path]]}))]}function E4(e,t){let n=new Set(e),r=!0;for(;r;){r=!1;for(let[e,i]of t)n.has(e)!==n.has(i)&&(n.add(e),n.add(i),r=!0)}return[...n]}function D4({content:e,branch:t,worktree:n}){let r=T4(t,n),i=(e?.stops??[]).map(e=>x4({branch:t,worktree:n,only:E4(l4(e),r)})),a=x4({branch:t,worktree:n}),o=e=>new Set(i.flatMap(e)),s=o(e=>e.branch),c=o(e=>e.worktree);return{steps:i,outside:{branch:a.branch.filter(e=>!s.has(e)),worktree:a.worktree.filter(e=>!c.has(e))}}}function O4(e,t){return[...new Set([...t?e.branch:[],...e.worktree])]}var k4=dt(e=>Xn(e.connection).fn(_s(`Walkthroughs.start`)(function*(t){let n=yield*zn(e.connection,n=>n.walkthroughs.startWalkthrough({params:{worktreeId:e.scope.worktreeId},payload:t}));return yield*Bi([lt.reviewSurface(e.connection.environmentId,e.scope,[`walkthrough`])]),n})));function A4([e,t],n){let r=de(qr(n.pulls)),i=_4({...n,pullRequests:r?.kind===`available`?r.pullRequests:void 0}),a=de(qr(e));return{accepted:a?.branch===n.branch?a:void 0,waiting:lo(e),failure:Mi(e)?g4(Ra(e.cause)):void 0,start:()=>void t(i)}}var j4=dt(({connection:e,scope:t,runId:n})=>{let r=Xn(e),i={worktreeId:t.worktreeId,runId:n},a=Bi([lt.reviewSurface(e.environmentId,t,[`walkthrough-conversations`])]);return{addMessage:r.fn(_s(`Walkthroughs.addMessage`)(function*(t){let n=yield*zn(e,e=>e.walkthroughs.addWalkthroughMessage({params:i,payload:t}));return yield*a,n})),retryAnswer:r.fn(_s(`Walkthroughs.retryAnswer`)(function*(t){let n=yield*zn(e,e=>e.walkthroughs.retryWalkthroughAnswer({params:{...i,messageId:t}}));return yield*a,n})),decideCall:r.fn(_s(`Walkthroughs.decideCall`)(function*(t){let{step:n,call:r,...o}=t,s=yield*zn(e,e=>e.walkthroughs.decideWalkthroughCall({params:{...i,step:n,call:r},payload:o}));return yield*a,s}))}}),M4={product:`Product call`,contract:`Contract call`,tradeoff:`Tradeoff`,risk:`Risk to accept`,accessibility:`Accessibility call`};function N4(e){return M4[e.kind]}var P4=`Needs a new commit: this change does not do this yet.`;function F4(e){return e?.implemented===void 0?`Choosing records your call, and Merge stops waiting for it. Porcelain changes no code.`:`Choosing records your call. Merge stops waiting for it unless the call needs a new commit. Porcelain changes no code.`}function I4(e){let t=e?.implemented;return(e?.columns??[]).map(e=>({option:e,implemented:e===t,effect:t===void 0?void 0:e===t?`Keeps the code as it is.`:P4}))}function L4(e){return e.find(e=>e.label===`After`)?.shows??`Before and after screenshots`}function R4(e,t){let n=e?.implemented;return t!==void 0&&n!==void 0&&t!==n}function z4(e,t){return i4(e).filter(e=>R4(e.comparison,t?.find(t=>t.step===e.step&&t.call===e.callIndex)?.option)).map(e=>e.step)}function B4(e,t){return t?R4(e,t.option)?`needs-commit`:`decided`:`open`}function V4(e,t){return i4(e).map(e=>{let n=t?.find(t=>t.step===e.step&&t.call===e.callIndex);return{...e,decided:n,state:B4(e.comparison,n)}})}var H4={decided:`Decided`,"needs-commit":`Decided, needs a new commit`};function U4(e,t){return e===`open`?t:H4[e]}var W4=[`open`,`needs-commit`,`decided`];function G4(e,t,n){let r=i4(e).filter(e=>e.step===t).map(e=>B4(e.comparison,n?.find(n=>n.step===t&&n.call===e.callIndex)));return W4.find(e=>r.includes(e))}var K4={added:`+`,changed:`~`,removed:`−`};function q4(e){return K4[e.change]}var J4=4,Y4=7,X4=3;function Z4(e,t){let n=e.growth;return{shown:t?n:n.slice(0,J4),hidden:t?0:Math.max(0,n.length-J4)}}function Q4(e,t){let n=e.onlyInTranscript.length+e.stillUnclear.length,r=t?e.onlyInTranscript:e.onlyInTranscript.slice(0,X4),i=t?e.stillUnclear:e.stillUnclear.slice(0,Math.max(0,X4-r.length));return{explained:r,unclear:i,total:n,hidden:n-r.length-i.length}}var $4=e=>e===1?`1 file`:`${e} files`;function e3(e,t){if(t===null)return;if(t===void 0){let t=e?u4(e):0;return t===0?void 0:$4(t)}let n=new Set(t.committed),r=new Set(t.uncommitted.filter(e=>!n.has(e))).size,i=n.size+r;if(i!==0)return`${$4(i)}${r>0?`, ${r} uncommitted`:``}`}function t3(e,t,n,r){let i=e3(t,r);return[...e.pullRequestNumber===void 0?[]:[`#${e.pullRequestNumber}`],...i===void 0?[]:[i],`written for ${e.headOid.slice(0,Y4)}${e.includesUncommitted?` and uncommitted work`:``}`,...n===void 0?[]:[`by ${n}`,`${e.writer.effort} effort`]].join(` · `)}function n3(e,t){return p4(e,t?.writer??{provider:`claude`,model:``,effort:`high`})}function r3(e,t){if(!(!t||e.kind!==`unwritten`&&e.kind!==`failed`))return{failure:t,run:e.kind===`failed`?e.run:void 0}}function i3(e,t){let n=e.attempt,r=n?.state.status,i=n?.state.status===`failed`?{failure:n.state.failure,writer:n.writer}:void 0;return{updating:t.waiting||r===`queued`||r===`running`,failure:t.failure?{failure:t.failure,writer:n?.writer??e.run.writer}:i}}function a3(e){switch(e.evidenceUnavailable){case`head_mismatch`:return`Screenshots and checks are not shown: the pull request is at another commit. Push, then update.`;case`github_account`:return`Screenshots and checks are not shown: choose a GitHub account for this project, then update.`;case`github_unavailable`:return`Screenshots and checks are not shown: GitHub could not be reached. Try updating later.`;case void 0:return}}function o3(e){let t=e.map(e=>e.split(`/`).at(-1)??e),n=t.slice(0,3),r=t.length-n.length;if(r>0)return`${n.join(`, `)} and ${r} more`;let i=n.pop();return n.length>0?`${n.join(`, `)} and ${i}`:i??``}function s3({uncommitted:e,uncovered:t,pullRequest:n,checkedCommit:r}){let i=n===void 0?``:`, so not in #${n}`,a=r===void 0?``:` The checks cover ${r.slice(0,Y4)} only.`;return{uncommitted:e.length===0?void 0:`${o3(e)} ${e.length===1?`is`:`are`} uncommitted${i}.${a}`,uncovered:t.length===0?void 0:`No step covers ${o3(t)}.`}}var c3=_s(`Walkthroughs.readConversations`)(function*({connection:e,scope:t,runId:n}){return yield*zn(e,e=>e.walkthroughs.listWalkthroughConversations({params:{worktreeId:t.worktreeId,runId:n}}))}),l3=dt(e=>et(e.connection,e.scope,[`walkthrough-conversations`,e.runId],c3(e),Xn(e.connection)).pipe(sr)),u3=dt(e=>Oe(t=>{if(!e)return;let n=t(l3({connection:e.connection,scope:{projectId:e.scope.projectId,worktreeId:e.scope.worktreeId},runId:e.runId})),r=de(qr(n));return{headOid:e.headOid,undecidedCallStep:c4(e.content,r?.decisions,Mi(n)),undecidedCalls:s4(e.content,r?.decisions),callsNeedingCommit:z4(e.content,r?.decisions)}})),d3=dt(e=>Vn(e,e.excerpt===void 0?[`walkthrough`]:[`walkthrough-excerpt`,e.excerpt.runId,e.excerpt.step,e.excerpt.block??0,e.excerpt.node??``],t=>t.walkthroughs.readWalkthrough({params:{worktreeId:e.scope.worktreeId},headers:e.excerpt?{accept:ys}:{},query:e.excerpt===void 0?{}:{excerptRunId:e.excerpt.runId,excerptStep:e.excerpt.step,excerptBlock:e.excerpt.block,excerptNode:e.excerpt.node}}),t=>t.walkthrough===void 0||t.walkthrough.worktreeId===e.scope.worktreeId)),f3=dt(e=>Vn(e,[`walkthrough-asset`,e.runId,e.assetId],t=>t.walkthroughs.readWalkthroughAsset({params:{worktreeId:e.scope.worktreeId,runId:e.runId,assetId:e.assetId}})));function p3(e,t){let n=e.filter(e=>e.headBranch===t.branch);return n.find(e=>e.state===`open`)??e.find(e=>e.number===t.pullRequestNumber)??n[0]}function m3(e,t,n){return e?.find(e=>e.step===t&&e.call===n)}function h3(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}function g3(e){let{step:t,call:n}=e;return e.decided?{step:t,call:n,decided:!0,...e.option===void 0?{}:{option:e.option}}:{step:t,call:n,decided:!1}}function _3(e){return e.option===void 0?`Decided`:`Decided: ${e.option}`}var v3=dt(({connection:e,projectId:t,branch:n,pullRequestNumber:r})=>Oe(i=>{let a=de(qr(i(Nn({connection:e,projectId:t})))),o=p3(a?.kind===`available`?a.pullRequests:[],{branch:n,pullRequestNumber:r});if(!o)return;let s={connection:e,projectId:t,number:o.number},c=de(qr(i(qs(s)))),l=i(re(s)),u=de(qr(l)),d=u?.kind===`available`?u.status:void 0;return{number:o.number,detail:c?.kind===`available`?Uc(c.pullRequest,d):void 0,status:d,statusUnread:Mi(l)&&!l.waiting||u!==void 0&&u.kind!==`available`}})),y3=dt(e=>Oe({text:``,failure:void 0,sending:!1}).pipe(x));function b3({connection:e,scope:t},n,r){return y3(JSON.stringify([e.environmentId,t.projectId,t.worktreeId,n.branch===void 0?[`run`,n.id]:[`branch`,n.branch],r]))}var x3={isActive:()=>document.visibilityState!==`hidden`,subscribe:e=>(document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e))};function S3(e,t,n){let r=(0,$.c)(3),i={connection:e,projectId:t,number:n,activity:x3},a=Ot(dr(i)),o=l(Gn(i)),s;return r[0]!==a||r[1]!==o?(s={...a,refresh:o},r[0]=a,r[1]=o,r[2]=s):s=r[2],s}function C3(e){let t=(0,$.c)(9),n;t[0]===e?n=t[1]:(n=wn(e),t[0]=e,t[1]=n);let r=Ot(n),i;t[2]===r?i=t[3]:(i=de(qr(r)),t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Mi(r),t[4]=r,t[5]=a);let o;return t[6]!==i||t[7]!==a?(o={read:i,failed:a},t[6]=i,t[7]=a,t[8]=o):o=t[8],o}var w3=Oe(Ns()),T3=Oe(Ns());function E3(e,t){let n=(0,$.c)(8),r;n[0]!==t||n[1]!==e?(r=t?d3({connection:e,scope:t}):w3,n[0]=t,n[1]=e,n[2]=r):r=n[2];let i=de(qr(Ot(r))),a=i?n4(i):void 0,o=de(qr(vB(t,e,void 0).result)),s=de(qr(Ot(t&&o?.base?eB({connection:e,scope:t,range:py(o)}):T3))),c=a?.kind===`ready`?a:void 0,l=c?.run.headOid,u=c&&{runId:c.run.id,headOid:c.run.headOid,content:c.content},d=xe((c?.content.stops??[]).map(k3)),f=o&&s?sy(o.files,s).filter(O3).map(D3):[],p;return n[3]!==l||n[4]!==u||n[5]!==d||n[6]!==f?(p={walkthroughHead:l,walkthrough:u,citations:d,changedSinceReview:f},n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=p):p=n[7],p}function D3(e){return e.path}function O3(e){return e.reviewStatus===`stale`}function k3(e,t){return{number:t+1,names:e.blocks.flatMap(A3)}}function A3(e){return e.kind===`checks`?e.checks.results.map(j3):[]}function j3(e){return e.name}var M3={failed:{Icon:Nh,color:`text-del-fg`,label:`Failed`},running:{Icon:ra,color:`text-foreground animate-spin motion-reduce:animate-none`,label:`Running`},passed:{Icon:gc,color:`text-add-fg`,label:`Passed`},skipped:{Icon:jh,color:`text-muted-foreground`,label:`Skipped`},pending:{Icon:kh,color:`text-muted-foreground`,label:`Waiting`}};function N3(e){let t=(0,$.c)(7),{state:n,className:r}=e,{Icon:i,color:a,label:o}=M3[n],s;t[0]!==r||t[1]!==a?(s=Y(`size-3.5 shrink-0`,a,r),t[0]=r,t[1]=a,t[2]=s):s=t[2];let c;return t[3]!==i||t[4]!==o||t[5]!==s?(c=(0,Q.jsx)(i,{role:`img`,"aria-label":o,className:s}),t[3]=i,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function P3(e){return`[data-check-row="${CSS.escape(e)}"]`}function F3(e){let t=(0,$.c)(22),{status:n,connection:r,projectId:i,number:a,controller:o,pendingReruns:s,rerunning:c,onRerun:l,citations:u,onOpenStep:d}=e,f=es(n.checks),p;t[0]===n.checks?p=t[1]:(p=it(n.checks),t[0]=n.checks,t[1]=p);let m=p,h=OQ(m.running>0||s.size>0),g;t[2]===l?g=t[3]:(g=(e,t)=>{t?K2.open({payload:{title:e.title,description:e.description,confirm:()=>l(e.target,e.keys)}}):l(e.target,e.keys)},t[2]=l,t[3]=g);let _=g,v=L3,y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`h2`,{id:`pull-checks-heading`,children:`Checks`}),t[4]=y):y=t[4];let b;t[5]===m.failed?b=t[6]:(b=m.failed>0&&(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[m.failed,` failed`]}),t[5]=m.failed,t[6]=b);let x;t[7]===m.running?x=t[8]:(x=m.running>0&&(0,Q.jsxs)(`span`,{className:`text-foreground`,children:[m.running,` running`]}),t[7]=m.running,t[8]=x);let S;t[9]===m.passed?S=t[10]:(S=(0,Q.jsxs)(`span`,{children:[m.passed,` passed`]}),t[9]=m.passed,t[10]=S);let C;t[11]!==b||t[12]!==x||t[13]!==S?(C=(0,Q.jsxs)(`div`,{className:R3,children:[y,(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 font-normal tabular-nums`,children:[b,x,S]})]}),t[11]=b,t[12]=x,t[13]=S,t[14]=C):C=t[14];let w=n.checks.length===0?(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No checks reported by GitHub.`}):(0,Q.jsx)(`div`,{role:`presentation`,onKeyDown:v,className:`flex min-w-0 flex-col`,children:f.map(e=>(0,Q.jsx)(z3,{group:e,status:n,connection:r,projectId:i,number:a,now:h,controller:o,pendingReruns:s,rerunning:c,request:_,citations:u,onOpenStep:d},e.key))}),T;t[15]===n.checksTruncated?T=t[16]:(T=n.checksTruncated&&(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`GitHub lists the first 100 checks. Open GitHub to see the rest.`}),t[15]=n.checksTruncated,t[16]=T);let E;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(Ez,{controller:K2,children:I3}),t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==T||t[20]!==C?(D=(0,Q.jsxs)(`section`,{"aria-labelledby":`pull-checks-heading`,className:`mt-8 min-w-0`,children:[C,w,T,E]}),t[18]=w,t[19]=T,t[20]=C,t[21]=D):D=t[21],D}function I3(e){return e&&(0,Q.jsxs)(Oz,{children:[(0,Q.jsxs)(kz,{children:[(0,Q.jsx)(jz,{children:e.title}),(0,Q.jsx)(Mz,{children:e.description})]}),(0,Q.jsxs)(Az,{children:[(0,Q.jsx)(Nz,{children:`Cancel`}),(0,Q.jsx)(X,{onClick:()=>{e.confirm(),K2.close()},children:`Re-run`})]})]})}function L3(e){let t={j:1,ArrowDown:1,k:-1,ArrowUp:-1}[e.key],n=e.target;if(!(n instanceof HTMLElement)||t===void 0||e.metaKey||e.ctrlKey||e.altKey||!n.matches(`[data-check-row]`))return;let r=[...e.currentTarget.querySelectorAll(`[data-check-row]`)],i=r[r.indexOf(n)+t];i&&(e.preventDefault(),i.focus())}var R3=`flex min-h-6 min-w-0 flex-wrap items-center gap-x-2 gap-y-1 border-b pb-1.5 text-xs leading-4 font-medium text-muted-foreground`;function z3(e){let t=(0,$.c)(51),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({group:r,status:c,controller:n,pendingReruns:i,rerunning:o,request:a,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=`passed:${r.key}`,u;if(t[8]!==n||t[9]!==r||t[10]!==l||t[11]!==i||t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c){let e=n.open.has(l),d;t[17]!==r||t[18]!==c?(d=Pi(c,r),t[17]=r,t[18]=c,t[19]=d):d=t[19];let f=d,p;t[20]===r?p=t[21]:(p=vs(r),t[20]=r,t[21]=p);let m=p,h;t[22]!==n||t[23]!==i||t[24]!==a||t[25]!==o||t[26]!==s||t[27]!==c?(h=e=>e.map(e=>(0,Q.jsx)(V3,{check:e,status:c,open:n.open.has(e.key),onToggle:()=>n.toggle(e.key),requested:i.has(e.key),rerunning:o,request:a,...s},e.key)),t[22]=n,t[23]=i,t[24]=a,t[25]=o,t[26]=s,t[27]=c,t[28]=h):h=t[28];let g=h,_=r.name,v;t[29]===r.name?v=t[30]:(v=(0,Q.jsx)(fr,{text:r.name,className:`min-w-0 font-medium text-foreground`}),t[29]=r.name,t[30]=v);let y;t[31]===r.runNumber?y=t[32]:(y=r.runNumber!==void 0&&(0,Q.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,r.runNumber]}),t[31]=r.runNumber,t[32]=y);let b;t[33]!==m||t[34]!==f||t[35]!==a||t[36]!==o?(b=f&&m&&(0,Q.jsx)(B3,{offer:f,label:`Re-run failed jobs`,className:`ml-auto`,pending:o,onClick:e=>a(m,e)}),t[33]=m,t[34]=f,t[35]=a,t[36]=o,t[37]=b):b=t[37];let x;t[38]!==v||t[39]!==y||t[40]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center gap-2 text-xs leading-4 text-muted-foreground`,children:[v,y,b]}),t[38]=v,t[39]=y,t[40]=b,t[41]=x):x=t[41];let S;t[42]!==r.failed||t[43]!==g?(S=g(r.failed),t[42]=r.failed,t[43]=g,t[44]=S):S=t[44];let C;t[45]!==r.running||t[46]!==g?(C=g(r.running),t[45]=r.running,t[46]=g,t[47]=C):C=t[47];let w;t[48]!==S||t[49]!==C?(w=(0,Q.jsxs)(`ul`,{className:`min-w-0`,children:[S,C]}),t[48]=S,t[49]=C,t[50]=w):w=t[50],u=(0,Q.jsxs)(`div`,{role:`group`,"aria-label":_,className:`min-w-0 border-b py-1`,children:[x,w,r.passed.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,"data-check-row":l,"aria-expanded":e,onClick:()=>n.toggle(l),className:`flex h-7 w-full min-w-0 items-center gap-2 rounded-sm text-left text-ui leading-4.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsx)(ci,{"aria-hidden":`true`,className:Y(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,e&&`rotate-90`)}),(0,Q.jsx)(N3,{state:`passed`}),(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[r.passed.length,` passed`]})]}),e&&(0,Q.jsx)(`ul`,{className:`min-w-0`,children:g(r.passed)})]})]}),t[8]=n,t[9]=r,t[10]=l,t[11]=i,t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=u}else u=t[16];return u}function B3(e){let t=(0,$.c)(22),{offer:n,label:r,className:i,pending:a,onClick:o}=e,s=(0,Z.useId)();if(n.kind===`unavailable`){let e;t[0]!==i||t[1]!==s?(e=(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,disabled:!0,focusableWhenDisabled:!0,"aria-describedby":s,className:i}),t[0]=i,t[1]=s,t[2]=e):e=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Au,{"aria-hidden":`true`}),t[3]=a):a=t[3];let o;t[4]!==r||t[5]!==e?(o=(0,Q.jsxs)(Ze,{render:e,children:[a,r]}),t[4]=r,t[5]=e,t[6]=o):o=t[6];let c;t[7]!==n.reason||t[8]!==s?(c=(0,Q.jsx)(Yo,{id:s,children:n.reason}),t[7]=n.reason,t[8]=s,t[9]=c):c=t[9];let l;return t[10]!==o||t[11]!==c?(l=(0,Q.jsxs)(ot,{children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}let c;t[13]!==n.confirm||t[14]!==o?(c=()=>o(n.confirm),t[13]=n.confirm,t[14]=o,t[15]=c):c=t[15];let l;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Au,{"aria-hidden":`true`}),t[16]=l):l=t[16];let u;return t[17]!==i||t[18]!==r||t[19]!==a||t[20]!==c?(u=(0,Q.jsxs)(ji,{variant:`ghost`,size:`sm`,pending:a,className:i,onClick:c,children:[l,r]}),t[17]=i,t[18]=r,t[19]=a,t[20]=c,t[21]=u):u=t[21],u}function V3(e){let t=(0,$.c)(89),{check:n,status:i,open:a,onToggle:o,requested:s,rerunning:c,request:l,connection:u,projectId:d,number:f,now:p,citations:m,onOpenStep:h}=e,g=(0,Z.useId)(),_;t[0]!==n||t[1]!==s?(_=s?`running`:sn(n),t[0]=n,t[1]=s,t[2]=_):_=t[2];let v=_,y;t[3]===n?y=t[4]:(y=Lr(n),t[3]=n,t[4]=y);let b=y,x;t[5]===n?x=t[6]:(x=mo(n),t[5]=n,t[6]=x);let S=x,C;t[7]!==n.name||t[8]!==m?(C=m.get(n.name),t[7]=n.name,t[8]=m,t[9]=C):C=t[9];let w=C,T;t[10]!==n.completedAt||t[11]!==n.startedAt||t[12]!==p?(T=qo(r(n.startedAt,n.completedAt,p)),t[10]=n.completedAt,t[11]=n.startedAt,t[12]=p,t[13]=T):T=t[13];let E=T,D=E;if(s)D=`Re-run requested`;else if(v===`running`&&b){let e;t[14]!==b.position||t[15]!==b.total?(e=(0,Q.jsxs)(`span`,{className:`text-foreground`,children:[`Step `,b.position,` of `,b.total]}),t[14]=b.position,t[15]=b.total,t[16]=e):e=t[16];let n;t[17]===b.step.name?n=t[18]:(n=(0,Q.jsxs)(`span`,{className:`hidden @min-2xl/pr:inline`,children:[` · `,b.step.name]}),t[17]=b.step.name,t[18]=n);let r=E&&` · ${E}`,i;t[19]!==e||t[20]!==n||t[21]!==r?(i=(0,Q.jsxs)(Q.Fragment,{children:[e,n,r]}),t[19]=e,t[20]=n,t[21]=r,t[22]=i):i=t[22],D=i}else if(v===`running`)D=`Queued`;else if(S){let e;t[23]!==S.name||t[24]!==S.number?(e=(0,Q.jsxs)(`span`,{className:`hidden text-del-fg @min-2xl/pr:inline`,children:[`Step `,S.number,` · `,S.name,` ·`,` `]}),t[23]=S.name,t[24]=S.number,t[25]=e):e=t[25];let n;t[26]===E?n=t[27]:(n=(0,Q.jsx)(`span`,{className:`hidden @min-2xl/pr:inline`,children:E}),t[26]=E,t[27]=n);let r;t[28]!==e||t[29]!==n?(r=(0,Q.jsxs)(Q.Fragment,{children:[e,n]}),t[28]=e,t[29]=n,t[30]=r):r=t[30],D=r}let O=n.key,k=a&&`rotate-90`,A;t[31]===k?A=t[32]:(A=Y(`size-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none`,k),t[31]=k,t[32]=A);let j;t[33]===A?j=t[34]:(j=(0,Q.jsx)(ci,{"aria-hidden":`true`,className:A}),t[33]=A,t[34]=j);let M;t[35]===v?M=t[36]:(M=(0,Q.jsx)(N3,{state:v}),t[35]=v,t[36]=M);let N;t[37]===n?N=t[38]:(N=vr(n),t[37]=n,t[38]=N);let F;t[39]===N?F=t[40]:(F=(0,Q.jsx)(fr,{text:N,className:`min-w-0`}),t[39]=N,t[40]=F);let I;t[41]===n.required?I=t[42]:(I=n.required&&(0,Q.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground @min-xl/pr:inline`,children:`Required`}),t[41]=n.required,t[42]=I);let L;t[43]!==F||t[44]!==I?(L=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[F,I]}),t[43]=F,t[44]=I,t[45]=L):L=t[45];let R;t[46]===D?R=t[47]:(R=(0,Q.jsx)(`span`,{className:`shrink-0 pl-2 text-xs leading-4 text-muted-foreground tabular-nums`,children:D}),t[46]=D,t[47]=R);let z;t[48]!==n.required||t[49]!==S?(z=S&&(0,Q.jsxs)(`span`,{className:`col-span-2 col-start-3 -mt-0.5 pb-1 text-xs leading-4 text-del-fg @min-2xl/pr:hidden`,children:[n.required&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground @min-xl/pr:hidden`,children:[`Required ·`,` `]}),`Step `,S.number,` · `,S.name]}),t[48]=n.required,t[49]=S,t[50]=z):z=t[50];let B;t[51]!==n.key||t[52]!==o||t[53]!==a||t[54]!==g||t[55]!==M||t[56]!==L||t[57]!==R||t[58]!==z||t[59]!==j?(B=(0,Q.jsxs)(`button`,{type:`button`,"data-check-row":O,"aria-expanded":a,"aria-controls":g,onClick:o,className:`grid min-h-7 min-w-0 flex-1 grid-cols-[auto_auto_minmax(0,1fr)_auto] items-center gap-x-2 rounded-sm text-left text-ui leading-4.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[j,M,L,R,z]}),t[51]=n.key,t[52]=o,t[53]=a,t[54]=g,t[55]=M,t[56]=L,t[57]=R,t[58]=z,t[59]=j,t[60]=B):B=t[60];let V;t[61]!==n.name||t[62]!==w||t[63]!==h?(V=w!==void 0&&h&&(0,Q.jsxs)(`button`,{type:`button`,className:`h-7 shrink-0 rounded-sm px-1.5 text-xs text-muted-foreground underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`${n.name} is cited in Walkthrough step ${w}`,onClick:()=>h(w),children:[`cited in Walkthrough step `,w]}),t[61]=n.name,t[62]=w,t[63]=h,t[64]=V):V=t[64];let H;t[65]!==n.detailsUrl||t[66]!==n.group||t[67]!==n.kind||t[68]!==n.name?(H=n.detailsUrl&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),"aria-label":`Open ${n.name} on ${n.kind===`actions`?`GitHub`:n.group}`}),children:(0,Q.jsx)(P,{"aria-hidden":`true`})}),(0,Q.jsxs)(Yo,{children:[`Open on `,n.kind===`actions`?`GitHub`:n.group]})]}),t[65]=n.detailsUrl,t[66]=n.group,t[67]=n.kind,t[68]=n.name,t[69]=H):H=t[69];let U;t[70]!==B||t[71]!==V||t[72]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-start gap-1`,children:[B,V,H]}),t[70]=B,t[71]=V,t[72]=H,t[73]=U):U=t[73];let W;t[74]!==n||t[75]!==u||t[76]!==p||t[77]!==f||t[78]!==a||t[79]!==g||t[80]!==d||t[81]!==l||t[82]!==s||t[83]!==c||t[84]!==i?(W=a&&(0,Q.jsx)(`div`,{id:g,className:`mb-2 min-w-0 pl-5.5`,children:n.kind===`actions`?(0,Q.jsx)(H3,{check:n,status:i,connection:u,projectId:d,number:f,now:p,requested:s,rerunning:c,request:l},n.jobId):(0,Q.jsx)($3,{check:n})}),t[74]=n,t[75]=u,t[76]=p,t[77]=f,t[78]=a,t[79]=g,t[80]=d,t[81]=l,t[82]=s,t[83]=c,t[84]=i,t[85]=W):W=t[85];let G;return t[86]!==U||t[87]!==W?(G=(0,Q.jsxs)(`li`,{className:`min-w-0`,children:[U,W]}),t[86]=U,t[87]=W,t[88]=G):G=t[88],G}function H3(e){let t=(0,$.c)(26),{check:n,status:r,connection:i,projectId:a,number:o,now:s,requested:c,rerunning:l,request:u}=e,d;t[0]===n?d=t[1]:(d=mo(n),t[0]=n,t[1]=d);let f=d,p;t[2]===f?p=t[3]:(p=()=>new Set(f?[f.number]:[]),t[2]=f,t[3]=p);let[m,h]=(0,Z.useState)(p),g;t[4]!==n||t[5]!==r?(g=va(r,n),t[4]=n,t[5]=r,t[6]=g):g=t[6];let _=g,v=n.jobId,y;t[7]===n?y=t[8]:(y=Zr(n),t[7]=n,t[8]=y);let b=y,x;t[9]!==n||t[10]!==i||t[11]!==v||t[12]!==s||t[13]!==o||t[14]!==m||t[15]!==a?(x=n.steps.length===0?(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:sn(n)===`running`?`Waiting for a runner.`:`GitHub reported no steps for this job.`}):(0,Q.jsx)(`ol`,{"aria-label":`Steps of ${n.name}`,className:`min-w-0`,children:n.steps.map(e=>(0,Q.jsx)(U3,{step:e,check:n,now:s,open:m.has(e.number),onToggle:()=>h(t=>gi(t,e.number)),log:v===void 0?void 0:(0,Q.jsx)(K3,{connection:i,projectId:a,number:o,check:n,jobId:v,step:e})},e.number))}),t[9]=n,t[10]=i,t[11]=v,t[12]=s,t[13]=o,t[14]=m,t[15]=a,t[16]=x):x=t[16];let S;t[17]!==_||t[18]!==u||t[19]!==c||t[20]!==b||t[21]!==l?(S=!c&&b&&(0,Q.jsx)(`div`,{className:`mt-1 flex min-w-0 items-center gap-2`,children:(0,Q.jsx)(B3,{offer:_,label:`Re-run this job`,pending:l,onClick:e=>u(b,e)})}),t[17]=_,t[18]=u,t[19]=c,t[20]=b,t[21]=l,t[22]=S):S=t[22];let C;return t[23]!==x||t[24]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[23]=x,t[24]=S,t[25]=C):C=t[25],C}function U3(e){let t=(0,$.c)(34),{step:n,check:i,now:a,open:o,onToggle:s,log:c}=e,l;t[0]===n?l=t[1]:(l=us(n),t[0]=n,t[1]=l);let u=l,d;t[2]!==a||t[3]!==n.completedAt||t[4]!==n.startedAt?(d=qo(r(n.startedAt,n.completedAt,a)),t[2]=a,t[3]=n.completedAt,t[4]=n.startedAt,t[5]=d):d=t[5];let f=d,p=c!==void 0&&(u===`passed`||u===`failed`),m;t[6]===n.number?m=t[7]:(m=(0,Q.jsx)(`span`,{className:`w-5 shrink-0 text-right text-xs text-muted-foreground tabular-nums`,children:n.number}),t[6]=n.number,t[7]=m);let h;t[8]===u?h=t[9]:(h=(0,Q.jsx)(N3,{state:u,className:`size-3`}),t[8]=u,t[9]=h);let g=n.name,_=W3[u],v;t[10]===_?v=t[11]:(v=Y(`min-w-0`,_),t[10]=_,t[11]=v);let y;t[12]!==n.name||t[13]!==v?(y=(0,Q.jsx)(fr,{text:g,className:v}),t[12]=n.name,t[13]=v,t[14]=y):y=t[14];let b=u===`running`?`running ${f??``}`:f,x;t[15]===b?x=t[16]:(x=(0,Q.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums`,children:b}),t[15]=b,t[16]=x);let S;t[17]!==x||t[18]!==m||t[19]!==h||t[20]!==y?(S=(0,Q.jsxs)(Q.Fragment,{children:[m,h,y,x]}),t[17]=x,t[18]=m,t[19]=h,t[20]=y,t[21]=S):S=t[21];let C=S,w=u===`running`?`step`:void 0,T;t[22]!==i||t[23]!==C||t[24]!==p||t[25]!==s||t[26]!==o||t[27]!==n.name||t[28]!==n.number?(T=p?(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":o,"aria-label":`${o?`Hide`:`Show`} the log of step ${n.number}, ${n.name}, in ${i.name}`,onClick:s,className:`flex h-6 w-full min-w-0 items-center gap-2 rounded-sm text-left text-ui leading-4.5 outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring`,children:C}):(0,Q.jsx)(`div`,{className:`flex h-6 min-w-0 items-center gap-2 text-ui leading-4.5`,children:C}),t[22]=i,t[23]=C,t[24]=p,t[25]=s,t[26]=o,t[27]=n.name,t[28]=n.number,t[29]=T):T=t[29];let E=o&&p&&c,D;return t[30]!==w||t[31]!==T||t[32]!==E?(D=(0,Q.jsxs)(`li`,{className:`min-w-0`,"aria-current":w,children:[T,E]}),t[30]=w,t[31]=T,t[32]=E,t[33]=D):D=t[33],D}var W3={pending:`text-muted-foreground`,skipped:`text-muted-foreground`,failed:`font-medium text-del-fg`,running:`font-medium`,passed:``},G3={plain:``,error:`bg-del-bg text-del-fg`,warning:`text-foreground`,group:`font-semibold text-foreground`,command:`text-muted-foreground`};function K3(e){let t=(0,$.c)(44),{connection:n,projectId:r,number:i,check:a,jobId:o,step:s}=e,c;t[0]!==n||t[1]!==o||t[2]!==i||t[3]!==r||t[4]!==s.completedAt||t[5]!==s.startedAt?(c={connection:n,projectId:r,number:i,jobId:o,from:s.startedAt,to:s.completedAt},t[0]=n,t[1]=o,t[2]=i,t[3]=r,t[4]=s.completedAt,t[5]=s.startedAt,t[6]=c):c=t[6];let{read:l,failed:u}=C3(c);if(l===void 0&&u){let e;return t[7]===a?e=t[8]:(e=(0,Q.jsx)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:(0,Q.jsx)(X3,{check:a,reason:`The log could not be read.`})}),t[7]=a,t[8]=e),e}if(l===void 0){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=Y(`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,`flex h-8 items-center gap-2 px-2.5`),t[9]=e):e=t[9];let n;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:e,"aria-busy":`true`,children:[(0,Q.jsx)(ra,{"aria-hidden":`true`,className:`size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Reading the log`})]}),t[10]=n):n=t[10],n}if(l.kind===`unavailable`){let e;t[11]===l.reason?e=t[12]:(e=Or(l.reason),t[11]=l.reason,t[12]=e);let n;return t[13]!==a||t[14]!==e?(n=(0,Q.jsx)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:(0,Q.jsx)(X3,{check:a,reason:e})}),t[13]=a,t[14]=e,t[15]=n):n=t[15],n}let{excerpt:d}=l,f;t[16]===d.lines?f=t[17]:(f=d.lines.map(J3).join(`
1357
- `),t[16]=d.lines,t[17]=f);let p=f,m;t[18]!==d||t[19]!==s.number?(m=Ye(d,s.number),t[18]=d,t[19]=s.number,t[20]=m):m=t[20];let h;t[21]===m?h=t[22]:(h=(0,Q.jsx)(fr,{className:`min-w-0`,text:m}),t[21]=m,t[22]=h);let g;t[23]===p?g=t[24]:(g=()=>void X2(p),t[23]=p,t[24]=g);let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Bs,{"aria-hidden":`true`}),t[25]=_):_=t[25];let v;t[26]===g?v=t[27]:(v=(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:g,children:[_,`Copy`]}),t[26]=g,t[27]=v);let y;t[28]===a.detailsUrl?y=t[29]:(y=a.detailsUrl&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,render:(0,Q.jsx)(`a`,{href:a.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Full log`,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[28]=a.detailsUrl,t[29]=y);let b;t[30]!==h||t[31]!==v||t[32]!==y?(b=(0,Q.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center gap-2 border-b px-2.5 text-xs text-muted-foreground`,children:[h,v,y]}),t[30]=h,t[31]=v,t[32]=y,t[33]=b):b=t[33];let x=`Log of step ${s.number}, ${s.name}`,S;t[34]===d.lines?S=t[35]:(S=d.lines.map(q3),t[34]=d.lines,t[35]=S);let C;t[36]===S?C=t[37]:(C=(0,Q.jsx)(`div`,{className:`w-max min-w-full`,children:S}),t[36]=S,t[37]=C);let w;t[38]!==x||t[39]!==C?(w=(0,Q.jsx)(`pre`,{ref:Y3,tabIndex:0,"aria-label":x,className:`max-h-96 min-w-0 overflow-auto py-1.5 font-mono text-xs leading-4.5 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:C}),t[38]=x,t[39]=C,t[40]=w):w=t[40];let T;return t[41]!==w||t[42]!==b?(T=(0,Q.jsxs)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:[b,w]}),t[41]=w,t[42]=b,t[43]=T):T=t[43],T}function q3(e,t){return(0,Q.jsx)(`div`,{className:Y(`px-2.5 whitespace-pre`,G3[e.level]),children:e.text||` `},t)}function J3(e){return e.text}function Y3(e){e&&(e.scrollTop=e.scrollHeight)}function X3(e){let t=(0,$.c)(10),{check:n,reason:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=n.annotations.length>0&&(0,Q.jsx)(Z3,{check:n}),t[2]=n,t[3]=a);let o;t[4]===n.detailsUrl?o=t[5]:(o=n.detailsUrl&&(0,Q.jsxs)(X,{variant:`link`,size:`flush`,className:`mt-1`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Open the job on GitHub`,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[4]=n.detailsUrl,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`min-w-0 px-2.5 py-2 text-ui`,children:[i,a,o]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Z3(e){let t=(0,$.c)(5),{check:n}=e,r=`Annotations of ${n.name}`,i;t[0]===n.annotations?i=t[1]:(i=n.annotations.map(Q3),t[0]=n.annotations,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Q.jsx)(`ul`,{"aria-label":r,className:`mt-1.5 min-w-0`,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function Q3(e,t){return(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1 text-ui leading-4.5`,children:[e.level===`FAILURE`?(0,Q.jsx)(Nh,{"aria-label":`Error`,className:`mt-0.5 size-3.5 shrink-0 text-del-fg`}):(0,Q.jsx)(qi,{"aria-label":e.level===`WARNING`?`Warning`:`Notice`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[e.path&&(0,Q.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[e.path,e.line===void 0?``:`:${e.line}`]}),(0,Q.jsxs)(`p`,{className:`wrap-anywhere`,children:[e.title&&(0,Q.jsxs)(`span`,{className:`font-medium`,children:[e.title,` · `]}),e.message]})]})]},t)}function $3(e){let t=(0,$.c)(13),{check:n}=e,r;t[0]!==n.kind||t[1]!==n.summary?(r=n.summary?(0,Q.jsx)(`p`,{className:`py-1 text-ui leading-5 whitespace-pre-line text-foreground-2 wrap-anywhere`,children:n.summary}):(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:n.kind===`status`?`A commit status reported by an external service.`:`No summary reported.`}),t[0]=n.kind,t[1]=n.summary,t[2]=r):r=t[2];let i;t[3]===n?i=t[4]:(i=n.annotations.length>0&&(0,Q.jsx)(Z3,{check:n}),t[3]=n,t[4]=i);let a;t[5]!==n.detailsUrl||t[6]!==n.group||t[7]!==n.kind?(a=n.detailsUrl&&(0,Q.jsxs)(X,{variant:`link`,size:`flush`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Open on `,n.kind===`status`?`its service`:n.group,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[5]=n.detailsUrl,t[6]=n.group,t[7]=n.kind,t[8]=a):a=t[8];let o;return t[9]!==r||t[10]!==i||t[11]!==a?(o=(0,Q.jsxs)(`div`,{className:`min-w-0 pb-1`,children:[r,i,a]}),t[9]=r,t[10]=i,t[11]=a,t[12]=o):o=t[12],o}var e6={failed:`failed`,running:`running`,none:`pending`};function t6(e){let t=(0,$.c)(6),{children:n,action:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(N3,{state:`pending`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:n}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[i,a,r]}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function n6(e){let t=(0,$.c)(42),{drafts:n,pull:r,status:i,context:a,projectId:o,blockers:s,walkthrough:c,changedSinceReview:l,review:u,notes:d,onOpenFile:f,onFocusCheck:p}=e,m,h,g,_,v,y,b,x;if(t[0]!==s||t[1]!==d||t[2]!==p||t[3]!==r||t[4]!==u||t[5]!==i||t[6]!==c){m=Uc(r,i);let e=id(m.mergeable),n=c!==void 0&&c.headOid!==m.headSha;h=m.state===`open`;let a;t[15]!==r.baseBranch||t[16]!==r.mergeMethods||t[17]!==u||t[18]!==i?(a=nf({status:i,baseBranch:r.baseBranch,mergeMethods:r.mergeMethods,review:u}),t[15]=r.baseBranch,t[16]=r.mergeMethods,t[17]=u,t[18]=i,t[19]=a):a=t[19],g=a,_=`pull-decision-heading`,v=`mt-7 min-w-0`;let o;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`h2`,{id:`pull-decision-heading`,children:`Merge`}),t[20]=o):o=t[20];let l=(0,Q.jsxs)(`span`,{className:`ml-auto flex min-w-0 items-center gap-1.5 font-normal`,children:[h&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(G2,{})]}),(0,Q.jsx)(`span`,{className:`font-mono text-caption text-foreground`,children:By(m.headSha)})]});t[21]===l?y=t[22]:(y=(0,Q.jsxs)(`div`,{className:R3,children:[o,l]}),t[21]=l,t[22]=y),b=!h&&(0,Q.jsxs)(`p`,{className:`flex h-7 min-w-0 items-center gap-2 pt-1 text-ui`,children:[(0,Q.jsx)(N3,{state:m.state===`merged`?`passed`:`skipped`}),m.state===`merged`?(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[`Merged into`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:m.baseBranch}),`.`]}):(0,Q.jsx)(`span`,{children:`Closed without merging.`})]}),x=h&&(0,Q.jsxs)(`ul`,{"aria-label":`What blocks the merge`,className:`min-w-0 pt-1`,children:[s.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(N3,{state:e6[e.tone]}),e.checkKey?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>p(e.checkKey??``),className:`min-w-0 rounded-sm py-1 text-left wrap-anywhere underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,children:e.text}):(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:e.text}),e.key===`review`&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,render:(0,Q.jsx)(`a`,{href:r.url,target:`_blank`,rel:`noreferrer`}),children:[`Reviewers on GitHub`,(0,Q.jsx)(P,{"aria-hidden":`true`,"data-icon":`inline-end`})]})]},e.key)),s.length===0&&i&&(0,Q.jsxs)(`li`,{className:`flex h-7 min-w-0 items-center gap-2 text-ui`,children:[(0,Q.jsx)(N3,{state:`passed`}),(0,Q.jsx)(`span`,{children:`Nothing on GitHub blocks the merge.`})]}),n&&(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(N3,{state:`pending`}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[`The Walkthrough covers`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:By(c.headOid)}),`; the pull request is at`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:By(m.headSha)}),`.`]}),(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:c.onOpen,children:`Open Walkthrough`})]}),d]}),t[0]=s,t[1]=d,t[2]=p,t[3]=r,t[4]=u,t[5]=i,t[6]=c,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x}else m=t[7],h=t[8],g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14];let S=h&&n,C;t[23]!==l||t[24]!==f?(C=l.length>0&&(0,Q.jsxs)(`div`,{className:`min-w-0 pt-1`,children:[(0,Q.jsxs)(`p`,{className:`flex h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(N3,{state:`pending`}),l.length,` `,l.length===1?`file you marked reviewed has`:`files you marked reviewed have`,` `,`changed since.`]}),(0,Q.jsx)(`ul`,{"aria-label":`Reviewed files that changed`,className:`flex min-w-0 flex-col pl-5.5`,children:l.slice(0,8).map(e=>(0,Q.jsx)(`li`,{className:`min-w-0`,children:f?(0,Q.jsxs)(`button`,{type:`button`,className:`flex h-6 max-w-full min-w-0 items-center gap-1.5 rounded-sm font-mono text-xs text-foreground-2 underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>f(e),children:[(0,Q.jsx)(Zh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{text:e})]}):(0,Q.jsx)(fr,{text:e,className:`font-mono text-xs text-muted-foreground`})},e))}),l.length>8&&(0,Q.jsxs)(`p`,{className:`pl-5.5 text-xs text-muted-foreground`,children:[`and `,l.length-8,` more`]})]}),t[23]=l,t[24]=f,t[25]=C):C=t[25];let w;t[26]!==a||t[27]!==m||t[28]!==h||t[29]!==o||t[30]!==g||t[31]!==u?(w=h&&(0,Q.jsx)(qK,{context:a,projectId:o,pull:m,review:u,reason:g.waitsFor,className:Y(`mt-2 border-t pt-3`)}),t[26]=a,t[27]=m,t[28]=h,t[29]=o,t[30]=g,t[31]=u,t[32]=w):w=t[32];let T;return t[33]!==_||t[34]!==v||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==S||t[39]!==C||t[40]!==w?(T=(0,Q.jsxs)(`section`,{"aria-labelledby":_,className:v,children:[y,b,x,S,C,w]}),t[33]=_,t[34]=v,t[35]=y,t[36]=b,t[37]=x,t[38]=S,t[39]=C,t[40]=w,t[41]=T):T=t[41],T}function r6(e){let t=(0,$.c)(49),{context:n,projectId:r,number:i,repository:a,reviewAction:o}=e,s=(0,Z.useId)(),c=(0,Z.useId)(),[l,u]=(0,Z.useState)(),d=l?.body??``,f=na(n)??(a?Xc(l,a):Tu(`github-comment`)),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>u(void 0),t[0]=p):p=t[0];let{result:m,submit:h}=Y2(n.connection,r,i,p),g;t[1]===d?g=t[2]:(g=d.trim(),t[1]=d,t[2]=g);let _=g===``,v;t[3]!==d||t[4]!==l||t[5]!==_||t[6]!==m.waiting||t[7]!==h||t[8]!==f?(v=()=>{!l?.repository||_||f||m.waiting||h(l.repository,d)},t[3]=d,t[4]=l,t[5]=_,t[6]=m.waiting,t[7]=h,t[8]=f,t[9]=v):v=t[9];let y=v,b;t[10]===m?b=t[11]:(b=Mi(m),t[10]=m,t[11]=b);let x=b,S;t[12]===y?S=t[13]:(S=e=>{e.preventDefault(),y()},t[12]=y,t[13]=S);let C;t[14]!==s||t[15]!==i?(C=(0,Q.jsxs)(`label`,{htmlFor:s,className:`sr-only`,children:[`Comment on pull request #`,i]}),t[14]=s,t[15]=i,t[16]=C):C=t[16];let w=x||void 0,T=x?c:void 0,E;t[17]===a?E=t[18]:(E=e=>{let t=e.currentTarget.value;u(e=>Vl(e,a,t))},t[17]=a,t[18]=E);let D;t[19]===y?D=t[20]:(D=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())},t[19]=y,t[20]=D);let O;t[21]!==d||t[22]!==s||t[23]!==m.waiting||t[24]!==D||t[25]!==w||t[26]!==T||t[27]!==E?(O=(0,Q.jsx)(gH,{id:s,value:d,maxLength:Nr,placeholder:`Comment on GitHub`,disabled:m.waiting,"aria-invalid":w,"aria-describedby":T,className:`min-h-18`,onChange:E,onKeyDown:D}),t[21]=d,t[22]=s,t[23]=m.waiting,t[24]=D,t[25]=w,t[26]=T,t[27]=E,t[28]=O):O=t[28];let k;t[29]!==c||t[30]!==x||t[31]!==m.cause?(k=x&&(0,Q.jsx)(`p`,{id:c,role:`alert`,className:`mr-auto min-w-0 text-ui text-destructive`,children:q2(m.cause)}),t[29]=c,t[30]=x,t[31]=m.cause,t[32]=k):k=t[32];let A;t[33]===f?A=t[34]:(A=f&&(0,Q.jsx)(`p`,{className:`mr-auto text-ui text-muted-foreground`,children:f}),t[33]=f,t[34]=A);let j=_||!!f,M;t[35]!==m.waiting||t[36]!==j||t[37]!==f?(M=(0,Q.jsx)(ji,{type:`submit`,size:`sm`,pending:m.waiting,disabled:j,"aria-description":f,children:`Comment`}),t[35]=m.waiting,t[36]=j,t[37]=f,t[38]=M):M=t[38];let N;t[39]!==o||t[40]!==k||t[41]!==A||t[42]!==M?(N=(0,Q.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[k,A,o,M]}),t[39]=o,t[40]=k,t[41]=A,t[42]=M,t[43]=N):N=t[43];let P;return t[44]!==O||t[45]!==N||t[46]!==S||t[47]!==C?(P=(0,Q.jsxs)(`form`,{"aria-label":`Comment on GitHub`,className:`mt-5 min-w-0 @min-3xl/pr:ml-7.5`,onSubmit:S,children:[C,O,N]}),t[44]=O,t[45]=N,t[46]=S,t[47]=C,t[48]=P):P=t[48],P}function i6(e){let t=(0,$.c)(7),{step:n,state:r,onOpenStep:i}=e,a;t[0]!==i||t[1]!==n?(a=i&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:()=>i(n),children:[`Open step `,n]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==n||t[5]!==a?(o=(0,Q.jsxs)(t6,{action:a,children:[`Your call in Walkthrough step `,n,` `,r,`. Merge waits for it.`]}),t[3]=r,t[4]=n,t[5]=a,t[6]=o):o=t[6],o}function a6(e){let t=(0,$.c)(9),{undecidedCallStep:n,callNeedingCommit:r,onOpenStep:i}=e,a;t[0]!==i||t[1]!==n?(a=typeof n==`number`&&(0,Q.jsx)(i6,{step:n,state:`is not decided yet`,onOpenStep:i}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]!==r||t[4]!==i?(o=r!==void 0&&(0,Q.jsx)(i6,{step:r,state:`needs a new commit`,onOpenStep:i}),t[3]=r,t[4]=i,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,Q.jsxs)(Q.Fragment,{children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function o6(e){let t=(0,$.c)(3),{checkout:n,context:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(D1,{owner:{scope:n,context:r},renderTrigger:s6}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function s6(e,t){return(0,Q.jsxs)(`p`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5 text-muted-foreground`,children:[(0,Q.jsx)($g,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:e===1?`1 draft comment is not published yet.`:`${e} draft comments are not published yet.`}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,className:`shrink-0`,onClick:t,children:`Publish review`})]})}var c6={passed:`open`,failed:`closed`,none:`outline`};function l6(e){let t=(0,$.c)(69),{projectId:n,number:r,context:i,toolbarTarget:a,onBack:o,onFile:s,checkout:c,onOpen:u}=e,d;t[0]!==i.connection||t[1]!==r||t[2]!==n?(d=qs({connection:i.connection,projectId:n,number:r}),t[0]=i.connection,t[1]=r,t[2]=n,t[3]=d):d=t[3];let f=d,p=Ot(f),m=l(f),h,g,_;if(t[4]!==i.connection||t[5]!==n||t[6]!==p||t[7]!==m){_=Symbol.for(`react.early_return_sentinel`);bb0:{let e=de(qr(p));if(Mi(p)){let e;t[11]===m?e=t[12]:(e=(0,Q.jsx)(gt,{description:`The pull request could not be read.`,onRetry:m}),t[11]=m,t[12]=e),_=e;break bb0}if(!e){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Reading the pull request`}),t[13]=e):e=t[13],_=e;break bb0}if(e.kind===`unavailable`){_=(0,Q.jsx)(v6,{reason:e.reason,retrying:p.waiting,onRetry:m});break bb0}h=e.pullRequest,g=JSON.stringify([i.connection.environmentId,n,h.url])}t[4]=i.connection,t[5]=n,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_}else h=t[8],g=t[9],_=t[10];if(_!==Symbol.for(`react.early_return_sentinel`))return _;let v=g,y;t[14]!==i||t[15]!==r||t[16]!==n||t[17]!==h.state?(y=h.state===`merged`||h.state===`closed`?(0,Q.jsx)(BK,{context:i,projectId:n,number:r}):void 0,t[14]=i,t[15]=r,t[16]=n,t[17]=h.state,t[18]=y):y=t[18];let b;t[19]!==h.url||t[20]!==y||t[21]!==a?(b=(0,Q.jsx)(d6,{url:h.url,target:a,archive:y}),t[19]=h.url,t[20]=y,t[21]=a,t[22]=b):b=t[22];let x=`Pull request #${r}`,S;t[23]===h?S=t[24]:(S=(0,Q.jsx)(p6,{pull:h}),t[23]=h,t[24]=S);let C;t[25]!==c||t[26]!==i||t[27]!==r||t[28]!==u||t[29]!==n||t[30]!==h?(C=(0,Q.jsx)(b6,{pull:h,context:i,projectId:n,number:r,checkout:c,onOpen:u}),t[25]=c,t[26]=i,t[27]=r,t[28]=u,t[29]=n,t[30]=h,t[31]=C):C=t[31];let w;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(`h2`,{children:`Description`}),t[32]=w):w=t[32];let T;t[33]===h.author?T=t[34]:(T=h.author&&(0,Q.jsx)(fr,{text:`by ${h.author}`}),t[33]=h.author,t[34]=T);let E;t[35]!==h.author||t[36]!==h.createdAt?(E=h.author&&h.createdAt&&(0,Q.jsx)(G2,{}),t[35]=h.author,t[36]=h.createdAt,t[37]=E):E=t[37];let D;t[38]===h.createdAt?D=t[39]:(D=h.createdAt&&(0,Q.jsx)(`time`,{dateTime:h.createdAt,children:y6(h.createdAt)}),t[38]=h.createdAt,t[39]=D);let O;t[40]!==T||t[41]!==E||t[42]!==D?(O=(0,Q.jsxs)(`div`,{className:R3,children:[w,(0,Q.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-1.5 font-normal`,children:[T,E,D]})]}),t[40]=T,t[41]=E,t[42]=D,t[43]=O):O=t[43];let k;t[44]===h.description?k=t[45]:(k=h.description.trim()?(0,Q.jsx)(cR,{text:h.description,className:`pt-3 text-(length:--text-prose) leading-6 wrap-anywhere text-foreground-2 [&_h1]:text-foreground [&_h2]:text-foreground [&_h3]:text-base [&_h3]:leading-6 [&_h3]:text-foreground [&_code]:text-ui [&_code]:leading-5 [&_p]:leading-6 [&_p]:mt-1 [&_p]:mb-0 [&_ul]:mt-2 [&_ul]:mb-0 [&_ol]:mt-2 [&_ol]:mb-0 [&_li]:my-0 [&_h1]:mb-0 [&_h2]:mb-0 [&_h3]:mb-0 [&_h1]:tracking-pr-subheading [&_h2]:tracking-pr-subheading [&_h3]:tracking-pr-subheading [&_code]:rounded-sm [&_code]:px-1.25 [&_code]:py-px [&_code]:ring-1 [&_code]:ring-border [&_code]:ring-inset`}):(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No description provided.`}),t[44]=h.description,t[45]=k);let A;t[46]!==O||t[47]!==k?(A=(0,Q.jsxs)(`section`,{"aria-label":`Description`,className:`mt-8 min-w-0`,children:[O,k]}),t[46]=O,t[47]=k,t[48]=A):A=t[48];let j;t[49]!==c||t[50]!==i||t[51]!==o||t[52]!==s||t[53]!==n||t[54]!==h?(j=(0,Q.jsx)(h6,{pull:h,context:i,projectId:n,checkout:c,onBack:o,onFile:s}),t[49]=c,t[50]=i,t[51]=o,t[52]=s,t[53]=n,t[54]=h,t[55]=j):j=t[55];let M;t[56]!==p.waiting||t[57]!==A||t[58]!==j||t[59]!==x||t[60]!==S||t[61]!==C?(M=(0,Q.jsxs)(`article`,{"aria-busy":p.waiting,"aria-label":x,className:`mx-auto w-full max-w-280 min-w-0 px-4 pt-9 pb-12 text-ui @min-3xl/pr:px-7`,children:[S,C,A,j]}),t[56]=p.waiting,t[57]=A,t[58]=j,t[59]=x,t[60]=S,t[61]=C,t[62]=M):M=t[62];let N;return t[63]!==v||t[64]!==r||t[65]!==n||t[66]!==M||t[67]!==b?(N=(0,Q.jsxs)(u6,{document:v,projectId:n,number:r,children:[b,M]},v),t[63]=v,t[64]=r,t[65]=n,t[66]=M,t[67]=b,t[68]=N):N=t[68],N}function u6(e){let t=(0,$.c)(9),{document:n,projectId:r,number:i,children:a}=e,o=Ot(E),s;t[0]===n?s=t[1]:(s=jQ(n),t[0]=n,t[1]=s);let c=s,l;t[2]!==i||t[3]!==c||t[4]!==r||t[5]!==o?(l=()=>e=>{let t=e?.querySelector(`[data-pr-conversation]`);if(!e||!t)return;let n=()=>t.getBoundingClientRect().top-e.getBoundingClientRect().top,a=o.get(c),s=o.get(AQ);return a!==null&&(s?.projectId!==r||s.number!==i)&&(e.scrollTop+=n()+a),()=>{let t=n();o.set(c,e.scrollTop>0&&t<e.clientHeight?-t:null)}},t[2]=i,t[3]=c,t[4]=r,t[5]=o,t[6]=l):l=t[6];let[u]=(0,Z.useState)(l),d;return t[7]===a?d=t[8]:(d=(0,Q.jsx)(`div`,{ref:u,className:`@container/pr flex min-h-0 min-w-0 flex-1 flex-col overflow-auto`,children:a}),t[7]=a,t[8]=d),d}function d6(e){let t=(0,$.c)(21),{url:n,target:r,archive:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,render:(0,Q.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`}),"aria-label":`Open on GitHub`,className:``}),t[0]=n,t[1]=a);let o=r!==void 0&&`hidden @min-3xl/pane:inline`,s;t[2]===o?s=t[3]:(s=Y(o),t[2]=o,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,Q.jsx)(`span`,{className:s,children:`Open on GitHub`}),t[4]=s,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]!==a||t[8]!==c?(u=(0,Q.jsxs)(Ze,{render:a,children:[c,l]}),t[7]=a,t[8]=c,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(Yo,{children:`Open on GitHub`}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Q.jsxs)(ot,{children:[u,d]}),t[11]=u,t[12]=f);let p;t[13]!==i||t[14]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[i,f]}),t[13]=i,t[14]=f,t[15]=p):p=t[15];let m=p;if(r!==void 0){let e;return t[16]!==m||t[17]!==r?(e=r?(0,th.createPortal)(m,r):null,t[16]=m,t[17]=r,t[18]=e):e=t[18],e}let h;return t[19]===m?h=t[20]:(h=(0,Q.jsx)(`div`,{className:`flex h-12 shrink-0 items-center justify-end border-b px-3`,children:m}),t[19]=m,t[20]=h),h}function f6(e){let t=(0,$.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-y-0 left-0 flex w-6 items-center justify-center`,children:`·`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,Q.jsxs)(`span`,{className:`relative flex max-w-full min-w-0 items-center gap-2.5 pl-6`,children:[r,n]}),t[1]=n,t[2]=i),i}function p6(e){let t=(0,$.c)(53),{pull:n}=e,r;t[0]===n.url?r=t[1]:(r=El(n.url)?.split(`/`).at(-1),t[0]=n.url,t[1]=r);let i=r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Dg,{"aria-hidden":`true`,strokeWidth:1.75,className:`size-3.5 shrink-0`}),o=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Pull request`}),t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===i?s=t[5]:(s=i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(G2,{}),(0,Q.jsx)(fr,{text:i})]}),t[4]=i,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`flex h-5.5 min-w-0 items-center gap-2 text-ui leading-5.5 font-medium text-muted-foreground`,children:[a,o,s]}),t[6]=s,t[7]=c);let l;t[8]===n.number?l=t[9]:(l=(0,Q.jsxs)(`span`,{className:`text-title-dim tabular-nums`,children:[`#`,n.number]}),t[8]=n.number,t[9]=l);let u;t[10]!==n.title||t[11]!==l?(u=(0,Q.jsxs)(`h1`,{className:`mt-3 text-4xl leading-10 font-semibold tracking-pr-title wrap-anywhere`,children:[l,` `,n.title]}),t[10]=n.title,t[11]=l,t[12]=u):u=t[12];let d;t[13]===n?d=t[14]:(d=(0,Q.jsx)(H2,{pull:n}),t[13]=n,t[14]=d);let f;t[15]!==n.author||t[16]!==n.authorAvatarUrl?(f=n.author&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(g6,{author:n.author,url:n.authorAvatarUrl}),(0,Q.jsx)(fr,{text:n.author,className:`font-medium text-foreground`})]}),t[15]=n.author,t[16]=n.authorAvatarUrl,t[17]=f):f=t[17];let p;t[18]!==d||t[19]!==f?(p=(0,Q.jsxs)(f6,{children:[d,f]}),t[18]=d,t[19]=f,t[20]=p):p=t[20];let m=`Merges ${n.headBranch} into ${n.baseBranch}`,h;t[21]===m?h=t[22]:(h=(0,Q.jsx)(`span`,{role:`group`,"aria-label":m,tabIndex:0,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-sm font-mono text-caption text-foreground focus-visible:outline-2 focus-visible:outline-ring`}),t[21]=m,t[22]=h);let g;t[23]===n.baseBranch?g=t[24]:(g=(0,Q.jsx)(fr,{text:n.baseBranch}),t[23]=n.baseBranch,t[24]=g);let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(_h,{"aria-hidden":`true`,strokeWidth:1.75,className:`size-3 shrink-0 text-muted-foreground`}),t[25]=_):_=t[25];let v;t[26]===n.headBranch?v=t[27]:(v=(0,Q.jsx)(fr,{text:n.headBranch}),t[26]=n.headBranch,t[27]=v);let y;t[28]!==h||t[29]!==g||t[30]!==v?(y=(0,Q.jsxs)(Ze,{render:h,children:[g,_,v]}),t[28]=h,t[29]=g,t[30]=v,t[31]=y):y=t[31];let b;t[32]!==n.baseBranch||t[33]!==n.headBranch?(b=(0,Q.jsxs)(Yo,{children:[`Merges `,n.headBranch,` into `,n.baseBranch]}),t[32]=n.baseBranch,t[33]=n.headBranch,t[34]=b):b=t[34];let x;t[35]!==y||t[36]!==b?(x=(0,Q.jsx)(f6,{children:(0,Q.jsxs)(ot,{children:[y,b]})}),t[35]=y,t[36]=b,t[37]=x):x=t[37];let S;t[38]===n.updatedAt?S=t[39]:(S=y6(n.updatedAt),t[38]=n.updatedAt,t[39]=S);let C;t[40]===S?C=t[41]:(C=(0,Q.jsxs)(f6,{children:[`updated `,S]}),t[40]=S,t[41]=C);let w;t[42]!==p||t[43]!==x||t[44]!==C?(w=(0,Q.jsx)(`div`,{className:`mt-3.5 min-w-0 overflow-hidden`,children:(0,Q.jsxs)(`div`,{className:`-ml-6 flex min-w-0 flex-wrap items-center gap-y-2 text-ui leading-5 text-muted-foreground`,children:[p,x,C]})}),t[42]=p,t[43]=x,t[44]=C,t[45]=w):w=t[45];let T;t[46]===n.labels?T=t[47]:(T=n.labels.length>0&&(0,Q.jsx)(`ul`,{"aria-label":`Labels`,className:`mt-3 flex min-w-0 flex-wrap gap-1.5`,children:n.labels.map(m6)}),t[46]=n.labels,t[47]=T);let E;return t[48]!==w||t[49]!==T||t[50]!==c||t[51]!==u?(E=(0,Q.jsxs)(`header`,{className:`min-w-0`,children:[c,u,w,T]}),t[48]=w,t[49]=T,t[50]=c,t[51]=u,t[52]=E):E=t[52],E}function m6(e,t){return(0,Q.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,Q.jsx)(Ao,{variant:`outline`,className:`max-w-full`,children:(0,Q.jsx)(fr,{text:e.name})})},`${e.name}:${t}`)}function h6(e){let t=(0,$.c)(39),{pull:n,context:r,projectId:i,checkout:a,onBack:o,onFile:s}=e,c,l,u,d,f;if(t[0]!==s||t[1]!==n.timeline||t[2]!==n.url){let e=kl(n.timeline);c=`Conversation on GitHub`,l=``,u=`mt-8 min-w-0`;let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`h2`,{children:`Conversation`}),t[8]=r):r=t[8];let i;t[9]===n.timeline.length?i=t[10]:(i=(0,Q.jsx)(`span`,{className:`font-normal tabular-nums`,children:n.timeline.length}),t[9]=n.timeline.length,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3 shrink-0`}),t[11]=a):a=t[11];let o;t[12]===n.url?o=t[13]:(o=(0,Q.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex max-w-full min-w-0 items-center gap-1 font-normal outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[`On GitHub`,a]}),t[12]=n.url,t[13]=o),t[14]!==i||t[15]!==o?(d=(0,Q.jsxs)(`div`,{className:R3,children:[r,i,o]}),t[14]=i,t[15]=o,t[16]=d):d=t[16],f=e.length>0?(0,Q.jsx)(`ol`,{"aria-label":`Timeline`,className:Y(`relative mt-3 flex min-w-0 flex-col gap-4`,e.length>1&&`before:absolute before:top-4 before:bottom-2.5 before:left-2.5 before:w-px before:bg-border`),children:e.map(e=>{let{item:t,comments:n}=e;return(0,Q.jsx)(_6,{item:t,onFile:s,children:n.length>0&&(0,Q.jsx)(`ol`,{"aria-label":`Comments on review by ${t.author??`Unknown author`}`,className:`mt-3 flex min-w-0 flex-col gap-3 border-l pl-3`,children:n.map(e=>(0,Q.jsx)(_6,{item:e,onFile:s},e.id))})},t.id)})}):(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No comments or reviews on GitHub yet.`}),t[0]=s,t[1]=n.timeline,t[2]=n.url,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f}else c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];let p;t[17]!==a||t[18]!==r?(p=a&&(0,Q.jsx)(D1,{owner:{scope:a,context:r}}),t[17]=a,t[18]=r,t[19]=p):p=t[19];let m;t[20]!==r||t[21]!==i||t[22]!==n.number||t[23]!==n.repository||t[24]!==p?(m=(0,Q.jsx)(r6,{context:r,projectId:i,number:n.number,repository:n.repository,reviewAction:p}),t[20]=r,t[21]=i,t[22]=n.number,t[23]=n.repository,t[24]=p,t[25]=m):m=t[25];let h;t[26]===n.truncated?h=t[27]:(h=n.truncated&&(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Some labels or conversation items are not shown. Open on GitHub to see everything.`}),t[26]=n.truncated,t[27]=h);let g;t[28]===o?g=t[29]:(g=(0,Q.jsxs)(`p`,{className:`mt-4 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 text-xs leading-4 text-muted-foreground @min-3xl/pr:ml-7.5`,children:[`Questions about the change belong in its Walkthrough.`,(0,Q.jsx)(X,{variant:`link`,size:`sm`,onClick:o,children:`Back to the worktree`})]}),t[28]=o,t[29]=g);let _;return t[30]!==c||t[31]!==l||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==m||t[36]!==h||t[37]!==g?(_=(0,Q.jsxs)(`section`,{"aria-label":c,"data-pr-conversation":l,className:u,children:[d,f,m,h,g]}),t[30]=c,t[31]=l,t[32]=u,t[33]=d,t[34]=f,t[35]=m,t[36]=h,t[37]=g,t[38]=_):_=t[38],_}function g6(e){let t=(0,$.c)(9),{author:n,url:r}=e,i;t[0]===r?i=t[1]:(i=r&&(0,Q.jsx)(z2,{src:r,alt:``}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=n.slice(0,1).toUpperCase(),t[2]=n,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,Q.jsx)(B2,{children:a}),t[4]=a,t[5]=o);let s;return t[6]!==i||t[7]!==o?(s=(0,Q.jsxs)(R2,{size:`sm`,"aria-hidden":`true`,children:[i,o]}),t[6]=i,t[7]=o,t[8]=s):s=t[8],s}function _6(e){let t=(0,$.c)(51),{item:n,onFile:r,children:i}=e,{dark:a}=Xd(),o;t[0]===n.reviewState?o=t[1]:(o=pl(n.reviewState),t[0]=n.reviewState,t[1]=o);let s=o,c=n.author??`Unknown author`,l=n.line??n.originalLine,u=n.path,d=n.path===void 0?void 0:`${n.path}${l===void 0?``:`:${l}`}`,f;t[2]!==c||t[3]!==n.authorAvatarUrl?(f=(0,Q.jsx)(`div`,{className:`z-1 shrink-0 bg-background`,children:(0,Q.jsx)(g6,{author:c,url:n.authorAvatarUrl})}),t[2]=c,t[3]=n.authorAvatarUrl,t[4]=f):f=t[4];let p;t[5]===c?p=t[6]:(p=(0,Q.jsx)(fr,{text:c,className:`text-ui leading-4.5 font-semibold text-foreground`}),t[5]=c,t[6]=p);let m;t[7]===s?m=t[8]:(m=s&&(0,Q.jsx)(Ao,{variant:c6[s.tone],children:s.label}),t[7]=s,t[8]=m);let h=!s&&n.kind===`comment`?`commented · `:``,g;t[9]===n.time?g=t[10]:(g=y6(n.time),t[9]=n.time,t[10]=g);let _;t[11]!==h||t[12]!==g?(_=(0,Q.jsxs)(`span`,{children:[h,g]}),t[11]=h,t[12]=g,t[13]=_):_=t[13];let v;t[14]===n.url?v=t[15]:(v=(0,Q.jsx)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`}),t[14]=n.url,t[15]=v);let y=`Open this ${n.kind===`review`?`review`:`comment`} on GitHub`,b;t[16]!==v||t[17]!==y?(b=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,render:v,"aria-label":y,className:`ml-auto`}),t[16]=v,t[17]=y,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,Q.jsx)(Ze,{render:b,children:x}),t[20]=b,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Yo,{children:`Open on GitHub`}),t[22]=C):C=t[22];let w;t[23]===S?w=t[24]:(w=(0,Q.jsxs)(ot,{children:[S,C]}),t[23]=S,t[24]=w);let T;t[25]!==w||t[26]!==p||t[27]!==m||t[28]!==_?(T=(0,Q.jsxs)(`div`,{className:`flex min-h-5 min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-4 text-muted-foreground`,children:[p,m,_,w]}),t[25]=w,t[26]=p,t[27]=m,t[28]=_,t[29]=T):T=t[29];let E;t[30]!==d||t[31]!==n.path||t[32]!==r||t[33]!==u?(E=d&&(0,Q.jsxs)(`div`,{className:`mt-2.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-t-lg border bg-muted px-2 py-1.5`,children:[r&&n.path!==void 0?(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-label":`Open ${d}`,className:`max-w-full min-w-0 justify-start`,onClick:()=>{u!==void 0&&r(u)},children:[(0,Q.jsx)(Yh,{"aria-hidden":`true`}),(0,Q.jsx)(fr,{text:d})]}):(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-xs`,children:[(0,Q.jsx)(Yh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{text:d})]}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:`review comment`})]}),t[30]=d,t[31]=n.path,t[32]=r,t[33]=u,t[34]=E):E=t[34];let D;t[35]!==a||t[36]!==n.diffHunk||t[37]!==u?(D=n.diffHunk&&(0,Q.jsx)(`div`,{role:`region`,"aria-label":`Code excerpt for ${u??`review comment`}`,className:`max-h-64 min-w-0 overflow-auto border-x`,children:(0,Q.jsx)(cI,{file:{name:u??`review.diff`,contents:n.diffHunk,lang:`diff`},options:{theme:Qu,preferredHighlighter:Gu,themeType:a?`dark`:`light`,disableFileHeader:!0,disableLineNumbers:!0,overflow:`wrap`}})}),t[35]=a,t[36]=n.diffHunk,t[37]=u,t[38]=D):D=t[38];let O;t[39]!==d||t[40]!==n.body?(O=n.body.trim()&&(0,Q.jsx)(cR,{text:n.body,className:Y(`mt-1 text-sm leading-5.5 wrap-anywhere [&_p]:my-0 [&_p]:leading-5.5`,d&&`mt-0 rounded-b-lg border border-t-0 px-3 py-2.5 text-ui [&_p]:leading-4.75`)}),t[39]=d,t[40]=n.body,t[41]=O):O=t[41];let k;t[42]!==i||t[43]!==T||t[44]!==E||t[45]!==D||t[46]!==O?(k=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[T,E,D,O,i]}),t[42]=i,t[43]=T,t[44]=E,t[45]=D,t[46]=O,t[47]=k):k=t[47];let A;return t[48]!==k||t[49]!==f?(A=(0,Q.jsxs)(`li`,{className:`relative flex min-w-0 items-start gap-2.5`,children:[f,k]}),t[48]=k,t[49]=f,t[50]=A):A=t[50],A}function v6(e){let t=(0,$.c)(20),{reason:n,retrying:r,onRetry:i}=e,a=Pc(),o;t[0]===n?o=t[1]:(o=Kc(n),t[0]=n,t[1]=o);let{description:s,action:c}=o,l;t[2]!==i||t[3]!==r?(l=(0,Q.jsx)(X,{variant:`outline`,disabled:r,onClick:i,children:`Try again`}),t[2]=i,t[3]=r,t[4]=l):l=t[4];let u=l;if(c.kind===`settings`){let e;t[5]===a?e=t[6]:(e=()=>void a({to:`/settings/$section`,params:{section:`git`}}),t[5]=a,t[6]=e);let n;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(x_,{}),t[7]=n):n=t[7];let r;t[8]!==c.label||t[9]!==e?(r=(0,Q.jsxs)(X,{variant:`outline`,onClick:e,children:[n,c.label]}),t[8]=c.label,t[9]=e,t[10]=r):r=t[10],u=r}if(c.kind===`install`){let e;t[11]===c.url?e=t[12]:(e=(0,Q.jsx)(`a`,{href:c.url,target:`_blank`,rel:`noreferrer`}),t[11]=c.url,t[12]=e);let n;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(P,{}),t[13]=n):n=t[13];let r;t[14]!==c.label||t[15]!==e?(r=(0,Q.jsxs)(X,{variant:`outline`,render:e,children:[n,c.label]}),t[14]=c.label,t[15]=e,t[16]=r):r=t[16],u=r}let d;return t[17]!==u||t[18]!==s?(d=(0,Q.jsx)(vn,{role:`alert`,message:s,action:u}),t[17]=u,t[18]=s,t[19]=d):d=t[19],d}function y6(e){return Number.isFinite(Date.parse(e))?$a(e,Date.now()):`unknown time`}function b6(e){let t=(0,$.c)(74),{pull:n,context:r,projectId:i,number:a,checkout:o,onOpen:s}=e,{connection:c}=r,{status:l,problem:u,reading:d,refresh:f,pendingReruns:p}=S3(c,i,a),[m,h]=(0,Z.useState)(x6),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>h(n=>{let r=new Set(n);return t??!r.has(e)?r.add(e):r.delete(e),r}),t[0]=g):g=t[0];let _=g,v;t[1]===l?.checks?v=t[2]:(v=e=>{let t=l?.checks.find(t=>t.key===e);(0,th.flushSync)(()=>h(n=>{let r=new Set(n);return r.add(e),t?.kind===`actions`&&t.runId!==void 0&&r.add(`passed:run:${t.runId}`),r}));let n=document.querySelector(P3(e));n?.scrollIntoView({block:`center`}),n?.focus()},t[1]=l?.checks,t[2]=v);let y=v,[b,x]=B(AQ),S;t[3]!==b||t[4]!==a||t[5]!==i||t[6]!==l?(S=l&&b?.projectId===i&&b.number===a?l.checks.find(e=>e.name===b.name):void 0,t[3]=b,t[4]=a,t[5]=i,t[6]=l,t[7]=S):S=t[7];let C=S,w=J2(c,i,a),T;t[8]!==w||t[9]!==l?(T=(e,t)=>{l&&w.rerun(l,e,t)},t[8]=w,t[9]=l,t[10]=T):T=t[10];let E=T,D=E3(c,o),O;t[11]!==o||t[12]!==c||t[13]!==D.walkthrough?(O=u3(o&&D.walkthrough?{connection:c,scope:o,...D.walkthrough}:void 0),t[11]=o,t[12]=c,t[13]=D.walkthrough,t[14]=O):O=t[14];let k=Ot(O),A=l?.headSha??n.headSha,j=k?.headOid===A?k:void 0,M;t[15]!==n||t[16]!==l?(M=l?So(l,n.baseBranch,n.mergeMethods):[],t[15]=n,t[16]=l,t[17]=M):M=t[17];let N=M,P;t[18]===s?P=t[19]:(P=s?e=>s({kind:`walkthrough-step`,step:e}):void 0,t[18]=s,t[19]=P);let F=P,I;t[20]!==y||t[21]!==C||t[22]!==x?(I=C&&(0,Q.jsx)(`span`,{hidden:!0,ref:e=>{e&&queueMicrotask(()=>{x(void 0),y(C.key)})}}),t[20]=y,t[21]=C,t[22]=x,t[23]=I):I=t[23];let L;t[24]!==s||t[25]!==D.walkthroughHead?(L=D.walkthroughHead&&s?{headOid:D.walkthroughHead,onOpen:()=>s({kind:`review`})}:void 0,t[24]=s,t[25]=D.walkthroughHead,t[26]=L):L=t[26];let R;t[27]!==o||t[28]!==j?.callsNeedingCommit?.[0]||t[29]!==j?.undecidedCallStep||t[30]!==F?(R=o&&(0,Q.jsx)(a6,{undecidedCallStep:j?.undecidedCallStep,callNeedingCommit:j?.callsNeedingCommit?.[0],onOpenStep:F}),t[27]=o,t[28]=j?.callsNeedingCommit?.[0],t[29]=j?.undecidedCallStep,t[30]=F,t[31]=R):R=t[31];let z;t[32]!==o||t[33]!==r?(z=o&&(0,Q.jsx)(o6,{checkout:o,context:r}),t[32]=o,t[33]=r,t[34]=z):z=t[34];let V;t[35]===s?V=t[36]:(V=s?e=>s({kind:`branch-file`,path:e}):void 0,t[35]=s,t[36]=V);let H;t[37]!==N||t[38]!==r||t[39]!==y||t[40]!==i||t[41]!==n||t[42]!==k||t[43]!==D.changedSinceReview||t[44]!==l||t[45]!==R||t[46]!==z||t[47]!==V||t[48]!==L?(H=(0,Q.jsx)(n6,{pull:n,status:l,context:r,projectId:i,blockers:N,walkthrough:L,review:k,changedSinceReview:D.changedSinceReview,notes:R,drafts:z,onOpenFile:V,onFocusCheck:y}),t[37]=N,t[38]=r,t[39]=y,t[40]=i,t[41]=n,t[42]=k,t[43]=D.changedSinceReview,t[44]=l,t[45]=R,t[46]=z,t[47]=V,t[48]=L,t[49]=H):H=t[49];let U;t[50]!==u||t[51]!==d||t[52]!==f||t[53]!==l?(U=l&&u&&(0,Q.jsx)(S6,{problem:u,reading:d,onRetry:f,stale:!0}),t[50]=u,t[51]=d,t[52]=f,t[53]=l,t[54]=U):U=t[54];let W;t[55]!==c||t[56]!==a||t[57]!==E||t[58]!==m||t[59]!==F||t[60]!==p||t[61]!==u||t[62]!==i||t[63]!==d||t[64]!==f||t[65]!==w||t[66]!==D.citations||t[67]!==l?(W=l?(0,Q.jsx)(F3,{status:l,connection:c,projectId:i,number:a,controller:{open:m,toggle:_},pendingReruns:p,rerunning:w.pending,onRerun:E,citations:D.citations,onOpenStep:F}):(0,Q.jsxs)(`section`,{"aria-label":`Checks`,className:`mt-8 min-w-0`,children:[(0,Q.jsx)(`div`,{className:R3,children:(0,Q.jsx)(`h2`,{children:`Checks`})}),u&&(0,Q.jsx)(S6,{problem:u,reading:d,onRetry:f,stale:!1})]}),t[55]=c,t[56]=a,t[57]=E,t[58]=m,t[59]=F,t[60]=p,t[61]=u,t[62]=i,t[63]=d,t[64]=f,t[65]=w,t[66]=D.citations,t[67]=l,t[68]=W):W=t[68];let G;return t[69]!==H||t[70]!==U||t[71]!==W||t[72]!==I?(G=(0,Q.jsxs)(Q.Fragment,{children:[I,H,U,W]}),t[69]=H,t[70]=U,t[71]=W,t[72]=I,t[73]=G):G=t[73],G}function x6(){return new Set}function S6(e){let t=(0,$.c)(10),{problem:n,reading:r,onRetry:i,stale:a}=e,o;t[0]===n?o=t[1]:(o=n===`failed`?`The checks could not be read.`:Kc(n).description,t[0]=n,t[1]=o);let s=o,c=a?`Showing the last read. ${s}`:s,l;t[2]===c?l=t[3]:(l=(0,Q.jsx)(`span`,{className:`min-w-0`,children:c}),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==r?(u=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,disabled:r,onClick:i,children:`Try again`}),t[4]=i,t[5]=r,t[6]=u):u=t[6];let d;return t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`p`,{role:`status`,className:`mt-3 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-ui text-muted-foreground`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9],d}function C6(e){let t=(0,$.c)(51),{scope:n,context:r,document:i,onOpen:a,onBrowse:o,sideLabel:s,active:c,hidden:l,base:u,toolbarTarget:d,review:f,walkthroughCode:p,fileTarget:m}=e,h=c!==void 0&&c,g=l!==void 0&&l,_=n.worktreeId,v;t[0]===i?v=t[1]:(v=vZ(i),t[0]=i,t[1]=v);let y;t[2]!==h||t[3]!==m||t[4]!==g||t[5]!==n.worktreeId||t[6]!==v||t[7]!==d?(y={toolbarTarget:d,active:h,worktreeId:_,entry:v,fileTarget:m,hidden:g},t[2]=h,t[3]=m,t[4]=g,t[5]=n.worktreeId,t[6]=v,t[7]=d,t[8]=y):y=t[8];let b;t[9]!==u||t[10]!==r||t[11]!==o||t[12]!==a||t[13]!==n||t[14]!==s||t[15]!==y?(b={base:u,scope:n,context:r,onOpen:a,onBrowse:o,sideLabel:s,interaction:y},t[9]=u,t[10]=r,t[11]=o,t[12]=a,t[13]=n,t[14]=s,t[15]=y,t[16]=b):b=t[16];let x=b;switch(i.kind){case`review`:{let e;return t[17]!==f||t[18]!==x?(e=f?(0,Q.jsx)(f,{...x}):null,t[17]=f,t[18]=x,t[19]=e):e=t[19],e}case`all-changes`:{let e;return t[20]===x?e=t[21]:(e=(0,Q.jsx)(k6,{...x}),t[20]=x,t[21]=e),e}case`specs`:{let e;return t[22]===x?e=t[23]:(e=(0,Q.jsx)(A6,{...x,specsOnly:!0}),t[22]=x,t[23]=e),e}case`change`:{let e;return t[24]!==i.path||t[25]!==x?(e=(0,Q.jsx)(N6,{...x,path:i.path}),t[24]=i.path,t[25]=x,t[26]=e):e=t[26],e}case`file`:{let e;return t[27]!==i.path||t[28]!==x?(e=(0,Q.jsx)(G0,{...x,path:i.path}),t[27]=i.path,t[28]=x,t[29]=e):e=t[29],e}case`commit`:{let e;return t[30]!==i.oid||t[31]!==x?(e=(0,Q.jsx)(w0,{...x,oid:i.oid}),t[30]=i.oid,t[31]=x,t[32]=e):e=t[32],e}case`branch`:{let e;return t[33]===x?e=t[34]:(e=(0,Q.jsx)(p0,{...x}),t[33]=x,t[34]=e),e}case`branch-file`:{let e;return t[35]!==i.path||t[36]!==x?(e=(0,Q.jsx)(m0,{...x,path:i.path}),t[35]=i.path,t[36]=x,t[37]=e):e=t[37],e}case`walkthrough-step`:{let e;return t[38]!==p||t[39]!==i||t[40]!==x?(e=p?(0,Q.jsx)(p,{...x,document:i}):null,t[38]=p,t[39]=i,t[40]=x,t[41]=e):e=t[41],e}case`timeline`:{let e;return t[42]!==i.path||t[43]!==x?(e=(0,Q.jsx)(D6,{...x,path:i.path}),t[42]=i.path,t[43]=x,t[44]=e):e=t[44],e}case`graph`:{let e;return t[45]===x?e=t[46]:(e=(0,Q.jsx)(E6,{...x}),t[45]=x,t[46]=e),e}case`pull-request`:{let e;return t[47]!==r||t[48]!==i||t[49]!==d?(e=(0,Q.jsx)(w6,{document:i,context:r,toolbarTarget:d}),t[47]=r,t[48]=i,t[49]=d,t[50]=e):e=t[50],e}}}function w6(e){let t=(0,$.c)(15),{document:n,context:r,toolbarTarget:i}=e,a=Di(),o=io(),s=n.environmentId??r.connection.environmentId,c;if(t[0]!==s||t[1]!==o){let e;t[3]===s?e=t[4]:(e=e=>e.connection.environmentId===s,t[3]=s,t[4]=e),c=o.find(e),t[0]=s,t[1]=o,t[2]=c}else c=t[2];let l=c,u;t[5]!==s||t[6]!==a||t[7]!==l?(u=s===a.connection.environmentId?a:l&&{connection:l.connection,remoteStatus:ns(s)},t[5]=s,t[6]=a,t[7]=l,t[8]=u):u=t[8];let d=u;if(!d){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`Pair this pull request's computer in Settings to read it.`}),t[9]=e):e=t[9],e}let f;return t[10]!==n||t[11]!==a.connection.environmentId||t[12]!==d||t[13]!==i?(f=(0,Q.jsx)(T6,{document:n,context:d,localEnvironmentId:a.connection.environmentId,toolbarTarget:i}),t[10]=n,t[11]=a.connection.environmentId,t[12]=d,t[13]=i,t[14]=f):f=t[14],f}function T6(e){let t=(0,$.c)(19),{document:n,context:r,localEnvironmentId:i,toolbarTarget:a}=e,o=Pc(),s=KQ(r.connection,n.projectId,n.number),c;t[0]!==s||t[1]!==r.connection||t[2]!==i||t[3]!==o?(c=e=>{if(!s){o({to:`/`});return}let t=s,n={entry:vZ(e)};o(r.connection.environmentId===i?{to:`/$projectId/$worktreeId`,params:t,search:n}:{to:`/remotes/$environmentId/$projectId/$worktreeId`,params:{...t,environmentId:r.connection.environmentId},search:n})},t[0]=s,t[1]=r.connection,t[2]=i,t[3]=o,t[4]=c):c=t[4];let l=c,u;t[5]===l?u=t[6]:(u=()=>l({kind:`review`}),t[5]=l,t[6]=u);let d;t[7]!==s||t[8]!==l?(d=s?e=>l({kind:`file`,path:e}):void 0,t[7]=s,t[8]=l,t[9]=d):d=t[9];let f=s?l:void 0,p;return t[10]!==s||t[11]!==r||t[12]!==n.number||t[13]!==n.projectId||t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==a?(p=(0,Q.jsx)(l6,{projectId:n.projectId,number:n.number,context:r,toolbarTarget:a,onBack:u,onFile:d,checkout:s,onOpen:f}),t[10]=s,t[11]=r,t[12]=n.number,t[13]=n.projectId,t[14]=u,t[15]=d,t[16]=f,t[17]=a,t[18]=p):p=t[18],p}function E6(e){let t=(0,$.c)(7),{scope:n,context:r,onOpen:i,sideLabel:a}=e,o;t[0]===i?o=t[1]:(o=(e,t)=>i({kind:`commit`,oid:e},{toSide:t===!0}),t[0]=i,t[1]=o);let s;return t[2]!==r.connection||t[3]!==n||t[4]!==a||t[5]!==o?(s=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(lX,{scope:n,connection:r.connection,sideLabel:a,onSelect:o})}),t[2]=r.connection,t[3]=n,t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function D6(e){let t=(0,$.c)(17),{scope:n,context:r,path:i,onOpen:a,sideLabel:o}=e,s=`Timeline of ${i}`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(h_,{className:`size-4 shrink-0`}),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[c,(0,Q.jsx)(fr,{text:i})]}),t[1]=i,t[2]=l);let u;t[3]!==s||t[4]!==l?(u=(0,Q.jsx)(Z1,{titleLabel:s,title:l}),t[3]=s,t[4]=l,t[5]=u):u=t[5];let d;t[6]===a?d=t[7]:(d=(e,t)=>a({kind:`commit`,oid:e.oid},{path:e.path,toSide:t===!0}),t[6]=a,t[7]=d);let f;t[8]!==r.connection||t[9]!==i||t[10]!==n||t[11]!==o||t[12]!==d?(f=(0,Q.jsx)(dX,{scope:n,connection:r.connection,path:i,sideLabel:o,onSelect:d}),t[8]=r.connection,t[9]=i,t[10]=n,t[11]=o,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==u||t[15]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,f]}),t[14]=u,t[15]=f,t[16]=p):p=t[16],p}function O6(e,t,n){return(e?void 0:H(t,n))??Vt(t,e?`uncommitted spec change`:`uncommitted change`)}function k6(e){let t=(0,$.c)(11),{connection:n}=e.context,r;t[0]!==n.environmentId||t[1]!==e.scope.projectId||t[2]!==e.scope.worktreeId?(r=fQ(JSON.stringify([n.environmentId,e.scope.projectId,e.scope.worktreeId,`all-changes`])),t[0]=n.environmentId,t[1]=e.scope.projectId,t[2]=e.scope.worktreeId,t[3]=r):r=t[3];let[i,a]=B(r),o;t[4]!==a||t[5]!==i?(o=()=>a(i+25),t[4]=a,t[5]=i,t[6]=o):o=t[6];let s;return t[7]!==e||t[8]!==i||t[9]!==o?(s=(0,Q.jsx)(A6,{...e,limit:i,onReadMore:o}),t[7]=e,t[8]=i,t[9]=o,t[10]=s):s=t[10],s}function A6(e){let t=(0,$.c)(72),{scope:n,context:r,interaction:i,onBrowse:a,onOpen:o,sideLabel:s,specsOnly:c,only:l,heading:u,fullHeight:d,limit:f,onReadMore:p}=e,m=c!==void 0&&c,[h,g]=(0,Z.useState)(!1),{connection:_}=r;YQ(n,r);let v=a2(rB(n,_),i.hidden===!0),y=XQ(n,r,v),b;t[0]!==l||t[1]!==m?(b=e=>l?l.includes(e):!m||ky(e),t[0]=l,t[1]=m,t[2]=b):b=t[2];let x=b,S,C,w,T,E,D,O,k,A,j,M,N,P;if(t[3]!==h||t[4]!==y||t[5]!==r||t[6]!==d||t[7]!==u||t[8]!==x||t[9]!==i||t[10]!==f||t[11]!==v||t[12]!==a||t[13]!==o||t[14]!==l||t[15]!==n||t[16]!==s||t[17]!==m){D=Symbol.for(`react.early_return_sentinel`);bb0:{let e;if(t[31]===x?e=t[32]:(e=e=>x(e.path),t[31]=x,t[32]=e),C=y.filter(e),w=C.length===y.length?v.omittedChanges:void 0,T=f===void 0?C:C.slice(0,f),E=u!==void 0,!m&&C.length===0&&h&&g(!1),l&&C.length===0){let e;t[33]===u?e=t[34]:(e=u&&(0,Q.jsx)(Z1,{inline:!0,title:u.title,titleLabel:u.titleLabel,children:u.after}),t[33]=u,t[34]=e);let n;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(`p`,{className:`p-5 text-prose text-foreground-2`,children:`Nothing uncommitted in this step.`}),t[35]=n):n=t[35];let r;t[36]===e?r=t[37]:(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[e,n]}),t[36]=e,t[37]=r),D=r;break bb0}if(!m&&C.length===0){let e;t[38]!==r||t[39]!==a||t[40]!==o||t[41]!==n||t[42]!==s?(e=(0,Q.jsx)(M6,{scope:n,context:r,onBrowse:a,onOpen:o,sideLabel:s}),t[38]=r,t[39]=a,t[40]=o,t[41]=n,t[42]=s,t[43]=e):e=t[43],D=e;break bb0}P=`flex min-h-0 flex-1 flex-col`,S=d2,O=d,k=n,A=r,j=i,M=f,N=m||l||f!==void 0?{paths:T.map(j6)}:{}}t[3]=h,t[4]=y,t[5]=r,t[6]=d,t[7]=u,t[8]=x,t[9]=i,t[10]=f,t[11]=v,t[12]=a,t[13]=o,t[14]=l,t[15]=n,t[16]=s,t[17]=m,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k,t[26]=A,t[27]=j,t[28]=M,t[29]=N,t[30]=P}else S=t[18],C=t[19],w=t[20],T=t[21],E=t[22],D=t[23],O=t[24],k=t[25],A=t[26],j=t[27],M=t[28],N=t[29],P=t[30];if(D!==Symbol.for(`react.early_return_sentinel`))return D;let F=!E,I;t[44]!==h||t[45]!==C||t[46]!==r||t[47]!==u||t[48]!==w||t[49]!==n||t[50]!==T||t[51]!==E||t[52]!==m?(I=E?{toolbar:e=>(0,Q.jsxs)(Z1,{inline:!0,...u?{title:u.title,titleLabel:u.titleLabel}:{title:`All changes`},subtitle:O6(m,C.length,w),children:[e,u?.after]})}:{header:e=>(0,Q.jsx)(`div`,{className:`pt-6`,children:(0,Q.jsx)(F0,{scope:n,context:r,label:O6(m,C.length,w),items:C,rows:T.length,controls:e,actionsOpen:h,onActionsOpenChange:g,actions:(0,Q.jsx)(s0,{scope:n,context:r,entries:C})})})},t[44]=h,t[45]=C,t[46]=r,t[47]=u,t[48]=w,t[49]=n,t[50]=T,t[51]=E,t[52]=m,t[53]=I):I=t[53];let L;t[54]!==S||t[55]!==F||t[56]!==I||t[57]!==O||t[58]!==k||t[59]!==A||t[60]!==j||t[61]!==M||t[62]!==N?(L=(0,Q.jsx)(S,{fullHeight:O,scope:k,context:A,interaction:j,windowLimit:M,...N,column:F,...I}),t[54]=S,t[55]=F,t[56]=I,t[57]=O,t[58]=k,t[59]=A,t[60]=j,t[61]=M,t[62]=N,t[63]=L):L=t[63];let R;t[64]!==C||t[65]!==p||t[66]!==T?(R=p&&(0,Q.jsx)(Q1,{more:C.length-T.length,total:C.length,pending:!1,onReadMore:p}),t[64]=C,t[65]=p,t[66]=T,t[67]=R):R=t[67];let z;return t[68]!==L||t[69]!==R||t[70]!==P?(z=(0,Q.jsxs)(`div`,{className:P,children:[L,R]}),t[68]=L,t[69]=R,t[70]=P,t[71]=z):z=t[71],z}function j6(e){return e.path}function M6(e){let t=(0,$.c)(16),{scope:n,context:r,onBrowse:i,onOpen:a,sideLabel:o}=e,s,c;t[0]===a?(s=t[1],c=t[2]):(s=(e,t)=>a({kind:`commit`,oid:e},{toSide:t===!0}),c=()=>a({kind:`graph`}),t[0]=a,t[1]=s,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(`span`,{children:`No changes to review.`}),t[3]=l):l=t[3];let u;t[4]===i?u=t[5]:(u=e=>i(`files`,e.currentTarget),t[4]=i,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pH,{children:Ad(ou.surfaceFiles)}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-caption text-muted-foreground`,children:[l,(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,onClick:u,children:[`Files `,d]})]}),t[7]=u,t[8]=f);let p;return t[9]!==r.connection||t[10]!==n||t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==f?(p=(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-(--container-commit) px-4 py-6`,children:(0,Q.jsx)(mX,{scope:n,connection:r.connection,sideLabel:o,onOpenCommit:s,onOpenGraph:c,status:f})})}),t[9]=r.connection,t[10]=n,t[11]=o,t[12]=s,t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function N6(e){let t=(0,$.c)(14),{scope:n,context:r,interaction:i,onOpen:a,path:o}=e,{connection:s}=r;YQ(n,r);let c=rB(n,s),l;if(t[0]===o?l=t[1]:(l=[o],t[0]=o,t[1]=l),!XQ(n,r,c,l).find(e=>e.path===o)){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`This change is no longer present.`}),t[2]=e):e=t[2],e}let u;t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==n?(u=e=>(0,Q.jsx)(d2,{headerActions:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(qQ,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>a({kind:`timeline`,path:o})})}),headerLeading:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,"aria-label":`Open file`,onClick:()=>a({kind:`file`,path:o}),children:[(0,Q.jsx)(rg,{}),(0,Q.jsx)(`span`,{className:`max-narrow:sr-only`,children:`Open file`})]}),e]}),scope:n,context:r,interaction:i,paths:[o]}),t[3]=r,t[4]=i,t[5]=a,t[6]=o,t[7]=n,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==o||t[11]!==n||t[12]!==u?(d=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(UJ,{scope:n,context:r,path:o,variant:`quiet`,children:u})}),t[9]=r,t[10]=o,t[11]=n,t[12]=u,t[13]=d):d=t[13],d}function P6(e){let t=(0,$.c)(65),{scope:n,connection:r,base:i,onBase:a,compact:o}=e,s=o!==void 0&&o,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(``),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{l(e),e||d(``)},t[0]=f):f=t[0];let p=f,m=yB(n,r,c),h=vB(n,r,i),g,_,v,y,b;if(t[1]!==i||t[2]!==m.result||t[3]!==h.result){let e=de(qr(m.result)),n;t[9]===h.result?n=t[10]:(n=de(qr(h.result)),t[9]=h.result,t[10]=n);let r=i??n?.base?.ref,a;t[11]===r?a=t[12]:(a=r===void 0?`the default branch`:Vy(r),t[11]=r,t[12]=a),y=a,_=e?.defaultRef??null,g=i??_,v=new Map((e?.bases??[]).map(L6)),b=[{label:`Local`,remote:!1},{label:`Remote`,remote:!0}].map(t=>{let{label:n,remote:r}=t;return{type:`group`,label:n,items:(e?.bases??[]).filter(e=>e.remote===r).map(I6)}}).filter(F6),t[1]=i,t[2]=m.result,t[3]=h.result,t[4]=g,t[5]=_,t[6]=v,t[7]=y,t[8]=b}else g=t[4],_=t[5],v=t[6],y=t[7],b=t[8];let x=b,S;t[13]!==_||t[14]!==a?(S=e=>{a(e===_?void 0:e),p(!1)},t[13]=_,t[14]=a,t[15]=S):S=t[15];let C=S,w=s?`max-w-24 @min-3xl/pane:max-w-40`:`w-full`,T;t[16]===w?T=t[17]:(T=Y(`justify-between`,w),t[16]=w,t[17]=T);let E=`Compare against ${y}`,D;t[18]!==T||t[19]!==E?(D=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,className:T,"aria-label":E,title:`Choose the branch this one is compared against`}),t[18]=T,t[19]=E,t[20]=D):D=t[20];let O=s&&`hidden @min-3xl/pane:block`,k;t[21]===O?k=t[22]:(k=Y(`size-3.5 shrink-0 text-muted-foreground`,O),t[21]=O,t[22]=k);let A;t[23]===k?A=t[24]:(A=(0,Q.jsx)(_g,{className:k}),t[23]=k,t[24]=A);let j=`Against ${y}`,M=s&&`hidden @min-3xl/pane:inline`,N;t[25]===M?N=t[26]:(N=Y(`text-muted-foreground`,M),t[25]=M,t[26]=N);let P;t[27]===N?P=t[28]:(P=(0,Q.jsxs)(`span`,{className:N,children:[`Against`,` `]}),t[27]=N,t[28]=P);let F;t[29]!==y||t[30]!==j||t[31]!==P?(F=(0,Q.jsxs)(fr,{text:j,children:[P,y]}),t[29]=y,t[30]=j,t[31]=P,t[32]=F):F=t[32];let I;t[33]!==A||t[34]!==F?(I=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[A,F]}),t[33]=A,t[34]=F,t[35]=I):I=t[35];let L;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Th,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[36]=L):L=t[36];let R;t[37]!==I||t[38]!==D?(R=(0,Q.jsxs)(yo,{render:D,children:[I,L]}),t[37]=I,t[38]=D,t[39]=R):R=t[39];let z,B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>p(!1),B=(0,Q.jsx)(LU,{"aria-label":`Find a base branch`,placeholder:`Find a branch`}),t[40]=z,t[41]=B):(z=t[40],B=t[41]);let V;t[42]===m.result?V=t[43]:(V=Xi(m.result)&&(0,Q.jsx)(`p`,{className:`p-3`,children:(0,Q.jsx)(Be,{label:`Reading branches`})}),t[42]=m.result,t[43]=V);let H;t[44]!==m.refresh||t[45]!==m.result?(H=Mi(m.result)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-center gap-2 py-6 text-xs/relaxed text-muted-foreground`,children:[`Branches could not be read.`,(0,Q.jsx)(X,{variant:`link`,size:`flush`,onClick:m.refresh,children:`Try again`})]}),t[44]=m.refresh,t[45]=m.result,t[46]=H):H=t[46];let U;t[47]===m.result?U=t[48]:(U=Bo(m.result)&&(0,Q.jsx)(zU,{children:`No matching branch`}),t[47]=m.result,t[48]=U);let W;t[49]!==C||t[50]!==g||t[51]!==_||t[52]!==v?(W=(0,Q.jsx)(RU,{"aria-label":`Base branches`,children:e=>e.items.map(e=>typeof e==`object`&&`type`in e&&e.type===`group`?(0,Q.jsx)(BU,{heading:e.label,children:e.items.map(e=>{let t=typeof e==`string`?e:e.value,n=v.get(t);return n&&(0,Q.jsxs)(VU,{value:n.ref,label:n.name,"data-checked":n.ref===g,onSelect:()=>C(n.ref),children:[(0,Q.jsx)(fr,{text:n.name}),n.ref===_&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`default`})]},n.ref)})},e.label):null)}),t[49]=C,t[50]=g,t[51]=_,t[52]=v,t[53]=W):W=t[53];let G;t[54]!==x||t[55]!==u||t[56]!==V||t[57]!==H||t[58]!==U||t[59]!==W?(G=(0,Q.jsx)(Zo,{align:`start`,className:`w-72`,children:(0,Q.jsxs)(FU,{items:x,query:u,onQueryChange:d,onEscape:z,children:[B,V,H,U,W]})}),t[54]=x,t[55]=u,t[56]=V,t[57]=H,t[58]=U,t[59]=W,t[60]=G):G=t[60];let K;return t[61]!==c||t[62]!==R||t[63]!==G?(K=(0,Q.jsxs)(uo,{open:c,onOpenChange:p,children:[R,G]}),t[61]=c,t[62]=R,t[63]=G,t[64]=K):K=t[64],K}function F6(e){return e.items.length>0}function I6(e){return{value:e.ref,label:e.name}}function L6(e){return[e.ref,e]}function R6(e,t){let n=(0,$.c)(6),r;n[0]===e?r=n[1]:(r=K(e),n[0]=e,n[1]=r);let i;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promiseExit`},n[2]=i):i=n[2];let a=Da(r,i),o;return n[3]!==a||n[4]!==t?(o=e=>{a(t).then(t=>{ne(t)&&e()})},n[3]=a,n[4]=t,n[5]=o):o=n[5],o}var z6=class extends Z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let e=this.state.error;return e instanceof Error&&e.name===`CommitNotFoundError`?(0,Q.jsx)(vn,{message:`This commit is not in this repository.`}):e?(0,Q.jsx)(gt,{description:ly(e,this.props.subject),onRetry:()=>this.props.reset(()=>this.setState({error:null}))}):this.props.children}};function B6(e){let t=(0,$.c)(12),{children:n,connection:r,scope:i,quiet:a,documentKey:o}=e,s=a!==void 0&&a,c=R6(r,i),l;t[0]===s?l=t[1]:(l=s?null:(0,Q.jsx)(kc,{label:`Loading review`}),t[0]=s,t[1]=l);let u;t[2]===o?u=t[3]:(u=bZ(yZ(o)),t[2]=o,t[3]=u);let d;t[4]!==n||t[5]!==o||t[6]!==c||t[7]!==u?(d=(0,Q.jsx)(z6,{subject:u,reset:c,children:n},o),t[4]=n,t[5]=o,t[6]=c,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,Q.jsx)(Z.Suspense,{fallback:l,children:d}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f}var V6=L([`changes`,`files`,`history`]),H6=L([`uncommitted`,`branch`]),U6=ar(ee.check(D(mt))).pipe(Tt(()=>Ja(Zn(void 0)))),W6=Ut({surface:ar(V6).pipe(Tt(()=>Ja(Zn(void 0)))),entry:U6,side:U6,scope:ar(H6).pipe(Tt(()=>Ja(Zn(void 0)))),base:U6}),G6=_t(V6);function K6(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({layout:n,onSurface:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=Y6(),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=e=>(0,Q.jsx)(Z6,{...i,actionsTarget:e}),t[5]=i,t[6]=o);let s;return t[7]!==n||t[8]!==r||t[9]!==i.surface||t[10]!==o?(s=(0,Q.jsx)(q6,{layout:n,surfaces:J6,names:a,published:!1,surface:i.surface,onSurface:r,children:o}),t[7]=n,t[8]=r,t[9]=i.surface,t[10]=o,t[11]=s):s=t[11],s}function q6(e){let t=(0,$.c)(19),{layout:n,surfaces:r,names:i,published:a,surface:o,onSurface:s,children:c}=e,{element:l,attach:u}=hH(),d;t[0]===u?d=t[1]:(d=(0,Q.jsx)(`div`,{ref:u,className:`ml-auto flex shrink-0 items-center gap-0.5`}),t[0]=u,t[1]=d);let f=d,p;t[2]!==l||t[3]!==c?(p=c(l),t[2]=l,t[3]=c,t[4]=p):p=t[4];let m=p,h=n===`docked`&&`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-1 duration-150`,g;t[5]===h?g=t[6]:(g=Y(`flex h-full min-h-0 flex-col overflow-hidden rounded-paper bg-card shadow-paper`,h),t[5]=h,t[6]=g);let _;t[7]!==m||t[8]!==n||t[9]!==i||t[10]!==s||t[11]!==a||t[12]!==o||t[13]!==r||t[14]!==f?(_=n===`docked`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-1 border-b pr-2.5 pl-4`,children:[(0,Q.jsx)(fr,{className:`text-ui leading-5 font-semibold`,render:(0,Q.jsx)(`h2`,{}),text:i[o]}),f]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 text-sm`,children:m})]}):(0,Q.jsxs)(Nu,{value:o,onValueChange:e=>{G6(e)&&s(e)},className:`min-h-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-1 border-b px-1.5`,children:[(0,Q.jsx)(kd,{className:`h-8 min-w-0 flex-1`,children:r.map(e=>(0,Q.jsx)(fr,{propagateEscape:!0,text:i[e],renderTrigger:t=>(0,Q.jsxs)(hd,{value:e,className:`min-w-0`,children:[(0,Q.jsx)(X6,{published:a,surface:e,className:`size-3.5 shrink-0`}),t]})},e))}),f]}),(0,Q.jsx)(Vu,{value:o,className:`min-h-0 overflow-hidden`,children:m})]}),t[7]=m,t[8]=n,t[9]=i,t[10]=s,t[11]=a,t[12]=o,t[13]=r,t[14]=f,t[15]=_):_=t[15];let v;return t[16]!==g||t[17]!==_?(v=(0,Q.jsx)(`aside`,{"aria-label":`Review sidebar`,"data-testid":`review-sidebar`,className:g,children:_}),t[16]=g,t[17]=_,t[18]=v):v=t[18],v}var J6=[`files`,`changes`,`history`];function Y6(){return CZ}function X6(e){let t=(0,$.c)(7),{published:n,surface:r,className:i}=e;if(r===`files`){let e;return t[0]===i?e=t[1]:(e=(0,Q.jsx)(pg,{className:i}),t[0]=i,t[1]=e),e}if(r===`history`){let e;return t[2]===i?e=t[3]:(e=(0,Q.jsx)(h_,{className:i}),t[2]=i,t[3]=e),e}let a;return t[4]!==i||t[5]!==n?(a=n?(0,Q.jsx)(Lg,{className:i}):(0,Q.jsx)(Zh,{className:i}),t[4]=i,t[5]=n,t[6]=a):a=t[6],a}function Z6(e){let t=(0,$.c)(38),{changesNavigation:n,scope:r,context:i,worktreePath:a,surface:o,activeEntry:s,available:c,onOpen:l,onFilesMoved:u,onFilesRemoved:d,sideLabel:f,changes:p,actionsTarget:m}=e;if(!c){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`div`,{className:`p-3`,children:(0,Q.jsx)(vn,{message:`This worktree is unavailable.`})}),t[0]=e):e=t[0],e}let h=`${r.worktreeId}:${o}`,g;t[1]!==n||t[2]!==s||t[3]!==p||t[4]!==i||t[5]!==l||t[6]!==r||t[7]!==f||t[8]!==o?(g=o===`changes`&&(0,Q.jsx)(n,{scope:r,context:i,activeEntry:s,onOpen:l,sideLabel:f,changeScope:p.scope,base:p.base,onChangeScope:p.onScope,onBase:p.onBase}),t[1]=n,t[2]=s,t[3]=p,t[4]=i,t[5]=l,t[6]=r,t[7]=f,t[8]=o,t[9]=g):g=t[9];let _;t[10]!==m||t[11]!==s||t[12]!==i||t[13]!==u||t[14]!==d||t[15]!==l||t[16]!==r||t[17]!==f||t[18]!==o||t[19]!==a?(_=o===`files`&&(0,Q.jsx)(yq,{scope:r,context:i,worktreePath:a,selected:s?.startsWith(`file:`)?s.slice(5):``,onOpen:l,onMoved:u,onTrashed:d,sideLabel:f,actionsTarget:m}),t[10]=m,t[11]=s,t[12]=i,t[13]=u,t[14]=d,t[15]=l,t[16]=r,t[17]=f,t[18]=o,t[19]=a,t[20]=_):_=t[20];let v;t[21]!==s||t[22]!==i.connection||t[23]!==l||t[24]!==r||t[25]!==f||t[26]!==o?(v=o===`history`&&(0,Q.jsx)(aX,{scope:r,connection:i.connection,selected:s?.startsWith(`commit:`)?s.slice(7):``,onSelect:(e,t)=>l({kind:`commit`,oid:e},{toSide:t===!0,preserveFocus:!0}),sideLabel:f,onOpenGraph:()=>l({kind:`graph`}),onOpenChanges:()=>l(pZ)}),t[21]=s,t[22]=i.connection,t[23]=l,t[24]=r,t[25]=f,t[26]=o,t[27]=v):v=t[27];let y;t[28]!==i.connection||t[29]!==r||t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==v?(y=(0,Q.jsxs)(B6,{connection:i.connection,scope:r,quiet:!0,children:[g,_,v]},h),t[28]=i.connection,t[29]=r,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y):y=t[34];let b=y,x;return t[35]!==b||t[36]!==o?(x=o===`changes`?(0,Q.jsx)(JV,{className:`h-full`,children:b}):(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:b}),t[35]=b,t[36]=o,t[37]=x):x=t[37],x}var Q6={files:ou.surfaceFiles,changes:ou.surfaceChanges,history:ou.surfaceHistory};function $6(e){let t=(0,$.c)(32),{surfaces:n,names:r,published:i,surface:a,open:o,onSelect:s,onHide:c,onToggle:l,toggleRef:u}=e,d=o?`Hide side panel`:`Show side panel`,f;if(t[0]!==r||t[1]!==c||t[2]!==s||t[3]!==o||t[4]!==i||t[5]!==a||t[6]!==n){let e;t[8]!==r||t[9]!==c||t[10]!==s||t[11]!==o||t[12]!==i||t[13]!==a?(e=e=>{let t=o&&a===e;return(0,Q.jsx)(`span`,{"data-selected":t||void 0,className:`workspace-choice inline-flex rounded-lg data-selected:text-foreground`,children:(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":r[e],"aria-pressed":t,"aria-keyshortcuts":Q6[e],onClick:()=>t?c():s(e)}),children:(0,Q.jsx)(X6,{published:i,surface:e})}),(0,Q.jsxs)(Yo,{side:`left`,children:[r[e],` `,(0,Q.jsx)(pH,{children:Ad(Q6[e])})]})]})},e)},t[8]=r,t[9]=c,t[10]=s,t[11]=o,t[12]=i,t[13]=a,t[14]=e):e=t[14],f=n.map(e),t[0]=r,t[1]=c,t[2]=s,t[3]=o,t[4]=i,t[5]=a,t[6]=n,t[7]=f}else f=t[7];let p;t[15]!==l||t[16]!==o||t[17]!==d||t[18]!==u?(p=(0,Q.jsx)(X,{ref:u,variant:`ghost`,size:`icon`,className:`mt-auto`,"aria-label":d,"aria-expanded":o,"aria-keyshortcuts":ou.toggleSidebar,onClick:l}),t[15]=l,t[16]=o,t[17]=d,t[18]=u,t[19]=p):p=t[19];let m;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(a_,{}),t[20]=m):m=t[20];let h;t[21]===p?h=t[22]:(h=(0,Q.jsx)(Ze,{render:p,children:m}),t[21]=p,t[22]=h);let g;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(pH,{children:Ad(ou.toggleSidebar)}),t[23]=g):g=t[23];let _;t[24]===d?_=t[25]:(_=(0,Q.jsxs)(Yo,{side:`left`,children:[d,` `,g]}),t[24]=d,t[25]=_);let v;t[26]!==h||t[27]!==_?(v=(0,Q.jsxs)(ot,{children:[h,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;return t[29]!==f||t[30]!==v?(y=(0,Q.jsxs)(`nav`,{"aria-label":`Side panel`,className:`flex w-11 shrink-0 flex-col items-center gap-1 pt-2.5 pb-2 pl-1 text-muted-foreground`,children:[f,v]}),t[29]=f,t[30]=v,t[31]=y):y=t[31],y}function e8(e){let t=(0,$.c)(184),{worktree:n,projectId:r,search:i,onSearch:a,context:o,navigationTrigger:s,review:c,changesNavigation:l,walkthroughCode:u,firstDocument:d}=e,{open:f,setOpen:p}=SQ(),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!0),[v,y]=(0,Z.useState)(m);m!==v&&(y(m),m&&_(!0));let b=uZ(),[x,S]=(0,Z.useState)(b);x!==b&&(S(b),b&&m&&(p(!0),h(!1)));let C=hH(),w=hH(),T=hH(),{isMobile:E,open:D,openMobile:O}=BH(),k=i.surface??(d.guided?`changes`:`files`),A;t[0]!==r||t[1]!==n.id?(A={projectId:r,worktreeId:n.id},t[0]=r,t[1]=n.id,t[2]=A):A=t[2];let j=A,{saved:M,focused:N,setFocused:P}=uQ(n.id),F=iB(j,o.connection),I=vB(d.guided&&i.scope===void 0?j:void 0,o.connection,i.base).result,L=de(qr(I))?.files.length===0&&(de(qr(F))?.changes.length??0)>0,R;t[3]===F?R=t[4]:(R=r8(F),t[3]=F,t[4]=R);let z=R,B;t[5]!==M||t[6]!==i.entry||t[7]!==i.side?(B=!M&&!yZ(i.entry)&&!yZ(i.side),t[5]=M,t[6]=i.entry,t[7]=i.side,t[8]=B):B=t[8];let V=B,H=!V||!z&&!d.pending,U=d.guided||Mi(F)&&Fe(qr(F))||(de(qr(F))?.changes.length??0)>0?DZ:null,W=m&&!b,G;t[9]!==U||t[10]!==N||t[11]!==T.element||t[12]!==a||t[13]!==H||t[14]!==i.entry||t[15]!==i.side||t[16]!==P||t[17]!==W||t[18]!==n.id?(G={worktreeId:n.id,entry:i.entry,side:i.side,onSearch:a,fallback:U,focused:N,setFocused:P,ready:H,focusBoundary:T.element,focusBoundaryOpen:W},t[9]=U,t[10]=N,t[11]=T.element,t[12]=a,t[13]=H,t[14]=i.entry,t[15]=i.side,t[16]=P,t[17]=W,t[18]=n.id,t[19]=G):G=t[19];let K=MQ(G),q;t[20]!==N||t[21]!==K.split?(q=JZ(o8(K.split,N)),t[20]=N,t[21]=K.split,t[22]=q):q=t[22];let ee=q,J;t[23]!==f||t[24]!==C||t[25]!==p?(J=()=>{f&&C.element?.focus(),p(n8)},t[23]=f,t[24]=C,t[25]=p,t[26]=J):J=t[26];let te=J,ne;t[27]!==b||t[28]!==te?(ne=()=>{b?te():h(t8)},t[27]=b,t[28]=te,t[29]=ne):ne=t[29];let re;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(re={ignoreInputs:!0},t[30]=re):re=t[30],Hu(ou.toggleSidebar,ne,re);let[ie,ae]=(0,Z.useState)(),oe;t[31]!==b||t[32]!==N||t[33]!==K?(oe=(e,t)=>{let n=vZ(e),r=+(N===0),i=t?.toSide?r:K.open(N,n,t?.preserveFocus===!0&&b);ae(t?.path?{path:t.path,entry:t.entry,nonce:Date.now(),pane:i,key:n}:void 0),t?.toSide&&K.openToSide(N,n),_(!1),h(!1)},t[31]=b,t[32]=N,t[33]=K,t[34]=oe):oe=t[34];let se=oe,ce;t[35]===a?ce=t[36]:(ce=e=>{a({surface:e})},t[35]=a,t[36]=ce);let le=ce,ue;t[37]!==b||t[38]!==p||t[39]!==le?(ue=e=>{le(e),b?p(!0):h(!0)},t[37]=b,t[38]=p,t[39]=le,t[40]=ue):ue=t[40];let fe=ue,pe;t[41]===fe?pe=t[42]:(pe=()=>fe(`changes`),t[41]=fe,t[42]=pe);let me;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(me={ignoreInputs:!0},t[43]=me):me=t[43],Hu(ou.surfaceChanges,pe,me);let he;t[44]===fe?he=t[45]:(he=()=>fe(`files`),t[44]=fe,t[45]=he);let ge;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ge={ignoreInputs:!0},t[46]=ge):ge=t[46],Hu(ou.surfaceFiles,he,ge);let _e;t[47]===fe?_e=t[48]:(_e=()=>fe(`history`),t[47]=fe,t[48]=_e);let ve;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ve={ignoreInputs:!0},t[49]=ve):ve=t[49],Hu(ou.surfaceHistory,_e,ve);let ye=hH(),be;t[50]!==ye||t[51]!==fe?(be=(e,t)=>{ye.attach(t),fe(e)},t[50]=ye,t[51]=fe,t[52]=be):be=t[52];let xe=be,Se=i.scope??(d.guided&&!L?`branch`:`uncommitted`),Ce=b&&f&&k===`changes`&&Se===`branch`,we,Te;t[53]===a?(we=t[54],Te=t[55]):(we=e=>a({scope:e}),Te=e=>a({base:e}),t[53]=a,t[54]=we,t[55]=Te);let Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Ie,Le,Re,ze;if(t[56]!==xe||t[57]!==ye||t[58]!==Se||t[59]!==l||t[60]!==o||t[61]!==b||t[62]!==ie||t[63]!==d||t[64]!==N||t[65]!==K||t[66]!==m||t[67]!==T||t[68]!==w||t[69]!==s||t[70]!==E||t[71]!==D||t[72]!==O||t[73]!==V||t[74]!==a||t[75]!==se||t[76]!==F||t[77]!==f||t[78]!==C||t[79]!==c||t[80]!==j||t[81]!==i.base||t[82]!==p||t[83]!==le||t[84]!==g||t[85]!==fe||t[86]!==ee||t[87]!==k||t[88]!==Ce||t[89]!==we||t[90]!==Te||t[91]!==te||t[92]!==u||t[93]!==n.available||t[94]!==n.branch||t[95]!==n.path){let e={scope:Se,baseInPanel:Ce,onScope:we,onBase:Te},r=K.panes[N]?.active??void 0,_=t=>(0,Q.jsx)(K6,{changesNavigation:l,layout:t,scope:j,context:o,worktreePath:n.path,surface:k,activeEntry:r,available:n.available,onSurface:le,onOpen:se,onFilesMoved:(e,t)=>K.moveFiles(e,t),onFilesRemoved:e=>K.closeRemovedFiles(e),sideLabel:ee,changes:{...e,base:i.base,onBase:e=>a({base:e})}}),v;t[109]!==ye||t[110]!==o||t[111]!==b||t[112]!==K||t[113]!==m||t[114]!==w||t[115]!==j?(v=e=>(0,Q.jsxs)(`div`,{"data-review-controls":``,className:`contents`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-5 w-px bg-border`}),(0,Q.jsx)(aZ,{scope:j,context:o}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,ref:e=>w.attach(e),className:`xl:hidden`,"aria-label":`Side panel`,"aria-haspopup":`dialog`,"aria-expanded":m&&!b,"aria-keyshortcuts":ou.toggleSidebar,onClick:()=>{ye.attach(null),K.selectPane(e),h(!0)},children:(0,Q.jsx)(a_,{})})}),(0,Q.jsxs)(Yo,{role:`tooltip`,className:`break-all`,children:[`Side panel `,(0,Q.jsx)(pH,{children:Ad(ou.toggleSidebar)})]})]})]}),t[109]=ye,t[110]=o,t[111]=b,t[112]=K,t[113]=m,t[114]=w,t[115]=j,t[116]=v):v=t[116];let y=v,x;t[117]===se?x=t[118]:(x=e=>se({kind:`file`,path:e}),t[117]=se,t[118]=x),t[119]!==o.connection||t[120]!==K.bindQuickOpen||t[121]!==K.recentFiles||t[122]!==j||t[123]!==x?(Re=(0,Q.jsx)(Kq,{bindPopup:K.bindQuickOpen,openFiles:K.recentFiles,scope:j,connection:o.connection,onOpen:x}),t[119]=o.connection,t[120]=K.bindQuickOpen,t[121]=K.recentFiles,t[122]=j,t[123]=x,t[124]=Re):Re=t[124];let S=E?0:480,A;t[125]!==o||t[126]!==j?(A=(0,Q.jsx)(wJ,{scope:j,context:o}),t[125]=o,t[126]=j,t[127]=A):A=t[127];let M;t[128]!==o||t[129]!==se||t[130]!==j?(M=(0,Q.jsx)(TJ,{scope:j,context:o,onOpen:se}),t[128]=o,t[129]=se,t[130]=j,t[131]=M):M=t[131];let P;t[132]===n.branch?P=t[133]:(P=yt(n.branch),t[132]=n.branch,t[133]=P);let I=(0,Q.jsxs)(`section`,{"aria-label":`Review content`,className:`flex h-full min-w-0 flex-col overflow-hidden rounded-paper border bg-card max-md:rounded-none max-md:border-0`,children:[A,M,(0,Q.jsx)(i8,{worktreeName:P,review:c,walkthroughCode:u,firstDocument:d,changesNavigation:l,fileTarget:ie,scope:j,context:o,overview:F,needsDefault:V,layout:K,base:i.base,changes:e,focused:N,onOpen:se,onBrowse:xe,navigationTrigger:s,navigatorIsMobile:E,navigatorOpen:D,navigatorOpenMobile:O,tabControls:y})]}),L;t[134]!==S||t[135]!==I?(L=(0,Q.jsx)(PK,{id:`review-document`,minSize:S,children:I}),t[134]=S,t[135]=I,t[136]=L):L=t[136];let R=f&&b&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(FK,{"aria-label":`Document panes and side panel`,className:`w-2 bg-transparent after:w-2`}),(0,Q.jsx)(PK,{id:`review-sidebar`,defaultSize:320,minSize:260,maxSize:520,children:_(`docked`)})]}),z;t[137]!==L||t[138]!==R?(z=(0,Q.jsxs)(NK,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[L,R]}),t[137]=L,t[138]=R,t[139]=z):z=t[139];let B;t[140]!==b||t[141]!==f||t[142]!==C||t[143]!==p||t[144]!==fe||t[145]!==k||t[146]!==te?(B=b&&(0,Q.jsx)($6,{surfaces:J6,names:Y6(),published:!1,surface:k,open:f,onSelect:fe,onHide:()=>p(!1),onToggle:te,toggleRef:e=>C.attach(e)}),t[140]=b,t[141]=f,t[142]=C,t[143]=p,t[144]=fe,t[145]=k,t[146]=te,t[147]=B):B=t[147],t[148]!==z||t[149]!==B?(ze=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[z,B]}),t[148]=z,t[149]=B,t[150]=ze):ze=t[150],De=EH,Pe=m&&!b,Ie=h,t[151]!==ye.element||t[152]!==K||t[153]!==w.element||t[154]!==g?(Le=e=>{e||(K.focusDestination(),!g&&!K.hasDestinationFocus()&&document.activeElement===document.body&&(ye.element?.isConnected?ye.element:w.element)?.focus())},t[151]=ye.element,t[152]=K,t[153]=w.element,t[154]=g,t[155]=Le):Le=t[155],Ee=OH,t[156]!==K||t[157]!==T?(Oe=e=>{T.attach(e),e===null&&K.focusDestination()},t[156]=K,t[157]=T,t[158]=Oe):Oe=t[158],t[159]!==ye.element||t[160]!==K||t[161]!==T.element||t[162]!==w.element||t[163]!==g?(ke=g?()=>{if(K.hasDestinationFocus())return null;let e=document.activeElement;return e===document.body||T.element?.contains(e)?ye.element?.isConnected?ye.element:w.element:null}:`none`,t[159]=ye.element,t[160]=K,t[161]=T.element,t[162]=w.element,t[163]=g,t[164]=ke):ke=t[164],Ae=`w-[min(90vw,22rem)]!`,je=!1,t[165]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,Q.jsxs)(kH,{className:`sr-only`,children:[(0,Q.jsx)(AH,{children:`Worktree review`}),(0,Q.jsx)(jH,{children:`Choose a review surface and open a document.`})]}),t[165]=Me):Me=t[165],Ne=!b&&_(`sheet`),t[56]=xe,t[57]=ye,t[58]=Se,t[59]=l,t[60]=o,t[61]=b,t[62]=ie,t[63]=d,t[64]=N,t[65]=K,t[66]=m,t[67]=T,t[68]=w,t[69]=s,t[70]=E,t[71]=D,t[72]=O,t[73]=V,t[74]=a,t[75]=se,t[76]=F,t[77]=f,t[78]=C,t[79]=c,t[80]=j,t[81]=i.base,t[82]=p,t[83]=le,t[84]=g,t[85]=fe,t[86]=ee,t[87]=k,t[88]=Ce,t[89]=we,t[90]=Te,t[91]=te,t[92]=u,t[93]=n.available,t[94]=n.branch,t[95]=n.path,t[96]=Ee,t[97]=De,t[98]=Oe,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne,t[104]=Pe,t[105]=Ie,t[106]=Le,t[107]=Re,t[108]=ze}else Ee=t[96],De=t[97],Oe=t[98],ke=t[99],Ae=t[100],je=t[101],Me=t[102],Ne=t[103],Pe=t[104],Ie=t[105],Le=t[106],Re=t[107],ze=t[108];let Be;t[166]!==Ee||t[167]!==Oe||t[168]!==ke||t[169]!==Ae||t[170]!==je||t[171]!==Me||t[172]!==Ne?(Be=(0,Q.jsxs)(Ee,{ref:Oe,finalFocus:ke,className:Ae,showCloseButton:je,children:[Me,Ne]}),t[166]=Ee,t[167]=Oe,t[168]=ke,t[169]=Ae,t[170]=je,t[171]=Me,t[172]=Ne,t[173]=Be):Be=t[173];let Ve;t[174]!==De||t[175]!==Pe||t[176]!==Ie||t[177]!==Le||t[178]!==Be?(Ve=(0,Q.jsx)(De,{open:Pe,onOpenChange:Ie,onOpenChangeComplete:Le,children:Be}),t[174]=De,t[175]=Pe,t[176]=Ie,t[177]=Le,t[178]=Be,t[179]=Ve):Ve=t[179];let He;return t[180]!==Re||t[181]!==ze||t[182]!==Ve?(He=(0,Q.jsxs)(Q.Fragment,{children:[Re,ze,Ve]}),t[180]=Re,t[181]=ze,t[182]=Ve,t[183]=He):He=t[183],He}function t8(e){return!e}function n8(e){return!e}function r8(e){return Fe(qr(e))&&!Mi(e)}function i8(e){let t=(0,$.c)(3),n=r8(e.overview);if(e.needsDefault&&(n||e.firstDocument.pending)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Loading review`}),t[0]=e):e=t[0],e}let r;return t[1]===e?r=t[2]:(r=(0,Q.jsx)(a8,{...e}),t[1]=e,t[2]=r),r}function a8(e){let t=(0,$.c)(52),{review:n,changesNavigation:r,walkthroughCode:i,firstDocument:a,layout:o,fileTarget:s,scope:c,context:l,base:u,changes:d,focused:f,onOpen:p,onBrowse:m,navigationTrigger:h,navigatorIsMobile:g,navigatorOpen:_,navigatorOpenMobile:v,worktreeName:y,tabControls:b}=e,x;t[0]!==f||t[1]!==o.panes?(x=o.panes[f]??{tabs:[],pinned:[],active:null},t[0]=f,t[1]=o.panes,t[2]=x):x=t[2];let S=x,C=BR()&&(o.split||f===0),w;t[3]===C?w=t[4]:(w={ignoreInputs:!0,enabled:C},t[3]=C,t[4]=w);let T=w,E;t[5]!==f||t[6]!==o?(E=()=>o.step(f,1),t[5]=f,t[6]=o,t[7]=E):E=t[7],Hu(ou.nextTab,E,T);let D;t[8]!==f||t[9]!==o?(D=()=>o.step(f,-1),t[8]=f,t[9]=o,t[10]=D):D=t[10],Hu(ou.previousTab,D,T);let O;t[11]!==f||t[12]!==S.active||t[13]!==o?(O=()=>S.active!==null&&S.active!==void 0&&o.close(f,S.active),t[11]=f,t[12]=S.active,t[13]=o,t[14]=O):O=t[14],Hu(ou.closeTab,O,T);let k;t[15]!==f||t[16]!==S.active||t[17]!==o?(k=()=>S.active!==null&&S.active!==void 0&&o.openToSide(f,S.active),t[15]=f,t[16]=S.active,t[17]=o,t[18]=k):k=t[18],Hu(ou.openToSide,k,T);let A;t[19]!==u||t[20]!==d||t[21]!==r||t[22]!==l||t[23]!==s||t[24]!==a||t[25]!==f||t[26]!==o||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==m||t[32]!==p||t[33]!==n||t[34]!==c||t[35]!==b||t[36]!==i||t[37]!==y?(A=e=>({review:n,changesNavigation:r,walkthroughCode:i,firstDocument:a,fileTarget:s,index:e,layout:o,split:o.split,focused:f===e,scope:c,context:l,base:u,changes:d,onOpen:p,onBrowse:m,navigationTrigger:h,navigatorIsMobile:g,navigatorOpen:_,navigatorOpenMobile:v,worktreeName:y,tabControls:b}),t[19]=u,t[20]=d,t[21]=r,t[22]=l,t[23]=s,t[24]=a,t[25]=f,t[26]=o,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=m,t[32]=p,t[33]=n,t[34]=c,t[35]=b,t[36]=i,t[37]=y,t[38]=A):A=t[38];let j=A,M=g?`vertical`:`horizontal`,N=g?200:320,P;t[39]===j?P=t[40]:(P=(0,Q.jsx)(s8,{...j(0)}),t[39]=j,t[40]=P);let F;t[41]!==N||t[42]!==P?(F=(0,Q.jsx)(PK,{id:`pane-left`,minSize:N,children:P}),t[41]=N,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==o.split||t[45]!==g||t[46]!==j?(I=o.split&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(FK,{"aria-label":g?`Top and bottom document panes`:`Left and right document panes`,withHandle:!0}),(0,Q.jsx)(PK,{id:`pane-right`,minSize:g?200:320,children:(0,Q.jsx)(s8,{...j(1)})})]}),t[44]=o.split,t[45]=g,t[46]=j,t[47]=I):I=t[47];let L;return t[48]!==F||t[49]!==I||t[50]!==M?(L=(0,Q.jsxs)(NK,{orientation:M,className:`min-h-0 flex-1`,children:[F,I]}),t[48]=F,t[49]=I,t[50]=M,t[51]=L):L=t[51],L}function o8(e,t){return e?t===0?`left`:`right`:null}function s8(e){let t=(0,$.c)(102),{review:n,walkthroughCode:r,firstDocument:i,fileTarget:a,index:o,layout:s,split:c,focused:l,scope:u,context:d,base:f,changes:p,onOpen:m,onBrowse:h,navigationTrigger:g,navigatorIsMobile:_,navigatorOpen:v,navigatorOpenMobile:y,worktreeName:b,tabControls:x}=e,{element:S,attach:C}=hH(),w;t[0]!==o||t[1]!==s.panes?(w=s.panes[o]??{tabs:[],pinned:[],active:null},t[0]=o,t[1]=s.panes,t[2]=w):w=t[2];let T=w,E=(0,Z.useDeferredValue)(T.active),D=yZ(T.active??void 0),O;t[3]!==E||t[4]!==T.active||t[5]!==T.tabs||t[6]!==D?.kind?(O=D?.kind!==`file`&&D?.kind!==`change`&&T.tabs.includes(E??``)?E:T.active,t[3]=E,t[4]=T.active,t[5]=T.tabs,t[6]=D?.kind,t[7]=O):O=t[7];let k=O,A=k!==T.active,j=(0,Z.useId)(),[M,N]=(0,Z.useState)(!1);!M&&k===`review`&&N(!0);let P=k??void 0,F;t[8]===P?F=t[9]:(F=yZ(P),t[8]=P,t[9]=F);let I=F,L;t[10]!==o||t[11]!==s?(L=e=>{let t=e.target;t instanceof Element&&e.currentTarget.contains(t)&&t.closest(`[data-review-controls]`)===null&&(e.type===`pointerdown`?s.selectPane(o):s.focusPane(o,t))},t[10]=o,t[11]=s,t[12]=L):L=t[12];let R=L,z;t[13]!==o||t[14]!==s?(z=e=>s.bindPane(o,e),t[13]=o,t[14]=s,t[15]=z):z=t[15];let B=c?`${o===0?`Left`:`Right`} pane`:void 0,V=c&&o===1&&`border-l`,H=o===1&&`motion-safe:animate-in motion-safe:fade-in-0 duration-150`,U;t[16]!==V||t[17]!==H?(U=Y(`@container/pane relative flex h-full min-h-0 min-w-0 flex-col`,V,H),t[16]=V,t[17]=H,t[18]=U):U=t[18];let W;t[19]===j?W=t[20]:(W=e=>kZ(j,e),t[19]=j,t[20]=W);let G;t[21]!==d.connection||t[22]!==u?(G={connection:d.connection,scope:u},t[21]=d.connection,t[22]=u,t[23]=G):G=t[23];let K;t[24]!==o||t[25]!==g||t[26]!==_||t[27]!==v||t[28]!==y||t[29]!==T.tabs||t[30]!==b?(K=o===0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(UH,{ref:e=>g.attach(e),"aria-label":`Toggle Sidebar`,"aria-expanded":_?y:v,"aria-keyshortcuts":or()===`mac`?`Meta+B`:`Control+B`,onClick:()=>{!_&&v&&requestAnimationFrame(()=>g.element?.focus())}})}),(0,Q.jsxs)(Yo,{role:`tooltip`,className:`break-all`,children:[`Toggle Sidebar`,` `,(0,Q.jsx)(pH,{children:Ad(ou.toggleNavigator)})]})]}),_&&T.tabs.length<=1&&(0,Q.jsx)(fr,{className:`ml-1 max-w-32 min-w-0 font-mono text-caption text-foreground-2`,text:b})]}):void 0,t[24]=o,t[25]=g,t[26]=_,t[27]=v,t[28]=y,t[29]=T.tabs,t[30]=b,t[31]=K):K=t[31];let q=T.tabs,ee=T.pinned,J;t[32]!==o||t[33]!==c?(J=o8(c,o),t[32]=o,t[33]=c,t[34]=J):J=t[34];let te;t[35]!==o||t[36]!==s?(te=RQ(s,o),t[35]=o,t[36]=s,t[37]=te):te=t[37];let ne;t[38]!==I?.kind||t[39]!==f||t[40]!==p||t[41]!==d.connection||t[42]!==i||t[43]!==u?(ne=I?.kind===`branch`&&!i.guided&&!p.baseInPanel&&(0,Q.jsx)(P6,{scope:u,connection:d.connection,base:f,onBase:p.onBase,compact:!0}),t[38]=I?.kind,t[39]=f,t[40]=p,t[41]=d.connection,t[42]=i,t[43]=u,t[44]=ne):ne=t[44];let re;t[45]!==C||t[46]!==ne?(re=(0,Q.jsx)(`div`,{ref:C,"data-pane-controls":``,role:`toolbar`,"aria-label":`Document controls`,className:`flex items-center gap-1 empty:hidden`,children:ne}),t[45]=C,t[46]=ne,t[47]=re):re=t[47];let ie;t[48]!==o||t[49]!==c||t[50]!==x?(ie=(!c||o===1)&&x(o),t[48]=o,t[49]=c,t[50]=x,t[51]=ie):ie=t[51];let ae;t[52]!==re||t[53]!==ie?(ae=(0,Q.jsxs)(Q.Fragment,{children:[re,ie]}),t[52]=re,t[53]=ie,t[54]=ae):ae=t[54];let oe;t[55]!==T.pinned||t[56]!==T.tabs||t[57]!==k||t[58]!==W||t[59]!==G||t[60]!==K||t[61]!==J||t[62]!==te||t[63]!==ae?(oe=(0,Q.jsx)(VQ,{ids:W,commitContext:G,leading:K,tabs:q,pinned:ee,active:k,side:J,...te,trailing:ae}),t[55]=T.pinned,t[56]=T.tabs,t[57]=k,t[58]=W,t[59]=G,t[60]=K,t[61]=J,t[62]=te,t[63]=ae,t[64]=oe):oe=t[64];let se;t[65]!==I?.kind||t[66]!==f||t[67]!==p||t[68]!==d.connection||t[69]!==i||t[70]!==u?(se=I?.kind===`branch-file`&&!i.guided&&!p.baseInPanel&&(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Branch comparison`,className:`flex items-center gap-2 border-b px-3.5 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{children:`Branch comparison`}),(0,Q.jsx)(P6,{scope:u,connection:d.connection,base:f,onBase:p.onBase,compact:!0})]}),t[65]=I?.kind,t[66]=f,t[67]=p,t[68]=d.connection,t[69]=i,t[70]=u,t[71]=se):se=t[71];let ce;t[72]!==T.tabs||t[73]!==M?(ce=M&&T.tabs.includes(`review`)?DZ:null,t[72]=T.tabs,t[73]=M,t[74]=ce):ce=t[74];let le;t[75]!==f||t[76]!==d||t[77]!==a||t[78]!==l||t[79]!==o||t[80]!==h||t[81]!==m||t[82]!==j||t[83]!==A||t[84]!==n||t[85]!==u||t[86]!==k||t[87]!==c||t[88]!==ce||t[89]!==S||t[90]!==r?(le=[{slot:DZ,entry:ce},{slot:`document`,entry:k===`review`?null:k}].map(e=>{let{slot:t,entry:i}=e,s=yZ(i??void 0),p=s!==null&&i===k,g=i?kZ(j,i):void 0;return(0,Q.jsx)(`div`,{role:s?`tabpanel`:void 0,id:g?.panel,"aria-labelledby":g?.tab,"aria-hidden":!p,inert:!p||A,className:Y(`flex min-h-0 flex-1 flex-col overflow-hidden`,!p&&`pointer-events-none invisible absolute opacity-0 inset-x-0 top-12 bottom-0`),children:(0,Q.jsx)(B6,{documentKey:i??void 0,connection:d.connection,scope:u,children:s&&(0,Q.jsx)(C6,{review:n,walkthroughCode:r,scope:u,context:d,document:s,sideLabel:JZ(o8(c,o)),base:f,onOpen:m,onBrowse:h,active:p&&l&&!A,hidden:!p,toolbarTarget:p&&!A?S:null,fileTarget:p&&a?.pane===o&&a.key===k?a:void 0})})},t)}),t[75]=f,t[76]=d,t[77]=a,t[78]=l,t[79]=o,t[80]=h,t[81]=m,t[82]=j,t[83]=A,t[84]=n,t[85]=u,t[86]=k,t[87]=c,t[88]=ce,t[89]=S,t[90]=r,t[91]=le):le=t[91];let ue;return t[92]!==R||t[93]!==l||t[94]!==A||t[95]!==U||t[96]!==oe||t[97]!==se||t[98]!==le||t[99]!==z||t[100]!==B?(ue=(0,Q.jsxs)(`section`,{ref:z,"aria-label":B,"data-focused":l,"aria-busy":A,onPointerDownCapture:R,onFocusCapture:R,className:U,children:[oe,se,le]}),t[92]=R,t[93]=l,t[94]=A,t[95]=U,t[96]=oe,t[97]=se,t[98]=le,t[99]=z,t[100]=B,t[101]=ue):ue=t[101],ue}var c8={open:Zh,review:Dn,comment:Yg,"open-to-side":Lh,"open-file":rg,timeline:h_,"copy-relative":Bs,discard:F_,"expand-all":Th,"collapse-all":Ch};function l8(e){let t=(0,$.c)(2),{action:n}=e,r=c8[n.id],i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(r,{}),t[0]=r,t[1]=i),i}function u8(e){let t=(0,$.c)(52),{actions:n,label:r,description:i,writeBlock:a,onAction:o,children:s}=e,c=(0,Z.useId)(),[l,u]=(0,Z.useState)(!1),d;t[0]===a?d=t[1]:(d=e=>e===`review`||e===`discard`?a:void 0,t[0]=a,t[1]=d);let f=d,p;t[2]!==f||t[3]!==o?(p=e=>{f(e)||(e===`open-to-side`&&(0,th.flushSync)(()=>u(!0)),o(e))},t[2]=f,t[3]=o,t[4]=p):p=t[4];let m=p,h;t[5]!==m||t[6]!==f?(h=e=>{let t=f(e.id);return{disabled:e.disabled||!!t,"aria-description":t,destructive:e.destructive===!0,onSelect:()=>m(e.id)}},t[5]=m,t[6]=f,t[7]=h):h=t[7];let g=h,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e&&u(!1)},t[8]=_):_=t[8];let v=_,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`div`,{className:`min-w-0`}),t[9]=y):y=t[9];let b;t[10]!==i||t[11]!==c?(b=i&&(0,Q.jsx)(`span`,{id:c,className:`sr-only`,children:i}),t[10]=i,t[11]=c,t[12]=b):b=t[12];let x=i?c:void 0,S;t[13]!==r||t[14]!==x?(S=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,className:`shrink-0`,"aria-label":r,"aria-describedby":x}),t[13]=r,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Vh,{}),t[16]=C):C=t[16];let w;t[17]===S?w=t[18]:(w=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:S,children:C})}),t[17]=S,t[18]=w);let T;t[19]===r?T=t[20]:(T=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:r}),t[19]=r,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,Q.jsxs)(ot,{children:[w,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D=l?`none`:`trigger`,O;if(t[24]!==n||t[25]!==g){let e;t[27]===g?e=t[28]:(e=e=>(0,Q.jsxs)(dn,{...g(e),children:[(0,Q.jsx)(l8,{action:e}),e.label]},e.id),t[27]=g,t[28]=e),O=n.map(e),t[24]=n,t[25]=g,t[26]=O}else O=t[26];let k;t[29]!==D||t[30]!==O?(k=(0,Q.jsx)(Ne,{align:`end`,finalFocus:D,children:O}),t[29]=D,t[30]=O,t[31]=k):k=t[31];let A;t[32]!==E||t[33]!==k||t[34]!==b?(A=(0,Q.jsxs)(Wt,{onOpenChange:v,children:[b,E,k]}),t[32]=E,t[33]=k,t[34]=b,t[35]=A):A=t[35];let j;t[36]!==s||t[37]!==A?(j=s(A),t[36]=s,t[37]=A,t[38]=j):j=t[38];let M;t[39]===j?M=t[40]:(M=(0,Q.jsx)(uH,{render:y,children:j}),t[39]=j,t[40]=M);let N=l?`none`:`trigger`,P;if(t[41]!==n||t[42]!==g){let e;t[44]===g?e=t[45]:(e=e=>(0,Q.jsxs)(dn,{...g(e),children:[(0,Q.jsx)(l8,{action:e}),e.label]},e.id),t[44]=g,t[45]=e),P=n.map(e),t[41]=n,t[42]=g,t[43]=P}else P=t[43];let F;t[46]!==N||t[47]!==P?(F=(0,Q.jsx)(dH,{finalFocus:N,children:P}),t[46]=N,t[47]=P,t[48]=F):F=t[48];let I;return t[49]!==M||t[50]!==F?(I=(0,Q.jsxs)(Wt,{onOpenChange:v,children:[M,F]}),t[49]=M,t[50]=F,t[51]=I):I=t[51],I}var d8=`flex h-7 w-full min-w-0 items-center gap-1.5 rounded-md px-2 text-left text-caption transition-colors outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/60 aria-pressed:bg-selection aria-pressed:font-medium aria-pressed:text-foreground`;function f8(e){let t=(0,$.c)(40),{path:n,document:r,note:i,scopes:a,changeStatus:o,reviewStatus:s,active:c,current:l,onOpen:u,sideLabel:d,onReview:f,canReview:p,writeBlock:m,onDiscard:h,indented:g,commentCount:_,onComment:v,trailing:y,tick:b}=e,x=l!==void 0&&l,S=g!==void 0&&g,C=_===void 0?0:_,w=b!==void 0&&b,T;t[0]===n?T=t[1]:(T=dy(n),t[0]=n,t[1]=T);let E;t[2]===a?E=t[3]:(E=a.length>0?` · ${a.join(` + `)}`:``,t[2]=a,t[3]=E);let D=`${T}${E}`,O;t[4]!==r||t[5]!==v||t[6]!==h||t[7]!==u||t[8]!==f||t[9]!==n?(O=e=>{bb22:switch(e){case`review`:f();break bb22;case`open`:u(r);break bb22;case`open-to-side`:u(r,{toSide:!0});break bb22;case`open-file`:u({kind:`file`,path:n});break bb22;case`timeline`:u({kind:`timeline`,path:n});break bb22;case`copy-relative`:Zt(n,`relative path`);break bb22;case`discard`:h?.();break bb22;case`comment`:v?.()}},t[4]=r,t[5]=v,t[6]=h,t[7]=u,t[8]=f,t[9]=n,t[10]=O):O=t[10];let k=O,A=`Actions for ${n}`,j=h!==void 0,M=v!==void 0,N;t[11]!==p||t[12]!==s||t[13]!==d||t[14]!==M||t[15]!==j?(N=My({kind:`file`,status:s,canReview:p,sideLabel:d,canDiscard:j,canComment:M}),t[11]=p,t[12]=s,t[13]=d,t[14]=M,t[15]=j,t[16]=N):N=t[16];let P;t[17]!==c||t[18]!==p||t[19]!==o||t[20]!==C||t[21]!==x||t[22]!==r||t[23]!==S||t[24]!==D||t[25]!==i||t[26]!==u||t[27]!==f||t[28]!==n||t[29]!==s||t[30]!==w||t[31]!==y||t[32]!==m?(P=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsxs)(`button`,{type:`button`,ref:e=>{e&&(!c&&!x?delete e.dataset.revealed:e.dataset.revealed===void 0&&(e.dataset.revealed=``,e.scrollIntoView({block:`nearest`})))},"aria-pressed":c,"aria-current":x?`location`:void 0,"aria-label":D,"aria-description":h8(o,s),title:i==null?n:`${n}\n${i}`,className:Y(d8,`flex-1 text-muted-foreground`,S&&`pl-7`,c?`bg-selection font-medium text-foreground`:x&&`bg-accent text-foreground`),onClick:e=>u(r,{toSide:e.altKey}),children:[(0,Q.jsx)(m8,{status:o,reviewStatus:s,tick:w}),(0,Q.jsx)(Gk,{path:n,className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:dy(n)}),C>0&&(0,Q.jsxs)(`span`,{"aria-label":C===1?`1 comment`:`${C} comments`,className:`flex shrink-0 items-center gap-0.5 text-2xs text-muted-foreground tabular-nums`,children:[(0,Q.jsx)($g,{"aria-hidden":!0,className:`size-3`}),C]}),y]}),w&&(0,Q.jsx)(p8,{path:n,status:s,canReview:p,writeBlock:m,onReview:f}),e]}),t[17]=c,t[18]=p,t[19]=o,t[20]=C,t[21]=x,t[22]=r,t[23]=S,t[24]=D,t[25]=i,t[26]=u,t[27]=f,t[28]=n,t[29]=s,t[30]=w,t[31]=y,t[32]=m,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==N||t[36]!==P||t[37]!==A||t[38]!==m?(F=(0,Q.jsx)(u8,{label:A,actions:N,writeBlock:m,onAction:k,children:P}),t[34]=k,t[35]=N,t[36]=P,t[37]=A,t[38]=m,t[39]=F):F=t[39],F}function p8(e){let t=(0,$.c)(11),{path:n,status:r,canReview:i,writeBlock:a,onReview:o}=e,s=r===`stale`?`Changed since reviewed`:`Mark as reviewed`;i||(s=`This file cannot be marked reviewed`),a&&(s=a);let c=r===`reviewed`,l=`${n} reviewed`,u=!i||!!a,d;t[0]!==s||t[1]!==o||t[2]!==c||t[3]!==l||t[4]!==u?(d=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(pY,{className:`mx-1.5`,checked:c,"aria-label":l,"aria-description":s,disabled:u,onCheckedChange:o})}),t[0]=s,t[1]=o,t[2]=c,t[3]=l,t[4]=u,t[5]=d):d=t[5];let f;t[6]===s?f=t[7]:(f=(0,Q.jsx)(Yo,{role:`tooltip`,children:s}),t[6]=s,t[7]=f);let p;return t[8]!==d||t[9]!==f?(p=(0,Q.jsxs)(ot,{children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10],p}function m8(e){let t=(0,$.c)(12),{status:n,reviewStatus:r,tick:i}=e,a=r??`unreviewed`,o;t[0]!==r||t[1]!==n?(o=h8(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s=o,c;t[3]!==a||t[4]!==n||t[5]!==i?(c=a===`reviewed`&&!i?(0,Q.jsx)(Dn,{"aria-hidden":`true`,className:`size-3 text-add-fg`}):(0,Q.jsx)(`span`,{className:Y(`size-1.5 rounded-full`,n===void 0&&`bg-muted-foreground/60`,(n===`added`||n===`untracked`)&&`bg-graph-2`,n===`modified`&&`bg-graph-4`,n===`deleted`&&`bg-destructive`,n===`renamed`&&`bg-graph-1`)}),t[3]=a,t[4]=n,t[5]=i,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==a||t[9]!==n||t[10]!==c?(l=(0,Q.jsx)(`span`,{role:`img`,"aria-label":s,className:`grid w-3.5 shrink-0 place-items-center`,"data-review-state":a,"data-change-status":n,title:s,children:c}),t[7]=s,t[8]=a,t[9]=n,t[10]=c,t[11]=l):l=t[11],l}function h8(e,t){return`${e===void 0?`Change type unavailable`:vl[e].label} · ${g8(t)}`}function g8(e){return e===`reviewed`?`Reviewed`:e===`stale`?`Changed since review`:`Not reviewed`}function _8(e){let t=(0,$.c)(17),{label:n,active:r,onOpen:i,className:a,plain:o,children:s}=e,c=a===void 0?d8:a;if(o!==void 0&&o){let e;return t[0]!==r||t[1]!==s||t[2]!==c||t[3]!==n||t[4]!==i?(e=(0,Q.jsx)(`div`,{className:`flex min-w-0 items-center`,children:(0,Q.jsx)(`button`,{type:`button`,className:c,"aria-pressed":r,"aria-label":n,onClick:i,children:s})}),t[0]=r,t[1]=s,t[2]=c,t[3]=n,t[4]=i,t[5]=e):e=t[5],e}let l=`Actions for ${n}`,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=My({kind:`section`}),t[6]=u):u=t[6];let d;t[7]!==r||t[8]!==s||t[9]!==c||t[10]!==i?(d=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsx)(`button`,{type:`button`,className:c,"aria-pressed":r,onClick:i,children:s}),e]}),t[7]=r,t[8]=s,t[9]=c,t[10]=i,t[11]=d):d=t[11];let f;return t[12]!==i||t[13]!==l||t[14]!==u||t[15]!==d?(f=(0,Q.jsx)(u8,{label:l,actions:u,onAction:i,children:d}),t[12]=i,t[13]=l,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function v8(e){let t=(0,$.c)(15),{name:n,count:r,expanded:i,onExpanded:a,onAll:o,action:s,children:c}=e,l=i?sc:ci,u;t[0]!==l||t[1]!==r||t[2]!==i||t[3]!==n||t[4]!==a?(u=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:d8,"aria-label":n,"aria-expanded":i,onClick:()=>a(!i),children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:`${n} · ${Vt(r,`file`)}`}),(0,Q.jsx)(l,{className:`size-3.5 shrink-0`})]}),e]}),t[0]=l,t[1]=r,t[2]=i,t[3]=n,t[4]=a,t[5]=u):u=t[5];let d=u,f;t[6]!==s||t[7]!==n||t[8]!==o||t[9]!==d?(f=s?d(s):(0,Q.jsx)(u8,{label:`Actions for ${n}`,actions:My({kind:`group`}),onAction:e=>o(e===`expand-all`),children:d}),t[6]=s,t[7]=n,t[8]=o,t[9]=d,t[10]=f):f=t[10];let p=i&&c,m;return t[11]!==n||t[12]!==f||t[13]!==p?(m=(0,Q.jsxs)(`section`,{"aria-label":n,className:`mt-3 border-t pt-2`,children:[f,p]}),t[11]=n,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function y8(e){let t=(0,$.c)(14),{reviewed:n,total:r,label:i,scope:a}=e,o;t[0]===i?o=t[1]:(o=i&&(0,Q.jsx)(fr,{className:`min-w-0`,text:i}),t[0]=i,t[1]=o);let s;t[2]===a?s=t[3]:(s=a&&(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:a}),t[2]=a,t[3]=s);let c;t[4]===r?c=t[5]:(c=Vt(r,`file`),t[4]=r,t[5]=c);let l=`${n} of ${c} reviewed`,u;t[6]===l?u=t[7]:(u=(0,Q.jsx)(`span`,{className:`ml-auto shrink-0`,children:l}),t[6]=l,t[7]=u);let d;t[8]!==s||t[9]!==u?(d=(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[s,u]}),t[8]=s,t[9]=u,t[10]=d):d=t[10];let f;return t[11]!==o||t[12]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 px-2 pb-1.5 text-2xs text-muted-foreground tabular-nums`,children:[o,d]}),t[11]=o,t[12]=d,t[13]=f):f=t[13],f}function b8(e){let t=(0,$.c)(17),{label:n,value:r,options:i,onValue:a,className:o}=e,s;t[0]===o?s=t[1]:(s=Y(`shrink-0`,o),t[0]=o,t[1]=s);let c;t[2]!==a||t[3]!==i?(c=e=>{let t=i.find(t=>t.value===e);t&&a(t.value)},t[2]=a,t[3]=i,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i.map(x8),t[5]=i,t[6]=l);let u;t[7]!==n||t[8]!==l?(u=(0,Q.jsx)(kd,{"aria-label":n,className:`w-full`,children:l}),t[7]=n,t[8]=l,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==u||t[12]!==r?(d=(0,Q.jsx)(Nu,{value:r,onValueChange:c,children:u}),t[10]=c,t[11]=u,t[12]=r,t[13]=d):d=t[13];let f;return t[14]!==s||t[15]!==d?(f=(0,Q.jsx)(`div`,{className:s,children:d}),t[14]=s,t[15]=d,t[16]=f):f=t[16],f}function x8(e){return(0,Q.jsx)(hd,{value:e.value,className:`min-w-0`,children:e.label},e.value)}function S8(e){let t=(0,$.c)(16),{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,onBase:c,grouping:l}=e,u;t[0]!==i||t[1]!==r.connection||t[2]!==c||t[3]!==n?(u=(0,Q.jsx)(`div`,{className:`shrink-0 px-2.5 pt-2`,children:(0,Q.jsx)(P6,{scope:n,connection:r.connection,base:i,onBase:c})}),t[0]=i,t[1]=r.connection,t[2]=c,t[3]=n,t[4]=u):u=t[4];let d;t[5]!==a||t[6]!==i||t[7]!==r||t[8]!==l||t[9]!==o||t[10]!==n||t[11]!==s?(d=(0,Q.jsx)(C8,{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,grouping:l}),t[5]=a,t[6]=i,t[7]=r,t[8]=l,t[9]=o,t[10]=n,t[11]=s,t[12]=d):d=t[12];let f;return t[13]!==u||t[14]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,d]}),t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function C8(e){let t=(0,$.c)(13),{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,grouping:c}=e,l;t[0]!==a||t[1]!==i||t[2]!==r||t[3]!==c||t[4]!==o||t[5]!==n||t[6]!==s?(l=e=>(0,Q.jsx)(w8,{scope:n,context:r,base:i,branch:e,activeEntry:a,onOpen:o,sideLabel:s,grouping:c}),t[0]=a,t[1]=i,t[2]=r,t[3]=c,t[4]=o,t[5]=n,t[6]=s,t[7]=l):l=t[7];let u;return t[8]!==i||t[9]!==r||t[10]!==n||t[11]!==l?(u=(0,Q.jsx)(ZQ,{scope:n,context:r,base:i,quiet:!0,children:l}),t[8]=i,t[9]=r,t[10]=n,t[11]=l,t[12]=u):u=t[12],u}function w8(e){let t=(0,$.c)(60),{scope:n,context:r,base:i,branch:a,activeEntry:o,onOpen:s,sideLabel:c,grouping:l}=e,u=Ku(r.connection),d;t[0]===a?d=t[1]:(d=py(a),t[0]=a,t[1]=d);let f=d,p=JQ(n,r,f),m;t[2]!==r||t[3]!==n?(m={scope:n,context:r},t[2]=r,t[3]=n,t[4]=m):m=t[4];let h=w1(m),g=bQ(n.worktreeId,o),_=f$(n,r,E8,f);if(a.base===null||a.base===void 0)return null;let v,y,b,x,S,C,w,T,E;if(t[5]!==l||t[6]!==o||t[7]!==i||t[8]!==a.base.ref||t[9]!==a.commits||t[10]!==a.files||t[11]!==a.head.branch||t[12]!==h||t[13]!==r||t[14]!==g||t[15]!==p||t[16]!==s||t[17]!==_||t[18]!==n||t[19]!==c||t[20]!==u){let e=sy(a.files,p),d;t[30]===a.head.branch?d=t[31]:(d=a.head.branch===null||a.head.branch===void 0?`this commit`:Vy(a.head.branch),t[30]=a.head.branch,t[31]=d);let f=d,m;t[32]===a.commits?m=t[33]:(m=Vt(a.commits,`commit`),t[32]=a.commits,t[33]=m);let D=m,O;t[34]!==o||t[35]!==h||t[36]!==g||t[37]!==s||t[38]!==_||t[39]!==c?(O=(e,t)=>(0,Z.createElement)(f8,{...t,key:e.path,path:e.path,document:{kind:`branch-file`,path:e.path},note:e.status,changeStatus:Sl(e),scopes:[e.status],reviewStatus:e.reviewStatus,active:o===vZ({kind:`branch-file`,path:e.path}),current:g===e.path,onOpen:s,sideLabel:c,writeBlock:_.writeBlock,commentCount:h.counts.get(e.path),onComment:()=>h.comment(e.path),canReview:e.fingerprint!==null&&e.fingerprint!==void 0,onReview:()=>_.toggle({path:e.path,reviewed:e.reviewStatus===`reviewed`,fingerprint:e.fingerprint})}),t[34]=o,t[35]=h,t[36]=g,t[37]=s,t[38]=_,t[39]=c,t[40]=O):O=t[40];let k=O;v=JV,y=`h-0 min-h-0 flex-1`,b=`px-2.5 pt-2 pb-3`;let A=e.filter(T8).length,j=e.length,M;t[41]===a.base.ref?M=t[42]:(M=Vy(a.base.ref),t[41]=a.base.ref,t[42]=M),x=(0,Q.jsx)(y8,{reviewed:A,total:j,label:`${D} on ${f} since ${M}`,scope:`Committed files only`}),S=h.summary,C=h.dialogs;let N;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(N=vZ(hZ),t[43]=N):N=t[43];let P;t[44]===s?P=t[45]:(P=()=>s(hZ),t[44]=s,t[45]=P);let F,I;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(_g,{className:`size-3.5 shrink-0 text-muted-foreground`}),I=(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:`All branch changes`}),t[46]=F,t[47]=I):(F=t[46],I=t[47]),w=(0,Q.jsxs)(_8,{label:`All branch changes`,active:o===N,onOpen:P,plain:l!==void 0,children:[F,I,(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:e.length})]}),T=e.length===0&&(0,Q.jsxs)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:[`No changes since `,Vy(a.base.ref)]}),E=l?(0,Q.jsx)(l,{scope:n,context:r,base:i,items:e,row:k,activeEntry:o,onOpen:s}):Ay(e,u).map(e=>k(e)),t[5]=l,t[6]=o,t[7]=i,t[8]=a.base.ref,t[9]=a.commits,t[10]=a.files,t[11]=a.head.branch,t[12]=h,t[13]=r,t[14]=g,t[15]=p,t[16]=s,t[17]=_,t[18]=n,t[19]=c,t[20]=u,t[21]=v,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=E}else v=t[21],y=t[22],b=t[23],x=t[24],S=t[25],C=t[26],w=t[27],T=t[28],E=t[29];let D;t[48]!==b||t[49]!==x||t[50]!==S||t[51]!==C||t[52]!==w||t[53]!==T||t[54]!==E?(D=(0,Q.jsxs)(`div`,{className:b,children:[x,S,C,w,T,E]}),t[48]=b,t[49]=x,t[50]=S,t[51]=C,t[52]=w,t[53]=T,t[54]=E,t[55]=D):D=t[55];let O;return t[56]!==v||t[57]!==y||t[58]!==D?(O=(0,Q.jsx)(v,{className:y,children:D}),t[56]=v,t[57]=y,t[58]=D,t[59]=O):O=t[59],O}function T8(e){return e.reviewStatus===`reviewed`}function E8(e){return ks(e)}var D8=[{value:`uncommitted`,label:`Uncommitted`},{value:`branch`,label:`Branch`}];function O8(e){let t=(0,$.c)(28),{grouping:n,scope:r,context:i,activeEntry:a,onOpen:o,sideLabel:s,changeScope:c,base:l,onChangeScope:u,onBase:d}=e,{connection:f}=i;YQ(r,i);let p=rB(r,f),m=XQ(r,i,p),h=c===`branch`,g;t[0]!==c||t[1]!==u?(g=(0,Q.jsx)(b8,{label:`Changes to review`,className:`px-2.5 pt-3`,value:c,onValue:u,options:D8}),t[0]=c,t[1]=u,t[2]=g):g=t[2];let _;t[3]!==a||t[4]!==l||t[5]!==h||t[6]!==i||t[7]!==n?.branch||t[8]!==d||t[9]!==o||t[10]!==r||t[11]!==s?(_=h&&(0,Q.jsx)(S8,{scope:r,context:i,base:l,activeEntry:a,onOpen:o,sideLabel:s,onBase:d,grouping:n?.branch}),t[3]=a,t[4]=l,t[5]=h,t[6]=i,t[7]=n?.branch,t[8]=d,t[9]=o,t[10]=r,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==a||t[14]!==l||t[15]!==h||t[16]!==m||t[17]!==i||t[18]!==n?.uncommitted||t[19]!==p||t[20]!==o||t[21]!==r||t[22]!==s?(v=!h&&(0,Q.jsx)(k8,{scope:r,context:i,activeEntry:a,onOpen:o,sideLabel:s,list:p,changes:m,grouping:n?.uncommitted,base:l}),t[13]=a,t[14]=l,t[15]=h,t[16]=m,t[17]=i,t[18]=n?.uncommitted,t[19]=p,t[20]=o,t[21]=r,t[22]=s,t[23]=v):v=t[23];let y;return t[24]!==g||t[25]!==_||t[26]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,_,v]}),t[24]=g,t[25]=_,t[26]=v,t[27]=y):y=t[27],y}function k8(e){let t=(0,$.c)(23),{scope:n,context:r,activeEntry:i,onOpen:a,sideLabel:o,list:s,changes:c,grouping:l,base:u}=e,d=Ku(r.connection),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={changes:!0,specs:!1},t[0]=f):f=t[0];let[p,m]=(0,Z.useState)(f),h=s.changes.map(P8),g=d?h.filter(N8):h,_=d?h.filter(ky):[],v=new Map(c.map(M8)),y=du(s.changes),b=f$(n,r,j8),x;t[1]!==r||t[2]!==n?(x={scope:n,context:r},t[1]=r,t[2]=n,t[3]=x):x=t[3];let S=w1(x),C=bQ(n.worktreeId,i),[w,T]=(0,Z.useState)(null),E=()=>l?(0,Q.jsx)(l,{base:u,scope:n,context:r,paths:h,row:D,activeEntry:i,onOpen:a}):(0,Q.jsx)(_8,{label:`All changes`,active:i===vZ(pZ),onOpen:()=>a(pZ),children:`All changes`}),D=(e,t)=>(0,Z.createElement)(f8,{...t,key:e,path:e,document:{kind:`change`,path:e},note:void 0,changeStatus:y.files.get(e),scopes:[...new Set(s.changes.find(t=>t.path===e)?.comparisons.map(A8))],reviewStatus:v.get(e)?.reviewStatus,active:i===vZ({kind:`change`,path:e}),current:C===e,onOpen:a,sideLabel:o,writeBlock:b.writeBlock,commentCount:S.counts.get(e),onComment:()=>S.comment(e),canReview:v.get(e)?.fingerprint!==null&&v.get(e)?.fingerprint!==void 0,onReview:()=>b.toggle({path:e,reviewed:v.get(e)?.reviewStatus===`reviewed`,fingerprint:v.get(e)?.fingerprint}),onDiscard:()=>T(t=>({path:e,nonce:(t?.nonce??0)+1}))}),O=JV,k=h.length>0&&(0,Q.jsx)(y8,{reviewed:h.filter(e=>v.get(e)?.reviewStatus===`reviewed`).length,total:h.length}),A=H(h.length,s.omittedChanges)&&(0,Q.jsx)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:H(h.length,s.omittedChanges)}),j=S.summary,M=S.dialogs,N;t[4]===E?N=t[5]:(N=E(),t[4]=E,t[5]=N);let P=!l&&h.length===0&&(0,Q.jsx)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:`No changes`}),F=!l&&g.length>0&&(0,Q.jsx)(v8,{name:`Changed files`,count:g.length,expanded:p.changes,onExpanded:e=>m(t=>({...t,changes:e})),onAll:e=>m({changes:e,specs:e}),children:g.map(e=>D(e))}),I=!l&&_.length>0&&(0,Q.jsxs)(v8,{name:`Specs`,count:_.length,expanded:p.specs,onExpanded:e=>m(t=>({...t,specs:e})),onAll:e=>m({changes:e,specs:e}),children:[(0,Q.jsx)(_8,{label:`Open all specs`,active:i===`specs`,onOpen:()=>a(mZ),children:`Open all specs`}),_.map(e=>D(e))]}),L;t[6]!==r||t[7]!==w||t[8]!==n?(L=w&&(0,Q.jsx)(UJ,{scope:n,context:r,path:w.path,signal:w.nonce,hiddenTrigger:!0}),t[6]=r,t[7]=w,t[8]=n,t[9]=L):L=t[9];let R;t[10]!==S.dialogs||t[11]!==S.summary||t[12]!==P||t[13]!==F||t[14]!==I||t[15]!==L||t[16]!==k||t[17]!==A||t[18]!==N?(R=(0,Q.jsxs)(`div`,{className:`px-2.5 pt-2 pb-3`,children:[k,A,j,M,N,P,F,I,L]}),t[10]=S.dialogs,t[11]=S.summary,t[12]=P,t[13]=F,t[14]=I,t[15]=L,t[16]=k,t[17]=A,t[18]=N,t[19]=R):R=t[19];let z;return t[20]!==O||t[21]!==R?(z=(0,Q.jsx)(O,{className:`h-0 min-h-0 flex-1`,children:R}),t[20]=O,t[21]=R,t[22]=z):z=t[22],z}function A8(e){return e.scope}function j8(e){return ks(e)}function M8(e){return[e.path,e]}function N8(e){return!ky(e)}function P8(e){return e.path}function F8(){let e=(0,$.c)(12),{open:t}=SQ(),n=zH()?.open??!0,r=!n&&`desktop-workspace-without-navigator`,i;e[0]===r?i=e[1]:(i=Y(`relative flex h-svh w-full bg-frame p-2 max-md:p-0`,r),e[0]=r,e[1]=i);let a;e[2]===n?a=e[3]:(a=n&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 md:block`}),e[2]=n,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 rounded-paper border bg-card max-md:rounded-none max-md:border-0`,children:(0,Q.jsx)(kc,{label:`Opening Porcelain`})}),e[4]=o):o=e[4];let s;e[5]===t?s=e[6]:(s=t&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`ml-2 hidden w-80 shrink-0 rounded-paper bg-card shadow-paper xl:block`}),e[5]=t,e[6]=s);let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-11 shrink-0 xl:block`}),e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==a||e[10]!==s?(l=(0,Q.jsxs)(`div`,{className:i,children:[a,o,s,c]}),e[8]=i,e[9]=a,e[10]=s,e[11]=l):l=e[11],l}var I8=Oe(void 0);function L8(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=e===void 0?I8:ir(e),t[0]=e,t[1]=n),Lt(n)}var R8=Ut({start:Ln,workspace:fi,list:ar(Ln),retired:ar(fi),navigator:ar(fi)}),z8=Qt(Ut({settings:R8}));function B8(e){let{state:t,pathname:n}=e.location;return{index:t.__TSR_index,pathname:n,fromNavigator:t.settingsFromNavigator===!0,session:de(fn(z8(t),e=>e.settings))}}function V8(e,t){let{state:n,href:r}=e.location;e.replace(r,{...n,settings:t})}function H8(e,t,n){e.replace(t,{...e.location.state,settings:n})}function U8(e,t,n){if(t===0){n();return}let r=e.subscribe(()=>{r(),n()});e.go(t)}var W8=24,G8=`data-outline-landed`,K8=`data-outline-chosen`,q8=`data-outline-pinned`;function J8(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.title===t[n]?.title)}function Y8(e,t){let n=Number.parseFloat(getComputedStyle(t).scrollMarginTop);return e.scrollTop+t.getBoundingClientRect().top-e.getBoundingClientRect().top-(Number.isNaN(n)?0:n)}function X8(e,t){let n=t.at(-1);if(n&&e.scrollTop>0&&e.scrollTop+e.clientHeight>=e.scrollHeight-2)return n.id;let r=e.getBoundingClientRect().top,i=t[0]?.id;for(let e of t)e.getBoundingClientRect().top-r<=W8&&(i=e.id);return i}function Z8(e,t){let n=(0,$.c)(12),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],n[0]=r):r=n[0];let[i,a]=(0,Z.useState)(r),[o,s]=(0,Z.useState)(),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),f;n[1]!==t||n[2]!==e?(f=n=>{if(l(n),!n)return;let r=n.closest(`[data-slot=scroll-area-viewport]`)??n;d(r);let i=`${e}#${t}`,o=()=>{let e=[...n.querySelectorAll(`[${cc}]`)],o=e.map(Q8);a(e=>J8(e,o)?e:o),t!==``&&n.getAttribute(G8)!==i&&(n.setAttribute(G8,i),n.setAttribute(K8,t),n.setAttribute(q8,t));let c=n.getAttribute(q8),l=e.find(e=>e.id===c);l&&(r.scrollTop=Y8(r,l)),s(n.getAttribute(K8)??X8(r,e))},c=0,u=()=>{cancelAnimationFrame(c),c=requestAnimationFrame(o)},f=r.closest(`[data-slot=scroll-area]`)??r,p=()=>{n.removeAttribute(K8),n.removeAttribute(q8)},m=new MutationObserver(u);m.observe(n,{childList:!0,subtree:!0}),r.addEventListener(`scroll`,u,{passive:!0});for(let e of[`wheel`,`touchmove`,`keydown`,`pointerdown`])f.addEventListener(e,p,{passive:!0});return o(),()=>{a([]),s(void 0),cancelAnimationFrame(c),m.disconnect(),r.removeEventListener(`scroll`,u);for(let e of[`wheel`,`touchmove`,`keydown`,`pointerdown`])f.removeEventListener(e,p)}},n[1]=t,n[2]=e,n[3]=f):f=n[3];let p=f,m;n[4]!==c||n[5]!==u?(m=e=>{let t=c?.querySelector(`#${CSS.escape(e)}`);t&&u&&(c?.removeAttribute(q8),c?.setAttribute(K8,e),s(e),u.scrollTo({top:Y8(u,t),behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}),t.focus({preventScroll:!0}))},n[4]=c,n[5]=u,n[6]=m):m=n[6];let h=m,g;return n[7]!==o||n[8]!==p||n[9]!==h||n[10]!==i?(g={sections:i,active:o,attach:p,go:h},n[7]=o,n[8]=p,n[9]=h,n[10]=i,n[11]=g):g=n[11],g}function Q8(e){return{id:e.id,title:e.getAttribute(`data-settings-section`)??e.id}}var $8=[{id:`general`,label:`General`,icon:C_},{id:`git`,label:`Changes & Git`,icon:_g},{id:`computers`,label:`Computers`,icon:Io}],e5=$8[0].id;function t5(e,t){if($8.some(t=>t.id===e)&&(t===void 0||e===`computers`))return{section:e,environmentId:t}}function n5(e){return e.key.toLowerCase()===`b`&&(e.ctrlKey||e.metaKey)}function r5(e){let[,t,n,r,i]=e.split(`/`);if(t===`settings`&&n!==void 0&&i===void 0)return t5(n,r===``?void 0:r)}var i5=`settings-content wrap-anywhere mx-auto flex w-full max-w-200 flex-col gap-8 px-4 py-5 md:px-8 md:py-6`;function a5(e){let t=(0,$.c)(3),{attach:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(JV,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(`div`,{ref:n,className:i5,children:r})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function o5(e){let t=(0,$.c)(9),{sections:n,active:r,onGo:i}=e;if(n.length<2)return null;let a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>{let{id:t,title:n}=e;return(0,Q.jsx)(`a`,{href:`#${t}`,"aria-current":r===t?`location`:void 0,onClick:e=>{di(e)&&(e.preventDefault(),i(t))},className:Y(`-ml-px flex h-6 min-w-0 items-center border-l border-transparent pr-2 pl-3 text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30`,r===t&&`border-foreground font-medium text-foreground`),children:(0,Q.jsx)(fr,{text:n,className:`min-w-0`})},t)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,Q.jsx)(`div`,{className:`my-0.5 ml-4.5 flex flex-col border-l`,children:a}),t[7]=a,t[8]=o),o}function s5(e){return e instanceof HTMLElement&&(e.isContentEditable||e.closest(`input, textarea, select`)!==null)}function c5(e){return e instanceof Element&&e.closest(`[data-slot=dialog-backdrop]`)!==null}function l5(e){let t=(0,$.c)(93),{section:n,environmentId:r}=e,i=Pc(),a=Fi(),o=eh(),{isMobile:s}=BH(),c;t[0]!==o||t[1]!==a.history?(c=()=>{let e=B8(a.history);return e.session??{start:e.index,workspace:o,...e.fromNavigator?{navigator:!0}:{}}},t[0]=o,t[1]=a.history,t[2]=c):c=t[2];let[l]=(0,Z.useState)(c),u;t[3]!==l||t[4]!==a.history?(u=()=>{let e=B8(a.history);return{index:e.index,...e.session??l}},t[3]=l,t[4]=a.history,t[5]=u):u=t[5];let d=u;L8(`Settings — Porcelain`);let[f]=(0,Z.useState)(p5),p=Da(qn),m;t[6]!==s||t[7]!==f||t[8]!==l||t[9]!==a.history||t[10]!==p?(m=e=>{if(!e)return;p(!1);let t,n=e=>{let n=B8(a.history),r=r5(n.pathname);if(!r)return;if(n.session?.retired&&e){a.history.back();return}if(n.session){t={index:n.index,list:r.section===`computers`&&r.environmentId===void 0};return}let i=r.environmentId!==void 0&&t?.list===!0&&t.index===n.index-1;V8(a.history,{start:l.start,workspace:l.workspace,...l.navigator?{navigator:!0}:{},...i&&t?{list:t.index}:{}})};n(!1);let r=a.history.subscribe(e=>{let{action:t}=e;return n(t.type===`FORWARD`||t.type===`GO`&&t.index>0)});return()=>{r(),queueMicrotask(()=>{if(e.isConnected)return;if(l.navigator&&s){p(!0);return}let t=document.activeElement;(t===null||t===document.body)&&f?.focus({preventScroll:!0})})}},t[6]=s,t[7]=f,t[8]=l,t[9]=a.history,t[10]=p,t[11]=m):m=t[11];let h=m,g=Fo(r??``)?.remote,{element:_,attach:v}=hH(),[y,b]=(0,Z.useState)(null),x;t[12]!==i||t[13]!==a.history||t[14]!==d?(x=()=>{let{index:e,list:t}=d();t===void 0?i({to:`/settings/$section`,params:{section:`computers`},replace:!0}):a.history.go(t-e)},t[12]=i,t[13]=a.history,t[14]=d,t[15]=x):x=t[15];let S=x,C;t[16]!==r||t[17]!==i||t[18]!==a.history||t[19]!==d?(C=e=>{let{index:t,list:n}=d(),o=()=>void i({to:`/settings/$section`,params:{section:e},replace:!0});if(r!==void 0&&n!==void 0){let{index:e,...r}=d();V8(a.history,{...r,retired:!0}),U8(a.history,n-t,o)}else o()},t[16]=r,t[17]=i,t[18]=a.history,t[19]=d,t[20]=C):C=t[20];let w=C,T;t[21]!==_?.scrollTop||t[22]!==i?(T=e=>{b({scroll:_?.scrollTop??0,focus:document.activeElement instanceof HTMLElement?document.activeElement:null}),i({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}})},t[21]=_?.scrollTop,t[22]=i,t[23]=T):T=t[23];let E=T,D;t[24]!==r||t[25]!==y||t[26]!==v?(D=e=>{if(v(e),r===void 0&&e){y&&(e.scrollTop=y.scroll);let t=y?.focus,n=t?.isConnected?t:e;n.focus({preventScroll:!0}),requestAnimationFrame(()=>{document.activeElement?.getAttribute(`role`)===`dialog`&&n.focus({preventScroll:!0})})}},t[24]=r,t[25]=y,t[26]=v,t[27]=D):D=t[27];let O=D,k=e=>{if(B.id===`computers`&&r===void 0){E(e);return}if(e===r)return;let{index:t,...n}=d();H8(a.history,a.buildLocation({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}}).href,n)},A;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(A={select:f5},t[28]=A):A=t[28];let j=$m(A),M;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(M={select:d5},t[29]=M):M=t[29];let N=Z8(j,$m(M)),P;t[30]!==N.active||t[31]!==N.go||t[32]!==N.sections?(P=(0,Q.jsx)(o5,{sections:N.sections,active:N.active,onGo:N.go}),t[30]=N.active,t[31]=N.go,t[32]=N.sections,t[33]=P):P=t[33];let F=P,I;t[34]===r?I=t[35]:(I=e=>{r!==void 0&&e?.focus({preventScroll:!0})},t[34]=r,t[35]=I);let L=I,{connection:R}=Di(),{environment:z}=QB(R),B=$8.find(e=>e.id===n)??$8[0],V=`Computer unavailable`;if(r===`this-computer`)V=`This computer`;else if(g){let e;t[36]===g?e=t[37]:(e=(0,Q.jsx)(ss,{remote:g}),t[36]=g,t[37]=e),V=e}let H;t[38]!==i||t[39]!==a.history||t[40]!==d?(H=()=>{let{index:e,start:t,workspace:n}=d();n?a.history.go(t-1-e):U8(a.history,t-e,()=>void i({to:`/`,replace:!0}))},t[38]=i,t[39]=a.history,t[40]=d,t[41]=H):H=t[41];let U=H,W;t[42]!==r||t[43]!==U||t[44]!==S?(W=(e,t)=>{if(!e){if(t.reason===`escape-key`){if(s5(t.event?.target??null))return;if(r!==void 0){S();return}}(t.reason!==`outside-press`||c5(t.event?.target??null))&&U()}},t[42]=r,t[43]=U,t[44]=S,t[45]=W):W=t[45];let G,K;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)($V,{children:`Settings`}),K=(0,Q.jsx)(nH,{children:`/`}),t[46]=G,t[47]=K):(G=t[46],K=t[47]);let q;t[48]!==B.label||t[49]!==r||t[50]!==S?(q=(0,Q.jsx)($V,{children:r===void 0?(0,Q.jsx)(`h2`,{children:(0,Q.jsx)(tH,{children:B.label})}):(0,Q.jsx)(eH,{render:(0,Q.jsx)(`button`,{type:`button`,onClick:S}),children:`Computers`})}),t[48]=B.label,t[49]=r,t[50]=S,t[51]=q):q=t[51];let ee;t[52]!==V||t[53]!==r?(ee=r!==void 0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(nH,{children:`/`}),(0,Q.jsx)($V,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`min-w-0`,children:(0,Q.jsx)(tH,{className:`min-w-0`,children:V})})})]}),t[52]=V,t[53]=r,t[54]=ee):ee=t[54];let J;t[55]!==q||t[56]!==ee?(J=(0,Q.jsx)(ZV,{className:`min-w-0 flex-1`,children:(0,Q.jsxs)(QV,{className:`min-w-0 flex-nowrap`,children:[G,K,q,ee]})}),t[55]=q,t[56]=ee,t[57]=J):J=t[57];let te;t[58]!==h||t[59]!==J?(te=(0,Q.jsx)(`header`,{ref:h,className:`settings-bar flex min-h-12 shrink-0 items-center gap-2 border-b pr-12 pl-4`,children:J}),t[58]=h,t[59]=J,t[60]=te):te=t[60];let ne;t[61]!==B.id||t[62]!==r||t[63]!==S||t[64]!==F||t[65]!==k||t[66]!==w?(ne=$8.map(e=>{let t=e.icon,n=B.id===e.id,i=n&&r===void 0;return(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsxs)(X,{variant:i?`secondary`:`ghost`,size:`sm`,className:`shrink-0 justify-start md:w-full`,"aria-current":i?`page`:void 0,onClick:()=>{r!==void 0&&e.id===`computers`?S():w(e.id)},children:[(0,Q.jsx)(t,{}),e.label]}),e.id===`computers`?(0,Q.jsx)(`div`,{className:`hidden pl-4 md:mb-1 md:block`,children:(0,Q.jsx)(ws,{selected:r,onOpen:k,children:F})}):n&&(0,Q.jsx)(`div`,{className:`hidden md:mb-1 md:block`,children:F})]},e.id)}),t[61]=B.id,t[62]=r,t[63]=S,t[64]=F,t[65]=k,t[66]=w,t[67]=ne):ne=t[67];let re;t[68]===ne?re=t[69]:(re=(0,Q.jsx)(`div`,{className:`settings-nav flex gap-0.5 overflow-x-auto px-3 py-3 md:min-h-0 md:flex-1 md:flex-col md:overflow-x-hidden md:overflow-y-auto md:py-4`,children:ne}),t[68]=ne,t[69]=re);let ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsxs)(`p`,{className:`hidden shrink-0 px-5 py-3 text-xs tabular-nums text-muted-foreground md:block`,children:[`Porcelain `,`0.88.2`]}),t[70]=ie):ie=t[70];let ae;t[71]===re?ae=t[72]:(ae=(0,Q.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`flex shrink-0 flex-col md:min-h-0 md:w-56`,children:[re,ie]}),t[71]=re,t[72]=ae);let oe;t[73]!==O||t[74]!==B.id||t[75]!==z||t[76]!==r||t[77]!==E||t[78]!==N.attach||t[79]!==S?(oe=(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col md:border-l`,children:B.id===`computers`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{ref:O,className:r===void 0?`min-h-0 flex-1 overflow-y-auto outline-none`:`hidden`,role:`region`,"aria-label":`Computers list`,tabIndex:-1,children:(0,Q.jsx)(`div`,{className:i5,children:(0,Q.jsx)(Si,{showUpdates:r===void 0,environment:z,onOpen:E})})}),r!==void 0&&(0,Q.jsx)(a5,{attach:N.attach,children:r===`this-computer`?(0,Q.jsx)(Vi,{environment:z}):(0,Q.jsx)(pi,{environmentId:r,onForgotten:S},r)},r)]}):(0,Q.jsx)(a5,{attach:N.attach,children:B.id===`git`?(0,Q.jsx)(Ud,{}):(0,Q.jsx)(wd,{})},B.id)}),t[73]=O,t[74]=B.id,t[75]=z,t[76]=r,t[77]=E,t[78]=N.attach,t[79]=S,t[80]=oe):oe=t[80];let se;t[81]!==ae||t[82]!==oe?(se=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[ae,oe]}),t[81]=ae,t[82]=oe,t[83]=se):se=t[83];let ce;t[84]!==te||t[85]!==se?(ce=(0,Q.jsxs)(`div`,{className:`-m-4 flex min-h-0 flex-1 flex-col bg-card text-base text-card-foreground`,children:[te,se]}),t[84]=te,t[85]=se,t[86]=ce):ce=t[86];let le;t[87]!==L||t[88]!==ce?(le=(0,Q.jsx)(xz,{ref:L,finalFocus:`none`,onKeyDown:u5,"aria-label":`Settings`,className:`flex h-[min(48rem,calc(100svh-2rem))] w-[min(64rem,calc(100vw-2rem))] max-w-none flex-col overflow-clip sm:max-w-none`,children:ce}),t[87]=L,t[88]=ce,t[89]=le):le=t[89];let ue;return t[90]!==W||t[91]!==le?(ue=(0,Q.jsx)(vz,{open:!0,onOpenChange:W,children:le}),t[90]=W,t[91]=le,t[92]=ue):ue=t[92],ue}function u5(e){n5(e)&&e.stopPropagation()}function d5(e){return e.hash}function f5(e){return e.pathname}function p5(){return document.activeElement instanceof HTMLElement&&document.activeElement!==document.body?document.activeElement:null}export{l4 as $,$m as $n,mH as $t,U4 as A,lA as An,_Z as At,t3 as B,py as Bn,IK as Bt,u3 as C,XF as Cn,ZQ as Ct,I4 as D,LM as Dn,DZ as Dt,V4 as E,lN as En,AQ as Et,r3 as F,Wk as Fn,qK as Ft,o4 as G,$g as Gn,UH as Gt,j4 as H,Zv as Hn,OW as Ht,i3 as I,Ly as In,YK as It,y4 as J,Dg as Jn,yH as Jt,w4 as K,Yg as Kn,BH as Kt,L4 as L,Vy as Ln,BK as Lt,Z4 as M,eA as Mn,fJ as Mt,Q4 as N,Qk as Nn,uJ as Nt,F4 as O,Kj as On,pZ as Ot,q4 as P,Gk as Pn,eq as Pt,b4 as Q,yh as Qn,pH as Qt,G4 as R,Ny as Rn,HK as Rt,l3 as S,QF as Sn,V$ as St,N4 as T,LP as Tn,TQ as Tt,k4 as U,Xv as Un,fW as Ut,s3 as V,dy as Vn,jW as Vt,A4 as W,Yv as Wn,HH as Wt,C4 as X,Dh as Xn,wH as Xt,S4 as Y,_g as Yn,xH as Yt,D4 as Z,xh as Zn,hH as Zt,g3 as _,Sz as _n,X$ as _t,F8 as a,QB as an,yp as ar,W2 as at,d3 as b,eI as bn,w$ as bt,d8 as c,jB as cn,i0 as ct,B6 as d,bB as dn,f1 as dt,sH as en,Xm as er,O4 as et,M6 as f,rB as fn,u1 as ft,m3 as g,Tz as gn,$$ as gt,v3 as h,xz as hn,Q$ as ht,L8 as i,UV as in,Ip as ir,v4 as it,n3 as j,rA as jn,TZ as jt,B4 as k,fA as kn,vZ as kt,e8 as l,yB as ln,Z1 as lt,b3 as m,vz as mn,o1 as mt,e5 as n,YV as nn,qm as nr,p4 as nt,O8 as o,UB as on,bp as or,a2 as ot,A6 as p,iB as pn,s1 as pt,r4 as q,Ng as qn,_H as qt,t5 as r,XV as rn,Fm as rr,n4 as rt,_8 as s,AB as sn,p0 as st,l5 as t,JV as tn,Qm as tr,x4 as tt,W6 as u,vB as un,T1 as ut,_3 as v,wz as vn,q$ as vt,P4 as w,JP as wn,CQ as wt,f3 as x,$F as xn,H$ as xt,h3 as y,BR as yn,C$ as yt,a3 as z,ky as zn,LK as zt};
1351
+ `):``,...t?{replacedSubject:t.subject}:{},onBusy:o,onLookAgain:s})},t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=n,t[10]=a,t[11]=d):d=t[11];let f;return t[12]!==r||t[13]!==n||t[14]!==u||t[15]!==d?(f=(0,Q.jsx)(mQ,{scope:n,context:r,pending:u,children:d}),t[12]=r,t[13]=n,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function fQ(e){let t=(0,$.c)(7),{action:n}=e,r=n===`amend`?`Amend last commit`:`Commit changes`,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(wz,{children:r}),t[0]=r,t[1]=i);let a=n===`amend`?`The last commit is replaced by one with this message and the files you add.`:`Committed steps fold away in the review and show up in History.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Tz,{children:a}),t[2]=a,t[3]=o);let s;return t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Sz,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6],s}function pQ(e){let t=(0,$.c)(13),{scope:n,context:r,action:i,status:a,current:o,onBusy:s,onLookAgain:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Be,{label:`Reading the branch`}),t[0]=l):l=t[0];let u;t[1]!==i||t[2]!==r||t[3]!==o||t[4]!==s||t[5]!==c||t[6]!==n||t[7]!==a?(u=e=>(0,Q.jsx)(hQ,{scope:n,context:r,action:i,status:{...a,branch:e.branch??a.branch},expectedStatus:a,current:o,onBusy:s,onLookAgain:c}),t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=n,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==n||t[11]!==u?(d=(0,Q.jsx)(mQ,{scope:n,context:r,pending:l,children:u}),t[9]=r,t[10]=n,t[11]=u,t[12]=d):d=t[12],d}function mQ(e){let t=(0,$.c)(12),{scope:n,context:r,pending:i,children:a}=e,o=sB(n,r.connection);if(Mi(o.result)){let e;t[0]===o.result.cause?e=t[1]:(e=Un(Ra(o.result.cause)),t[0]=o.result.cause,t[1]=e);let n;t[2]===e?n=t[3]:(n=(0,Q.jsx)(rX,{text:e}),t[2]=e,t[3]=n);let r;t[4]===o.refresh?r=t[5]:(r=(0,Q.jsx)(X,{variant:`outline`,onClick:o.refresh,children:`Read status again`}),t[4]=o.refresh,t[5]=r);let i;return t[6]!==n||t[7]!==r?(i=(0,Q.jsxs)(Q.Fragment,{children:[n,r]}),t[6]=n,t[7]=r,t[8]=i):i=t[8],i}if(!Bo(o.result))return i;let s;return t[9]!==a||t[10]!==o.result.value?(s=a(o.result.value),t[9]=a,t[10]=o.result.value,t[11]=s):s=t[11],s}function hQ(e){let t=(0,$.c)(77),{scope:n,context:r,action:i,status:a,expectedStatus:o,current:s,onBusy:c,onLookAgain:l}=e,u=o===void 0?a:o,d=s===void 0?a:s,f=a.branch,[p,m]=(0,Z.useState)(`Porcelain review`),[h,g]=(0,Z.useState)(f?.stashes?.[0]?.oid??``),[_,v]=(0,Z.useState)(i===`stash-create`),y=na(r),b;t[0]!==u||t[1]!==c||t[2]!==l?(b={expectedStatus:u,onBusy:c,onLookAgain:l},t[0]=u,t[1]=c,t[2]=l,t[3]=b):b=t[3];let x=kX(n,i,r,b),{busy:C,uncertain:w,outcome:T,error:E}=x,D;t[4]===T?D=t[5]:(D=T&&Tc(T),t[4]=T,t[5]=D);let O=!!D,k;t[6]!==i||t[7]!==x||t[8]!==p||t[9]!==_||t[10]!==h||t[11]!==y?(k=e=>{e.preventDefault(),y||x.onSubmit(MY(i,{message:p,stashOid:h,option:_}))},t[6]=i,t[7]=x,t[8]=p,t[9]=_,t[10]=h,t[11]=y,t[12]=k):k=t[12];let A=C||w,j;t[13]!==i||t[14]!==_?(j=i===`stash-create`&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_?`Tracked changes and new files are set aside until you pop the stash.`:`Tracked changes are set aside. New files stay in the worktree.`}),t[13]=i,t[14]=_,t[15]=j):j=t[15];let M;t[16]!==i||t[17]!==x.messageLimit||t[18]!==p?(M=i===`stash-create`&&(0,Q.jsxs)(Oo,{children:[(0,Q.jsx)(Qa,{htmlFor:`git-message`,children:`Message`}),(0,Q.jsx)(gH,{id:`git-message`,value:p,onChange:e=>m(e.target.value),required:!0,maxLength:x.messageLimit})]}),t[16]=i,t[17]=x.messageLimit,t[18]=p,t[19]=M):M=t[19];let N;t[20]!==i||t[21]!==f||t[22]!==h?(N=(i===`stash-apply`||i===`stash-pop`)&&(0,Q.jsxs)(Oo,{children:[(0,Q.jsx)(Qa,{htmlFor:`git-stash`,children:`Stash`}),f?.stashes?.length?(0,Q.jsxs)(oa,{items:f.stashes.map(_Q),value:h,onValueChange:e=>{e&&g(e)},children:[(0,Q.jsx)(ni,{id:`git-stash`,children:(0,Q.jsx)(ec,{})}),(0,Q.jsx)(Zi,{children:f.stashes.map(gQ)})]}):(0,Q.jsx)(ei,{id:`git-stash`,value:h,onChange:e=>g(e.target.value),required:!0,pattern:`([a-f0-9]{40}|[a-f0-9]{64})`})]}),t[20]=i,t[21]=f,t[22]=h,t[23]=N):N=t[23];let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>v(e===!0),t[24]=P):P=t[24];let F;t[25]===_?F=t[26]:(F=(0,Q.jsx)(OX,{checked:_,onCheckedChange:P}),t[25]=_,t[26]=F);let I=i===`stash-create`?`Include untracked files`:`Restore staged changes`,L;t[27]!==F||t[28]!==I?(L=(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[F,I]}),t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]!==L||t[31]!==A||t[32]!==j||t[33]!==M||t[34]!==N?(R=(0,Q.jsxs)(`fieldset`,{disabled:A,className:`flex min-w-0 flex-col gap-4`,children:[j,M,N,L]}),t[30]=L,t[31]=A,t[32]=j,t[33]=M,t[34]=N,t[35]=R):R=t[35];let z;t[36]!==d||t[37]!==u||t[38]!==T||t[39]!==O?(z=O?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm`,children:er(S(u,d))}):(0,Q.jsx)(vQ,{outcome:T}),t[36]=d,t[37]=u,t[38]=T,t[39]=O,t[40]=z):z=t[40];let B;t[41]!==T||t[42]!==w?(B=w&&!T&&(0,Q.jsx)(`p`,{role:`status`,children:`Outcome not yet confirmed`}),t[41]=T,t[42]=w,t[43]=B):B=t[43];let V;t[44]===E?V=t[45]:(V=E?(0,Q.jsx)(rX,{text:Un(E)}):null,t[44]=E,t[45]=V);let H;t[46]!==C||t[47]!==x.lookAgain||t[48]!==l||t[49]!==O?(H=O&&l&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:C,onClick:x.lookAgain,children:`Look again`}),t[46]=C,t[47]=x.lookAgain,t[48]=l,t[49]=O,t[50]=H):H=t[50];let U;t[51]!==C||t[52]!==x.checkOutcome||t[53]!==x.operation||t[54]!==T?(U=x.operation&&!C&&!(T&&ye(T))&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,onClick:x.checkOutcome,children:`Check outcome`}),t[51]=C,t[52]=x.checkOutcome,t[53]=x.operation,t[54]=T,t[55]=U):U=t[55];let W;t[56]!==C||t[57]!==x.clearUnconfirmed||t[58]!==y?(W=x.clearUnconfirmed&&(0,Q.jsx)(X,{type:`button`,variant:`outline`,className:`self-start`,disabled:C||!!y,onClick:x.clearUnconfirmed,children:`Clear unconfirmed action`}),t[56]=C,t[57]=x.clearUnconfirmed,t[58]=y,t[59]=W):W=t[59];let G=!!y||C||w||O,K;t[60]!==i||t[61]!==C?(K=C?`Working…`:LY(i),t[60]=i,t[61]=C,t[62]=K):K=t[62];let q;t[63]!==G||t[64]!==K||t[65]!==y?(q=(0,Q.jsx)(X,{type:`submit`,className:`self-end`,"aria-description":y,disabled:G,children:K}),t[63]=G,t[64]=K,t[65]=y,t[66]=q):q=t[66];let J;return t[67]!==R||t[68]!==z||t[69]!==B||t[70]!==V||t[71]!==H||t[72]!==U||t[73]!==W||t[74]!==q||t[75]!==k?(J=(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:k,children:[R,z,B,V,H,U,W,q]}),t[67]=R,t[68]=z,t[69]=B,t[70]=V,t[71]=H,t[72]=U,t[73]=W,t[74]=q,t[75]=k,t[76]=J):J=t[76],J}function gQ(e){return(0,Q.jsxs)(Ps,{value:e.oid,children:[(0,Q.jsx)(fr,{text:e.message}),(0,Q.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:By(e.oid)})]},e.oid)}function _Q(e){return{value:e.oid,label:`${e.message} · ${By(e.oid)}`}}function vQ(e){let t=(0,$.c)(9),{outcome:n}=e;if(!n)return null;if(lr(n)&&n.state!==`running`){let e;t[0]===n?e=t[1]:(e=nt(n),t[0]=n,t[1]=e);let r;return t[2]===e?r=t[3]:(r=(0,Q.jsx)(rX,{text:e}),t[2]=e,t[3]=r),r}let r=n.state,i;t[4]===n?i=t[5]:(i=yQ(n),t[4]=n,t[5]=i);let a;return t[6]!==n.state||t[7]!==i?(a=(0,Q.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[r,i]}),t[6]=n.state,t[7]=i,t[8]=a):a=t[8],a}function yQ({message:e,reason:t}){return e?` · ${e}`:t?` · ${t.replaceAll(`_`,` `).toLowerCase()}`:``}function bQ(e){let t=(0,$.c)(76),{scope:n,context:r}=e,{connection:i}=r,{operations:a}=La(i.operations.state),o=de(qr(iB(n,i))),[s,c]=(0,Z.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>e=>{if(!e)return;let t=()=>c(e.getClientRects().length===0);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[0]=l):l=t[0];let[u]=(0,Z.useState)(l),[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=o!=null&&p(St(o)).kind===`hint`,_=d||g,v=sB(n,i,_),y=de(qr(v.result)),b=dB(n,i),x=Yu(i),S;t[1]===x?S=t[2]:(S=Hd(x),t[1]=x,t[2]=S);let C=S,w;t[3]!==C||t[4]!==x?(w=C?void 0:rd(x),t[3]=C,t[4]=x,t[5]=w):w=t[5];let T=w,[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(null),[M,P]=(0,Z.useState)(null),F=hH(),[I,L]=(0,Z.useState)(null),[R,z]=(0,Z.useState)(null),B=na(r),V=SQ,H;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>f(!0),t[6]=H):H=t[6];let U;t[7]!==T||t[8]!==C?(U=C?{kind:`ready`,strategy:C}:{kind:`blocked`,reason:T??`Changes & Git settings for this computer are unavailable.`},t[7]=T,t[8]=C,t[9]=U):U=t[9];let G,K;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{e&&j(null),k(e)},K=e=>{j(e.type===`error`?e:null),e.type!==`error`&&V(e)},t[10]=G,t[11]=K):(G=t[10],K=t[11]);let q;t[12]!==v||t[13]!==b||t[14]!==U?(q={details:v,enableDetails:H,pull:U,notify:V,onProgress:G,onResult:K,refreshLook:b,onLooked:z},t[12]=v,t[13]=b,t[14]=U,t[15]=q):q=t[15];let J=fX(n,r,q);if(o==null){let e,n,r;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(oe({variant:`outline`}),`rounded-r-none @max-lg/pane:w-7 @max-lg/pane:px-0`),e=(0,Q.jsx)(gX,{action:`commit`,className:`size-3.5`}),n=(0,Q.jsx)(`span`,{className:`hidden @min-lg/pane:inline`,children:`Commit`}),t[16]=e,t[17]=n,t[18]=r):(e=t[16],n=t[17],r=t[18]);let i;t[19]===r?i=t[20]:(i=(0,Q.jsxs)(`span`,{className:r,children:[e,n]}),t[19]=r,t[20]=i);let a;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`span`,{className:Y(oe({variant:`outline`,size:`icon`}),`rounded-l-none border-l-0`)}),t[21]=a):a=t[21];let o;return t[22]!==i||t[23]!==a?(o=(0,Q.jsxs)(`span`,{"aria-hidden":`true`,className:`invisible flex shrink-0`,children:[i,a]}),t[22]=i,t[23]=a,t[24]=o):o=t[24],o}let ee={...St(o),branch:ja(o.branch,_?y?.branch:void 0)},te;t[25]===M?te=t[26]:(te=e=>e.id===M,t[25]=M,t[26]=te);let ne=FY.find(te),re=p(ee),ie=re.kind===`run`&&re.action===`pull`&&!C,ae=B??(ie&&T?T:Fn(re,ee)),se=Mt(re,ee),ce=W(ee),le=J.running,ue;t[27]!==v.result||t[28]!==_?(ue=_&&Xi(v.result),t[27]=v.result,t[28]=_,t[29]=ue):ue=t[29];let fe=ue,pe=fe?IY.slice(0,1):IY,me=e=>{B||(N(e)?J.runNetwork(e,ee.branch):(L(document.activeElement instanceof HTMLElement?document.activeElement:null),z(ee),P(e)))},he;t[30]===le?he=t[31]:(he=e=>{e||j(null),le&&k(e)},t[30]=le,t[31]=he);let ge=!!le,_e;t[32]===re?_e=t[33]:(_e=CQ(re),t[32]=re,t[33]=_e);let ve;t[34]===_e?ve=t[35]:(ve=(0,Q.jsx)(gX,{action:_e,className:`size-3.5`}),t[34]=_e,t[35]=ve);let ye;t[36]!==ge||t[37]!==ve?(ye=(0,Q.jsx)(Yi,{pending:ge,children:ve}),t[36]=ge,t[37]=ve,t[38]=ye):ye=t[38];let be=le?`${Ys(le.name)}…`:re.label,xe=!le&&se!=null&&` ${se}`,Se;t[39]!==be||t[40]!==xe?(Se=(0,Q.jsxs)(`span`,{ref:u,"aria-hidden":`true`,className:`hidden @min-lg/pane:inline`,children:[be,xe]}),t[39]=be,t[40]=xe,t[41]=Se):Se=t[41];let Ce;t[42]!==J.checkOutcome||t[43]!==A||t[44]!==le?(Ce=(0,Q.jsx)(Zo,{align:`end`,className:`w-80`,children:A&&!le?(0,Q.jsxs)(ha,{children:[(0,Q.jsx)(Jr,{children:A.title}),A.description!==void 0&&(0,Q.jsx)(rX,{text:A.description})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,Q.jsx)(Jr,{children:le?`${Ys(le.name)}…`:`Git action…`}),(0,Q.jsx)(`ol`,{className:`flex flex-col gap-0.5 font-mono text-2xs leading-4`,children:le?.operation?.receipt?.progress.length?le.operation.receipt.progress.slice(-4).map(xQ):(0,Q.jsx)(`li`,{className:`text-muted-foreground`,children:`Waiting for Git…`})}),le&&A?.description&&(0,Q.jsx)(rX,{text:A.description}),le&&(0,Q.jsx)(ji,{variant:`outline`,className:`self-start`,pending:le.checking,onClick:J.checkOutcome,children:`Check outcome`})]})}),t[42]=J.checkOutcome,t[43]=A,t[44]=le,t[45]=Ce):Ce=t[45];let Te;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>{h(e),e&&f(!0)},t[46]=Te):Te=t[46];let Ee;t[47]===F?Ee=t[48]:(Ee=e=>F.attach(e),t[47]=F,t[48]=Ee);let De=!!B||le!=null,Oe;t[49]!==Ee||t[50]!==De||t[51]!==B?(Oe=(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{ref:Ee,variant:`outline`,size:`icon`,"aria-label":`Git actions`,disabled:De,"aria-description":B})}),t[49]=Ee,t[50]=De,t[51]=B,t[52]=Oe):Oe=t[52];let ke;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsx)(sc,{className:`size-3.5`}),t[53]=ke):ke=t[53];let Ae;t[54]===Oe?Ae=t[55]:(Ae=(0,Q.jsx)(Ze,{render:Oe,children:ke}),t[54]=Oe,t[55]=Ae);let je=B??`Git actions`,Me;t[56]===je?Me=t[57]:(Me=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:je}),t[56]=je,t[57]=Me);let Pe;t[58]!==Ae||t[59]!==Me?(Pe=(0,Q.jsxs)(ot,{children:[Ae,Me]}),t[58]=Ae,t[59]=Me,t[60]=Pe):Pe=t[60];let Fe=ce?(0,Q.jsx)(QX,{tracking:Ky(ce,null)}):(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(_g,{className:`size-3.5 shrink-0`}),`Git actions`]}),Ie;t[61]===Fe?Ie=t[62]:(Ie=(0,Q.jsx)(ct,{children:(0,Q.jsx)(bc,{children:Fe})}),t[61]=Fe,t[62]=Ie);let Le;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,Q.jsx)(we,{}),t[63]=Le):Le=t[63];let Re=pe.map((e,t)=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(ct,{children:e.actions.map(e=>{let t=a.get(ai(n,e.id)),r=e.id.startsWith(`stash-`)&&t&&(!t.receipt||!pc(t.receipt)),i=r?null:RY(e.id,ee,T),o=B??(i?void 0:Va(e.id,ee));return(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(dn,{className:`data-disabled:pointer-events-auto`,disabled:!!B||i!=null,"aria-description":B,onSelect:()=>me(e.id)}),children:[(0,Q.jsx)(gX,{action:e.id}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsx)(fr,{text:e.label}),(r||i)&&(0,Q.jsx)(`span`,{className:`text-xs whitespace-normal text-muted-foreground`,children:r?`Check the previous outcome.`:i})]})]}),(0,Q.jsxs)(Yo,{children:[e.description,o&&` ${o}`]})]},e.id)})}),(fe||t<pe.length-1)&&(0,Q.jsx)(we,{})]},e.id)),ze;t[64]===fe?ze=t[65]:(ze=fe&&(0,Q.jsx)(Be,{label:`Reading Git status`,className:`mx-2 my-1`}),t[64]=fe,t[65]=ze);let Ve=!fe&&(ce?.discarded?.length??0)>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(we,{}),(0,Q.jsxs)(ct,{children:[(0,Q.jsx)(bc,{children:`Discarded`}),ce?.discarded?.map(e=>{let t=e.kind===`rename`?`Restore discarded rename of ${e.path}`:`Restore discarded hunk of ${e.path}`;return(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(dn,{onSelect:()=>{h(!1),J.restoreDiscarded(e)}}),children:[(0,Q.jsx)(F_,{}),(0,Q.jsx)(fr,{className:`min-w-0`,text:t,propagateEscape:!0})]}),(0,Q.jsxs)(Yo,{children:[t,` · Kept until you restore it`]})]},e.oid)})]})]}),He;t[66]!==fe||t[67]!==Ie||t[68]!==Re||t[69]!==ze||t[70]!==Ve?(He=(0,Q.jsxs)(Ne,{align:`end`,className:`w-76`,"aria-busy":fe,children:[Ie,Le,Re,ze,Ve]}),t[66]=fe,t[67]=Ie,t[68]=Re,t[69]=ze,t[70]=Ve,t[71]=He):He=t[71];let Ue;return t[72]!==m||t[73]!==Pe||t[74]!==He?(Ue=(0,Q.jsxs)(Wt,{open:m,onOpenChange:Te,children:[Pe,He]}),t[72]=m,t[73]=Pe,t[74]=He,t[75]=Ue):Ue=t[75],(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(dX,{"aria-label":`Git controls`,className:`shrink-0`,children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(uo,{open:le!=null&&O||A!=null,onOpenChange:he,children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(yo,{render:(0,Q.jsx)(X,{variant:`outline`,size:s?`icon`:`default`,"aria-label":le?`${Ys(le.name)} in progress: show progress`:re.label,disabled:le==null&&(re.kind===`hint`||ie||!!B),"aria-busy":!!le,"aria-description":B,focusableWhenDisabled:!0,className:`aria-disabled:cursor-default`,onClick:()=>{le||A||B||(re.kind===`commit`?me(`commit`):re.kind===`stash`?me(`stash-apply`):re.kind===`run`&&J.runNetwork(re.action,ee.branch))}})}),children:[ye,Se]}),Ce]}),(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:le?`${Ys(le.name)} in progress: show progress`:ae})]}),Ue]}),M==null?null:(0,Q.jsx)(vz,{open:!0,closeOnOutsidePress:!1,onOpenChange:e=>{!e&&!E&&P(null)},children:(0,Q.jsxs)(xz,{finalFocus:()=>I?.isConnected?I:F.element,"aria-busy":E,className:`max-h-[min(90svh,48rem)] overflow-y-auto sm:max-w-2xl`,children:[ne?.id!==`commit`&&ne?.id!==`amend`&&(0,Q.jsxs)(Sz,{children:[(0,Q.jsx)(wz,{children:ne?.label??`Git action`}),ne?.id!==`stash-create`&&(0,Q.jsx)(Tz,{children:wQ(ne?.id)})]}),(0,Q.jsx)(uQ,{scope:n,context:r,entry:M,status:R??ee,current:ee,onBusy:D,onLookAgain:J.lookAgain})]})})]})}function xQ(e){return(0,Q.jsx)(fr,{render:(0,Q.jsx)(`li`,{}),text:e},e)}function SQ(e){let{title:t,description:n,type:r}=e;return ks({title:t,description:n===void 0?void 0:(0,Q.jsx)(nX,{text:n}),type:r})}function CQ(e){return e.kind===`run`?e.action:e.kind===`stash`?`stash-apply`:`commit`}function wQ(e){return e===`stash-pop`?`Its changes come back into the working tree and the stash is dropped.`:e===`stash-apply`?`Its changes come back into the working tree and the stash is kept.`:`Every change, new files included, is set aside until you pop the stash.`}function TQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Me(`(min-width: 1280px)`),e[0]=t):t=e[0],Ot(t)}var EQ={kind:`review`},DQ=[`review`,`handoff`,`walkthrough`,`walkthrough-changes`],OQ={kind:`all-changes`},kQ={kind:`specs`},AQ={kind:`branch`},jQ={kind:`graph`};function MQ(e){return{kind:`pull-request`,projectId:e.projectId,number:e.number,...e.environmentId===e.shownOn?{}:{environmentId:e.environmentId}}}function NQ(e){return(t,n)=>e({kind:n,path:t.path},{path:t.path,lines:t})}function PQ(e){switch(e.kind){case`review`:return`review`;case`all-changes`:return`all-changes`;case`specs`:return`specs`;case`change`:return`change:${e.path}`;case`file`:return`file:${e.path}`;case`commit`:return`commit:${e.oid}`;case`pull-request`:return`pull-request:${e.projectId}:${e.number}${e.environmentId?`:environment=${encodeURIComponent(e.environmentId)}`:``}`;case`branch`:return`branch`;case`branch-file`:return`branch:${e.path}`;case`graph`:return`graph`;case`timeline`:return`timeline:${e.path}`;case`walkthrough-step`:return`walkthrough-step:${e.step}`}}function FQ(e){if(e==null||e===``)return null;if(DQ.includes(e))return EQ;if(e===`all-changes`)return OQ;if(e===`specs`)return kQ;if(e===`branch`)return AQ;if(e===`graph`)return jQ;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);if(r===``)return null;switch(n){case`change`:case`file`:case`timeline`:return{kind:n,path:r};case`branch`:return{kind:`branch-file`,path:r};case`walkthrough-step`:return/^[1-9][0-9]*$/.test(r)&&Number.isSafeInteger(Number(r))?{kind:n,step:Number(r)}:null;case`commit`:return/^[0-9a-f]{4,64}$/.test(r)?{kind:n,oid:r}:null;case`pull-request`:{let[e,t,i,a]=r.split(`:`);return e!==void 0&&e.length>0&&t!==void 0&&a===void 0&&(i===void 0||/^environment=[a-zA-Z0-9_-]+$/.test(i))&&/^[1-9][0-9]*$/.test(t)&&Number.isSafeInteger(Number(t))?{kind:n,projectId:e,number:Number(t),...i?{environmentId:i.slice(12)}:{}}:null}default:return null}}function IQ(e){switch(e?.kind){case void 0:return`This worktree`;case`review`:return`The Walkthrough`;case`walkthrough-step`:return`This step`;case`file`:return`This file`;case`commit`:return`This commit`;case`pull-request`:return`This pull request`;case`graph`:return`The commit graph`;case`timeline`:return`This file history`;case`all-changes`:case`specs`:case`change`:case`branch`:case`branch-file`:return`These changes`}}function LQ(e){let t=FQ(e);return t?PQ(t):void 0}function RQ(e,t,n){if(e.includes(t))return[...e];let r=n==null?-1:e.indexOf(n),i=[...e];return i.splice(r===-1?i.length:r+1,0,t),i}var zQ={changes:`Changes`,files:`Files`,history:`History`};function BQ(e){switch(e.kind){case`review`:return`Review`;case`all-changes`:return`All changes`;case`specs`:return`Specs`;case`branch`:return`All branch changes`;case`graph`:return`Commit graph`;case`commit`:return By(e.oid);case`pull-request`:return`PR #${e.number}`;case`change`:case`file`:case`branch-file`:return e.path.split(`/`).at(-1)??e.path;case`timeline`:return`Timeline of ${e.path.split(`/`).at(-1)??e.path}`;case`walkthrough-step`:return`Step ${e.step}`}}function VQ(e){let t=FQ(e.entry),n=(e.firstDocument!==void 0&&(!t||t.kind===`review`)?e.firstDocument:void 0)??(t?BQ(t):zQ[e.surface??`files`]),r=e.project?`${n} — ${e.project}`:n;return e.environment?`${r} · ${e.environment}`:r}var HQ=()=>({tabs:[],pinned:[]}),UQ=`review`;function WQ(e){return e===UQ}function GQ(e,t){let n=`${e}-${encodeURIComponent(t)}`;return{tab:`${n}-tab`,panel:`${n}-panel`}}function KQ(e,t){let n=LQ(e);return n===void 0||!WQ(n)?n:t?XQ(qQ(t)).at(-1):void 0}function qQ(e){return{tabs:e.tabs.filter(e=>!WQ(e)),pinned:e.pinned.filter(e=>!WQ(e))}}function JQ(e){return{tabs:[UQ,...e.tabs.filter(e=>!WQ(e))],pinned:e.pinned.filter(e=>!WQ(e))}}function YQ(e,t,n){if(e[t]?.tabs.includes(n))return t;let r=+(t===0);return e[r]?.tabs.includes(n)?r:t}function XQ(e){return[...e.tabs.filter(WQ),...e.pinned.filter(t=>!WQ(t)&&e.tabs.includes(t)),...e.tabs.filter(t=>!WQ(t)&&!e.pinned.includes(t))]}function ZQ(e,t,n){return e.tabs.includes(t)?e:{...e,tabs:RQ(e.tabs,t,n)}}function QQ(e,t){return WQ(t)?e:{tabs:e.tabs.filter(e=>e!==t),pinned:e.pinned.filter(e=>e!==t)}}function $Q(e,t){return{...e,tabs:e.tabs.filter(n=>WQ(n)||n===t||e.pinned.includes(n))}}function e$(e){return{...e,tabs:e.tabs.filter(t=>WQ(t)||e.pinned.includes(t))}}function t$(e,t){return WQ(t)?e:e.pinned.includes(t)?{...e,pinned:e.pinned.filter(e=>e!==t)}:{...e,pinned:[...e.pinned,t]}}function n$(e,t,n){let r=FQ(e);return r?.kind===`file`&&ed(r.path,t)?PQ({kind:`file`,path:bd(r.path,t,n)}):e}function r$(e,t,n){let r=e=>[...new Set(e.map(e=>n$(e,t,n)))];return{tabs:r(e.tabs),pinned:r(e.pinned)}}function i$(e,t){let n=FQ(e);return n?.kind===`file`&&ed(n.path,t)}function a$(e,t){return{tabs:e.tabs.filter(e=>!i$(e,t)),pinned:e.pinned.filter(e=>!i$(e,t))}}function o$(e,t,n){if(n.tabs.includes(t))return t;let r=XQ(e),i=new Set(XQ(n)),a=r.indexOf(t);return a===-1?null:[...r.slice(a+1),...r.slice(0,a).reverse()].find(e=>i.has(e)&&!WQ(e))??e.tabs.find(e=>i.has(e))??null}function s$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c$(e){return Array.isArray(e)?[...new Set(e.flatMap(e=>{let t=typeof e==`string`?LQ(e):void 0;return t===void 0?[]:[t]}))]:[]}function l$(e){if(!s$(e)||!Array.isArray(e.panes))return null;let t=e.panes.map(e=>{let t=c$(s$(e)?e.tabs:void 0);return{tabs:t,pinned:c$(s$(e)?e.pinned:void 0).filter(e=>t.includes(e))}}).map((e,t)=>t===0?e:qQ(e)).filter((e,t)=>t===0||e.tabs.length>0);return t.length>0?t:null}function u$(e){return e===null?`Open to the side`:e===`left`?`Open in the right pane`:`Open in the left pane`}function d$(e,t,n){let r=t.flatMap(e=>XQ(e)),i=n===null?e:[n,...e],a=new Set(r);return[...new Set([...i,...r])].filter(e=>a.has(e))}function f$(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function p$(e){return!e||typeof e!=`object`||!(`folded`in e)||!(`expanded`in e)?{folded:[],expanded:[]}:f$(e.folded)&&f$(e.expanded)?{folded:e.folded,expanded:e.expanded}:{folded:[],expanded:[]}}function m$(e,t,n=!1){return e.folded.includes(t)||n&&!e.expanded.includes(t)}function h$(e,t,n){let r=new Set(e.folded),i=new Set(e.expanded);for(let e of t)n?(r.add(e),i.delete(e)):(r.delete(e),i.add(e));return{folded:[...r],expanded:[...i]}}function g$(e,t){return e?.owner===t?void 0:e}var _$=Qt(Ut({saved:fi})),v$=Qt(Ut({focused:L([0,1])})),y$=Ka([$s(J),$s(J)]),b$=Qt(Ut({activeEntries:y$})),x$=Pa.pipe(Ft(Ut({panes:$s(yc(Ut({tabs:yc(J),pinned:yc(J)}))),saved:fi,focused:L([0,1]),activeEntries:$s(y$)}),{decode:pr(e=>({panes:l$(e),saved:_$(e).pipe(fn(e=>e.saved),bt(()=>!0)),focused:v$(e).pipe(fn(e=>e.focused),bt(()=>0)),activeEntries:b$(e).pipe(fn(e=>e.activeEntries),kt)})),encode:Jn()})),S$=Pa.pipe(Ft(Ut({folded:yc(J),expanded:yc(J)}),{decode:pr(p$),encode:Jn()})),C$=dt(e=>$n({runtime:Od,key:`porcelain.tabs.${e}`,schema:x$,defaultValue:()=>({panes:null,saved:!1,focused:0,activeEntries:null})})),w$=dt(e=>Oe({recent:[],actives:null}).pipe(x)),T$=dt(e=>$n({runtime:Od,key:e,schema:S$,defaultValue:()=>({folded:[],expanded:[]})}));function E$(e){let t=(0,$.c)(25),n;t[0]===e?n=t[1]:(n=C$(e),t[0]=e,t[1]=n);let r=n,{panes:i,saved:a,focused:o,activeEntries:s}=Ot(r),c=Da(r),l=Ot(E),u;t[2]===e?u=t[3]:(u=w$(e),t[2]=e,t[3]=u);let d=u,f;t[4]!==r||t[5]!==l?(f=e=>{let t=l.get(r);t.focused!==e&&l.set(r,{...t,focused:e})},t[4]=r,t[5]=l,t[6]=f):f=t[6];let p;t[7]===c?p=t[8]:(p=e=>c(t=>({...t,panes:e,saved:!0})),t[7]=c,t[8]=p);let m;t[9]!==d||t[10]!==r||t[11]!==l?(m=()=>({panes:l.get(r).panes,actives:l.get(d).actives}),t[9]=d,t[10]=r,t[11]=l,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==l?(h=e=>{l.set(d,{...l.get(d),actives:e})},t[13]=d,t[14]=l,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==o||t[18]!==i||t[19]!==a||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g={panes:i,saved:a,focused:o,activeEntries:s,setFocused:f,save:p,latest:m,saveActives:h},t[16]=s,t[17]=o,t[18]=i,t[19]=a,t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}function D$(e,t){let n=(0,$.c)(7),r=`porcelain.folds.${e}.${t}`,i;n[0]===r?i=n[1]:(i=T$(r),n[0]=r,n[1]=i);let a=i,o=Ot(a),s=Da(a),c;n[2]===s?c=n[3]:(c=(e,t)=>s(n=>h$(n,e,t)),n[2]=s,n[3]=c);let l;return n[4]!==c||n[5]!==o?(l={folds:o,setCollapsed:c},n[4]=c,n[5]=o,n[6]=l):l=n[6],l}var O$=dt(e=>Oe(25).pipe(x)),k$=dt(e=>Oe({viewer:null,restored:null})),A$=dt(e=>Oe({scrollTop:0,selection:null,focused:void 0}).pipe(x));function j$(e){let t=(0,$.c)(33),n=(0,Z.useId)(),r;t[0]===n?r=t[1]:(r=k$(n),t[0]=n,t[1]=r);let i=r;Lt(i);let a=Ot(E),o;t[2]===e?o=t[3]:(o=A$(e),t[2]=e,t[3]=o);let s=o,c,l,u,d,f,p;t[4]!==s||t[5]!==a?(c=()=>a.get(s).scrollTop,l=()=>a.get(s).selection,u=()=>a.get(s).focused,d=e=>a.set(s,{...a.get(s),focused:e}),f=e=>{a.set(s,{...a.get(s),scrollTop:e})},p=e=>{a.set(s,{...a.get(s),selection:e})},t[4]=s,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):(c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11]);let m;t[12]!==i||t[13]!==a?(m=e=>a.get(i).viewer?.scrollTo(e),t[12]=i,t[13]=a,t[14]=m):m=t[14];let h;t[15]!==i||t[16]!==e||t[17]!==s||t[18]!==a?(h=(t,n)=>{let r=a.get(i);(r.restored?.viewer!==t||r.restored.owner!==e)&&(t.scrollTo({type:`position`,position:a.get(s).scrollTop+n,behavior:`instant`}),a.set(i,{...r,restored:{viewer:t,owner:e}}))},t[15]=i,t[16]=e,t[17]=s,t[18]=a,t[19]=h):h=t[19];let g;t[20]!==i||t[21]!==a?(g=e=>{if(e)return a.set(i,{...a.get(i),viewer:e}),()=>{let t=a.get(i);t.viewer===e&&a.set(i,{...t,viewer:null})}},t[20]=i,t[21]=a,t[22]=g):g=t[22];let _;return t[23]!==h||t[24]!==g||t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==d||t[29]!==f||t[30]!==p||t[31]!==m?(_={position:c,selection:l,focused:u,rememberFocus:d,rememberPosition:f,rememberSelection:p,scrollTo:m,restorePosition:h,attach:g},t[23]=h,t[24]=g,t[25]=c,t[26]=l,t[27]=u,t[28]=d,t[29]=f,t[30]=p,t[31]=m,t[32]=_):_=t[32],_}var M$=dt(e=>Oe(null).pipe(x)),N$=dt(e=>Oe(t=>{let n=M$({worktreeId:e.worktreeId,entry:e.entry});t.set(n,e.path),t.addFinalizer(()=>{t.registry.getNodes().has(n)&&t.registry.get(n)===e.path&&t.registry.set(n,null)})})),P$=Oe(null);function F$(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=e?N$(e):P$,t[0]=e,t[1]=n),Lt(n)}function I$(e,t){return Ot(M$({worktreeId:e,entry:t??``}))??void 0}var L$=$n({runtime:Od,key:`porcelain.review-panel.open`,schema:fi,defaultValue:()=>!0}).pipe(x);function R$(){let e=(0,$.c)(3),t=Ot(L$),n=Da(L$),r;return e[0]!==t||e[1]!==n?(r={open:t,setOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}var z$=dt(e=>Oe(void 0).pipe(x)),B$=new Map,V$=dt(e=>Oe(t=>{let n=Symbol();B$.set(e.worktreeId,{owner:n,title:e.title}),t.set(z$(e.worktreeId),e.title),t.addFinalizer(()=>{g$(B$.get(e.worktreeId),n)||(B$.delete(e.worktreeId),t.set(z$(e.worktreeId),void 0))})})),H$=Oe(aa(0)),U$=Oe(vo($i).pipe(Cs(ko(`1 second`).pipe(Ta(()=>$i)))));function W$(e){let t=(0,$.c)(2),n=Ot(e?U$:H$),r;return t[0]===n?r=t[1]:(r=bt(qr(n),G$),t[0]=n,t[1]=r),r}function G$(){return 0}var K$=Oe(void 0).pipe(x),q$=dt(e=>Oe(null).pipe(x));function J$(e){let t=(0,$.c)(8),{worktreeId:n,entry:r,side:i,onSearch:a,fallback:o,focused:s,setFocused:c,ready:l,focusBoundary:u,focusBoundaryOpen:d}=e,{panes:f,activeEntries:p,save:m,latest:h,saveActives:g}=E$(n),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[void 0,void 0],t[0]=_):_=t[0];let[v,y]=(0,Z.useState)(_),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[null,null],t[1]=b):b=t[1];let[x,S]=(0,Z.useState)(b),C=(0,Z.useId)(),w;t[2]===C?w=t[3]:(w=X$(C),t[2]=C,t[3]=w);let T=Ot(w),E=T.cancel,D=[JQ(f?.[0]??HQ()),...f?.slice(1)??[]],O=KQ(i,D[1]),k=[LQ(r),O],A=e=>{let t=v[e];return t===void 0?k[e]:t??void 0},j=e=>{let t=D[e];if(!t)return null;let n=p?.[e];return n&&t.tabs.includes(n)?n:XQ(t).at(-1)??null},M=[A(0)??(f===null?o:j(0))??`review`,A(1)??(A(0)===void 0?j(1):null)];Lt(Z$({ready:l&&v[0]===void 0&&v[1]===void 0,entry:r,side:i,fallback:o,actives:M,onSearch:a}));let N=[ZQ(D[0]??HQ(),M[0],x[0])];M[1]!==null&&M[1]!==void 0&&(N[1]=ZQ(D[1]??HQ(),M[1],x[1]));let P=N.length>1;if(l){let e=v.map((e,t)=>e!==void 0&&(k[t]??null)===(e??null)?void 0:e);(e[0]!==v[0]||e[1]!==v[1])&&y([e[0],e[1]]),(x[0]!==M[0]||x[1]!==M[1])&&S(M)}Lt(Q$({worktreeId:n,panes:N,actives:M,ready:l}));let F;t[4]===n?F=t[5]:(F=w$(n),t[4]=n,t[5]=F);let{recent:I}=Ot(F),L=M[s]??null;Lt($$({worktreeId:n,panes:N,actives:M,active:L,ready:l}));let R=d$(I,N,L).flatMap(Y$),z=e=>{E();let t=h().actives??M;g([`entry`in e?e.entry??null:t[0],`side`in e?e.side??null:t[1]]),y(t=>[`entry`in e?e.entry??null:t[0],`side`in e?e.side??null:t[1]]),a({...`entry`in e?{entry:e.entry??void 0}:{},...`side`in e?{side:e.side??void 0}:{}})},B;t[6]===z?B=t[7]:(B=(e,t)=>z(e===0?{entry:t}:{side:t}),t[6]=z,t[7]=B);let V=B,H=(e,t)=>N.map((n,r)=>r===e?t:n),U=e=>{let t=h(),n=t.panes?[JQ(t.panes[0]??HQ()),...t.panes.slice(1)]:N,r=t.actives??M,{next:i,after:a}=e(n,r);if(i.length>1&&(i[1]?.tabs.length??0)===0){m([i[0]??HQ()]),c(0),z({entry:a[0]??null,side:null});return}m(i);let o={};(a[0]??null)!==(r[0]??null)&&(o.entry=a[0]??null),i.length>1&&(a[1]??null)!==(r[1]??null)&&(o.side=a[1]??null),Object.keys(o).length>0&&z(o)},W=(e,t,n)=>{if(E(),P&&t.tabs.length===0){let t=+(e===0);m([N[t]??HQ()]),c(0),z({entry:M[t],side:null})}else m(H(e,t)),n!==M[e]&&V(e,n)};return{recentFiles:R,bindQuickOpen:T.bindQuickOpen,focusDestination:T.schedule,hasDestinationFocus(){return T.current()!==null},selectPane(e){E(),c(e)},focusPane(e,t){if(d||T.restoringQuickOpen&&t.getAttribute(`role`)===`tab`)return;let n=T.destination;n!==null&&(n.pane!==e||t.getAttribute(`role`)!==`tab`||t.getAttribute(`data-entry`)!==n.key)&&E(),c(e)},bindPane(e,t){return T.bind(e,t,{focused:s,actives:M,panes:N,focusBoundary:u})},split:P,panes:N.map((e,t)=>({tabs:XQ(e),pinned:e.pinned,active:M[t]??null})),activate(e,t){c(e),V(e,t)},open(e,t,n){let r=n!==void 0&&n,i=YQ(N,e,t);return V(i,t),r?T.cancel():T.request({pane:i,key:t}),c(i),i},closePane(e){P&&W(e,HQ(),null)},close(e,t,n){let r=n!==void 0&&n;if(WQ(t))return;let i=N[e]??HQ(),a=QQ(i,t),o=t===M[e]?o$(i,t,a):M[e],s=r||T.isTabFocused(e,t);if(W(e,a,o),!s)return;let c=P&&a.tabs.length===0?M[0]:o;c!==null&&T.request({pane:a.tabs.length===0?0:e,key:c})},closeOthers(e,t){W(e,$Q(N[e]??HQ(),t),t)},closeUnpinned(e){let t=e$(N[e]??HQ()),n=M[e];W(e,t,n!=null&&t.tabs.includes(n)?n:XQ(t)[0]??null)},moveFiles(e,t){U((n,r)=>({next:n.map(n=>r$(n,e,t)),after:r.map(n=>n===null?null:n$(n,e,t))}))},closeRemovedFiles(e){U((t,n)=>{let r=t.map(t=>a$(t,e));return{next:r,after:n.map((n,i)=>n!==null&&i$(n,e)?o$(t[i]??HQ(),n,r[i]??HQ()):n)}})},togglePin(e,t){m(H(e,t$(N[e]??HQ(),t)))},openToSide(e,t){if(WQ(t))return;let n=+(e===0),r=[...N];r[n]=ZQ(N[n]??HQ(),t,M[n]),m(r),V(n,t),T.request({pane:n,key:t}),c(n)},step(e,t){E();let n=XQ(N[e]??HQ());if(n.length===0)return;let r=n[((M[e]===null||M[e]===void 0?-1:n.indexOf(M[e]))+t+n.length)%n.length]??null,i=T.isTabFocused(e);V(e,r),i&&r!==null&&T.request({pane:e,key:r})}}}function Y$(e){let t=FQ(e);return t?.kind===`file`?[t.path]:[]}var X$=dt(e=>Oe(e=>{let t=[null,null],n=null,r=!1,i=null,a,o=null,s=()=>{o!==null&&cancelAnimationFrame(o),o=null},c=()=>{i=null,r=!1,s()},l=()=>i&&a&&(a.focused!==i.pane||a.actives[i.pane]!==i.key||!a.panes[i.pane]?.tabs.includes(i.key))?null:i,u=()=>{i&&o===null&&(o=requestAnimationFrame(()=>{o=null;let e=l();if(!e||a?.focusBoundary?.isConnected||n?.isConnected)return;let s=[...t[e.pane]?.querySelectorAll(`[role="tab"]`)??[]].find(t=>t.dataset.entry===e.key);s?.isConnected&&(s.focus(),s.ownerDocument.activeElement===s&&i===e&&(i=null,r=!1))}))};return e.addFinalizer(c),{get destination(){return i},get restoringQuickOpen(){return r},current:l,isTabFocused(e,n){let r=t[e],i=r?.ownerDocument.activeElement?.closest(`[role="tab"][data-entry]`);return!i||!r?.contains(i)?!1:n===void 0||i.dataset.entry===n},cancel:c,schedule:u,bindQuickOpen:e=>{n=e,e===null&&u()},request(e){i=e,r=n?.isConnected===!0},bind(e,n,r){if(s(),a=r,t[e]=n,l(),n)return u(),()=>{t[e]===n&&(t[e]=null),s()}}}})),Z$=dt(({ready:e,entry:t,side:n,fallback:r,actives:i,onSearch:a})=>Oe(()=>{if(!e)return;let[o,s]=i,c=s??void 0;t===void 0&&n===void 0&&r===null&&o===`review`&&c===void 0?a({},{replace:!0,implicitReview:!0}):(t!==o||n!==c)&&a({entry:o,side:c},{replace:!0})})),Q$=dt(({worktreeId:e,panes:t,actives:n,ready:r})=>Oe(i=>{if(!r)return;let a=C$(e),o=i.once(a);o.saved&&JSON.stringify(o.panes)===JSON.stringify(t)&&o.activeEntries?.[0]===n[0]&&o.activeEntries[1]===n[1]&&(t.length>1||o.focused===0)||i.set(a,{...o,panes:t,saved:!0,focused:t.length>1?o.focused:0,activeEntries:n})})),$$=dt(({worktreeId:e,panes:t,actives:n,active:r,ready:i})=>Oe(a=>{if(!i)return;let o=w$(e),s=a.once(o),c=d$(s.recent,t,r);s.actives?.[0]===n[0]&&s.actives[1]===n[1]&&s.recent.length===c.length&&s.recent.every((e,t)=>e===c[t])||a.set(o,{recent:c,actives:n})}));function e1(e,t){return{onActivate:n=>e.activate(t,n),onClose:(n,r)=>e.close(t,n,r),onCloseOthers:n=>e.closeOthers(t,n),onCloseUnpinned:()=>e.closeUnpinned(t),onTogglePin:n=>e.togglePin(t,n),onOpenToSide:n=>e.openToSide(t,n),onClosePane:e.split?()=>e.closePane(t):void 0}}function t1(e){let t=e?.closest(`[data-tab-viewport]`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.left<r.left?n.left-r.left:Math.max(0,n.right-r.right);t.scrollBy({left:i})}function n1(e){let t=FQ(e);switch(t?.kind){case`review`:return{Icon:Lg,title:`Review`,hint:`The branch's review`};case`walkthrough-step`:return{Icon:Zh,title:`Step ${t.step}`,hint:`Changes in step ${t.step}`};case`all-changes`:return{Icon:Zh,title:`All changes`,hint:`Every changed file, including specs`};case`specs`:return{Icon:ag,title:`Specs`,hint:`Changed spec and test files`};case`change`:case`branch-file`:{let e=t.kind===`change`?`uncommitted diff`:`branch diff`,n=`${t.path} · ${e}`;return{Icon:Zh,title:dy(t.path),accessibleName:n,hint:n}}case`file`:return{Icon:Yh,title:dy(t.path),accessibleName:t.path,hint:t.path};case`commit`:return{Icon:yg,title:By(t.oid),hint:`Commit ${t.oid}`};case`branch`:return{Icon:_g,title:`All branch changes`,hint:`Every change on the branch`};case`pull-request`:return{Icon:Dg,title:`PR #${t.number}`,hint:`Pull request #${t.number}`};case`graph`:return{Icon:_g,title:`Graph`,hint:`Commit graph of the checked-out branch`};case`timeline`:return{Icon:h_,title:`Timeline of ${dy(t.path)}`,accessibleName:`Timeline of ${t.path}`,hint:`${t.path} · timeline`};default:return{Icon:tg,title:e,hint:e}}}function r1(e){let t=(0,$.c)(66),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({tabs:l,pinned:s,active:r,side:c,leading:o,trailing:u,commitContext:i,ids:a,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let[d,f]=(0,Z.useState)(null);d!==null&&d.active!==r&&f(null);let p;t[10]!==r||t[11]!==d||t[12]!==l?(p=d!==null&&l.includes(d.key)?d.key:r??l[0],t[10]=r,t[11]=d,t[12]=l,t[13]=p):p=t[13];let m=p,h;t[14]===r?h=t[15]:(h=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=[...e.currentTarget.querySelectorAll(`[role="tab"]`)],n=t.findIndex(t=>t===e.target);if(n<0)return;e.preventDefault();let i=t[(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length],a=i?.dataset.entry;i&&a!==void 0&&(f({active:r,key:a}),i.focus({preventScroll:!0}),t1(i))},t[14]=r,t[15]=h);let g=h,v;t[16]===n?v=t[17]:(v=e=>{f(null),n.onActivate(e)},t[16]=n,t[17]=v);let y=v,b=c!=null&&`gap-2`,x;t[18]===b?x=t[19]:(x=Y(`relative flex h-12 shrink-0 items-center gap-1.5 border-b px-2.5 text-ui`,b),t[18]=b,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(sW,{}),t[20]=S):S=t[20];let C;t[21]===o?C=t[22]:(C=o!=null&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center`,children:o}),t[21]=o,t[22]=C);let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e.currentTarget.contains(e.relatedTarget)||f(null)},t[23]=w):w=t[23];let T=c==null?`Open documents`:`Open documents, ${c} pane`,E;t[24]!==n||t[25]!==y||t[26]!==r||t[27]!==a||t[28]!==s||t[29]!==c||t[30]!==m||t[31]!==l?(E=l.includes(`review`)&&(0,Q.jsx)(`span`,{className:`flex shrink-0`,children:(0,Q.jsx)(o1,{tabKey:`review`,ids:a(`review`),active:r===`review`,tabStop:m===`review`,pinned:!1,hasUnpinned:l.some(e=>!WQ(e)&&!s.includes(e)),hasOthers:l.some(e=>!WQ(e)&&!s.includes(e)),side:c,...n,onActivate:y})}),t[24]=n,t[25]=y,t[26]=r,t[27]=a,t[28]=s,t[29]=c,t[30]=m,t[31]=l,t[32]=E):E=t[32];let D;t[33]!==n||t[34]!==y||t[35]!==r||t[36]!==i||t[37]!==a||t[38]!==s||t[39]!==c||t[40]!==m||t[41]!==l?(D=l.filter(i1).map((e,t)=>{let o=s.includes(e),u=o&&!s.includes(l[t+1]??``)&&t<l.length-1,d=FQ(e),f={tabKey:e,ids:a(e),active:e===r,tabStop:e===m,pinned:o,hasUnpinned:l.some(e=>!WQ(e)&&!s.includes(e)),hasOthers:l.some(t=>t!==e&&!WQ(t)&&!s.includes(t)),side:c,...n,onActivate:y};return(0,Q.jsxs)(`span`,{className:Y(`flex items-center`,e===r?`shrink-0`:`min-w-18 shrink`),children:[i&&d?.kind===`commit`?(0,Q.jsx)(s1,{...f,commitContext:i,oid:d.oid}):(0,Q.jsx)(o1,{...f}),u&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-4 w-px shrink-0 bg-border`})]},e)}),t[33]=n,t[34]=y,t[35]=r,t[36]=i,t[37]=a,t[38]=s,t[39]=c,t[40]=m,t[41]=l,t[42]=D):D=t[42];let O;t[43]===D?O=t[44]:(O=(0,Q.jsx)(XV,{"data-tab-viewport":``,tabIndex:-1,className:`size-full overflow-y-hidden`,ref:a1,children:(0,Q.jsx)(`div`,{className:`flex h-full w-full items-center gap-1 px-1.5`,children:D})}),t[43]=D,t[44]=O);let k;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(YV,{orientation:`horizontal`,className:`absolute inset-x-0 bottom-0 data-horizontal:h-1.5`}),t[45]=k):k=t[45];let A;t[46]===O?A=t[47]:(A=(0,Q.jsxs)(UV,{className:`@container/tabs relative h-full min-w-0 flex-1`,children:[O,k]}),t[46]=O,t[47]=A);let j;t[48]!==g||t[49]!==E||t[50]!==A||t[51]!==T?(j=(0,Q.jsxs)(`div`,{role:`tablist`,onKeyDown:g,onBlur:w,"aria-label":T,className:`flex h-full min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[E,A]}),t[48]=g,t[49]=E,t[50]=A,t[51]=T,t[52]=j):j=t[52];let M;t[53]!==n||t[54]!==r||t[55]!==s||t[56]!==l?(M=l.length>1&&(0,Q.jsxs)(Wt,{children:[(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(Vo,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,"aria-label":`Open document list`})}),children:[(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[l.length,(0,Q.jsx)(`span`,{className:`max-sm:hidden`,children:` tabs`})]}),(0,Q.jsx)(sc,{"data-icon":`inline-end`})]}),(0,Q.jsx)(Yo,{children:`Open document list`})]}),(0,Q.jsx)(Ne,{align:`end`,children:(0,Q.jsx)(_,{value:r??``,onValueChange:e=>{typeof e==`string`&&l.includes(e)&&n.onActivate(e)},children:l.map(e=>{let{Icon:t,title:n,hint:r,accessibleName:i}=n1(e);return(0,Q.jsxs)(Yn,{value:e,closeOnSelect:!0,"aria-label":i===void 0?n:i,className:`items-start`,children:[(0,Q.jsx)(t,{className:`mt-0.5`}),(0,Q.jsx)(`span`,{className:`min-w-0 whitespace-normal break-all`,children:r}),s.includes(e)&&(0,Q.jsx)(s_,{"aria-label":`Pinned`,className:`mt-0.5`})]},e)})})})]}),t[53]=n,t[54]=r,t[55]=s,t[56]=l,t[57]=M):M=t[57];let N;t[58]===u?N=t[59]:(N=u!=null&&(0,Q.jsx)(`div`,{className:`relative flex shrink-0 items-center gap-1`,children:u}),t[58]=u,t[59]=N);let P;return t[60]!==j||t[61]!==M||t[62]!==N||t[63]!==x||t[64]!==C?(P=(0,Q.jsxs)(`div`,{"data-pane-bar":``,className:x,children:[S,C,j,M,N]}),t[60]=j,t[61]=M,t[62]=N,t[63]=x,t[64]=C,t[65]=P):P=t[65],P}function i1(e){return!WQ(e)}function a1(e){if(!e)return;let t=()=>t1(e.querySelector(`[role="tab"][aria-selected="true"]`)),n=0,r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(t)});return r.observe(e),()=>{cancelAnimationFrame(n),r.disconnect()}}function o1(e){let t=(0,$.c)(87),{tabKey:n,commitSubject:r,ids:i,active:a,tabStop:o,pinned:s,hasUnpinned:c,hasOthers:l,side:u,onActivate:d,onClose:f,onCloseOthers:p,onCloseUnpinned:m,onTogglePin:h,onOpenToSide:g,onClosePane:_}=e,v;t[0]===n?v=t[1]:(v=n1(n),t[0]=n,t[1]=v);let{Icon:y,title:b,hint:x,accessibleName:S}=v,C=S===void 0?b:S,w=r?`${b} ${r}`:b,T=r?`${x} · ${r}`:x,[E,D]=(0,Z.useState)(!1),O;t[2]===u?O=t[3]:(O=u$(u),t[2]=u,t[3]=O);let k=O,A;t[4]!==d||t[5]!==n?(A=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d(n))},t[4]=d,t[5]=n,t[6]=A):A=t[6];let j=A,M;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e&&D(!1)},t[7]=M):M=t[7];let N=s?`${T} · pinned`:T,P;t[8]!==y||t[9]!==C||t[10]!==j||t[11]!==a||t[12]!==r||t[13]!==i.panel||t[14]!==i.tab||t[15]!==d||t[16]!==f||t[17]!==h||t[18]!==s||t[19]!==n||t[20]!==o||t[21]!==w||t[22]!==b?(P=e=>(0,Q.jsxs)(uH,{render:(0,Q.jsx)(`div`,{ref:e=>{a&&t1(e)},role:`tab`,id:i.tab,"aria-controls":a?i.panel:void 0,tabIndex:o?0:-1,"aria-selected":a,"aria-label":r?w:C,"data-entry":n,className:Y(`group flex h-7 min-w-0 max-w-[min(100cqw,calc(var(--spacing)*45))] cursor-default items-center gap-1.5 rounded-md px-2 text-xs font-medium outline-none transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring`,a?`bg-muted text-foreground ring-1 ring-border ring-inset`:`text-muted-foreground hover:bg-accent hover:text-foreground`,a&&!WQ(n)&&!s&&`pr-0.5`),onClick:()=>d(n),onAuxClick:e=>{e.button===1&&!s&&!WQ(n)&&(e.preventDefault(),f(n))},onKeyDown:e=>{e.target===e.currentTarget&&j(e)}}),children:[(0,Q.jsx)(y,{className:`size-3.5 shrink-0`,strokeWidth:WQ(n)?1.75:void 0}),e,!WQ(n)&&s&&(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{type:`button`,tabIndex:-1,"aria-label":`Unpin ${b}`,onClick:e=>{e.stopPropagation(),h(n)},variant:`ghost`,size:`icon-xs`}),children:(0,Q.jsx)(s_,{className:`size-3`})}),(0,Q.jsx)(Yo,{children:`Unpin ${b}`})]}),!WQ(n)&&a&&(0,Q.jsxs)(ot,{hoverable:!1,children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{type:`button`,tabIndex:-1,"aria-label":`Close ${b}`,onClick:e=>{e.stopPropagation(),f(n)},variant:`ghost`,size:`icon-xs`,className:`mr-0.5`}),children:(0,Q.jsx)(Oi,{className:`size-3`})}),(0,Q.jsxs)(Yo,{children:[`Close ${b}`,(0,Q.jsx)(pH,{children:Ad(ou.closeTab)})]})]})]}),t[8]=y,t[9]=C,t[10]=j,t[11]=a,t[12]=r,t[13]=i.panel,t[14]=i.tab,t[15]=d,t[16]=f,t[17]=h,t[18]=s,t[19]=n,t[20]=o,t[21]=w,t[22]=b,t[23]=P):P=t[23];let F;t[24]!==N||t[25]!==P||t[26]!==w?(F=(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:N,disclose:`always`,renderTrigger:P,children:w}),t[24]=N,t[25]=P,t[26]=w,t[27]=F):F=t[27];let I=E?`none`:`trigger`,L;t[28]===n?L=t[29]:(L=WQ(n),t[28]=n,t[29]=L);let R;t[30]!==h||t[31]!==n?(R=()=>h(n),t[30]=h,t[31]=n,t[32]=R):R=t[32];let z;t[33]===s?z=t[34]:(z=s?(0,Q.jsx)(l_,{}):(0,Q.jsx)(s_,{}),t[33]=s,t[34]=z);let B=s?`Unpin`:`Pin`,V;t[35]!==L||t[36]!==R||t[37]!==z||t[38]!==B?(V=(0,Q.jsxs)(dn,{disabled:L,onSelect:R,children:[z,B]}),t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V):V=t[39];let H;t[40]!==g||t[41]!==n?(H=g===void 0||WQ(n),t[40]=g,t[41]=n,t[42]=H):H=t[42];let U;t[43]!==g||t[44]!==n?(U=()=>{(0,th.flushSync)(()=>D(!0)),g?.(n)},t[43]=g,t[44]=n,t[45]=U):U=t[45];let W;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(Lh,{}),t[46]=W):W=t[46];let G;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(Rn,{children:Ad(ou.openToSide)}),t[47]=G):G=t[47];let K;t[48]!==k||t[49]!==H||t[50]!==U?(K=(0,Q.jsxs)(dn,{disabled:H,onSelect:U,children:[W,k,G]}),t[48]=k,t[49]=H,t[50]=U,t[51]=K):K=t[51];let q;t[52]===_?q=t[53]:(q=_&&(0,Q.jsxs)(dn,{onSelect:_,children:[(0,Q.jsx)(Lh,{}),`Close pane`]}),t[52]=_,t[53]=q);let J;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsx)(we,{}),t[54]=J):J=t[54];let ee;t[55]===n?ee=t[56]:(ee=WQ(n),t[55]=n,t[56]=ee);let te;t[57]!==f||t[58]!==n?(te=()=>f(n,!0),t[57]=f,t[58]=n,t[59]=te):te=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(Oi,{}),t[60]=ne):ne=t[60];let re;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(Rn,{children:Ad(ou.closeTab)}),t[61]=re):re=t[61];let ie;t[62]!==ee||t[63]!==te?(ie=(0,Q.jsxs)(dn,{disabled:ee,onSelect:te,children:[ne,`Close`,re]}),t[62]=ee,t[63]=te,t[64]=ie):ie=t[64];let ae=!l,oe;t[65]!==p||t[66]!==n?(oe=()=>p(n),t[65]=p,t[66]=n,t[67]=oe):oe=t[67];let se;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(D_,{}),t[68]=se):se=t[68];let ce;t[69]!==ae||t[70]!==oe?(ce=(0,Q.jsxs)(dn,{disabled:ae,onSelect:oe,children:[se,`Close others`]}),t[69]=ae,t[70]=oe,t[71]=ce):ce=t[71];let le=!c,ue;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Q.jsx)(Gg,{}),t[72]=ue):ue=t[72];let de;t[73]!==m||t[74]!==le?(de=(0,Q.jsxs)(dn,{disabled:le,onSelect:m,children:[ue,`Close unpinned`]}),t[73]=m,t[74]=le,t[75]=de):de=t[75];let fe;t[76]!==V||t[77]!==K||t[78]!==q||t[79]!==ie||t[80]!==ce||t[81]!==de||t[82]!==I?(fe=(0,Q.jsxs)(dH,{finalFocus:I,children:[V,K,q,J,ie,ce,de]}),t[76]=V,t[77]=K,t[78]=q,t[79]=ie,t[80]=ce,t[81]=de,t[82]=I,t[83]=fe):fe=t[83];let pe;return t[84]!==fe||t[85]!==F?(pe=(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 flex-1`,children:(0,Q.jsxs)(Wt,{onOpenChange:M,children:[F,fe]})}),t[84]=fe,t[85]=F,t[86]=pe):pe=t[86],pe}function s1(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({commitContext:n,oid:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=KX({...n,oid:r,parent:1}),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o=Ot(a),s;t[7]===o?s=t[8]:(s=de(qr(o)),t[7]=o,t[8]=s);let c=s?.commit.subject,l;return t[9]!==c||t[10]!==i?(l=(0,Q.jsx)(o1,{...i,commitSubject:c}),t[9]=c,t[10]=i,t[11]=l):l=t[11],l}function c1(e,t,n){let r=(0,$.c)(4),i;r[0]!==e||r[1]!==n||r[2]!==t?(i=qs({connection:e,projectId:t,number:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3];let a=de(qr(Ot(i))),o=QB(e);if(a?.kind===`available`)return el(o.projects,t,a.pullRequest.headBranch)}function l1(e){let t=(0,$.c)(13),{label:n,description:r,icon:i,shortcut:a,onClick:o,disabled:s,pressed:c,variant:l,iconOnly:u}=e,d=s!==void 0&&s,f=l===void 0?`ghost`:l,p=u!==void 0&&u,m;t[0]===p?m=t[1]:(m=p?[`compact`]:[`compact`,`key`,`full`],t[0]=p,t[1]=m);let h;return t[2]!==i||t[3]!==r||t[4]!==d||t[5]!==p||t[6]!==n||t[7]!==o||t[8]!==c||t[9]!==a||t[10]!==m||t[11]!==f?(h=(0,Q.jsx)(Q.Fragment,{children:m.map(e=>(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(Ze,{render:(0,Q.jsx)(X,{variant:f,size:e===`compact`?`icon`:`default`,className:Y(!p&&e===`compact`&&`@min-lg/pane:hidden`,e===`key`&&`hidden @min-lg/pane:inline-flex @min-3xl/pane:hidden`,e===`full`&&`hidden @min-3xl/pane:inline-flex`),"aria-label":n,"aria-keyshortcuts":a,"aria-pressed":c,disabled:d,focusableWhenDisabled:!0,onClick:o}),children:[c===!1?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0 rounded-sm border-[--spacing(0.375)] border-border-strong bg-background`}):(0,Q.jsx)(i,{className:`size-3.5`}),e===`full`&&(0,Q.jsx)(`span`,{children:n}),a&&e!==`compact`&&(0,Q.jsx)(pH,{children:Ad(a)})]}),(0,Q.jsxs)(Yo,{role:`tooltip`,children:[r??n,a&&(0,Q.jsx)(pH,{children:Ad(a)})]})]},e))}),t[2]=i,t[3]=r,t[4]=d,t[5]=p,t[6]=n,t[7]=o,t[8]=c,t[9]=a,t[10]=m,t[11]=f,t[12]=h):h=t[12],h}function u1(e,t,n){let r=(0,$.c)(4),i=n===void 0?fy:n,a;return r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=eB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3],$u(a).value}function d1(e,t,n){let r=(0,$.c)(4),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=eB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3],Lt(a)}function f1(e,t,n,r){let i=(0,$.c)(4),a=u1(e,t),o;return i[0]!==n||i[1]!==r||i[2]!==a?(o=oy(n,a,r),i[0]=n,i[1]=r,i[2]=a,i[3]=o):o=i[3],o}function p1(e){let t=(0,$.c)(14),{scope:n,context:r,base:i,quiet:a,children:o}=e,s=a!==void 0&&a,c;t[0]===s?c=t[1]:(c=s?null:(0,Q.jsx)(kc,{label:`Comparing the branch`}),t[0]=s,t[1]=c);let l=c,u=vB(n,r.connection,i);if(Mi(u.result)){let e;t[2]===u.result.cause?e=t[3]:(e=Qv(Ra(u.result.cause)),t[2]=u.result.cause,t[3]=e);let n;return t[4]!==u.refresh||t[5]!==e?(n=(0,Q.jsx)(gt,{description:e,onRetry:u.refresh}),t[4]=u.refresh,t[5]=e,t[6]=n):n=t[6],n}if(!Bo(u.result))return l;if(u.result.value.base===void 0){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`Choose the branch this one is compared against in the Branch list.`}),t[7]=e):e=t[7],e}let d;t[8]!==u.result.value||t[9]!==o?(d=o(u.result.value),t[8]=u.result.value,t[9]=o,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==d?(f=(0,Q.jsx)(Z.Suspense,{fallback:l,children:d}),t[11]=l,t[12]=d,t[13]=f):f=t[13],f}function m1(e,t,n,r){return{id:e,kind:`file`,path:t,contents:n,version:bu(n),...r?{note:r}:{}}}var h1=new Map,g1=new Map;function _1(e){if(e.kind===`diff`){let t=h1.get(e.id);return t?.cacheKey!==void 0&&t.cacheKey===e.fileDiff.cacheKey?{type:`diff`,fileDiff:t}:(h1.set(e.id,e.fileDiff),{type:`diff`,fileDiff:e.fileDiff})}let t=g1.get(e.id);if(t?.file.name===e.path&&t.file.contents===e.contents)return{type:`file`,file:t.file};let n=(t?.revision??0)+1;if(!Number.isSafeInteger(n))throw Error(`File highlighting exhausted its revision identifiers.`);let r={name:e.path,contents:e.contents,cacheKey:JSON.stringify([e.id,e.path,n])};return g1.set(e.id,{file:r,revision:n}),{type:`file`,file:r}}function v1(e){let t=new Map;for(let n of e){let e=t.get(n.path)??{additions:0,deletions:0},r=y1(n);e.additions+=r.additions,e.deletions+=r.deletions,t.set(n.path,e)}return t}function y1(e){return e.kind===`file`?{additions:e.contents.split(`
1352
+ `).filter((e,t,n)=>t<n.length-1||e).length,deletions:0}:e.fileDiff.hunks.reduce((e,t)=>({additions:e.additions+t.additionLines,deletions:e.deletions+t.deletionLines}),{additions:0,deletions:0})}function b1(e){let t=(0,$.c)(7),{counts:n}=e,r;t[0]===n.additions?r=t[1]:(r=(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,n.additions]}),t[0]=n.additions,t[1]=r);let i;t[2]===n.deletions?i=t[3]:(i=(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,n.deletions]}),t[2]=n.deletions,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(`span`,{className:`shrink-0 font-mono text-xs leading-4 font-medium tabular-nums`,children:[r,` `,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function x1(e){return e?e.hunks.flatMap(e=>{let t=e.additionStart;return e.hunkContent.flatMap(e=>{if(e.type===`context`)return t+=e.lines,[];let n=t;return t+=e.additions,Array.from({length:e.additions},(e,t)=>`[data-code] [data-line="${n+t}"] { box-shadow: inset calc(var(--spacing) * 0.75) 0 var(--add-fg); }`)})}).join(`
1353
+ `):``}var S1=6;function C1(e,t){let n=e.shadowRoot?.querySelector(`[data-line="${t.line}"]`),r=n?.closest(`[data-code]`);if(!n||!r||r.clientWidth===0)return!1;if(r.scrollWidth<=r.clientWidth)return!0;let i=w1(n,t);if(!i)return!1;let a=i.getBoundingClientRect(),o=r.getBoundingClientRect(),s=r.querySelector(`[data-gutter]`),c=o.left+(s?.offsetWidth??0)+S1,l=o.left+r.clientWidth-S1;return a.left<c||a.width>l-c?r.scrollLeft=a.right+r.scrollLeft<=l?0:r.scrollLeft+a.left-c:a.right>l&&(r.scrollLeft+=a.right-l),!0}function w1(e,{column:t,length:n}){let r=document.createRange(),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=0;for(let e=i.nextNode();e instanceof Text;e=i.nextNode()){let i=a+e.length;if(t>=a&&t<i&&r.setStart(e,t-a),t+n<=i)return r.setEnd(e,t+n-a),r;a=i}}function T1(e,t,n){let r=(0,$.c)(9),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.set,s;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promiseExit`},r[4]=s):s=r[4];let[c,l]=B(o,s),u=Da(o),d;return r[5]!==c||r[6]!==l||r[7]!==u?(d={result:c,submit:l,start:u},r[5]=c,r[6]=l,r[7]=u,r[8]=d):d=r[8],d}function E1(e,t,n){let r=(0,$.c)(9),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.remove,s;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={mode:`promiseExit`},r[4]=s):s=r[4];let[c,l]=B(o,s),u=Da(o),d;return r[5]!==c||r[6]!==l||r[7]!==u?(d={result:c,submit:l,start:u},r[5]=c,r[6]=l,r[7]=u,r[8]=d):d=r[8],d}function D1(e,t,n){let r=(0,$.c)(12),i=n===void 0?fy:n,a;r[0]!==t.connection||r[1]!==i||r[2]!==e?(a=tB({scope:e,connection:t.connection,range:i}),r[0]=t.connection,r[1]=i,r[2]=e,r[3]=a):a=r[3];let o=a.bulk,[s,c]=B(o),l;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={mode:`promiseExit`},r[4]=l):l=r[4];let u=Da(o,l),d;r[5]===s?d=r[6]:(d=de(qr(s)),r[5]=s,r[6]=d);let f=d,p=!s.waiting&&f?.kind===`mark`?f.report:null,m;return r[7]!==s||r[8]!==c||r[9]!==u||r[10]!==p?(m={result:s,submit:u,report:p,start:c},r[7]=s,r[8]=c,r[9]=u,r[10]=p,r[11]=m):m=r[11],m}function O1(e,t,n,r){let i=(0,$.c)(5),a=r===void 0?fy:r,o=na(t),s=T1(e,t,a),c=E1(e,t,a),l;return i[0]!==s||i[1]!==n||i[2]!==c||i[3]!==o?(l={writeBlock:o,toggle(e){if(o)return;let t=wy(e,s.result.waiting||c.result.waiting);t&&(t.kind===`unmark`?c.submit(t.path):s.submit(t.input)).then(e=>{Mn(e)&&n({title:`Could not update review`,description:cy(Ra(e.cause)),type:`error`})})}},i[0]=s,i[1]=n,i[2]=c,i[3]=o,i[4]=l):l=i[4],l}function k1(e,t,n,r,i,a){let o=(0,$.c)(22),s=na(t),c;o[0]===r?c=o[1]:(c=Sy(r),o[0]=r,o[1]=c);let l=c,u;o[2]===i?u=o[3]:(u=Sy(i),o[2]=i,o[3]=u);let d=u,f=D1(e,t,n),p=D1(e,t),m;if(o[4]!==r||o[5]!==i){let e=[...r,...i];m=e.length>0&&e.every(j1),o[4]=r,o[5]=i,o[6]=m}else m=o[6];let h=m,g=f.result.waiting||p.result.waiting,_=!!s||g||l.blocked&&d.blocked,v;o[7]!==r||o[8]!==f||o[9]!==l||o[10]!==_||o[11]!==a||o[12]!==h||o[13]!==i||o[14]!==p||o[15]!==d?(v=()=>{if(_)return;let e=[{entries:r,plan:l,command:f},{entries:i,plan:d,command:p}].filter(A1).map(e=>e.command.submit(h?{kind:`unmark`,paths:e.plan.reviewedPaths}:{kind:`mark`,entries:e.entries}));Promise.all(e).then(e=>{let t=e.find(Mn);if(t){a({title:`Could not update review`,description:cy(Ra(t.cause)),type:`error`});return}let n={marked:[],skipped:[],failed:[]};for(let t of e)ne(t)&&t.value.kind===`mark`&&(n.marked.push(...t.value.report.marked),n.skipped.push(...t.value.report.skipped),n.failed.push(...t.value.report.failed));a(xy(n)??{title:h?`Step marked unreviewed`:`Step marked reviewed`,type:`success`})})},o[7]=r,o[8]=f,o[9]=l,o[10]=_,o[11]=a,o[12]=h,o[13]=i,o[14]=p,o[15]=d,o[16]=v):v=o[16];let y=v,b;return o[17]!==_||o[18]!==h||o[19]!==y||o[20]!==s?(b={reviewed:h,disabled:_,toggle:y,writeBlock:s},o[17]=_,o[18]=h,o[19]=y,o[20]=s,o[21]=b):b=o[21],b}function A1(e){return e.entries.length>0}function j1(e){return e.reviewStatus===`reviewed`}function M1(e){if(!(!e||e.side===`deletions`||e.endSide!==void 0&&e.endSide!==e.side))return{startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)}}function N1(e){let t=(0,$.c)(14),n=O1(e.scope,e.context,P1,e.range),r;t[0]!==e||t[1]!==n?(r=t=>{n.writeBlock||t.review?.current===!1||(e.onReview?e.onReview(t):n.toggle(t.review))},t[0]=e,t[1]=n,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n.writeBlock||t[5]!==r?(i={...e,writeBlock:n.writeBlock,onToggleReviewed:r},t[3]=e,t[4]=n.writeBlock,t[5]=r,t[6]=i):i=t[6];let a=i,o;t[7]!==e.interaction.entry||t[8]!==e.range?(o=JSON.stringify([e.interaction.entry,e.range]),t[7]=e.interaction.entry,t[8]=e.range,t[9]=o):o=t[9];let s=o,c;return t[10]!==s||t[11]!==e.comments||t[12]!==a?(c=e.comments?(0,Q.jsx)(F1,{...a},s):(0,Q.jsx)(L1,{...a},s),t[10]=s,t[11]=e.comments,t[12]=a,t[13]=c):c=t[13],c}function P1(e){return ks(e)}function F1(e){let t=(0,$.c)(10),n;t[0]!==e.context||t[1]!==e.scope?(n={scope:e.scope,context:e.context},t[0]=e.context,t[1]=e.scope,t[2]=n):n=t[2];let{view:r}=KJ(n),i;t[3]===r?.comments?i=t[4]:(i=r?.comments??[],t[3]=r?.comments,t[4]=i);let a;t[5]===i?a=t[6]:(a=i.filter(I1),t[5]=i,t[6]=a);let o=a,s;return t[7]!==o||t[8]!==e?(s=(0,Q.jsx)(L1,{...e,commentDrafts:o}),t[7]=o,t[8]=e,t[9]=s):s=t[9],s}function I1(e){return e.publication.status===`draft`}function L1(e){let t=(0,$.c)(151),{entries:n,listed:r,paths:i,scope:a,context:o,interaction:s,header:c,footer:l,headerLeading:u,headerActions:d,emptyActions:f,toolbar:p,foundMatch:m,disableFileHeader:h,fileDiff:g,compactThreads:_,fullHeight:v,compactHeight:y,collapsible:b,decision:x,column:S,readingColumn:C,framed:w,range:T,onToggleReviewed:E,writeBlock:D,commentDrafts:O}=e,k=h!==void 0&&h,A=_!==void 0&&_,j=v!==void 0&&v,M=y!==void 0&&y,N=b!==void 0&&b,P=x!==void 0&&x,F=S!==void 0&&S,I=C===void 0?F:C,L=w!==void 0&&w,[R,z]=(0,Z.useState)(null),{dark:B}=Xd(),{preferences:V}=Bu(),H=Ku(o.connection),U=P?n:Ay(n,H),W=r??U.map(J1),G=r===void 0||P?W:Ay(W,H),K=G.filter(q1),q=D$(s.worktreeId,s.entry),J;t[0]!==o.connection.environmentId||t[1]!==s.entry||t[2]!==s.worktreeId||t[3]!==T?(J=JSON.stringify([o.connection.environmentId,s.worktreeId,s.entry,T]),t[0]=o.connection.environmentId,t[1]=s.entry,t[2]=s.worktreeId,t[3]=T,t[4]=J):J=t[4];let ee=j$(J),te;t[5]===ee?te=t[6]:(te=()=>ee.selection(),t[5]=ee,t[6]=te);let[ne,re]=(0,Z.useState)(te),ie=ne?U.find(e=>e.id===ne.lines.id):void 0,ae=ne!==null&&ie?.version!==ne.version,oe=ae?null:ne?.lines??null,se=e=>{let t=e?U.find(t=>t.id===e.id):void 0,n=e&&t?{lines:e,version:t.version}:null;re(n),ee.rememberSelection(n)},ce=oe?.range,le;t[7]===ce?le=t[8]:(le=M1(ce),t[7]=ce,t[8]=le);let ue=le,de;t[9]===ee?de=t[10]:(de=()=>ee.focused(),t[9]=ee,t[10]=de);let[fe,pe]=(0,Z.useState)(de),[me,he]=(0,Z.useState)();me===void 0||s.active&&(i?.includes(me.path)||G.some(e=>e.path===me.path))||he(void 0);let ge=me&&s.active?_e(me):void 0;function _e(e){let t=G.find(t=>t.id===e.id);if(t?.state===`code`||t?.state===`pending`)return t;let n=G.filter(t=>t.path===e.path),r=n[0];return r?.state===`omitted`?n.find(K1)??n.find(G1)??r:r}let ve;t[11]!==he||t[12]!==ee?(ve=e=>{he(void 0),pe(e),ee.rememberFocus(e)},t[11]=he,t[12]=ee,t[13]=ve):ve=t[13];let ye=ve,be;t[14]===fe?be=t[15]:(be=e=>e.id===fe,t[14]=fe,t[15]=be);let xe=Math.max(K.findIndex(be),0),Se=U.find(e=>e.id===K[xe]?.id),Ce=K[xe]?.path;F$(s.active&&Ce!==void 0&&K.length>1?{worktreeId:s.worktreeId,entry:s.entry,path:Ce}:void 0);let we=e=>{let t=e.getScrollTop(),n=t+e.getHeight()>=e.getScrollHeight()-1;if(me!==void 0||n)return;let r=t+X1,i;for(let t of e.getRenderedItems()){let n=e.getTopForItem(t.id);n!==void 0&&n<=r&&(i=t.id)}i===void 0&&t===0&&(i=K[0]?.id),i!==void 0&&i!==K[xe]?.id&&K.some(e=>e.id===i)&&(pe(i),ee.rememberFocus(i))},Te=new Set(U.filter(e=>m$(q.folds,e.id,U.length>1&&e.review?.reviewed===!0||(N||U.length>1)&&H&&ky(e.path))).map(W1)),[Ee,De]=(0,Z.useState)(),[Oe,ke]=(0,Z.useState)(),Ae;t[16]!==m||t[17]!==V||t[18]!==Oe?(Ae=e=>{m&&V.lineOverflow===`scroll`&&Oe!==m.nonce&&C1(e,m)&&ke(m.nonce)},t[16]=m,t[17]=V,t[18]=Oe,t[19]=Ae):Ae=t[19];let je=Ae,[Me,Ne]=(0,Z.useState)(),Pe=e=>{let t=K[e];t&&(ye(t.id),U.some(e=>e.id===t.id)?ee.scrollTo({type:`item`,id:t.id,align:`start`}):he({path:t.path,id:t.id}))},Fe;t[20]!==he||t[21]!==me?(Fe=()=>{me!==void 0&&he(void 0)},t[20]=he,t[21]=me,t[22]=Fe):Fe=t[22];let Ie=Fe,Le=new Map(U.map(U1)),Re;t[23]!==O||t[24]!==R?(Re=e=>{if(O===void 0)return[];let t=new Map,n=(e,n)=>{let r=`${e}:${n}`,i=t.get(r)??{side:e,line:n,drafts:[]};return t.set(r,i),i};for(let t of O){let r=t.anchor;r.kind===`lines`&&r.path===e.path&&(e.kind!==`file`||r.side===`additions`)&&n(r.side,r.end).drafts.push(t)}return R?.id===e.id&&(n(R.side,R.end).composing={side:R.side,start:R.start,end:R.end}),[...t.values()]},t[23]=O,t[24]=R,t[25]=Re):Re=t[25];let ze=Re,Be=U.map(e=>{let t=ze(e),n={id:e.id,collapsed:Te.has(e.id),version:bu(JSON.stringify([e.version,Te.has(e.id),t]))},r=_1(e);return r.type===`diff`?{...n,...r,annotations:t.map(H1)}:{...n,...r,annotations:t.map(V1)}}),Ve=U.filter(B1),He=new Set(Ve.map(z1)).size,Ue=Ve[0]?.id,We=new Map;for(let e of U)e.review&&!We.has(e.review.path)&&We.set(e.review.path,e.id);let Ge=j||l?12:160,Ke=P||F||L,qe=B?`dark`:`light`,Je=V.lineOverflow,Ye=V.diffStyle,Xe=!k&&!j,Ze=k||M,Qe=O!==void 0,$e;t[26]!==O||t[27]!==q?($e=(e,t)=>{let n=fY(e);n&&O!==void 0&&(t.item.type!==`file`||n.side===`additions`)&&(q.setCollapsed([t.item.id],!1),z({id:t.item.id,...n}))},t[26]=O,t[27]=q,t[28]=$e):$e=t[28];let et,tt;t[29]===ye?(et=t[30],tt=t[31]):(et=(e,t)=>ye(t.item.id),tt=(e,t)=>ye(t.item.id),t[29]=ye,t[30]=et,t[31]=tt);let nt;t[32]===je?nt=t[33]:(nt=(e,t,n,r)=>{r.item.type===`file`&&n!==`unmount`&&je(e)},t[32]=je,t[33]=nt);let rt;t[34]===g?rt=t[35]:(rt=x1(g),t[34]=g,t[35]=rt);let it=`${A?`[data-line-annotation]:has([data-file-thread-marker]) { margin-left: 0; }`:``}${rt}${Ke?qd:``}${F?Mu:``}${vd}${O===void 0?``:md}${k||M?`[data-code] { padding-top: 0 !important; }`:Lu}${k||M||Ke?``:Nd}${A?tf:``}${M?`[data-diffs-header], pre { border: 0; border-radius: 0; }`:``}`,at;t[36]===F?at=t[37]:(at=F?{itemMetrics:{lineHeight:22,diffHeaderHeight:41}}:{},t[36]=F,t[37]=at);let ot;t[38]!==M||t[39]!==k?(ot=k||M?{itemMetrics:{paddingTop:0}}:{},t[38]=M,t[39]=k,t[40]=ot):ot=t[40];let st=k||M?0:12,ct=M?0:Ge,lt;t[41]!==st||t[42]!==ct?(lt={paddingTop:st,paddingBottom:ct,gap:12},t[41]=st,t[42]=ct,t[43]=lt):lt=t[43];let ut;t[44]!==V.diffStyle||t[45]!==V.lineOverflow||t[46]!==qe||t[47]!==Xe||t[48]!==Ze||t[49]!==Qe||t[50]!==$e||t[51]!==et||t[52]!==tt||t[53]!==nt||t[54]!==it||t[55]!==at||t[56]!==ot||t[57]!==lt?(ut={preferredHighlighter:Gu,theme:Qu,themeType:qe,overflow:Je,diffStyle:Ye,diffIndicators:`classic`,hunkSeparators:`line-info`,stickyHeaders:Xe,disableFileHeader:Ze,enableLineSelection:!0,enableGutterUtility:Qe,onGutterUtilityClick:$e,onLineClick:et,onLineNumberClick:tt,onPostRender:nt,lineHoverHighlight:`number`,unsafeCSS:it,...at,...ot,layout:lt},t[44]=V.diffStyle,t[45]=V.lineOverflow,t[46]=qe,t[47]=Xe,t[48]=Ze,t[49]=Qe,t[50]=$e,t[51]=et,t[52]=tt,t[53]=nt,t[54]=it,t[55]=at,t[56]=ot,t[57]=lt,t[58]=ut):ut=t[58];let dt=ut,ft=U.length>0&&U.every(e=>Te.has(e.id)),pt;t[59]!==U||t[60]!==q?(pt=e=>q.setCollapsed(U.map(R1),e),t[59]=U,t[60]=q,t[61]=pt):pt=t[61];let mt=pt,ht=e=>{ye(e),q.setCollapsed([e],!Te.has(e))},gt;t[62]===ft?gt=t[63]:(gt=ft?(0,Q.jsx)(Th,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,Q.jsx)(Ch,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[62]=ft,t[63]=gt);let _t=gt,vt=ft?`Expand all files`:`Collapse all files`,yt;t[64]!==ft||t[65]!==mt?(yt=()=>mt(!ft),t[64]=ft,t[65]=mt,t[66]=yt):yt=t[66];let bt;t[67]!==_t||t[68]!==vt||t[69]!==yt?(bt=(0,Q.jsxs)(X,{size:`sm`,variant:`ghost`,onClick:yt,children:[_t,vt]}),t[67]=_t,t[68]=vt,t[69]=yt,t[70]=bt):bt=t[70];let xt=bt,St=U.length>1?xt:null,Ct;t[71]!==s.entry||t[72]!==s.toolbarTarget?(Ct=s.toolbarTarget!==void 0&&/^(file|review-file|review-change|change|branch):/.test(s.entry),t[71]=s.entry,t[72]=s.toolbarTarget,t[73]=Ct):Ct=t[73];let wt=Ct,Tt;t[74]!==f||t[75]!==Se||t[76]!==d||t[77]!==E||t[78]!==wt||t[79]!==D?(Tt=wt&&(Se?(0,Q.jsxs)(Q.Fragment,{children:[Se.review&&(0,Q.jsx)(l1,{label:`Reviewed`,variant:`outline`,icon:Se?.review?.reviewed?Dn:k_,shortcut:ou.toggleReviewed,description:D,disabled:!!D||Se.review.current===!1||!Se.review.fingerprint,pressed:Se?.review?.reviewed,onClick:()=>{Se&&E(Se)}}),d]}):f??d),t[74]=f,t[75]=Se,t[76]=d,t[77]=E,t[78]=wt,t[79]=D,t[80]=Tt):Tt=t[80];let Et=Tt,Dt;t[81]!==he||t[82]!==me?.path||t[83]!==St||t[84]!==U||t[85]!==xe||t[86]!==q||t[87]!==c||t[88]!==_e||t[89]!==ge||t[90]!==K||t[91]!==ye||t[92]!==ee?(Dt=c&&(()=>c({collapse:St,current:K[xe]?.path,counts:v1(U),open:e=>{let t=K.find(t=>t.path===e);t&&(q.setCollapsed([t.id],!1),ye(t.id));let n=_e({path:e});n?.state===`code`?ee.scrollTo({type:`item`,id:n.id,align:`start`}):he({path:e})},awaiting:ge?.state===`omitted`?ge.path:void 0,landed:e=>{me?.path===e&&he(void 0)}})),t[81]=he,t[82]=me?.path,t[83]=St,t[84]=U,t[85]=xe,t[86]=q,t[87]=c,t[88]=_e,t[89]=ge,t[90]=K,t[91]=ye,t[92]=ee,t[93]=Dt):Dt=t[93];let Ot=Dt,kt;t[94]===Ie?kt=t[95]:(kt=e=>{Z1.has(e.key)&&Ie()},t[94]=Ie,t[95]=kt);let At=(P||F||A||L)&&`decision-code`,jt=A&&`file-code`,Mt=L&&`commit-code`,Nt=M&&`overflow-hidden rounded-lg border`,Pt;t[96]!==At||t[97]!==jt||t[98]!==Mt||t[99]!==Nt?(Pt=Y(`@container/code relative flex min-h-0 flex-1 flex-col`,At,jt,Mt,Nt),t[96]=At,t[97]=jt,t[98]=Mt,t[99]=Nt,t[100]=Pt):Pt=t[100];let Ft;t[101]!==s.toolbarTarget||t[102]!==Et?(Ft=s.toolbarTarget&&Et&&(0,th.createPortal)(Et,s.toolbarTarget),t[101]=s.toolbarTarget,t[102]=Et,t[103]=Ft):Ft=t[103];let It;t[104]!==O||t[105]!==U||t[106]!==Pe||t[107]!==xe||t[108]!==Se||t[109]!==q||t[110]!==s.active||t[111]!==s.entry||t[112]!==K||t[113]!==E||t[114]!==oe?(It=s.active&&K.length>0&&(0,Q.jsx)($1,{reviewEnabled:!s.entry.startsWith(`walkthrough-step:`),next:()=>Pe(Math.min(xe+1,K.length-1)),previous:()=>Pe(Math.max(xe-1,0)),review:()=>{Se?.review&&E(Se)},comment:()=>{let e=oe?fY(oe.range):null;oe&&e&&O!==void 0&&(U.find(e=>e.id===oe.id)?.kind!==`file`||e.side===`additions`)&&(q.setCollapsed([oe.id],!1),z({id:oe.id,...e}))}}),t[104]=O,t[105]=U,t[106]=Pe,t[107]=xe,t[108]=Se,t[109]=q,t[110]=s.active,t[111]=s.entry,t[112]=K,t[113]=E,t[114]=oe,t[115]=It):It=t[115];let Lt;t[116]===ae?Lt=t[117]:(Lt=ae&&(0,Q.jsx)(`p`,{role:`status`,className:`absolute bottom-3 left-3 z-10 rounded-lg border bg-popover p-2 text-xs`,children:`Code changed since these lines were selected. Select lines again.`}),t[116]=ae,t[117]=Lt);let Rt;t[118]!==ue||t[119]!==o||t[120]!==a||t[121]!==ie?(Rt=ue&&ie?.discardScope&&ie.current!==!1&&(0,Q.jsx)(`div`,{className:`absolute bottom-3 left-3 z-10 rounded-lg border bg-popover p-2`,children:(0,Q.jsx)(iX,{scope:a,context:o,path:ie.path,hunk:{scope:ie.discardScope,...ue},variant:`compact`})}),t[118]=ue,t[119]=o,t[120]=a,t[121]=ie,t[122]=Rt):Rt=t[122];let zt;t[123]!==St||t[124]!==F||t[125]!==p?(zt=p?p(St):!F&&St&&(0,Q.jsx)(`div`,{className:`flex shrink-0 justify-end px-3`,children:St}),t[123]=St,t[124]=F,t[125]=p,t[126]=zt):zt=t[126];let Bt;t[127]!==U.length||t[128]!==l||t[129]!==c||t[130]!==d||t[131]!==u||t[132]!==wt||t[133]!==I||t[134]!==Ot?(Bt=U.length===0&&(c||d||l)&&(0,Q.jsxs)(`div`,{className:Y(`min-h-0 flex-1 overflow-auto`,I&&Q1),"data-testid":`empty-code-document`,children:[u&&(0,Q.jsx)(`div`,{className:`flex items-center gap-1 px-3.5 py-2`,children:u}),Ot?.(),l?.(),!wt&&d&&(0,Q.jsx)(`div`,{className:`flex justify-end px-3.5 py-2`,children:(0,Q.jsx)(dX,{children:d})})]}),t[127]=U.length,t[128]=l,t[129]=c,t[130]=d,t[131]=u,t[132]=wt,t[133]=I,t[134]=Ot,t[135]=Bt):Bt=t[135];let Ht;t[136]!==M||t[137]!==U[0]?(Ht=M&&U[0]&&(0,Q.jsx)(`div`,{className:`flex min-h-10 shrink-0 items-center gap-2 border-b bg-muted px-2 py-1`,children:(0,Q.jsx)(fr,{className:`min-w-0 flex-1 font-mono text-caption font-medium`,text:U[0].path})}),t[136]=M,t[137]=U[0],t[138]=Ht):Ht=t[138];let Ut=U.length>0&&(0,Q.jsx)(BF,{ref:e=>{if(!e)return;let t=e.getInstance();if(!t)return;let n=ee.attach(t),r=requestAnimationFrame(()=>{ee.restorePosition(t,dt.stickyHeaders&&!dt.disableFileHeader?dt.itemMetrics?.diffHeaderHeight??_d.diffHeaderHeight:0);let n=ge?.state===`code`?U.find(e=>e.id===ge.id):void 0;n&&(e.scrollTo({type:`item`,id:n.id,align:`start`}),ye(n.id));let r=s.fileTarget,i=r?U.find(e=>r.entry===void 0?e.path===r.path:e.id===r.entry):void 0;r&&i&&r.nonce!==Me&&(q.setCollapsed([i.id],!1),r.lines?(se({id:i.id,range:r.lines}),e.scrollTo({type:`line`,id:i.id,lineNumber:r.lines.end,side:r.lines.side,align:`center`})):e.scrollTo({type:`item`,id:i.id,align:`start`}),ye(i.id),Ne(r.nonce));let a=U[0];if(m&&a&&Ee!==m.nonce){se({id:a.id,range:{start:m.line,end:m.line}}),e.scrollTo({type:`line`,id:a.id,lineNumber:m.line,align:`center`});let n=t.getRenderedItems()[0];n?.type===`file`&&je(n.element),De(m.nonce)}});return()=>{cancelAnimationFrame(r),n?.()}},items:Be,onScroll:(e,t)=>{ee.rememberPosition(e),we(t)},selectedLines:oe,onSelectedLinesChange:e=>{se(e),e&&ye(e.id)},renderAnnotation:(...e)=>{let[t]=e,n=t.metadata,r=U.find(e=>e.id===R?.id),i=n.composing,s=T?.kind===`branch`?`branch-file`:`change`,c=i&&r?{kind:`lines`,surface:A?`file`:s,path:r.path,...i,text:r.kind===`diff`?uY(r.fileDiff,i):dY(r.contents,i)}:void 0;return(0,Q.jsx)(sY,{owner:{scope:a,context:o},drafts:n.drafts,anchor:c,composing:i!==void 0,onClose:()=>{z(null),se(null)},className:`mx-3 my-2 max-w-[min(100%,48rem)]`})},renderHeaderMetadata:e=>{let t=Le.get(e.id);if(k||!t)return null;let n=e.id===U[0]?.id,r=!wt&&n?d:null,i=e.id===U[0]?.id?u:null,a=t.review?.stale?(0,Q.jsx)(`span`,{className:`rounded-md bg-graph-4/15 px-1.5 py-0.5 font-sans text-2xs text-graph-4`,children:`Changed since reviewed`}):null;return F?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[a,(0,Q.jsx)(b1,{counts:y1(t)})]}):!a&&!i&&!r?null:(0,Q.jsxs)(`div`,{className:Y(`flex max-w-full items-center justify-end gap-1.5`,!P&&`flex-wrap`),children:[a,i,r&&(0,Q.jsx)(dX,{children:r})]})},options:dt,className:Y(M&&`max-h-48 flex-none overflow-auto`,!M&&j&&`flex-none overflow-visible`,!M&&!j&&`min-h-0 flex-1 overflow-auto`,I&&Q1),...Ot?{renderCodeViewHeader:Ot}:{},...l?{renderCodeViewFooter:l}:{},renderHeaderPrefix:e=>{let t=Le.get(e.id);if(!t)return null;let n=Te.has(e.id),r=t.review,i=r&&!wt&&We.get(r.path)===t.id?r.control:null;return(0,Q.jsxs)(`span`,{className:Y(`flex items-center`,F?`gap-2`:`gap-1`),children:[!P&&H&&e.id===Ue&&U.length>Ve.length&&(0,Q.jsxs)(`span`,{className:`mr-2 border-r pr-2 font-sans text-xs font-medium`,children:[`Specs · `,Vt(He,`file`)]}),(F||N||U.length>1)&&(0,Q.jsx)(t0,{label:`${n?`Expand`:`Collapse`} ${t.path}`,icon:n?ci:sc,expanded:!n,onClick:()=>ht(e.id)}),i]})},renderHeaderFilenameSuffix:e=>{let t=Le.get(e.id);return t&&t.note&&!Y1.has(t.note)?(0,Q.jsx)(fr,{className:`ml-2 hidden max-w-48 font-sans text-xs text-muted-foreground @code-wide/code:block`,text:t.note}):null}}),Wt;return t[139]!==Ie||t[140]!==kt||t[141]!==Pt||t[142]!==Ft||t[143]!==It||t[144]!==Lt||t[145]!==Rt||t[146]!==zt||t[147]!==Bt||t[148]!==Ht||t[149]!==Ut?(Wt=(0,Q.jsxs)(`div`,{role:`region`,"aria-label":`Code content`,onWheel:Ie,onTouchMove:Ie,onPointerDown:Ie,onKeyDown:kt,className:Pt,children:[Ft,It,Lt,Rt,zt,Bt,Ht,Ut]}),t[139]=Ie,t[140]=kt,t[141]=Pt,t[142]=Ft,t[143]=It,t[144]=Lt,t[145]=Rt,t[146]=zt,t[147]=Bt,t[148]=Ht,t[149]=Ut,t[150]=Wt):Wt=t[150],Wt}function R1(e){return e.id}function z1(e){return e.path}function B1(e){return ky(e.path)}function V1(e){return{lineNumber:e.line,metadata:e}}function H1(e){return{side:e.side,lineNumber:e.line,metadata:e}}function U1(e){return[e.id,e]}function W1(e){return e.id}function G1(e){return e.state===`code`}function K1(e){return e.state===`pending`}function q1(e){return e.state!==`omitted`}function J1(e){return{id:e.id,path:e.path,state:`code`}}var Y1=new Set([`added`,`deleted`,`modified`,`renamed`]),X1=8,Z1=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]),Q1=`px-[max(--spacing(4),calc((100%-var(--container-reading))/2))] @2xl/pane:px-[max(--spacing(7),calc((100%-var(--container-reading))/2))]`;function $1(e){let t=(0,$.c)(4),{reviewEnabled:n,next:r,previous:i,review:a,comment:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={ignoreInputs:!0},t[0]=s):s=t[0];let c=s;Hu(ou.nextFile,r,c),Hu(ou.previousFile,i,c),Hu(ou.comment,o,c);let l;return t[1]!==a||t[2]!==n?(l=n?(0,Q.jsx)(e0,{review:a}):null,t[1]=a,t[2]=n,t[3]=l):l=t[3],l}function e0(e){let t=(0,$.c)(1),{review:n}=e,r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={ignoreInputs:!0},t[0]=r):r=t[0],Hu(ou.toggleReviewed,n,r),null}function t0(e){let t=(0,$.c)(14),{label:n,icon:r,expanded:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(X,{size:`icon-xs`,variant:`ghost`,"aria-label":n,"aria-expanded":i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Q.jsx)(r,{}),t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsx)(Ze,{render:o,children:s}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]===n?l=t[10]:(l=(0,Q.jsx)(Yo,{children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(ot,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function n0(e){let t=(0,$.c)(57),{target:n,barActions:r,title:i,titleLabel:a,subtitle:o,aside:s,children:c,className:l,inline:u}=e;if(u!==void 0&&u){let e=a??(typeof i==`string`?i:``),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(`h1`,{}),t[0]=n):n=t[0];let r;t[1]!==e||t[2]!==i?(r=(0,Q.jsx)(fr,{text:e,render:n,className:`min-w-0 text-ui font-semibold`,children:i}),t[1]=e,t[2]=i,t[3]=r):r=t[3];let s;t[4]===o?s=t[5]:(s=o&&(0,Q.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:o}),t[4]=o,t[5]=s);let l;t[6]!==r||t[7]!==s?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-64 items-baseline gap-2`,children:[r,s]}),t[6]=r,t[7]=s,t[8]=l):l=t[8];let u;t[9]===c?u=t[10]:(u=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c}),t[9]=c,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(`header`,{"data-testid":`document-toolbar`,className:`flex min-h-11 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-1.5`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}if(n!==void 0){let e;t[14]!==r||t[15]!==c||t[16]!==n?(e=n&&(0,th.createPortal)(r===void 0?c:r,n),t[14]=r,t[15]=c,t[16]=n,t[17]=e):e=t[17];let l=a??(typeof i==`string`?i:``),u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(`h1`,{}),t[18]=u):u=t[18];let d;t[19]!==l||t[20]!==i?(d=(0,Q.jsx)(fr,{text:l,render:u,className:`min-w-0 text-ui font-semibold`,children:i}),t[19]=l,t[20]=i,t[21]=d):d=t[21];let f;t[22]!==s||t[23]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[d,s]}),t[22]=s,t[23]=d,t[24]=f):f=t[24];let p;t[25]===o?p=t[26]:(p=o&&(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:o}),t[25]=o,t[26]=p);let m;t[27]!==r||t[28]!==c?(m=r!==void 0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:c}),t[27]=r,t[28]=c,t[29]=m):m=t[29];let h;t[30]!==f||t[31]!==p||t[32]!==m?(h=(0,Q.jsxs)(`div`,{className:`shrink-0 px-3.5 py-2`,children:[f,p,m]}),t[30]=f,t[31]=p,t[32]=m,t[33]=h):h=t[33];let g;return t[34]!==e||t[35]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[e,h]}),t[34]=e,t[35]=h,t[36]=g):g=t[36],g}let d;t[37]===l?d=t[38]:(d=Y(`flex min-h-11 shrink-0 flex-wrap items-center gap-x-2.5 gap-y-1 border-b px-3.5`,l),t[37]=l,t[38]=d);let f=a??(typeof i==`string`?i:``),p;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`h1`,{}),t[39]=p):p=t[39];let m;t[40]!==f||t[41]!==i?(m=(0,Q.jsx)(fr,{text:f,render:p,className:`min-w-0 text-ui leading-tight font-semibold`,children:i}),t[40]=f,t[41]=i,t[42]=m):m=t[42];let h;t[43]!==s||t[44]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[m,s]}),t[43]=s,t[44]=m,t[45]=h):h=t[45];let g;t[46]===o?g=t[47]:(g=o!=null&&(0,Q.jsx)(fr,{text:o,render:(0,Q.jsx)(`p`,{}),className:`text-2xs leading-tight text-muted-foreground`}),t[46]=o,t[47]=g);let _;t[48]!==h||t[49]!==g?(_=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-auto flex-col`,children:[h,g]}),t[48]=h,t[49]=g,t[50]=_):_=t[50];let v;t[51]===c?v=t[52]:(v=(0,Q.jsx)(`div`,{className:`ml-auto flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1.5`,children:c}),t[51]=c,t[52]=v);let y;return t[53]!==d||t[54]!==_||t[55]!==v?(y=(0,Q.jsxs)(`header`,{"data-testid":`document-toolbar`,className:d,children:[_,v]}),t[53]=d,t[54]=_,t[55]=v,t[56]=y):y=t[56],y}function r0(e){let t=(0,$.c)(4),{more:n,total:r,pending:i,onReadMore:a}=e;if(n<=0)return null;let o=`Read ${Math.min(n,25)} more of ${r}`,s;return t[0]!==a||t[1]!==i||t[2]!==o?(s=(0,Q.jsx)(`div`,{className:`border-t px-4 py-3 text-center`,children:(0,Q.jsx)(ji,{pending:i,variant:`outline`,size:`sm`,onClick:a,children:o})}),t[0]=a,t[1]=i,t[2]=o,t[3]=s):s=t[3],s}function i0(e){let t=(0,$.c)(2),{count:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`flex flex-col`,children:Array.from({length:n},a0)}),t[0]=n,t[1]=r),r}function a0(e,t){return(0,Q.jsx)(`div`,{className:`min-h-40`},t)}var o0={open:Zh,review:Dn,comment:Yg,"open-to-side":Lh,"open-file":rg,timeline:h_,"copy-relative":Bs,discard:F_,"expand-all":Th,"collapse-all":Ch};function s0(e){let t=(0,$.c)(2),{action:n}=e,r=o0[n.id],i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(r,{}),t[0]=r,t[1]=i),i}function c0(e){let t=(0,$.c)(52),{actions:n,label:r,description:i,writeBlock:a,onAction:o,children:s}=e,c=(0,Z.useId)(),[l,u]=(0,Z.useState)(!1),d;t[0]===a?d=t[1]:(d=e=>e===`review`||e===`discard`?a:void 0,t[0]=a,t[1]=d);let f=d,p;t[2]!==f||t[3]!==o?(p=e=>{f(e)||(e===`open-to-side`&&(0,th.flushSync)(()=>u(!0)),o(e))},t[2]=f,t[3]=o,t[4]=p):p=t[4];let m=p,h;t[5]!==m||t[6]!==f?(h=e=>{let t=f(e.id);return{disabled:e.disabled||!!t,"aria-description":t,destructive:e.destructive===!0,onSelect:()=>m(e.id)}},t[5]=m,t[6]=f,t[7]=h):h=t[7];let g=h,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e&&u(!1)},t[8]=_):_=t[8];let v=_,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`div`,{className:`min-w-0`}),t[9]=y):y=t[9];let b;t[10]!==i||t[11]!==c?(b=i&&(0,Q.jsx)(`span`,{id:c,className:`sr-only`,children:i}),t[10]=i,t[11]=c,t[12]=b):b=t[12];let x=i?c:void 0,S;t[13]!==r||t[14]!==x?(S=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-xs`,className:`shrink-0`,"aria-label":r,"aria-describedby":x}),t[13]=r,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Vh,{}),t[16]=C):C=t[16];let w;t[17]===S?w=t[18]:(w=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(Vo,{render:S,children:C})}),t[17]=S,t[18]=w);let T;t[19]===r?T=t[20]:(T=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:r}),t[19]=r,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,Q.jsxs)(ot,{children:[w,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D=l?`none`:`trigger`,O;if(t[24]!==n||t[25]!==g){let e;t[27]===g?e=t[28]:(e=e=>(0,Q.jsxs)(dn,{...g(e),children:[(0,Q.jsx)(s0,{action:e}),e.label]},e.id),t[27]=g,t[28]=e),O=n.map(e),t[24]=n,t[25]=g,t[26]=O}else O=t[26];let k;t[29]!==D||t[30]!==O?(k=(0,Q.jsx)(Ne,{align:`end`,finalFocus:D,children:O}),t[29]=D,t[30]=O,t[31]=k):k=t[31];let A;t[32]!==E||t[33]!==k||t[34]!==b?(A=(0,Q.jsxs)(Wt,{onOpenChange:v,children:[b,E,k]}),t[32]=E,t[33]=k,t[34]=b,t[35]=A):A=t[35];let j;t[36]!==s||t[37]!==A?(j=s(A),t[36]=s,t[37]=A,t[38]=j):j=t[38];let M;t[39]===j?M=t[40]:(M=(0,Q.jsx)(uH,{render:y,children:j}),t[39]=j,t[40]=M);let N=l?`none`:`trigger`,P;if(t[41]!==n||t[42]!==g){let e;t[44]===g?e=t[45]:(e=e=>(0,Q.jsxs)(dn,{...g(e),children:[(0,Q.jsx)(s0,{action:e}),e.label]},e.id),t[44]=g,t[45]=e),P=n.map(e),t[41]=n,t[42]=g,t[43]=P}else P=t[43];let F;t[46]!==N||t[47]!==P?(F=(0,Q.jsx)(dH,{finalFocus:N,children:P}),t[46]=N,t[47]=P,t[48]=F):F=t[48];let I;return t[49]!==M||t[50]!==F?(I=(0,Q.jsxs)(Wt,{onOpenChange:v,children:[M,F]}),t[49]=M,t[50]=F,t[51]=I):I=t[51],I}function l0(e,t,n,r=!0){return{path:n.path,fingerprint:n.fingerprint??null,reviewed:n.reviewStatus===`reviewed`,stale:n.reviewStatus===`stale`,current:r,control:(0,Q.jsx)(u0,{scope:e,context:t,path:n.path,fingerprint:n.fingerprint,status:n.reviewStatus,current:r,compact:!0},`review:${n.path}`)}}function u0(e){let t=(0,$.c)(48),{scope:n,context:r,path:i,fingerprint:a,status:o,current:s,compact:c,range:l}=e,u=s===void 0||s,d=c!==void 0&&c,f=l===void 0?fy:l,p=na(r),m=T1(n,r,f),h=E1(n,r,f),g=m.result.waiting||h.result.waiting,_,v;if(t[0]!==d||t[1]!==u||t[2]!==a||t[3]!==m||t[4]!==i||t[5]!==g||t[6]!==o||t[7]!==h||t[8]!==p){v=Symbol.for(`react.early_return_sentinel`);bb0:{let e=nB(m.result,h.result);if(a==null){let e;t[11]===i?e=t[12]:(e=yy([i]),t[11]=i,t[12]=e);let n;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Gh,{className:`size-3`,"aria-hidden":`true`}),t[13]=n):n=t[13];let r=d?`Not reviewable`:`Not reviewable: too large or unreadable`,a;t[14]!==e||t[15]!==r?(a=(0,Q.jsxs)(`span`,{title:e,className:`inline-flex items-center gap-1 text-2xs text-muted-foreground`,children:[n,r]}),t[14]=e,t[15]=r,t[16]=a):a=t[16],v=a;break bb0}let n=o===`reviewed`,r;t[17]!==i||t[18]!==o?(r=Cy(i,o),t[17]=i,t[18]=o,t[19]=r):r=t[19];let s=r,c=d?`icon-xs`:`xs`,l=n?`ghost`:`outline`,f=g||!!p||!u,y;t[20]!==a||t[21]!==m||t[22]!==i||t[23]!==n||t[24]!==h?(y=()=>{n?h.start(i):m.start({path:i,fingerprint:a})},t[20]=a,t[21]=m,t[22]=i,t[23]=n,t[24]=h,t[25]=y):y=t[25];let b;t[26]!==d||t[27]!==g||t[28]!==o?(b=(0,Q.jsx)(y0,{pending:g,status:o,compact:d}),t[26]=d,t[27]=g,t[28]=o,t[29]=b):b=t[29];let x;t[30]!==d||t[31]!==o?(x=!d&&b0(o),t[30]=d,t[31]=o,t[32]=x):x=t[32];let S;t[33]!==s||t[34]!==n||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==c||t[39]!==l||t[40]!==f||t[41]!==p?(S=(0,Q.jsx)(Ze,{render:(0,Q.jsxs)(X,{type:`button`,size:c,variant:l,"aria-pressed":n,disabled:f,focusableWhenDisabled:!0,"aria-description":p,"aria-label":s,onClick:y,children:[b,x]})}),t[33]=s,t[34]=n,t[35]=y,t[36]=b,t[37]=x,t[38]=c,t[39]=l,t[40]=f,t[41]=p,t[42]=S):S=t[42];let C=p??s,w;t[43]===C?w=t[44]:(w=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:C}),t[43]=C,t[44]=w);let T;t[45]!==S||t[46]!==w?(T=(0,Q.jsxs)(ot,{children:[S,w]}),t[45]=S,t[46]=w,t[47]=T):T=t[47],_=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[T,e!==void 0&&(0,Q.jsx)(fr,{className:`max-w-52 text-2xs text-destructive`,render:(0,Q.jsx)(`span`,{role:`alert`}),text:cy(e)})]})}t[0]=d,t[1]=u,t[2]=a,t[3]=m,t[4]=i,t[5]=g,t[6]=o,t[7]=h,t[8]=p,t[9]=_,t[10]=v}else _=t[9],v=t[10];return v===Symbol.for(`react.early_return_sentinel`)?_:v}function d0(e){let t=(0,$.c)(25),{scope:n,context:r,path:i,fingerprint:a,status:o,latest:s,onStart:c}=e,l=na(r),u=T1(n,r,fy),d=E1(n,r,fy),f=u.result.waiting||d.result.waiting,p=nB(u.result,d.result),m=s?p:void 0,h=(0,Z.useId)(),g=o===`reviewed`,_=a!=null,v=o===`stale`?`Changed since reviewed`:`Toggle reviewed`,y;t[0]!==i||t[1]!==_||t[2]!==v||t[3]!==l?(y=l??(_?v:yy([i])),t[0]=i,t[1]=_,t[2]=v,t[3]=l,t[4]=y):y=t[4];let b=y,x=`${i} reviewed`,S=m!==void 0,C=f||!_||!!l,w;t[5]!==f||t[6]!==a||t[7]!==u||t[8]!==c||t[9]!==i||t[10]!==g||t[11]!==d||t[12]!==l?(w=()=>{l||f||a==null||(c(),g?d.start(i):u.start({path:i,fingerprint:a}))},t[5]=f,t[6]=a,t[7]=u,t[8]=c,t[9]=i,t[10]=g,t[11]=d,t[12]=l,t[13]=w):w=t[13];let T;t[14]!==f||t[15]!==h||t[16]!==g||t[17]!==x||t[18]!==S||t[19]!==C||t[20]!==w?(T=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(OX,{checked:g,"aria-label":x,"aria-describedby":h,"aria-invalid":S,disabled:C,"aria-busy":f,onCheckedChange:w})}),t[14]=f,t[15]=h,t[16]=g,t[17]=x,t[18]=S,t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;return t[22]!==b||t[23]!==h?(E=(0,Q.jsx)(`span`,{id:h,hidden:!0,children:b}),t[22]=b,t[23]=h,t[24]=E):E=t[24],(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ot,{children:[T,(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:m===void 0?b:cy(m)})]}),E,m!==void 0&&(0,Q.jsx)(`span`,{role:`alert`,className:`sr-only`,children:cy(m)})]})}function f0(e){let t=(0,$.c)(20),{scope:n,context:r,branchFiles:i,changes:a,committed:o,dirty:s,range:c}=e,l=u1(n,r,c),u;t[0]!==i||t[1]!==o||t[2]!==l?(u=sy(i,l,o),t[0]=i,t[1]=o,t[2]=l,t[3]=u):u=t[3];let d=u,f=u1(n,r),p;t[4]!==a||t[5]!==s||t[6]!==f?(p=oy(a,f,s),t[4]=a,t[5]=s,t[6]=f,t[7]=p):p=t[7];let m=p,{reviewed:h,disabled:g,toggle:_,writeBlock:v}=k1(n,r,c,d,m,m0),y;t[8]!==d||t[9]!==m?(y=[...d,...m],t[8]=d,t[9]=m,t[10]=y):y=t[10];let b=y,x=b.length,S;t[11]===b?S=t[12]:(S=b.filter(p0),t[11]=b,t[12]=S);let C;return t[13]!==g||t[14]!==b.length||t[15]!==h||t[16]!==S.length||t[17]!==_||t[18]!==v?(C={reviewed:h,disabled:g,toggle:_,writeBlock:v,count:x,done:S.length},t[13]=g,t[14]=b.length,t[15]=h,t[16]=S.length,t[17]=_,t[18]=v,t[19]=C):C=t[19],C}function p0(e){return e.reviewStatus===`reviewed`}function m0(e){return ks(e)}function h0(e){let t=(0,$.c)(17),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({label:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{reviewed:a,disabled:o,toggle:s,writeBlock:c,count:l,done:u}=f0(i),d=a?`Mark step unreviewed`:`Mark step reviewed`,f;t[4]!==o||t[5]!==d?(f=[{id:`review`,label:d,disabled:o}],t[4]=o,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==l||t[9]!==u?(p=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[n,(0,Q.jsxs)(`span`,{"aria-label":`${u} of ${l} reviewed`,className:`ml-auto text-2xs tabular-nums text-muted-foreground`,children:[u,`/`,l]}),e]}),t[7]=n,t[8]=l,t[9]=u,t[10]=p):p=t[10];let m;return t[11]!==r||t[12]!==f||t[13]!==p||t[14]!==s||t[15]!==c?(m=(0,Q.jsx)(c0,{label:r,actions:f,writeBlock:c,onAction:s,children:p}),t[11]=r,t[12]=f,t[13]=p,t[14]=s,t[15]=c,t[16]=m):m=t[16],m}function g0(e){let t=(0,$.c)(17),n,r;t[0]===e?(n=t[1],r=t[2]):({interaction:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{reviewed:i,disabled:a,toggle:o,writeBlock:s}=f0(r);if(!n.toolbarTarget)return null;let c;t[3]!==n.active||t[4]!==o?(c=n.active&&(0,Q.jsx)(_0,{toggle:o}),t[3]=n.active,t[4]=o,t[5]=c):c=t[5];let l=s??(i?`Mark this step unreviewed`:`Mark this step reviewed`),u;t[6]!==a||t[7]!==i||t[8]!==l||t[9]!==o?(u=(0,Q.jsx)(l1,{label:`Reviewed`,description:l,variant:`outline`,icon:Dn,shortcut:ou.toggleReviewed,pressed:i,disabled:a,onClick:o}),t[6]=a,t[7]=i,t[8]=l,t[9]=o,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==n.toolbarTarget||t[15]!==d?(f=(0,th.createPortal)(d,n.toolbarTarget),t[14]=n.toolbarTarget,t[15]=d,t[16]=f):f=t[16],f}function _0(e){let t=(0,$.c)(1),{toggle:n}=e,r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={ignoreInputs:!0},t[0]=r):r=t[0],Hu(ou.toggleReviewed,n,r),null}function v0(e){let t=(0,$.c)(6),{scope:n,context:r,entries:i,compact:a,range:o}=e,s=a!==void 0&&a,c=D1(n,r,o===void 0?fy:o),l=Sy(i),u=c.result.waiting,d=na(r),f=l.blocked||u||!!d,p=()=>{f||(l.unmarking?c.start({kind:`unmark`,paths:l.reviewedPaths}):c.start({kind:`mark`,entries:l.entries}))},m=d??l.label,h;t[0]===m?h=t[1]:(h=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:m}),t[0]=m,t[1]=h);let g;t[2]===c.report?g=t[3]:(g=c.report&&(0,Q.jsx)(C0,{report:c.report}),t[2]=c.report,t[3]=g);let _;return t[4]===c.result?_=t[5]:(_=Mi(c.result)&&(0,Q.jsx)(`span`,{role:`alert`,className:`max-w-64 text-right text-2xs text-destructive`,children:cy(Ra(c.result.cause))}),t[4]=c.result,t[5]=_),(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 flex-col items-end gap-1`,children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsxs)(X,{type:`button`,size:s?`icon-xs`:`sm`,variant:`outline`,disabled:f,focusableWhenDisabled:!0,"aria-label":l.label,"aria-description":d,onClick:p,children:[(0,Q.jsx)(x0,{pending:u,unmarking:l.unmarking}),!s&&S0(u,l.unmarking,l.text)]})}),h]}),g,_]})}function y0(e){let t=(0,$.c)(7),{pending:n,status:r,compact:i}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(ra,{className:`animate-spin`}),t[0]=e):e=t[0],e}if(r===`reviewed`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Dn,{}),t[1]=e):e=t[1],e}if(r===`stale`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Au,{}),t[2]=e):e=t[2],e}let a=i&&`invisible`,o;t[3]===a?o=t[4]:(o=Y(a),t[3]=a,t[4]=o);let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(Dn,{className:o}),t[5]=o,t[6]=s),s}function b0(e){return e===`reviewed`?`Reviewed`:e===`stale`?`Review again`:`Mark reviewed`}function x0(e){let t=(0,$.c)(3),{pending:n,unmarking:r}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(ra,{className:`animate-spin`}),t[0]=e):e=t[0],e}if(r){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Au,{}),t[1]=e):e=t[1],e}let i;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dn,{}),t[2]=i):i=t[2],i}function S0(e,t,n){return e?t?`Unmarking…`:`Marking…`:n}function C0(e){let t=(0,$.c)(11),{report:n}=e,r=n.failed.length,i=r>0?`alert`:`status`,a=r>0?`text-destructive`:`text-muted-foreground`,o;t[0]===a?o=t[1]:(o=Y(`max-w-64 text-right text-2xs leading-tight`,a),t[0]=a,t[1]=o);let s;t[2]===r?s=t[3]:(s=r>0&&(0,Q.jsx)(Dh,{className:`mr-1 inline size-3`}),t[2]=r,t[3]=s);let c;t[4]===n?c=t[5]:(c=vy(n),t[4]=n,t[5]=c);let l;return t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,Q.jsxs)(`span`,{role:i,className:o,children:[s,c]}),t[6]=i,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function w0(e){let t=(0,$.c)(9),n,r;if(t[0]===e?(n=t[1],r=t[2]):({compared:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n){let e=r.fullHeight??!1,i;return t[3]!==n||t[4]!==r||t[5]!==e?(i=(0,Q.jsx)(D0,{...r,branch:n,path:void 0,fullHeight:e}),t[3]=n,t[4]=r,t[5]=e,t[6]=i):i=t[6],i}let i;return t[7]===r?i=t[8]:(i=(0,Q.jsx)(E0,{...r,path:void 0}),t[7]=r,t[8]=i),i}function T0(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({path:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Q.jsx)(E0,{...r,path:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function E0(e){let t=(0,$.c)(14),{scope:n,context:r,interaction:i,base:a,path:o,only:s,heading:c,fullHeight:l,onOpen:u}=e,d=l!==void 0&&l,f;t[0]!==r||t[1]!==d||t[2]!==c||t[3]!==i||t[4]!==u||t[5]!==s||t[6]!==o||t[7]!==n?(f=e=>(0,Q.jsx)(D0,{scope:n,context:r,interaction:i,onOpen:u,branch:e,path:o,only:s,heading:c,fullHeight:d}),t[0]=r,t[1]=d,t[2]=c,t[3]=i,t[4]=u,t[5]=s,t[6]=o,t[7]=n,t[8]=f):f=t[8];let p;return t[9]!==a||t[10]!==r||t[11]!==n||t[12]!==f?(p=(0,Q.jsx)(p1,{scope:n,context:r,base:a,children:f}),t[9]=a,t[10]=r,t[11]=n,t[12]=f,t[13]=p):p=t[13],p}function D0(e){let t=(0,$.c)(33),{scope:n,context:r,interaction:i,branch:a,path:o,only:s,heading:c,fullHeight:l,onOpen:u}=e,d=l!==void 0&&l,f;t[0]===a?f=t[1]:(f=py(a),t[0]=a,t[1]=f);let p=f,m=u1(n,r,p);if(a.base===null||a.base===void 0)return null;let h;t[2]!==a.files||t[3]!==s||t[4]!==o?(h=()=>s?a.files.filter(e=>s.includes(e.path)||e.oldPath!==void 0&&s.includes(e.oldPath)).map(O0):o==null?void 0:[o],t[2]=a.files,t[3]=s,t[4]=o,t[5]=h):h=t[5];let g=h,_;t[6]!==a.files||t[7]!==m||t[8]!==g?(_=sy(a.files,m,g()),t[6]=a.files,t[7]=m,t[8]=g,t[9]=_):_=t[9];let v=_;if(o!=null&&v.length===0){let e;t[10]===a.base.ref?e=t[11]:(e=Vy(a.base.ref),t[10]=a.base.ref,t[11]=e);let n=`${o} has no committed change since ${e}.`,r;return t[12]===n?r=t[13]:(r=(0,Q.jsx)(vn,{message:n}),t[12]=n,t[13]=r),r}let y=o!=null,b=a.base.ref,x=a.head,S=a.mergeBaseOid??``,C=a.commits,w;t[14]===a?w=t[15]:(w=Zv(a),t[14]=a,t[15]=w);let T;t[16]!==a.base.ref||t[17]!==a.commits||t[18]!==a.head||t[19]!==w||t[20]!==S?(T={base:b,head:x,mergeBaseOid:S,commits:C,diffRange:w},t[16]=a.base.ref,t[17]=a.commits,t[18]=a.head,t[19]=w,t[20]=S,t[21]=T):T=t[21];let E;return t[22]!==r||t[23]!==d||t[24]!==c||t[25]!==i||t[26]!==v||t[27]!==u||t[28]!==p||t[29]!==n||t[30]!==T||t[31]!==y?(E=(0,Q.jsx)(k0,{scope:n,context:r,interaction:i,onOpen:u,range:p,items:v,single:y,heading:c,fullHeight:d,branch:T}),t[22]=r,t[23]=d,t[24]=c,t[25]=i,t[26]=v,t[27]=u,t[28]=p,t[29]=n,t[30]=T,t[31]=y,t[32]=E):E=t[32],E}function O0(e){return e.path}function k0(e){let t=(0,$.c)(63),{scope:n,context:r,interaction:i,range:a,items:o,single:s,heading:c,fullHeight:l,branch:u,onOpen:d}=e,f=l!==void 0&&l,{connection:p}=r,m=de(qr(iB(n,p))),h=JSON.stringify([u.base,u.head.branch]),[g,_]=B(O$(JSON.stringify([p.environmentId,n.projectId,n.worktreeId,h]))),v=o.slice(0,g),y=bB(n,p,u.diffRange,v.map(Ly)),b=JSON.stringify([u.diffRange,v.map(M0)]),[x,S]=(0,Z.useState)({version:``,comparison:h,count:v.length,patches:new Map});if(!y.pending&&!y.failed&&x.version!==b){let e;t[0]===y.patches?e=t[1]:(e=e=>{let t=y.patches.get(Ly(e).join(`\0`));return t?[[e.fingerprint,t]]:[]},t[0]=y.patches,t[1]=e),S({version:b,comparison:h,count:v.length,patches:new Map(v.flatMap(e))})}let C=e=>y.patches.get(Ly(e).join(`\0`))??(x.comparison===h?x.patches.get(e.fingerprint):void 0),w;t[2]!==r||t[3]!==a||t[4]!==n?(w=(e,t)=>(0,Q.jsx)(u0,{scope:n,context:r,path:e.path,fingerprint:e.fingerprint,status:e.reviewStatus,range:a,compact:t},`review:${e.path}`),t[2]=r,t[3]=a,t[4]=n,t[5]=w):w=t[5];let T=w,E;t[6]!==u.head.oid||t[7]!==T||t[8]!==C?(E=e=>{let t=lB(u.head.oid,e,C(e));return t==null?[]:[{...t,id:`branch:${e.path}`,review:{path:e.path,fingerprint:e.fingerprint,reviewed:e.reviewStatus===`reviewed`,stale:e.reviewStatus===`stale`,control:T(e,!0)}}]},t[6]=u.head.oid,t[7]=T,t[8]=C,t[9]=E):E=t[9];let D=v.flatMap(E),O=new Set(D.map(j0)),k=v.filter(e=>!O.has(e.path)&&(i.quiet!==!0||y.failed||C(e)!==void 0)),A=y.pending&&x.comparison===h?x.count:v.length,j=o.length-A,M=m?.changes.length??0,[N]=o,P=c!==void 0;if(i.quiet===!0&&D.length===0&&y.pending){let e;return t[10]===v.length?e=t[11]:(e=(0,Q.jsx)(i0,{count:v.length}),t[10]=v.length,t[11]=e),e}let F=!s&&!P,I;t[12]!==N||t[13]!==d||t[14]!==s?(I=s&&N?(0,Q.jsx)(l1,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>d({kind:`timeline`,path:N.path})}):void 0,t[12]=N,t[13]=d,t[14]=s,t[15]=I):I=t[15];let L;t[16]!==u.base||t[17]!==u.commits||t[18]!==u.head.branch||t[19]!==r||t[20]!==T||t[21]!==D||t[22]!==N||t[23]!==c||t[24]!==i.toolbarTarget||t[25]!==o||t[26]!==a||t[27]!==n||t[28]!==s||t[29]!==P?(L=e=>s&&N&&P?null:s&&N?(0,Q.jsx)(n0,{target:i.toolbarTarget,barActions:null,title:dy(N.path),subtitle:`${[N.oldPath,N.path].filter(A0).join(` → `)} · on the branch`,aside:D[0]&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(b1,{counts:y1(D[0])}),N.reviewStatus===`stale`&&(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md bg-graph-4/15 px-1.5 py-0.5 text-2xs text-graph-4`,children:`Changed since reviewed`})]}),children:i.toolbarTarget===void 0&&T(N,!1)}):P?(0,Q.jsxs)(n0,{inline:!0,...c?{title:c.title,titleLabel:c.titleLabel}:{title:`All changes`},subtitle:Vt(o.length,`file`),children:[e,c?.after]}):(0,Q.jsxs)(n0,{inline:!0,title:`${u.head.branch?Vy(u.head.branch):`This commit`} since ${Vy(u.base)}`,subtitle:`${Vt(o.length,`file`)} · ${Vt(u.commits,`commit`)}`,children:[e,(0,Q.jsx)(v0,{scope:n,context:r,entries:o,range:a})]}),t[16]=u.base,t[17]=u.commits,t[18]=u.head.branch,t[19]=r,t[20]=T,t[21]=D,t[22]=N,t[23]=c,t[24]=i.toolbarTarget,t[25]=o,t[26]=a,t[27]=n,t[28]=s,t[29]=P,t[30]=L):L=t[30];let R;t[31]!==T||t[32]!==y.failed||t[33]!==y.retry||t[34]!==k||t[35]!==C||t[36]!==s||t[37]!==P||t[38]!==M?(R=()=>(0,Q.jsx)(N0,{single:s,singleHeader:P,uncommitted:M,omitted:k,patchOf:C,failed:y.failed,onRetry:y.retry,control:e=>T(e,!0)}),t[31]=T,t[32]=y.failed,t[33]=y.retry,t[34]=k,t[35]=C,t[36]=s,t[37]=P,t[38]=M,t[39]=R):R=t[39];let z;t[40]!==r||t[41]!==D||t[42]!==f||t[43]!==i||t[44]!==a||t[45]!==n||t[46]!==s||t[47]!==F||t[48]!==I||t[49]!==L||t[50]!==R?(z=(0,Q.jsx)(N1,{comments:!0,fullHeight:f,disableFileHeader:s,readingColumn:F,scope:n,context:r,interaction:i,range:a,headerActions:I,entries:D,toolbar:L,header:R}),t[40]=r,t[41]=D,t[42]=f,t[43]=i,t[44]=a,t[45]=n,t[46]=s,t[47]=F,t[48]=I,t[49]=L,t[50]=R,t[51]=z):z=t[51];let V;t[52]!==_||t[53]!==g?(V=()=>_(g+25),t[52]=_,t[53]=g,t[54]=V):V=t[54];let H;t[55]!==y.pending||t[56]!==o.length||t[57]!==j||t[58]!==V?(H=(0,Q.jsx)(r0,{more:j,total:o.length,pending:y.pending,onReadMore:V}),t[55]=y.pending,t[56]=o.length,t[57]=j,t[58]=V,t[59]=H):H=t[59];let U;return t[60]!==H||t[61]!==z?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[z,H]}),t[60]=H,t[61]=z,t[62]=U):U=t[62],U}function A0(e,t,n){return e!==void 0&&n.indexOf(e)===t}function j0(e){return e.path}function M0(e){return e.fingerprint}function N0(e){let t=(0,$.c)(18),{single:n,singleHeader:r,uncommitted:i,omitted:a,patchOf:o,failed:s,onRetry:c,control:l}=e,u=i>0&&!r;if(!u&&!s&&a.length===0)return null;let d=n&&`mb-3`,f;t[0]===d?f=t[1]:(f=Y(`mx-4 mt-3 flex flex-col gap-3`,d),t[0]=d,t[1]=f);let p;t[2]===u?p=t[3]:(p=u&&(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Uncommitted changes are not part of the branch review. Review them under Uncommitted.`}),t[2]=u,t[3]=p);let m;t[4]!==s||t[5]!==c?(m=s&&(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[`Some patches could not be read.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:c,children:`Try again`})]}),t[4]=s,t[5]=c,t[6]=m):m=t[6];let h;t[7]!==l||t[8]!==s||t[9]!==a||t[10]!==o||t[11]!==n?(h=a.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Changes without code preview`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 rounded-lg border bg-muted/25 px-3 py-2 text-xs`,children:[l(e),!n&&(0,Q.jsx)(fr,{className:`font-mono font-medium`,text:e.path}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.status,o(e)!==void 0||s?` · ${W_(e,o(e),s)??`No code change`}`:``]})]},e.path))}),t[7]=l,t[8]=s,t[9]=a,t[10]=o,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==h?(g=(0,Q.jsxs)(`section`,{className:f,children:[p,m,h]}),t[13]=f,t[14]=p,t[15]=m,t[16]=h,t[17]=g):g=t[17],g}var P0=e=>Ly(e).join(`\0`);function F0(e){let t=(0,$.c)(52),{scope:n,context:r,interaction:i,oid:a,onOpen:o}=e,{connection:s}=r,[c,l]=(0,Z.useState)(1),[,u]=(0,Z.useTransition)(),d=ZX(s,n,a,c),f;t[0]!==s||t[1]!==n?(f=XX({connection:s,scope:n}),t[0]=s,t[1]=n,t[2]=f):f=t[2];let p=de(qr(Ot(f))),m=p?.snapshot?.head.kind===`attached`&&p.commits.some(e=>e.oid===a)?Vy(p.snapshot.head.ref):void 0,h=`${a}:${c}`,g;t[3]===h?g=t[4]:(g={of:h,shown:25},t[3]=h,t[4]=g);let[_,v]=(0,Z.useState)(g),y=_.of===`${a}:${c}`?_.shown:25,b;t[5]!==a||t[6]!==c||t[7]!==y?(b=()=>v({of:`${a}:${c}`,shown:y+25}),t[5]=a,t[6]=c,t[7]=y,t[8]=b):b=t[8];let x=b,S=d.files.slice(0,y),C=SB(s,n,a,c,S.map(z0)),w;t[9]===C.patches?w=t[10]:(w=e=>C.patches.get(P0(e)),t[9]=C.patches,t[10]=w);let T=w,E;t[11]!==a||t[12]!==c||t[13]!==T?(E=e=>{let t=lB(a,e,T(e));return t==null?[]:[{...t,id:`${t.id}:${c}`}]},t[11]=a,t[12]=c,t[13]=T,t[14]=E):E=t[14];let D=S.flatMap(E),O;t[15]!==a||t[16]!==T?(O=e=>(lB(a,e,T(e))??null)===null,t[15]=a,t[16]=T,t[17]=O):O=t[17];let k=S.filter(O),A=d.files.length-S.length,j;t[18]!==d.commit.subject||t[19]!==a?(j=d.commit.subject||`Commit ${By(a)}`,t[18]=d.commit.subject,t[19]=a,t[20]=j):j=t[20];let M=j,N=new Map(D.map(R0));for(let e of S)T(e)?.kind===`metadata-only`&&N.set(Ry(e),{added:0,removed:0});let P=A===0&&d.files.every(e=>{let t=T(e);return N.has(Ry(e))||t?.kind===`binary`})?[...N.values()].reduce(L0,{added:0,removed:0}):void 0,F;t[21]===a?F=t[22]:(F=(0,Q.jsx)(l1,{label:`Copy hash`,icon:Bs,onClick:()=>Zt(a,`commit id`)}),t[21]=a,t[22]=F);let I;t[23]===o?I=t[24]:(I=(0,Q.jsx)(l1,{label:`Open in graph`,icon:_g,onClick:()=>o({kind:`graph`})}),t[23]=o,t[24]=I);let L;t[25]!==I||t[26]!==F?(L=(0,Q.jsxs)(Q.Fragment,{children:[F,I]}),t[25]=I,t[26]=F,t[27]=L):L=t[27];let R=L,z;t[28]!==R||t[29]!==m||t[30]!==d.commit||t[31]!==i.toolbarTarget||t[32]!==a||t[33]!==c||t[34]!==u||t[35]!==M?(z=e=>(0,Q.jsxs)(`header`,{className:`mx-auto w-full max-w-commit px-7 pt-10`,children:[i.toolbarTarget?(0,th.createPortal)(R,i.toolbarTarget):(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:R}),(0,Q.jsxs)(`div`,{className:`flex min-h-5.5 min-w-0 flex-wrap items-center gap-x-2 text-ui leading-5.5 font-medium text-muted-foreground`,children:[(0,Q.jsx)(yg,{className:`size-3.5 shrink-0`}),(0,Q.jsxs)(`span`,{children:[`Commit`,` `,(0,Q.jsx)(fr,{text:a,disclose:`always`,className:`font-mono text-caption text-foreground`,children:By(a)})]}),m&&(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`on`,` `,(0,Q.jsx)(fr,{text:m,className:`font-mono text-caption font-normal`})]})]}),(0,Q.jsx)(fr,{text:M,render:(0,Q.jsx)(`h1`,{}),className:`mt-3 text-2xl leading-tight font-semibold tracking-tight`}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[d.commit.parentOids.length>1&&(0,Q.jsx)(Nu,{value:String(c),onValueChange:e=>u(()=>l(Number(e))),children:(0,Q.jsx)(kd,{children:d.commit.parentOids.map(I0)})}),(0,Q.jsx)(l1,{label:`Copy message`,icon:Bs,onClick:()=>Zt(Iy(d.commit),`commit message`)}),e]})]}),t[28]=R,t[29]=m,t[30]=d.commit,t[31]=i.toolbarTarget,t[32]=a,t[33]=c,t[34]=u,t[35]=M,t[36]=z):z=t[36];let B=()=>(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(B0,{commit:d,branch:m,counts:N,total:P,omitted:k,patchOf:T,failed:C.failed,onRetry:C.retry})}),V;t[37]!==r||t[38]!==D||t[39]!==i||t[40]!==n||t[41]!==z||t[42]!==B?(V=(0,Q.jsx)(N1,{toolbar:z,framed:!0,scope:n,context:r,interaction:i,entries:D,header:B}),t[37]=r,t[38]=D,t[39]=i,t[40]=n,t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]!==d.files.length||t[45]!==C.pending||t[46]!==A||t[47]!==x?(H=(0,Q.jsx)(r0,{more:A,total:d.files.length,pending:C.pending,onReadMore:x}),t[44]=d.files.length,t[45]=C.pending,t[46]=A,t[47]=x,t[48]=H):H=t[48];let U;return t[49]!==V||t[50]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[V,H]}),t[49]=V,t[50]=H,t[51]=U):U=t[51],U}function I0(e,t){return(0,Q.jsxs)(hd,{value:String(t+1),children:[BX(t+1),` parent ·`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:By(e)})]},e)}function L0(e,t){return{added:e.added+t.added,removed:e.removed+t.removed}}function R0(e){return[e.path,e.lineCounts]}function z0(e){return Ly(e)}function B0(e){let t=(0,$.c)(62),{commit:n,omitted:r,patchOf:i,failed:a,onRetry:o,branch:s,counts:c,total:l}=e,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-5 shrink-0 place-items-center rounded-sm border border-border-strong text-foreground`,children:(0,Q.jsx)(L_,{className:`size-3`})}),t[0]=u):u=t[0];let d;t[1]===n.commit.author.name?d=t[2]:(d=(0,Q.jsx)(fr,{text:n.commit.author.name,className:`font-medium text-foreground`}),t[1]=n.commit.author.name,t[2]=d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),t[3]=f):f=t[3];let p;t[4]===n.commit.author.timestamp?p=t[5]:(p=$a(n.commit.author.timestamp,Date.now()),t[4]=n.commit.author.timestamp,t[5]=p);let m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`span`,{children:p}),t[6]=p,t[7]=m);let h;t[8]!==n.commit.parentOids||t[9]!==n.comparison.baseOid||t[10]!==n.comparison.kind||t[11]!==n.comparison.parentNumber?(h=n.comparison.kind===`parent`?(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`· `}),`parent`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption leading-5 text-foreground`,children:By(n.comparison.baseOid)}),n.commit.parentOids.length>1&&` (${BX(n.comparison.parentNumber)} parent of a merge)`]}):(0,Q.jsx)(`span`,{children:`root commit`}),t[8]=n.commit.parentOids,t[9]=n.comparison.baseOid,t[10]=n.comparison.kind,t[11]=n.comparison.parentNumber,t[12]=h):h=t[12];let g;t[13]!==d||t[14]!==m||t[15]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-ui leading-5 text-muted-foreground`,children:[u,d,f,m,h]}),t[13]=d,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;if(t[17]!==s||t[18]!==n.commit.refs){let e;t[20]===s?e=t[21]:(e=e=>e.kind!==`local-branch`||e.name!==s,t[20]=s,t[21]=e),_=Hy(n.commit.refs).filter(e).map(V0),t[17]=s,t[18]=n.commit.refs,t[19]=_}else _=t[19];let v;t[22]===_?v=t[23]:(v=(0,Q.jsx)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-caption text-muted-foreground`,children:_}),t[22]=_,t[23]=v);let y;t[24]===n.commit.body?y=t[25]:(y=n.commit.body!==null&&n.commit.body!==void 0&&(0,Q.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap text-ui leading-relaxed wrap-anywhere text-muted-foreground`,children:n.commit.body}),t[24]=n.commit.body,t[25]=y);let b;t[26]!==n.commit.bodyTruncated||t[27]!==n.commit.subjectTruncated?(b=(n.commit.subjectTruncated||n.commit.bodyTruncated)&&(0,Q.jsx)(`p`,{className:`mt-1 text-caption text-muted-foreground`,children:`Commit message truncated`}),t[26]=n.commit.bodyTruncated,t[27]=n.commit.subjectTruncated,t[28]=b):b=t[28];let x;t[29]===n.files.length?x=t[30]:(x=Vt(n.files.length,`file`),t[29]=n.files.length,t[30]=x);let S;t[31]===x?S=t[32]:(S=(0,Q.jsxs)(`span`,{children:[x,` changed`]}),t[31]=x,t[32]=S);let C;t[33]===l?C=t[34]:(C=l&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`mx-2 font-normal text-muted-foreground`,children:`·`}),(0,Q.jsx)(G0,{count:l})]}),t[33]=l,t[34]=C);let w;t[35]!==n.files.length||t[36]!==a||t[37]!==l?(w=!l&&n.files.length>0&&(0,Q.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:a?`Line counts unavailable`:`Line counts incomplete`}),t[35]=n.files.length,t[36]=a,t[37]=l,t[38]=w):w=t[38];let T;t[39]!==S||t[40]!==C||t[41]!==w?(T=(0,Q.jsxs)(`p`,{className:`border-b pb-1.5 text-xs font-medium tabular-nums`,children:[S,C,w]}),t[39]=S,t[40]=C,t[41]=w,t[42]=T):T=t[42];let E;t[43]!==n.files||t[44]!==c||t[45]!==i?(E=n.files.length>1&&(0,Q.jsx)(`ul`,{className:`max-h-64 divide-y overflow-y-auto border-b`,"aria-label":`Changed files`,children:n.files.map(e=>(0,Q.jsxs)(`li`,{className:`flex h-8 min-w-0 items-center gap-2.5 rounded-sm pr-1.5 pl-1 text-caption leading-4`,children:[(0,Q.jsx)(`span`,{"aria-label":e.status,className:`w-4 shrink-0 text-center font-mono text-xs font-semibold text-brand`,children:e.status.slice(0,1).toUpperCase()}),(0,Q.jsx)(fr,{text:Ly(e).join(` → `),className:`flex-1 font-mono font-medium`}),(0,Q.jsx)(G0,{count:c.get(Ry(e))}),i(e)?.kind===`binary`&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Binary`})]},P0(e)))}),t[43]=n.files,t[44]=c,t[45]=i,t[46]=E):E=t[46];let D;t[47]!==T||t[48]!==E?(D=(0,Q.jsxs)(`section`,{"aria-label":`Files changed`,className:`mt-7`,children:[T,E]}),t[47]=T,t[48]=E,t[49]=D):D=t[49];let O;t[50]!==a||t[51]!==r||t[52]!==o||t[53]!==i?(O=r.length>0&&(0,Q.jsx)(H0,{changes:r,patchOf:i,failed:a,onRetry:o}),t[50]=a,t[51]=r,t[52]=o,t[53]=i,t[54]=O):O=t[54];let k;return t[55]!==y||t[56]!==b||t[57]!==D||t[58]!==O||t[59]!==g||t[60]!==v?(k=(0,Q.jsxs)(`section`,{className:`mx-auto mt-1 mb-6 w-full max-w-commit min-w-0 px-7`,children:[g,v,y,b,D,O]}),t[55]=y,t[56]=b,t[57]=D,t[58]=O,t[59]=g,t[60]=v,t[61]=k):k=t[61],k}function V0(e){return(0,Q.jsx)(fr,{text:e.name,className:`font-mono`},`${e.kind}:${e.name}`)}function H0(e){let t=(0,$.c)(15),{changes:n,patchOf:r,failed:i,onRetry:a}=e,o;t[0]!==i||t[1]!==a?(o=i&&(0,Q.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-xs text-muted-foreground`,children:[`Some patches could not be read.`,(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:a,children:`Try again`})]}),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;if(t[3]!==n||t[4]!==i||t[5]!==r){let e;t[7]!==i||t[8]!==r?(e=e=>{let t=Ry(e),n=r(e),a=z_(e),o=n===void 0&&!i?void 0:W_(e,n,i)??`No code change`;return(0,Q.jsxs)(`li`,{className:`rounded-lg border bg-muted/25 px-3 py-2 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(fr,{className:`font-mono font-medium`,text:t}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.status,o&&` · ${o}`]})]}),a&&n?.kind===`text`&&(0,Q.jsx)(`pre`,{className:`mt-1 overflow-x-auto whitespace-pre-wrap font-mono text-2xs text-muted-foreground`,children:n.patch.split(`
1354
+ `).filter(W0).map(U0).join(`
1355
+ `)})]},`${e.oldPath}->${e.newPath}:${e.status}`)},t[7]=i,t[8]=r,t[9]=e):e=t[9],s=n.map(e),t[3]=n,t[4]=i,t[5]=r,t[6]=s}else s=t[6];let c;t[10]===s?c=t[11]:(c=(0,Q.jsx)(`ul`,{className:`mt-3 space-y-1.5`,"aria-label":`Changes without code preview`,children:s}),t[10]=s,t[11]=c);let l;return t[12]!==o||t[13]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[o,c]}),t[12]=o,t[13]=c,t[14]=l):l=t[14],l}function U0(e){return e.slice(1)}function W0(e){return/^[+-]Subproject commit /.test(e)}function G0(e){let t=(0,$.c)(7),{count:n}=e;if(!n)return null;let r;t[0]===n.added?r=t[1]:(r=(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,n.added]}),t[0]=n.added,t[1]=r);let i;t[2]===n.removed?i=t[3]:(i=(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,n.removed]}),t[2]=n.removed,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,Q.jsxs)(`span`,{className:`shrink-0 space-x-1 font-mono text-xs font-medium tabular-nums`,children:[r,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function K0(e){let t=(0,$.c)(33),{scope:n,context:r,label:i,items:a,rows:o,controls:s,actions:c,actionsOpen:l,onActionsOpenChange:u}=e,[d,f]=(0,Z.useState)(),p;t[0]===a?p=t[1]:(p=a.filter(q0),t[0]=a,t[1]=p);let m=p.length,h;t[2]===a.length?h=t[3]:(h=Vt(a.length,`file`),t[2]=a.length,t[3]=h);let g=`${m} of ${h} reviewed`,_;t[4]===i?_=t[5]:(_=(0,Q.jsx)(`h2`,{className:`text-ui leading-4 font-medium text-foreground`,children:i}),t[4]=i,t[5]=_);let v=`File review actions: ${g}`,y;t[6]===v?y=t[7]:(y=(0,Q.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,className:`ml-auto`,"aria-label":v}),t[6]=v,t[7]=y);let b;t[8]!==g||t[9]!==y?(b=(0,Q.jsx)(yo,{render:y,children:g}),t[8]=g,t[9]=y,t[10]=b):b=t[10];let x;t[11]!==c||t[12]!==s.collapse?(x=(0,Q.jsxs)(Zo,{"aria-label":`File review actions`,align:`end`,children:[s.collapse,c]}),t[11]=c,t[12]=s.collapse,t[13]=x):x=t[13];let S;t[14]!==l||t[15]!==u||t[16]!==b||t[17]!==x?(S=(0,Q.jsxs)(uo,{open:l,onOpenChange:u,children:[b,x]}),t[14]=l,t[15]=u,t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==_||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex min-h-6 flex-wrap items-center gap-x-3.5 gap-y-1 border-b pb-1.5 text-xs text-muted-foreground tabular-nums`,children:[_,S]}),t[19]=_,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==r||t[23]!==s||t[24]!==a||t[25]!==d||t[26]!==o||t[27]!==n?(w=!(a.length===1&&s.counts.has(a[0]?.path??``))&&(0,Q.jsx)(`ol`,{children:a.slice(0,o??a.length).map(e=>{let t=e.path.lastIndexOf(`/`)+1,i=s.counts.get(e.path);return(0,Q.jsxs)(`li`,{className:`box-content flex h-8 items-center gap-3 border-t pl-1 first:border-t-0 last:border-b`,children:[(0,Q.jsx)(d0,{scope:n,context:r,path:e.path,fingerprint:e.fingerprint,status:e.reviewStatus,latest:d===e.path,onStart:()=>f(e.path)}),(0,Q.jsx)(fr,{text:e.path,renderTrigger:(n,r)=>(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`${e.path}${i?` +${i.additions} −${i.deletions}`:``}`,"aria-current":s.current===e.path?`true`:void 0,onClick:()=>s.open(e.path),className:`flex h-8 min-w-0 flex-1 items-center gap-3 rounded-sm px-1.5 text-left whitespace-nowrap text-foreground outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 font-mono text-caption leading-4`,children:[t>0&&r(e.path.slice(0,t),`shrink-[100] text-muted-foreground`,`start`),r(e.path.slice(t),`shrink-0 max-w-full`)]}),i&&(0,Q.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Q.jsx)(b1,{counts:i})})]})})]},e.path)})}),t[22]=r,t[23]=s,t[24]=a,t[25]=d,t[26]=o,t[27]=n,t[28]=w):w=t[28];let T;return t[29]!==i||t[30]!==w||t[31]!==C?(T=(0,Q.jsxs)(`section`,{"aria-label":i,className:`pb-3.25`,children:[C,w]}),t[29]=i,t[30]=w,t[31]=C,t[32]=T):T=t[32],T}function q0(e){return e.reviewStatus===`reviewed`}function J0(e){let t=(0,$.c)(41),{path:n,note:r,diff:i,children:a}=e,o,s,c,l,u,d,f,p,m,h;if(t[0]!==i?.hunks||t[1]!==n){let e=n.split(`/`);l=e.pop()??n;let r;t[12]===i?.hunks?r=t[13]:(r=i?.hunks.reduce(X0,0),t[12]=i?.hunks,t[13]=r),s=r;let a;t[14]===i?.hunks?a=t[15]:(a=i?.hunks.reduce(Y0,0),t[14]=i?.hunks,t[15]=a),c=a,m=``,h=`@container/file-heading flex min-h-11 shrink-0 items-center gap-2.5 px-4 text-ui leading-[1.4] whitespace-nowrap text-foreground`,o=fr,u=n,d=`min-w-0 font-mono text-caption leading-4 text-muted-foreground`,t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`h1`,{}),t[16]=f):f=t[16],p=e.length>0&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.join(` / `),` / `]}),t[0]=i?.hunks,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h}else o=t[2],s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11];let g;t[17]===l?g=t[18]:(g=(0,Q.jsx)(`span`,{className:`font-medium text-foreground`,children:l}),t[17]=l,t[18]=g);let _;t[19]!==o||t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p||t[24]!==g?(_=(0,Q.jsxs)(o,{text:u,className:d,render:f,children:[p,g]}),t[19]=o,t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=g,t[25]=_):_=t[25];let v;t[26]===r?v=t[27]:(v=r&&(0,Q.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground @md/file-heading:inline`,children:r}),t[26]=r,t[27]=v);let y;t[28]!==s||t[29]!==c||t[30]!==i?(y=i&&(0,Q.jsxs)(`span`,{"aria-label":`${s} additions, ${c} deletions`,className:`font-mono text-xs font-medium tabular-nums`,children:[(0,Q.jsxs)(`span`,{className:`text-add-fg`,children:[`+`,s]}),` `,(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[`−`,c]})]}),t[28]=s,t[29]=c,t[30]=i,t[31]=y):y=t[31];let b;t[32]!==a||t[33]!==y?(b=(0,Q.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[y,a]}),t[32]=a,t[33]=y,t[34]=b):b=t[34];let x;return t[35]!==b||t[36]!==m||t[37]!==h||t[38]!==_||t[39]!==v?(x=(0,Q.jsxs)(`header`,{"data-file-heading":m,className:h,children:[_,v,b]}),t[35]=b,t[36]=m,t[37]=h,t[38]=_,t[39]=v,t[40]=x):x=t[40],x}function Y0(e,t){return e+t.deletionLines}function X0(e,t){return e+t.additionLines}function Z0(e,t,n){if(t===``)return[];let r=t.toLocaleLowerCase(),i=[],a=e.split(`
1356
+ `);for(let[e,t]of a.entries()){let a=t.toLocaleLowerCase(),o=a.indexOf(r);for(;o!==-1;){if(i.length===n)return i;i.push({line:e+1,column:o}),o=a.indexOf(r,o+r.length)}}return i}function Q0(e,t){return Math.max(0,Math.min(e,t-1))}function $0(e,t,n){return t===0?0:(Q0(e,t)+n+t)%t}function e2(e,t,n){if(t===0)return`No results`;let r=t===n?`+`:``;return`${Q0(e,t)+1} of ${t}${r}`}function t2(e){let t=(0,$.c)(65),{text:n,focusRequest:r,onReveal:i,onClose:a}=e,[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(0),u;t[0]!==o||t[1]!==n?(u=Z0(n,o,Pt),t[0]=o,t[1]=n,t[2]=u):u=t[2];let d=u,[f,p]=(0,Z.useState)(),m;t[3]===i?m=t[4]:(m=(e,t,n)=>{l(e);let r=t[e];r&&i({...r,length:n})},t[3]=i,t[4]=m);let h=m,g;t[5]!==c||t[6]!==d||t[7]!==o.length||t[8]!==h?(g=e=>h($0(c,d.length,e),d,o.length),t[5]=c,t[6]=d,t[7]=o.length,t[8]=h,t[9]=g):g=t[9];let _=g,v;t[10]===a?v=t[11]:(v=e=>{e.key===`Escape`&&(e.preventDefault(),a())},t[10]=a,t[11]=v);let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(yH,{children:(0,Q.jsx)(y_,{})}),t[12]=y):y=t[12];let b;t[13]!==r||t[14]!==f?(b=e=>{e&&f!==r&&(e.focus(),e.select(),p(r))},t[13]=r,t[14]=f,t[15]=b):b=t[15];let x;t[16]!==h||t[17]!==n?(x=e=>{let t=e.target.value;s(t),h(0,Z0(n,t,Pt),t.length)},t[16]=h,t[17]=n,t[18]=x):x=t[18];let S;t[19]===_?S=t[20]:(S=e=>{e.key===`Enter`&&(e.preventDefault(),_(e.shiftKey?-1:1))},t[19]=_,t[20]=S);let C;t[21]!==o||t[22]!==b||t[23]!==x||t[24]!==S?(C=(0,Q.jsx)(CH,{ref:b,"aria-label":`Find in file`,placeholder:`Find in file`,value:o,onChange:x,onKeyDown:S}),t[21]=o,t[22]=b,t[23]=x,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==c||t[27]!==d.length||t[28]!==o?(w=o!==``&&(0,Q.jsx)(SH,{role:`status`,children:e2(c,d.length,1e4)}),t[26]=c,t[27]=d.length,t[28]=o,t[29]=w):w=t[29];let T=d.length===0,E;t[30]===_?E=t[31]:(E=()=>_(-1),t[30]=_,t[31]=E);let D;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(xh,{}),t[32]=D):D=t[32];let O;t[33]!==T||t[34]!==E?(O=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Previous match`,disabled:T,onClick:E,children:D})}),t[33]=T,t[34]=E,t[35]=O):O=t[35];let k;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Previous match`}),t[36]=k):k=t[36];let A;t[37]===O?A=t[38]:(A=(0,Q.jsxs)(ot,{children:[O,k]}),t[37]=O,t[38]=A);let j=d.length===0,M;t[39]===_?M=t[40]:(M=()=>_(1),t[39]=_,t[40]=M);let N;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(sc,{}),t[41]=N):N=t[41];let P;t[42]!==j||t[43]!==M?(P=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Next match`,disabled:j,onClick:M,children:N})}),t[42]=j,t[43]=M,t[44]=P):P=t[44];let F;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Next match`}),t[45]=F):F=t[45];let I;t[46]===P?I=t[47]:(I=(0,Q.jsxs)(ot,{children:[P,F]}),t[46]=P,t[47]=I);let L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Oi,{}),t[48]=L):L=t[48];let R;t[49]===a?R=t[50]:(R=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(xH,{size:`icon-xs`,"aria-label":`Close find`,onClick:a,children:L})}),t[49]=a,t[50]=R);let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Yo,{role:`tooltip`,className:`break-all`,children:`Close find`}),t[51]=z):z=t[51];let B;t[52]===R?B=t[53]:(B=(0,Q.jsxs)(ot,{children:[R,z]}),t[52]=R,t[53]=B);let V;t[54]!==w||t[55]!==A||t[56]!==I||t[57]!==B?(V=(0,Q.jsxs)(yH,{align:`inline-end`,children:[w,A,I,B]}),t[54]=w,t[55]=A,t[56]=I,t[57]=B,t[58]=V):V=t[58];let H;t[59]!==V||t[60]!==C?(H=(0,Q.jsxs)(_H,{className:`w-full max-w-sm`,children:[y,C,V]}),t[59]=V,t[60]=C,t[61]=H):H=t[61];let U;return t[62]!==H||t[63]!==v?(U=(0,Q.jsx)(`div`,{role:`search`,className:`flex shrink-0 justify-end border-b px-3 py-1.5`,onKeyDown:v,children:H}),t[62]=H,t[63]=v,t[64]=U):U=t[64],U}function n2(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=qy(e.path)?(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:[(0,Q.jsx)(h2,{...e}),(0,Q.jsx)(u2,{path:e.path,copy:!1,children:(0,Q.jsxs)(dX,{className:`max-w-full flex-wrap justify-end`,children:[(0,Q.jsx)(d2,{path:e.path,onOpen:e.onOpen}),(0,Q.jsx)(f2,{path:e.path})]})}),(0,Q.jsx)(Xk,{scope:e.scope,path:e.path,connection:e.context.connection})]}):(0,Q.jsx)(r2,{...e}),t[0]=e,t[1]=n),n}function r2(e){let t=(0,$.c)(17),n;t[0]===e.path?n=t[1]:(n=e.path.split(`/`).slice(0,-1).join(`/`),t[0]=e.path,t[1]=n);let r=n,{connection:i}=e.context,a=RR(i,e.scope,r);if(a===void 0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(a2,{}),t[2]=e):e=t[2],e}let o;t[3]===e.path?o=t[4]:(o=e.path.split(`/`).at(-1),t[3]=e.path,t[4]=o);let s=o,c;if(t[5]!==a.entries||t[6]!==s){let e;t[8]===s?e=t[9]:(e=e=>e.name===s,t[8]=s,t[9]=e),c=a.entries.find(e),t[5]=a.entries,t[6]=s,t[7]=c}else c=t[7];let l=c;if(l?.kind===`symlink`){let n=`Not followed: symlink to ${l.target??`an unknown target`}`,r;return t[10]!==e||t[11]!==n?(r=(0,Q.jsx)(i2,{...e,message:n}),t[10]=e,t[11]=n,t[12]=r):r=t[12],r}if(l?.kind===`submodule`){let n;return t[13]===e?n=t[14]:(n=(0,Q.jsx)(i2,{...e,message:`Not followed: submodule`}),t[13]=e,t[14]=n),n}let u;return t[15]===e?u=t[16]:(u=(0,Q.jsx)(o2,{...e}),t[15]=e,t[16]=u),u}function i2(e){let t=(0,$.c)(13),n,r;t[0]===e?(n=t[1],r=t[2]):({message:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===r?i=t[4]:(i=(0,Q.jsx)(h2,{...r}),t[3]=r,t[4]=i);let a;t[5]===r.path?a=t[6]:(a=(0,Q.jsx)(u2,{path:r.path}),t[5]=r.path,t[6]=a);let o;t[7]===n?o=t[8]:(o=(0,Q.jsx)(`div`,{className:`grid min-h-48 flex-1 place-items-center p-6`,children:(0,Q.jsx)(vn,{message:n})}),t[7]=n,t[8]=o);let s;return t[9]!==i||t[10]!==a||t[11]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[i,a,o]}),t[9]=i,t[10]=a,t[11]=o,t[12]=s):s=t[12],s}function a2(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{"aria-busy":`true`,className:`grid min-h-24 flex-1 place-items-center`,children:(0,Q.jsx)(Be,{label:`Loading file`})}),e[0]=t):t=e[0],t}function o2(e){let t=(0,$.c)(3),n=Rd(e.context,e.scope,e.path),r;return t[0]!==e||t[1]!==n?(r=n?(0,Q.jsx)(s2,{...e,read:n}):(0,Q.jsx)(a2,{}),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function s2(e){let t=(0,$.c)(19),n,r;t[0]===e?(n=t[1],r=t[2]):({read:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let{file:i,draft:a,reset:o,edit:s}=r,c=Ol(a),l=`kind`in i;if(l&&c.owner===null&&c.text===c.savedText){let e;return t[3]!==i.reason||t[4]!==n?(e=(0,Q.jsx)(i2,{...n,message:i.reason}),t[3]=i.reason,t[4]=n,t[5]=e):e=t[5],e}let u;t[6]===l?u=t[7]:(u=l&&(0,Q.jsx)(`p`,{role:`alert`,className:`border-b bg-graph-4/10 px-3.5 py-2 text-xs text-graph-4`,children:`The file is no longer readable. Your unsaved draft is still available below.`}),t[6]=l,t[7]=u);let d=l?c.savedText:i.text,f=l?c.fingerprint:i.contentFingerprint,p;t[8]!==a||t[9]!==s||t[10]!==n||t[11]!==o||t[12]!==c||t[13]!==d||t[14]!==f?(p=(0,Q.jsx)(c2,{...n,text:d,contentFingerprint:f,draft:a,draftState:c,reset:o,edit:s}),t[8]=a,t[9]=s,t[10]=n,t[11]=o,t[12]=c,t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;return t[16]!==u||t[17]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,p]}),t[16]=u,t[17]=p,t[18]=m):m=t[18],m}function c2(e){let t=(0,$.c)(120),{scope:n,context:r,interaction:i,path:a,text:o,contentFingerprint:s,draft:c,draftState:l,reset:u,edit:d,onOpen:f}=e,{preferences:p}=Bu(),m=na(r),{connection:h}=r,g=de(qr(iB(n,h))),_;t[0]===a?_=t[1]:(_=p2(a),t[0]=a,t[1]=_);let v=_,y=g?.changes.find(e=>e.path===a),b=y?.comparisons??[],x=b.find(l2)??b[0],S=x?G_(x):void 0,C=aB(n,h,g?.statusToken??``,g?.read??0,y?[{path:a,fingerprint:y.fingerprint}]:[],S?[S]:[]),w=S?C.diffs.get(za(S)):void 0,T=x&&x.scope!==`untracked`&&x.scope!==`unmerged`&&w?cB(x,w)?.fileDiff:void 0,E=x&&`kind`in x?`${x.scope} · ${x.kind}`:x?.scope,D=y!==void 0,O=v===`markdown`&&o.length>262144,[k,A]=(0,Z.useState)(!1),j;t[2]!==v||t[3]!==O||t[4]!==p?(j=()=>O?`source`:m2(v,p),t[2]=v,t[3]=O,t[4]=p,t[5]=j):j=t[5];let[M,N]=(0,Z.useState)(j),{active:P}=i,[F,I]=(0,Z.useState)(!1),[L,R]=(0,Z.useState)(),[z,B]=(0,Z.useState)(),{element:V,attach:H}=hH(),{element:U,attach:W}=hH(),G=!F&&v===`markdown`&&M===`rendered`&&(!O||k),K;t[6]!==G||t[7]!==o?(K=G?dR(o):void 0,t[6]=G,t[7]=o,t[8]=K):K=t[8];let q=K,J=wl(),ee;t[9]!==f||t[10]!==a||t[11]!==J||t[12]!==U||t[13]!==n?(ee=(e,t)=>{if(e!==a){J.openAt(`${n.worktreeId}:${e}`,t),f({kind:`file`,path:e});return}let r=U?.querySelector(`[data-markdown-root]`);t&&r&&nR(r,t)},t[9]=f,t[10]=a,t[11]=J,t[12]=U,t[13]=n,t[14]=ee):ee=t[14];let te=ee,ne=(0,Z.useId)();sJ(c,ne,s);let re=v===`code`||M===`source`,ie=BR(),ae;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>R(Date.now()),t[15]=ae):ae=t[15];let oe=ie&&P&&re&&!F,se;t[16]===oe?se=t[17]:(se={enabled:oe,ignoreInputs:!1,conflictBehavior:`allow`},t[16]=oe,t[17]=se),Hu(ou.findInFile,ae,se);let ce=l.diskChanged.has(ne)?`Changed on disk just now`:``,le;t[18]===ce?le=t[19]:(le=(0,Q.jsx)(`span`,{"aria-live":`polite`,className:`hidden text-xs text-muted-foreground xl:inline`,children:ce}),t[18]=ce,t[19]=le);let ue;t[20]!==q||t[21]!==U?(ue=q&&(0,Q.jsx)(mR,{outline:q.outline,root:U}),t[20]=q,t[21]=U,t[22]=ue):ue=t[22];let fe;t[23]!==v||t[24]!==M?(fe=v!==`code`&&(0,Q.jsx)(Nu,{value:M,onValueChange:e=>{(e===`rendered`||e===`source`)&&N(e)},children:(0,Q.jsxs)(kd,{children:[(0,Q.jsx)(hd,{value:`rendered`,children:v===`markdown`?`Reader`:`Preview`}),(0,Q.jsx)(hd,{value:`source`,children:`Source`})]})}),t[23]=v,t[24]=M,t[25]=fe):fe=t[25];let pe;t[26]!==ue||t[27]!==fe||t[28]!==le?(pe=(0,Q.jsxs)(Q.Fragment,{children:[le,ue,fe]}),t[26]=ue,t[27]=fe,t[28]=le,t[29]=pe):pe=t[29];let me=pe,he;t[30]!==s||t[31]!==l.owner||t[32]!==l.savedText||t[33]!==l.text||t[34]!==d||t[35]!==ne||t[36]!==m?(he=s&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,disabled:!!m||l.owner!==null&&l.owner!==ne,"aria-description":m,"aria-label":l.text===l.savedText?`Edit`:`Resume edit`,onClick:()=>{d(ne)&&I(!0)}}),children:(0,Q.jsx)(ao,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:m??(l.owner!==null&&l.owner!==ne?`Editing in another pane`:`Edit`)})]}),t[30]=s,t[31]=l.owner,t[32]=l.savedText,t[33]=l.text,t[34]=d,t[35]=ne,t[36]=m,t[37]=he):he=t[37];let ge;t[38]!==D||t[39]!==f||t[40]!==a?(ge=D&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open diff`,onClick:()=>f({kind:`change`,path:a})}),children:(0,Q.jsx)(Zh,{})}),(0,Q.jsx)(Yo,{role:`tooltip`,children:`Open diff`})]}),t[38]=D,t[39]=f,t[40]=a,t[41]=ge):ge=t[41];let _e;t[42]!==i.toolbarTarget||t[43]!==f||t[44]!==a?(_e=i.toolbarTarget===void 0&&(0,Q.jsx)(d2,{path:a,onOpen:f}),t[42]=i.toolbarTarget,t[43]=f,t[44]=a,t[45]=_e):_e=t[45];let ve;t[46]===a?ve=t[47]:(ve=(0,Q.jsx)(f2,{path:a}),t[46]=a,t[47]=ve);let ye;t[48]!==he||t[49]!==ge||t[50]!==_e||t[51]!==ve?(ye=(0,Q.jsxs)(Q.Fragment,{children:[he,ge,_e,ve]}),t[48]=he,t[49]=ge,t[50]=_e,t[51]=ve,t[52]=ye):ye=t[52];let be=ye;if(F){let e;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>I(!1),t[53]=e):e=t[53];let n;t[54]!==s||t[55]!==u||t[56]!==o?(n=()=>{u(o,s??``),I(!1)},t[54]=s,t[55]=u,t[56]=o,t[57]=n):n=t[57];let r;t[58]===a?r=t[59]:(r=e=>(0,Q.jsx)(u2,{path:a,children:e}),t[58]=a,t[59]=r);let i;return t[60]!==P||t[61]!==D||t[62]!==c||t[63]!==l||t[64]!==ne||t[65]!==a||t[66]!==n||t[67]!==r||t[68]!==m?(i=(0,Q.jsx)(SR,{owner:ne,path:a,draft:c,state:l,active:P,writeBlock:m,changed:D,onDone:e,onDiscard:n,renderToolbar:r}),t[60]=P,t[61]=D,t[62]=c,t[63]=l,t[64]=ne,t[65]=a,t[66]=n,t[67]=r,t[68]=m,t[69]=i):i=t[69],i}let xe=null;bb0:switch(v){case`markdown`:if(O&&!k){let e;t[70]===o.length?e=t[71]:(e=Math.round(o.length/1024),t[70]=o.length,t[71]=e);let n=`This Markdown file is ${e} KB. Rendering it can take a few seconds.`,r;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>A(!0),children:`Render it`}),t[72]=r):r=t[72];let i;t[73]===n?i=t[74]:(i=(0,Q.jsx)(`div`,{className:`grid min-h-48 flex-1 place-items-center p-6`,children:(0,Q.jsx)(vn,{message:n,action:r})}),t[73]=n,t[74]=i),xe=i}else if(q){let e;t[75]!==r.connection||t[76]!==te||t[77]!==a||t[78]!==n?(e={path:a,scope:n,connection:r.connection,openPath:te},t[75]=r.connection,t[76]=te,t[77]=a,t[78]=n,t[79]=e):e=t[79];let i;t[80]!==W||t[81]!==q.document||t[82]!==q.outline||t[83]!==a||t[84]!==e?(i=(0,Q.jsx)(_R,{document:q.document,outline:q.outline,attach:W,file:e},a),t[80]=W,t[81]=q.document,t[82]=q.outline,t[83]=a,t[84]=e,t[85]=i):i=t[85],xe=i}break bb0;case`html`:{let e;t[86]===te?e=t[87]:(e=e=>te(e,``),t[86]=te,t[87]=e);let i;t[88]!==r.connection||t[89]!==a||t[90]!==n||t[91]!==e||t[92]!==o?(i=(0,Q.jsx)(NR,{scope:n,path:a,html:o,connection:r.connection,onOpenPath:e},a),t[88]=r.connection,t[89]=a,t[90]=n,t[91]=e,t[92]=o,t[93]=i):i=t[93],xe=i;break bb0}case`code`:break bb0;default:return v}let Se;t[94]!==i.toolbarTarget||t[95]!==f||t[96]!==a||t[97]!==re?(Se=i.toolbarTarget&&!re&&(0,th.createPortal)((0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(d2,{path:a,onOpen:f})}),i.toolbarTarget),t[94]=i.toolbarTarget,t[95]=f,t[96]=a,t[97]=re,t[98]=Se):Se=t[98];let Ce;t[99]!==H||t[100]!==V||t[101]!==be||t[102]!==r||t[103]!==T||t[104]!==L||t[105]!==z||t[106]!==i||t[107]!==v||t[108]!==me||t[109]!==M||t[110]!==E||t[111]!==f||t[112]!==a||t[113]!==xe||t[114]!==n||t[115]!==o?(Ce=M===`rendered`&&v!==`code`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(u2,{path:a,copy:!1,children:[me,(0,Q.jsx)(dX,{className:`max-w-full flex-wrap justify-end`,children:be})]}),xe]}):(0,Q.jsxs)(`div`,{ref:H,className:`flex min-h-0 flex-1 flex-col`,children:[L!==void 0&&(0,Q.jsx)(t2,{text:o,focusRequest:L,onReveal:e=>B({...e,nonce:Date.now()}),onClose:()=>{R(void 0),V?.querySelector(`[aria-label="Code content"] [tabindex="-1"]`)?.focus({preventScroll:!0})}}),(0,Q.jsxs)(J0,{path:a,note:E,diff:T,children:[me,be]}),(0,Q.jsx)(N1,{comments:!0,disableFileHeader:!0,compactThreads:!0,fileDiff:T,scope:n,context:r,interaction:i,headerActions:i.toolbarTarget===void 0?void 0:(0,Q.jsx)(d2,{path:a,onOpen:f}),...z===void 0?{}:{foundMatch:z},entries:[{...m1(`file:${a}`,a,o)}]})]}),t[99]=H,t[100]=V,t[101]=be,t[102]=r,t[103]=T,t[104]=L,t[105]=z,t[106]=i,t[107]=v,t[108]=me,t[109]=M,t[110]=E,t[111]=f,t[112]=a,t[113]=xe,t[114]=n,t[115]=o,t[116]=Ce):Ce=t[116];let we;return t[117]!==Se||t[118]!==Ce?(we=(0,Q.jsxs)(`div`,{className:`@container/document flex min-h-0 flex-1 flex-col bg-card`,children:[Se,Ce]}),t[117]=Se,t[118]=Ce,t[119]=we):we=t[119],we}function l2(e){return e.scope===`unstaged`}function u2(e){let t=(0,$.c)(7),{path:n,children:r,copy:i}=e,a=i===void 0||i,o;t[0]!==a||t[1]!==n?(o=a&&(0,Q.jsx)(f2,{path:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n||t[5]!==o?(s=(0,Q.jsxs)(J0,{path:n,children:[r,o]}),t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6],s}function d2(e){let t=(0,$.c)(3),{path:n,onOpen:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Q.jsx)(l1,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>r({kind:`timeline`,path:n})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function f2(e){let t=(0,$.c)(8),{path:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`Copy path`,onClick:()=>Zt(n,`path`)}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Bs,{}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,Q.jsx)(Ze,{render:r,children:i}),t[3]=r,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(Yo,{role:`tooltip`,children:`Copy path`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,Q.jsxs)(ot,{children:[a,o]}),t[6]=a,t[7]=s),s}function p2(e){let t=e.toLowerCase();return t.endsWith(`.md`)||t.endsWith(`.mdx`)?`markdown`:t.endsWith(`.html`)||t.endsWith(`.htm`)?`html`:`code`}function m2(e,t){return e===`markdown`||e===`html`?t.documentsDefault:`source`}function h2(e){let t=(0,$.c)(6),{interaction:n,path:r,onOpen:i}=e;if(!n.toolbarTarget)return null;let a;t[0]!==i||t[1]!==r?(a=(0,Q.jsx)(d2,{path:r,onOpen:i}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n.toolbarTarget||t[4]!==a?(o=(0,th.createPortal)(a,n.toolbarTarget),t[3]=n.toolbarTarget,t[4]=a,t[5]=o):o=t[5],o}function g2(e,t){let[n,r]=(0,Z.useState)(e);return!t&&n!==e&&r(e),t?n:e}function _2(e){return[...new Set(e)].join(`, `)}var v2=e=>e.shown&&!e.current;function y2(e){return e.unsupported?{shown:!1,current:!1}:{shown:e.shown,current:e.current}}function b2(e){return!e.some(v2)}function x2(e,t){return{discard:!v2(t),review:b2(e)}}function S2(e){let t=(0,$.c)(51),{scope:n,context:r,interaction:i,paths:a,files:o,focus:s,header:c,headerActions:l,headerLeading:u,toolbar:d,footer:f,column:p,fullHeight:m,windowLimit:h}=e,g=o===void 0?[]:o,_=p!==void 0&&p,v=m!==void 0&&m,{connection:y}=r;d1(n,r);let b=i.quiet===!0,x=ry(f1(n,r,g2(rB(n,y),i.hidden===!0),a),g),S=aB(n,y,x[0]?.statusToken??``,x[0]?.read??0,x.flatMap(M2),x.flatMap(A2)),C=bR(y,n,i.hidden===!0?[]:x.flatMap(O2)),[w,T]=(0,Z.useState)(h),E=h!==void 0&&w!==void 0&&h>w;!E||S.pending||S.failed||C.pending||C.failed||T(h);let D=b||E,[O,k]=(0,Z.useState)(C.contents);i.hidden===!0||C.pending||C.failed||P2(O,C.contents)||k(C.contents);let A;t[0]!==D||t[1]!==O||t[2]!==C.contents||t[3]!==C.failed?(A=e=>C.contents.get(e)??(D||C.failed?O.get(e):void 0),t[0]=D,t[1]=O,t[2]=C.contents,t[3]=C.failed,t[4]=A):A=t[4];let j=A,[M,N]=(0,Z.useState)(S.diffs);!S.pending&&!S.failed&&M!==S.diffs&&N(S.diffs);let P;t[5]===S.diffs?P=t[6]:(P=e=>{let t=G_(e);return t?S.diffs.get(za(t)):void 0},t[5]=S.diffs,t[6]=P);let F=P,I;t[7]!==S.recovering||t[8]!==F?(I=e=>S.recovering?void 0:F(e),t[7]=S.recovering,t[8]=F,t[9]=I):I=t[9];let L=I,R;t[10]!==S.failed||t[11]!==D||t[12]!==M||t[13]!==F?(R=e=>{let t=G_(e);if(t)return F(e)??(D||S.failed?M.get(za(t)):void 0)},t[10]=S.failed,t[11]=D,t[12]=M,t[13]=F,t[14]=R):R=t[14];let z=R,B=!b&&(S.pending||C.pending),V=!S.pending&&!C.pending&&(S.failed&&(E||M.size===0)||C.failed&&(E||O.size===0)),H;t[15]!==L||t[16]!==z||t[17]!==j||t[18]!==C.contents?(H=e=>e.scope===`untracked`?{shown:j(e.path)!==void 0,current:C.contents.has(e.path)}:y2({unsupported:e.scope!==`unmerged`&&!e.supported,shown:z(e)!==void 0,current:L(e)!==void 0}),t[15]=L,t[16]=z,t[17]=j,t[18]=C.contents,t[19]=H):H=t[19];let U=H,W=new Map(g.map(D2)),G;t[20]!==z||t[21]!==U||t[22]!==j||t[23]!==C.pending?(G=e=>{let t=e.comparisons.flatMap(e=>{if(e.scope===`unmerged`)return[`Conflict`];if(e.scope===`untracked`)return j(e.path)!==void 0||C.pending?[]:[`Not readable`];if(!e.supported)return[`Unsupported comparison`];let t=z(e);return t?t.kind===`binary`?[`Binary change`]:t.kind===`omitted`?[`Content omitted: ${H_(t.reason)}`]:cB(e,t)?[]:[`No single-file textual patch`]:[]}),n=b2(e.comparisons.map(U));return t.length>0?[{item:e,reasons:t,current:n}]:[]},t[20]=z,t[21]=U,t[22]=j,t[23]=C.pending,t[24]=G):G=t[24];let K=x.flatMap(G),q=x.flatMap(e=>e.comparisons.flatMap(t=>{let i=x2(e.comparisons.map(U),U(t)),a=l0(n,r,e,i.review);if(t.scope===`untracked`){let n=j(t.path);return n===void 0?[]:[{...m1(Xv(t),e.path,n,W.get(e.path)??`untracked`),current:i.discard,review:a}]}if(t.scope===`unmerged`||!t.supported)return[];let o=I2(z(t),s?.[e.path]),c=o?cB(t,o):null,l=W.get(e.path);return c?[{...c,...l?{note:l}:{},current:i.discard,review:a,discardScope:t.scope}]:[]})),J=new Map(q.map(E2)),ee=new Set(K.map(T2)),te=x.flatMap(e=>e.comparisons.flatMap(t=>{let n=Xv(t),r=J.get(n);return r===void 0?(t.scope===`untracked`?C.pending&&j(t.path)===void 0:t.scope!==`unmerged`&&t.supported&&S.pending&&z(t)===void 0)?[{id:n,path:t.scope===`untracked`?e.path:zt(t),state:`pending`}]:ee.has(e.path)?[{id:n,path:e.path,state:`omitted`}]:[]:[{id:n,path:r,state:`code`}]})),ne=new Set(q.map(w2)),re=i.toolbarTarget!==void 0&&/^(file|change|branch):/.test(i.entry)&&q.length===0&&x.length===1?K[0]?.item:void 0,ie=c||B||V||K.length>0?e=>(0,Q.jsxs)(Q.Fragment,{children:[c?.(e),V&&(0,Q.jsx)(L2,{column:_,retry:()=>{S.retry(),C.retry()}}),K.length>0&&(0,Q.jsx)(R2,{changes:K,column:_,onTarget:(t,n)=>{n&&e.awaiting===t&&(e.landed(t),n.focus({preventScroll:!0}),n.scrollIntoView({block:`start`}))},renderedPaths:ne,scope:n,context:r,paneFile:!!re})]}):void 0;if(b&&q.length===0&&(S.pending||C.pending))return(0,Q.jsx)(i0,{count:x.length});let ae=N1,oe=re?(0,Q.jsx)(z2,{scope:n,context:r,item:re,current:K[0]?.current??!0,active:i.active,children:l}):void 0,se=x.map(C2),ce;t[25]===f?ce=t[26]:(ce=f?{footer:f}:{},t[25]=f,t[26]=ce);let le;t[27]===ie?le=t[28]:(le=ie?{header:ie}:{},t[27]=ie,t[28]=le);let ue;t[29]===l?ue=t[30]:(ue=l?{headerActions:l}:{},t[29]=l,t[30]=ue);let de;t[31]===u?de=t[32]:(de=u?{headerLeading:u}:{},t[31]=u,t[32]=de);let fe;t[33]===d?fe=t[34]:(fe=d?{toolbar:d}:{},t[33]=d,t[34]=fe);let pe;return t[35]!==ae||t[36]!==_||t[37]!==r||t[38]!==q||t[39]!==v||t[40]!==i||t[41]!==te||t[42]!==n||t[43]!==oe||t[44]!==se||t[45]!==ce||t[46]!==le||t[47]!==ue||t[48]!==de||t[49]!==fe?(pe=(0,Q.jsx)(ae,{comments:!0,fullHeight:v,emptyActions:oe,scope:n,context:r,interaction:i,entries:q,listed:te,paths:se,column:_,...ce,...le,...ue,...de,...fe}),t[35]=ae,t[36]=_,t[37]=r,t[38]=q,t[39]=v,t[40]=i,t[41]=te,t[42]=n,t[43]=oe,t[44]=se,t[45]=ce,t[46]=le,t[47]=ue,t[48]=de,t[49]=fe,t[50]=pe):pe=t[50],pe}function C2(e){return e.path}function w2(e){return e.path}function T2(e){let{item:t}=e;return t.path}function E2(e){return[e.id,e.path]}function D2(e){return[e.path,e.note]}function O2(e){return e.comparisons.flatMap(k2)}function k2(e){return e.scope===`untracked`?[e.path]:[]}function A2(e){return e.comparisons.flatMap(j2)}function j2(e){let t=G_(e);return t?[t]:[]}function M2(e){return e.comparisons.some(N2)?[{path:e.path,fingerprint:e.fingerprint}]:[]}function N2(e){return e.scope===`staged`||e.scope===`unstaged`}function P2(e,t){return e.size===t.size&&[...t].every(([t,n])=>e.get(t)===n)}var F2=new WeakMap;function I2(e,t){if(!e||!t?.length||e.kind!==`text`)return e;let n=t.map(e=>`${e.startLine}-${e.endLine}`).join(`,`),r=F2.get(e),i=r?.get(n);if(i)return i;let a=Yv(e.patch,t),o=a?{...e,patch:a}:e;return r??=new Map,r.set(n,o),F2.set(e,r),o}function L2(e){let t=(0,$.c)(8),{column:n,retry:r}=e,i=!n&&`mx-4`,a;t[0]===i?a=t[1]:(a=Y(`mt-3 flex items-center gap-3 rounded-lg border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,i),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`span`,{children:`The changes in this document could not be read.`}),t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,Q.jsx)(X,{size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,Q.jsxs)(`section`,{role:`alert`,className:a,children:[o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}function R2(e){let t=(0,$.c)(21),{changes:n,column:r,onTarget:i,renderedPaths:a,scope:o,context:s,paneFile:c}=e,l=!r&&`mx-4`,u;t[0]===l?u=t[1]:(u=Y(`mt-3 rounded-lg border bg-muted/40 px-4 py-3`,l),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:`Non-text content`}),t[2]=d):d=t[2];let f;if(t[3]!==n||t[4]!==s||t[5]!==i||t[6]!==c||t[7]!==a||t[8]!==o){let e;t[10]!==s||t[11]!==i||t[12]!==c||t[13]!==a||t[14]!==o?(e=e=>{let{item:t,reasons:n,current:r}=e;return(0,Q.jsxs)(`li`,{"aria-label":`${t.path}: ${_2(n)}`,tabIndex:-1,ref:e=>i(t.path,e),className:`flex min-w-0 scroll-mt-3 flex-wrap items-center gap-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsx)(fr,{className:`min-w-0 basis-full`,text:t.path}),qy(t.path)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`Current worktree image`}),(0,Q.jsx)(Xk,{scope:o,path:t.path,connection:s.connection})]}),(0,Q.jsx)(Ao,{variant:`outline`,className:`h-auto max-w-full text-left whitespace-normal`,children:_2(n)}),!c&&!a.has(t.path)&&(0,Q.jsx)(u0,{scope:o,context:s,path:t.path,fingerprint:t.fingerprint,status:t.reviewStatus,current:r,compact:!!t.fingerprint})]},t.path)},t[10]=s,t[11]=i,t[12]=c,t[13]=a,t[14]=o,t[15]=e):e=t[15],f=n.map(e),t[3]=n,t[4]=s,t[5]=i,t[6]=c,t[7]=a,t[8]=o,t[9]=f}else f=t[9];let p;t[16]===f?p=t[17]:(p=(0,Q.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2 text-xs text-muted-foreground`,children:f}),t[16]=f,t[17]=p);let m;return t[18]!==u||t[19]!==p?(m=(0,Q.jsxs)(`section`,{className:u,children:[d,p]}),t[18]=u,t[19]=p,t[20]=m):m=t[20],m}function z2(e){let t=(0,$.c)(19),{scope:n,context:r,item:i,current:a,active:o,children:s}=e,c=O1(n,r,B2),l;t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n?(l=l0(n,r,i,a),t[0]=r,t[1]=a,t[2]=i,t[3]=n,t[4]=l):l=t[4];let u=l,d=BR(),f;t[5]!==c||t[6]!==u?(f=()=>c.toggle(u),t[5]=c,t[6]=u,t[7]=f):f=t[7];let p=f,m=d&&o&&a,h;t[8]===m?h=t[9]:(h={enabled:m,ignoreInputs:!0},t[8]=m,t[9]=h),Hu(ou.toggleReviewed,p,h);let g=u.reviewed?Dn:k_,_=!!c.writeBlock||!a||!u.fingerprint,v;t[10]!==c.writeBlock||t[11]!==g||t[12]!==_||t[13]!==u.reviewed||t[14]!==p?(v=(0,Q.jsx)(l1,{label:`Reviewed`,variant:`outline`,icon:g,shortcut:ou.toggleReviewed,description:c.writeBlock,disabled:_,pressed:u.reviewed,onClick:p}),t[10]=c.writeBlock,t[11]=g,t[12]=_,t[13]=u.reviewed,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==s||t[17]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[v,s]}),t[16]=s,t[17]=v,t[18]=y):y=t[18],y}function B2(e){return ks(e)}function V2(e,t){return t?e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`:`error`}var H2=Ny({position:`absolute`,width:`1px`,height:`1px`,opacity:0,"pointer-events":`none`});function U2(e){return{"data-loading-status":e.loadingStatus}}function W2(e){return!!(e.getAttribute(`src`)||e.getAttribute(`srcset`))}var G2=he(sa({name:`avatar`,options:{onLoadingStatusChange:`callback`,fallbackDelay:`number`},state:e=>({loadingStatus:`idle`,delayElapsed:!1}),controlled:[],api:e=>{let{store:t,props:n,element:r,options:i}=e,a=Oc(e,e=>A(e)),o=(e,t,n)=>a(`loadingStatus`,e,{reason:t,event:n}),s=()=>{t.get().loadingStatus!==`loaded`&&o(`loading`,`src-change`)};return{internal:{watchImage(e){let t=()=>{let t=V2(e,W2(e));t===`loading`?s():o(t,t===`loaded`?`image-load`:`image-error`)};t();let n=new MutationObserver(t);n.observe(e,{attributeFilter:[`src`,`srcset`,`sizes`,`crossorigin`]});let i=[Ef(e,`load`,e=>o(`loaded`,`image-load`,e)),Ef(e,`error`,e=>o(`error`,`image-error`,e)),()=>n.disconnect()];return()=>{i.forEach(e=>e()),queueMicrotask(()=>{r(`image`)||o(`idle`,`src-change`)})}},watchImageRemoval(e){let n=new MutationObserver(()=>{t.get().loadingStatus!==`idle`&&!r(`image`)&&o(`idle`,`src-change`)});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()},startDelay(){let e,r=!0;return queueMicrotask(()=>{if(!r)return;let a=n(`fallback`)?.delay??i().fallbackDelay??0;a>0&&(e=setTimeout(()=>t.set({delayElapsed:!0}),a))}),()=>{r=!1,clearTimeout(e)}}}}},slots:e=>({root:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:U2,bind:(e,{api:t})=>{let n=[t.internal.startDelay(),t.internal.watchImageRemoval(e)];return()=>n.forEach(e=>e())}}),image:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:e=>({...U2(e),"aria-hidden":e.loadingStatus===`loaded`?void 0:`true`,style:e.loadingStatus===`loaded`?void 0:H2}),bind:(e,{api:t})=>t.internal.watchImage(e)}),fallback:e({props:{delay:`number`},present:(e,{props:t})=>e.loadingStatus!==`loaded`&&(!(t.delay&&t.delay>0)||e.delayElapsed),state:e=>({loadingStatus:e.loadingStatus}),attrs:U2})})}),{root:`span`,image:`img`,fallback:`span`}),K2=G2.Root,q2=G2.Image,J2=G2.Fallback;function Y2({className:e,size:t=`default`,...n}){return(0,Q.jsx)(K2,{"data-slot":`avatar`,"data-size":t,className:Y(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function X2({className:e,...t}){return(0,Q.jsx)(q2,{"data-slot":`avatar-image`,className:Y(`aspect-square size-full rounded-full object-cover`,e),...t})}function Z2({className:e,...t}){return(0,Q.jsx)(J2,{"data-slot":`avatar-fallback`,className:Y(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var Q2={open:Dg,draft:kg,merged:Cg,closed:Tg};function $2(e){let t=(0,$.c)(10),{pull:n}=e,r;t[0]===n?r=t[1]:(r=Nl(n),t[0]=n,t[1]=r);let i=r,a=Q2[i],o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(a,{"aria-hidden":`true`}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=rl(n),t[4]=n,t[5]=s);let c;return t[6]!==i||t[7]!==o||t[8]!==s?(c=(0,Q.jsxs)(Ao,{variant:i,children:[o,s]}),t[6]=i,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var e4={passed:{Icon:gc,label:`Passed`,color:`text-add-fg`},failed:{Icon:Nh,label:`Failed`,color:`text-del-fg`},running:{Icon:ra,label:`Running`,color:`text-muted-foreground`},none:{Icon:jh,label:`Unknown`,color:`text-muted-foreground`}};function t4(e){let t=(0,$.c)(6),{tone:n,label:r}=e,{Icon:i,label:a,color:o}=e4[n],s=r??a,c;t[0]===o?c=t[1]:(c=Y(`size-3.5 shrink-0`,o),t[0]=o,t[1]=c);let l;return t[2]!==i||t[3]!==s||t[4]!==c?(l=(0,Q.jsx)(i,{role:`img`,"aria-label":s,className:c}),t[2]=i,t[3]=s,t[4]=c,t[5]=l):l=t[5],l}function n4(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground`,children:`·`}),e[0]=t):t=e[0],t}var r4=XR();function i4(e){return Gl(Ra(e))}function a4(e,t,n){let r=(0,$.c)(10),i;r[0]!==e||r[1]!==n||r[2]!==t?(i=nr({connection:e,projectId:t,number:n}),r[0]=e,r[1]=n,r[2]=t,r[3]=i):i=r[3];let a;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(a={mode:`promiseExit`},r[4]=a):a=r[4];let[o,s]=B(i,a),c;r[5]===s?c=r[6]:(c=async(e,t,n)=>{let r=await s({payload:{headSha:e.headSha,target:t},reruns:n.map(t=>({key:t,jobId:e.checks.find(e=>e.key===t)?.jobId}))});ne(r)||ks({title:`Re-run refused`,description:i4(r.cause),type:`error`})},r[5]=s,r[6]=c);let l;return r[7]!==o.waiting||r[8]!==c?(l={pending:o.waiting,rerun:c},r[7]=o.waiting,r[8]=c,r[9]=l):l=r[9],l}function o4(e,t,n,r){let i=(0,$.c)(12),a;i[0]!==e||i[1]!==n||i[2]!==t?(a=Dc({connection:e,projectId:t,number:n}),i[0]=e,i[1]=n,i[2]=t,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=B(a,o),l;i[5]!==n||i[6]!==r||i[7]!==c?(l=async(e,t)=>{let i=await c({repository:e,comment:t});ne(i)&&(r(),ks({title:`Commented on #${n}`,type:`success`}))},i[5]=n,i[6]=r,i[7]=c,i[8]=l):l=i[8];let u;return i[9]!==s||i[10]!==l?(u={result:s,submit:l},i[9]=s,i[10]=l,i[11]=u):u=i[11],u}async function s4(e){try{await navigator.clipboard.writeText(e),ks({title:`Copied the log lines`,type:`success`})}catch{ks({title:`Could not copy the log lines`,type:`error`})}}function c4(e){let t=e.side===`old`?`Old`:`New`;return e.start===e.end?`${t} line ${e.start}`:`${t} lines ${e.start}–${e.end}`}function l4(e,t){return{title:e.title,layout:e.layout,edges:e.edges,nodes:e.nodes.map(({anchor:e,...n})=>({...n,anchor:e===void 0?void 0:e.lines===void 0?{kind:`file`,path:e.path}:{kind:`lines`,excerpt:{path:e.path,...e.lines,caption:n.note??``,position:t,node:n.id,lines:c4(e.lines),span:{startLine:e.lines.start,endLine:e.lines.end}}}}))}}function u4({title:e,explanation:t,blocks:n,paths:r}){let i=[],a=[],o=0;return n.forEach((e,t)=>{switch(e.kind){case`diff_excerpt`:i.push({kind:`excerpt`,excerpt:{path:e.path,side:e.side,start:e.start,end:e.end,caption:e.caption,position:t+1,lines:c4(e),span:{startLine:e.start,endLine:e.end}}});return;case`before_after`:i.push({kind:`images`,screenshots:[{...e.before,label:`Before`,enlarge:`Enlarge before screenshot`},{...e.after,label:`After`,enlarge:`Enlarge after screenshot`}],first:o}),o+=2;return;case`files`:e.files.length>0&&i.push({kind:`files`,files:e.files});return;case`checks`:if(e.results.length===0&&!e.checksTruncated)return;i.push({kind:`checks`,checks:{headOid:e.headOid,state:e.state,checksTruncated:e.checksTruncated,results:e.results}});return;case`diagram`:i.push({kind:`diagram`,diagram:l4(e,t+1)});return;case`callout`:a.push({attention:e.attention,comparison:e.comparison});return}}),{title:e,explanation:t,...r?{paths:r}:{},blocks:i,callouts:a}}function d4(e){if(e.paths!==void 0)return e.paths;let t=e.blocks.flatMap(e=>e.kind===`diagram`?e.diagram.nodes.flatMap(({anchor:e})=>e?[e.kind===`file`?e.path:e.excerpt.path]:[]):e.kind===`excerpt`?[e.excerpt.path]:e.kind===`files`?e.files.map(e=>e.path):[]);return[...new Set(t)]}function f4(e){let t=e.stops.filter((t,n)=>!(n===e.stops.length-1&&t.title===`Everything else`&&t.explanation===`These changed files complete the change.`&&t.blocks.every(e=>e.kind===`files`&&e.files.every(e=>e.note===`Supporting change`))));return{...e,stops:t.map(u4)}}function p4(e){let t=e.walkthrough;if(t===void 0)return{kind:`unwritten`};switch(t.state.status){case`queued`:case`running`:return{kind:`writing`,run:t};case`failed`:return{kind:`failed`,run:t,failure:t.state.failure};case`ready`:return{kind:`ready`,run:t,content:f4(t.state.content),freshness:e.freshness,attempt:e.attempt}}}function m4(e){return e.walkthrough===void 0?`changes`:`walkthrough`}function h4(e){return e.stops.flatMap((e,t)=>e.callouts.map((n,r)=>({...n,stop:e,step:t+1,callIndex:r})))}var g4=(e,t,n)=>e.some(e=>e.step===t&&e.call===n);function _4(e,t){let n=h4(e);return{total:n.length,decided:n.filter(e=>g4(t??[],e.step,e.callIndex)).length}}function v4(e,t){let n=_4(e,t);return n.total-n.decided}function y4(e,t,n=!1){if(h4(e).length!==0)return t?h4(e).find(e=>!g4(t,e.step,e.callIndex))?.step:n?`unreadable`:`reading`}function b4(e,t=[]){let n=d4(e),r=t.flatMap(e=>e.oldPath!==void 0&&n.includes(e.oldPath)?[e.path]:[]);return[...new Set([...n,...r])]}function x4(e){return new Set(e.stops.flatMap(e=>b4(e))).size}var S4={claude:`Claude`,codex:`Codex`},C4={claude:`claude auth login`,codex:`codex login`};function w4(e,t){let n=S4[t.provider];switch(e.kind){case`signed_out`:return{title:`Sign in to ${n} again with ${C4[t.provider]}, then try again.`,message:``,command:C4[t.provider]};case`agent_not_installed`:return{title:`${n} isn't installed here.`,message:e.message};case`timed_out`:return{title:`The walkthrough took too long.`,message:e.message};case`unusable_output`:return{title:`${n} wrote something unreadable.`,message:e.message};case`other`:return{title:`The walkthrough didn't finish.`,message:e.message}}}var T4=new Set([`signed_out`,`agent_not_installed`,`timed_out`,`unusable_output`,`other`]);function E4(e){return typeof e==`string`&&T4.has(e)}function D4(e){return typeof e==`object`&&e&&`kind`in e&&`message`in e&&E4(e.kind)&&typeof e.message==`string`?{kind:e.kind,message:e.message}:{kind:`other`,message:e instanceof Error&&e.message!==``?e.message:`Porcelain could not start the walkthrough.`}}function O4(e){let t=(e.branch===void 0?void 0:e.pullRequests?.find(t=>t.headBranch===e.branch&&t.state===`open`)?.number)??e.displayedRun?.pullRequestNumber;return{...e.base===void 0?{}:{base:e.base},...t===void 0?{}:{pullRequestNumber:t},...e.writer===void 0?{}:{writer:e.writer}}}function k4(e){let t=p4(e);return t.kind===`ready`?A4(t.content.title).replace(/\.$/,``):`Review`}function A4(e){return e.replaceAll("`",``)}function j4(e){return e.split(/(`[^`]+`)/).filter(e=>e!==``).map(e=>e.length>2&&e.startsWith("`")&&e.endsWith("`")?{kind:`code`,text:e.slice(1,-1)}:{kind:`text`,text:e})}function M4({branch:e,worktree:t,only:n}){let r=e=>[...new Set(e.filter(e=>n===void 0||n.includes(e.path)||e.oldPath!==void 0&&n.includes(e.oldPath)).map(e=>e.path))],i=t.flatMap(e=>[e,...(e.comparisons??[]).flatMap(t=>`oldPath`in t?[{path:e.path,oldPath:t.oldPath}]:[])]);return{branch:r(e),worktree:r(i)}}function N4(e){return new Set([...e.branch,...e.worktree]).size}function P4(e,t){let n=new Set(e[t]),r=t===`branch`?e.worktree:e.branch;return{here:e[t],elsewhere:r.filter(e=>!n.has(e))}}function F4(e,t,n){let r=0,i=e=>{let i=r<n;return r+=(t?e.branch.length:0)+e.worktree.length,i};return{steps:e.steps.map(i),outside:i(e.outside)}}function I4(e,t){return[...e.flatMap(({oldPath:e,path:t})=>e===void 0?[]:[[e,t]]),...t.flatMap(e=>(e.comparisons??[]).flatMap(t=>{let n=`oldPath`in t?t.oldPath:void 0;return n===void 0?[]:[[n,e.path]]}))]}function L4(e,t){let n=new Set(e),r=!0;for(;r;){r=!1;for(let[e,i]of t)n.has(e)!==n.has(i)&&(n.add(e),n.add(i),r=!0)}return[...n]}function R4({content:e,branch:t,worktree:n}){let r=I4(t,n),i=(e?.stops??[]).map(e=>M4({branch:t,worktree:n,only:L4(b4(e),r)})),a=M4({branch:t,worktree:n}),o=e=>new Set(i.flatMap(e)),s=o(e=>e.branch),c=o(e=>e.worktree);return{steps:i,outside:{branch:a.branch.filter(e=>!s.has(e)),worktree:a.worktree.filter(e=>!c.has(e))}}}function z4(e,t){return[...new Set([...t?e.branch:[],...e.worktree])]}var B4=dt(e=>Xn(e.connection).fn(_s(`Walkthroughs.start`)(function*(t){let n=yield*zn(e.connection,n=>n.walkthroughs.startWalkthrough({params:{worktreeId:e.scope.worktreeId},payload:t}));return yield*Bi([lt.reviewSurface(e.connection.environmentId,e.scope,[`walkthrough`])]),n})));function V4([e,t],n){let r=de(qr(n.pulls)),i=O4({...n,pullRequests:r?.kind===`available`?r.pullRequests:void 0}),a=de(qr(e));return{accepted:a?.branch===n.branch?a:void 0,waiting:lo(e),failure:Mi(e)?D4(Ra(e.cause)):void 0,start:()=>void t(i)}}var H4=dt(({connection:e,scope:t,runId:n})=>{let r=Xn(e),i={worktreeId:t.worktreeId,runId:n},a=Bi([lt.reviewSurface(e.environmentId,t,[`walkthrough-conversations`])]);return{addMessage:r.fn(_s(`Walkthroughs.addMessage`)(function*(t){let n=yield*zn(e,e=>e.walkthroughs.addWalkthroughMessage({params:i,payload:t}));return yield*a,n})),retryAnswer:r.fn(_s(`Walkthroughs.retryAnswer`)(function*(t){let n=yield*zn(e,e=>e.walkthroughs.retryWalkthroughAnswer({params:{...i,messageId:t}}));return yield*a,n})),decideCall:r.fn(_s(`Walkthroughs.decideCall`)(function*(t){let{step:n,call:r,...o}=t,s=yield*zn(e,e=>e.walkthroughs.decideWalkthroughCall({params:{...i,step:n,call:r},payload:o}));return yield*a,s}))}}),U4={product:`Product call`,contract:`Contract call`,tradeoff:`Tradeoff`,risk:`Risk to accept`,accessibility:`Accessibility call`};function W4(e){return U4[e.kind]}var G4=`Needs a new commit: this change does not do this yet.`;function K4(e){return e?.implemented===void 0?`Choosing records your call, and Merge stops waiting for it. Porcelain changes no code.`:`Choosing records your call. Merge stops waiting for it unless the call needs a new commit. Porcelain changes no code.`}function q4(e){let t=e?.implemented;return(e?.columns??[]).map(e=>({option:e,implemented:e===t,effect:t===void 0?void 0:e===t?`Keeps the code as it is.`:G4}))}function J4(e){return e.find(e=>e.label===`After`)?.shows??`Before and after screenshots`}function Y4(e,t){let n=e?.implemented;return t!==void 0&&n!==void 0&&t!==n}function X4(e,t){return h4(e).filter(e=>Y4(e.comparison,t?.find(t=>t.step===e.step&&t.call===e.callIndex)?.option)).map(e=>e.step)}function Z4(e,t){return t?Y4(e,t.option)?`needs-commit`:`decided`:`open`}function Q4(e,t){return h4(e).map(e=>{let n=t?.find(t=>t.step===e.step&&t.call===e.callIndex);return{...e,decided:n,state:Z4(e.comparison,n)}})}var $4={decided:`Decided`,"needs-commit":`Decided, needs a new commit`};function e3(e,t){return e===`open`?t:$4[e]}var t3=[`open`,`needs-commit`,`decided`];function n3(e,t,n){let r=h4(e).filter(e=>e.step===t).map(e=>Z4(e.comparison,n?.find(n=>n.step===t&&n.call===e.callIndex)));return t3.find(e=>r.includes(e))}var r3={added:`+`,changed:`~`,removed:`−`};function i3(e){return r3[e.change]}var a3=4,o3=7,s3=3;function c3(e,t){let n=e.growth;return{shown:t?n:n.slice(0,a3),hidden:t?0:Math.max(0,n.length-a3)}}function l3(e,t){let n=e.onlyInTranscript.length+e.stillUnclear.length,r=t?e.onlyInTranscript:e.onlyInTranscript.slice(0,s3),i=t?e.stillUnclear:e.stillUnclear.slice(0,Math.max(0,s3-r.length));return{explained:r,unclear:i,total:n,hidden:n-r.length-i.length}}var u3=e=>e===1?`1 file`:`${e} files`;function d3(e,t){if(t===null)return;if(t===void 0){let t=e?x4(e):0;return t===0?void 0:u3(t)}let n=new Set(t.committed),r=new Set(t.uncommitted.filter(e=>!n.has(e))).size,i=n.size+r;if(i!==0)return`${u3(i)}${r>0?`, ${r} uncommitted`:``}`}function f3(e,t,n,r){let i=d3(t,r);return[...e.pullRequestNumber===void 0?[]:[`#${e.pullRequestNumber}`],...i===void 0?[]:[i],`written for ${e.headOid.slice(0,o3)}${e.includesUncommitted?` and uncommitted work`:``}`,...n===void 0?[]:[`by ${n}`,`${e.writer.effort} effort`]].join(` · `)}function p3(e,t){return w4(e,t?.writer??{provider:`claude`,model:``,effort:`high`})}function m3(e,t){if(!(!t||e.kind!==`unwritten`&&e.kind!==`failed`))return{failure:t,run:e.kind===`failed`?e.run:void 0}}function h3(e,t){let n=e.attempt,r=n?.state.status,i=n?.state.status===`failed`?{failure:n.state.failure,writer:n.writer}:void 0;return{updating:t.waiting||r===`queued`||r===`running`,failure:t.failure?{failure:t.failure,writer:n?.writer??e.run.writer}:i}}function g3(e){switch(e.evidenceUnavailable){case`head_mismatch`:return`Screenshots and checks are not shown: the pull request is at another commit. Push, then update.`;case`github_account`:return`Screenshots and checks are not shown: choose a GitHub account for this project, then update.`;case`github_unavailable`:return`Screenshots and checks are not shown: GitHub could not be reached. Try updating later.`;case void 0:return}}function _3(e){let t=e.map(e=>e.split(`/`).at(-1)??e),n=t.slice(0,3),r=t.length-n.length;if(r>0)return`${n.join(`, `)} and ${r} more`;let i=n.pop();return n.length>0?`${n.join(`, `)} and ${i}`:i??``}function v3({uncommitted:e,uncovered:t,pullRequest:n,checkedCommit:r}){let i=n===void 0?``:`, so not in #${n}`,a=r===void 0?``:` The checks cover ${r.slice(0,o3)} only.`;return{uncommitted:e.length===0?void 0:`${_3(e)} ${e.length===1?`is`:`are`} uncommitted${i}.${a}`,uncovered:t.length===0?void 0:`No step covers ${_3(t)}.`}}var y3=_s(`Walkthroughs.readConversations`)(function*({connection:e,scope:t,runId:n}){return yield*zn(e,e=>e.walkthroughs.listWalkthroughConversations({params:{worktreeId:t.worktreeId,runId:n}}))}),b3=dt(e=>et(e.connection,e.scope,[`walkthrough-conversations`,e.runId],y3(e),Xn(e.connection)).pipe(sr)),x3=dt(e=>Oe(t=>{if(!e)return;let n=t(b3({connection:e.connection,scope:{projectId:e.scope.projectId,worktreeId:e.scope.worktreeId},runId:e.runId})),r=de(qr(n));return{headOid:e.headOid,undecidedCallStep:y4(e.content,r?.decisions,Mi(n)),undecidedCalls:v4(e.content,r?.decisions),callsNeedingCommit:X4(e.content,r?.decisions)}})),S3=dt(e=>Vn(e,e.excerpt===void 0?[`walkthrough`]:[`walkthrough-excerpt`,e.excerpt.runId,e.excerpt.step,e.excerpt.block??0,e.excerpt.node??``],t=>t.walkthroughs.readWalkthrough({params:{worktreeId:e.scope.worktreeId},headers:e.excerpt?{accept:ys}:{},query:e.excerpt===void 0?{}:{excerptRunId:e.excerpt.runId,excerptStep:e.excerpt.step,excerptBlock:e.excerpt.block,excerptNode:e.excerpt.node}}),t=>t.walkthrough===void 0||t.walkthrough.worktreeId===e.scope.worktreeId)),C3=dt(e=>Vn(e,[`walkthrough-asset`,e.runId,e.assetId],t=>t.walkthroughs.readWalkthroughAsset({params:{worktreeId:e.scope.worktreeId,runId:e.runId,assetId:e.assetId}})));function w3(e,t){let n=e.filter(e=>e.headBranch===t.branch);return n.find(e=>e.state===`open`)??e.find(e=>e.number===t.pullRequestNumber)??n[0]}function T3(e,t,n){return e?.find(e=>e.step===t&&e.call===n)}function E3(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}function D3(e){let{step:t,call:n}=e;return e.decided?{step:t,call:n,decided:!0,...e.option===void 0?{}:{option:e.option}}:{step:t,call:n,decided:!1}}function O3(e){return e.option===void 0?`Decided`:`Decided: ${e.option}`}var k3=dt(({connection:e,projectId:t,branch:n,pullRequestNumber:r})=>Oe(i=>{let a=de(qr(i(Nn({connection:e,projectId:t})))),o=w3(a?.kind===`available`?a.pullRequests:[],{branch:n,pullRequestNumber:r});if(!o)return;let s={connection:e,projectId:t,number:o.number},c=de(qr(i(qs(s)))),l=i(re(s)),u=de(qr(l)),d=u?.kind===`available`?u.status:void 0;return{number:o.number,detail:c?.kind===`available`?Uc(c.pullRequest,d):void 0,status:d,statusUnread:Mi(l)&&!l.waiting||u!==void 0&&u.kind!==`available`}})),A3=dt(e=>Oe({text:``,failure:void 0,sending:!1}).pipe(x));function j3({connection:e,scope:t},n,r){return A3(JSON.stringify([e.environmentId,t.projectId,t.worktreeId,n.branch===void 0?[`run`,n.id]:[`branch`,n.branch],r]))}var M3={isActive:()=>document.visibilityState!==`hidden`,subscribe:e=>(document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e))};function N3(e,t,n){let r=(0,$.c)(3),i={connection:e,projectId:t,number:n,activity:M3},a=Ot(dr(i)),o=l(Gn(i)),s;return r[0]!==a||r[1]!==o?(s={...a,refresh:o},r[0]=a,r[1]=o,r[2]=s):s=r[2],s}function P3(e){let t=(0,$.c)(9),n;t[0]===e?n=t[1]:(n=wn(e),t[0]=e,t[1]=n);let r=Ot(n),i;t[2]===r?i=t[3]:(i=de(qr(r)),t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Mi(r),t[4]=r,t[5]=a);let o;return t[6]!==i||t[7]!==a?(o={read:i,failed:a},t[6]=i,t[7]=a,t[8]=o):o=t[8],o}var F3=Oe(Ns()),I3=Oe(Ns());function L3(e,t){let n=(0,$.c)(8),r;n[0]!==t||n[1]!==e?(r=t?S3({connection:e,scope:t}):F3,n[0]=t,n[1]=e,n[2]=r):r=n[2];let i=de(qr(Ot(r))),a=i?p4(i):void 0,o=de(qr(vB(t,e,void 0).result)),s=de(qr(Ot(t&&o?.base?eB({connection:e,scope:t,range:py(o)}):I3))),c=a?.kind===`ready`?a:void 0,l=c?.run.headOid,u=c&&{runId:c.run.id,headOid:c.run.headOid,content:c.content},d=xe((c?.content.stops??[]).map(B3)),f=o&&s?sy(o.files,s).filter(z3).map(R3):[],p;return n[3]!==l||n[4]!==u||n[5]!==d||n[6]!==f?(p={walkthroughHead:l,walkthrough:u,citations:d,changedSinceReview:f},n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=p):p=n[7],p}function R3(e){return e.path}function z3(e){return e.reviewStatus===`stale`}function B3(e,t){return{number:t+1,names:e.blocks.flatMap(V3)}}function V3(e){return e.kind===`checks`?e.checks.results.map(H3):[]}function H3(e){return e.name}var U3={failed:{Icon:Nh,color:`text-del-fg`,label:`Failed`},running:{Icon:ra,color:`text-foreground animate-spin motion-reduce:animate-none`,label:`Running`},passed:{Icon:gc,color:`text-add-fg`,label:`Passed`},skipped:{Icon:jh,color:`text-muted-foreground`,label:`Skipped`},pending:{Icon:kh,color:`text-muted-foreground`,label:`Waiting`}};function W3(e){let t=(0,$.c)(7),{state:n,className:r}=e,{Icon:i,color:a,label:o}=U3[n],s;t[0]!==r||t[1]!==a?(s=Y(`size-3.5 shrink-0`,a,r),t[0]=r,t[1]=a,t[2]=s):s=t[2];let c;return t[3]!==i||t[4]!==o||t[5]!==s?(c=(0,Q.jsx)(i,{role:`img`,"aria-label":o,className:s}),t[3]=i,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function G3(e){return`[data-check-row="${CSS.escape(e)}"]`}function K3(e){let t=(0,$.c)(22),{status:n,connection:r,projectId:i,number:a,controller:o,pendingReruns:s,rerunning:c,onRerun:l,citations:u,onOpenStep:d}=e,f=es(n.checks),p;t[0]===n.checks?p=t[1]:(p=it(n.checks),t[0]=n.checks,t[1]=p);let m=p,h=W$(m.running>0||s.size>0),g;t[2]===l?g=t[3]:(g=(e,t)=>{t?r4.open({payload:{title:e.title,description:e.description,confirm:()=>l(e.target,e.keys)}}):l(e.target,e.keys)},t[2]=l,t[3]=g);let _=g,v=J3,y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`h2`,{id:`pull-checks-heading`,children:`Checks`}),t[4]=y):y=t[4];let b;t[5]===m.failed?b=t[6]:(b=m.failed>0&&(0,Q.jsxs)(`span`,{className:`text-del-fg`,children:[m.failed,` failed`]}),t[5]=m.failed,t[6]=b);let x;t[7]===m.running?x=t[8]:(x=m.running>0&&(0,Q.jsxs)(`span`,{className:`text-foreground`,children:[m.running,` running`]}),t[7]=m.running,t[8]=x);let S;t[9]===m.passed?S=t[10]:(S=(0,Q.jsxs)(`span`,{children:[m.passed,` passed`]}),t[9]=m.passed,t[10]=S);let C;t[11]!==b||t[12]!==x||t[13]!==S?(C=(0,Q.jsxs)(`div`,{className:Y3,children:[y,(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 font-normal tabular-nums`,children:[b,x,S]})]}),t[11]=b,t[12]=x,t[13]=S,t[14]=C):C=t[14];let w=n.checks.length===0?(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No checks reported by GitHub.`}):(0,Q.jsx)(`div`,{role:`presentation`,onKeyDown:v,className:`flex min-w-0 flex-col`,children:f.map(e=>(0,Q.jsx)(X3,{group:e,status:n,connection:r,projectId:i,number:a,now:h,controller:o,pendingReruns:s,rerunning:c,request:_,citations:u,onOpenStep:d},e.key))}),T;t[15]===n.checksTruncated?T=t[16]:(T=n.checksTruncated&&(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`GitHub lists the first 100 checks. Open GitHub to see the rest.`}),t[15]=n.checksTruncated,t[16]=T);let E;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(Ez,{controller:r4,children:q3}),t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==T||t[20]!==C?(D=(0,Q.jsxs)(`section`,{"aria-labelledby":`pull-checks-heading`,className:`mt-8 min-w-0`,children:[C,w,T,E]}),t[18]=w,t[19]=T,t[20]=C,t[21]=D):D=t[21],D}function q3(e){return e&&(0,Q.jsxs)(Oz,{children:[(0,Q.jsxs)(kz,{children:[(0,Q.jsx)(jz,{children:e.title}),(0,Q.jsx)(Mz,{children:e.description})]}),(0,Q.jsxs)(Az,{children:[(0,Q.jsx)(Nz,{children:`Cancel`}),(0,Q.jsx)(X,{onClick:()=>{e.confirm(),r4.close()},children:`Re-run`})]})]})}function J3(e){let t={j:1,ArrowDown:1,k:-1,ArrowUp:-1}[e.key],n=e.target;if(!(n instanceof HTMLElement)||t===void 0||e.metaKey||e.ctrlKey||e.altKey||!n.matches(`[data-check-row]`))return;let r=[...e.currentTarget.querySelectorAll(`[data-check-row]`)],i=r[r.indexOf(n)+t];i&&(e.preventDefault(),i.focus())}var Y3=`flex min-h-6 min-w-0 flex-wrap items-center gap-x-2 gap-y-1 border-b pb-1.5 text-xs leading-4 font-medium text-muted-foreground`;function X3(e){let t=(0,$.c)(51),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({group:r,status:c,controller:n,pendingReruns:i,rerunning:o,request:a,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=`passed:${r.key}`,u;if(t[8]!==n||t[9]!==r||t[10]!==l||t[11]!==i||t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c){let e=n.open.has(l),d;t[17]!==r||t[18]!==c?(d=Pi(c,r),t[17]=r,t[18]=c,t[19]=d):d=t[19];let f=d,p;t[20]===r?p=t[21]:(p=vs(r),t[20]=r,t[21]=p);let m=p,h;t[22]!==n||t[23]!==i||t[24]!==a||t[25]!==o||t[26]!==s||t[27]!==c?(h=e=>e.map(e=>(0,Q.jsx)(Q3,{check:e,status:c,open:n.open.has(e.key),onToggle:()=>n.toggle(e.key),requested:i.has(e.key),rerunning:o,request:a,...s},e.key)),t[22]=n,t[23]=i,t[24]=a,t[25]=o,t[26]=s,t[27]=c,t[28]=h):h=t[28];let g=h,_=r.name,v;t[29]===r.name?v=t[30]:(v=(0,Q.jsx)(fr,{text:r.name,className:`min-w-0 font-medium text-foreground`}),t[29]=r.name,t[30]=v);let y;t[31]===r.runNumber?y=t[32]:(y=r.runNumber!==void 0&&(0,Q.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,r.runNumber]}),t[31]=r.runNumber,t[32]=y);let b;t[33]!==m||t[34]!==f||t[35]!==a||t[36]!==o?(b=f&&m&&(0,Q.jsx)(Z3,{offer:f,label:`Re-run failed jobs`,className:`ml-auto`,pending:o,onClick:e=>a(m,e)}),t[33]=m,t[34]=f,t[35]=a,t[36]=o,t[37]=b):b=t[37];let x;t[38]!==v||t[39]!==y||t[40]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center gap-2 text-xs leading-4 text-muted-foreground`,children:[v,y,b]}),t[38]=v,t[39]=y,t[40]=b,t[41]=x):x=t[41];let S;t[42]!==r.failed||t[43]!==g?(S=g(r.failed),t[42]=r.failed,t[43]=g,t[44]=S):S=t[44];let C;t[45]!==r.running||t[46]!==g?(C=g(r.running),t[45]=r.running,t[46]=g,t[47]=C):C=t[47];let w;t[48]!==S||t[49]!==C?(w=(0,Q.jsxs)(`ul`,{className:`min-w-0`,children:[S,C]}),t[48]=S,t[49]=C,t[50]=w):w=t[50],u=(0,Q.jsxs)(`div`,{role:`group`,"aria-label":_,className:`min-w-0 border-b py-1`,children:[x,w,r.passed.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,"data-check-row":l,"aria-expanded":e,onClick:()=>n.toggle(l),className:`flex h-7 w-full min-w-0 items-center gap-2 rounded-sm text-left text-ui leading-4.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Q.jsx)(ci,{"aria-hidden":`true`,className:Y(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,e&&`rotate-90`)}),(0,Q.jsx)(W3,{state:`passed`}),(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[r.passed.length,` passed`]})]}),e&&(0,Q.jsx)(`ul`,{className:`min-w-0`,children:g(r.passed)})]})]}),t[8]=n,t[9]=r,t[10]=l,t[11]=i,t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=u}else u=t[16];return u}function Z3(e){let t=(0,$.c)(22),{offer:n,label:r,className:i,pending:a,onClick:o}=e,s=(0,Z.useId)();if(n.kind===`unavailable`){let e;t[0]!==i||t[1]!==s?(e=(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,disabled:!0,focusableWhenDisabled:!0,"aria-describedby":s,className:i}),t[0]=i,t[1]=s,t[2]=e):e=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Au,{"aria-hidden":`true`}),t[3]=a):a=t[3];let o;t[4]!==r||t[5]!==e?(o=(0,Q.jsxs)(Ze,{render:e,children:[a,r]}),t[4]=r,t[5]=e,t[6]=o):o=t[6];let c;t[7]!==n.reason||t[8]!==s?(c=(0,Q.jsx)(Yo,{id:s,children:n.reason}),t[7]=n.reason,t[8]=s,t[9]=c):c=t[9];let l;return t[10]!==o||t[11]!==c?(l=(0,Q.jsxs)(ot,{children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}let c;t[13]!==n.confirm||t[14]!==o?(c=()=>o(n.confirm),t[13]=n.confirm,t[14]=o,t[15]=c):c=t[15];let l;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Au,{"aria-hidden":`true`}),t[16]=l):l=t[16];let u;return t[17]!==i||t[18]!==r||t[19]!==a||t[20]!==c?(u=(0,Q.jsxs)(ji,{variant:`ghost`,size:`sm`,pending:a,className:i,onClick:c,children:[l,r]}),t[17]=i,t[18]=r,t[19]=a,t[20]=c,t[21]=u):u=t[21],u}function Q3(e){let t=(0,$.c)(89),{check:n,status:i,open:a,onToggle:o,requested:s,rerunning:c,request:l,connection:u,projectId:d,number:f,now:p,citations:m,onOpenStep:h}=e,g=(0,Z.useId)(),_;t[0]!==n||t[1]!==s?(_=s?`running`:sn(n),t[0]=n,t[1]=s,t[2]=_):_=t[2];let v=_,y;t[3]===n?y=t[4]:(y=Lr(n),t[3]=n,t[4]=y);let b=y,x;t[5]===n?x=t[6]:(x=mo(n),t[5]=n,t[6]=x);let S=x,C;t[7]!==n.name||t[8]!==m?(C=m.get(n.name),t[7]=n.name,t[8]=m,t[9]=C):C=t[9];let w=C,T;t[10]!==n.completedAt||t[11]!==n.startedAt||t[12]!==p?(T=qo(r(n.startedAt,n.completedAt,p)),t[10]=n.completedAt,t[11]=n.startedAt,t[12]=p,t[13]=T):T=t[13];let E=T,D=E;if(s)D=`Re-run requested`;else if(v===`running`&&b){let e;t[14]!==b.position||t[15]!==b.total?(e=(0,Q.jsxs)(`span`,{className:`text-foreground`,children:[`Step `,b.position,` of `,b.total]}),t[14]=b.position,t[15]=b.total,t[16]=e):e=t[16];let n;t[17]===b.step.name?n=t[18]:(n=(0,Q.jsxs)(`span`,{className:`hidden @min-2xl/pr:inline`,children:[` · `,b.step.name]}),t[17]=b.step.name,t[18]=n);let r=E&&` · ${E}`,i;t[19]!==e||t[20]!==n||t[21]!==r?(i=(0,Q.jsxs)(Q.Fragment,{children:[e,n,r]}),t[19]=e,t[20]=n,t[21]=r,t[22]=i):i=t[22],D=i}else if(v===`running`)D=`Queued`;else if(S){let e;t[23]!==S.name||t[24]!==S.number?(e=(0,Q.jsxs)(`span`,{className:`hidden text-del-fg @min-2xl/pr:inline`,children:[`Step `,S.number,` · `,S.name,` ·`,` `]}),t[23]=S.name,t[24]=S.number,t[25]=e):e=t[25];let n;t[26]===E?n=t[27]:(n=(0,Q.jsx)(`span`,{className:`hidden @min-2xl/pr:inline`,children:E}),t[26]=E,t[27]=n);let r;t[28]!==e||t[29]!==n?(r=(0,Q.jsxs)(Q.Fragment,{children:[e,n]}),t[28]=e,t[29]=n,t[30]=r):r=t[30],D=r}let O=n.key,k=a&&`rotate-90`,A;t[31]===k?A=t[32]:(A=Y(`size-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none`,k),t[31]=k,t[32]=A);let j;t[33]===A?j=t[34]:(j=(0,Q.jsx)(ci,{"aria-hidden":`true`,className:A}),t[33]=A,t[34]=j);let M;t[35]===v?M=t[36]:(M=(0,Q.jsx)(W3,{state:v}),t[35]=v,t[36]=M);let N;t[37]===n?N=t[38]:(N=vr(n),t[37]=n,t[38]=N);let F;t[39]===N?F=t[40]:(F=(0,Q.jsx)(fr,{text:N,className:`min-w-0`}),t[39]=N,t[40]=F);let I;t[41]===n.required?I=t[42]:(I=n.required&&(0,Q.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground @min-xl/pr:inline`,children:`Required`}),t[41]=n.required,t[42]=I);let L;t[43]!==F||t[44]!==I?(L=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[F,I]}),t[43]=F,t[44]=I,t[45]=L):L=t[45];let R;t[46]===D?R=t[47]:(R=(0,Q.jsx)(`span`,{className:`shrink-0 pl-2 text-xs leading-4 text-muted-foreground tabular-nums`,children:D}),t[46]=D,t[47]=R);let z;t[48]!==n.required||t[49]!==S?(z=S&&(0,Q.jsxs)(`span`,{className:`col-span-2 col-start-3 -mt-0.5 pb-1 text-xs leading-4 text-del-fg @min-2xl/pr:hidden`,children:[n.required&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground @min-xl/pr:hidden`,children:[`Required ·`,` `]}),`Step `,S.number,` · `,S.name]}),t[48]=n.required,t[49]=S,t[50]=z):z=t[50];let B;t[51]!==n.key||t[52]!==o||t[53]!==a||t[54]!==g||t[55]!==M||t[56]!==L||t[57]!==R||t[58]!==z||t[59]!==j?(B=(0,Q.jsxs)(`button`,{type:`button`,"data-check-row":O,"aria-expanded":a,"aria-controls":g,onClick:o,className:`grid min-h-7 min-w-0 flex-1 grid-cols-[auto_auto_minmax(0,1fr)_auto] items-center gap-x-2 rounded-sm text-left text-ui leading-4.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[j,M,L,R,z]}),t[51]=n.key,t[52]=o,t[53]=a,t[54]=g,t[55]=M,t[56]=L,t[57]=R,t[58]=z,t[59]=j,t[60]=B):B=t[60];let V;t[61]!==n.name||t[62]!==w||t[63]!==h?(V=w!==void 0&&h&&(0,Q.jsxs)(`button`,{type:`button`,className:`h-7 shrink-0 rounded-sm px-1.5 text-xs text-muted-foreground underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`${n.name} is cited in Walkthrough step ${w}`,onClick:()=>h(w),children:[`cited in Walkthrough step `,w]}),t[61]=n.name,t[62]=w,t[63]=h,t[64]=V):V=t[64];let H;t[65]!==n.detailsUrl||t[66]!==n.group||t[67]!==n.kind||t[68]!==n.name?(H=n.detailsUrl&&(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),"aria-label":`Open ${n.name} on ${n.kind===`actions`?`GitHub`:n.group}`}),children:(0,Q.jsx)(P,{"aria-hidden":`true`})}),(0,Q.jsxs)(Yo,{children:[`Open on `,n.kind===`actions`?`GitHub`:n.group]})]}),t[65]=n.detailsUrl,t[66]=n.group,t[67]=n.kind,t[68]=n.name,t[69]=H):H=t[69];let U;t[70]!==B||t[71]!==V||t[72]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-start gap-1`,children:[B,V,H]}),t[70]=B,t[71]=V,t[72]=H,t[73]=U):U=t[73];let W;t[74]!==n||t[75]!==u||t[76]!==p||t[77]!==f||t[78]!==a||t[79]!==g||t[80]!==d||t[81]!==l||t[82]!==s||t[83]!==c||t[84]!==i?(W=a&&(0,Q.jsx)(`div`,{id:g,className:`mb-2 min-w-0 pl-5.5`,children:n.kind===`actions`?(0,Q.jsx)($3,{check:n,status:i,connection:u,projectId:d,number:f,now:p,requested:s,rerunning:c,request:l},n.jobId):(0,Q.jsx)(u6,{check:n})}),t[74]=n,t[75]=u,t[76]=p,t[77]=f,t[78]=a,t[79]=g,t[80]=d,t[81]=l,t[82]=s,t[83]=c,t[84]=i,t[85]=W):W=t[85];let G;return t[86]!==U||t[87]!==W?(G=(0,Q.jsxs)(`li`,{className:`min-w-0`,children:[U,W]}),t[86]=U,t[87]=W,t[88]=G):G=t[88],G}function $3(e){let t=(0,$.c)(26),{check:n,status:r,connection:i,projectId:a,number:o,now:s,requested:c,rerunning:l,request:u}=e,d;t[0]===n?d=t[1]:(d=mo(n),t[0]=n,t[1]=d);let f=d,p;t[2]===f?p=t[3]:(p=()=>new Set(f?[f.number]:[]),t[2]=f,t[3]=p);let[m,h]=(0,Z.useState)(p),g;t[4]!==n||t[5]!==r?(g=va(r,n),t[4]=n,t[5]=r,t[6]=g):g=t[6];let _=g,v=n.jobId,y;t[7]===n?y=t[8]:(y=Zr(n),t[7]=n,t[8]=y);let b=y,x;t[9]!==n||t[10]!==i||t[11]!==v||t[12]!==s||t[13]!==o||t[14]!==m||t[15]!==a?(x=n.steps.length===0?(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:sn(n)===`running`?`Waiting for a runner.`:`GitHub reported no steps for this job.`}):(0,Q.jsx)(`ol`,{"aria-label":`Steps of ${n.name}`,className:`min-w-0`,children:n.steps.map(e=>(0,Q.jsx)(e6,{step:e,check:n,now:s,open:m.has(e.number),onToggle:()=>h(t=>gi(t,e.number)),log:v===void 0?void 0:(0,Q.jsx)(r6,{connection:i,projectId:a,number:o,check:n,jobId:v,step:e})},e.number))}),t[9]=n,t[10]=i,t[11]=v,t[12]=s,t[13]=o,t[14]=m,t[15]=a,t[16]=x):x=t[16];let S;t[17]!==_||t[18]!==u||t[19]!==c||t[20]!==b||t[21]!==l?(S=!c&&b&&(0,Q.jsx)(`div`,{className:`mt-1 flex min-w-0 items-center gap-2`,children:(0,Q.jsx)(Z3,{offer:_,label:`Re-run this job`,pending:l,onClick:e=>u(b,e)})}),t[17]=_,t[18]=u,t[19]=c,t[20]=b,t[21]=l,t[22]=S):S=t[22];let C;return t[23]!==x||t[24]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[23]=x,t[24]=S,t[25]=C):C=t[25],C}function e6(e){let t=(0,$.c)(34),{step:n,check:i,now:a,open:o,onToggle:s,log:c}=e,l;t[0]===n?l=t[1]:(l=us(n),t[0]=n,t[1]=l);let u=l,d;t[2]!==a||t[3]!==n.completedAt||t[4]!==n.startedAt?(d=qo(r(n.startedAt,n.completedAt,a)),t[2]=a,t[3]=n.completedAt,t[4]=n.startedAt,t[5]=d):d=t[5];let f=d,p=c!==void 0&&(u===`passed`||u===`failed`),m;t[6]===n.number?m=t[7]:(m=(0,Q.jsx)(`span`,{className:`w-5 shrink-0 text-right text-xs text-muted-foreground tabular-nums`,children:n.number}),t[6]=n.number,t[7]=m);let h;t[8]===u?h=t[9]:(h=(0,Q.jsx)(W3,{state:u,className:`size-3`}),t[8]=u,t[9]=h);let g=n.name,_=t6[u],v;t[10]===_?v=t[11]:(v=Y(`min-w-0`,_),t[10]=_,t[11]=v);let y;t[12]!==n.name||t[13]!==v?(y=(0,Q.jsx)(fr,{text:g,className:v}),t[12]=n.name,t[13]=v,t[14]=y):y=t[14];let b=u===`running`?`running ${f??``}`:f,x;t[15]===b?x=t[16]:(x=(0,Q.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums`,children:b}),t[15]=b,t[16]=x);let S;t[17]!==x||t[18]!==m||t[19]!==h||t[20]!==y?(S=(0,Q.jsxs)(Q.Fragment,{children:[m,h,y,x]}),t[17]=x,t[18]=m,t[19]=h,t[20]=y,t[21]=S):S=t[21];let C=S,w=u===`running`?`step`:void 0,T;t[22]!==i||t[23]!==C||t[24]!==p||t[25]!==s||t[26]!==o||t[27]!==n.name||t[28]!==n.number?(T=p?(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":o,"aria-label":`${o?`Hide`:`Show`} the log of step ${n.number}, ${n.name}, in ${i.name}`,onClick:s,className:`flex h-6 w-full min-w-0 items-center gap-2 rounded-sm text-left text-ui leading-4.5 outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring`,children:C}):(0,Q.jsx)(`div`,{className:`flex h-6 min-w-0 items-center gap-2 text-ui leading-4.5`,children:C}),t[22]=i,t[23]=C,t[24]=p,t[25]=s,t[26]=o,t[27]=n.name,t[28]=n.number,t[29]=T):T=t[29];let E=o&&p&&c,D;return t[30]!==w||t[31]!==T||t[32]!==E?(D=(0,Q.jsxs)(`li`,{className:`min-w-0`,"aria-current":w,children:[T,E]}),t[30]=w,t[31]=T,t[32]=E,t[33]=D):D=t[33],D}var t6={pending:`text-muted-foreground`,skipped:`text-muted-foreground`,failed:`font-medium text-del-fg`,running:`font-medium`,passed:``},n6={plain:``,error:`bg-del-bg text-del-fg`,warning:`text-foreground`,group:`font-semibold text-foreground`,command:`text-muted-foreground`};function r6(e){let t=(0,$.c)(44),{connection:n,projectId:r,number:i,check:a,jobId:o,step:s}=e,c;t[0]!==n||t[1]!==o||t[2]!==i||t[3]!==r||t[4]!==s.completedAt||t[5]!==s.startedAt?(c={connection:n,projectId:r,number:i,jobId:o,from:s.startedAt,to:s.completedAt},t[0]=n,t[1]=o,t[2]=i,t[3]=r,t[4]=s.completedAt,t[5]=s.startedAt,t[6]=c):c=t[6];let{read:l,failed:u}=P3(c);if(l===void 0&&u){let e;return t[7]===a?e=t[8]:(e=(0,Q.jsx)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:(0,Q.jsx)(s6,{check:a,reason:`The log could not be read.`})}),t[7]=a,t[8]=e),e}if(l===void 0){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=Y(`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,`flex h-8 items-center gap-2 px-2.5`),t[9]=e):e=t[9];let n;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:e,"aria-busy":`true`,children:[(0,Q.jsx)(ra,{"aria-hidden":`true`,className:`size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Reading the log`})]}),t[10]=n):n=t[10],n}if(l.kind===`unavailable`){let e;t[11]===l.reason?e=t[12]:(e=Or(l.reason),t[11]=l.reason,t[12]=e);let n;return t[13]!==a||t[14]!==e?(n=(0,Q.jsx)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:(0,Q.jsx)(s6,{check:a,reason:e})}),t[13]=a,t[14]=e,t[15]=n):n=t[15],n}let{excerpt:d}=l,f;t[16]===d.lines?f=t[17]:(f=d.lines.map(a6).join(`
1357
+ `),t[16]=d.lines,t[17]=f);let p=f,m;t[18]!==d||t[19]!==s.number?(m=Ye(d,s.number),t[18]=d,t[19]=s.number,t[20]=m):m=t[20];let h;t[21]===m?h=t[22]:(h=(0,Q.jsx)(fr,{className:`min-w-0`,text:m}),t[21]=m,t[22]=h);let g;t[23]===p?g=t[24]:(g=()=>void s4(p),t[23]=p,t[24]=g);let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Bs,{"aria-hidden":`true`}),t[25]=_):_=t[25];let v;t[26]===g?v=t[27]:(v=(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:g,children:[_,`Copy`]}),t[26]=g,t[27]=v);let y;t[28]===a.detailsUrl?y=t[29]:(y=a.detailsUrl&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,render:(0,Q.jsx)(`a`,{href:a.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Full log`,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[28]=a.detailsUrl,t[29]=y);let b;t[30]!==h||t[31]!==v||t[32]!==y?(b=(0,Q.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center gap-2 border-b px-2.5 text-xs text-muted-foreground`,children:[h,v,y]}),t[30]=h,t[31]=v,t[32]=y,t[33]=b):b=t[33];let x=`Log of step ${s.number}, ${s.name}`,S;t[34]===d.lines?S=t[35]:(S=d.lines.map(i6),t[34]=d.lines,t[35]=S);let C;t[36]===S?C=t[37]:(C=(0,Q.jsx)(`div`,{className:`w-max min-w-full`,children:S}),t[36]=S,t[37]=C);let w;t[38]!==x||t[39]!==C?(w=(0,Q.jsx)(`pre`,{ref:o6,tabIndex:0,"aria-label":x,className:`max-h-96 min-w-0 overflow-auto py-1.5 font-mono text-xs leading-4.5 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:C}),t[38]=x,t[39]=C,t[40]=w):w=t[40];let T;return t[41]!==w||t[42]!==b?(T=(0,Q.jsxs)(`div`,{className:`mt-1 mb-2 ml-7 min-w-0 overflow-hidden rounded-md border bg-muted/40`,children:[b,w]}),t[41]=w,t[42]=b,t[43]=T):T=t[43],T}function i6(e,t){return(0,Q.jsx)(`div`,{className:Y(`px-2.5 whitespace-pre`,n6[e.level]),children:e.text||` `},t)}function a6(e){return e.text}function o6(e){e&&(e.scrollTop=e.scrollHeight)}function s6(e){let t=(0,$.c)(10),{check:n,reason:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=n.annotations.length>0&&(0,Q.jsx)(c6,{check:n}),t[2]=n,t[3]=a);let o;t[4]===n.detailsUrl?o=t[5]:(o=n.detailsUrl&&(0,Q.jsxs)(X,{variant:`link`,size:`flush`,className:`mt-1`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Open the job on GitHub`,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[4]=n.detailsUrl,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`min-w-0 px-2.5 py-2 text-ui`,children:[i,a,o]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function c6(e){let t=(0,$.c)(5),{check:n}=e,r=`Annotations of ${n.name}`,i;t[0]===n.annotations?i=t[1]:(i=n.annotations.map(l6),t[0]=n.annotations,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Q.jsx)(`ul`,{"aria-label":r,className:`mt-1.5 min-w-0`,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function l6(e,t){return(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1 text-ui leading-4.5`,children:[e.level===`FAILURE`?(0,Q.jsx)(Nh,{"aria-label":`Error`,className:`mt-0.5 size-3.5 shrink-0 text-del-fg`}):(0,Q.jsx)(qi,{"aria-label":e.level===`WARNING`?`Warning`:`Notice`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[e.path&&(0,Q.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[e.path,e.line===void 0?``:`:${e.line}`]}),(0,Q.jsxs)(`p`,{className:`wrap-anywhere`,children:[e.title&&(0,Q.jsxs)(`span`,{className:`font-medium`,children:[e.title,` · `]}),e.message]})]})]},t)}function u6(e){let t=(0,$.c)(13),{check:n}=e,r;t[0]!==n.kind||t[1]!==n.summary?(r=n.summary?(0,Q.jsx)(`p`,{className:`py-1 text-ui leading-5 whitespace-pre-line text-foreground-2 wrap-anywhere`,children:n.summary}):(0,Q.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:n.kind===`status`?`A commit status reported by an external service.`:`No summary reported.`}),t[0]=n.kind,t[1]=n.summary,t[2]=r):r=t[2];let i;t[3]===n?i=t[4]:(i=n.annotations.length>0&&(0,Q.jsx)(c6,{check:n}),t[3]=n,t[4]=i);let a;t[5]!==n.detailsUrl||t[6]!==n.group||t[7]!==n.kind?(a=n.detailsUrl&&(0,Q.jsxs)(X,{variant:`link`,size:`flush`,render:(0,Q.jsx)(`a`,{href:n.detailsUrl,target:`_blank`,rel:`noreferrer`}),children:[`Open on `,n.kind===`status`?`its service`:n.group,(0,Q.jsx)(P,{"aria-hidden":`true`})]}),t[5]=n.detailsUrl,t[6]=n.group,t[7]=n.kind,t[8]=a):a=t[8];let o;return t[9]!==r||t[10]!==i||t[11]!==a?(o=(0,Q.jsxs)(`div`,{className:`min-w-0 pb-1`,children:[r,i,a]}),t[9]=r,t[10]=i,t[11]=a,t[12]=o):o=t[12],o}var d6={failed:`failed`,running:`running`,none:`pending`};function f6(e){let t=(0,$.c)(6),{children:n,action:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(W3,{state:`pending`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:n}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[i,a,r]}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function p6(e){let t=(0,$.c)(42),{drafts:n,pull:r,status:i,context:a,projectId:o,blockers:s,walkthrough:c,changedSinceReview:l,review:u,notes:d,onOpenFile:f,onFocusCheck:p}=e,m,h,g,_,v,y,b,x;if(t[0]!==s||t[1]!==d||t[2]!==p||t[3]!==r||t[4]!==u||t[5]!==i||t[6]!==c){m=Uc(r,i);let e=id(m.mergeable),n=c!==void 0&&c.headOid!==m.headSha;h=m.state===`open`;let a;t[15]!==r.baseBranch||t[16]!==r.mergeMethods||t[17]!==u||t[18]!==i?(a=nf({status:i,baseBranch:r.baseBranch,mergeMethods:r.mergeMethods,review:u}),t[15]=r.baseBranch,t[16]=r.mergeMethods,t[17]=u,t[18]=i,t[19]=a):a=t[19],g=a,_=`pull-decision-heading`,v=`mt-7 min-w-0`;let o;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`h2`,{id:`pull-decision-heading`,children:`Merge`}),t[20]=o):o=t[20];let l=(0,Q.jsxs)(`span`,{className:`ml-auto flex min-w-0 items-center gap-1.5 font-normal`,children:[h&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(n4,{})]}),(0,Q.jsx)(`span`,{className:`font-mono text-caption text-foreground`,children:By(m.headSha)})]});t[21]===l?y=t[22]:(y=(0,Q.jsxs)(`div`,{className:Y3,children:[o,l]}),t[21]=l,t[22]=y),b=!h&&(0,Q.jsxs)(`p`,{className:`flex h-7 min-w-0 items-center gap-2 pt-1 text-ui`,children:[(0,Q.jsx)(W3,{state:m.state===`merged`?`passed`:`skipped`}),m.state===`merged`?(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[`Merged into`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:m.baseBranch}),`.`]}):(0,Q.jsx)(`span`,{children:`Closed without merging.`})]}),x=h&&(0,Q.jsxs)(`ul`,{"aria-label":`What blocks the merge`,className:`min-w-0 pt-1`,children:[s.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(W3,{state:d6[e.tone]}),e.checkKey?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>p(e.checkKey??``),className:`min-w-0 rounded-sm py-1 text-left wrap-anywhere underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,children:e.text}):(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:e.text}),e.key===`review`&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,render:(0,Q.jsx)(`a`,{href:r.url,target:`_blank`,rel:`noreferrer`}),children:[`Reviewers on GitHub`,(0,Q.jsx)(P,{"aria-hidden":`true`,"data-icon":`inline-end`})]})]},e.key)),s.length===0&&i&&(0,Q.jsxs)(`li`,{className:`flex h-7 min-w-0 items-center gap-2 text-ui`,children:[(0,Q.jsx)(W3,{state:`passed`}),(0,Q.jsx)(`span`,{children:`Nothing on GitHub blocks the merge.`})]}),n&&(0,Q.jsxs)(`li`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(W3,{state:`pending`}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[`The Walkthrough covers`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:By(c.headOid)}),`; the pull request is at`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-caption`,children:By(m.headSha)}),`.`]}),(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:c.onOpen,children:`Open Walkthrough`})]}),d]}),t[0]=s,t[1]=d,t[2]=p,t[3]=r,t[4]=u,t[5]=i,t[6]=c,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x}else m=t[7],h=t[8],g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14];let S=h&&n,C;t[23]!==l||t[24]!==f?(C=l.length>0&&(0,Q.jsxs)(`div`,{className:`min-w-0 pt-1`,children:[(0,Q.jsxs)(`p`,{className:`flex h-7 min-w-0 items-center gap-2 text-ui leading-4.5`,children:[(0,Q.jsx)(W3,{state:`pending`}),l.length,` `,l.length===1?`file you marked reviewed has`:`files you marked reviewed have`,` `,`changed since.`]}),(0,Q.jsx)(`ul`,{"aria-label":`Reviewed files that changed`,className:`flex min-w-0 flex-col pl-5.5`,children:l.slice(0,8).map(e=>(0,Q.jsx)(`li`,{className:`min-w-0`,children:f?(0,Q.jsxs)(`button`,{type:`button`,className:`flex h-6 max-w-full min-w-0 items-center gap-1.5 rounded-sm font-mono text-xs text-foreground-2 underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>f(e),children:[(0,Q.jsx)(Zh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{text:e})]}):(0,Q.jsx)(fr,{text:e,className:`font-mono text-xs text-muted-foreground`})},e))}),l.length>8&&(0,Q.jsxs)(`p`,{className:`pl-5.5 text-xs text-muted-foreground`,children:[`and `,l.length-8,` more`]})]}),t[23]=l,t[24]=f,t[25]=C):C=t[25];let w;t[26]!==a||t[27]!==m||t[28]!==h||t[29]!==o||t[30]!==g||t[31]!==u?(w=h&&(0,Q.jsx)(qK,{context:a,projectId:o,pull:m,review:u,reason:g.waitsFor,className:Y(`mt-2 border-t pt-3`)}),t[26]=a,t[27]=m,t[28]=h,t[29]=o,t[30]=g,t[31]=u,t[32]=w):w=t[32];let T;return t[33]!==_||t[34]!==v||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==S||t[39]!==C||t[40]!==w?(T=(0,Q.jsxs)(`section`,{"aria-labelledby":_,className:v,children:[y,b,x,S,C,w]}),t[33]=_,t[34]=v,t[35]=y,t[36]=b,t[37]=x,t[38]=S,t[39]=C,t[40]=w,t[41]=T):T=t[41],T}function m6(e){let t=(0,$.c)(49),{context:n,projectId:r,number:i,repository:a,reviewAction:o}=e,s=(0,Z.useId)(),c=(0,Z.useId)(),[l,u]=(0,Z.useState)(),d=l?.body??``,f=na(n)??(a?Xc(l,a):Tu(`github-comment`)),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>u(void 0),t[0]=p):p=t[0];let{result:m,submit:h}=o4(n.connection,r,i,p),g;t[1]===d?g=t[2]:(g=d.trim(),t[1]=d,t[2]=g);let _=g===``,v;t[3]!==d||t[4]!==l||t[5]!==_||t[6]!==m.waiting||t[7]!==h||t[8]!==f?(v=()=>{!l?.repository||_||f||m.waiting||h(l.repository,d)},t[3]=d,t[4]=l,t[5]=_,t[6]=m.waiting,t[7]=h,t[8]=f,t[9]=v):v=t[9];let y=v,b;t[10]===m?b=t[11]:(b=Mi(m),t[10]=m,t[11]=b);let x=b,S;t[12]===y?S=t[13]:(S=e=>{e.preventDefault(),y()},t[12]=y,t[13]=S);let C;t[14]!==s||t[15]!==i?(C=(0,Q.jsxs)(`label`,{htmlFor:s,className:`sr-only`,children:[`Comment on pull request #`,i]}),t[14]=s,t[15]=i,t[16]=C):C=t[16];let w=x||void 0,T=x?c:void 0,E;t[17]===a?E=t[18]:(E=e=>{let t=e.currentTarget.value;u(e=>Vl(e,a,t))},t[17]=a,t[18]=E);let D;t[19]===y?D=t[20]:(D=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())},t[19]=y,t[20]=D);let O;t[21]!==d||t[22]!==s||t[23]!==m.waiting||t[24]!==D||t[25]!==w||t[26]!==T||t[27]!==E?(O=(0,Q.jsx)(gH,{id:s,value:d,maxLength:Nr,placeholder:`Comment on GitHub`,disabled:m.waiting,"aria-invalid":w,"aria-describedby":T,className:`min-h-18`,onChange:E,onKeyDown:D}),t[21]=d,t[22]=s,t[23]=m.waiting,t[24]=D,t[25]=w,t[26]=T,t[27]=E,t[28]=O):O=t[28];let k;t[29]!==c||t[30]!==x||t[31]!==m.cause?(k=x&&(0,Q.jsx)(`p`,{id:c,role:`alert`,className:`mr-auto min-w-0 text-ui text-destructive`,children:i4(m.cause)}),t[29]=c,t[30]=x,t[31]=m.cause,t[32]=k):k=t[32];let A;t[33]===f?A=t[34]:(A=f&&(0,Q.jsx)(`p`,{className:`mr-auto text-ui text-muted-foreground`,children:f}),t[33]=f,t[34]=A);let j=_||!!f,M;t[35]!==m.waiting||t[36]!==j||t[37]!==f?(M=(0,Q.jsx)(ji,{type:`submit`,size:`sm`,pending:m.waiting,disabled:j,"aria-description":f,children:`Comment`}),t[35]=m.waiting,t[36]=j,t[37]=f,t[38]=M):M=t[38];let N;t[39]!==o||t[40]!==k||t[41]!==A||t[42]!==M?(N=(0,Q.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[k,A,o,M]}),t[39]=o,t[40]=k,t[41]=A,t[42]=M,t[43]=N):N=t[43];let P;return t[44]!==O||t[45]!==N||t[46]!==S||t[47]!==C?(P=(0,Q.jsxs)(`form`,{"aria-label":`Comment on GitHub`,className:`mt-5 min-w-0 @min-3xl/pr:ml-7.5`,onSubmit:S,children:[C,O,N]}),t[44]=O,t[45]=N,t[46]=S,t[47]=C,t[48]=P):P=t[48],P}function h6(e){let t=(0,$.c)(7),{step:n,state:r,onOpenStep:i}=e,a;t[0]!==i||t[1]!==n?(a=i&&(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:()=>i(n),children:[`Open step `,n]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==n||t[5]!==a?(o=(0,Q.jsxs)(f6,{action:a,children:[`Your call in Walkthrough step `,n,` `,r,`. Merge waits for it.`]}),t[3]=r,t[4]=n,t[5]=a,t[6]=o):o=t[6],o}function g6(e){let t=(0,$.c)(9),{undecidedCallStep:n,callNeedingCommit:r,onOpenStep:i}=e,a;t[0]!==i||t[1]!==n?(a=typeof n==`number`&&(0,Q.jsx)(h6,{step:n,state:`is not decided yet`,onOpenStep:i}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]!==r||t[4]!==i?(o=r!==void 0&&(0,Q.jsx)(h6,{step:r,state:`needs a new commit`,onOpenStep:i}),t[3]=r,t[4]=i,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,Q.jsxs)(Q.Fragment,{children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function _6(e){let t=(0,$.c)(3),{checkout:n,context:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(DY,{owner:{scope:n,context:r},renderTrigger:v6}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function v6(e,t){return(0,Q.jsxs)(`p`,{className:`flex min-h-7 min-w-0 items-center gap-2 text-ui leading-4.5 text-muted-foreground`,children:[(0,Q.jsx)($g,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`min-w-0 py-1 wrap-anywhere`,children:e===1?`1 draft comment is not published yet.`:`${e} draft comments are not published yet.`}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,className:`shrink-0`,onClick:t,children:`Publish review`})]})}var y6={passed:`open`,failed:`closed`,none:`outline`};function b6(e){let t=(0,$.c)(69),{projectId:n,number:r,context:i,toolbarTarget:a,onBack:o,onFile:s,checkout:c,onOpen:u}=e,d;t[0]!==i.connection||t[1]!==r||t[2]!==n?(d=qs({connection:i.connection,projectId:n,number:r}),t[0]=i.connection,t[1]=r,t[2]=n,t[3]=d):d=t[3];let f=d,p=Ot(f),m=l(f),h,g,_;if(t[4]!==i.connection||t[5]!==n||t[6]!==p||t[7]!==m){_=Symbol.for(`react.early_return_sentinel`);bb0:{let e=de(qr(p));if(Mi(p)){let e;t[11]===m?e=t[12]:(e=(0,Q.jsx)(gt,{description:`The pull request could not be read.`,onRetry:m}),t[11]=m,t[12]=e),_=e;break bb0}if(!e){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Reading the pull request`}),t[13]=e):e=t[13],_=e;break bb0}if(e.kind===`unavailable`){_=(0,Q.jsx)(k6,{reason:e.reason,retrying:p.waiting,onRetry:m});break bb0}h=e.pullRequest,g=JSON.stringify([i.connection.environmentId,n,h.url])}t[4]=i.connection,t[5]=n,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_}else h=t[8],g=t[9],_=t[10];if(_!==Symbol.for(`react.early_return_sentinel`))return _;let v=g,y;t[14]!==i||t[15]!==r||t[16]!==n||t[17]!==h.state?(y=h.state===`merged`||h.state===`closed`?(0,Q.jsx)(BK,{context:i,projectId:n,number:r}):void 0,t[14]=i,t[15]=r,t[16]=n,t[17]=h.state,t[18]=y):y=t[18];let b;t[19]!==h.url||t[20]!==y||t[21]!==a?(b=(0,Q.jsx)(S6,{url:h.url,target:a,archive:y}),t[19]=h.url,t[20]=y,t[21]=a,t[22]=b):b=t[22];let x=`Pull request #${r}`,S;t[23]===h?S=t[24]:(S=(0,Q.jsx)(w6,{pull:h}),t[23]=h,t[24]=S);let C;t[25]!==c||t[26]!==i||t[27]!==r||t[28]!==u||t[29]!==n||t[30]!==h?(C=(0,Q.jsx)(j6,{pull:h,context:i,projectId:n,number:r,checkout:c,onOpen:u}),t[25]=c,t[26]=i,t[27]=r,t[28]=u,t[29]=n,t[30]=h,t[31]=C):C=t[31];let w;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(`h2`,{children:`Description`}),t[32]=w):w=t[32];let T;t[33]===h.author?T=t[34]:(T=h.author&&(0,Q.jsx)(fr,{text:`by ${h.author}`}),t[33]=h.author,t[34]=T);let E;t[35]!==h.author||t[36]!==h.createdAt?(E=h.author&&h.createdAt&&(0,Q.jsx)(n4,{}),t[35]=h.author,t[36]=h.createdAt,t[37]=E):E=t[37];let D;t[38]===h.createdAt?D=t[39]:(D=h.createdAt&&(0,Q.jsx)(`time`,{dateTime:h.createdAt,children:A6(h.createdAt)}),t[38]=h.createdAt,t[39]=D);let O;t[40]!==T||t[41]!==E||t[42]!==D?(O=(0,Q.jsxs)(`div`,{className:Y3,children:[w,(0,Q.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-1.5 font-normal`,children:[T,E,D]})]}),t[40]=T,t[41]=E,t[42]=D,t[43]=O):O=t[43];let k;t[44]===h.description?k=t[45]:(k=h.description.trim()?(0,Q.jsx)(cR,{text:h.description,className:`pt-3 text-(length:--text-prose) leading-6 wrap-anywhere text-foreground-2 [&_h1]:text-foreground [&_h2]:text-foreground [&_h3]:text-base [&_h3]:leading-6 [&_h3]:text-foreground [&_code]:text-ui [&_code]:leading-5 [&_p]:leading-6 [&_p]:mt-1 [&_p]:mb-0 [&_ul]:mt-2 [&_ul]:mb-0 [&_ol]:mt-2 [&_ol]:mb-0 [&_li]:my-0 [&_h1]:mb-0 [&_h2]:mb-0 [&_h3]:mb-0 [&_h1]:tracking-pr-subheading [&_h2]:tracking-pr-subheading [&_h3]:tracking-pr-subheading [&_code]:rounded-sm [&_code]:px-1.25 [&_code]:py-px [&_code]:ring-1 [&_code]:ring-border [&_code]:ring-inset`}):(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No description provided.`}),t[44]=h.description,t[45]=k);let A;t[46]!==O||t[47]!==k?(A=(0,Q.jsxs)(`section`,{"aria-label":`Description`,className:`mt-8 min-w-0`,children:[O,k]}),t[46]=O,t[47]=k,t[48]=A):A=t[48];let j;t[49]!==c||t[50]!==i||t[51]!==o||t[52]!==s||t[53]!==n||t[54]!==h?(j=(0,Q.jsx)(E6,{pull:h,context:i,projectId:n,checkout:c,onBack:o,onFile:s}),t[49]=c,t[50]=i,t[51]=o,t[52]=s,t[53]=n,t[54]=h,t[55]=j):j=t[55];let M;t[56]!==p.waiting||t[57]!==A||t[58]!==j||t[59]!==x||t[60]!==S||t[61]!==C?(M=(0,Q.jsxs)(`article`,{"aria-busy":p.waiting,"aria-label":x,className:`mx-auto w-full max-w-280 min-w-0 px-4 pt-9 pb-12 text-ui @min-3xl/pr:px-7`,children:[S,C,A,j]}),t[56]=p.waiting,t[57]=A,t[58]=j,t[59]=x,t[60]=S,t[61]=C,t[62]=M):M=t[62];let N;return t[63]!==v||t[64]!==r||t[65]!==n||t[66]!==M||t[67]!==b?(N=(0,Q.jsxs)(x6,{document:v,projectId:n,number:r,children:[b,M]},v),t[63]=v,t[64]=r,t[65]=n,t[66]=M,t[67]=b,t[68]=N):N=t[68],N}function x6(e){let t=(0,$.c)(9),{document:n,projectId:r,number:i,children:a}=e,o=Ot(E),s;t[0]===n?s=t[1]:(s=q$(n),t[0]=n,t[1]=s);let c=s,l;t[2]!==i||t[3]!==c||t[4]!==r||t[5]!==o?(l=()=>e=>{let t=e?.querySelector(`[data-pr-conversation]`);if(!e||!t)return;let n=()=>t.getBoundingClientRect().top-e.getBoundingClientRect().top,a=o.get(c),s=o.get(K$);return a!==null&&(s?.projectId!==r||s.number!==i)&&(e.scrollTop+=n()+a),()=>{let t=n();o.set(c,e.scrollTop>0&&t<e.clientHeight?-t:null)}},t[2]=i,t[3]=c,t[4]=r,t[5]=o,t[6]=l):l=t[6];let[u]=(0,Z.useState)(l),d;return t[7]===a?d=t[8]:(d=(0,Q.jsx)(`div`,{ref:u,className:`@container/pr flex min-h-0 min-w-0 flex-1 flex-col overflow-auto`,children:a}),t[7]=a,t[8]=d),d}function S6(e){let t=(0,$.c)(21),{url:n,target:r,archive:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(X,{variant:`ghost`,size:`sm`,render:(0,Q.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`}),"aria-label":`Open on GitHub`,className:``}),t[0]=n,t[1]=a);let o=r!==void 0&&`hidden @min-3xl/pane:inline`,s;t[2]===o?s=t[3]:(s=Y(o),t[2]=o,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,Q.jsx)(`span`,{className:s,children:`Open on GitHub`}),t[4]=s,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]!==a||t[8]!==c?(u=(0,Q.jsxs)(Ze,{render:a,children:[c,l]}),t[7]=a,t[8]=c,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(Yo,{children:`Open on GitHub`}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Q.jsxs)(ot,{children:[u,d]}),t[11]=u,t[12]=f);let p;t[13]!==i||t[14]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[i,f]}),t[13]=i,t[14]=f,t[15]=p):p=t[15];let m=p;if(r!==void 0){let e;return t[16]!==m||t[17]!==r?(e=r?(0,th.createPortal)(m,r):null,t[16]=m,t[17]=r,t[18]=e):e=t[18],e}let h;return t[19]===m?h=t[20]:(h=(0,Q.jsx)(`div`,{className:`flex h-12 shrink-0 items-center justify-end border-b px-3`,children:m}),t[19]=m,t[20]=h),h}function C6(e){let t=(0,$.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-y-0 left-0 flex w-6 items-center justify-center`,children:`·`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,Q.jsxs)(`span`,{className:`relative flex max-w-full min-w-0 items-center gap-2.5 pl-6`,children:[r,n]}),t[1]=n,t[2]=i),i}function w6(e){let t=(0,$.c)(53),{pull:n}=e,r;t[0]===n.url?r=t[1]:(r=El(n.url)?.split(`/`).at(-1),t[0]=n.url,t[1]=r);let i=r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Dg,{"aria-hidden":`true`,strokeWidth:1.75,className:`size-3.5 shrink-0`}),o=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Pull request`}),t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===i?s=t[5]:(s=i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(n4,{}),(0,Q.jsx)(fr,{text:i})]}),t[4]=i,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`flex h-5.5 min-w-0 items-center gap-2 text-ui leading-5.5 font-medium text-muted-foreground`,children:[a,o,s]}),t[6]=s,t[7]=c);let l;t[8]===n.number?l=t[9]:(l=(0,Q.jsxs)(`span`,{className:`text-title-dim tabular-nums`,children:[`#`,n.number]}),t[8]=n.number,t[9]=l);let u;t[10]!==n.title||t[11]!==l?(u=(0,Q.jsxs)(`h1`,{className:`mt-3 text-4xl leading-10 font-semibold tracking-pr-title wrap-anywhere`,children:[l,` `,n.title]}),t[10]=n.title,t[11]=l,t[12]=u):u=t[12];let d;t[13]===n?d=t[14]:(d=(0,Q.jsx)($2,{pull:n}),t[13]=n,t[14]=d);let f;t[15]!==n.author||t[16]!==n.authorAvatarUrl?(f=n.author&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D6,{author:n.author,url:n.authorAvatarUrl}),(0,Q.jsx)(fr,{text:n.author,className:`font-medium text-foreground`})]}),t[15]=n.author,t[16]=n.authorAvatarUrl,t[17]=f):f=t[17];let p;t[18]!==d||t[19]!==f?(p=(0,Q.jsxs)(C6,{children:[d,f]}),t[18]=d,t[19]=f,t[20]=p):p=t[20];let m=`Merges ${n.headBranch} into ${n.baseBranch}`,h;t[21]===m?h=t[22]:(h=(0,Q.jsx)(`span`,{role:`group`,"aria-label":m,tabIndex:0,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-sm font-mono text-caption text-foreground focus-visible:outline-2 focus-visible:outline-ring`}),t[21]=m,t[22]=h);let g;t[23]===n.baseBranch?g=t[24]:(g=(0,Q.jsx)(fr,{text:n.baseBranch}),t[23]=n.baseBranch,t[24]=g);let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(_h,{"aria-hidden":`true`,strokeWidth:1.75,className:`size-3 shrink-0 text-muted-foreground`}),t[25]=_):_=t[25];let v;t[26]===n.headBranch?v=t[27]:(v=(0,Q.jsx)(fr,{text:n.headBranch}),t[26]=n.headBranch,t[27]=v);let y;t[28]!==h||t[29]!==g||t[30]!==v?(y=(0,Q.jsxs)(Ze,{render:h,children:[g,_,v]}),t[28]=h,t[29]=g,t[30]=v,t[31]=y):y=t[31];let b;t[32]!==n.baseBranch||t[33]!==n.headBranch?(b=(0,Q.jsxs)(Yo,{children:[`Merges `,n.headBranch,` into `,n.baseBranch]}),t[32]=n.baseBranch,t[33]=n.headBranch,t[34]=b):b=t[34];let x;t[35]!==y||t[36]!==b?(x=(0,Q.jsx)(C6,{children:(0,Q.jsxs)(ot,{children:[y,b]})}),t[35]=y,t[36]=b,t[37]=x):x=t[37];let S;t[38]===n.updatedAt?S=t[39]:(S=A6(n.updatedAt),t[38]=n.updatedAt,t[39]=S);let C;t[40]===S?C=t[41]:(C=(0,Q.jsxs)(C6,{children:[`updated `,S]}),t[40]=S,t[41]=C);let w;t[42]!==p||t[43]!==x||t[44]!==C?(w=(0,Q.jsx)(`div`,{className:`mt-3.5 min-w-0 overflow-hidden`,children:(0,Q.jsxs)(`div`,{className:`-ml-6 flex min-w-0 flex-wrap items-center gap-y-2 text-ui leading-5 text-muted-foreground`,children:[p,x,C]})}),t[42]=p,t[43]=x,t[44]=C,t[45]=w):w=t[45];let T;t[46]===n.labels?T=t[47]:(T=n.labels.length>0&&(0,Q.jsx)(`ul`,{"aria-label":`Labels`,className:`mt-3 flex min-w-0 flex-wrap gap-1.5`,children:n.labels.map(T6)}),t[46]=n.labels,t[47]=T);let E;return t[48]!==w||t[49]!==T||t[50]!==c||t[51]!==u?(E=(0,Q.jsxs)(`header`,{className:`min-w-0`,children:[c,u,w,T]}),t[48]=w,t[49]=T,t[50]=c,t[51]=u,t[52]=E):E=t[52],E}function T6(e,t){return(0,Q.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,Q.jsx)(Ao,{variant:`outline`,className:`max-w-full`,children:(0,Q.jsx)(fr,{text:e.name})})},`${e.name}:${t}`)}function E6(e){let t=(0,$.c)(39),{pull:n,context:r,projectId:i,checkout:a,onBack:o,onFile:s}=e,c,l,u,d,f;if(t[0]!==s||t[1]!==n.timeline||t[2]!==n.url){let e=kl(n.timeline);c=`Conversation on GitHub`,l=``,u=`mt-8 min-w-0`;let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(`h2`,{children:`Conversation`}),t[8]=r):r=t[8];let i;t[9]===n.timeline.length?i=t[10]:(i=(0,Q.jsx)(`span`,{className:`font-normal tabular-nums`,children:n.timeline.length}),t[9]=n.timeline.length,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3 shrink-0`}),t[11]=a):a=t[11];let o;t[12]===n.url?o=t[13]:(o=(0,Q.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex max-w-full min-w-0 items-center gap-1 font-normal outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[`On GitHub`,a]}),t[12]=n.url,t[13]=o),t[14]!==i||t[15]!==o?(d=(0,Q.jsxs)(`div`,{className:Y3,children:[r,i,o]}),t[14]=i,t[15]=o,t[16]=d):d=t[16],f=e.length>0?(0,Q.jsx)(`ol`,{"aria-label":`Timeline`,className:Y(`relative mt-3 flex min-w-0 flex-col gap-4`,e.length>1&&`before:absolute before:top-4 before:bottom-2.5 before:left-2.5 before:w-px before:bg-border`),children:e.map(e=>{let{item:t,comments:n}=e;return(0,Q.jsx)(O6,{item:t,onFile:s,children:n.length>0&&(0,Q.jsx)(`ol`,{"aria-label":`Comments on review by ${t.author??`Unknown author`}`,className:`mt-3 flex min-w-0 flex-col gap-3 border-l pl-3`,children:n.map(e=>(0,Q.jsx)(O6,{item:e,onFile:s},e.id))})},t.id)})}):(0,Q.jsx)(`p`,{className:`pt-3 text-ui text-muted-foreground`,children:`No comments or reviews on GitHub yet.`}),t[0]=s,t[1]=n.timeline,t[2]=n.url,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f}else c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];let p;t[17]!==a||t[18]!==r?(p=a&&(0,Q.jsx)(DY,{owner:{scope:a,context:r}}),t[17]=a,t[18]=r,t[19]=p):p=t[19];let m;t[20]!==r||t[21]!==i||t[22]!==n.number||t[23]!==n.repository||t[24]!==p?(m=(0,Q.jsx)(m6,{context:r,projectId:i,number:n.number,repository:n.repository,reviewAction:p}),t[20]=r,t[21]=i,t[22]=n.number,t[23]=n.repository,t[24]=p,t[25]=m):m=t[25];let h;t[26]===n.truncated?h=t[27]:(h=n.truncated&&(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Some labels or conversation items are not shown. Open on GitHub to see everything.`}),t[26]=n.truncated,t[27]=h);let g;t[28]===o?g=t[29]:(g=(0,Q.jsxs)(`p`,{className:`mt-4 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 text-xs leading-4 text-muted-foreground @min-3xl/pr:ml-7.5`,children:[`Questions about the change belong in its Walkthrough.`,(0,Q.jsx)(X,{variant:`link`,size:`sm`,onClick:o,children:`Back to the worktree`})]}),t[28]=o,t[29]=g);let _;return t[30]!==c||t[31]!==l||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==m||t[36]!==h||t[37]!==g?(_=(0,Q.jsxs)(`section`,{"aria-label":c,"data-pr-conversation":l,className:u,children:[d,f,m,h,g]}),t[30]=c,t[31]=l,t[32]=u,t[33]=d,t[34]=f,t[35]=m,t[36]=h,t[37]=g,t[38]=_):_=t[38],_}function D6(e){let t=(0,$.c)(9),{author:n,url:r}=e,i;t[0]===r?i=t[1]:(i=r&&(0,Q.jsx)(X2,{src:r,alt:``}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=n.slice(0,1).toUpperCase(),t[2]=n,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,Q.jsx)(Z2,{children:a}),t[4]=a,t[5]=o);let s;return t[6]!==i||t[7]!==o?(s=(0,Q.jsxs)(Y2,{size:`sm`,"aria-hidden":`true`,children:[i,o]}),t[6]=i,t[7]=o,t[8]=s):s=t[8],s}function O6(e){let t=(0,$.c)(51),{item:n,onFile:r,children:i}=e,{dark:a}=Xd(),o;t[0]===n.reviewState?o=t[1]:(o=pl(n.reviewState),t[0]=n.reviewState,t[1]=o);let s=o,c=n.author??`Unknown author`,l=n.line??n.originalLine,u=n.path,d=n.path===void 0?void 0:`${n.path}${l===void 0?``:`:${l}`}`,f;t[2]!==c||t[3]!==n.authorAvatarUrl?(f=(0,Q.jsx)(`div`,{className:`z-1 shrink-0 bg-background`,children:(0,Q.jsx)(D6,{author:c,url:n.authorAvatarUrl})}),t[2]=c,t[3]=n.authorAvatarUrl,t[4]=f):f=t[4];let p;t[5]===c?p=t[6]:(p=(0,Q.jsx)(fr,{text:c,className:`text-ui leading-4.5 font-semibold text-foreground`}),t[5]=c,t[6]=p);let m;t[7]===s?m=t[8]:(m=s&&(0,Q.jsx)(Ao,{variant:y6[s.tone],children:s.label}),t[7]=s,t[8]=m);let h=!s&&n.kind===`comment`?`commented · `:``,g;t[9]===n.time?g=t[10]:(g=A6(n.time),t[9]=n.time,t[10]=g);let _;t[11]!==h||t[12]!==g?(_=(0,Q.jsxs)(`span`,{children:[h,g]}),t[11]=h,t[12]=g,t[13]=_):_=t[13];let v;t[14]===n.url?v=t[15]:(v=(0,Q.jsx)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`}),t[14]=n.url,t[15]=v);let y=`Open this ${n.kind===`review`?`review`:`comment`} on GitHub`,b;t[16]!==v||t[17]!==y?(b=(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,render:v,"aria-label":y,className:`ml-auto`}),t[16]=v,t[17]=y,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(P,{"aria-hidden":`true`,className:`size-3`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,Q.jsx)(Ze,{render:b,children:x}),t[20]=b,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Yo,{children:`Open on GitHub`}),t[22]=C):C=t[22];let w;t[23]===S?w=t[24]:(w=(0,Q.jsxs)(ot,{children:[S,C]}),t[23]=S,t[24]=w);let T;t[25]!==w||t[26]!==p||t[27]!==m||t[28]!==_?(T=(0,Q.jsxs)(`div`,{className:`flex min-h-5 min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-4 text-muted-foreground`,children:[p,m,_,w]}),t[25]=w,t[26]=p,t[27]=m,t[28]=_,t[29]=T):T=t[29];let E;t[30]!==d||t[31]!==n.path||t[32]!==r||t[33]!==u?(E=d&&(0,Q.jsxs)(`div`,{className:`mt-2.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-t-lg border bg-muted px-2 py-1.5`,children:[r&&n.path!==void 0?(0,Q.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-label":`Open ${d}`,className:`max-w-full min-w-0 justify-start`,onClick:()=>{u!==void 0&&r(u)},children:[(0,Q.jsx)(Yh,{"aria-hidden":`true`}),(0,Q.jsx)(fr,{text:d})]}):(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-xs`,children:[(0,Q.jsx)(Yh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(fr,{text:d})]}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:`review comment`})]}),t[30]=d,t[31]=n.path,t[32]=r,t[33]=u,t[34]=E):E=t[34];let D;t[35]!==a||t[36]!==n.diffHunk||t[37]!==u?(D=n.diffHunk&&(0,Q.jsx)(`div`,{role:`region`,"aria-label":`Code excerpt for ${u??`review comment`}`,className:`max-h-64 min-w-0 overflow-auto border-x`,children:(0,Q.jsx)(cI,{file:{name:u??`review.diff`,contents:n.diffHunk,lang:`diff`},options:{theme:Qu,preferredHighlighter:Gu,themeType:a?`dark`:`light`,disableFileHeader:!0,disableLineNumbers:!0,overflow:`wrap`}})}),t[35]=a,t[36]=n.diffHunk,t[37]=u,t[38]=D):D=t[38];let O;t[39]!==d||t[40]!==n.body?(O=n.body.trim()&&(0,Q.jsx)(cR,{text:n.body,className:Y(`mt-1 text-sm leading-5.5 wrap-anywhere [&_p]:my-0 [&_p]:leading-5.5`,d&&`mt-0 rounded-b-lg border border-t-0 px-3 py-2.5 text-ui [&_p]:leading-4.75`)}),t[39]=d,t[40]=n.body,t[41]=O):O=t[41];let k;t[42]!==i||t[43]!==T||t[44]!==E||t[45]!==D||t[46]!==O?(k=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[T,E,D,O,i]}),t[42]=i,t[43]=T,t[44]=E,t[45]=D,t[46]=O,t[47]=k):k=t[47];let A;return t[48]!==k||t[49]!==f?(A=(0,Q.jsxs)(`li`,{className:`relative flex min-w-0 items-start gap-2.5`,children:[f,k]}),t[48]=k,t[49]=f,t[50]=A):A=t[50],A}function k6(e){let t=(0,$.c)(20),{reason:n,retrying:r,onRetry:i}=e,a=Pc(),o;t[0]===n?o=t[1]:(o=Kc(n),t[0]=n,t[1]=o);let{description:s,action:c}=o,l;t[2]!==i||t[3]!==r?(l=(0,Q.jsx)(X,{variant:`outline`,disabled:r,onClick:i,children:`Try again`}),t[2]=i,t[3]=r,t[4]=l):l=t[4];let u=l;if(c.kind===`settings`){let e;t[5]===a?e=t[6]:(e=()=>void a({to:`/settings/$section`,params:{section:`git`}}),t[5]=a,t[6]=e);let n;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(x_,{}),t[7]=n):n=t[7];let r;t[8]!==c.label||t[9]!==e?(r=(0,Q.jsxs)(X,{variant:`outline`,onClick:e,children:[n,c.label]}),t[8]=c.label,t[9]=e,t[10]=r):r=t[10],u=r}if(c.kind===`install`){let e;t[11]===c.url?e=t[12]:(e=(0,Q.jsx)(`a`,{href:c.url,target:`_blank`,rel:`noreferrer`}),t[11]=c.url,t[12]=e);let n;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(P,{}),t[13]=n):n=t[13];let r;t[14]!==c.label||t[15]!==e?(r=(0,Q.jsxs)(X,{variant:`outline`,render:e,children:[n,c.label]}),t[14]=c.label,t[15]=e,t[16]=r):r=t[16],u=r}let d;return t[17]!==u||t[18]!==s?(d=(0,Q.jsx)(vn,{role:`alert`,message:s,action:u}),t[17]=u,t[18]=s,t[19]=d):d=t[19],d}function A6(e){return Number.isFinite(Date.parse(e))?$a(e,Date.now()):`unknown time`}function j6(e){let t=(0,$.c)(74),{pull:n,context:r,projectId:i,number:a,checkout:o,onOpen:s}=e,{connection:c}=r,{status:l,problem:u,reading:d,refresh:f,pendingReruns:p}=N3(c,i,a),[m,h]=(0,Z.useState)(M6),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>h(n=>{let r=new Set(n);return t??!r.has(e)?r.add(e):r.delete(e),r}),t[0]=g):g=t[0];let _=g,v;t[1]===l?.checks?v=t[2]:(v=e=>{let t=l?.checks.find(t=>t.key===e);(0,th.flushSync)(()=>h(n=>{let r=new Set(n);return r.add(e),t?.kind===`actions`&&t.runId!==void 0&&r.add(`passed:run:${t.runId}`),r}));let n=document.querySelector(G3(e));n?.scrollIntoView({block:`center`}),n?.focus()},t[1]=l?.checks,t[2]=v);let y=v,[b,x]=B(K$),S;t[3]!==b||t[4]!==a||t[5]!==i||t[6]!==l?(S=l&&b?.projectId===i&&b.number===a?l.checks.find(e=>e.name===b.name):void 0,t[3]=b,t[4]=a,t[5]=i,t[6]=l,t[7]=S):S=t[7];let C=S,w=a4(c,i,a),T;t[8]!==w||t[9]!==l?(T=(e,t)=>{l&&w.rerun(l,e,t)},t[8]=w,t[9]=l,t[10]=T):T=t[10];let E=T,D=L3(c,o),O;t[11]!==o||t[12]!==c||t[13]!==D.walkthrough?(O=x3(o&&D.walkthrough?{connection:c,scope:o,...D.walkthrough}:void 0),t[11]=o,t[12]=c,t[13]=D.walkthrough,t[14]=O):O=t[14];let k=Ot(O),A=l?.headSha??n.headSha,j=k?.headOid===A?k:void 0,M;t[15]!==n||t[16]!==l?(M=l?So(l,n.baseBranch,n.mergeMethods):[],t[15]=n,t[16]=l,t[17]=M):M=t[17];let N=M,P;t[18]===s?P=t[19]:(P=s?e=>s({kind:`walkthrough-step`,step:e}):void 0,t[18]=s,t[19]=P);let F=P,I;t[20]!==y||t[21]!==C||t[22]!==x?(I=C&&(0,Q.jsx)(`span`,{hidden:!0,ref:e=>{e&&queueMicrotask(()=>{x(void 0),y(C.key)})}}),t[20]=y,t[21]=C,t[22]=x,t[23]=I):I=t[23];let L;t[24]!==s||t[25]!==D.walkthroughHead?(L=D.walkthroughHead&&s?{headOid:D.walkthroughHead,onOpen:()=>s({kind:`review`})}:void 0,t[24]=s,t[25]=D.walkthroughHead,t[26]=L):L=t[26];let R;t[27]!==o||t[28]!==j?.callsNeedingCommit?.[0]||t[29]!==j?.undecidedCallStep||t[30]!==F?(R=o&&(0,Q.jsx)(g6,{undecidedCallStep:j?.undecidedCallStep,callNeedingCommit:j?.callsNeedingCommit?.[0],onOpenStep:F}),t[27]=o,t[28]=j?.callsNeedingCommit?.[0],t[29]=j?.undecidedCallStep,t[30]=F,t[31]=R):R=t[31];let z;t[32]!==o||t[33]!==r?(z=o&&(0,Q.jsx)(_6,{checkout:o,context:r}),t[32]=o,t[33]=r,t[34]=z):z=t[34];let V;t[35]===s?V=t[36]:(V=s?e=>s({kind:`branch-file`,path:e}):void 0,t[35]=s,t[36]=V);let H;t[37]!==N||t[38]!==r||t[39]!==y||t[40]!==i||t[41]!==n||t[42]!==k||t[43]!==D.changedSinceReview||t[44]!==l||t[45]!==R||t[46]!==z||t[47]!==V||t[48]!==L?(H=(0,Q.jsx)(p6,{pull:n,status:l,context:r,projectId:i,blockers:N,walkthrough:L,review:k,changedSinceReview:D.changedSinceReview,notes:R,drafts:z,onOpenFile:V,onFocusCheck:y}),t[37]=N,t[38]=r,t[39]=y,t[40]=i,t[41]=n,t[42]=k,t[43]=D.changedSinceReview,t[44]=l,t[45]=R,t[46]=z,t[47]=V,t[48]=L,t[49]=H):H=t[49];let U;t[50]!==u||t[51]!==d||t[52]!==f||t[53]!==l?(U=l&&u&&(0,Q.jsx)(N6,{problem:u,reading:d,onRetry:f,stale:!0}),t[50]=u,t[51]=d,t[52]=f,t[53]=l,t[54]=U):U=t[54];let W;t[55]!==c||t[56]!==a||t[57]!==E||t[58]!==m||t[59]!==F||t[60]!==p||t[61]!==u||t[62]!==i||t[63]!==d||t[64]!==f||t[65]!==w||t[66]!==D.citations||t[67]!==l?(W=l?(0,Q.jsx)(K3,{status:l,connection:c,projectId:i,number:a,controller:{open:m,toggle:_},pendingReruns:p,rerunning:w.pending,onRerun:E,citations:D.citations,onOpenStep:F}):(0,Q.jsxs)(`section`,{"aria-label":`Checks`,className:`mt-8 min-w-0`,children:[(0,Q.jsx)(`div`,{className:Y3,children:(0,Q.jsx)(`h2`,{children:`Checks`})}),u&&(0,Q.jsx)(N6,{problem:u,reading:d,onRetry:f,stale:!1})]}),t[55]=c,t[56]=a,t[57]=E,t[58]=m,t[59]=F,t[60]=p,t[61]=u,t[62]=i,t[63]=d,t[64]=f,t[65]=w,t[66]=D.citations,t[67]=l,t[68]=W):W=t[68];let G;return t[69]!==H||t[70]!==U||t[71]!==W||t[72]!==I?(G=(0,Q.jsxs)(Q.Fragment,{children:[I,H,U,W]}),t[69]=H,t[70]=U,t[71]=W,t[72]=I,t[73]=G):G=t[73],G}function M6(){return new Set}function N6(e){let t=(0,$.c)(10),{problem:n,reading:r,onRetry:i,stale:a}=e,o;t[0]===n?o=t[1]:(o=n===`failed`?`The checks could not be read.`:Kc(n).description,t[0]=n,t[1]=o);let s=o,c=a?`Showing the last read. ${s}`:s,l;t[2]===c?l=t[3]:(l=(0,Q.jsx)(`span`,{className:`min-w-0`,children:c}),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==r?(u=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,disabled:r,onClick:i,children:`Try again`}),t[4]=i,t[5]=r,t[6]=u):u=t[6];let d;return t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`p`,{role:`status`,className:`mt-3 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-ui text-muted-foreground`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9],d}function P6(e){let t=(0,$.c)(51),{scope:n,context:r,document:i,onOpen:a,onBrowse:o,sideLabel:s,active:c,hidden:l,base:u,toolbarTarget:d,review:f,walkthroughCode:p,fileTarget:m}=e,h=c!==void 0&&c,g=l!==void 0&&l,_=n.worktreeId,v;t[0]===i?v=t[1]:(v=PQ(i),t[0]=i,t[1]=v);let y;t[2]!==h||t[3]!==m||t[4]!==g||t[5]!==n.worktreeId||t[6]!==v||t[7]!==d?(y={toolbarTarget:d,active:h,worktreeId:_,entry:v,fileTarget:m,hidden:g},t[2]=h,t[3]=m,t[4]=g,t[5]=n.worktreeId,t[6]=v,t[7]=d,t[8]=y):y=t[8];let b;t[9]!==u||t[10]!==r||t[11]!==o||t[12]!==a||t[13]!==n||t[14]!==s||t[15]!==y?(b={base:u,scope:n,context:r,onOpen:a,onBrowse:o,sideLabel:s,interaction:y},t[9]=u,t[10]=r,t[11]=o,t[12]=a,t[13]=n,t[14]=s,t[15]=y,t[16]=b):b=t[16];let x=b;switch(i.kind){case`review`:{let e;return t[17]!==f||t[18]!==x?(e=f?(0,Q.jsx)(f,{...x}):null,t[17]=f,t[18]=x,t[19]=e):e=t[19],e}case`all-changes`:{let e;return t[20]===x?e=t[21]:(e=(0,Q.jsx)(B6,{...x}),t[20]=x,t[21]=e),e}case`specs`:{let e;return t[22]===x?e=t[23]:(e=(0,Q.jsx)(V6,{...x,specsOnly:!0}),t[22]=x,t[23]=e),e}case`change`:{let e;return t[24]!==i.path||t[25]!==x?(e=(0,Q.jsx)(W6,{...x,path:i.path}),t[24]=i.path,t[25]=x,t[26]=e):e=t[26],e}case`file`:{let e;return t[27]!==i.path||t[28]!==x?(e=(0,Q.jsx)(n2,{...x,path:i.path}),t[27]=i.path,t[28]=x,t[29]=e):e=t[29],e}case`commit`:{let e;return t[30]!==i.oid||t[31]!==x?(e=(0,Q.jsx)(F0,{...x,oid:i.oid}),t[30]=i.oid,t[31]=x,t[32]=e):e=t[32],e}case`branch`:{let e;return t[33]===x?e=t[34]:(e=(0,Q.jsx)(w0,{...x}),t[33]=x,t[34]=e),e}case`branch-file`:{let e;return t[35]!==i.path||t[36]!==x?(e=(0,Q.jsx)(T0,{...x,path:i.path}),t[35]=i.path,t[36]=x,t[37]=e):e=t[37],e}case`walkthrough-step`:{let e;return t[38]!==p||t[39]!==i||t[40]!==x?(e=p?(0,Q.jsx)(p,{...x,document:i}):null,t[38]=p,t[39]=i,t[40]=x,t[41]=e):e=t[41],e}case`timeline`:{let e;return t[42]!==i.path||t[43]!==x?(e=(0,Q.jsx)(R6,{...x,path:i.path}),t[42]=i.path,t[43]=x,t[44]=e):e=t[44],e}case`graph`:{let e;return t[45]===x?e=t[46]:(e=(0,Q.jsx)(L6,{...x}),t[45]=x,t[46]=e),e}case`pull-request`:{let e;return t[47]!==r||t[48]!==i||t[49]!==d?(e=(0,Q.jsx)(F6,{document:i,context:r,toolbarTarget:d}),t[47]=r,t[48]=i,t[49]=d,t[50]=e):e=t[50],e}}}function F6(e){let t=(0,$.c)(15),{document:n,context:r,toolbarTarget:i}=e,a=Di(),o=io(),s=n.environmentId??r.connection.environmentId,c;if(t[0]!==s||t[1]!==o){let e;t[3]===s?e=t[4]:(e=e=>e.connection.environmentId===s,t[3]=s,t[4]=e),c=o.find(e),t[0]=s,t[1]=o,t[2]=c}else c=t[2];let l=c,u;t[5]!==s||t[6]!==a||t[7]!==l?(u=s===a.connection.environmentId?a:l&&{connection:l.connection,remoteStatus:ns(s)},t[5]=s,t[6]=a,t[7]=l,t[8]=u):u=t[8];let d=u;if(!d){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`Pair this pull request's computer in Settings to read it.`}),t[9]=e):e=t[9],e}let f;return t[10]!==n||t[11]!==a.connection.environmentId||t[12]!==d||t[13]!==i?(f=(0,Q.jsx)(I6,{document:n,context:d,localEnvironmentId:a.connection.environmentId,toolbarTarget:i}),t[10]=n,t[11]=a.connection.environmentId,t[12]=d,t[13]=i,t[14]=f):f=t[14],f}function I6(e){let t=(0,$.c)(19),{document:n,context:r,localEnvironmentId:i,toolbarTarget:a}=e,o=Pc(),s=c1(r.connection,n.projectId,n.number),c;t[0]!==s||t[1]!==r.connection||t[2]!==i||t[3]!==o?(c=e=>{if(!s){o({to:`/`});return}let t=s,n={entry:PQ(e)};o(r.connection.environmentId===i?{to:`/$projectId/$worktreeId`,params:t,search:n}:{to:`/remotes/$environmentId/$projectId/$worktreeId`,params:{...t,environmentId:r.connection.environmentId},search:n})},t[0]=s,t[1]=r.connection,t[2]=i,t[3]=o,t[4]=c):c=t[4];let l=c,u;t[5]===l?u=t[6]:(u=()=>l({kind:`review`}),t[5]=l,t[6]=u);let d;t[7]!==s||t[8]!==l?(d=s?e=>l({kind:`file`,path:e}):void 0,t[7]=s,t[8]=l,t[9]=d):d=t[9];let f=s?l:void 0,p;return t[10]!==s||t[11]!==r||t[12]!==n.number||t[13]!==n.projectId||t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==a?(p=(0,Q.jsx)(b6,{projectId:n.projectId,number:n.number,context:r,toolbarTarget:a,onBack:u,onFile:d,checkout:s,onOpen:f}),t[10]=s,t[11]=r,t[12]=n.number,t[13]=n.projectId,t[14]=u,t[15]=d,t[16]=f,t[17]=a,t[18]=p):p=t[18],p}function L6(e){let t=(0,$.c)(7),{scope:n,context:r,onOpen:i,sideLabel:a}=e,o;t[0]===i?o=t[1]:(o=(e,t)=>i({kind:`commit`,oid:e},{toSide:t===!0}),t[0]=i,t[1]=o);let s;return t[2]!==r.connection||t[3]!==n||t[4]!==a||t[5]!==o?(s=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(wZ,{scope:n,connection:r.connection,sideLabel:a,onSelect:o})}),t[2]=r.connection,t[3]=n,t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function R6(e){let t=(0,$.c)(17),{scope:n,context:r,path:i,onOpen:a,sideLabel:o}=e,s=`Timeline of ${i}`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(h_,{className:`size-4 shrink-0`}),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[c,(0,Q.jsx)(fr,{text:i})]}),t[1]=i,t[2]=l);let u;t[3]!==s||t[4]!==l?(u=(0,Q.jsx)(n0,{titleLabel:s,title:l}),t[3]=s,t[4]=l,t[5]=u):u=t[5];let d;t[6]===a?d=t[7]:(d=(e,t)=>a({kind:`commit`,oid:e.oid},{path:e.path,toSide:t===!0}),t[6]=a,t[7]=d);let f;t[8]!==r.connection||t[9]!==i||t[10]!==n||t[11]!==o||t[12]!==d?(f=(0,Q.jsx)(EZ,{scope:n,connection:r.connection,path:i,sideLabel:o,onSelect:d}),t[8]=r.connection,t[9]=i,t[10]=n,t[11]=o,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==u||t[15]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,f]}),t[14]=u,t[15]=f,t[16]=p):p=t[16],p}function z6(e,t,n){return(e?void 0:H(t,n))??Vt(t,e?`uncommitted spec change`:`uncommitted change`)}function B6(e){let t=(0,$.c)(11),{connection:n}=e.context,r;t[0]!==n.environmentId||t[1]!==e.scope.projectId||t[2]!==e.scope.worktreeId?(r=O$(JSON.stringify([n.environmentId,e.scope.projectId,e.scope.worktreeId,`all-changes`])),t[0]=n.environmentId,t[1]=e.scope.projectId,t[2]=e.scope.worktreeId,t[3]=r):r=t[3];let[i,a]=B(r),o;t[4]!==a||t[5]!==i?(o=()=>a(i+25),t[4]=a,t[5]=i,t[6]=o):o=t[6];let s;return t[7]!==e||t[8]!==i||t[9]!==o?(s=(0,Q.jsx)(V6,{...e,limit:i,onReadMore:o}),t[7]=e,t[8]=i,t[9]=o,t[10]=s):s=t[10],s}function V6(e){let t=(0,$.c)(72),{scope:n,context:r,interaction:i,onBrowse:a,onOpen:o,sideLabel:s,specsOnly:c,only:l,heading:u,fullHeight:d,limit:f,onReadMore:p}=e,m=c!==void 0&&c,[h,g]=(0,Z.useState)(!1),{connection:_}=r;d1(n,r);let v=g2(rB(n,_),i.hidden===!0),y=f1(n,r,v),b;t[0]!==l||t[1]!==m?(b=e=>l?l.includes(e):!m||ky(e),t[0]=l,t[1]=m,t[2]=b):b=t[2];let x=b,S,C,w,T,E,D,O,k,A,j,M,N,P;if(t[3]!==h||t[4]!==y||t[5]!==r||t[6]!==d||t[7]!==u||t[8]!==x||t[9]!==i||t[10]!==f||t[11]!==v||t[12]!==a||t[13]!==o||t[14]!==l||t[15]!==n||t[16]!==s||t[17]!==m){D=Symbol.for(`react.early_return_sentinel`);bb0:{let e;if(t[31]===x?e=t[32]:(e=e=>x(e.path),t[31]=x,t[32]=e),C=y.filter(e),w=C.length===y.length?v.omittedChanges:void 0,T=f===void 0?C:C.slice(0,f),E=u!==void 0,!m&&C.length===0&&h&&g(!1),l&&C.length===0){let e;t[33]===u?e=t[34]:(e=u&&(0,Q.jsx)(n0,{inline:!0,title:u.title,titleLabel:u.titleLabel,children:u.after}),t[33]=u,t[34]=e);let n;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(`p`,{className:`p-5 text-prose text-foreground-2`,children:`Nothing uncommitted in this step.`}),t[35]=n):n=t[35];let r;t[36]===e?r=t[37]:(r=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[e,n]}),t[36]=e,t[37]=r),D=r;break bb0}if(!m&&C.length===0){let e;t[38]!==r||t[39]!==a||t[40]!==o||t[41]!==n||t[42]!==s?(e=(0,Q.jsx)(U6,{scope:n,context:r,onBrowse:a,onOpen:o,sideLabel:s}),t[38]=r,t[39]=a,t[40]=o,t[41]=n,t[42]=s,t[43]=e):e=t[43],D=e;break bb0}P=`flex min-h-0 flex-1 flex-col`,S=S2,O=d,k=n,A=r,j=i,M=f,N=m||l||f!==void 0?{paths:T.map(H6)}:{}}t[3]=h,t[4]=y,t[5]=r,t[6]=d,t[7]=u,t[8]=x,t[9]=i,t[10]=f,t[11]=v,t[12]=a,t[13]=o,t[14]=l,t[15]=n,t[16]=s,t[17]=m,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k,t[26]=A,t[27]=j,t[28]=M,t[29]=N,t[30]=P}else S=t[18],C=t[19],w=t[20],T=t[21],E=t[22],D=t[23],O=t[24],k=t[25],A=t[26],j=t[27],M=t[28],N=t[29],P=t[30];if(D!==Symbol.for(`react.early_return_sentinel`))return D;let F=!E,I;t[44]!==h||t[45]!==C||t[46]!==r||t[47]!==u||t[48]!==w||t[49]!==n||t[50]!==T||t[51]!==E||t[52]!==m?(I=E?{toolbar:e=>(0,Q.jsxs)(n0,{inline:!0,...u?{title:u.title,titleLabel:u.titleLabel}:{title:`All changes`},subtitle:z6(m,C.length,w),children:[e,u?.after]})}:{header:e=>(0,Q.jsx)(`div`,{className:`pt-6`,children:(0,Q.jsx)(K0,{scope:n,context:r,label:z6(m,C.length,w),items:C,rows:T.length,controls:e,actionsOpen:h,onActionsOpenChange:g,actions:(0,Q.jsx)(v0,{scope:n,context:r,entries:C})})})},t[44]=h,t[45]=C,t[46]=r,t[47]=u,t[48]=w,t[49]=n,t[50]=T,t[51]=E,t[52]=m,t[53]=I):I=t[53];let L;t[54]!==S||t[55]!==F||t[56]!==I||t[57]!==O||t[58]!==k||t[59]!==A||t[60]!==j||t[61]!==M||t[62]!==N?(L=(0,Q.jsx)(S,{fullHeight:O,scope:k,context:A,interaction:j,windowLimit:M,...N,column:F,...I}),t[54]=S,t[55]=F,t[56]=I,t[57]=O,t[58]=k,t[59]=A,t[60]=j,t[61]=M,t[62]=N,t[63]=L):L=t[63];let R;t[64]!==C||t[65]!==p||t[66]!==T?(R=p&&(0,Q.jsx)(r0,{more:C.length-T.length,total:C.length,pending:!1,onReadMore:p}),t[64]=C,t[65]=p,t[66]=T,t[67]=R):R=t[67];let z;return t[68]!==L||t[69]!==R||t[70]!==P?(z=(0,Q.jsxs)(`div`,{className:P,children:[L,R]}),t[68]=L,t[69]=R,t[70]=P,t[71]=z):z=t[71],z}function H6(e){return e.path}function U6(e){let t=(0,$.c)(16),{scope:n,context:r,onBrowse:i,onOpen:a,sideLabel:o}=e,s,c;t[0]===a?(s=t[1],c=t[2]):(s=(e,t)=>a({kind:`commit`,oid:e},{toSide:t===!0}),c=()=>a({kind:`graph`}),t[0]=a,t[1]=s,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(`span`,{children:`No changes to review.`}),t[3]=l):l=t[3];let u;t[4]===i?u=t[5]:(u=e=>i(`files`,e.currentTarget),t[4]=i,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pH,{children:Ad(ou.surfaceFiles)}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-caption text-muted-foreground`,children:[l,(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,onClick:u,children:[`Files `,d]})]}),t[7]=u,t[8]=f);let p;return t[9]!==r.connection||t[10]!==n||t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==f?(p=(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-(--container-commit) px-4 py-6`,children:(0,Q.jsx)(kZ,{scope:n,connection:r.connection,sideLabel:o,onOpenCommit:s,onOpenGraph:c,status:f})})}),t[9]=r.connection,t[10]=n,t[11]=o,t[12]=s,t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function W6(e){let t=(0,$.c)(14),{scope:n,context:r,interaction:i,onOpen:a,path:o}=e,{connection:s}=r;d1(n,r);let c=rB(n,s),l;if(t[0]===o?l=t[1]:(l=[o],t[0]=o,t[1]=l),!f1(n,r,c,l).find(e=>e.path===o)){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(vn,{message:`This change is no longer present.`}),t[2]=e):e=t[2],e}let u;t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==n?(u=e=>(0,Q.jsx)(S2,{headerActions:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(l1,{label:`Timeline`,iconOnly:!0,icon:h_,onClick:()=>a({kind:`timeline`,path:o})})}),headerLeading:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(X,{variant:`ghost`,size:`xs`,"aria-label":`Open file`,onClick:()=>a({kind:`file`,path:o}),children:[(0,Q.jsx)(rg,{}),(0,Q.jsx)(`span`,{className:`max-narrow:sr-only`,children:`Open file`})]}),e]}),scope:n,context:r,interaction:i,paths:[o]}),t[3]=r,t[4]=i,t[5]=a,t[6]=o,t[7]=n,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==o||t[11]!==n||t[12]!==u?(d=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(iX,{scope:n,context:r,path:o,variant:`quiet`,children:u})}),t[9]=r,t[10]=o,t[11]=n,t[12]=u,t[13]=d):d=t[13],d}function G6(e){let t=(0,$.c)(65),{scope:n,connection:r,base:i,onBase:a,compact:o}=e,s=o!==void 0&&o,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(``),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{l(e),e||d(``)},t[0]=f):f=t[0];let p=f,m=yB(n,r,c),h=vB(n,r,i),g,_,v,y,b;if(t[1]!==i||t[2]!==m.result||t[3]!==h.result){let e=de(qr(m.result)),n;t[9]===h.result?n=t[10]:(n=de(qr(h.result)),t[9]=h.result,t[10]=n);let r=i??n?.base?.ref,a;t[11]===r?a=t[12]:(a=r===void 0?`the default branch`:Vy(r),t[11]=r,t[12]=a),y=a,_=e?.defaultRef??null,g=i??_,v=new Map((e?.bases??[]).map(J6)),b=[{label:`Local`,remote:!1},{label:`Remote`,remote:!0}].map(t=>{let{label:n,remote:r}=t;return{type:`group`,label:n,items:(e?.bases??[]).filter(e=>e.remote===r).map(q6)}}).filter(K6),t[1]=i,t[2]=m.result,t[3]=h.result,t[4]=g,t[5]=_,t[6]=v,t[7]=y,t[8]=b}else g=t[4],_=t[5],v=t[6],y=t[7],b=t[8];let x=b,S;t[13]!==_||t[14]!==a?(S=e=>{a(e===_?void 0:e),p(!1)},t[13]=_,t[14]=a,t[15]=S):S=t[15];let C=S,w=s?`max-w-24 @min-3xl/pane:max-w-40`:`w-full`,T;t[16]===w?T=t[17]:(T=Y(`justify-between`,w),t[16]=w,t[17]=T);let E=`Compare against ${y}`,D;t[18]!==T||t[19]!==E?(D=(0,Q.jsx)(X,{variant:`outline`,size:`sm`,className:T,"aria-label":E,title:`Choose the branch this one is compared against`}),t[18]=T,t[19]=E,t[20]=D):D=t[20];let O=s&&`hidden @min-3xl/pane:block`,k;t[21]===O?k=t[22]:(k=Y(`size-3.5 shrink-0 text-muted-foreground`,O),t[21]=O,t[22]=k);let A;t[23]===k?A=t[24]:(A=(0,Q.jsx)(_g,{className:k}),t[23]=k,t[24]=A);let j=`Against ${y}`,M=s&&`hidden @min-3xl/pane:inline`,N;t[25]===M?N=t[26]:(N=Y(`text-muted-foreground`,M),t[25]=M,t[26]=N);let P;t[27]===N?P=t[28]:(P=(0,Q.jsxs)(`span`,{className:N,children:[`Against`,` `]}),t[27]=N,t[28]=P);let F;t[29]!==y||t[30]!==j||t[31]!==P?(F=(0,Q.jsxs)(fr,{text:j,children:[P,y]}),t[29]=y,t[30]=j,t[31]=P,t[32]=F):F=t[32];let I;t[33]!==A||t[34]!==F?(I=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[A,F]}),t[33]=A,t[34]=F,t[35]=I):I=t[35];let L;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Th,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[36]=L):L=t[36];let R;t[37]!==I||t[38]!==D?(R=(0,Q.jsxs)(yo,{render:D,children:[I,L]}),t[37]=I,t[38]=D,t[39]=R):R=t[39];let z,B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>p(!1),B=(0,Q.jsx)(LU,{"aria-label":`Find a base branch`,placeholder:`Find a branch`}),t[40]=z,t[41]=B):(z=t[40],B=t[41]);let V;t[42]===m.result?V=t[43]:(V=Xi(m.result)&&(0,Q.jsx)(`p`,{className:`p-3`,children:(0,Q.jsx)(Be,{label:`Reading branches`})}),t[42]=m.result,t[43]=V);let H;t[44]!==m.refresh||t[45]!==m.result?(H=Mi(m.result)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-center gap-2 py-6 text-xs/relaxed text-muted-foreground`,children:[`Branches could not be read.`,(0,Q.jsx)(X,{variant:`link`,size:`flush`,onClick:m.refresh,children:`Try again`})]}),t[44]=m.refresh,t[45]=m.result,t[46]=H):H=t[46];let U;t[47]===m.result?U=t[48]:(U=Bo(m.result)&&(0,Q.jsx)(zU,{children:`No matching branch`}),t[47]=m.result,t[48]=U);let W;t[49]!==C||t[50]!==g||t[51]!==_||t[52]!==v?(W=(0,Q.jsx)(RU,{"aria-label":`Base branches`,children:e=>e.items.map(e=>typeof e==`object`&&`type`in e&&e.type===`group`?(0,Q.jsx)(BU,{heading:e.label,children:e.items.map(e=>{let t=typeof e==`string`?e:e.value,n=v.get(t);return n&&(0,Q.jsxs)(VU,{value:n.ref,label:n.name,"data-checked":n.ref===g,onSelect:()=>C(n.ref),children:[(0,Q.jsx)(fr,{text:n.name}),n.ref===_&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`default`})]},n.ref)})},e.label):null)}),t[49]=C,t[50]=g,t[51]=_,t[52]=v,t[53]=W):W=t[53];let G;t[54]!==x||t[55]!==u||t[56]!==V||t[57]!==H||t[58]!==U||t[59]!==W?(G=(0,Q.jsx)(Zo,{align:`start`,className:`w-72`,children:(0,Q.jsxs)(FU,{items:x,query:u,onQueryChange:d,onEscape:z,children:[B,V,H,U,W]})}),t[54]=x,t[55]=u,t[56]=V,t[57]=H,t[58]=U,t[59]=W,t[60]=G):G=t[60];let K;return t[61]!==c||t[62]!==R||t[63]!==G?(K=(0,Q.jsxs)(uo,{open:c,onOpenChange:p,children:[R,G]}),t[61]=c,t[62]=R,t[63]=G,t[64]=K):K=t[64],K}function K6(e){return e.items.length>0}function q6(e){return{value:e.ref,label:e.name}}function J6(e){return[e.ref,e]}function Y6(e,t){let n=(0,$.c)(6),r;n[0]===e?r=n[1]:(r=K(e),n[0]=e,n[1]=r);let i;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={mode:`promiseExit`},n[2]=i):i=n[2];let a=Da(r,i),o;return n[3]!==a||n[4]!==t?(o=e=>{a(t).then(t=>{ne(t)&&e()})},n[3]=a,n[4]=t,n[5]=o):o=n[5],o}var X6=class extends Z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let e=this.state.error;return e instanceof Error&&e.name===`CommitNotFoundError`?(0,Q.jsx)(vn,{message:`This commit is not in this repository.`}):e?(0,Q.jsx)(gt,{description:ly(e,this.props.subject),onRetry:()=>this.props.reset(()=>this.setState({error:null}))}):this.props.children}};function Z6(e){let t=(0,$.c)(12),{children:n,connection:r,scope:i,quiet:a,documentKey:o}=e,s=a!==void 0&&a,c=Y6(r,i),l;t[0]===s?l=t[1]:(l=s?null:(0,Q.jsx)(kc,{label:`Loading review`}),t[0]=s,t[1]=l);let u;t[2]===o?u=t[3]:(u=IQ(FQ(o)),t[2]=o,t[3]=u);let d;t[4]!==n||t[5]!==o||t[6]!==c||t[7]!==u?(d=(0,Q.jsx)(X6,{subject:u,reset:c,children:n},o),t[4]=n,t[5]=o,t[6]=c,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,Q.jsx)(Z.Suspense,{fallback:l,children:d}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f}var Q6=L([`changes`,`files`,`history`]),$6=L([`uncommitted`,`branch`]),e8=ar(J.check(D(mt))).pipe(Tt(()=>Ja(Zn(void 0)))),t8=Ut({surface:ar(Q6).pipe(Tt(()=>Ja(Zn(void 0)))),entry:e8,side:e8,scope:ar($6).pipe(Tt(()=>Ja(Zn(void 0)))),base:e8}),n8=_t(Q6);function r8(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({layout:n,onSurface:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=o8(),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=e=>(0,Q.jsx)(c8,{...i,actionsTarget:e}),t[5]=i,t[6]=o);let s;return t[7]!==n||t[8]!==r||t[9]!==i.surface||t[10]!==o?(s=(0,Q.jsx)(i8,{layout:n,surfaces:a8,names:a,published:!1,surface:i.surface,onSurface:r,children:o}),t[7]=n,t[8]=r,t[9]=i.surface,t[10]=o,t[11]=s):s=t[11],s}function i8(e){let t=(0,$.c)(19),{layout:n,surfaces:r,names:i,published:a,surface:o,onSurface:s,children:c}=e,{element:l,attach:u}=hH(),d;t[0]===u?d=t[1]:(d=(0,Q.jsx)(`div`,{ref:u,className:`ml-auto flex shrink-0 items-center gap-0.5`}),t[0]=u,t[1]=d);let f=d,p;t[2]!==l||t[3]!==c?(p=c(l),t[2]=l,t[3]=c,t[4]=p):p=t[4];let m=p,h=n===`docked`&&`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-1 duration-150`,g;t[5]===h?g=t[6]:(g=Y(`flex h-full min-h-0 flex-col overflow-hidden rounded-paper bg-card shadow-paper`,h),t[5]=h,t[6]=g);let _;t[7]!==m||t[8]!==n||t[9]!==i||t[10]!==s||t[11]!==a||t[12]!==o||t[13]!==r||t[14]!==f?(_=n===`docked`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-1 border-b pr-2.5 pl-4`,children:[(0,Q.jsx)(fr,{className:`text-ui leading-5 font-semibold`,render:(0,Q.jsx)(`h2`,{}),text:i[o]}),f]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 text-sm`,children:m})]}):(0,Q.jsxs)(Nu,{value:o,onValueChange:e=>{n8(e)&&s(e)},className:`min-h-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-1 border-b px-1.5`,children:[(0,Q.jsx)(kd,{className:`h-8 min-w-0 flex-1`,children:r.map(e=>(0,Q.jsx)(fr,{propagateEscape:!0,text:i[e],renderTrigger:t=>(0,Q.jsxs)(hd,{value:e,className:`min-w-0`,children:[(0,Q.jsx)(s8,{published:a,surface:e,className:`size-3.5 shrink-0`}),t]})},e))}),f]}),(0,Q.jsx)(Vu,{value:o,className:`min-h-0 overflow-hidden`,children:m})]}),t[7]=m,t[8]=n,t[9]=i,t[10]=s,t[11]=a,t[12]=o,t[13]=r,t[14]=f,t[15]=_):_=t[15];let v;return t[16]!==g||t[17]!==_?(v=(0,Q.jsx)(`aside`,{"aria-label":`Review sidebar`,"data-testid":`review-sidebar`,className:g,children:_}),t[16]=g,t[17]=_,t[18]=v):v=t[18],v}var a8=[`files`,`changes`,`history`];function o8(){return zQ}function s8(e){let t=(0,$.c)(7),{published:n,surface:r,className:i}=e;if(r===`files`){let e;return t[0]===i?e=t[1]:(e=(0,Q.jsx)(pg,{className:i}),t[0]=i,t[1]=e),e}if(r===`history`){let e;return t[2]===i?e=t[3]:(e=(0,Q.jsx)(h_,{className:i}),t[2]=i,t[3]=e),e}let a;return t[4]!==i||t[5]!==n?(a=n?(0,Q.jsx)(Lg,{className:i}):(0,Q.jsx)(Zh,{className:i}),t[4]=i,t[5]=n,t[6]=a):a=t[6],a}function c8(e){let t=(0,$.c)(38),{changesNavigation:n,scope:r,context:i,worktreePath:a,surface:o,activeEntry:s,available:c,onOpen:l,onFilesMoved:u,onFilesRemoved:d,sideLabel:f,changes:p,actionsTarget:m}=e;if(!c){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`div`,{className:`p-3`,children:(0,Q.jsx)(vn,{message:`This worktree is unavailable.`})}),t[0]=e):e=t[0],e}let h=`${r.worktreeId}:${o}`,g;t[1]!==n||t[2]!==s||t[3]!==p||t[4]!==i||t[5]!==l||t[6]!==r||t[7]!==f||t[8]!==o?(g=o===`changes`&&(0,Q.jsx)(n,{scope:r,context:i,activeEntry:s,onOpen:l,sideLabel:f,changeScope:p.scope,base:p.base,onChangeScope:p.onScope,onBase:p.onBase}),t[1]=n,t[2]=s,t[3]=p,t[4]=i,t[5]=l,t[6]=r,t[7]=f,t[8]=o,t[9]=g):g=t[9];let _;t[10]!==m||t[11]!==s||t[12]!==i||t[13]!==u||t[14]!==d||t[15]!==l||t[16]!==r||t[17]!==f||t[18]!==o||t[19]!==a?(_=o===`files`&&(0,Q.jsx)(yq,{scope:r,context:i,worktreePath:a,selected:s?.startsWith(`file:`)?s.slice(5):``,onOpen:l,onMoved:u,onTrashed:d,sideLabel:f,actionsTarget:m}),t[10]=m,t[11]=s,t[12]=i,t[13]=u,t[14]=d,t[15]=l,t[16]=r,t[17]=f,t[18]=o,t[19]=a,t[20]=_):_=t[20];let v;t[21]!==s||t[22]!==i.connection||t[23]!==l||t[24]!==r||t[25]!==f||t[26]!==o?(v=o===`history`&&(0,Q.jsx)(bZ,{scope:r,connection:i.connection,selected:s?.startsWith(`commit:`)?s.slice(7):``,onSelect:(e,t)=>l({kind:`commit`,oid:e},{toSide:t===!0,preserveFocus:!0}),sideLabel:f,onOpenGraph:()=>l({kind:`graph`}),onOpenChanges:()=>l(OQ)}),t[21]=s,t[22]=i.connection,t[23]=l,t[24]=r,t[25]=f,t[26]=o,t[27]=v):v=t[27];let y;t[28]!==i.connection||t[29]!==r||t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==v?(y=(0,Q.jsxs)(Z6,{connection:i.connection,scope:r,quiet:!0,children:[g,_,v]},h),t[28]=i.connection,t[29]=r,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y):y=t[34];let b=y,x;return t[35]!==b||t[36]!==o?(x=o===`changes`?(0,Q.jsx)(JV,{className:`h-full`,children:b}):(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:b}),t[35]=b,t[36]=o,t[37]=x):x=t[37],x}var l8={files:ou.surfaceFiles,changes:ou.surfaceChanges,history:ou.surfaceHistory};function u8(e){let t=(0,$.c)(32),{surfaces:n,names:r,published:i,surface:a,open:o,onSelect:s,onHide:c,onToggle:l,toggleRef:u}=e,d=o?`Hide side panel`:`Show side panel`,f;if(t[0]!==r||t[1]!==c||t[2]!==s||t[3]!==o||t[4]!==i||t[5]!==a||t[6]!==n){let e;t[8]!==r||t[9]!==c||t[10]!==s||t[11]!==o||t[12]!==i||t[13]!==a?(e=e=>{let t=o&&a===e;return(0,Q.jsx)(`span`,{"data-selected":t||void 0,className:`workspace-choice inline-flex rounded-lg data-selected:text-foreground`,children:(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":r[e],"aria-pressed":t,"aria-keyshortcuts":l8[e],onClick:()=>t?c():s(e)}),children:(0,Q.jsx)(s8,{published:i,surface:e})}),(0,Q.jsxs)(Yo,{side:`left`,children:[r[e],` `,(0,Q.jsx)(pH,{children:Ad(l8[e])})]})]})},e)},t[8]=r,t[9]=c,t[10]=s,t[11]=o,t[12]=i,t[13]=a,t[14]=e):e=t[14],f=n.map(e),t[0]=r,t[1]=c,t[2]=s,t[3]=o,t[4]=i,t[5]=a,t[6]=n,t[7]=f}else f=t[7];let p;t[15]!==l||t[16]!==o||t[17]!==d||t[18]!==u?(p=(0,Q.jsx)(X,{ref:u,variant:`ghost`,size:`icon`,className:`mt-auto`,"aria-label":d,"aria-expanded":o,"aria-keyshortcuts":ou.toggleSidebar,onClick:l}),t[15]=l,t[16]=o,t[17]=d,t[18]=u,t[19]=p):p=t[19];let m;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(a_,{}),t[20]=m):m=t[20];let h;t[21]===p?h=t[22]:(h=(0,Q.jsx)(Ze,{render:p,children:m}),t[21]=p,t[22]=h);let g;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(pH,{children:Ad(ou.toggleSidebar)}),t[23]=g):g=t[23];let _;t[24]===d?_=t[25]:(_=(0,Q.jsxs)(Yo,{side:`left`,children:[d,` `,g]}),t[24]=d,t[25]=_);let v;t[26]!==h||t[27]!==_?(v=(0,Q.jsxs)(ot,{children:[h,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;return t[29]!==f||t[30]!==v?(y=(0,Q.jsxs)(`nav`,{"aria-label":`Side panel`,className:`flex w-11 shrink-0 flex-col items-center gap-1 pt-2.5 pb-2 pl-1 text-muted-foreground`,children:[f,v]}),t[29]=f,t[30]=v,t[31]=y):y=t[31],y}function d8(e){let t=(0,$.c)(199),{worktree:n,projectId:r,search:i,onSearch:a,context:o,navigationTrigger:s,review:c,changesNavigation:l,walkthroughCode:u,firstDocument:d}=e,{open:f,setOpen:p}=R$(),[m,h]=eY(n.id),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!0),[b,x]=(0,Z.useState)(g);g!==b&&(x(g),g&&y(!0));let S=TQ(),[C,w]=(0,Z.useState)(S);C!==S&&(w(S),S&&g&&(p(!0),_(!1)));let T=hH(),E=hH(),D=hH(),{isMobile:O,open:k,openMobile:A}=BH(),j=i.surface??(d.guided?`changes`:`files`),M;t[0]!==r||t[1]!==n.id?(M={projectId:r,worktreeId:n.id},t[0]=r,t[1]=n.id,t[2]=M):M=t[2];let N=M,{saved:P,focused:F,setFocused:I}=E$(n.id),L=iB(N,o.connection),R=vB(d.guided&&i.scope===void 0?N:void 0,o.connection,i.base).result,z=de(qr(R))?.files.length===0&&(de(qr(L))?.changes.length??0)>0,B;t[3]===L?B=t[4]:(B=m8(L),t[3]=L,t[4]=B);let V=B,H;t[5]!==P||t[6]!==i.entry||t[7]!==i.side?(H=!P&&!FQ(i.entry)&&!FQ(i.side),t[5]=P,t[6]=i.entry,t[7]=i.side,t[8]=H):H=t[8];let U=H,W=!U||!V&&!d.pending,G=d.guided||Mi(L)&&Fe(qr(L))||(de(qr(L))?.changes.length??0)>0?UQ:null,K=g&&!S,q;t[9]!==G||t[10]!==F||t[11]!==D.element||t[12]!==a||t[13]!==W||t[14]!==i.entry||t[15]!==i.side||t[16]!==I||t[17]!==K||t[18]!==n.id?(q={worktreeId:n.id,entry:i.entry,side:i.side,onSearch:a,fallback:G,focused:F,setFocused:I,ready:W,focusBoundary:D.element,focusBoundaryOpen:K},t[9]=G,t[10]=F,t[11]=D.element,t[12]=a,t[13]=W,t[14]=i.entry,t[15]=i.side,t[16]=I,t[17]=K,t[18]=n.id,t[19]=q):q=t[19];let J=J$(q),ee;t[20]!==F||t[21]!==J.split?(ee=u$(_8(J.split,F)),t[20]=F,t[21]=J.split,t[22]=ee):ee=t[22];let te=ee,ne;t[23]!==f||t[24]!==T||t[25]!==p?(ne=()=>{f&&T.element?.focus(),p(p8)},t[23]=f,t[24]=T,t[25]=p,t[26]=ne):ne=t[26];let re=ne,ie;t[27]!==S||t[28]!==re?(ie=()=>{S?re():_(f8)},t[27]=S,t[28]=re,t[29]=ie):ie=t[29];let ae;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ae={ignoreInputs:!0},t[30]=ae):ae=t[30],Hu(ou.toggleSidebar,ie,ae);let[oe,se]=(0,Z.useState)(),ce;t[31]!==S||t[32]!==F||t[33]!==J?(ce=(e,t)=>{let n=PQ(e),r=+(F===0),i=t?.toSide?r:J.open(F,n,t?.preserveFocus===!0&&S);se(t?.path?{path:t.path,entry:t.entry,lines:t.lines,nonce:Date.now(),pane:i,key:n}:void 0),t?.toSide&&J.openToSide(F,n),y(!1),_(!1)},t[31]=S,t[32]=F,t[33]=J,t[34]=ce):ce=t[34];let le=ce,ue;t[35]===a?ue=t[36]:(ue=e=>{a({surface:e})},t[35]=a,t[36]=ue);let fe=ue,pe;t[37]!==S||t[38]!==p||t[39]!==fe?(pe=e=>{fe(e),S?p(!0):_(!0)},t[37]=S,t[38]=p,t[39]=fe,t[40]=pe):pe=t[40];let me=pe,he;t[41]===me?he=t[42]:(he=()=>me(`changes`),t[41]=me,t[42]=he);let ge;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ge={ignoreInputs:!0},t[43]=ge):ge=t[43],Hu(ou.surfaceChanges,he,ge);let _e;t[44]===me?_e=t[45]:(_e=()=>me(`files`),t[44]=me,t[45]=_e);let ve;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ve={ignoreInputs:!0},t[46]=ve):ve=t[46],Hu(ou.surfaceFiles,_e,ve);let ye;t[47]===me?ye=t[48]:(ye=()=>me(`history`),t[47]=me,t[48]=ye);let be;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(be={ignoreInputs:!0},t[49]=be):be=t[49],Hu(ou.surfaceHistory,ye,be);let xe=hH(),Se;t[50]!==xe||t[51]!==me?(Se=(e,t)=>{xe.attach(t),me(e)},t[50]=xe,t[51]=me,t[52]=Se):Se=t[52];let Ce=Se,we=i.scope??(d.guided&&!z?`branch`:`uncommitted`),Te=S&&f&&j===`changes`&&we===`branch`,Ee,De;t[53]===a?(Ee=t[54],De=t[55]):(Ee=e=>a({scope:e}),De=e=>a({base:e}),t[53]=a,t[54]=Ee,t[55]=De);let Oe,ke,Ae,je,Me,Ne,Pe,Ie,Le,Re,ze,Be,Ve,He;if(t[56]!==Ce||t[57]!==xe||t[58]!==we||t[59]!==l||t[60]!==m||t[61]!==o||t[62]!==S||t[63]!==oe||t[64]!==d||t[65]!==F||t[66]!==J||t[67]!==g||t[68]!==D||t[69]!==E||t[70]!==s||t[71]!==O||t[72]!==k||t[73]!==A||t[74]!==U||t[75]!==a||t[76]!==le||t[77]!==L||t[78]!==f||t[79]!==T||t[80]!==c||t[81]!==N||t[82]!==i.base||t[83]!==h||t[84]!==p||t[85]!==fe||t[86]!==v||t[87]!==me||t[88]!==te||t[89]!==j||t[90]!==Te||t[91]!==Ee||t[92]!==De||t[93]!==re||t[94]!==u||t[95]!==n.available||t[96]!==n.branch||t[97]!==n.path){let e={scope:we,baseInPanel:Te,onScope:Ee,onBase:De},r=J.panes[F]?.active??void 0,y=t=>(0,Q.jsx)(r8,{changesNavigation:l,layout:t,scope:N,context:o,worktreePath:n.path,surface:j,activeEntry:r,available:n.available,onSurface:fe,onOpen:le,onFilesMoved:(e,t)=>J.moveFiles(e,t),onFilesRemoved:e=>J.closeRemovedFiles(e),sideLabel:te,changes:{...e,base:i.base,onBase:e=>a({base:e})}}),b;t[112]!==xe||t[113]!==o||t[114]!==S||t[115]!==J||t[116]!==g||t[117]!==E||t[118]!==N?(b=e=>(0,Q.jsxs)(`div`,{"data-review-controls":``,className:`contents`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-5 w-px bg-border`}),(0,Q.jsx)(bQ,{scope:N,context:o}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(X,{variant:`ghost`,size:`icon-sm`,ref:e=>E.attach(e),className:`xl:hidden`,"aria-label":`Side panel`,"aria-haspopup":`dialog`,"aria-expanded":g&&!S,"aria-keyshortcuts":ou.toggleSidebar,onClick:()=>{xe.attach(null),J.selectPane(e),_(!0)},children:(0,Q.jsx)(a_,{})})}),(0,Q.jsxs)(Yo,{role:`tooltip`,className:`break-all`,children:[`Side panel `,(0,Q.jsx)(pH,{children:Ad(ou.toggleSidebar)})]})]})]}),t[112]=xe,t[113]=o,t[114]=S,t[115]=J,t[116]=g,t[117]=E,t[118]=N,t[119]=b):b=t[119];let x=b,C=i.base,w;t[120]===le?w=t[121]:(w=NQ(le),t[120]=le,t[121]=w);let M;t[122]!==o||t[123]!==N||t[124]!==i.base||t[125]!==w?(M={scope:N,context:o,base:C,jump:w},t[122]=o,t[123]=N,t[124]=i.base,t[125]=w,t[126]=M):M=t[126],t[127]!==m||t[128]!==h||t[129]!==M?(Be=(0,Q.jsx)(TY,{owner:M,open:m,onOpenChange:h}),t[127]=m,t[128]=h,t[129]=M,t[130]=Be):Be=t[130];let P;t[131]===le?P=t[132]:(P=e=>le({kind:`file`,path:e}),t[131]=le,t[132]=P),t[133]!==o.connection||t[134]!==J.bindQuickOpen||t[135]!==J.recentFiles||t[136]!==N||t[137]!==P?(Ve=(0,Q.jsx)(Kq,{bindPopup:J.bindQuickOpen,openFiles:J.recentFiles,scope:N,connection:o.connection,onOpen:P}),t[133]=o.connection,t[134]=J.bindQuickOpen,t[135]=J.recentFiles,t[136]=N,t[137]=P,t[138]=Ve):Ve=t[138];let I=O?0:480,R;t[139]!==o||t[140]!==N?(R=(0,Q.jsx)(zY,{scope:N,context:o}),t[139]=o,t[140]=N,t[141]=R):R=t[141];let z;t[142]!==o||t[143]!==le||t[144]!==N?(z=(0,Q.jsx)(BY,{scope:N,context:o,onOpen:le}),t[142]=o,t[143]=le,t[144]=N,t[145]=z):z=t[145];let B;t[146]===n.branch?B=t[147]:(B=yt(n.branch),t[146]=n.branch,t[147]=B);let V=(0,Q.jsxs)(`section`,{"aria-label":`Review content`,className:`flex h-full min-w-0 flex-col overflow-hidden rounded-paper border bg-card max-md:rounded-none max-md:border-0`,children:[R,z,(0,Q.jsx)(h8,{worktreeName:B,review:c,walkthroughCode:u,firstDocument:d,changesNavigation:l,fileTarget:oe,scope:N,context:o,overview:L,needsDefault:U,layout:J,base:i.base,changes:e,focused:F,onOpen:le,onBrowse:Ce,navigationTrigger:s,navigatorIsMobile:O,navigatorOpen:k,navigatorOpenMobile:A,tabControls:x})]}),H;t[148]!==I||t[149]!==V?(H=(0,Q.jsx)(PK,{id:`review-document`,minSize:I,children:V}),t[148]=I,t[149]=V,t[150]=H):H=t[150];let W=f&&S&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(FK,{"aria-label":`Document panes and side panel`,className:`w-2 bg-transparent after:w-2`}),(0,Q.jsx)(PK,{id:`review-sidebar`,defaultSize:320,minSize:260,maxSize:520,children:y(`docked`)})]}),G;t[151]!==H||t[152]!==W?(G=(0,Q.jsxs)(NK,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[H,W]}),t[151]=H,t[152]=W,t[153]=G):G=t[153];let K;t[154]!==S||t[155]!==f||t[156]!==T||t[157]!==p||t[158]!==me||t[159]!==j||t[160]!==re?(K=S&&(0,Q.jsx)(u8,{surfaces:a8,names:o8(),published:!1,surface:j,open:f,onSelect:me,onHide:()=>p(!1),onToggle:re,toggleRef:e=>T.attach(e)}),t[154]=S,t[155]=f,t[156]=T,t[157]=p,t[158]=me,t[159]=j,t[160]=re,t[161]=K):K=t[161],t[162]!==G||t[163]!==K?(He=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[G,K]}),t[162]=G,t[163]=K,t[164]=He):He=t[164],ke=EH,Le=g&&!S,Re=_,t[165]!==xe.element||t[166]!==J||t[167]!==E.element||t[168]!==v?(ze=e=>{e||(J.focusDestination(),!v&&!J.hasDestinationFocus()&&document.activeElement===document.body&&(xe.element?.isConnected?xe.element:E.element)?.focus())},t[165]=xe.element,t[166]=J,t[167]=E.element,t[168]=v,t[169]=ze):ze=t[169],Oe=OH,t[170]!==J||t[171]!==D?(Ae=e=>{D.attach(e),e===null&&J.focusDestination()},t[170]=J,t[171]=D,t[172]=Ae):Ae=t[172],t[173]!==xe.element||t[174]!==J||t[175]!==D.element||t[176]!==E.element||t[177]!==v?(je=v?()=>{if(J.hasDestinationFocus())return null;let e=document.activeElement;return e===document.body||D.element?.contains(e)?xe.element?.isConnected?xe.element:E.element:null}:`none`,t[173]=xe.element,t[174]=J,t[175]=D.element,t[176]=E.element,t[177]=v,t[178]=je):je=t[178],Me=`w-[min(90vw,22rem)]!`,Ne=!1,t[179]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Q.jsxs)(kH,{className:`sr-only`,children:[(0,Q.jsx)(AH,{children:`Worktree review`}),(0,Q.jsx)(jH,{children:`Choose a review surface and open a document.`})]}),t[179]=Pe):Pe=t[179],Ie=!S&&y(`sheet`),t[56]=Ce,t[57]=xe,t[58]=we,t[59]=l,t[60]=m,t[61]=o,t[62]=S,t[63]=oe,t[64]=d,t[65]=F,t[66]=J,t[67]=g,t[68]=D,t[69]=E,t[70]=s,t[71]=O,t[72]=k,t[73]=A,t[74]=U,t[75]=a,t[76]=le,t[77]=L,t[78]=f,t[79]=T,t[80]=c,t[81]=N,t[82]=i.base,t[83]=h,t[84]=p,t[85]=fe,t[86]=v,t[87]=me,t[88]=te,t[89]=j,t[90]=Te,t[91]=Ee,t[92]=De,t[93]=re,t[94]=u,t[95]=n.available,t[96]=n.branch,t[97]=n.path,t[98]=Oe,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne,t[104]=Pe,t[105]=Ie,t[106]=Le,t[107]=Re,t[108]=ze,t[109]=Be,t[110]=Ve,t[111]=He}else Oe=t[98],ke=t[99],Ae=t[100],je=t[101],Me=t[102],Ne=t[103],Pe=t[104],Ie=t[105],Le=t[106],Re=t[107],ze=t[108],Be=t[109],Ve=t[110],He=t[111];let Ue;t[180]!==Oe||t[181]!==Ae||t[182]!==je||t[183]!==Me||t[184]!==Ne||t[185]!==Pe||t[186]!==Ie?(Ue=(0,Q.jsxs)(Oe,{ref:Ae,finalFocus:je,className:Me,showCloseButton:Ne,children:[Pe,Ie]}),t[180]=Oe,t[181]=Ae,t[182]=je,t[183]=Me,t[184]=Ne,t[185]=Pe,t[186]=Ie,t[187]=Ue):Ue=t[187];let We;t[188]!==ke||t[189]!==Le||t[190]!==Re||t[191]!==ze||t[192]!==Ue?(We=(0,Q.jsx)(ke,{open:Le,onOpenChange:Re,onOpenChangeComplete:ze,children:Ue}),t[188]=ke,t[189]=Le,t[190]=Re,t[191]=ze,t[192]=Ue,t[193]=We):We=t[193];let Ge;return t[194]!==Be||t[195]!==Ve||t[196]!==He||t[197]!==We?(Ge=(0,Q.jsxs)(Q.Fragment,{children:[Be,Ve,He,We]}),t[194]=Be,t[195]=Ve,t[196]=He,t[197]=We,t[198]=Ge):Ge=t[198],Ge}function f8(e){return!e}function p8(e){return!e}function m8(e){return Fe(qr(e))&&!Mi(e)}function h8(e){let t=(0,$.c)(3),n=m8(e.overview);if(e.needsDefault&&(n||e.firstDocument.pending)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(kc,{label:`Loading review`}),t[0]=e):e=t[0],e}let r;return t[1]===e?r=t[2]:(r=(0,Q.jsx)(g8,{...e}),t[1]=e,t[2]=r),r}function g8(e){let t=(0,$.c)(52),{review:n,changesNavigation:r,walkthroughCode:i,firstDocument:a,layout:o,fileTarget:s,scope:c,context:l,base:u,changes:d,focused:f,onOpen:p,onBrowse:m,navigationTrigger:h,navigatorIsMobile:g,navigatorOpen:_,navigatorOpenMobile:v,worktreeName:y,tabControls:b}=e,x;t[0]!==f||t[1]!==o.panes?(x=o.panes[f]??{tabs:[],pinned:[],active:null},t[0]=f,t[1]=o.panes,t[2]=x):x=t[2];let S=x,C=BR()&&(o.split||f===0),w;t[3]===C?w=t[4]:(w={ignoreInputs:!0,enabled:C},t[3]=C,t[4]=w);let T=w,E;t[5]!==f||t[6]!==o?(E=()=>o.step(f,1),t[5]=f,t[6]=o,t[7]=E):E=t[7],Hu(ou.nextTab,E,T);let D;t[8]!==f||t[9]!==o?(D=()=>o.step(f,-1),t[8]=f,t[9]=o,t[10]=D):D=t[10],Hu(ou.previousTab,D,T);let O;t[11]!==f||t[12]!==S.active||t[13]!==o?(O=()=>S.active!==null&&S.active!==void 0&&o.close(f,S.active),t[11]=f,t[12]=S.active,t[13]=o,t[14]=O):O=t[14],Hu(ou.closeTab,O,T);let k;t[15]!==f||t[16]!==S.active||t[17]!==o?(k=()=>S.active!==null&&S.active!==void 0&&o.openToSide(f,S.active),t[15]=f,t[16]=S.active,t[17]=o,t[18]=k):k=t[18],Hu(ou.openToSide,k,T);let A;t[19]!==u||t[20]!==d||t[21]!==r||t[22]!==l||t[23]!==s||t[24]!==a||t[25]!==f||t[26]!==o||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==m||t[32]!==p||t[33]!==n||t[34]!==c||t[35]!==b||t[36]!==i||t[37]!==y?(A=e=>({review:n,changesNavigation:r,walkthroughCode:i,firstDocument:a,fileTarget:s,index:e,layout:o,split:o.split,focused:f===e,scope:c,context:l,base:u,changes:d,onOpen:p,onBrowse:m,navigationTrigger:h,navigatorIsMobile:g,navigatorOpen:_,navigatorOpenMobile:v,worktreeName:y,tabControls:b}),t[19]=u,t[20]=d,t[21]=r,t[22]=l,t[23]=s,t[24]=a,t[25]=f,t[26]=o,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=m,t[32]=p,t[33]=n,t[34]=c,t[35]=b,t[36]=i,t[37]=y,t[38]=A):A=t[38];let j=A,M=g?`vertical`:`horizontal`,N=g?200:320,P;t[39]===j?P=t[40]:(P=(0,Q.jsx)(v8,{...j(0)}),t[39]=j,t[40]=P);let F;t[41]!==N||t[42]!==P?(F=(0,Q.jsx)(PK,{id:`pane-left`,minSize:N,children:P}),t[41]=N,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==o.split||t[45]!==g||t[46]!==j?(I=o.split&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(FK,{"aria-label":g?`Top and bottom document panes`:`Left and right document panes`,withHandle:!0}),(0,Q.jsx)(PK,{id:`pane-right`,minSize:g?200:320,children:(0,Q.jsx)(v8,{...j(1)})})]}),t[44]=o.split,t[45]=g,t[46]=j,t[47]=I):I=t[47];let L;return t[48]!==F||t[49]!==I||t[50]!==M?(L=(0,Q.jsxs)(NK,{orientation:M,className:`min-h-0 flex-1`,children:[F,I]}),t[48]=F,t[49]=I,t[50]=M,t[51]=L):L=t[51],L}function _8(e,t){return e?t===0?`left`:`right`:null}function v8(e){let t=(0,$.c)(102),{review:n,walkthroughCode:r,firstDocument:i,fileTarget:a,index:o,layout:s,split:c,focused:l,scope:u,context:d,base:f,changes:p,onOpen:m,onBrowse:h,navigationTrigger:g,navigatorIsMobile:_,navigatorOpen:v,navigatorOpenMobile:y,worktreeName:b,tabControls:x}=e,{element:S,attach:C}=hH(),w;t[0]!==o||t[1]!==s.panes?(w=s.panes[o]??{tabs:[],pinned:[],active:null},t[0]=o,t[1]=s.panes,t[2]=w):w=t[2];let T=w,E=(0,Z.useDeferredValue)(T.active),D=FQ(T.active??void 0),O;t[3]!==E||t[4]!==T.active||t[5]!==T.tabs||t[6]!==D?.kind?(O=D?.kind!==`file`&&D?.kind!==`change`&&T.tabs.includes(E??``)?E:T.active,t[3]=E,t[4]=T.active,t[5]=T.tabs,t[6]=D?.kind,t[7]=O):O=t[7];let k=O,A=k!==T.active,j=(0,Z.useId)(),[M,N]=(0,Z.useState)(!1);!M&&k===`review`&&N(!0);let P=k??void 0,F;t[8]===P?F=t[9]:(F=FQ(P),t[8]=P,t[9]=F);let I=F,L;t[10]!==o||t[11]!==s?(L=e=>{let t=e.target;t instanceof Element&&e.currentTarget.contains(t)&&t.closest(`[data-review-controls]`)===null&&(e.type===`pointerdown`?s.selectPane(o):s.focusPane(o,t))},t[10]=o,t[11]=s,t[12]=L):L=t[12];let R=L,z;t[13]!==o||t[14]!==s?(z=e=>s.bindPane(o,e),t[13]=o,t[14]=s,t[15]=z):z=t[15];let B=c?`${o===0?`Left`:`Right`} pane`:void 0,V=c&&o===1&&`border-l`,H=o===1&&`motion-safe:animate-in motion-safe:fade-in-0 duration-150`,U;t[16]!==V||t[17]!==H?(U=Y(`@container/pane relative flex h-full min-h-0 min-w-0 flex-col`,V,H),t[16]=V,t[17]=H,t[18]=U):U=t[18];let W;t[19]===j?W=t[20]:(W=e=>GQ(j,e),t[19]=j,t[20]=W);let G;t[21]!==d.connection||t[22]!==u?(G={connection:d.connection,scope:u},t[21]=d.connection,t[22]=u,t[23]=G):G=t[23];let K;t[24]!==o||t[25]!==g||t[26]!==_||t[27]!==v||t[28]!==y||t[29]!==T.tabs||t[30]!==b?(K=o===0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(Ze,{render:(0,Q.jsx)(UH,{ref:e=>g.attach(e),"aria-label":`Toggle Sidebar`,"aria-expanded":_?y:v,"aria-keyshortcuts":or()===`mac`?`Meta+B`:`Control+B`,onClick:()=>{!_&&v&&requestAnimationFrame(()=>g.element?.focus())}})}),(0,Q.jsxs)(Yo,{role:`tooltip`,className:`break-all`,children:[`Toggle Sidebar`,` `,(0,Q.jsx)(pH,{children:Ad(ou.toggleNavigator)})]})]}),_&&T.tabs.length<=1&&(0,Q.jsx)(fr,{className:`ml-1 max-w-32 min-w-0 font-mono text-caption text-foreground-2`,text:b})]}):void 0,t[24]=o,t[25]=g,t[26]=_,t[27]=v,t[28]=y,t[29]=T.tabs,t[30]=b,t[31]=K):K=t[31];let q=T.tabs,J=T.pinned,ee;t[32]!==o||t[33]!==c?(ee=_8(c,o),t[32]=o,t[33]=c,t[34]=ee):ee=t[34];let te;t[35]!==o||t[36]!==s?(te=e1(s,o),t[35]=o,t[36]=s,t[37]=te):te=t[37];let ne;t[38]!==I?.kind||t[39]!==f||t[40]!==p||t[41]!==d.connection||t[42]!==i||t[43]!==u?(ne=I?.kind===`branch`&&!i.guided&&!p.baseInPanel&&(0,Q.jsx)(G6,{scope:u,connection:d.connection,base:f,onBase:p.onBase,compact:!0}),t[38]=I?.kind,t[39]=f,t[40]=p,t[41]=d.connection,t[42]=i,t[43]=u,t[44]=ne):ne=t[44];let re;t[45]!==C||t[46]!==ne?(re=(0,Q.jsx)(`div`,{ref:C,"data-pane-controls":``,role:`toolbar`,"aria-label":`Document controls`,className:`flex items-center gap-1 empty:hidden`,children:ne}),t[45]=C,t[46]=ne,t[47]=re):re=t[47];let ie;t[48]!==o||t[49]!==c||t[50]!==x?(ie=(!c||o===1)&&x(o),t[48]=o,t[49]=c,t[50]=x,t[51]=ie):ie=t[51];let ae;t[52]!==re||t[53]!==ie?(ae=(0,Q.jsxs)(Q.Fragment,{children:[re,ie]}),t[52]=re,t[53]=ie,t[54]=ae):ae=t[54];let oe;t[55]!==T.pinned||t[56]!==T.tabs||t[57]!==k||t[58]!==W||t[59]!==G||t[60]!==K||t[61]!==ee||t[62]!==te||t[63]!==ae?(oe=(0,Q.jsx)(r1,{ids:W,commitContext:G,leading:K,tabs:q,pinned:J,active:k,side:ee,...te,trailing:ae}),t[55]=T.pinned,t[56]=T.tabs,t[57]=k,t[58]=W,t[59]=G,t[60]=K,t[61]=ee,t[62]=te,t[63]=ae,t[64]=oe):oe=t[64];let se;t[65]!==I?.kind||t[66]!==f||t[67]!==p||t[68]!==d.connection||t[69]!==i||t[70]!==u?(se=I?.kind===`branch-file`&&!i.guided&&!p.baseInPanel&&(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Branch comparison`,className:`flex items-center gap-2 border-b px-3.5 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{children:`Branch comparison`}),(0,Q.jsx)(G6,{scope:u,connection:d.connection,base:f,onBase:p.onBase,compact:!0})]}),t[65]=I?.kind,t[66]=f,t[67]=p,t[68]=d.connection,t[69]=i,t[70]=u,t[71]=se):se=t[71];let ce;t[72]!==T.tabs||t[73]!==M?(ce=M&&T.tabs.includes(`review`)?UQ:null,t[72]=T.tabs,t[73]=M,t[74]=ce):ce=t[74];let le;t[75]!==f||t[76]!==d||t[77]!==a||t[78]!==l||t[79]!==o||t[80]!==h||t[81]!==m||t[82]!==j||t[83]!==A||t[84]!==n||t[85]!==u||t[86]!==k||t[87]!==c||t[88]!==ce||t[89]!==S||t[90]!==r?(le=[{slot:UQ,entry:ce},{slot:`document`,entry:k===`review`?null:k}].map(e=>{let{slot:t,entry:i}=e,s=FQ(i??void 0),p=s!==null&&i===k,g=i?GQ(j,i):void 0;return(0,Q.jsx)(`div`,{role:s?`tabpanel`:void 0,id:g?.panel,"aria-labelledby":g?.tab,"aria-hidden":!p,inert:!p||A,className:Y(`flex min-h-0 flex-1 flex-col overflow-hidden`,!p&&`pointer-events-none invisible absolute opacity-0 inset-x-0 top-12 bottom-0`),children:(0,Q.jsx)(Z6,{documentKey:i??void 0,connection:d.connection,scope:u,children:s&&(0,Q.jsx)(P6,{review:n,walkthroughCode:r,scope:u,context:d,document:s,sideLabel:u$(_8(c,o)),base:f,onOpen:m,onBrowse:h,active:p&&l&&!A,hidden:!p,toolbarTarget:p&&!A?S:null,fileTarget:p&&a?.pane===o&&a.key===k?a:void 0})})},t)}),t[75]=f,t[76]=d,t[77]=a,t[78]=l,t[79]=o,t[80]=h,t[81]=m,t[82]=j,t[83]=A,t[84]=n,t[85]=u,t[86]=k,t[87]=c,t[88]=ce,t[89]=S,t[90]=r,t[91]=le):le=t[91];let ue;return t[92]!==R||t[93]!==l||t[94]!==A||t[95]!==U||t[96]!==oe||t[97]!==se||t[98]!==le||t[99]!==z||t[100]!==B?(ue=(0,Q.jsxs)(`section`,{ref:z,"aria-label":B,"data-focused":l,"aria-busy":A,onPointerDownCapture:R,onFocusCapture:R,className:U,children:[oe,se,le]}),t[92]=R,t[93]=l,t[94]=A,t[95]=U,t[96]=oe,t[97]=se,t[98]=le,t[99]=z,t[100]=B,t[101]=ue):ue=t[101],ue}var y8=`flex h-7 w-full min-w-0 items-center gap-1.5 rounded-md px-2 text-left text-caption transition-colors outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/60 aria-pressed:bg-selection aria-pressed:font-medium aria-pressed:text-foreground`;function b8(e){let t=(0,$.c)(41),{path:n,document:r,note:i,scopes:a,changeStatus:o,reviewStatus:s,active:c,current:l,onOpen:u,sideLabel:d,onReview:f,canReview:p,writeBlock:m,onDiscard:h,indented:g,commentCount:_,onComment:v,trailing:y,tick:b}=e,x=l!==void 0&&l,S=g!==void 0&&g,C=_===void 0?0:_,w=b!==void 0&&b,T;t[0]===n?T=t[1]:(T=dy(n),t[0]=n,t[1]=T);let E;t[2]===a?E=t[3]:(E=a.length>0?` · ${a.join(` + `)}`:``,t[2]=a,t[3]=E);let D=`${T}${E}`,O;t[4]!==r||t[5]!==v||t[6]!==h||t[7]!==u||t[8]!==f||t[9]!==n?(O=e=>{bb22:switch(e){case`review`:f();break bb22;case`open`:u(r);break bb22;case`open-to-side`:u(r,{toSide:!0});break bb22;case`open-file`:u({kind:`file`,path:n});break bb22;case`timeline`:u({kind:`timeline`,path:n});break bb22;case`copy-relative`:Zt(n,`relative path`);break bb22;case`discard`:h?.();break bb22;case`comment`:v?.(!0)}},t[4]=r,t[5]=v,t[6]=h,t[7]=u,t[8]=f,t[9]=n,t[10]=O):O=t[10];let k=O,A=`Actions for ${n}`,j=h!==void 0,M=v!==void 0,N;t[11]!==p||t[12]!==s||t[13]!==d||t[14]!==M||t[15]!==j?(N=My({kind:`file`,status:s,canReview:p,sideLabel:d,canDiscard:j,canComment:M}),t[11]=p,t[12]=s,t[13]=d,t[14]=M,t[15]=j,t[16]=N):N=t[16];let P;t[17]!==c||t[18]!==p||t[19]!==o||t[20]!==C||t[21]!==x||t[22]!==r||t[23]!==S||t[24]!==D||t[25]!==i||t[26]!==v||t[27]!==u||t[28]!==f||t[29]!==n||t[30]!==s||t[31]!==w||t[32]!==y||t[33]!==m?(P=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsxs)(`button`,{type:`button`,ref:e=>{e&&(!c&&!x?delete e.dataset.revealed:e.dataset.revealed===void 0&&(e.dataset.revealed=``,e.scrollIntoView({block:`nearest`})))},"aria-pressed":c,"aria-current":x?`location`:void 0,"aria-label":D,"aria-description":C8(o,s),title:i==null?n:`${n}\n${i}`,className:Y(y8,`flex-1 text-muted-foreground`,S&&`pl-7`,c?`bg-selection font-medium text-foreground`:x&&`bg-accent text-foreground`),onClick:e=>u(r,{toSide:e.altKey}),children:[(0,Q.jsx)(S8,{status:o,reviewStatus:s,tick:w}),(0,Q.jsx)(Gk,{path:n,className:`size-3.5 shrink-0`}),(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:dy(n)}),y]}),C>0&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>v?.(!1),"aria-label":C===1?`1 comment`:`${C} comments`,className:`flex shrink-0 items-center gap-0.5 text-2xs text-muted-foreground tabular-nums`,children:[(0,Q.jsx)($g,{"aria-hidden":!0,className:`size-3`}),C]}),w&&(0,Q.jsx)(x8,{path:n,status:s,canReview:p,writeBlock:m,onReview:f}),e]}),t[17]=c,t[18]=p,t[19]=o,t[20]=C,t[21]=x,t[22]=r,t[23]=S,t[24]=D,t[25]=i,t[26]=v,t[27]=u,t[28]=f,t[29]=n,t[30]=s,t[31]=w,t[32]=y,t[33]=m,t[34]=P):P=t[34];let F;return t[35]!==k||t[36]!==N||t[37]!==P||t[38]!==A||t[39]!==m?(F=(0,Q.jsx)(c0,{label:A,actions:N,writeBlock:m,onAction:k,children:P}),t[35]=k,t[36]=N,t[37]=P,t[38]=A,t[39]=m,t[40]=F):F=t[40],F}function x8(e){let t=(0,$.c)(11),{path:n,status:r,canReview:i,writeBlock:a,onReview:o}=e,s=r===`stale`?`Changed since reviewed`:`Mark as reviewed`;i||(s=`This file cannot be marked reviewed`),a&&(s=a);let c=r===`reviewed`,l=`${n} reviewed`,u=!i||!!a,d;t[0]!==s||t[1]!==o||t[2]!==c||t[3]!==l||t[4]!==u?(d=(0,Q.jsx)(Ze,{render:(0,Q.jsx)(OX,{className:`mx-1.5`,checked:c,"aria-label":l,"aria-description":s,disabled:u,onCheckedChange:o})}),t[0]=s,t[1]=o,t[2]=c,t[3]=l,t[4]=u,t[5]=d):d=t[5];let f;t[6]===s?f=t[7]:(f=(0,Q.jsx)(Yo,{role:`tooltip`,children:s}),t[6]=s,t[7]=f);let p;return t[8]!==d||t[9]!==f?(p=(0,Q.jsxs)(ot,{children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10],p}function S8(e){let t=(0,$.c)(12),{status:n,reviewStatus:r,tick:i}=e,a=r??`unreviewed`,o;t[0]!==r||t[1]!==n?(o=C8(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s=o,c;t[3]!==a||t[4]!==n||t[5]!==i?(c=a===`reviewed`&&!i?(0,Q.jsx)(Dn,{"aria-hidden":`true`,className:`size-3 text-add-fg`}):(0,Q.jsx)(`span`,{className:Y(`size-1.5 rounded-full`,n===void 0&&`bg-muted-foreground/60`,(n===`added`||n===`untracked`)&&`bg-graph-2`,n===`modified`&&`bg-graph-4`,n===`deleted`&&`bg-destructive`,n===`renamed`&&`bg-graph-1`)}),t[3]=a,t[4]=n,t[5]=i,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==a||t[9]!==n||t[10]!==c?(l=(0,Q.jsx)(`span`,{role:`img`,"aria-label":s,className:`grid w-3.5 shrink-0 place-items-center`,"data-review-state":a,"data-change-status":n,title:s,children:c}),t[7]=s,t[8]=a,t[9]=n,t[10]=c,t[11]=l):l=t[11],l}function C8(e,t){return`${e===void 0?`Change type unavailable`:vl[e].label} · ${w8(t)}`}function w8(e){return e===`reviewed`?`Reviewed`:e===`stale`?`Changed since review`:`Not reviewed`}function T8(e){let t=(0,$.c)(17),{label:n,active:r,onOpen:i,className:a,plain:o,children:s}=e,c=a===void 0?y8:a;if(o!==void 0&&o){let e;return t[0]!==r||t[1]!==s||t[2]!==c||t[3]!==n||t[4]!==i?(e=(0,Q.jsx)(`div`,{className:`flex min-w-0 items-center`,children:(0,Q.jsx)(`button`,{type:`button`,className:c,"aria-pressed":r,"aria-label":n,onClick:i,children:s})}),t[0]=r,t[1]=s,t[2]=c,t[3]=n,t[4]=i,t[5]=e):e=t[5],e}let l=`Actions for ${n}`,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=My({kind:`section`}),t[6]=u):u=t[6];let d;t[7]!==r||t[8]!==s||t[9]!==c||t[10]!==i?(d=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsx)(`button`,{type:`button`,className:c,"aria-pressed":r,onClick:i,children:s}),e]}),t[7]=r,t[8]=s,t[9]=c,t[10]=i,t[11]=d):d=t[11];let f;return t[12]!==i||t[13]!==l||t[14]!==u||t[15]!==d?(f=(0,Q.jsx)(c0,{label:l,actions:u,onAction:i,children:d}),t[12]=i,t[13]=l,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function E8(e){let t=(0,$.c)(15),{name:n,count:r,expanded:i,onExpanded:a,onAll:o,action:s,children:c}=e,l=i?sc:ci,u;t[0]!==l||t[1]!==r||t[2]!==i||t[3]!==n||t[4]!==a?(u=e=>(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:y8,"aria-label":n,"aria-expanded":i,onClick:()=>a(!i),children:[(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:`${n} · ${Vt(r,`file`)}`}),(0,Q.jsx)(l,{className:`size-3.5 shrink-0`})]}),e]}),t[0]=l,t[1]=r,t[2]=i,t[3]=n,t[4]=a,t[5]=u):u=t[5];let d=u,f;t[6]!==s||t[7]!==n||t[8]!==o||t[9]!==d?(f=s?d(s):(0,Q.jsx)(c0,{label:`Actions for ${n}`,actions:My({kind:`group`}),onAction:e=>o(e===`expand-all`),children:d}),t[6]=s,t[7]=n,t[8]=o,t[9]=d,t[10]=f):f=t[10];let p=i&&c,m;return t[11]!==n||t[12]!==f||t[13]!==p?(m=(0,Q.jsxs)(`section`,{"aria-label":n,className:`mt-3 border-t pt-2`,children:[f,p]}),t[11]=n,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function D8(e){let t=(0,$.c)(14),{reviewed:n,total:r,label:i,scope:a}=e,o;t[0]===i?o=t[1]:(o=i&&(0,Q.jsx)(fr,{className:`min-w-0`,text:i}),t[0]=i,t[1]=o);let s;t[2]===a?s=t[3]:(s=a&&(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:a}),t[2]=a,t[3]=s);let c;t[4]===r?c=t[5]:(c=Vt(r,`file`),t[4]=r,t[5]=c);let l=`${n} of ${c} reviewed`,u;t[6]===l?u=t[7]:(u=(0,Q.jsx)(`span`,{className:`ml-auto shrink-0`,children:l}),t[6]=l,t[7]=u);let d;t[8]!==s||t[9]!==u?(d=(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[s,u]}),t[8]=s,t[9]=u,t[10]=d):d=t[10];let f;return t[11]!==o||t[12]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 px-2 pb-1.5 text-2xs text-muted-foreground tabular-nums`,children:[o,d]}),t[11]=o,t[12]=d,t[13]=f):f=t[13],f}function O8(e){let t=(0,$.c)(17),{label:n,value:r,options:i,onValue:a,className:o}=e,s;t[0]===o?s=t[1]:(s=Y(`shrink-0`,o),t[0]=o,t[1]=s);let c;t[2]!==a||t[3]!==i?(c=e=>{let t=i.find(t=>t.value===e);t&&a(t.value)},t[2]=a,t[3]=i,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i.map(k8),t[5]=i,t[6]=l);let u;t[7]!==n||t[8]!==l?(u=(0,Q.jsx)(kd,{"aria-label":n,className:`w-full`,children:l}),t[7]=n,t[8]=l,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==u||t[12]!==r?(d=(0,Q.jsx)(Nu,{value:r,onValueChange:c,children:u}),t[10]=c,t[11]=u,t[12]=r,t[13]=d):d=t[13];let f;return t[14]!==s||t[15]!==d?(f=(0,Q.jsx)(`div`,{className:s,children:d}),t[14]=s,t[15]=d,t[16]=f):f=t[16],f}function k8(e){return(0,Q.jsx)(hd,{value:e.value,className:`min-w-0`,children:e.label},e.value)}function A8(e){let t=(0,$.c)(16),{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,onBase:c,grouping:l}=e,u;t[0]!==i||t[1]!==r.connection||t[2]!==c||t[3]!==n?(u=(0,Q.jsx)(`div`,{className:`shrink-0 px-2.5 pt-2`,children:(0,Q.jsx)(G6,{scope:n,connection:r.connection,base:i,onBase:c})}),t[0]=i,t[1]=r.connection,t[2]=c,t[3]=n,t[4]=u):u=t[4];let d;t[5]!==a||t[6]!==i||t[7]!==r||t[8]!==l||t[9]!==o||t[10]!==n||t[11]!==s?(d=(0,Q.jsx)(j8,{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,grouping:l}),t[5]=a,t[6]=i,t[7]=r,t[8]=l,t[9]=o,t[10]=n,t[11]=s,t[12]=d):d=t[12];let f;return t[13]!==u||t[14]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u,d]}),t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function j8(e){let t=(0,$.c)(13),{scope:n,context:r,base:i,activeEntry:a,onOpen:o,sideLabel:s,grouping:c}=e,l;t[0]!==a||t[1]!==i||t[2]!==r||t[3]!==c||t[4]!==o||t[5]!==n||t[6]!==s?(l=e=>(0,Q.jsx)(M8,{scope:n,context:r,base:i,branch:e,activeEntry:a,onOpen:o,sideLabel:s,grouping:c}),t[0]=a,t[1]=i,t[2]=r,t[3]=c,t[4]=o,t[5]=n,t[6]=s,t[7]=l):l=t[7];let u;return t[8]!==i||t[9]!==r||t[10]!==n||t[11]!==l?(u=(0,Q.jsx)(p1,{scope:n,context:r,base:i,quiet:!0,children:l}),t[8]=i,t[9]=r,t[10]=n,t[11]=l,t[12]=u):u=t[12],u}function M8(e){let t=(0,$.c)(66),{scope:n,context:r,base:i,branch:a,activeEntry:o,onOpen:s,sideLabel:c,grouping:l}=e,u=Ku(r.connection),d;t[0]===a?d=t[1]:(d=py(a),t[0]=a,t[1]=d);let f=d,p=u1(n,r,f),m;t[2]===s?m=t[3]:(m=NQ(s),t[2]=s,t[3]=m);let h;t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==m?(h={scope:n,context:r,base:i,jump:m},t[4]=i,t[5]=r,t[6]=n,t[7]=m,t[8]=h):h=t[8];let g=mY(h),_=I$(n.worktreeId,o),v=O1(n,r,P8,f);if(a.base===null||a.base===void 0)return null;let y,b,x,S,C,w,T,E,D;if(t[9]!==l||t[10]!==o||t[11]!==i||t[12]!==a.base.ref||t[13]!==a.commits||t[14]!==a.files||t[15]!==a.head.branch||t[16]!==g||t[17]!==r||t[18]!==_||t[19]!==p||t[20]!==s||t[21]!==v||t[22]!==n||t[23]!==c||t[24]!==u){let e=sy(a.files,p),d;t[34]===a.head.branch?d=t[35]:(d=a.head.branch===null||a.head.branch===void 0?`this commit`:Vy(a.head.branch),t[34]=a.head.branch,t[35]=d);let f=d,m;t[36]===a.commits?m=t[37]:(m=Vt(a.commits,`commit`),t[36]=a.commits,t[37]=m);let h=m,O;t[38]!==o||t[39]!==g||t[40]!==_||t[41]!==s||t[42]!==v||t[43]!==c?(O=(e,t)=>(0,Z.createElement)(b8,{...t,key:e.path,path:e.path,document:{kind:`branch-file`,path:e.path},note:e.status,changeStatus:Sl(e),scopes:[e.status],reviewStatus:e.reviewStatus,active:o===PQ({kind:`branch-file`,path:e.path}),current:_===e.path,onOpen:s,sideLabel:c,writeBlock:v.writeBlock,commentCount:g.counts.get(e.path),onComment:t=>g.comment(e.path,t),canReview:e.fingerprint!==null&&e.fingerprint!==void 0,onReview:()=>v.toggle({path:e.path,reviewed:e.reviewStatus===`reviewed`,fingerprint:e.fingerprint})}),t[38]=o,t[39]=g,t[40]=_,t[41]=s,t[42]=v,t[43]=c,t[44]=O):O=t[44];let k=O;b=g.summary,x=g.dialogs,y=JV,D=`h-0 min-h-0 flex-1`,S=`px-2.5 pt-2 pb-3`;let A=e.filter(N8).length,j=e.length,M;t[45]===a.base.ref?M=t[46]:(M=Vy(a.base.ref),t[45]=a.base.ref,t[46]=M),C=(0,Q.jsx)(D8,{reviewed:A,total:j,label:`${h} on ${f} since ${M}`,scope:`Committed files only`});let N;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(N=PQ(AQ),t[47]=N):N=t[47];let P;t[48]===s?P=t[49]:(P=()=>s(AQ),t[48]=s,t[49]=P);let F,I;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(_g,{className:`size-3.5 shrink-0 text-muted-foreground`}),I=(0,Q.jsx)(fr,{className:`min-w-0 flex-1`,text:`All branch changes`}),t[50]=F,t[51]=I):(F=t[50],I=t[51]),w=(0,Q.jsxs)(T8,{label:`All branch changes`,active:o===N,onOpen:P,plain:l!==void 0,children:[F,I,(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:e.length})]}),T=e.length===0&&(0,Q.jsxs)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:[`No changes since `,Vy(a.base.ref)]}),E=l?(0,Q.jsx)(l,{scope:n,context:r,base:i,items:e,row:k,activeEntry:o,onOpen:s}):Ay(e,u).map(e=>k(e)),t[9]=l,t[10]=o,t[11]=i,t[12]=a.base.ref,t[13]=a.commits,t[14]=a.files,t[15]=a.head.branch,t[16]=g,t[17]=r,t[18]=_,t[19]=p,t[20]=s,t[21]=v,t[22]=n,t[23]=c,t[24]=u,t[25]=y,t[26]=b,t[27]=x,t[28]=S,t[29]=C,t[30]=w,t[31]=T,t[32]=E,t[33]=D}else y=t[25],b=t[26],x=t[27],S=t[28],C=t[29],w=t[30],T=t[31],E=t[32],D=t[33];let O;t[52]!==S||t[53]!==C||t[54]!==w||t[55]!==T||t[56]!==E?(O=(0,Q.jsxs)(`div`,{className:S,children:[C,w,T,E]}),t[52]=S,t[53]=C,t[54]=w,t[55]=T,t[56]=E,t[57]=O):O=t[57];let k;t[58]!==y||t[59]!==O||t[60]!==D?(k=(0,Q.jsx)(y,{className:D,children:O}),t[58]=y,t[59]=O,t[60]=D,t[61]=k):k=t[61];let A;return t[62]!==b||t[63]!==x||t[64]!==k?(A=(0,Q.jsxs)(Q.Fragment,{children:[b,x,k]}),t[62]=b,t[63]=x,t[64]=k,t[65]=A):A=t[65],A}function N8(e){return e.reviewStatus===`reviewed`}function P8(e){return ks(e)}var F8=[{value:`uncommitted`,label:`Uncommitted`},{value:`branch`,label:`Branch`}];function I8(e){let t=(0,$.c)(28),{grouping:n,scope:r,context:i,activeEntry:a,onOpen:o,sideLabel:s,changeScope:c,base:l,onChangeScope:u,onBase:d}=e,{connection:f}=i;d1(r,i);let p=rB(r,f),m=f1(r,i,p),h=c===`branch`,g;t[0]!==c||t[1]!==u?(g=(0,Q.jsx)(O8,{label:`Changes to review`,className:`px-2.5 pt-3`,value:c,onValue:u,options:F8}),t[0]=c,t[1]=u,t[2]=g):g=t[2];let _;t[3]!==a||t[4]!==l||t[5]!==h||t[6]!==i||t[7]!==n?.branch||t[8]!==d||t[9]!==o||t[10]!==r||t[11]!==s?(_=h&&(0,Q.jsx)(A8,{scope:r,context:i,base:l,activeEntry:a,onOpen:o,sideLabel:s,onBase:d,grouping:n?.branch}),t[3]=a,t[4]=l,t[5]=h,t[6]=i,t[7]=n?.branch,t[8]=d,t[9]=o,t[10]=r,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==a||t[14]!==l||t[15]!==h||t[16]!==m||t[17]!==i||t[18]!==n?.uncommitted||t[19]!==p||t[20]!==o||t[21]!==r||t[22]!==s?(v=!h&&(0,Q.jsx)(L8,{scope:r,context:i,activeEntry:a,onOpen:o,sideLabel:s,list:p,changes:m,grouping:n?.uncommitted,base:l}),t[13]=a,t[14]=l,t[15]=h,t[16]=m,t[17]=i,t[18]=n?.uncommitted,t[19]=p,t[20]=o,t[21]=r,t[22]=s,t[23]=v):v=t[23];let y;return t[24]!==g||t[25]!==_||t[26]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,_,v]}),t[24]=g,t[25]=_,t[26]=v,t[27]=y):y=t[27],y}function L8(e){let t=(0,$.c)(29),{scope:n,context:r,activeEntry:i,onOpen:a,sideLabel:o,list:s,changes:c,grouping:l,base:u}=e,d=Ku(r.connection),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={changes:!0,specs:!1},t[0]=f):f=t[0];let[p,m]=(0,Z.useState)(f),h=s.changes.map(H8),g=d?h.filter(V8):h,_=d?h.filter(ky):[],v=new Map(c.map(B8)),y=du(s.changes),b=O1(n,r,z8),x;t[1]===a?x=t[2]:(x=NQ(a),t[1]=a,t[2]=x);let S;t[3]!==u||t[4]!==r||t[5]!==n||t[6]!==x?(S={scope:n,context:r,base:u,jump:x},t[3]=u,t[4]=r,t[5]=n,t[6]=x,t[7]=S):S=t[7];let C=mY(S),w=I$(n.worktreeId,i),[T,E]=(0,Z.useState)(null),D=()=>l?(0,Q.jsx)(l,{base:u,scope:n,context:r,paths:h,row:O,activeEntry:i,onOpen:a}):(0,Q.jsx)(T8,{label:`All changes`,active:i===PQ(OQ),onOpen:()=>a(OQ),children:`All changes`}),O=(e,t)=>(0,Z.createElement)(b8,{...t,key:e,path:e,document:{kind:`change`,path:e},note:void 0,changeStatus:y.files.get(e),scopes:[...new Set(s.changes.find(t=>t.path===e)?.comparisons.map(R8))],reviewStatus:v.get(e)?.reviewStatus,active:i===PQ({kind:`change`,path:e}),current:w===e,onOpen:a,sideLabel:o,writeBlock:b.writeBlock,commentCount:C.counts.get(e),onComment:t=>C.comment(e,t),canReview:v.get(e)?.fingerprint!==null&&v.get(e)?.fingerprint!==void 0,onReview:()=>b.toggle({path:e,reviewed:v.get(e)?.reviewStatus===`reviewed`,fingerprint:v.get(e)?.fingerprint}),onDiscard:()=>E(t=>({path:e,nonce:(t?.nonce??0)+1}))}),k=C.summary,A=C.dialogs,j=JV,M=h.length>0&&(0,Q.jsx)(D8,{reviewed:h.filter(e=>v.get(e)?.reviewStatus===`reviewed`).length,total:h.length}),N=H(h.length,s.omittedChanges)&&(0,Q.jsx)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:H(h.length,s.omittedChanges)}),P;t[8]===D?P=t[9]:(P=D(),t[8]=D,t[9]=P);let F=!l&&h.length===0&&(0,Q.jsx)(`p`,{className:`px-2 py-1 text-caption text-muted-foreground`,children:`No changes`}),I=!l&&g.length>0&&(0,Q.jsx)(E8,{name:`Changed files`,count:g.length,expanded:p.changes,onExpanded:e=>m(t=>({...t,changes:e})),onAll:e=>m({changes:e,specs:e}),children:g.map(e=>O(e))}),L=!l&&_.length>0&&(0,Q.jsxs)(E8,{name:`Specs`,count:_.length,expanded:p.specs,onExpanded:e=>m(t=>({...t,specs:e})),onAll:e=>m({changes:e,specs:e}),children:[(0,Q.jsx)(T8,{label:`Open all specs`,active:i===`specs`,onOpen:()=>a(kQ),children:`Open all specs`}),_.map(e=>O(e))]}),R;t[10]!==r||t[11]!==T||t[12]!==n?(R=T&&(0,Q.jsx)(iX,{scope:n,context:r,path:T.path,signal:T.nonce,hiddenTrigger:!0}),t[10]=r,t[11]=T,t[12]=n,t[13]=R):R=t[13];let z;t[14]!==P||t[15]!==F||t[16]!==I||t[17]!==L||t[18]!==R||t[19]!==M||t[20]!==N?(z=(0,Q.jsxs)(`div`,{className:`px-2.5 pt-2 pb-3`,children:[M,N,P,F,I,L,R]}),t[14]=P,t[15]=F,t[16]=I,t[17]=L,t[18]=R,t[19]=M,t[20]=N,t[21]=z):z=t[21];let B;t[22]!==j||t[23]!==z?(B=(0,Q.jsx)(j,{className:`h-0 min-h-0 flex-1`,children:z}),t[22]=j,t[23]=z,t[24]=B):B=t[24];let V;return t[25]!==C.dialogs||t[26]!==C.summary||t[27]!==B?(V=(0,Q.jsxs)(Q.Fragment,{children:[k,A,B]}),t[25]=C.dialogs,t[26]=C.summary,t[27]=B,t[28]=V):V=t[28],V}function R8(e){return e.scope}function z8(e){return ks(e)}function B8(e){return[e.path,e]}function V8(e){return!ky(e)}function H8(e){return e.path}function U8(){let e=(0,$.c)(12),{open:t}=R$(),n=zH()?.open??!0,r=!n&&`desktop-workspace-without-navigator`,i;e[0]===r?i=e[1]:(i=Y(`relative flex h-svh w-full bg-frame p-2 max-md:p-0`,r),e[0]=r,e[1]=i);let a;e[2]===n?a=e[3]:(a=n&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 md:block`}),e[2]=n,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 rounded-paper border bg-card max-md:rounded-none max-md:border-0`,children:(0,Q.jsx)(kc,{label:`Opening Porcelain`})}),e[4]=o):o=e[4];let s;e[5]===t?s=e[6]:(s=t&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`ml-2 hidden w-80 shrink-0 rounded-paper bg-card shadow-paper xl:block`}),e[5]=t,e[6]=s);let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-11 shrink-0 xl:block`}),e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==a||e[10]!==s?(l=(0,Q.jsxs)(`div`,{className:i,children:[a,o,s,c]}),e[8]=i,e[9]=a,e[10]=s,e[11]=l):l=e[11],l}var W8=Oe(void 0);function G8(e){let t=(0,$.c)(2),n;t[0]===e?n=t[1]:(n=e===void 0?W8:ir(e),t[0]=e,t[1]=n),Lt(n)}var K8=Ut({start:Ln,workspace:fi,list:ar(Ln),retired:ar(fi),navigator:ar(fi)}),q8=Qt(Ut({settings:K8}));function J8(e){let{state:t,pathname:n}=e.location;return{index:t.__TSR_index,pathname:n,fromNavigator:t.settingsFromNavigator===!0,session:de(fn(q8(t),e=>e.settings))}}function Y8(e,t){let{state:n,href:r}=e.location;e.replace(r,{...n,settings:t})}function X8(e,t,n){e.replace(t,{...e.location.state,settings:n})}function Z8(e,t,n){if(t===0){n();return}let r=e.subscribe(()=>{r(),n()});e.go(t)}var Q8=24,$8=`data-outline-landed`,e5=`data-outline-chosen`,t5=`data-outline-pinned`;function n5(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.title===t[n]?.title)}function r5(e,t){let n=Number.parseFloat(getComputedStyle(t).scrollMarginTop);return e.scrollTop+t.getBoundingClientRect().top-e.getBoundingClientRect().top-(Number.isNaN(n)?0:n)}function i5(e,t){let n=t.at(-1);if(n&&e.scrollTop>0&&e.scrollTop+e.clientHeight>=e.scrollHeight-2)return n.id;let r=e.getBoundingClientRect().top,i=t[0]?.id;for(let e of t)e.getBoundingClientRect().top-r<=Q8&&(i=e.id);return i}function a5(e,t){let n=(0,$.c)(12),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],n[0]=r):r=n[0];let[i,a]=(0,Z.useState)(r),[o,s]=(0,Z.useState)(),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),f;n[1]!==t||n[2]!==e?(f=n=>{if(l(n),!n)return;let r=n.closest(`[data-slot=scroll-area-viewport]`)??n;d(r);let i=`${e}#${t}`,o=()=>{let e=[...n.querySelectorAll(`[${cc}]`)],o=e.map(o5);a(e=>n5(e,o)?e:o),t!==``&&n.getAttribute($8)!==i&&(n.setAttribute($8,i),n.setAttribute(e5,t),n.setAttribute(t5,t));let c=n.getAttribute(t5),l=e.find(e=>e.id===c);l&&(r.scrollTop=r5(r,l)),s(n.getAttribute(e5)??i5(r,e))},c=0,u=()=>{cancelAnimationFrame(c),c=requestAnimationFrame(o)},f=r.closest(`[data-slot=scroll-area]`)??r,p=()=>{n.removeAttribute(e5),n.removeAttribute(t5)},m=new MutationObserver(u);m.observe(n,{childList:!0,subtree:!0}),r.addEventListener(`scroll`,u,{passive:!0});for(let e of[`wheel`,`touchmove`,`keydown`,`pointerdown`])f.addEventListener(e,p,{passive:!0});return o(),()=>{a([]),s(void 0),cancelAnimationFrame(c),m.disconnect(),r.removeEventListener(`scroll`,u);for(let e of[`wheel`,`touchmove`,`keydown`,`pointerdown`])f.removeEventListener(e,p)}},n[1]=t,n[2]=e,n[3]=f):f=n[3];let p=f,m;n[4]!==c||n[5]!==u?(m=e=>{let t=c?.querySelector(`#${CSS.escape(e)}`);t&&u&&(c?.removeAttribute(t5),c?.setAttribute(e5,e),s(e),u.scrollTo({top:r5(u,t),behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}),t.focus({preventScroll:!0}))},n[4]=c,n[5]=u,n[6]=m):m=n[6];let h=m,g;return n[7]!==o||n[8]!==p||n[9]!==h||n[10]!==i?(g={sections:i,active:o,attach:p,go:h},n[7]=o,n[8]=p,n[9]=h,n[10]=i,n[11]=g):g=n[11],g}function o5(e){return{id:e.id,title:e.getAttribute(`data-settings-section`)??e.id}}var s5=[{id:`general`,label:`General`,icon:C_},{id:`git`,label:`Changes & Git`,icon:_g},{id:`computers`,label:`Computers`,icon:Io}],c5=s5[0].id;function l5(e,t){if(s5.some(t=>t.id===e)&&(t===void 0||e===`computers`))return{section:e,environmentId:t}}function u5(e){return e.key.toLowerCase()===`b`&&(e.ctrlKey||e.metaKey)}function d5(e){let[,t,n,r,i]=e.split(`/`);if(t===`settings`&&n!==void 0&&i===void 0)return l5(n,r===``?void 0:r)}var f5=`settings-content wrap-anywhere mx-auto flex w-full max-w-200 flex-col gap-8 px-4 py-5 md:px-8 md:py-6`;function p5(e){let t=(0,$.c)(3),{attach:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(JV,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(`div`,{ref:n,className:f5,children:r})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function m5(e){let t=(0,$.c)(9),{sections:n,active:r,onGo:i}=e;if(n.length<2)return null;let a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>{let{id:t,title:n}=e;return(0,Q.jsx)(`a`,{href:`#${t}`,"aria-current":r===t?`location`:void 0,onClick:e=>{di(e)&&(e.preventDefault(),i(t))},className:Y(`-ml-px flex h-6 min-w-0 items-center border-l border-transparent pr-2 pl-3 text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30`,r===t&&`border-foreground font-medium text-foreground`),children:(0,Q.jsx)(fr,{text:n,className:`min-w-0`})},t)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,Q.jsx)(`div`,{className:`my-0.5 ml-4.5 flex flex-col border-l`,children:a}),t[7]=a,t[8]=o),o}function h5(e){return e instanceof HTMLElement&&(e.isContentEditable||e.closest(`input, textarea, select`)!==null)}function g5(e){return e instanceof Element&&e.closest(`[data-slot=dialog-backdrop]`)!==null}function _5(e){let t=(0,$.c)(93),{section:n,environmentId:r}=e,i=Pc(),a=Fi(),o=eh(),{isMobile:s}=BH(),c;t[0]!==o||t[1]!==a.history?(c=()=>{let e=J8(a.history);return e.session??{start:e.index,workspace:o,...e.fromNavigator?{navigator:!0}:{}}},t[0]=o,t[1]=a.history,t[2]=c):c=t[2];let[l]=(0,Z.useState)(c),u;t[3]!==l||t[4]!==a.history?(u=()=>{let e=J8(a.history);return{index:e.index,...e.session??l}},t[3]=l,t[4]=a.history,t[5]=u):u=t[5];let d=u;G8(`Settings — Porcelain`);let[f]=(0,Z.useState)(x5),p=Da(qn),m;t[6]!==s||t[7]!==f||t[8]!==l||t[9]!==a.history||t[10]!==p?(m=e=>{if(!e)return;p(!1);let t,n=e=>{let n=J8(a.history),r=d5(n.pathname);if(!r)return;if(n.session?.retired&&e){a.history.back();return}if(n.session){t={index:n.index,list:r.section===`computers`&&r.environmentId===void 0};return}let i=r.environmentId!==void 0&&t?.list===!0&&t.index===n.index-1;Y8(a.history,{start:l.start,workspace:l.workspace,...l.navigator?{navigator:!0}:{},...i&&t?{list:t.index}:{}})};n(!1);let r=a.history.subscribe(e=>{let{action:t}=e;return n(t.type===`FORWARD`||t.type===`GO`&&t.index>0)});return()=>{r(),queueMicrotask(()=>{if(e.isConnected)return;if(l.navigator&&s){p(!0);return}let t=document.activeElement;(t===null||t===document.body)&&f?.focus({preventScroll:!0})})}},t[6]=s,t[7]=f,t[8]=l,t[9]=a.history,t[10]=p,t[11]=m):m=t[11];let h=m,g=Fo(r??``)?.remote,{element:_,attach:v}=hH(),[y,b]=(0,Z.useState)(null),x;t[12]!==i||t[13]!==a.history||t[14]!==d?(x=()=>{let{index:e,list:t}=d();t===void 0?i({to:`/settings/$section`,params:{section:`computers`},replace:!0}):a.history.go(t-e)},t[12]=i,t[13]=a.history,t[14]=d,t[15]=x):x=t[15];let S=x,C;t[16]!==r||t[17]!==i||t[18]!==a.history||t[19]!==d?(C=e=>{let{index:t,list:n}=d(),o=()=>void i({to:`/settings/$section`,params:{section:e},replace:!0});if(r!==void 0&&n!==void 0){let{index:e,...r}=d();Y8(a.history,{...r,retired:!0}),Z8(a.history,n-t,o)}else o()},t[16]=r,t[17]=i,t[18]=a.history,t[19]=d,t[20]=C):C=t[20];let w=C,T;t[21]!==_?.scrollTop||t[22]!==i?(T=e=>{b({scroll:_?.scrollTop??0,focus:document.activeElement instanceof HTMLElement?document.activeElement:null}),i({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}})},t[21]=_?.scrollTop,t[22]=i,t[23]=T):T=t[23];let E=T,D;t[24]!==r||t[25]!==y||t[26]!==v?(D=e=>{if(v(e),r===void 0&&e){y&&(e.scrollTop=y.scroll);let t=y?.focus,n=t?.isConnected?t:e;n.focus({preventScroll:!0}),requestAnimationFrame(()=>{document.activeElement?.getAttribute(`role`)===`dialog`&&n.focus({preventScroll:!0})})}},t[24]=r,t[25]=y,t[26]=v,t[27]=D):D=t[27];let O=D,k=e=>{if(B.id===`computers`&&r===void 0){E(e);return}if(e===r)return;let{index:t,...n}=d();X8(a.history,a.buildLocation({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}}).href,n)},A;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(A={select:b5},t[28]=A):A=t[28];let j=$m(A),M;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(M={select:y5},t[29]=M):M=t[29];let N=a5(j,$m(M)),P;t[30]!==N.active||t[31]!==N.go||t[32]!==N.sections?(P=(0,Q.jsx)(m5,{sections:N.sections,active:N.active,onGo:N.go}),t[30]=N.active,t[31]=N.go,t[32]=N.sections,t[33]=P):P=t[33];let F=P,I;t[34]===r?I=t[35]:(I=e=>{r!==void 0&&e?.focus({preventScroll:!0})},t[34]=r,t[35]=I);let L=I,{connection:R}=Di(),{environment:z}=QB(R),B=s5.find(e=>e.id===n)??s5[0],V=`Computer unavailable`;if(r===`this-computer`)V=`This computer`;else if(g){let e;t[36]===g?e=t[37]:(e=(0,Q.jsx)(ss,{remote:g}),t[36]=g,t[37]=e),V=e}let H;t[38]!==i||t[39]!==a.history||t[40]!==d?(H=()=>{let{index:e,start:t,workspace:n}=d();n?a.history.go(t-1-e):Z8(a.history,t-e,()=>void i({to:`/`,replace:!0}))},t[38]=i,t[39]=a.history,t[40]=d,t[41]=H):H=t[41];let U=H,W;t[42]!==r||t[43]!==U||t[44]!==S?(W=(e,t)=>{if(!e){if(t.reason===`escape-key`){if(h5(t.event?.target??null))return;if(r!==void 0){S();return}}(t.reason!==`outside-press`||g5(t.event?.target??null))&&U()}},t[42]=r,t[43]=U,t[44]=S,t[45]=W):W=t[45];let G,K;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)($V,{children:`Settings`}),K=(0,Q.jsx)(nH,{children:`/`}),t[46]=G,t[47]=K):(G=t[46],K=t[47]);let q;t[48]!==B.label||t[49]!==r||t[50]!==S?(q=(0,Q.jsx)($V,{children:r===void 0?(0,Q.jsx)(`h2`,{children:(0,Q.jsx)(tH,{children:B.label})}):(0,Q.jsx)(eH,{render:(0,Q.jsx)(`button`,{type:`button`,onClick:S}),children:`Computers`})}),t[48]=B.label,t[49]=r,t[50]=S,t[51]=q):q=t[51];let J;t[52]!==V||t[53]!==r?(J=r!==void 0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(nH,{children:`/`}),(0,Q.jsx)($V,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`min-w-0`,children:(0,Q.jsx)(tH,{className:`min-w-0`,children:V})})})]}),t[52]=V,t[53]=r,t[54]=J):J=t[54];let ee;t[55]!==q||t[56]!==J?(ee=(0,Q.jsx)(ZV,{className:`min-w-0 flex-1`,children:(0,Q.jsxs)(QV,{className:`min-w-0 flex-nowrap`,children:[G,K,q,J]})}),t[55]=q,t[56]=J,t[57]=ee):ee=t[57];let te;t[58]!==h||t[59]!==ee?(te=(0,Q.jsx)(`header`,{ref:h,className:`settings-bar flex min-h-12 shrink-0 items-center gap-2 border-b pr-12 pl-4`,children:ee}),t[58]=h,t[59]=ee,t[60]=te):te=t[60];let ne;t[61]!==B.id||t[62]!==r||t[63]!==S||t[64]!==F||t[65]!==k||t[66]!==w?(ne=s5.map(e=>{let t=e.icon,n=B.id===e.id,i=n&&r===void 0;return(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsxs)(X,{variant:i?`secondary`:`ghost`,size:`sm`,className:`shrink-0 justify-start md:w-full`,"aria-current":i?`page`:void 0,onClick:()=>{r!==void 0&&e.id===`computers`?S():w(e.id)},children:[(0,Q.jsx)(t,{}),e.label]}),e.id===`computers`?(0,Q.jsx)(`div`,{className:`hidden pl-4 md:mb-1 md:block`,children:(0,Q.jsx)(ws,{selected:r,onOpen:k,children:F})}):n&&(0,Q.jsx)(`div`,{className:`hidden md:mb-1 md:block`,children:F})]},e.id)}),t[61]=B.id,t[62]=r,t[63]=S,t[64]=F,t[65]=k,t[66]=w,t[67]=ne):ne=t[67];let re;t[68]===ne?re=t[69]:(re=(0,Q.jsx)(`div`,{className:`settings-nav flex gap-0.5 overflow-x-auto px-3 py-3 md:min-h-0 md:flex-1 md:flex-col md:overflow-x-hidden md:overflow-y-auto md:py-4`,children:ne}),t[68]=ne,t[69]=re);let ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsxs)(`p`,{className:`hidden shrink-0 px-5 py-3 text-xs tabular-nums text-muted-foreground md:block`,children:[`Porcelain `,`0.89.0`]}),t[70]=ie):ie=t[70];let ae;t[71]===re?ae=t[72]:(ae=(0,Q.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`flex shrink-0 flex-col md:min-h-0 md:w-56`,children:[re,ie]}),t[71]=re,t[72]=ae);let oe;t[73]!==O||t[74]!==B.id||t[75]!==z||t[76]!==r||t[77]!==E||t[78]!==N.attach||t[79]!==S?(oe=(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col md:border-l`,children:B.id===`computers`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{ref:O,className:r===void 0?`min-h-0 flex-1 overflow-y-auto outline-none`:`hidden`,role:`region`,"aria-label":`Computers list`,tabIndex:-1,children:(0,Q.jsx)(`div`,{className:f5,children:(0,Q.jsx)(Si,{showUpdates:r===void 0,environment:z,onOpen:E})})}),r!==void 0&&(0,Q.jsx)(p5,{attach:N.attach,children:r===`this-computer`?(0,Q.jsx)(Vi,{environment:z}):(0,Q.jsx)(pi,{environmentId:r,onForgotten:S},r)},r)]}):(0,Q.jsx)(p5,{attach:N.attach,children:B.id===`git`?(0,Q.jsx)(Ud,{}):(0,Q.jsx)(wd,{})},B.id)}),t[73]=O,t[74]=B.id,t[75]=z,t[76]=r,t[77]=E,t[78]=N.attach,t[79]=S,t[80]=oe):oe=t[80];let se;t[81]!==ae||t[82]!==oe?(se=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[ae,oe]}),t[81]=ae,t[82]=oe,t[83]=se):se=t[83];let ce;t[84]!==te||t[85]!==se?(ce=(0,Q.jsxs)(`div`,{className:`-m-4 flex min-h-0 flex-1 flex-col bg-card text-base text-card-foreground`,children:[te,se]}),t[84]=te,t[85]=se,t[86]=ce):ce=t[86];let le;t[87]!==L||t[88]!==ce?(le=(0,Q.jsx)(xz,{ref:L,finalFocus:`none`,onKeyDown:v5,"aria-label":`Settings`,className:`flex h-[min(48rem,calc(100svh-2rem))] w-[min(64rem,calc(100vw-2rem))] max-w-none flex-col overflow-clip sm:max-w-none`,children:ce}),t[87]=L,t[88]=ce,t[89]=le):le=t[89];let ue;return t[90]!==W||t[91]!==le?(ue=(0,Q.jsx)(vz,{open:!0,onOpenChange:W,children:le}),t[90]=W,t[91]=le,t[92]=ue):ue=t[92],ue}function v5(e){u5(e)&&e.stopPropagation()}function y5(e){return e.hash}function b5(e){return e.pathname}function x5(){return document.activeElement instanceof HTMLElement&&document.activeElement!==document.body?document.activeElement:null}export{b4 as $,yh as $n,pH as $t,e3 as A,fA as An,bJ as At,f3 as B,ky as Bn,LK as Bt,x3 as C,QF as Cn,sY as Ct,q4 as D,lN as Dn,KJ as Dt,Q4 as E,LP as En,YJ as Et,m3 as F,Gk as Fn,eq as Ft,_4 as G,Yv as Gn,HH as Gt,H4 as H,dy as Hn,jW as Ht,h3 as I,Wk as In,qK as It,A4 as J,Ng as Jn,_H as Jt,F4 as K,$g as Kn,UH as Kt,J4 as L,Ly as Ln,YK as Lt,c3 as M,rA as Mn,LJ as Mt,l3 as N,eA as Nn,fJ as Nt,K4 as O,LM as On,UJ as Ot,i3 as P,Qk as Pn,uJ as Pt,j4 as Q,xh as Qn,hH as Qt,n3 as R,Vy as Rn,BK as Rt,b3 as S,$F as Sn,uY as St,W4 as T,JP as Tn,JJ as Tt,B4 as U,Zv as Un,OW as Ut,v3 as V,py as Vn,IK as Vt,V4 as W,Xv as Wn,fW as Wt,P4 as X,_g as Xn,xH as Xt,N4 as Y,Dg as Yn,yH as Yt,R4 as Z,Dh as Zn,wH as Zt,D3 as _,Tz as _n,PQ as _t,U8 as a,UV as an,Ip as ar,t4 as at,S3 as b,BR as bn,hY as bt,y8 as c,AB as cn,h0 as ct,Z6 as d,vB as dn,p1 as dt,mH as en,$m as er,z4 as et,U6 as f,bB as fn,z$ as ft,T3 as g,xz as gn,OQ as gt,k3 as h,vz as hn,UQ as ht,G8 as i,XV as in,Fm as ir,k4 as it,p3 as j,lA as jn,RJ as jt,Z4 as k,Kj as kn,yJ as kt,d8 as l,jB as ln,g0 as lt,j3 as m,iB as mn,K$ as mt,c5 as n,JV as nn,Qm as nr,w4 as nt,I8 as o,QB as on,yp as or,g2 as ot,V6 as p,rB as pn,V$ as pt,m4 as q,Yg as qn,BH as qt,l5 as r,YV as rn,qm as rr,p4 as rt,T8 as s,UB as sn,bp as sr,w0 as st,_5 as t,sH as tn,Xm as tr,M4 as tt,t8 as u,yB as un,n0 as ut,O3 as v,Sz as vn,MQ as vt,G4 as w,XF as wn,oY as wt,C3 as x,eI as xn,fY as xt,E3 as y,wz as yn,VQ as yt,g3 as z,Ny as zn,HK as zt};