@staff0rd/assist 0.1148.1 → 0.1148.2
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.
- package/dist/.build-files +13 -13
- package/dist/built-version +1 -1
- package/dist/{chunk-2WB3DUS2.js → chunk-IJBO3QAZ.js} +1 -1
- package/dist/{chunk-WATVHSJF.js → chunk-M7NG6SAJ.js} +2 -2
- package/dist/{chunk-BMW3E2QR.js → chunk-NK5F3LAA.js} +1 -1
- package/dist/{chunk-KTCQFSW3.js → chunk-SUWZDG7Q.js} +1 -1
- package/dist/{chunk-NJS76Y65.js → chunk-TYFTNUF3.js} +1 -1
- package/dist/{chunk-M3WZ4V3G.js → chunk-Y63NZG55.js} +1 -1
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/{doctorNodes-MTV5KCNV.js → doctorNodes-YMEBOBIJ.js} +3 -3
- package/dist/index.js +11 -11
- package/dist/{restartNode-54DQSXFF.js → restartNode-GW6K7HWB.js} +5 -5
- package/dist/{runDaemon-5EXE7NHI.js → runDaemon-SIDHFAD4.js} +2 -2
- package/dist/{signExtension-25JSZAFS.js → signExtension-WW37ABPP.js} +1 -1
- package/dist/{updateNode-MY6AUXFD.js → updateNode-JUQC73JS.js} +5 -5
- package/dist/{web-YMSBQYKR.js → web-JQG6IAUE.js} +5 -5
- package/dist/{web-DS57JQKY.js → web-P476PEM5.js} +5 -5
- package/package.json +1 -1
|
@@ -3813,7 +3813,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
3813
3813
|
${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${ESt.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),h2n=wX.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:s,scope:l,size:u,sortDirection:d,variant:f,...p}=n,h=wX.useContext(ede),m=wX.useContext(g_),g=m&&m.variant==="head",y;a?y=a:y=g?"th":"td";let v=l;y==="td"?v=void 0:!v&&g&&(v="col");let b=f||m&&m.variant,x={...n,align:o,component:y,padding:s||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:d,stickyHeader:b==="head"&&h&&h.stickyHeader,variant:b},w=f2n(x),C=null;return d&&(C=d==="asc"?"ascending":"descending"),(0,RSt.jsx)(p2n,{as:y,ref:r,className:gt(w.root,i),"aria-sort":C,scope:v,ownerState:x,...p})}),Zr=h2n;var ASt=S(oe(),1);function PSt(e){return wt("MuiTableContainer",e)}var pAi=kt("MuiTableContainer",["root"]);var LSt=S(E(),1),m2n=e=>{let{classes:t}=e;return Ct({root:["root"]},PSt,t)},g2n=nt("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),y2n=ASt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableContainer"}),{className:o,component:i="div",...a}=n,s={...n,component:i},l=m2n(s);return(0,LSt.jsx)(g2n,{ref:r,as:i,className:gt(l.root,o),ownerState:s,...a})}),L2=y2n;var MSt=S(oe(),1);function ISt(e){return wt("MuiTableHead",e)}var _Ai=kt("MuiTableHead",["root"]);var LDe=S(E(),1),v2n=e=>{let{classes:t}=e;return Ct({root:["root"]},ISt,t)},b2n=nt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),x2n={variant:"head"},DSt="thead",S2n=MSt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableHead"}),{className:o,component:i=DSt,...a}=n,s={...n,component:i},l=v2n(s);return(0,LDe.jsx)(g_.Provider,{value:x2n,children:(0,LDe.jsx)(b2n,{as:i,className:gt(l.root,o),ref:r,role:i===DSt?null:"rowgroup",ownerState:s,...a})})}),I2=S2n;var GSt=S(oe(),1);var OSt=S(oe(),1);function NSt(e){return wt("MuiToolbar",e)}var zAi=kt("MuiToolbar",["root","gutters","regular","dense"]);var BSt=S(E(),1),T2n=e=>{let{classes:t,disableGutters:r,variant:n}=e;return Ct({root:["root",!r&&"gutters",n]},NSt,t)},w2n=nt("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,!r.disableGutters&&t.gutters,t[r.variant]]}})(Dt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),C2n=OSt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiToolbar"}),{className:o,component:i="div",disableGutters:a=!1,variant:s="regular",...l}=n,u={...n,component:i,disableGutters:a,variant:s},d=T2n(u);return(0,BSt.jsx)(w2n,{as:i,className:gt(d.root,o),ref:r,ownerState:u,...l})}),sA=C2n;var HSt=S(oe(),1);var $St=S(E(),1),rde=ot((0,$St.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft");var FSt=S(E(),1),nde=ot((0,FSt.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function zSt(e){return wt("MuiTablePaginationActions",e)}var o6i=kt("MuiTablePaginationActions",["root"]);var Ef=S(E(),1),k2n=e=>{let{classes:t}=e;return Ct({root:["root"]},zSt,t)},_2n=nt("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),E2n=HSt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTablePaginationActions"}),{className:o,count:i,disabled:a=!1,getItemAriaLabel:s,onPageChange:l,page:u,rowsPerPage:d,showFirstButton:f,showLastButton:p,slots:h={},slotProps:m={},...g}=n,y=Ld(),b=k2n(n),x=q=>{l(q,0)},w=q=>{l(q,u-1)},C=q=>{l(q,u+1)},k=q=>{l(q,Math.max(0,Math.ceil(i/d)-1))},_=h.firstButton??Ht,R=h.lastButton??Ht,D=h.nextButton??Ht,N=h.previousButton??Ht,$=h.firstButtonIcon??jxt,P=h.lastButtonIcon??Kxt,A=h.nextButtonIcon??nde,L=h.previousButtonIcon??rde,I=y?R:_,M=y?D:N,F=y?N:D,O=y?_:R,z=y?m.lastButton:m.firstButton,U=y?m.nextButton:m.previousButton,W=y?m.previousButton:m.nextButton,V=y?m.firstButton:m.lastButton;return(0,Ef.jsxs)(_2n,{ref:r,className:gt(b.root,o),...g,children:[f&&(0,Ef.jsx)(I,{onClick:x,disabled:a||u===0,"aria-label":s("first",u),title:s("first",u),...z,children:y?(0,Ef.jsx)(P,{...m.lastButtonIcon}):(0,Ef.jsx)($,{...m.firstButtonIcon})}),(0,Ef.jsx)(M,{onClick:w,disabled:a||u===0,color:"inherit","aria-label":s("previous",u),title:s("previous",u),...U,children:y?(0,Ef.jsx)(A,{...m.nextButtonIcon}):(0,Ef.jsx)(L,{...m.previousButtonIcon})}),(0,Ef.jsx)(F,{onClick:C,disabled:a||(i!==-1?u>=Math.ceil(i/d)-1:!1),color:"inherit","aria-label":s("next",u),title:s("next",u),...W,children:y?(0,Ef.jsx)(L,{...m.previousButtonIcon}):(0,Ef.jsx)(A,{...m.nextButtonIcon})}),p&&(0,Ef.jsx)(O,{onClick:k,disabled:a||u>=Math.ceil(i/d)-1,"aria-label":s("last",u),title:s("last",u),...V,children:y?(0,Ef.jsx)($,{...m.firstButtonIcon}):(0,Ef.jsx)(P,{...m.lastButtonIcon})})]})}),IDe=E2n;function USt(e){return wt("MuiTablePagination",e)}var R2n=kt("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),w8=R2n;var P2n=e=>{let t;if(typeof Intl<"u"&&Intl.NumberFormat)try{t=new Intl.NumberFormat(e)}catch{}return r=>Number.isFinite(r)&&t?t.format(r):String(r)},VSt=P2n;var N1=S(E(),1),qSt=S(oe(),1),WSt,ode=VSt("en-US"),A2n=nt(Zr,{name:"MuiTablePagination",slot:"Root"})(Dt(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),L2n=nt(sA,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${w8.actions}`]:t.actions,...t.toolbar})})(Dt(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${w8.actions}`]:{flexShrink:0,marginLeft:20}}))),I2n=nt("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),D2n=nt("p",{name:"MuiTablePagination",slot:"SelectLabel"})(Dt(({theme:e})=>({...e.typography.body2,flexShrink:0}))),M2n=nt(h_,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${w8.selectIcon}`]:t.selectIcon,[`& .${w8.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${w8.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),N2n=nt(Br,{name:"MuiTablePagination",slot:"MenuItem"})({}),O2n=nt("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(Dt(({theme:e})=>({...e.typography.body2,flexShrink:0})));function B2n({from:e,to:t,count:r}){return`${ode(e)}\u2013${ode(t)} of ${r!==-1?ode(r):`more than ${ode(t)}`}`}function $2n(e){return`Go to ${e} page`}var F2n=e=>{let{classes:t}=e;return Ct({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},USt,t)},z2n=GSt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTablePagination"}),{ActionsComponent:o=IDe,colSpan:i,component:a=Zr,count:s,disabled:l=!1,getItemAriaLabel:u=$2n,labelDisplayedRows:d=B2n,labelRowsPerPage:f="Rows per page:",onPageChange:p,onRowsPerPageChange:h,page:m,rowsPerPage:g,rowsPerPageOptions:y=[10,25,50,100],showFirstButton:v=!1,showLastButton:b=!1,slotProps:x={},slots:w={},...C}=n,k=n,_=F2n(k),R=typeof x?.select=="function"?x.select(k):x?.select??{},D=R.native?"option":N2n,N;(a===Zr||a==="td")&&(N=i||1e3);let $=bg(R.id),P=bg(R.labelId),A=()=>s===-1?(m+1)*g:g===-1?s:Math.min(s,(m+1)*g),L={slots:w,slotProps:x},[I,M]=sr("root",{ref:r,className:_.root,elementType:A2n,externalForwardedProps:{...L,component:a,...C},ownerState:k,additionalProps:{colSpan:N}}),[F,O]=sr("toolbar",{className:_.toolbar,elementType:L2n,externalForwardedProps:L,ownerState:k}),[z,U]=sr("spacer",{className:_.spacer,elementType:I2n,externalForwardedProps:L,ownerState:k}),[W,V]=sr("selectLabel",{className:_.selectLabel,elementType:D2n,externalForwardedProps:L,ownerState:k,additionalProps:{id:P}}),[q,Y]=sr("select",{className:_.select,elementType:M2n,externalForwardedProps:L,ownerState:k}),[Z,ee]=sr("menuItem",{className:_.menuItem,elementType:D,externalForwardedProps:L,ownerState:k}),[K,ce]=sr("displayedRows",{className:_.displayedRows,elementType:O2n,externalForwardedProps:L,ownerState:k});return(0,N1.jsx)(I,{...M,children:(0,N1.jsxs)(F,{...O,children:[(0,N1.jsx)(z,{...U}),y.length>1&&(0,N1.jsx)(W,{...V,children:f}),y.length>1&&(0,N1.jsx)(q,{variant:"standard",...!R.variant&&{input:WSt||(WSt=(0,N1.jsx)($i,{}))},value:g,onChange:h,id:$,labelId:P,...R,classes:{...R.classes,root:gt(_.input,_.selectRoot,(R.classes||{}).root),select:gt(_.select,(R.classes||{}).select),icon:gt(_.selectIcon,(R.classes||{}).icon)},disabled:l,...Y,children:y.map(ne=>(0,qSt.createElement)(Z,{...ee,key:ne.label?ne.label:ne,value:ne.value?ne.value:ne},ne.label?ne.label:ne))}),(0,N1.jsx)(K,{...ce,children:d({from:s===0?0:m*g+1,to:A(),count:s===-1?-1:s,page:m})}),(0,N1.jsx)(o,{className:_.actions,count:s,onPageChange:p,page:m,rowsPerPage:g,showFirstButton:v,showLastButton:b,slotProps:x.actions,slots:w.actions,getItemAriaLabel:u,disabled:l})]})})}),lA=z2n;var ide=S(oe(),1);function jSt(e){return wt("MuiTableRow",e)}var H2n=kt("MuiTableRow",["root","selected","hover","head","footer"]),DDe=H2n;var KSt=S(E(),1),U2n=e=>{let{classes:t,selected:r,hover:n,head:o,footer:i}=e;return Ct({root:["root",r&&"selected",n&&"hover",o&&"head",i&&"footer"]},jSt,t)},V2n=nt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.head&&t.head,r.footer&&t.footer]}})(Dt(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${DDe.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${DDe.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),YSt="tr",W2n=ide.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableRow"}),{className:o,component:i=YSt,hover:a=!1,selected:s=!1,...l}=n,u=ide.useContext(g_),d={...n,component:i,hover:a,selected:s,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},f=U2n(d);return(0,KSt.jsx)(V2n,{as:i,ref:r,className:gt(f.root,o),role:i===YSt?null:"row",ownerState:d,...l})}),pc=W2n;var JSt=S(oe(),1);var XSt=S(E(),1),ZSt=ot((0,XSt.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function QSt(e){return wt("MuiTableSortLabel",e)}var G2n=kt("MuiTableSortLabel",["root","active","icon","directionDesc","directionAsc"]),ade=G2n;var sde=S(E(),1),q2n=e=>{let{classes:t,direction:r,active:n}=e,o={root:["root",n&&"active",`direction${It(r)}`],icon:["icon"]};return Ct(o,QSt,t)},j2n=nt(Zt,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.active&&t.active]}})(Dt(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${ade.icon}`]:{opacity:.5}},[`&.${ade.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${ade.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),Y2n=nt("span",{name:"MuiTableSortLabel",slot:"Icon"})(Dt(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),K2n=JSt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableSortLabel"}),{active:o=!1,children:i,className:a,direction:s="asc",hideSortIcon:l=!1,IconComponent:u=ZSt,slots:d={},slotProps:f={},...p}=n,h={...n,active:o,direction:s,hideSortIcon:l,IconComponent:u},m=q2n(h),g={slots:d,slotProps:f},[y,v]=sr("root",{elementType:j2n,externalForwardedProps:g,ownerState:h,className:gt(m.root,a),ref:r,additionalProps:{internalNativeButton:!1}}),[b,x]=sr("icon",{elementType:Y2n,externalForwardedProps:g,ownerState:h,className:m.icon});return(0,sde.jsxs)(y,{disableRipple:!0,component:"span",...v,...p,children:[i,l&&!o?null:(0,sde.jsx)(b,{as:u,...x})]})}),MDe=K2n;var ji=S(oe(),1);function X2n(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function NDe(e,t,r,n={},o=()=>{}){let{ease:i=X2n,duration:a=300}=n,s=null,l=t[e],u=!1,d=()=>{u=!0},f=p=>{if(u){o(new Error("Animation cancelled"));return}s===null&&(s=p);let h=Math.min(1,(p-s)/a);if(t[e]=i(h)*(r-l)+l,h>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(f)};return l===r?(o(new Error("Element already at target position")),d):(requestAnimationFrame(f),d)}var CX=S(oe(),1);var e2t=S(E(),1),Z2n={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ODe(e){let{onChange:t,...r}=e,n=CX.useRef(),o=CX.useRef(null),i=()=>{n.current=o.current.offsetHeight-o.current.clientHeight};return _0(()=>{let a=Kk(()=>{let l=n.current;i(),l!==n.current&&t(n.current)}),s=zh(o.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[t]),CX.useEffect(()=>{i(),t(n.current)},[t]),(0,e2t.jsx)("div",{style:Z2n,...r,ref:o})}var n2t=S(oe(),1);function t2t(e){return wt("MuiTabScrollButton",e)}var Q2n=kt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),r2t=Q2n;var lde=S(E(),1),J2n=e=>{let{classes:t,orientation:r,disabled:n}=e;return Ct({root:["root",r,n&&"disabled"]},t2t,t)},eTn=nt(Zt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${r2t.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),tTn=n2t.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTabScrollButton"}),{className:o,slots:i={},slotProps:a={},direction:s,orientation:l,disabled:u,...d}=n,{nativeButton:f,...p}=d,h=Ld(),m={isRtl:h,...n},g=J2n(m),y=i.StartScrollButtonIcon??rde,v=i.EndScrollButtonIcon??nde,b=I0({elementType:y,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),x=I0({elementType:v,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return(0,lde.jsx)(eTn,{component:"div",className:gt(g.root,o),ref:r,role:null,ownerState:m,tabIndex:null,...p,style:{...p.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:s==="left"?(0,lde.jsx)(y,{...b}):(0,lde.jsx)(v,{...x})})}),BDe=tTn;function o2t(e){return wt("MuiTabs",e)}var rTn=kt("MuiTabs",["root","vertical","list","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),cde=rTn;var O1=S(E(),1),nTn=e=>{let{vertical:t,fixed:r,hideScrollbar:n,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return Ct({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},o2t,l)},oTn=nt("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${cde.scrollButtons}`]:t.scrollButtons},{[`& .${cde.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(Dt(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${cde.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),iTn=nt("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),aTn=nt("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.list,r.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),sTn=nt("span",{name:"MuiTabs",slot:"Indicator"})(Dt(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),lTn=nt(ODe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),i2t={};var cTn=ji.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTabs"}),o=Cn(),i=Ld(),{"aria-label":a,"aria-labelledby":s,action:l,centered:u=!1,children:d,className:f,component:p="div",allowScrollButtonsMobile:h=!1,indicatorColor:m="primary",onChange:g,orientation:y="horizontal",scrollButtons:v="auto",selectionFollowsFocus:b,slots:x={},slotProps:w={},textColor:C="primary",value:k,variant:_="standard",visibleScrollbar:R=!1,...D}=n,N=_==="scrollable",$=y==="vertical",P=$?"scrollTop":"scrollLeft",A=$?"top":"left",L=$?"bottom":"right",I=$?"clientHeight":"clientWidth",M=$?"height":"width",F={...n,component:p,allowScrollButtonsMobile:h,indicatorColor:m,orientation:y,vertical:$,scrollButtons:v,textColor:C,variant:_,visibleScrollbar:R,fixed:!N,hideScrollbar:N&&!R,scrollableX:N&&!$,scrollableY:N&&$,centered:u&&!N,scrollButtonsHideMobile:!h},O=nTn(F),z=I0({elementType:x.startScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:F}),U=I0({elementType:x.endScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:F}),[W,V]=ji.useState(!1),[q,Y]=ji.useState(i2t),[Z,ee]=ji.useState(!1),[K,ce]=ji.useState(!1),[ne,ge]=ji.useState(!1),he=k===!1?null:k,[me,Ce]=ji.useState(!1),[Te,We]=ji.useState({overflow:"hidden",scrollbarWidth:0}),je=new Map,Ye=ji.useRef(null),be=ji.useRef(null),Pe={slots:x,slotProps:w},Me=()=>{let yt=Ye.current,Re;if(yt){let Ue=yt.getBoundingClientRect();Re={clientWidth:yt.clientWidth,scrollLeft:yt.scrollLeft,scrollTop:yt.scrollTop,scrollWidth:yt.scrollWidth,top:Ue.top,bottom:Ue.bottom,left:Ue.left,right:Ue.right}}let se;if(yt&&k!==!1){let Ue=be.current.children;if(Ue.length>0){let et=Ue[je.get(k)];se=et?et.getBoundingClientRect():null}}return{tabsMeta:Re,tabMeta:se}},He=Tf(()=>{let{tabsMeta:yt,tabMeta:Re}=Me(),se=0,Ue;$?(Ue="top",Re&&yt&&(se=Re.top-yt.top+yt.scrollTop)):(Ue=i?"right":"left",Re&&yt&&(se=(i?-1:1)*(Re[Ue]-yt[Ue]+yt.scrollLeft)));let et={[Ue]:se,[M]:Re?Re[M]:0};if(typeof q[Ue]!="number"||typeof q[M]!="number")Y(et);else{let Xe=Math.abs(q[Ue]-et[Ue]),vt=Math.abs(q[M]-et[M]);(Xe>=1||vt>=1)&&Y(et)}}),le=(yt,{animation:Re=!0}={})=>{Re?NDe(P,Ye.current,yt,{duration:o.transitions.duration.standard}):Ye.current[P]=yt},fe=yt=>{let Re=Ye.current[P];$?Re+=yt:Re+=yt*(i?-1:1),le(Re)},ye=()=>{let yt=Ye.current[I],Re=0,se=Array.from(be.current.children);for(let Ue=0;Ue<se.length;Ue+=1){let et=se[Ue];if(Re+et[I]>yt){Ue===0&&(Re=yt);break}Re+=et[I]}return Re},ve=()=>{fe(-1*ye())},ke=()=>{fe(ye())},[de,{onChange:G,...J}]=sr("scrollbar",{className:gt(O.scrollableX,O.hideScrollbar),elementType:lTn,shouldForwardComponentProp:!0,externalForwardedProps:Pe,ownerState:F}),ae=ji.useCallback(yt=>{G?.(yt),We({overflow:null,scrollbarWidth:yt})},[G]),[j,ue]=sr("scrollButtons",{className:O.scrollButtons,elementType:BDe,externalForwardedProps:Pe,ownerState:F,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:x.startScrollButtonIcon,EndScrollButtonIcon:x.endScrollButtonIcon},slotProps:{startScrollButtonIcon:z,endScrollButtonIcon:U}}}),re=()=>{let yt={};yt.scrollbarSizeListener=N?(0,O1.jsx)(de,{...J,onChange:ae}):null;let se=N&&(v==="auto"&&(Z||K)||v===!0);return yt.scrollButtonStart=se?(0,O1.jsx)(j,{direction:i?"right":"left",onClick:ve,disabled:!Z,...ue}):null,yt.scrollButtonEnd=se?(0,O1.jsx)(j,{direction:i?"left":"right",onClick:ke,disabled:!K,...ue}):null,yt},X=Tf(yt=>{let{tabsMeta:Re,tabMeta:se}=Me();if(!(!se||!Re)){if(se[A]<Re[A]){let Ue=Re[P]+(se[A]-Re[A]);le(Ue,{animation:yt})}else if(se[L]>Re[L]){let Ue=Re[P]+(se[L]-Re[L]);le(Ue,{animation:yt})}}}),Q=Tf(()=>{N&&v!==!1&&ge(!ne)});ji.useEffect(()=>{let yt=Kk(()=>{Ye.current&&He()}),Re,se=Xe=>{Xe.forEach(vt=>{vt.removedNodes.forEach(Ft=>{Re?.unobserve(Ft)}),vt.addedNodes.forEach(Ft=>{Re?.observe(Ft)})}),yt(),Q()},Ue=zh(Ye.current);Ue.addEventListener("resize",yt);let et;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(yt),Array.from(be.current.children).forEach(Xe=>{Re.observe(Xe)})),typeof MutationObserver<"u"&&(et=new MutationObserver(se),et.observe(be.current,{childList:!0})),()=>{yt.clear(),Ue.removeEventListener("resize",yt),et?.disconnect(),Re?.disconnect()}},[He,Q]),ji.useEffect(()=>{let yt=Array.from(be.current.children),Re=yt.length;if(typeof IntersectionObserver<"u"&&Re>0&&N&&v!==!1){let se=yt[0],Ue=yt[Re-1],et={root:Ye.current,threshold:.99},Xe=Qe=>{ee(!Qe[0].isIntersecting)},vt=new IntersectionObserver(Xe,et);vt.observe(se);let Ft=Qe=>{ce(!Qe[0].isIntersecting)},Fe=new IntersectionObserver(Ft,et);return Fe.observe(Ue),()=>{vt.disconnect(),Fe.disconnect()}}},[N,v,ne,d?.length]),ji.useEffect(()=>{V(!0)},[]),ji.useEffect(()=>{He()}),ji.useEffect(()=>{X(i2t!==q)},[X,q]),ji.useImperativeHandle(l,()=>({updateIndicator:He,updateScrollButtons:Q}),[He,Q]);let[$e,we]=sr("indicator",{className:O.indicator,elementType:sTn,externalForwardedProps:Pe,ownerState:F,additionalProps:{style:q}}),Ie=(0,O1.jsx)($e,{...we}),De=lX({activeItemId:me?void 0:he,orientation:y,isRtl:i}),Oe=De.getContainerProps(),Ge=ji.Children.toArray(d).filter(ji.isValidElement).map((yt,Re)=>{let se=yt.props.value===void 0?Re:yt.props.value;return je.set(se,Re),{child:yt,index:Re,childValue:se}}).map(({child:yt,childValue:Re})=>{let se=Re===k;return ji.cloneElement(yt,{fullWidth:_==="fullWidth",indicator:se&&!W&&Ie,selected:se,selectionFollowsFocus:b,onChange:g,textColor:C,value:Re})}),Be=re(),[tt,Ee]=sr("root",{ref:r,className:gt(O.root,f),elementType:oTn,externalForwardedProps:{...Pe,...D,component:p},ownerState:F}),[Rt,qe]=sr("scroller",{ref:Ye,className:O.scroller,elementType:iTn,externalForwardedProps:Pe,ownerState:F,additionalProps:{style:{overflow:Te.overflow,[$?`margin${i?"Left":"Right"}`:"marginBottom"]:R?void 0:-Te.scrollbarWidth}}}),Lt=li(Oe.ref,be),Jt=yt=>{let Re=be.current;R1(P1(Re))?.getAttribute("role")==="tab"&&Oe.onKeyDown(yt)},[fr,Nt]=sr("list",{ref:Lt,className:O.list,elementType:aTn,externalForwardedProps:Pe,ownerState:F,getSlotProps:yt=>({...yt,onBlur:Re=>{Re.currentTarget.contains(Re.relatedTarget)||Ce(!1),yt.onBlur?.(Re)},onKeyDown:Re=>{Jt(Re),yt.onKeyDown?.(Re)},onFocus:Re=>{Ce(!0),Oe.onFocus(Re),yt.onFocus?.(Re)}})});return(0,O1.jsxs)(tt,{...Ee,children:[Be.scrollButtonStart,Be.scrollbarSizeListener,(0,O1.jsxs)(Rt,{...qe,children:[(0,O1.jsx)(fr,{"aria-label":a,"aria-labelledby":s,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...Nt,children:(0,O1.jsx)(m8.Provider,{value:De,children:Ge})}),W&&Ie]}),Be.scrollButtonEnd]})}),cA=cTn;var s2t=S(oe(),1);function a2t(e){return wt("MuiTextField",e)}var yIi=kt("MuiTextField",["root"]);var uA=S(E(),1),uTn={standard:oX,filled:rX,outlined:gX},dTn=e=>{let{classes:t}=e;return Ct({root:["root"]},a2t,t)},fTn=nt(jIe,{name:"MuiTextField",slot:"Root"})({}),pTn=s2t.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:a,className:s,color:l="primary",defaultValue:u,disabled:d=!1,error:f=!1,fullWidth:p=!1,helperText:h,id:m,inputRef:g,label:y,maxRows:v,minRows:b,multiline:x=!1,name:w,onBlur:C,onChange:k,onFocus:_,placeholder:R,required:D=!1,rows:N,select:$=!1,slots:P={},slotProps:A={},type:L,value:I,variant:M="outlined",...F}=n,O={...n,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:x,required:D,select:$,variant:M},z=dTn(O),U=Fh(m),W=h&&U?`${U}-helper-text`:void 0,V=y&&U?`${U}-label`:void 0,q=uTn[M],Y={slots:P,slotProps:A},[Z,ee]=sr("select",{elementType:h_,externalForwardedProps:Y,ownerState:O}),K=$&&ee.native,ce={},ne=Y.slotProps.inputLabel;M==="outlined"&&(ne&&typeof ne.shrink<"u"&&(ce.notched=ne.shrink),ce.label=y),$&&(K||(ce.id=void 0),ce["aria-describedby"]=void 0);let[ge,he]=sr("root",{elementType:fTn,shouldForwardComponentProp:!0,externalForwardedProps:{...Y,...F},ownerState:O,className:gt(z.root,s),ref:r,additionalProps:{disabled:d,error:f,fullWidth:p,required:D,color:l,variant:M}}),[me,Ce]=sr("input",{elementType:q,externalForwardedProps:Y,additionalProps:ce,ownerState:O}),[Te,We]=sr("inputLabel",{elementType:nDe,externalForwardedProps:Y,ownerState:O}),[je,Ye]=sr("htmlInput",{elementType:"input",externalForwardedProps:Y,ownerState:O}),[be,Pe]=sr("formHelperText",{elementType:ZIe,externalForwardedProps:Y,ownerState:O}),Me=(0,uA.jsx)(me,{"aria-describedby":W,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:x,name:w,rows:N,maxRows:v,minRows:b,type:L,value:I,id:U,inputRef:g,onBlur:C,onChange:k,onFocus:_,placeholder:R,inputProps:Ye,slots:{input:P.htmlInput?je:void 0},...Ce});return(0,uA.jsxs)(ge,{...he,children:[y!=null&&y!==""&&(0,uA.jsx)(Te,{htmlFor:$&&!K?void 0:U,id:V,...$&&!K&&{component:"div"},...We,children:y}),$?(0,uA.jsx)(Z,{"aria-describedby":W,id:U,labelId:V,value:I,input:Me,...ee,children:a}):Me,h&&(0,uA.jsx)(be,{id:W,...Pe,children:h})]})}),Yn=pTn;var kX=S(oe(),1);function l2t(e){return wt("MuiToggleButton",e)}var hTn=kt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),D2=hTn;var c2t=S(oe(),1),mTn=c2t.createContext({}),ude=mTn;var u2t=S(oe(),1),gTn=u2t.createContext(void 0),dde=gTn;function $De(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}var d2t=S(E(),1),yTn=e=>{let{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:a}=e,s={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${It(i)}`,a]};return Ct(s,l2t,t)},vTn=nt(Zt,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`size${It(r.size)}`]]}})(Dt(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${D2.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${D2.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(bn()).map(([t])=>({props:{color:t},style:{[`&.${D2.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),bTn=kX.forwardRef(function(t,r){let{value:n,...o}=kX.useContext(ude),i=kX.useContext(dde),a=yg({...o,selected:$De(t.value,n)},t),s=_t({props:a,name:"MuiToggleButton"}),{children:l,className:u,color:d="standard",disabled:f=!1,disableFocusRipple:p=!1,fullWidth:h=!1,onChange:m,onClick:g,selected:y,size:v="medium",value:b,...x}=s,w={...s,color:d,disabled:f,disableFocusRipple:p,fullWidth:h,size:v},C=yTn(w),k=R=>{g&&(g(R,b),R.defaultPrevented)||m&&m(R,b)},_=i||"";return(0,d2t.jsx)(vTn,{className:gt(o.className,C.root,u,_),internalNativeButton:!0,disabled:f,focusRipple:!p,ref:r,onClick:k,onChange:m,value:b,ownerState:w,"aria-pressed":y,...x,children:l})}),Rs=bTn;var dA=S(oe(),1);function f2t(e){return wt("MuiToggleButtonGroup",e)}var xTn=kt("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","fullWidth","firstButton","lastButton","middleButton"]),Ha=xTn;var fde=S(E(),1),STn=e=>{let{classes:t,orientation:r,fullWidth:n,disabled:o}=e;return Ct({root:["root",r,n&&"fullWidth"],grouped:["grouped",o&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]},f2t,t)},TTn=nt("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${Ha.grouped}`]:t.grouped},{[`& .${Ha.firstButton}`]:t.firstButton},{[`& .${Ha.lastButton}`]:t.lastButton},{[`& .${Ha.middleButton}`]:t.middleButton},t.root,r.orientation==="vertical"&&t.vertical,r.fullWidth&&t.fullWidth]}})(Dt(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Ha.grouped}`]:{[`&.${Ha.selected} + .${Ha.grouped}.${Ha.selected}`]:{borderTop:0,marginTop:0}},[`& .${Ha.firstButton},& .${Ha.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Ha.lastButton},& .${Ha.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Ha.lastButton}.${D2.disabled},& .${Ha.middleButton}.${D2.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Ha.grouped}`]:{[`&.${Ha.selected} + .${Ha.grouped}.${Ha.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Ha.firstButton},& .${Ha.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Ha.lastButton},& .${Ha.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Ha.lastButton}.${D2.disabled},& .${Ha.middleButton}.${D2.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),wTn=dA.forwardRef(function(t,r){let n=_t({props:t,name:"MuiToggleButtonGroup"}),{children:o,className:i,color:a="standard",disabled:s=!1,exclusive:l=!1,fullWidth:u=!1,onChange:d,orientation:f="horizontal",size:p="medium",value:h,...m}=n,g={...n,disabled:s,fullWidth:u,orientation:f,size:p},y=STn(g),v=dA.useCallback((_,R)=>{if(!d)return;let D=h&&h.indexOf(R),N;h&&D>=0?(N=h.slice(),N.splice(D,1)):N=h?h.concat(R):[R],d(_,N)},[d,h]),b=dA.useCallback((_,R)=>{d&&d(_,h===R?null:R)},[d,h]),x=dA.useMemo(()=>({className:y.grouped,onChange:l?b:v,value:h,size:p,fullWidth:u,color:a,disabled:s}),[y.grouped,l,b,v,h,p,u,a,s]),w=r8(o),C=w.length,k=_=>{let R=_===0,D=_===C-1;return R&&D?"":R?y.firstButton:D?y.lastButton:y.middleButton};return(0,fde.jsx)(TTn,{role:"group",className:gt(y.root,i),ref:r,ownerState:g,...m,children:(0,fde.jsx)(ude.Provider,{value:x,children:w.map((_,R)=>(0,fde.jsx)(dde.Provider,{value:k(R),children:_},R))})})}),Kc=wTn;var CTn=LLe({themeId:cc}),p2t=CTn;var Dfn=S(oe(),1);var Mfn=S(zkt(),1);var Op=S(oe(),1),Fr=S(oe(),1),dn=S(oe(),1),q7e=S(oe(),1),uEt=S(oe(),1),No=S(oe(),1),W_n=S(oe(),1),G_n=S(oe(),1),q_n=S(oe(),1),fn=S(oe(),1),TEt=S(oe(),1),aEn={};var y_t=e=>{throw TypeError(e)},v_t=(e,t,r)=>t.has(e)||y_t("Cannot "+r),$g=(e,t,r)=>(v_t(e,t,"read from private field"),r?r.call(e):t.get(e)),RZ=(e,t,r)=>t.has(e)?y_t("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),W1=(e,t,r,n)=>(v_t(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Qfe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Jfe=/^[\\/]{2}/;function b_t(e,t){return t+e.replace(/\\/g,"/")}var Hkt="popstate";function Ukt(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function x_t(e={}){function t(n,o){let i=o.state?.masked,{pathname:a,search:s,hash:l}=i||n.location;return LZ("",{pathname:a,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default",i?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,o){return typeof o=="string"?o:Hd(o)}return QCn(t,r,null,e)}function qn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ls(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZCn(){return Math.random().toString(36).substring(2,10)}function Vkt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function LZ(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Hg(t):t,state:r,key:t&&t.key||n||ZCn(),mask:o}}function Hd({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Hg(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function QCn(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:i=!1}=n,a=o.history,s="POP",l=null,u=d();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function d(){return(a.state||{idx:null}).idx}function f(){s="POP";let y=d(),v=y==null?null:y-u;u=y,l&&l({action:s,location:g.location,delta:v})}function p(y,v){s="PUSH";let b=Ukt(y)?y:LZ(g.location,y,v);r&&r(b,y),u=d()+1;let x=Vkt(b,u),w=g.createHref(b.mask||b);try{a.pushState(x,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(w)}i&&l&&l({action:s,location:g.location,delta:1})}function h(y,v){s="REPLACE";let b=Ukt(y)?y:LZ(g.location,y,v);r&&r(b,y),u=d();let x=Vkt(b,u),w=g.createHref(b.mask||b);a.replaceState(x,"",w),i&&l&&l({action:s,location:g.location,delta:0})}function m(y){return S_t(o,y)}let g={get action(){return s},get location(){return e(o,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Hkt,f),l=y,()=>{o.removeEventListener(Hkt,f),l=null}},createHref(y){return t(o,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(y){return a.go(y)}};return g}function S_t(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),qn(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Hd(t);return o=o.replace(/ $/,"%20"),!r&&Jfe.test(o)&&(o=n+o),new URL(o,n)}var PZ,T7e=class{constructor(e){if(RZ(this,PZ,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if($g(this,PZ).has(e))return $g(this,PZ).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){$g(this,PZ).set(e,t)}};PZ=new WeakMap;var JCn=new Set(["lazy","caseSensitive","path","id","index","children"]);function ekn(e){return JCn.has(e)}var tkn=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function rkn(e){return tkn.has(e)}function nkn(e){return e.index===!0}function IZ(e,t,r=[],n={},o=!1){return e.map((i,a)=>{let s=[...r,String(a)],l=typeof i.id=="string"?i.id:s.join("-");if(qn(i.index!==!0||!i.children,"Cannot specify children on an index route"),qn(o||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),nkn(i)){let u={...i,id:l};return n[l]=Wkt(u,t(u)),u}else{let u={...i,id:l,children:void 0};return n[l]=Wkt(u,t(u)),i.children&&(u.children=IZ(i.children,t,s,n,o)),u}})}function Wkt(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function P7e(e,t,r="/"){return W0(e,t,r,!1)}function W0(e,t,r,n,o){let i=typeof t=="string"?Hg(t):t,a=Pf(i.pathname||"/",r);if(a==null)return null;let s=o??Gfe(e),l=null,u=E_t(a);for(let d=0;l==null&&d<s.length;++d)l=pkn(s[d],u,n);return l}function T_t(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Gfe(e){let t=w_t(e);return okn(t),t}function w_t(e,t=[],r=[],n="",o=!1){let i=(a,s,l=o,u)=>{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&l)return;qn(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let f=zg([n,d.relativePath]),p=r.concat(d);a.children&&a.children.length>0&&(qn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),w_t(a.children,t,p,f,l)),!(a.path==null&&!a.index)&&t.push({path:f,score:dkn(f,a.index),routesMeta:p.map((h,m)=>{let[g,y]=__t(h.relativePath,h.caseSensitive,m===p.length-1);return{...h,matcher:g,compiledParams:y}})})};return e.forEach((a,s)=>{if(a.path===""||!a.path?.includes("?"))i(a,s);else for(let l of C_t(a.path))i(a,s,!0,l)}),t}function C_t(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return o?[i,""]:[i];let a=C_t(n.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function okn(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fkn(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var ikn=/^:[\w-]+$/,akn=3,skn=2,lkn=1,ckn=10,ukn=-2,Gkt=e=>e==="*";function dkn(e,t){let r=e.split("/"),n=r.length;return r.some(Gkt)&&(n+=ukn),t&&(n+=skn),r.filter(o=>!Gkt(o)).reduce((o,i)=>o+(ikn.test(i)?akn:i===""?lkn:ckn),n)}function fkn(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function pkn(e,t,r=!1){let{routesMeta:n}=e,o={},i="/",a=[];for(let s=0;s<n.length;++s){let l=n[s],u=s===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f={path:l.relativePath,caseSensitive:l.caseSensitive,end:u},p=l.matcher&&l.compiledParams?k_t(f,d,l.matcher,l.compiledParams):SO(f,d),h=l.route;if(!p&&u&&r&&!n[n.length-1].route.index&&(p=SO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!p)return null;Object.assign(o,p.params),a.push({params:o,pathname:zg([i,p.pathname]),pathnameBase:mkn(zg([i,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(i=zg([i,p.pathnameBase]))}return a}function SO(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=__t(e.path,e.caseSensitive,e.end);return k_t(e,t,r,n)}function k_t(e,t,r,n){let o=t.match(r);if(!o)return null;let i=o[0],a=TO(i,1),s=o.slice(1);return{params:n.reduce((u,{paramName:d,isOptional:f},p)=>{if(d==="*"){let m=s[p]||"";a=TO(i.slice(0,i.length-m.length),1)}let h=s[p];return f&&!h?u[d]=void 0:u[d]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function __t(e,t=!1,r=!0){ls(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l,u,d)=>{if(n.push({paramName:s,isOptional:l!=null}),l){let f=d.charAt(u+a.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function E_t(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ls(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Pf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function hkn({basename:e,pathname:t}){return t==="/"?e:zg([e,t])}var A7e=e=>Qfe.test(e);function R_t(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Hg(e):e,i;return r?(r=L7e(r),r.startsWith("/")||r.startsWith("\\")?i=qkt(r.substring(1),"/"):i=qkt(r,t)):i=t,{pathname:i,search:gkn(n),hash:ykn(o)}}function qkt(e,t){let r=TO(t).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function y7e(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function P_t(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function epe(e){let t=P_t(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function DZ(e,t,r,n=!1){let o;typeof e=="string"?o=Hg(e):(o={...e},qn(!o.pathname||!o.pathname.includes("?"),y7e("?","pathname","search",o)),qn(!o.pathname||!o.pathname.includes("#"),y7e("#","pathname","hash",o)),qn(!o.search||!o.search.includes("#"),y7e("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=r;else{let f=t.length-1;if(!n&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;o.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=R_t(o,s),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}var L7e=e=>e.replace(/[\\/]{2,}/g,"/"),zg=e=>L7e(e.join("/"));function TO(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var mkn=e=>TO(e).replace(/^\/*/,"/"),gkn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ykn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var vkn=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CO=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function wO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function MZ(e){let t=e.map(r=>r.route.path).filter(Boolean);return zg(t)||"/"}var A_t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function L_t(e,t){let r=e;if(typeof r!="string"||!Qfe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(A_t)try{let i=new URL(window.location.href),a=Jfe.test(r)?new URL(b_t(r,i.protocol)):new URL(r),s=Pf(a.pathname,t);a.origin===i.origin&&s!=null?r=s+a.search+a.hash:o=!0}catch{ls(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}var q_=Symbol("Uninstrumented");function bkn(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(i){let a=Object.keys(r);for(let s of a)i[s]&&r[s].push(i[s])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=yO(r.lazy,t.lazy,()=>{});o&&(n.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(i=>{let a=o[i],s=r[`lazy.${i}`];if(typeof a=="function"&&s.length>0){let l=yO(s,a,()=>{});l&&(n.lazy=Object.assign(n.lazy||{},{[i]:l}))}})}return["loader","action"].forEach(o=>{let i=t[o];if(typeof i=="function"&&r[o].length>0){let a=i[q_]??i,s=yO(r[o],a,(...l)=>jkt(l[0]));s&&(o==="loader"&&a.hydrate===!0&&(s.hydrate=!0),s[q_]=a,n[o]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(o=>{let i=o[q_]??o,a=yO(r.middleware,i,(...s)=>jkt(s[0]));return a?(a[q_]=i,a):o})),n}function xkn(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(o){let i=Object.keys(o);for(let a of i)o[a]&&r[a].push(o[a])}})),r.navigate.length>0){let n=e.navigate[q_]??e.navigate,o=yO(r.navigate,n,(...i)=>{let[a,s]=i;return{to:typeof a=="number"||typeof a=="string"?a:a?Hd(a):".",...Ykt(e,s??{})}});o&&(o[q_]=n,e.navigate=o)}if(r.fetch.length>0){let n=e.fetch[q_]??e.fetch,o=yO(r.fetch,n,(...i)=>{let[a,,s,l]=i;return{href:s??".",fetcherKey:a,...Ykt(e,l??{})}});o&&(o[q_]=n,e.fetch=o)}return e}function yO(e,t,r){return e.length===0?null:async(...n)=>{let o=await I_t(e,r(...n),()=>t(...n),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function I_t(e,t,r,n){let o=e[n],i;if(o){let a,s=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=I_t(e,t,r,n-1),i=await a,qn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await o(s,t)}catch(l){console.error("An instrumentation function threw an error:",l)}a||await s(),await a}else try{i={type:"success",value:await r()}}catch(a){i={type:"error",value:a}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function jkt(e){let{request:t,context:r,params:n,pattern:o}=e;return{request:Skn(t),params:{...n},pattern:o,context:Tkn(r)}}function Ykt(e,t){return{currentUrl:Hd(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Skn(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Tkn(e){if(Ckn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var wkn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ckn(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===wkn}var Kkt=new URL("http://localhost");function I7e(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Kkt)}catch{return Kkt}}function v7e(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function kkn(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function vO(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let i=new URL(t,r),a=o!=null&&!v7e(o,r),s=!v7e(i,r);if(n==="reject"){if(a||s)throw new Error("External navigation is not allowed")}else if(s&&(o==null||!kkn(e,o)||!v7e(o,i)))throw new Error("External navigation is not allowed")}var D_t=["POST","PUT","PATCH","DELETE"],_kn=new Set(D_t),Ekn=["GET",...D_t],Rkn=new Set(Ekn),M_t=new Set([301,302,303,307,308]),Pkn=new Set([307,308]),qfe={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},N_t={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},DA={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Akn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),O_t="remix-router-transitions",B_t=Symbol("ResetLoaderData"),IA,hO,W_,mO,Lkn=class{constructor(e){RZ(this,IA),RZ(this,hO),RZ(this,W_),RZ(this,mO),W1(this,IA,e),W1(this,hO,Gfe(e))}get stableRoutes(){return $g(this,IA)}get activeRoutes(){return $g(this,W_)??$g(this,IA)}get branches(){return $g(this,mO)??$g(this,hO)}get hasHMRRoutes(){return $g(this,W_)!=null}setRoutes(e){W1(this,IA,e),W1(this,hO,Gfe(e))}setHmrRoutes(e){W1(this,W_,e),W1(this,mO,Gfe(e))}commitHmrRoutes(){$g(this,W_)&&(W1(this,IA,$g(this,W_)),W1(this,hO,$g(this,mO)),W1(this,W_,void 0),W1(this,mO,void 0))}};IA=new WeakMap;hO=new WeakMap;W_=new WeakMap;mO=new WeakMap;function $_t(e){let t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";qn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Akn,i=o;if(e.instrumentations){let Re=e.instrumentations;i=se=>({...o(se),...bkn(Re.map(Ue=>Ue.route).filter(Boolean),se)})}let a={},s=new Lkn(IZ(e.routes,i,void 0,a)),l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let u=e.dataStrategy||Okn,d={...e.future},f=null,p=new Set,h=null,m=null,g=null,y=null,v=e.hydrationData!=null,b=W0(s.activeRoutes,e.history.location,l,!1,s.branches),x=!1,w=null,C,k;if(b==null&&!e.patchRoutesOnNavigation){let Re=Fg(404,{pathname:e.history.location.pathname}),{matches:se,route:Ue}=Hfe(s.activeRoutes);C=!0,k=!C,b=se,w={[Ue.id]:Re}}else if(b&&!e.hydrationData&&Lt(b,s.activeRoutes,e.history.location.pathname).active&&(b=null),b)if(b.some(Re=>Re.route.lazy))C=!1,k=!C;else if(!b.some(Re=>D7e(Re.route)))C=!0,k=!C;else{let Re=e.hydrationData?e.hydrationData.loaderData:null,se=e.hydrationData?e.hydrationData.errors:null,Ue=b;if(se){let et=b.findIndex(Xe=>se[Xe.route.id]!==void 0);Ue=Ue.slice(0,et+1)}k=!1,C=!0,Ue.forEach(et=>{let Xe=F_t(et.route,Re,se);k=k||Xe.renderFallback,C=C&&!Xe.shouldLoad})}else{C=!1,k=!C,b=[];let Re=Lt(null,s.activeRoutes,e.history.location.pathname);Re.active&&Re.matches&&(x=!0,b=Re.matches)}let _,R={historyAction:e.history.action,location:e.history.location,matches:b,initialized:C,renderFallback:k,navigation:qfe,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},D="POP",N=null,$=!1,P,A=!1,L=new Map,I=null,M=!1,F=!1,O=new Set,z=new Map,U=0,W=-1,V=new Map,q=new Set,Y=new Map,Z=new Map,ee=new Set,K=new Map,ce,ne=null;function ge(){if(f=e.history.listen(({action:Re,location:se,delta:Ue})=>{if(ce){ce(),ce=void 0;return}ls(K.size===0||Ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let et=Ge({currentLocation:R.location,nextLocation:se,historyAction:Re});if(et&&Ue!=null){let Xe=new Promise(vt=>{ce=vt});e.history.go(Ue*-1),Le(et,{state:"blocked",location:se,proceed(){Le(et,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),Xe.then(()=>e.history.go(Ue))},reset(){let vt=new Map(R.blockers);vt.set(et,DA),Ce({blockers:vt})}}),N?.resolve(),N=null;return}return Ye(Re,se)}),r){t_n(t,L);let Re=()=>r_n(t,L);t.addEventListener("pagehide",Re),I=()=>t.removeEventListener("pagehide",Re)}return R.initialized||Ye("POP",R.location,{initialHydration:!0}),_}function he(){f&&f(),I&&I(),p.clear(),P&&P.abort(),R.fetchers.forEach((Re,se)=>re(R.fetchers,se)),R.blockers.forEach((Re,se)=>Oe(se))}function me(Re){if(p.add(Re),h){let{newErrors:se}=h;h=null,Re(R,{deletedFetchers:[],newErrors:se,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(Re)}function Ce(Re,se={}){Re.matches&&(Re.matches=Re.matches.map(Xe=>{let vt=a[Xe.route.id],Ft=Xe.route;return Ft.element!==vt.element||Ft.errorElement!==vt.errorElement||Ft.hydrateFallbackElement!==vt.hydrateFallbackElement?{...Xe,route:vt}:Xe})),R={...R,...Re};let Ue=[],et=[];R.fetchers.forEach((Xe,vt)=>{Xe.state==="idle"&&(ee.has(vt)?Ue.push(vt):et.push(vt))}),ee.forEach(Xe=>{!R.fetchers.has(Xe)&&!z.has(Xe)&&Ue.push(Xe)}),p.size===0&&(h={newErrors:Re.errors??null}),[...p].forEach(Xe=>Xe(R,{deletedFetchers:Ue,newErrors:Re.errors??null,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),Ue.forEach(Xe=>re(R.fetchers,Xe)),et.forEach(Xe=>R.fetchers.delete(Xe))}function Te(Re,se,{flushSync:Ue}={}){let et=R.actionData!=null&&R.navigation.formMethod!=null&&zd(R.navigation.formMethod)&&R.navigation.state==="loading"&&Re.state?._isRedirect!==!0,Xe;se.actionData?Object.keys(se.actionData).length>0?Xe=se.actionData:Xe=null:et?Xe=R.actionData:Xe=null;let vt=se.loaderData?i_t(R.loaderData,se.loaderData,se.matches||[],se.errors):R.loaderData,Ft=R.blockers;Ft.size>0&&(Ft=new Map(Ft),Ft.forEach((ht,Ut)=>Ft.set(Ut,DA)));let Fe=M?!1:qe(Re,se.matches||R.matches),Qe=$===!0||R.navigation.formMethod!=null&&zd(R.navigation.formMethod)&&Re.state?._isRedirect!==!0;s.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(Re,Re.state):D==="REPLACE"&&e.history.replace(Re,Re.state));let mt;if(D==="POP"&&!M&&Re!==R.location){let ht=L.get(R.location.pathname);ht&&ht.has(Re.pathname)?mt={currentLocation:R.location,nextLocation:Re}:L.has(Re.pathname)&&(mt={currentLocation:Re,nextLocation:R.location})}else if(A){let ht=L.get(R.location.pathname);ht?ht.add(Re.pathname):(ht=new Set([Re.pathname]),L.set(R.location.pathname,ht)),mt={currentLocation:R.location,nextLocation:Re}}Ce({...se,actionData:Xe,loaderData:vt,historyAction:D,location:Re,initialized:!0,renderFallback:!1,navigation:qfe,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Qe,blockers:Ft},{viewTransitionOpts:mt,flushSync:Ue===!0}),D="POP",$=!1,A=!1,M=!1,F=!1,N?.resolve(),N=null,ne?.resolve(),ne=null}async function We(Re,se){if(N?.resolve(),N=null,typeof Re=="number"){N||(N=c_t());let er=N.promise;return e.history.go(Re),er}let Ue=w7e(R.location,R.matches,l,Re,se?.fromRouteId,se?.relative),{path:et,submission:Xe,error:vt}=Xkt(!1,Ue,se),Ft;if(se?.mask){let er=typeof se.mask=="string"?Hg(se.mask):{...R.location.mask,...se.mask};if(Ft={pathname:er.pathname??"",search:er.search??"",hash:er.hash??""},Jfe.test(Ft.pathname))throw new Error("External navigation is not allowed");Ft.pathname.startsWith("\\")&&(Ft.pathname=Ft.pathname.replace(/^\\+/,"/")),vO(typeof se.mask=="string"?se.mask:Hd(se.mask),Hd(Ft),e.history.createURL("/"),"reject")}let Fe=R.location,Qe=LZ(Fe,et,se&&se.state,void 0,Ft);Qe={...Qe,...e.history.encodeLocation(Qe)},vO(Re==null?e.history.createHref(R.location):typeof Re=="string"?Re:Hd(Re),e.history.createHref(Qe.mask||Qe),e.history.createURL("/"),"reject");let mt=se&&se.replace!=null?se.replace:void 0,ht="PUSH";mt===!0?ht="REPLACE":mt===!1||Xe!=null&&zd(Xe.formMethod)&&Xe.formAction===R.location.pathname+R.location.search&&(ht="REPLACE");let Ut=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,or=(se&&se.flushSync)===!0,cr=Ge({currentLocation:Fe,nextLocation:Qe,historyAction:ht});if(cr){Le(cr,{state:"blocked",location:Qe,proceed(){Le(cr,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),We(Re,se)},reset(){let er=new Map(R.blockers);er.set(cr,DA),Ce({blockers:er})}});return}await Ye(ht,Qe,{submission:Xe,pendingError:vt,preventScrollReset:Ut,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:or,callSiteDefaultShouldRevalidate:se&&se.defaultShouldRevalidate})}function je(){ne||(ne=c_t()),G(),Ce({revalidation:"loading"});let Re=ne.promise;return R.navigation.state==="submitting"?Re:R.navigation.state==="idle"?(Ye(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),Re):(Ye(D||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:A===!0}),Re)}async function Ye(Re,se,Ue){P&&P.abort(),P=null,D=Re,M=(Ue&&Ue.startUninterruptedRevalidation)===!0,Rt(R.location,R.matches),$=(Ue&&Ue.preventScrollReset)===!0,A=(Ue&&Ue.enableViewTransition)===!0;let et=s.activeRoutes,Xe=Ue?.initialHydration&&R.matches&&R.matches.length>0&&!x?R.matches:W0(et,se,l,!1,s.branches),vt=(Ue&&Ue.flushSync)===!0;if(Xe&&R.initialized&&!F&&Gkn(R.location,se)&&!(Ue&&Ue.submission&&zd(Ue.submission.formMethod))){Te(se,{matches:Xe},{flushSync:vt});return}let Ft=Lt(Xe,et,se.pathname);if(Ft.active&&Ft.matches&&(Xe=Ft.matches),!Xe){let{error:at,notFoundMatches:ft,route:Mt}=Be(se.pathname);Te(se,{matches:ft,loaderData:{},errors:{[Mt.id]:at}},{flushSync:vt});return}let Fe=Ue&&Ue.overrideNavigation?{...Ue.overrideNavigation,matches:Xe,historyAction:Re}:void 0;P=new AbortController;let Qe=gO(e.history,se,P.signal,Ue&&Ue.submission),mt=e.getContext?await e.getContext():new T7e,ht;if(Ue&&Ue.pendingError)ht=[G_(Xe).route.id,{type:"error",error:Ue.pendingError}];else if(Ue&&Ue.submission&&zd(Ue.submission.formMethod)){let at=await be(Qe,se,Ue.submission,Xe,Re,mt,Ft.active,Ue&&Ue.initialHydration===!0,{replace:Ue.replace,flushSync:vt});if(at.shortCircuited)return;if(at.pendingActionResult){let[ft,Mt]=at.pendingActionResult;if(rm(Mt)&&wO(Mt.error)&&Mt.error.status===404){P=null,Te(se,{matches:at.matches,loaderData:{},errors:{[ft]:Mt.error}});return}}Xe=at.matches||Xe,ht=at.pendingActionResult,Fe=b7e(se,Xe,Re,Ue.submission),vt=!1,Ft.active=!1,Qe=gO(e.history,Qe.url,Qe.signal)}let{shortCircuited:Ut,matches:or,loaderData:cr,errors:er,workingFetchers:Tr}=await Pe(Qe,se,Xe,Re,mt,Ft.active,Fe,Ue&&Ue.submission,Ue&&Ue.fetcherSubmission,Ue&&Ue.replace,Ue&&Ue.initialHydration===!0,vt,ht,Ue&&Ue.callSiteDefaultShouldRevalidate);Ut||(P=null,Te(se,{matches:or||Xe,...a_t(ht),loaderData:cr,errors:er,...Tr?{fetchers:Tr}:{}}))}async function be(Re,se,Ue,et,Xe,vt,Ft,Fe,Qe={}){G();let mt=Jkn(se,et,Xe,Ue);if(Ce({navigation:mt},{flushSync:Qe.flushSync===!0}),Ft){let or=await Jt(et,se.pathname,Re.signal);if(or.type==="aborted")return{shortCircuited:!0};if(or.type==="error"){if(or.partialMatches.length===0){let{matches:er,route:Tr}=Hfe(s.activeRoutes);return{matches:er,pendingActionResult:[Tr.id,{type:"error",error:or.error}]}}let cr=G_(or.partialMatches).route.id;return{matches:or.partialMatches,pendingActionResult:[cr,{type:"error",error:or.error}]}}else if(or.matches)et=or.matches;else{let{notFoundMatches:cr,error:er,route:Tr}=Be(se.pathname);return{matches:cr,pendingActionResult:[Tr.id,{type:"error",error:er}]}}}let ht,Ut=jfe(et,se);if(!Ut.route.action&&!Ut.route.lazy)ht={type:"error",error:Fg(405,{method:Re.method,pathname:se.pathname,routeId:Ut.route.id})};else{let or=bO(i,a,Re,se,et,Ut,Fe?[]:n,vt),cr=await ke(Re,se,or,vt,null);if(ht=cr[Ut.route.id],!ht){for(let er of et)if(cr[er.route.id]){ht=cr[er.route.id];break}}if(Re.signal.aborted)return{shortCircuited:!0}}if(MA(ht)){let or;return Qe&&Qe.replace!=null?or=Qe.replace:or=r_t(ht.response.headers.get("Location"),new URL(Re.url),l,e.history)===R.location.pathname+R.location.search,await ve(Re,ht,!0,{submission:Ue,replace:or}),{shortCircuited:!0}}if(rm(ht)){let or=G_(et,Ut.route.id);return(Qe&&Qe.replace)!==!0&&(D="PUSH"),{matches:et,pendingActionResult:[or.route.id,ht,Ut.route.id]}}return{matches:et,pendingActionResult:[Ut.route.id,ht]}}async function Pe(Re,se,Ue,et,Xe,vt,Ft,Fe,Qe,mt,ht,Ut,or,cr){let er=Ft||b7e(se,Ue,et,Fe),Tr=Fe||Qe||l_t(er),at=!M&&!ht;if(vt){if(at){let Qn=Me(or);Ce({navigation:er,...Qn!==void 0?{actionData:Qn}:{}},{flushSync:Ut})}let Ne=await Jt(Ue,se.pathname,Re.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){if(Ne.partialMatches.length===0){let{matches:Ke,route:Yr}=Hfe(s.activeRoutes);return{matches:Ke,loaderData:{},errors:{[Yr.id]:Ne.error}}}let Qn=G_(Ne.partialMatches).route.id;return{matches:Ne.partialMatches,loaderData:{},errors:{[Qn]:Ne.error}}}else if(Ne.matches)Ue=Ne.matches;else{let{error:Qn,notFoundMatches:Ke,route:Yr}=Be(se.pathname);return{matches:Ke,loaderData:{},errors:{[Yr.id]:Qn}}}}let ft=s.activeRoutes,{dsMatches:Mt,revalidatingFetchers:kr}=Zkt(Re,Xe,i,a,e.history,R,Ue,Tr,se,ht?[]:n,ht===!0,F,O,ee,Y,q,ft,l,e.patchRoutesOnNavigation!=null,s.branches,or,cr);if(W=++U,!e.dataStrategy&&!Mt.some(Ne=>Ne.shouldLoad)&&!Mt.some(Ne=>Ne.route.middleware&&Ne.route.middleware.length>0)&&kr.length===0){let Ne=new Map(R.fetchers),Qn=we(Ne);return Te(se,{matches:Ue,loaderData:{},errors:or&&rm(or[1])?{[or[0]]:or[1].error}:null,...a_t(or),...Qn?{fetchers:Ne}:{}},{flushSync:Ut}),{shortCircuited:!0}}if(at){let Ne={};if(!vt){Ne.navigation=er;let Qn=Me(or);Qn!==void 0&&(Ne.actionData=Qn)}kr.length>0&&(Ne.fetchers=He(kr)),Ce(Ne,{flushSync:Ut})}kr.forEach(Ne=>{Q(Ne.key),Ne.controller&&z.set(Ne.key,Ne.controller)});let Ar=()=>kr.forEach(Ne=>Q(Ne.key));P&&P.signal.addEventListener("abort",Ar);let{loaderResults:mn,fetcherResults:uo}=await de(Mt,kr,Re,se,Xe);if(Re.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Ar),kr.forEach(Ne=>z.delete(Ne.key));let rn=Ufe(mn);if(rn)return await ve(Re,rn.result,!0,{replace:mt}),{shortCircuited:!0};if(rn=Ufe(uo),rn)return q.add(rn.key),await ve(Re,rn.result,!0,{replace:mt}),{shortCircuited:!0};let tr=new Map(R.fetchers),{loaderData:jt,errors:ur}=o_t(R,Ue,mn,or,kr,uo,tr);ht&&R.errors&&(ur={...R.errors,...ur});let mr=we(tr),Yt=Ie(W,tr),jr=mr||Yt||kr.length>0;return{matches:Ue,loaderData:jt,errors:ur,...jr?{workingFetchers:tr}:{}}}function Me(Re){if(Re&&!rm(Re[1]))return{[Re[0]]:Re[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function He(Re){let se=new Map(R.fetchers);return Re.forEach(Ue=>{let et=se.get(Ue.key),Xe=_Z(void 0,et?et.data:void 0);se.set(Ue.key,Xe)}),se}async function le(Re,se,Ue,et){Q(Re);let Xe=(et&&et.flushSync)===!0,vt=s.activeRoutes,Ft=w7e(R.location,R.matches,l,Ue,se,et?.relative),Fe=W0(vt,Ft,l,!1,s.branches),Qe=Lt(Fe,vt,Ft);if(Qe.active&&Qe.matches&&(Fe=Qe.matches),!Fe){ae(Re,se,Fg(404,{pathname:Ft}),{flushSync:Xe});return}let{path:mt,submission:ht,error:Ut}=Xkt(!0,Ft,et);if(Ut){ae(Re,se,Ut,{flushSync:Xe});return}let or=e.getContext?await e.getContext():new T7e,cr=(et&&et.preventScrollReset)===!0;if(ht&&zd(ht.formMethod)){await fe(Re,se,mt,Fe,or,Qe.active,Xe,cr,ht,et&&et.defaultShouldRevalidate);return}Y.set(Re,{routeId:se,path:mt}),await ye(Re,se,mt,Fe,or,Qe.active,Xe,cr,ht)}async function fe(Re,se,Ue,et,Xe,vt,Ft,Fe,Qe,mt){G(),Y.delete(Re);let ht=R.fetchers.get(Re);J(Re,e_n(Qe,ht),{flushSync:Ft});let Ut=new AbortController,or=gO(e.history,Ue,Ut.signal,Qe);if(vt){let Xo=await Jt(et,new URL(or.url).pathname,or.signal,Re);if(Xo.type==="aborted")return;if(Xo.type==="error"){ae(Re,se,Xo.error,{flushSync:Ft});return}else if(Xo.matches)et=Xo.matches;else{ae(Re,se,Fg(404,{pathname:Ue}),{flushSync:Ft});return}}let cr=jfe(et,Ue);if(!cr.route.action&&!cr.route.lazy){let Xo=Fg(405,{method:Qe.formMethod,pathname:Ue,routeId:se});ae(Re,se,Xo,{flushSync:Ft});return}z.set(Re,Ut);let er=U,Tr=bO(i,a,or,Ue,et,cr,n,Xe),at=await ke(or,Ue,Tr,Xe,Re),ft=at[cr.route.id];if(!ft){for(let Xo of Tr)if(at[Xo.route.id]){ft=at[Xo.route.id];break}}if(or.signal.aborted){z.get(Re)===Ut&&z.delete(Re);return}if(ee.has(Re)){if(MA(ft)||rm(ft)){J(Re,G1(void 0));return}}else{if(MA(ft))if(z.delete(Re),W>er){J(Re,G1(void 0));return}else return q.add(Re),J(Re,_Z(Qe)),ve(or,ft,!1,{fetcherSubmission:Qe,preventScrollReset:Fe});if(rm(ft)){ae(Re,se,ft.error);return}}let Mt=R.navigation.location||R.location,kr=gO(e.history,Mt,Ut.signal),Ar=s.activeRoutes,mn=R.navigation.state!=="idle"?W0(Ar,R.navigation.location,l,!1,s.branches):R.matches;qn(mn,"Didn't find any matches after fetcher action");let uo=++U;V.set(Re,uo);let{dsMatches:rn,revalidatingFetchers:tr}=Zkt(kr,Xe,i,a,e.history,R,mn,Qe,Mt,n,!1,F,O,ee,Y,q,Ar,l,e.patchRoutesOnNavigation!=null,s.branches,[cr.route.id,ft],mt),jt=_Z(Qe,ft.data),ur=new Map(R.fetchers);ur.set(Re,jt),tr.filter(Xo=>Xo.key!==Re).forEach(Xo=>{let Pd=Xo.key,b1=ur.get(Pd),$a=_Z(void 0,b1?b1.data:void 0);ur.set(Pd,$a),Q(Pd),Xo.controller&&z.set(Pd,Xo.controller)}),Ce({fetchers:ur});let mr=()=>tr.forEach(Xo=>Q(Xo.key));Ut.signal.addEventListener("abort",mr);let{loaderResults:Yt,fetcherResults:jr}=await de(rn,tr,kr,Mt,Xe);if(Ut.signal.aborted)return;Ut.signal.removeEventListener("abort",mr),V.delete(Re),z.delete(Re),tr.forEach(Xo=>z.delete(Xo.key));let Ne=R.fetchers.has(Re),Qn=Xo=>{if(!Ne)return Xo;let Pd=new Map(Xo.fetchers);return Pd.set(Re,G1(ft.data)),{...Xo,fetchers:Pd}},Ke=Ufe(Yt);if(Ke)return R=Qn(R),ve(kr,Ke.result,!1,{preventScrollReset:Fe});if(Ke=Ufe(jr),Ke)return q.add(Ke.key),R=Qn(R),ve(kr,Ke.result,!1,{preventScrollReset:Fe});let Yr=new Map(R.fetchers);Ne&&Yr.set(Re,G1(ft.data));let{loaderData:zs,errors:mf}=o_t(R,mn,Yt,void 0,tr,jr,Yr);Ie(uo,Yr),R.navigation.state==="loading"&&uo>W?(qn(D,"Expected pending action"),P&&P.abort(),Te(R.navigation.location,{matches:mn,loaderData:zs,errors:mf,fetchers:Yr})):(Ce({errors:mf,loaderData:i_t(R.loaderData,zs,mn,mf),fetchers:Yr}),F=!1)}async function ye(Re,se,Ue,et,Xe,vt,Ft,Fe,Qe){let mt=R.fetchers.get(Re);J(Re,_Z(Qe,mt?mt.data:void 0),{flushSync:Ft});let ht=new AbortController,Ut=gO(e.history,Ue,ht.signal);if(vt){let ft=await Jt(et,new URL(Ut.url).pathname,Ut.signal,Re);if(ft.type==="aborted")return;if(ft.type==="error"){ae(Re,se,ft.error,{flushSync:Ft});return}else if(ft.matches)et=ft.matches;else{ae(Re,se,Fg(404,{pathname:Ue}),{flushSync:Ft});return}}let or=jfe(et,Ue);z.set(Re,ht);let cr=U,er=bO(i,a,Ut,Ue,et,or,n,Xe),Tr=await ke(Ut,Ue,er,Xe,Re),at=Tr[or.route.id];if(!at){for(let ft of et)if(Tr[ft.route.id]){at=Tr[ft.route.id];break}}if(z.get(Re)===ht&&z.delete(Re),!Ut.signal.aborted){if(ee.has(Re)){J(Re,G1(void 0));return}if(MA(at))if(W>cr){J(Re,G1(void 0));return}else{q.add(Re),await ve(Ut,at,!1,{preventScrollReset:Fe});return}if(rm(at)){ae(Re,se,at.error);return}J(Re,G1(at.data))}}async function ve(Re,se,Ue,{submission:et,fetcherSubmission:Xe,preventScrollReset:vt,replace:Ft}={}){Ue||(N?.resolve(),N=null),se.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Fe=se.response.headers.get("Location");qn(Fe,"Expected a Location header on the redirect Response");let Qe=Fe,mt=new URL(Re.url);Fe=r_t(Fe,mt,l,e.history),vO(Qe,Fe,mt,"allow-explicit");let ht=LZ(R.location,Fe,{_isRedirect:!0});if(r){let at=!1;if(se.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(A7e(Fe)){let ft=S_t(t,Fe,!0);at=ft.origin!==t.location.origin||Pf(ft.pathname,l)==null}if(at){Ft?t.location.replace(Fe):t.location.assign(Fe);return}}P=null;let Ut=Ft===!0||se.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:or,formAction:cr,formEncType:er}=R.navigation;!et&&!Xe&&or&&cr&&er&&(et=l_t(R.navigation));let Tr=et||Xe;if(Pkn.has(se.response.status)&&Tr&&zd(Tr.formMethod))await Ye(Ut,ht,{submission:{...Tr,formAction:Fe},preventScrollReset:vt||$,enableViewTransition:Ue?A:void 0});else{let at=b7e(ht,[],Ut,et);await Ye(Ut,ht,{overrideNavigation:at,fetcherSubmission:Xe,preventScrollReset:vt||$,enableViewTransition:Ue?A:void 0})}}async function ke(Re,se,Ue,et,Xe){let vt,Ft={};try{vt=await $kn(u,Re,se,Ue,Xe,et,!1)}catch(Fe){return Ue.filter(Qe=>Qe.shouldLoad).forEach(Qe=>{Ft[Qe.route.id]={type:"error",error:Fe}}),Ft}if(Re.signal.aborted)return Ft;if(!zd(Re.method))for(let Fe of Ue){if(vt[Fe.route.id]?.type==="error")break;!vt.hasOwnProperty(Fe.route.id)&&!R.loaderData.hasOwnProperty(Fe.route.id)&&(!R.errors||!R.errors.hasOwnProperty(Fe.route.id))&&Fe.shouldCallHandler()&&(vt[Fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Fe.route.id}`)})}for(let[Fe,Qe]of Object.entries(vt))if(Kkn(Qe)){let mt=Qe.result;Ft[Fe]={type:"redirect",response:Ukn(mt,Re,Fe,Ue,l)}}else Ft[Fe]=await Hkn(Qe);return Ft}async function de(Re,se,Ue,et,Xe){let vt=ke(Ue,et,Re,Xe,null),Ft=Promise.all(se.map(async mt=>{if(mt.matches&&mt.match&&mt.request&&mt.controller){let Ut=(await ke(mt.request,mt.path,mt.matches,Xe,mt.key))[mt.match.route.id];return{[mt.key]:Ut}}else return Promise.resolve({[mt.key]:{type:"error",error:Fg(404,{pathname:mt.path})}})})),Fe=await vt,Qe=(await Ft).reduce((mt,ht)=>Object.assign(mt,ht),{});return{loaderResults:Fe,fetcherResults:Qe}}function G(){F=!0,Y.forEach((Re,se)=>{z.has(se)&&O.add(se),Q(se)})}function J(Re,se,Ue={}){let et=new Map(R.fetchers);et.set(Re,se),Ce({fetchers:et},{flushSync:(Ue&&Ue.flushSync)===!0})}function ae(Re,se,Ue,et={}){let Xe=G_(R.matches,se),vt=new Map(R.fetchers);re(vt,Re),Ce({errors:{[Xe.route.id]:Ue},fetchers:vt},{flushSync:(et&&et.flushSync)===!0})}function j(Re){return Z.set(Re,(Z.get(Re)||0)+1),ee.has(Re)&&ee.delete(Re),R.fetchers.get(Re)||N_t}function ue(Re,se){Q(Re,se?.reason),J(Re,G1(null))}function re(Re,se){let Ue=R.fetchers.get(se);z.has(se)&&!(Ue&&Ue.state==="loading"&&V.has(se))&&Q(se),Y.delete(se),V.delete(se),q.delete(se),ee.delete(se),O.delete(se),Re.delete(se)}function X(Re){let se=(Z.get(Re)||0)-1;se<=0?(Z.delete(Re),ee.add(Re)):Z.set(Re,se),Ce({fetchers:new Map(R.fetchers)})}function Q(Re,se){let Ue=z.get(Re);Ue&&(Ue.abort(se),z.delete(Re))}function $e(Re,se){for(let Ue of Re){let et=se.get(Ue);qn(et,`Expected fetcher: ${Ue}`);let Xe=G1(et.data);se.set(Ue,Xe)}}function we(Re){let se=[],Ue=!1;for(let et of q){let Xe=Re.get(et);qn(Xe,`Expected fetcher: ${et}`),Xe.state==="loading"&&(q.delete(et),se.push(et),Ue=!0)}return $e(se,Re),Ue}function Ie(Re,se){let Ue=[];for(let[et,Xe]of V)if(Xe<Re){let vt=se.get(et);qn(vt,`Expected fetcher: ${et}`),vt.state==="loading"&&(Q(et),V.delete(et),Ue.push(et))}return $e(Ue,se),Ue.length>0}function De(Re,se){let Ue=R.blockers.get(Re)||DA;return K.get(Re)!==se&&K.set(Re,se),Ue}function Oe(Re){R.blockers.delete(Re),K.delete(Re)}function Le(Re,se){let Ue=R.blockers.get(Re)||DA;qn(Ue.state==="unblocked"&&se.state==="blocked"||Ue.state==="blocked"&&se.state==="blocked"||Ue.state==="blocked"&&se.state==="proceeding"||Ue.state==="blocked"&&se.state==="unblocked"||Ue.state==="proceeding"&&se.state==="unblocked",`Invalid blocker state transition: ${Ue.state} -> ${se.state}`);let et=new Map(R.blockers);et.set(Re,se),Ce({blockers:et})}function Ge({currentLocation:Re,nextLocation:se,historyAction:Ue}){if(K.size===0)return;K.size>1&&ls(!1,"A router only supports one blocker at a time");let et=Array.from(K.entries()),[Xe,vt]=et[et.length-1],Ft=R.blockers.get(Xe);if(!(Ft&&Ft.state==="proceeding")&&vt({currentLocation:Re,nextLocation:se,historyAction:Ue}))return Xe}function Be(Re){let se=Fg(404,{pathname:Re}),Ue=s.activeRoutes,{matches:et,route:Xe}=Hfe(Ue);return{notFoundMatches:et,route:Xe,error:se}}function tt(Re,se,Ue){if(m=Re,y=se,g=Ue||null,!v&&R.navigation===qfe){v=!0;let et=qe(R.location,R.matches);et!=null&&Ce({restoreScrollPosition:et})}return()=>{m=null,y=null,g=null}}function Ee(Re,se){return g&&g(Re,se.map(et=>T_t(et,R.loaderData)))||Re.key}function Rt(Re,se){if(m&&y){let Ue=Ee(Re,se);m[Ue]=y()}}function qe(Re,se){if(m){let Ue=Ee(Re,se),et=m[Ue];if(typeof et=="number")return et}return null}function Lt(Re,se,Ue){if(e.patchRoutesOnNavigation){let et=s.branches;if(Re){if(Object.keys(Re[0].params).length>0)return{active:!0,matches:W0(se,Ue,l,!0,et)}}else return{active:!0,matches:W0(se,Ue,l,!0,et)||[]}}return{active:!1,matches:null}}async function Jt(Re,se,Ue,et){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Re};let Xe=Re;for(;;){let vt=a;try{await e.patchRoutesOnNavigation({signal:Ue,path:se,matches:Xe,fetcherKey:et,patch:(mt,ht)=>{Ue.aborted||Qkt(mt,ht,s,vt,i,!1)}})}catch(mt){return{type:"error",error:mt,partialMatches:Xe}}if(Ue.aborted)return{type:"aborted"};let Ft=s.branches,Fe=W0(s.activeRoutes,se,l,!1,Ft),Qe=null;if(Fe){if(Object.keys(Fe[0].params).length===0)return{type:"success",matches:Fe};if(Qe=W0(s.activeRoutes,se,l,!0,Ft),!(Qe&&Xe.length<Qe.length&&fr(Xe,Qe.slice(0,Xe.length))))return{type:"success",matches:Fe}}if(Qe||(Qe=W0(s.activeRoutes,se,l,!0,Ft)),!Qe||fr(Xe,Qe))return{type:"success",matches:null};Xe=Qe}}function fr(Re,se){return Re.length===se.length&&Re.every((Ue,et)=>Ue.route.id===se[et].route.id)}function Nt(Re){a={},s.setHmrRoutes(IZ(Re,i,void 0,a))}function yt(Re,se,Ue=!1){Qkt(Re,se,s,a,i,Ue),s.hasHMRRoutes||Ce({})}return _={get basename(){return l},get future(){return d},get state(){return R},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return a},get window(){return t},initialize:ge,subscribe:me,enableScrollRestoration:tt,navigate:We,fetch:le,revalidate:je,createHref:Re=>e.history.createHref(Re),createURL:Re=>e.history.createURL(Re),encodeLocation:Re=>e.history.encodeLocation(Re),getFetcher:j,resetFetcher:ue,deleteFetcher:X,dispose:he,getBlocker:De,deleteBlocker:Oe,patchRoutes:yt,_internalFetchControllers:z,_internalSetRoutes:Nt,_internalSetStateDoNotUseOrYouWillBreakYourApp(Re){Ce(Re)}},e.instrumentations&&(_=xkn(_,e.instrumentations.map(Re=>Re.router).filter(Boolean))),_}function Ikn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function w7e(e,t,r,n,o,i){let a,s;if(o){a=[];for(let u of t)if(a.push(u),u.route.id===o){s=u;break}}else a=t,s=t[t.length-1];let l=DZ(n||".",epe(a),Pf(e.pathname,r)||e.pathname,i==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&s){let u=N7e(l.search);if(s.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let d=new URLSearchParams(l.search),f=d.getAll("index");d.delete("index"),f.filter(h=>h).forEach(h=>d.append("index",h));let p=d.toString();l.search=p?`?${p}`:""}}return r!=="/"&&(l.pathname=hkn({basename:r,pathname:l.pathname})),Hd(l)}function Xkt(e,t,r){if(!r||!Ikn(r))return{path:t};if(r.formMethod&&!Qkn(r.formMethod))return{path:t,error:Fg(405,{method:r.formMethod})};let n=()=>({path:t,error:Fg(400,{type:"invalid-body"})}),i=(r.formMethod||"get").toUpperCase(),a=q_t(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!zd(i))return n();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[h,m])=>`${p}${h}=${m}
|
|
3814
3814
|
`,""):String(r.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!zd(i))return n();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return n()}}}qn(typeof FormData=="function","FormData is not available in this environment");let s,l;if(r.formData)s=_7e(r.formData),l=r.formData;else if(r.body instanceof FormData)s=_7e(r.body),l=r.body;else if(r.body instanceof URLSearchParams)s=r.body,l=n_t(s);else if(r.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(r.body),l=n_t(s)}catch{return n()}let u={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(zd(u.formMethod))return{path:t,submission:u};let d=Hg(t);return e&&d.search&&N7e(d.search)&&s.append("index",""),d.search=`?${s}`,{path:Hd(d),submission:u}}function Zkt(e,t,r,n,o,i,a,s,l,u,d,f,p,h,m,g,y,v,b,x,w,C){let k=w?rm(w[1])?w[1].error:w[1].data:void 0,_=o.createURL(i.location),R=o.createURL(l),D;if(d&&i.errors){let M=Object.keys(i.errors)[0];D=a.findIndex(F=>F.route.id===M)}else if(w&&rm(w[1])){let M=w[0];D=a.findIndex(F=>F.route.id===M)-1}let N=w?w[1].statusCode:void 0,$=N&&N>=400,P={currentUrl:_,currentParams:i.matches[0]?.params||{},nextUrl:R,nextParams:a[0].params,...s,actionResult:k,actionStatus:N},A=MZ(a),L=a.map((M,F)=>{let{route:O}=M,z=null;if(D!=null&&F>D)z=!1;else if(O.lazy)z=!0;else if(!D7e(O))z=!1;else if(d){let{shouldLoad:q}=F_t(O,i.loaderData,i.errors);z=q}else Dkn(i.loaderData,i.matches[F],M)&&(z=!0);if(z!==null)return C7e(r,n,e,l,A,M,u,t,z);let U=!1;typeof C=="boolean"?U=C:$?U=!1:(f||_.pathname+_.search===R.pathname+R.search||_.search!==R.search||Mkn(i.matches[F],M))&&(U=!0);let W={...P,defaultShouldRevalidate:U},V=AZ(M,W);return C7e(r,n,e,l,A,M,u,t,V,W,C)}),I=[];return m.forEach((M,F)=>{if(d||!a.some(Z=>Z.route.id===M.routeId)||h.has(F))return;let O=i.fetchers.get(F),z=O&&O.state!=="idle"&&O.data===void 0,U=W0(y,M.path,v??"/",!1,x);if(!U){if(b&&z)return;I.push({key:F,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(g.has(F))return;let W=jfe(U,M.path),V=new AbortController,q=gO(o,M.path,V.signal),Y=null;if(p.has(F))p.delete(F),Y=bO(r,n,q,M.path,U,W,u,t);else if(z)f&&(Y=bO(r,n,q,M.path,U,W,u,t));else{let Z;typeof C=="boolean"?Z=C:$?Z=!1:Z=f;let ee={...P,defaultShouldRevalidate:Z};AZ(W,ee)&&(Y=bO(r,n,q,M.path,U,W,u,t,ee))}Y&&I.push({key:F,routeId:M.routeId,path:M.path,matches:Y,match:W,request:q,controller:V})}),{dsMatches:L,revalidatingFetchers:I}}function D7e(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function F_t(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!D7e(e))return{shouldLoad:!1,renderFallback:!1};let n=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!n&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!n};let i=!n&&!o;return{shouldLoad:i,renderFallback:i}}function Dkn(e,t,r){let n=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return n||o}function Mkn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function AZ(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Qkt(e,t,r,n,o,i){let a;if(e){let u=n[e];qn(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),a=u.children}else a=r.activeRoutes;let s=[],l=[];if(t.forEach(u=>{let d=a.find(f=>z_t(u,f));d?l.push({existingRoute:d,newRoute:u}):s.push(u)}),s.length>0){let u=IZ(s,o,[e||"_","patch",String(a?.length||"0")],n);a.push(...u)}if(i&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:d,newRoute:f}=l[u],p=d,[h]=IZ([f],o,[],{},!0);Object.assign(p,{element:h.element?h.element:p.element,errorElement:h.errorElement?h.errorElement:p.errorElement,hydrateFallbackElement:h.hydrateFallbackElement?h.hydrateFallbackElement:p.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function z_t(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((r,n)=>t.children?.some(o=>z_t(r,o)))??!1:!1}var Jkt=new WeakMap,H_t=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let o=r[t.id];if(qn(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let i=o.lazy[e];if(!i)return;let a=Jkt.get(o);a||(a={},Jkt.set(o,a));let s=a[e];if(s)return s;let l=(async()=>{let u=ekn(e),f=o[e]!==void 0&&e!=="hasErrorBoundary";if(u)ls(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(f)ls(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await i();p!=null&&(Object.assign(o,{[e]:p}),Object.assign(o,n(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(p=>p===void 0)&&(o.lazy=void 0))})();return a[e]=l,l},e_t=new WeakMap;function Nkn(e,t,r,n,o){let i=r[e.id];if(qn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let d=e_t.get(i);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let f=(async()=>{qn(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),h={};for(let m in p){let g=p[m];if(g===void 0)continue;let y=rkn(m),b=i[m]!==void 0&&m!=="hasErrorBoundary";y?ls(!y,"Route property "+m+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?ls(!b,`Route "${i.id}" has a static property "${m}" defined but its lazy function is also returning a value for this property. The lazy route property "${m}" will be ignored.`):h[m]=g}Object.assign(i,h),Object.assign(i,{...n(i),lazy:void 0})})();return e_t.set(i,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let a=Object.keys(e.lazy),s=[],l;for(let d of a){if(o&&o.includes(d))continue;let f=H_t({key:d,route:e,manifest:r,mapRouteProperties:n});f&&(s.push(f),d===t&&(l=f))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function t_t(e){let t=e.matches.filter(o=>o.shouldLoad),r={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,i)=>{r[t[i].route.id]=o}),r}async function Okn(e){return e.matches.some(t=>t.route.middleware)?U_t(e,()=>t_t(e)):t_t(e)}function U_t(e,t){return Bkn(e,t,n=>{if(Zkn(n))throw n;return n},jkn,r);function r(n,o,i){if(i)return Promise.resolve(Object.assign(i.value,{[o]:{type:"error",result:n}}));{let{matches:a}=e,s=Math.min(Math.max(a.findIndex(u=>u.route.id===o),0),Math.max(a.findIndex(u=>u.shouldCallHandler()),0)),l=G_(a,a[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:n}})}}}async function Bkn(e,t,r,n,o){let{matches:i,...a}=e,s=i.flatMap(u=>u.route.middleware?u.route.middleware.map(d=>[u.route.id,d]):[]);return await V_t(a,s,t,r,n,o)}async function V_t(e,t,r,n,o,i,a=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[a];if(!l)return await r();let[u,d]=l,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await V_t(e,t,r,n,o,i,a+1)},f.value}catch(h){return f={value:await i(h,u,f)},f.value}};try{let h=await d(e,p),m=h!=null?n(h):void 0;return o(m)?m:f?m??f.value:(f={value:await p()},f.value)}catch(h){return await i(h,u,f)}}function W_t(e,t,r,n,o){let i=H_t({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),a=Nkn(n.route,zd(r.method)?"action":"loader",t,e,o);return{middleware:i,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function C7e(e,t,r,n,o,i,a,s,l,u=null,d){let f=!1,p=W_t(e,t,r,i,a);return{...i,_lazyPromises:p,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(h){return f=!0,u?typeof d=="boolean"?AZ(i,{...u,defaultShouldRevalidate:d}):typeof h=="boolean"?AZ(i,{...u,defaultShouldRevalidate:h}):AZ(i,u):l},resolve(h){let{lazy:m,loader:g,middleware:y}=i.route,v=f||l||h&&!zd(r.method)&&(m||g),b=y&&y.length>0&&!g&&!m;return v&&(zd(r.method)||!b)?Fkn({request:r,path:n,pattern:o,match:i,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:h,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function bO(e,t,r,n,o,i,a,s,l=null){return o.map(u=>u.route.id!==i.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:W_t(e,t,r,u,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:C7e(e,t,r,n,MZ(o),u,a,s,!0,l))}async function $kn(e,t,r,n,o,i,a){n.some(d=>d._lazyPromises?.middleware)&&await Promise.all(n.map(d=>d._lazyPromises?.middleware));let s={request:t,url:G_t(t,r),pattern:MZ(n),params:n[0].params,context:i,matches:n},u=await e({...s,fetcherKey:o,runClientMiddleware:a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:d=>{let f=s;return U_t(f,()=>d({...f,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>[d._lazyPromises?.handler,d._lazyPromises?.route]))}catch{}return u}async function Fkn({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:o,lazyRoutePromise:i,handlerOverride:a,scopedContext:s}){let l,u,d=zd(e.method),f=d?"action":"loader",p=h=>{let m,g=new Promise((b,x)=>m=x);u=()=>m(),e.signal.addEventListener("abort",u);let y=b=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):h({request:e,url:G_t(e,t),pattern:r,params:n.params,context:s},...b!==void 0?[b]:[]),v=(async()=>{try{return{type:"data",result:await(a?a(x=>y(x)):y())}}catch(b){return{type:"error",result:b}}})();return Promise.race([v,g])};try{let h=d?n.route.action:n.route.loader;if(o||i)if(h){let m,[g]=await Promise.all([p(h).catch(y=>{m=y}),o,i]);if(m!==void 0)throw m;l=g}else{await o;let m=d?n.route.action:n.route.loader;if(m)[l]=await Promise.all([p(m),i]);else if(f==="action"){let g=new URL(e.url),y=g.pathname+g.search;throw Fg(405,{method:e.method,pathname:y,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(h)l=await p(h);else{let m=new URL(e.url),g=m.pathname+m.search;throw Fg(404,{pathname:g})}}catch(h){return{type:"error",result:h}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function zkn(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Hkn(e){let{result:t,type:r}=e;if(M7e(t)){let n;try{n=await zkn(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new CO(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?s_t(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:qkn(t),statusCode:wO(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:wO(t)?t.status:void 0}:s_t(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Ukn(e,t,r,n,o){let i=e.headers.get("Location");if(qn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!A7e(i)){let a=n.slice(0,n.findIndex(s=>s.route.id===r)+1);i=w7e(new URL(t.url),a,o,i),e.headers.set("Location",i)}return e}var Vkn=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function k7e(e){try{return Vkn.includes(new URL(e).protocol)}catch{return!1}}function r_t(e,t,r,n){if(A7e(e)){let o=e,i=Jfe.test(o)?new URL(b_t(o,t.protocol)):new URL(o);if(k7e(i.toString()))throw new Error("Invalid redirect location");let a=Pf(i.pathname,r)!=null;if(i.origin===t.origin&&a)return L7e(i.pathname)+i.search+i.hash}try{let o=n.createURL(e);if(k7e(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function gO(e,t,r,n){let o=e.createURL(q_t(t)).toString(),i={signal:r};if(n&&zd(n.formMethod)){let{formMethod:a,formEncType:s}=n;i.method=a.toUpperCase(),s==="application/json"?(i.headers=new Headers({"Content-Type":s}),i.body=JSON.stringify(n.json)):s==="text/plain"?i.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?i.body=_7e(n.formData):i.body=n.formData}return new Request(o,i)}function G_t(e,t){let r=new URL(e.url),n=typeof t=="string"?Hg(t):t;if(r.pathname=n.pathname||"/",n.search){let o=new URLSearchParams(n.search),i=o.getAll("index");o.delete("index");for(let a of i.filter(Boolean))o.append("index",a);r.search=o.size?`?${o.toString()}`:""}else r.search="";return r.hash=n.hash||"",r}function _7e(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function n_t(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Wkn(e,t,r,n=!1,o=!1){let i={},a=null,s,l=!1,u={},d=r&&rm(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,h=t[p];if(qn(!MA(h),"Cannot handle redirect results in processLoaderData"),rm(h)){let m=h.error;if(d!==void 0&&(m=d,d=void 0),a=a||{},o)a[p]=m;else{let g=G_(e,p);a[g.route.id]==null&&(a[g.route.id]=m)}n||(i[p]=B_t),l||(l=!0,s=wO(h.error)?h.error.status:500),h.headers&&(u[p]=h.headers)}else i[p]=h.data,h.statusCode&&h.statusCode!==200&&!l&&(s=h.statusCode),h.headers&&(u[p]=h.headers)}),d!==void 0&&r&&(a={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:a,statusCode:s||200,loaderHeaders:u}}function o_t(e,t,r,n,o,i,a){let{loaderData:s,errors:l}=Wkn(t,r,n);return o.filter(u=>!u.matches||u.matches.some(d=>d.shouldLoad)).forEach(u=>{let{key:d,match:f,controller:p}=u;if(p&&p.signal.aborted)return;let h=i[d];if(qn(h,"Did not find corresponding fetcher result"),rm(h)){let m=G_(e.matches,f?.route.id);l&&l[m.route.id]||(l={...l,[m.route.id]:h.error}),a.delete(d)}else if(MA(h))qn(!1,"Unhandled fetcher revalidation redirect");else{let m=G1(h.data);a.set(d,m)}}),{loaderData:s,errors:l}}function i_t(e,t,r,n){let o=Object.entries(t).filter(([,i])=>i!==B_t).reduce((i,[a,s])=>(i[a]=s,i),{});for(let i of r){let a=i.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&i.route.loader&&(o[a]=e[a]),n&&n.hasOwnProperty(a))break}return o}function a_t(e){return e?rm(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function G_(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Hfe(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Fg(e,{pathname:t,routeId:r,method:n,type:o,message:i}={}){let a="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(a="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(a="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(a="Not Found",s=`No route matches URL "${t}"`):e===405&&(a="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new CO(e||500,a,new Error(s),!0)}function Ufe(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,o]=t[r];if(MA(o))return{key:n,result:o}}}function q_t(e){let t=typeof e=="string"?Hg(e):e;return Hd({...t,hash:""})}function Gkn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function qkn(e){return new CO(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function jkn(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Ykn(r))}function Ykn(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Kkn(e){return M7e(e.result)&&M_t.has(e.result.status)}function rm(e){return e.type==="error"}function MA(e){return(e&&e.type)==="redirect"}function s_t(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function M7e(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Xkn(e){return M_t.has(e)}function Zkn(e){return M7e(e)&&Xkn(e.status)&&e.headers.has("Location")}function Qkn(e){return Rkn.has(e.toUpperCase())}function zd(e){return _kn.has(e.toUpperCase())}function N7e(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function jfe(e,t){let r=typeof t=="string"?Hg(t).search:t.search;if(e[e.length-1].route.index&&N7e(r||""))return e[e.length-1];let n=P_t(e);return n[n.length-1]}function l_t(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:i,json:a}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function b7e(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Jkn(e,t,r,n){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function _Z(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function e_n(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function G1(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function t_n(e,t){try{let r=e.sessionStorage.getItem(O_t);if(r){let n=JSON.parse(r);for(let[o,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function r_n(e,t){if(t.size>0){let r={};for(let[n,o]of t)r[n]=[...o];try{e.sessionStorage.setItem(O_t,JSON.stringify(r))}catch(n){ls(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function c_t(){let e,t,r=new Promise((n,o)=>{e=async i=>{n(i);try{await r}catch{}},t=async i=>{o(i);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var j_=Op.createContext(null);j_.displayName="DataRouter";var NA=Op.createContext(null);NA.displayName="DataRouterState";var j_t=Op.createContext(!1);function Y_t(){return Op.useContext(j_t)}var tpe=Op.createContext({isTransitioning:!1});tpe.displayName="ViewTransition";var O7e=Op.createContext(new Map);O7e.displayName="Fetchers";var n_n=Op.createContext(null);n_n.displayName="Await";var Ud=Op.createContext(null);Ud.displayName="Navigation";var kO=Op.createContext(null);kO.displayName="Location";var nm=Op.createContext({outlet:null,matches:[],isDataRoute:!1});nm.displayName="Route";var B7e=Op.createContext(null);B7e.displayName="RouteError";var xO=!0,K_t="REACT_ROUTER_ERROR",o_n="REDIRECT",i_n="ROUTE_ERROR_RESPONSE";function a_n(e){if(e.startsWith(`${K_t}:${o_n}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function s_n(e){if(e.startsWith(`${K_t}:${i_n}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new CO(t.status,t.statusText,t.data)}catch{}}function X_t(e,{relative:t}={}){qn(Y_(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=Fr.useContext(Ud),{hash:o,pathname:i,search:a}=_O(e,{relative:t}),s=i;return r!=="/"&&(s=i==="/"?r:zg([r,i])),n.createHref({pathname:s,search:a,hash:o})}function Y_(){return Fr.useContext(kO)!=null}function ki(){return qn(Y_(),"useLocation() may be used only in the context of a <Router> component."),Fr.useContext(kO).location}function $7e(e){qn(Y_(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=ki();return Fr.useMemo(()=>SO(e,E_t(t)),[t,e])}var Z_t="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Q_t(e){Fr.useContext(Ud).static||Fr.useLayoutEffect(e)}function sn(){let{isDataRoute:e}=Fr.useContext(nm);return e?v_n():l_n()}function l_n(){qn(Y_(),"useNavigate() may be used only in the context of a <Router> component.");let e=Fr.useContext(j_),{basename:t,navigator:r}=Fr.useContext(Ud),{matches:n}=Fr.useContext(nm),{pathname:o}=ki(),i=JSON.stringify(epe(n)),a=Fr.useRef(!1);return Q_t(()=>{a.current=!0}),Fr.useCallback((l,u={})=>{if(ls(a.current,Z_t),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=DZ(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:zg([t,d.pathname])),vO(typeof l=="string"?l:Hd(l),r.createHref(d),I7e(r),"reject"),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,i,o,e])}var c_n=Fr.createContext(null);function J_t(e){let t=Fr.useContext(nm).outlet;return Fr.useMemo(()=>t&&Fr.createElement(c_n.Provider,{value:e},t),[t,e])}function eT(){let{matches:e}=Fr.useContext(nm);return e[e.length-1]?.params??{}}function _O(e,{relative:t}={}){let{matches:r}=Fr.useContext(nm),{pathname:n}=ki(),o=JSON.stringify(epe(r));return Fr.useMemo(()=>DZ(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}function eEt(e,t){return tEt(e,t)}function tEt(e,t,r){qn(Y_(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=Fr.useContext(Ud),{matches:o}=Fr.useContext(nm),i=o[o.length-1],a=i?i.params:{},s=i?i.pathname:"/",l=i?i.pathnameBase:"/",u=i&&i.route;if(xO){let y=u&&u.path||"";aEt(s,!u||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3815
3815
|
|
|
3816
|
-
Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let d=ki(),f;if(t){let y=typeof t=="string"?Hg(t):t;qn(l==="/"||y.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${y.pathname}" was given in the \`location\` prop.`),f=y}else f=d;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=r&&r.state.matches.length?r.state.matches.map(y=>Object.assign(y,{route:r.manifest[y.route.id]||y.route})):P7e(e,{pathname:h});xO&&(ls(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ls(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let g=h_n(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:zg([l,n.encodeLocation?n.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:zg([l,n.encodeLocation?n.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),o,r);return t&&g?Fr.createElement(kO.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function u_n(){let e=iEt(),t=wO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},a=null;return xO&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=Fr.createElement(Fr.Fragment,null,Fr.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),Fr.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Fr.createElement("code",{style:i},"ErrorBoundary")," or"," ",Fr.createElement("code",{style:i},"errorElement")," prop on your route."))),Fr.createElement(Fr.Fragment,null,Fr.createElement("h2",null,"Unexpected Application Error!"),Fr.createElement("h3",{style:{fontStyle:"italic"}},t),r?Fr.createElement("pre",{style:o},r):null,a)}var d_n=Fr.createElement(u_n,null),rEt=class extends Fr.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=s_n(e.digest);r&&(e=r)}let t=e!==void 0?Fr.createElement(nm.Provider,{value:this.props.routeContext},Fr.createElement(B7e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?Fr.createElement(f_n,{error:e},t):t}};rEt.contextType=j_t;var x7e=new WeakMap;function f_n({children:e,error:t}){let{basename:r,navigator:n}=Fr.useContext(Ud);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=a_n(t.digest);if(o){let i=x7e.get(t);if(i)throw i;let a=L_t(o.location,r),s=a.absoluteURL||a.to;if(vO(o.location,s,I7e(n),"allow-explicit"),k7e(s))throw new Error("Invalid redirect location");if(A_t&&!x7e.get(t))if(a.isExternal||o.reloadDocument)window.location.href=s;else{let l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw x7e.set(t,l),l}return Fr.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function p_n({routeContext:e,match:t,children:r}){let n=Fr.useContext(j_);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),Fr.createElement(nm.Provider,{value:e},r)}function h_n(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n?.errors;if(i!=null){let d=o.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);qn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let a=!1,s=-1;if(r&&n){a=n.renderFallback;for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=d),f.route.id){let{loaderData:p,errors:h}=n,m=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!h||h[f.route.id]===void 0);if(f.route.lazy||m){r.isStatic&&(a=!0),s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}}let l=r?.onError,u=n&&l?(d,f)=>{l(d,{location:n.location,params:n.matches?.[0]?.params??{},pattern:MZ(n.matches),errorInfo:f})}:void 0;return o.reduceRight((d,f,p)=>{let h,m=!1,g=null,y=null;n&&(h=i&&f.route.id?i[f.route.id]:void 0,g=f.route.errorElement||d_n,a&&(s<0&&p===0?(aEt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):s===p&&(m=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=g:m?x=y:f.route.Component?x=Fr.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,Fr.createElement(p_n,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?Fr.createElement(rEt,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):b()},null)}function F7e(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nEt(e){let t=Fr.useContext(j_);return qn(t,F7e(e)),t}function rpe(e){let t=Fr.useContext(NA);return qn(t,F7e(e)),t}function m_n(e){let t=Fr.useContext(nm);return qn(t,F7e(e)),t}function z7e(e){let t=m_n(e),r=t.matches[t.matches.length-1];return qn(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function g_n(){return z7e("useRouteId")}function oEt(){let e=rpe("useNavigation");return Fr.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function H7e(){let{matches:e,loaderData:t}=rpe("useMatches");return Fr.useMemo(()=>e.map(r=>T_t(r,t)),[e,t])}function iEt(){let e=Fr.useContext(B7e),t=rpe("useRouteError"),r=z7e("useRouteError");return e!==void 0?e:t.errors?.[r]}var y_n=0;function U7e(e){let{router:t,basename:r}=nEt("useBlocker"),n=rpe("useBlocker"),[o,i]=Fr.useState(""),a=Fr.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:l,nextLocation:u,historyAction:d}=s;return e({currentLocation:{...l,pathname:Pf(l.pathname,r)||l.pathname},nextLocation:{...u,pathname:Pf(u.pathname,r)||u.pathname},historyAction:d})},[r,e]);return Fr.useEffect(()=>{let s=String(++y_n);return i(s),()=>t.deleteBlocker(s)},[t]),Fr.useEffect(()=>{o!==""&&t.getBlocker(o,a)},[t,o,a]),o&&n.blockers.has(o)?n.blockers.get(o):DA}function v_n(){let{router:e}=nEt("useNavigate"),t=z7e("useNavigate"),r=Fr.useRef(!1);return Q_t(()=>{r.current=!0}),Fr.useCallback(async(o,i={})=>{ls(r.current,Z_t),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var u_t={};function aEt(e,t,r){!t&&!u_t[e]&&(u_t[e]=!0,ls(!1,r))}var d_t={};function f_t(e,t){!e&&!d_t[t]&&(d_t[t]=!0,console.warn(t))}var b_n="useOptimistic",p_t=dn[b_n],x_n=()=>{};function S_n(e){return p_t?p_t(e):[e,x_n]}function sEt(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(xO&&e.element&&ls(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:dn.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(xO&&e.hydrateFallbackElement&&ls(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:dn.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(xO&&e.errorElement&&ls(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:dn.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var lEt=["HydrateFallback","hydrateFallbackElement"];var T_n=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function V7e({router:e,flushSync:t,onError:r,useTransitions:n}){n=Y_t()||n;let[i,a]=dn.useState(e.state),[s,l]=S_n(i),[u,d]=dn.useState(),[f,p]=dn.useState({isTransitioning:!1}),[h,m]=dn.useState(),[g,y]=dn.useState(),[v,b]=dn.useState(),x=dn.useRef(new Map),w=dn.useCallback((R,{deletedFetchers:D,newErrors:N,flushSync:$,viewTransitionOpts:P})=>{N&&r&&Object.values(N).forEach(L=>r(L,{location:R.location,params:R.matches[0]?.params??{},pattern:MZ(R.matches)})),R.fetchers.forEach((L,I)=>{L.data!==void 0&&x.current.set(I,L.data)}),D.forEach(L=>x.current.delete(L)),f_t($===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(f_t(P==null||A,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!A){t&&$?t(()=>a(R)):n===!1?a(R):dn.startTransition(()=>{n===!0&&l(L=>h_t(L,R)),a(R)});return}if(t&&$){t(()=>{g&&(h?.resolve(),g.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>a(R))});L.finished.finally(()=>{t(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})})}),t(()=>y(L));return}g?(h?.resolve(),g.skipTransition(),b({state:R,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(d(R),p({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,h,n,l,r]);dn.useLayoutEffect(()=>e.subscribe(w),[e,w]),dn.useEffect(()=>{f.isTransitioning&&!f.flushSync&&m(new T_n)},[f]),dn.useEffect(()=>{if(h&&u&&e.window){let R=u,D=h.promise,N=e.window.document.startViewTransition(async()=>{n===!1?a(R):dn.startTransition(()=>{n===!0&&l($=>h_t($,R)),a(R)}),await D});N.finished.finally(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})}),y(N)}},[u,h,e.window,n,l]),dn.useEffect(()=>{h&&u&&s.location.key===u.location.key&&h.resolve()},[h,g,s.location,u]),dn.useEffect(()=>{!f.isTransitioning&&v&&(d(v.state),p({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[f.isTransitioning,v]);let C=dn.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:R=>e.navigate(R),push:(R,D,N)=>e.navigate(R,{state:D,preventScrollReset:N?.preventScrollReset}),replace:(R,D,N)=>e.navigate(R,{replace:!0,state:D,preventScrollReset:N?.preventScrollReset})}),[e]),k=e.basename||"/",_=dn.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:r}),[e,C,k,r]);return dn.createElement(dn.Fragment,null,dn.createElement(j_.Provider,{value:_},dn.createElement(NA.Provider,{value:s},dn.createElement(O7e.Provider,{value:x.current},dn.createElement(tpe.Provider,{value:f},dn.createElement(G7e,{basename:k,location:s.location,navigationType:s.historyAction,navigator:C,useTransitions:n},dn.createElement(w_n,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function h_t(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var w_n=dn.memo(C_n);function C_n({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:i}){return tEt(e,void 0,{manifest:t,state:n,isStatic:o,onError:i,future:r})}function OA({to:e,replace:t,state:r,relative:n}){qn(Y_(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:i}=dn.useContext(Ud);ls(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=dn.useContext(nm),{pathname:s}=ki(),l=sn(),u=DZ(e,epe(a),s,n==="path");vO(typeof e=="string"?e:Hd(e),i.createHref(u),I7e(i),"reject");let d=JSON.stringify(u);return dn.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:n})},[l,d,n,t,r]),null}function W7e(e){return J_t(e.context)}function Oo(e){qn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function G7e({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1,useTransitions:a}){qn(!Y_(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=dn.useMemo(()=>({basename:s,navigator:o,static:i,useTransitions:a,future:{}}),[s,o,i,a]);typeof r=="string"&&(r=Hg(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default",mask:m}=r,g=dn.useMemo(()=>{let y=Pf(u,s);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:h,mask:m},navigationType:n}},[s,u,d,f,p,h,n,m]);return ls(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:dn.createElement(Ud.Provider,{value:l},dn.createElement(kO.Provider,{children:t,value:g}))}function tT({children:e,location:t}){return eEt(Xfe(e),t)}function Xfe(e,t=[]){let r=[];return dn.Children.forEach(e,(n,o)=>{if(!dn.isValidElement(n))return;let i=[...t,o];if(n.type===dn.Fragment){r.push.apply(r,Xfe(n.props.children,i));return}qn(n.type===Oo,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qn(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=Xfe(n.props.children,i)),r.push(a)}),r}var Yfe="get",Kfe="application/x-www-form-urlencoded";function npe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function k_n(e){return npe(e)&&e.tagName.toLowerCase()==="button"}function __n(e){return npe(e)&&e.tagName.toLowerCase()==="form"}function E_n(e){return npe(e)&&e.tagName.toLowerCase()==="input"}function R_n(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function P_n(e,t){return e.button===0&&(!t||t==="_self")&&!R_n(e)}function Zfe(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function A_n(e,t){let r=Zfe(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}var Vfe=null;function L_n(){if(Vfe===null)try{new FormData(document.createElement("form"),0),Vfe=!1}catch{Vfe=!0}return Vfe}var I_n=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function S7e(e){return e!=null&&!I_n.has(e)?(ls(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kfe}"`),null):e}function D_n(e,t){let r,n,o,i,a;if(__n(e)){let s=e.getAttribute("action");n=s?Pf(s,t):null,r=e.getAttribute("method")||Yfe,o=S7e(e.getAttribute("enctype"))||Kfe,i=new FormData(e)}else if(k_n(e)||E_n(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?Pf(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Yfe,o=S7e(e.getAttribute("formenctype"))||S7e(s.getAttribute("enctype"))||Kfe,i=new FormData(s,e),!L_n()){let{name:u,type:d,value:f}=e;if(d==="image"){let p=u?`${u}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else u&&i.append(u,f)}}else{if(npe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Yfe,n=null,o=Kfe,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:i,body:a}}var G7i=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var M_n={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},N_n=/[&><\u2028\u2029]/g;function m_t(e){return e.replace(N_n,t=>M_n[t])}function j7e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cEt(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&Pf(o.pathname,t)==="/"?o.pathname=`${TO(t)}/_root.${n}`:o.pathname=`${TO(o.pathname)}.${n}`,o}async function O_n(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&aEn.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function B_n(e){return e!=null&&typeof e.page=="string"}function $_n(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function F_n(e,t,r){let n=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await O_n(i,r);return a.links?a.links():[]}return[]}));return V_n(n.flat(1).filter($_n).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function g_t(e,t,r,n,o,i){let a=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return i==="assets"?t.filter((l,u)=>a(l,u)||s(l,u)):i==="data"?t.filter((l,u)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(a(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function z_n(e,t,{includeHydrateFallback:r}={}){return H_n(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function H_n(e){return[...new Set(e)]}function U_n(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function V_n(e,t){let r=new Set,n=new Set(t);return e.reduce((o,i)=>{if(t&&!B_n(i)&&i.as==="script"&&i.href&&n.has(i.href))return o;let s=JSON.stringify(U_n(i));return r.has(s)||(r.add(s),o.push({key:s,link:i})),o},[])}function Y7e(){let e=No.useContext(j_);return j7e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function j_n(){let e=No.useContext(NA);return j7e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var NZ=No.createContext(void 0);NZ.displayName="FrameworkContext";function ope(){let e=No.useContext(NZ);return j7e(e,"You must render this element inside a <HydratedRouter> element"),e}function Y_n(e,t){let r=No.useContext(NZ),[n,o]=No.useState(!1),[i,a]=No.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=No.useRef(null);No.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let g=v=>{v.forEach(b=>{a(b.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return p.current&&y.observe(p.current),()=>{y.disconnect()}}},[e]),No.useEffect(()=>{if(n){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[n]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return r?e!=="intent"?[i,p,{}]:[i,p,{onFocus:EZ(s,h),onBlur:EZ(l,m),onMouseEnter:EZ(u,h),onMouseLeave:EZ(d,m),onTouchStart:EZ(f,h)}]:[!1,p,{}]}function EZ(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function dEt({page:e,...t}){let r=Y_t(),{nonce:n}=ope(),{router:o}=Y7e(),i=No.useMemo(()=>P7e(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?(t.nonce==null&&n&&(t={...t,nonce:n}),r?No.createElement(X_n,{page:e,matches:i,...t}):No.createElement(Z_n,{page:e,matches:i,...t})):null}function K_n(e){let{manifest:t,routeModules:r}=ope(),[n,o]=No.useState([]);return No.useEffect(()=>{let i=!1;return F_n(e,t,r).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,r]),n}function X_n({page:e,matches:t,...r}){let n=ki(),{future:o}=ope(),{basename:i}=Y7e(),a=No.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=cEt(e,i,o.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,u=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?l=!0:u.push(d.route.id);return l&&u.length>0&&s.searchParams.set("_routes",u.join(",")),[s.pathname+s.search]},[i,o.v8_trailingSlashAwareDataRequests,e,n,t]);return No.createElement(No.Fragment,null,a.map(s=>No.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function Z_n({page:e,matches:t,...r}){let n=ki(),{future:o,manifest:i,routeModules:a}=ope(),{basename:s}=Y7e(),{loaderData:l,matches:u}=j_n(),d=No.useMemo(()=>g_t(e,t,u,i,n,"data"),[e,t,u,i,n]),f=No.useMemo(()=>g_t(e,t,u,i,n,"assets"),[e,t,u,i,n]),p=No.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,y=!1;if(t.forEach(b=>{let x=i.routes[b.route.id];!x||!x.hasLoader||(!d.some(w=>w.route.id===b.route.id)&&b.route.id in l&&a[b.route.id]?.shouldRevalidate||x.hasClientLoader?y=!0:g.add(b.route.id))}),g.size===0)return[];let v=cEt(e,s,o.v8_trailingSlashAwareDataRequests,"data");return y&&g.size>0&&v.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[s,o.v8_trailingSlashAwareDataRequests,l,n,i,d,t,e,a]),h=No.useMemo(()=>z_n(f,i),[f,i]),m=K_n(f);return No.createElement(No.Fragment,null,p.map(g=>No.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),h.map(g=>No.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),m.map(({key:g,link:y})=>No.createElement("link",{key:g,nonce:r.nonce,...y,crossOrigin:y.crossOrigin??r.crossOrigin})))}function Q_n(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var J_n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{J_n&&(window.__reactRouterVersion="7.18.5")}catch{}function K7e(e,t){return $_t({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:x_t({window:t?.window}),hydrationData:t?.hydrationData||eEn(),routes:e,mapRouteProperties:sEt,hydrationRouteProperties:lEt,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function eEn(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:tEn(e.errors)}),e}function tEn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new CO(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&vkn.includes(o.__subType)){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}function fEt({basename:e,children:t,history:r,useTransitions:n}){let[o,i]=fn.useState({action:r.action,location:r.location}),a=fn.useCallback(s=>{n===!1?i(s):fn.startTransition(()=>i(s))},[n]);return fn.useLayoutEffect(()=>r.listen(a),[r,a]),fn.createElement(G7e,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}fEt.displayName="unstable_HistoryRouter";var Sa=fn.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:i,replace:a,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:h,...m},g){let{basename:y,navigator:v,useTransitions:b}=fn.useContext(Ud),x=typeof d=="string"&&Qfe.test(d),w=L_t(d,y);d=w.to;let C=X_t(d,{relative:o}),k=ki(),_=null;if(s){let I=DZ(s,[],k.mask?k.mask.pathname:"/",!0);y!=="/"&&(I.pathname=I.pathname==="/"?y:zg([y,I.pathname])),_=v.createHref(I)}let[R,D,N]=Y_n(n,m),$=yEt(d,{replace:a,mask:s,state:l,target:u,preventScrollReset:f,relative:o,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b});function P(I){t&&t(I),I.defaultPrevented||$(I)}let A=!(w.isExternal||i),L=fn.createElement("a",{...m,...N,href:(A?_:void 0)||w.absoluteURL||C,onClick:A?P:t,ref:Q_n(g,D),target:u,"data-discover":!x&&r==="render"?"true":void 0});return R&&!x?fn.createElement(fn.Fragment,null,L,fn.createElement(dEt,{page:C})):L});Sa.displayName="Link";var pEt=fn.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...u},d){let f=_O(a,{relative:u.relative}),p=ki(),h=fn.useContext(NA),{navigator:m,basename:g}=fn.useContext(Ud),y=h!=null&&SEt(f)&&s===!0,v=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=p.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(b=b.toLowerCase(),x=x?x.toLowerCase():null,v=v.toLowerCase()),x&&g&&(x=Pf(x,g)||x);let w=v!=="/"&&v.endsWith("/")?v.length-1:v.length,C=b===v||!o&&b.startsWith(v)&&b.charAt(w)==="/",k=x!=null&&(x===v||!o&&x.startsWith(v)&&x.charAt(v.length)==="/"),_={isActive:C,isPending:k,isTransitioning:y},R=C?t:void 0,D;typeof n=="function"?D=n(_):D=[n,C?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof i=="function"?i(_):i;return fn.createElement(Sa,{...u,"aria-current":R,className:D,ref:d,style:N,to:a,viewTransition:s},typeof l=="function"?l(_):l)});pEt.displayName="NavLink";var hEt=fn.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:a=Yfe,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},m)=>{let{useTransitions:g}=fn.useContext(Ud),y=vEt(),v=bEt(s,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&Qfe.test(s);return fn.createElement("form",{ref:m,method:b,action:v,onSubmit:n?l:C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,_=k?.getAttribute("formmethod")||a,R=()=>y(k||C.currentTarget,{fetcherKey:t,method:_,navigate:r,replace:o,state:i,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?fn.startTransition(()=>R()):R()},...h,"data-discover":!x&&e==="render"?"true":void 0})});hEt.displayName="Form";function mEt({getKey:e,storageKey:t,...r}){let n=fn.useContext(NZ),{basename:o}=fn.useContext(Ud),i=ki(),a=H7e();xEt({getKey:e,storageKey:t});let s=fn.useMemo(()=>{if(!n||!e)return null;let u=R7e(i,a,o,e);return u!==i.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,d)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),fn.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${m_t(JSON.stringify(t||E7e))}, ${m_t(JSON.stringify(s))})`}})}mEt.displayName="ScrollRestoration";function gEt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X7e(e){let t=fn.useContext(j_);return qn(t,gEt(e)),t}function rEn(e){let t=fn.useContext(NA);return qn(t,gEt(e)),t}function yEt(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=sn(),f=ki(),p=_O(e,{relative:a});return fn.useCallback(h=>{if(P_n(h,t)){h.preventDefault();let m=r!==void 0?r:Hd(f)===Hd(p),g=()=>d(e,{replace:m,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l});u?fn.startTransition(()=>g()):g()}},[f,d,p,r,n,o,t,e,i,a,s,l,u])}function Ga(e){ls(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=fn.useRef(Zfe(e)),r=fn.useRef(!1),n=ki(),o=fn.useMemo(()=>A_n(n.search,r.current?null:t.current),[n.search]),i=sn(),a=fn.useCallback((s,l)=>{let u=Zfe(typeof s=="function"?s(new URLSearchParams(o)):s);r.current=!0,i("?"+u,l)},[i,o]);return[o,a]}var nEn=0,oEn=()=>`__${String(++nEn)}__`;function vEt(){let{router:e}=X7e("useSubmit"),{basename:t}=fn.useContext(Ud),r=g_n(),n=e.fetch,o=e.navigate;return fn.useCallback(async(i,a={})=>{let{action:s,method:l,encType:u,formData:d,body:f}=D_n(i,t);if(a.navigate===!1){let p=a.fetcherKey||oEn();await n(p,r,a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await o(a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,o,t,r])}function bEt(e,{relative:t}={}){let{basename:r}=fn.useContext(Ud),n=fn.useContext(nm);qn(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={..._O(e||".",{relative:t})},a=ki();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(d=>d==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let d=s.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:zg([r,i.pathname])),Hd(i)}var E7e="react-router-scroll-positions",Wfe={};function R7e(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:Pf(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}function xEt({getKey:e,storageKey:t}={}){let{router:r}=X7e("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=rEn("useScrollRestoration"),{basename:i}=fn.useContext(Ud),a=ki(),s=H7e(),l=oEt();fn.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),iEn(fn.useCallback(()=>{if(l.state==="idle"){let u=R7e(a,s,i,e);Wfe[u]=window.scrollY}try{sessionStorage.setItem(t||E7e,JSON.stringify(Wfe))}catch(u){ls(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,i,a,s,t])),typeof document<"u"&&(fn.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||E7e);u&&(Wfe=JSON.parse(u))}catch{}},[t]),fn.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Wfe,()=>window.scrollY,e?(d,f)=>R7e(d,f,i,e):void 0);return()=>u&&u()},[r,i,e]),fn.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{ls(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[a,n,o]))}function iEn(e,t){let{capture:r}=t||{};fn.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function SEt(e,{relative:t}={}){let r=fn.useContext(tpe);qn(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=X7e("useViewTransitionState"),o=_O(e,{relative:t});if(!r.isTransitioning)return!1;let i=Pf(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=Pf(r.nextLocation.pathname,n)||r.nextLocation.pathname;return SO(o.pathname,a)!=null||SO(o.pathname,i)!=null}var Min=S(oe(),1);var ipe=S(oe(),1),Z7e=(0,ipe.createContext)({nodes:null,transfer:()=>{},cancel:()=>{}});function ape(){return(0,ipe.useContext)(Z7e)}var wEt=S(E(),1);function K_({inputRef:e,value:t,onChange:r,onKeyDown:n,placeholder:o,autoFocus:i}){return(0,wEt.jsx)(Yn,{autoFocus:i,inputRef:e,value:t,onChange:a=>r(a.target.value),onKeyDown:n,placeholder:o,size:"small",fullWidth:!0,slotProps:{input:{sx:{fontSize:12}}},sx:{p:.5}})}var rT=S(oe(),1),EEt=S(E(),1),CEt=(0,rT.createContext)({query:"",setQuery:()=>{},viewedTerm:"",setViewedTerm:()=>{}});function kEt({children:e}){let[t,r]=(0,rT.useState)(""),[n,o]=(0,rT.useState)(""),i=(0,rT.useMemo)(()=>({query:t,setQuery:r,viewedTerm:n,setViewedTerm:o}),[t,n]);return(0,EEt.jsx)(CEt.Provider,{value:i,children:e})}function OZ(){return(0,rT.useContext)(CEt)}function _Et(){let{query:e,viewedTerm:t}=OZ();return e.trim()?t:""}var REt=S(E(),1),G0=ot((0,REt.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");function spe(e){return{display:"block",width:"100%",textAlign:"left",p:"5px 10px",borderRadius:0,bgcolor:e?"action.selected":"background.default",borderLeft:2,borderLeftColor:e?"primary.main":"transparent",cursor:e?"default":"pointer",transition:"background 0.15s","&:hover":e?void 0:{bgcolor:"action.hover"}}}var cOi=S(oe(),1);var PEt=S(E(),1),lpe=ot((0,PEt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");var sEn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function cpe(e){let t=sEn.exec(e);if(!t)return;let[,r,n,o]=t;return`https://github.com/${r}/${n}/issues/${o}`}var lEn=/^[^/\s]+\/[^/\s]+#(\d+)$/;function AEt(e){let t=lEn.exec(e);return t?`#${t[1]}`:e}var cEn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function LEt(e,t){let r=cEn.exec(e);if(!r||!t)return e;let[,n,o,i]=r;return`github.com/${n}/${o}`.toLowerCase()===t.toLowerCase()?`#${i}`:e}var Q7e=S(E(),1),IEt={height:18,fontSize:"0.65rem"};function DEt({label:e,url:t,title:r}){return t?(0,Q7e.jsx)(xn,{label:e,title:r,size:"small",sx:IEt,clickable:!0,component:"a",href:t,target:"_blank",rel:"noopener",onClick:n=>n.stopPropagation()}):(0,Q7e.jsx)(xn,{label:e,title:r,size:"small",sx:IEt,clickable:!1,onClick:n=>n.stopPropagation()})}var EO=S(E(),1),MEt={display:"inline-flex",alignItems:"center",gap:.375,whiteSpace:"nowrap","& svg":{fontSize:14}};function NEt({icon:e,label:t,title:r,url:n}){return n?(0,EO.jsx)(pr,{title:r,children:(0,EO.jsxs)(Xr,{href:n,target:"_blank",rel:"noopener",underline:"hover",sx:MEt,children:[e,t]})}):(0,EO.jsx)(pr,{title:r,children:(0,EO.jsxs)(H,{component:"span",sx:{...MEt,color:"text.disabled"},children:[e,t]})})}var BEt=S(E(),1),uEn={color:"primary.main",opacity:.85,whiteSpace:"nowrap"};function OEt({label:e,url:t,title:r}){return t?(0,BEt.jsx)(Xr,{href:t,title:r,target:"_blank",rel:"noopener",underline:"hover",sx:uEn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:e}):e}var RO=S(E(),1),$Et={fontSize:"0.875rem"};function upe({label:e,url:t,variant:r="link",icon:n,title:o}){return r==="chip"?(0,RO.jsx)(DEt,{label:e,url:t,title:o}):r==="token"?(0,RO.jsx)(OEt,{label:e,url:t,title:o}):r==="icon"?(0,RO.jsx)(NEt,{icon:n,label:e,title:o??e,url:t}):t?(0,RO.jsx)(Xr,{href:t,target:"_blank",rel:"noopener",onClick:i=>i.stopPropagation(),sx:$Et,children:e}):(0,RO.jsx)(Se,{variant:"body2",color:"text.disabled",sx:$Et,children:e})}var J7e=S(E(),1);function X_({githubIssue:e,origin:t,variant:r="link"}){return e?(0,J7e.jsx)(upe,{label:r==="link"?LEt(e,t):AEt(e),title:e,url:cpe(e),icon:(0,J7e.jsx)(lpe,{}),variant:r}):null}var dpe=S(oe(),1);function FEt(){let[e,t]=(0,dpe.useState)(null);return(0,dpe.useEffect)(()=>{let r=!1;return(async()=>{try{let o=await(await fetch("/api/jira-site")).json();r||t(o?.site??null)}catch{r||t(null)}})(),()=>{r=!0}},[]),e}var zEt=S(E(),1);function PO({jiraKey:e,variant:t="link"}){let r=FEt();if(!e)return null;let n=r?`https://${r}/browse/${e}`:void 0;return(0,zEt.jsx)(upe,{label:e,url:n,variant:t})}var e8e=S(E(),1);function fpe({tracker:e,variant:t="link"}){return e?.jiraKey?(0,e8e.jsx)(PO,{jiraKey:e.jiraKey,variant:t}):e?.githubIssue?(0,e8e.jsx)(X_,{githubIssue:e.githubIssue,origin:e.origin,variant:t}):null}var t8e=class extends Error{constructor(){super(...arguments);yr(this,"name","InvalidItemIdError")}};function pn(e){return`a${e}`}var dEn=/^a?(\d+)$/;function Z_(e){let t=dEn.exec(e.trim());if(!t)throw new t8e(`Invalid backlog item id "${e}" (e.g. a574 or 574).`);return Number.parseInt(t[1],10)}function Vr(e,t){if(!t)return e;let r=e.includes("?")?"&":"?";return`${e}${r}node=${encodeURIComponent(t)}`}function gc(e,t,r){if(!t)return Vr(e,r);let n=e.includes("?")?"&":"?";return Vr(`${e}${n}cwd=${encodeURIComponent(t)}`,r)}function Vd(e,t,r){return gc(`/backlog/items/${pn(e)}`,t,t&&r)}function fEn(e,t){if(t==="neutral")return{color:e.palette.text.secondary,borderColor:e.palette.divider};let{main:r}=e.palette[t];return{color:r,borderColor:Ur(r,.35)}}function Vo(e){return t=>({display:"inline-block",fontFamily:t.typography.fontFamilyMono,fontSize:10,fontWeight:400,lineHeight:"16px",px:"5px",border:1,borderRadius:"4px",whiteSpace:"nowrap",opacity:1,...fEn(t,e)})}var ppe=S(oe(),1),yc=(0,ppe.createContext)(void 0);function hr(){return(0,ppe.useContext)(yc)}var UEt=S(E(),1),pEn=[Vo("primary"),{flexShrink:0,textDecoration:"none"}],HEt=e=>e.stopPropagation();function hpe({itemId:e,cwd:t}){let r=hr();return(0,UEt.jsx)(H,{component:Sa,to:Vd(e,t,r),onMouseDown:HEt,onClick:HEt,sx:pEn,children:pn(e)})}var hEn={claude:"Claude","claude-sdk":"Claude (SDK)",codex:"Codex",pi:"pi"},mEn={claude:"Claude Code","claude-sdk":"Claude Code",codex:"Codex",pi:"pi"},Ug="claude";function Wd(e){return e??Ug}function _i(e){return hEn[Wd(e)]}function VEt(e){return mEn[Wd(e)]}var WEt=S(E(),1),gEn=Vo("neutral");function mpe({harness:e}){return Wd(e)===Ug?null:(0,WEt.jsx)(H,{component:"span",sx:gEn,children:_i(e).toLowerCase()})}var yEn=["update"];function AO(e){return!e||!yEn.includes(e)}function cs(e){if(!e)return"";let t=e.split(/[/\\]/).filter(Boolean);return t[t.length-1]??""}function q0(e){return e.repoGroup?.origin||e.cwd||void 0}function $l(e){return e.repoGroup?.clone||e.cwd||void 0}function LO(e,t){if(!e)return e;for(let r of t){let n=r.repoGroup;if(n&&(n.clone===e||r.cwd===e))return n.origin}return e}var bpe=S(oe(),1);var GEt="";function r8e(e){GEt=e.replace(/\/+$/,"")}function nT(e){return`${GEt}${e}`}function qEt(e){let t=new URL(nT(e),location.href);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}var jEt=new WeakSet;function BA(e){typeof e=="object"&&e!==null&&jEt.add(e)}function BZ(e){return typeof e=="object"&&e!==null&&jEt.has(e)}var vEn="/api/client-errors",a8e=1e3,bEn=6e4,xEn=1e4,SEn=50,TEn=500,IO=[],n8e,o8e=!1,gpe=a8e;function i8e(e){n8e||o8e||(n8e=setTimeout(()=>{n8e=void 0,CEn()},e))}async function wEn(e){try{return(await fetch(nT(vEn),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({failures:e}),signal:AbortSignal.timeout(xEn)})).ok}catch{return!1}}async function CEn(){let e=IO.slice(0,SEn);if(e.length===0)return;o8e=!0;let t=await wEn(e);if(o8e=!1,t){IO=IO.slice(e.length),gpe=a8e,IO.length>0&&i8e(0);return}gpe=Math.min(gpe*2,bEn),i8e(gpe)}function YEt(e){IO=[...IO,e].slice(-TEn),i8e(a8e)}var kEn=100,l8e=[],s8e=new Set;function KEt(e){l8e=e;for(let t of s8e)t()}function DO(e){KEt([e,...l8e].slice(0,kEn)),YEt(e)}function c8e(){return l8e}function XEt(){KEt([])}function ZEt(e){return s8e.add(e),()=>{s8e.delete(e)}}function _En(e){return new URL(e,"http://local").searchParams.get("node")??void 0}function QEt(e,t,r){let n=Date.now();return o=>{r&&DO({at:new Date(n).toISOString(),method:(t??"GET").toUpperCase(),path:e,base:nT("")||location.origin,node:_En(e),durationMs:Date.now()-n,...o})}}var EEn="x-assist-trace-id";async function REn(e){try{let t=await e.clone().json();if(t&&typeof t=="object"&&"error"in t){let{error:r}=t;if(typeof r=="string"&&r)return r}}catch{}}async function ype(e){let t=await REn(e)??(e.statusText||void 0),r=e.headers?.get(EEn);return r?t?`${t} (trace=${r})`:`trace=${r}`:t}function JEt(e,t){let r=new AbortController,n=()=>r.abort(e?.reason);e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(new DOMException(`timed out after ${t/1e3}s`,"TimeoutError")),t);return{signal:r.signal,clear:()=>{clearTimeout(o),e?.removeEventListener("abort",n)}}}var PEn=3e4;function AEn(e){return e instanceof DOMException&&e.name==="TimeoutError"}async function Wt(e,t={}){let{timeoutMs:r=PEn,capture:n=!0,blipGate:o,signal:i,...a}=t,{signal:s,clear:l}=JEt(i,r),u=QEt(e,a.method,n);try{let d=await fetch(nT(e),{...a,signal:s});return d.ok?o?.reset():(o?.shouldRecord(d.status)??!0)&&u({status:d.status,error:await ype(d)}),d}catch(d){let f=s.aborted?s.reason:d;throw(!s.aborted||AEn(f))&&(u({error:f instanceof Error?f.message:String(f)}),BA(f)),f}finally{l()}}var LEn={error:"ERROR",rejection:"REJECT",caught:"CAUGHT"};function $Z(e,t){DO({at:new Date().toISOString(),kind:e,method:LEn[e],path:location.pathname+location.search,base:location.origin,error:t,durationMs:0})}function wr(e,t){if(BZ(e))return;BA(e);let r=e instanceof Error?e.message:String(e);$Z("caught",`${t}: ${r}`)}var e4t=new Map;function vpe(e,t){let r=`${t??""}\0${e??""}`,n=e4t.get(r);return n||(n=(async()=>{let i=await(await Wt(gc("/api/items",e,t))).json(),a=new Map;for(let s of i)!s.jiraKey&&!s.githubIssue||a.set(s.id,{jiraKey:s.jiraKey,githubIssue:s.githubIssue,origin:s.origin});return a})().catch(o=>(wr(o,"item trackers"),new Map)),e4t.set(r,n)),n}function xpe(e){let[t,r]=(0,bpe.useState)(()=>new Map),n=hr();return(0,bpe.useEffect)(()=>{let o=!1;return vpe(e,n).then(i=>{o||r(i)}),()=>{o=!0}},[e,n]),o=>o==null?void 0:t.get(o)}var u8e=S(E(),1),IEn=Vo("neutral");function Spe({node:e}){return e?(0,u8e.jsx)(pr,{title:`Running on ${e}`,children:(0,u8e.jsx)(H,{component:"span",sx:IEn,children:e})}):null}var j0=S(E(),1),t4t={height:18,fontSize:"0.65rem"};function r4t({session:e}){let t=AO(e.sessionType)?cs(e.cwd):"",r=xpe(e.cwd);return(0,j0.jsxs)(j0.Fragment,{children:[t&&(0,j0.jsx)(xn,{label:t,size:"small",sx:t4t}),(0,j0.jsx)(mpe,{harness:e.harness}),(0,j0.jsx)(Spe,{node:e.node}),e.sessionType&&e.sessionType!=="next"&&(0,j0.jsx)(xn,{label:e.sessionType,size:"small",color:"primary",variant:"outlined",sx:t4t}),e.itemId!=null&&(0,j0.jsx)(hpe,{itemId:e.itemId,cwd:$l(e)}),(0,j0.jsx)(fpe,{variant:"chip",tracker:r(e.itemId)})]})}function so(e){let t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var n4t=S(E(),1);function sa({children:e}){let t=r=>r.stopPropagation();return(0,n4t.jsx)(H,{sx:{display:"contents"},onClick:t,onMouseDown:t,onTouchStart:t,children:e})}var MO=S(oe(),1),DEn=1200;function Q_(e){let[t,r]=(0,MO.useState)(!1),n=(0,MO.useRef)(void 0);return(0,MO.useEffect)(()=>()=>clearTimeout(n.current),[]),{copied:t,copy:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),clearTimeout(n.current),n.current=setTimeout(()=>r(!1),DEn)})}}}var FZ=S(E(),1);function o4t({sessionId:e,harness:t}){let{copied:r,copy:n}=Q_(e),o=i=>{i.stopPropagation(),n()};return(0,FZ.jsx)(sa,{children:(0,FZ.jsx)(pr,{title:r?"Copied!":`Copy ${_i(t)} session id`,open:r||void 0,children:(0,FZ.jsx)(Zt,{onClick:o,sx:{borderRadius:.5,px:.25},children:(0,FZ.jsx)(Se,{variant:"caption",color:"text.disabled",sx:{fontFamily:"fontFamilyMono"},children:e.slice(0,8)})})})})}var zZ=S(E(),1);function i4t({session:e}){return(0,zZ.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,alignSelf:"flex-end"},children:[e.sessionId&&(0,zZ.jsx)(o4t,{sessionId:e.sessionId,harness:e.harness}),(0,zZ.jsx)(Se,{variant:"caption",color:"text.disabled",children:so(e.lastActivity??e.timestamp)})]})}var a4t=S(E(),1);function Tpe({children:e}){return(0,a4t.jsx)(H,{component:"mark",sx:{bgcolor:"warning.main",color:"warning.contrastText",borderRadius:.5,px:.25},children:e})}var wpe=S(E(),1);function s4t({snippet:e}){return(0,wpe.jsxs)(Se,{variant:"caption",sx:{color:"text.secondary",overflowWrap:"anywhere"},children:[e.before,(0,wpe.jsx)(Tpe,{children:e.match}),e.after]})}function l4t(e){return e.prompt||e.name}var $A=S(E(),1);function c4t({session:e}){return(0,$A.jsxs)($A.Fragment,{children:[e.title&&(0,$A.jsx)(Se,{variant:"body2",sx:{color:"text.primary",fontWeight:500,overflowWrap:"anywhere"},children:e.title}),(0,$A.jsx)(Se,{variant:e.title?"caption":"body2",sx:{color:e.title?"text.secondary":"text.primary",overflowWrap:"anywhere"},children:l4t(e)})]})}var Af=S(E(),1);function MEn({onResume:e}){return(0,Af.jsx)(Ht,{size:"small",onClick:t=>{t.stopPropagation(),e()},title:"Resume",sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,Af.jsx)(G0,{sx:{fontSize:14}})})}function u4t({session:e,selected:t=!1,onView:r,onResume:n}){return(0,Af.jsx)(yc.Provider,{value:e.node,children:(0,Af.jsx)(Zt,{onClick:()=>r(e),sx:spe(t),"aria-current":t||void 0,children:(0,Af.jsxs)(H,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[(0,Af.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,Af.jsx)(r4t,{session:e}),(0,Af.jsx)(H,{sx:{flex:1}}),(0,Af.jsx)(sa,{children:(0,Af.jsx)(MEn,{onResume:()=>n(e)})})]}),(0,Af.jsx)(c4t,{session:e}),e.snippet&&(0,Af.jsx)(s4t,{snippet:e.snippet}),(0,Af.jsx)(i4t,{session:e})]})})})}var kpe=S(E(),1);function Cpe({sessions:e,viewingId:t,onView:r,onResume:n,empty:o}){return(0,kpe.jsxs)(H,{sx:{flex:1,overflow:"auto",p:1},children:[e.map(i=>(0,kpe.jsx)(u4t,{session:i,selected:i.sessionId===t,onView:r,onResume:n},i.sessionId)),e.length===0&&o]})}var d4t=S(E(),1);function NO({children:e,color:t="text.disabled"}){return(0,d4t.jsx)(Se,{variant:"caption",color:t,role:"status",sx:{display:"block",textAlign:"center",p:2},children:e})}var OO=S(E(),1);function f4t({search:e,viewingId:t,...r}){return e.status==="loading"?(0,OO.jsx)(NO,{children:"Searching\u2026"}):e.status==="error"?(0,OO.jsxs)(NO,{color:"error.main",children:["Search failed: ",e.message]}):(0,OO.jsx)(Cpe,{sessions:e.sessions,viewingId:t,empty:(0,OO.jsx)(NO,{children:"No sessions match"}),...r})}var _pe=S(oe(),1);async function p4t(e,t,r,n){let o=await Wt(Vr(`/api/history/search?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,r),{signal:n}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(i.error??`HTTP ${o.status}`);let a=Array.isArray(i.sessions)?i.sessions:[];return r?a.map(s=>({...s,node:r})):a}var NEn=300;function h4t(e,t,r){let n=r.trim(),[o,i]=(0,_pe.useState)({status:"idle"});return(0,_pe.useEffect)(()=>{if(!e||!n){i({status:"idle"});return}i({status:"loading"});let a=new AbortController,s=setTimeout(()=>{p4t(e,n,t,a.signal).then(l=>{a.signal.aborted||i({status:"done",sessions:l})},l=>{if(a.signal.aborted)return;let u=l instanceof Error?l.message:String(l);i({status:"error",message:u})})},NEn);return()=>{clearTimeout(s),a.abort()}},[e,t,n]),o}var Epe=S(oe(),1),HZ=(0,Epe.createContext)({repos:[],selectedCwd:"",worktreeCwd:"",setSelectedCwd:()=>{},cloneOn:e=>e,originOf:()=>{}});function Ln(){return(0,Epe.useContext)(HZ)}var FA=S(E(),1);function m4t({sessions:e,...t}){let{selectedCwd:r,selectedNode:n}=Ln(),{query:o,setQuery:i}=OZ(),a=h4t(r,n,o),s=LO(r,e),l=r?e.filter(u=>q0(u)===s||$l(u)===r):[];return(0,FA.jsxs)(H,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[r&&(0,FA.jsx)(K_,{value:o,onChange:i,placeholder:"Search history..."}),a.status==="idle"?(0,FA.jsx)(Cpe,{sessions:l,empty:(0,FA.jsx)(NO,{children:"No history for this repo"}),...t}):(0,FA.jsx)(f4t,{search:a,...t,onView:u=>t.onView(u,o.trim())})]})}var B4t=S(oe(),1);function g4t(e,t,r){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return n===-1?r===1?e[0]:e.at(-1):e[(n+r+e.length)%e.length]}var d8e=null;function Rpe(e){d8e=e,e.focus({preventScroll:!0})}function BO(){let e=globalThis.document;return e.querySelector('[role="dialog"][aria-modal="true"]')?!0:d8e!==null&&e.activeElement===d8e}function Ppe(e){let t=globalThis.document.querySelector(`[data-session-id="${e}"]`);t&&Rpe(t)}function Ape(e){globalThis.requestAnimationFrame(()=>{globalThis.document.querySelector(`[data-session-id="${e}"]`)?.scrollIntoView({block:"nearest"})})}function Lpe(e){return e.key==="Tab"&&!e.ctrlKey&&!e.altKey&&!e.metaKey}var zA=S(oe(),1);var y4t="assist:group-collapse",f8e=new Set;function p8e(){try{return localStorage.getItem(y4t)??""}catch{return""}}function h8e(e){if(!e)return{};try{let t=JSON.parse(e);return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r=="object"))}catch{return{}}}function v4t(e){try{localStorage.setItem(y4t,JSON.stringify(e))}catch{}for(let t of f8e)t()}function OEn(e,t){v4t({...h8e(p8e()),[e]:t})}function BEn(e){let t=h8e(p8e()),r=Object.fromEntries(Object.entries(t).filter(([n])=>!e.includes(n)));Object.keys(r).length!==Object.keys(t).length&&v4t(r)}function $En(e){return f8e.add(e),()=>{f8e.delete(e)}}var oT={getRaw:p8e,parse:h8e,setChoice:OEn,removeChoices:BEn,subscribe:$En};function $O(){let e=(0,zA.useSyncExternalStore)(oT.subscribe,oT.getRaw),t=(0,zA.useMemo)(()=>oT.parse(e),[e]),r=(0,zA.useCallback)(n=>{let o=t[n];return o!==void 0&&"collapsedAt"in o},[t]);return(0,zA.useMemo)(()=>({isCollapsed:r,setCollapsed:(n,o)=>oT.setChoice(n,o?{collapsedAt:Date.now()}:{openedAt:Date.now()})}),[r])}var iT=S(oe(),1);function FEn(e,t){let r=new URLSearchParams;e&&r.set("q",e),t&&t!=="todo"&&r.set("filter",t);let n=r.toString();return n?`/api/items?${n}`:"/api/items"}async function J_({query:e,cwd:t,node:r,signal:n,filter:o}={}){let i=await Wt(gc(FEn(e,o),t,r),{signal:n});if(!i.ok){let a=await i.json().catch(()=>null);throw new Error(a?.error??`HTTP ${i.status}`)}return i.json()}function UZ(e){let t=e.activity?.itemId;if(!(!e.cwd||e.activity?.kind!=="backlog"||t==null))return{cwd:e.cwd,itemId:t}}function VZ(e,t){return`${e}::${t}`}function b4t(e){let t=new Set;for(let r of e){let n=UZ(r);n&&t.add(n.cwd)}return[...t].sort()}async function zEn(e){try{return(await J_({cwd:e,filter:"all"})).filter(r=>r.starred).map(r=>VZ(e,r.id))}catch(t){return wr(t,"starred keys"),[]}}async function x4t(e){let t=await Promise.all(e.map(zEn));return new Set(t.flat())}var Mpe=S(oe(),1);var S4t="/api/backlog/docs-refresh";async function Ipe(e,t,r){let n=await Wt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`${t} ${e} failed: ${n.status}`);return n.json()}async function T4t(e,t,r){await Wt(gc(`/api/items/${pn(e)}`,t,r),{method:"DELETE"})}function FO(e,t,r,n){return Ipe(gc(`/api/items/${pn(e)}`,r,n),"PATCH",{status:t})}function Dpe(e,t,r,n){return Ipe(gc(`/api/items/${pn(e)}/star`,r,n),"POST",{starred:t})}function w4t(e,t,r,n,o){return Ipe(gc(`/api/items/${pn(e)}/rewind`,n,o),"POST",{phase:t,reason:r})}async function C4t(e,t,r){return(await Wt(gc(S4t,e,t),{signal:r})).json()}function k4t(e,t){return Ipe(gc(S4t,e,t),"POST",{})}function HEn(e,t,r){let n=new Set(e);return r?n.add(t):n.delete(t),n}function _4t(e,t){let r=UZ(t);return r?e.has(VZ(r.cwd,r.itemId)):t.starred??!1}function E4t(e,t,r){let n=UZ(r);if(!n){t(r.id,!(r.starred??!1));return}let o=VZ(n.cwd,n.itemId);e(i=>{let a=!i.has(o);return Dpe(n.itemId,a,n.cwd),HEn(i,o,a)})}function UEn(e,t){let r=!1,n=e?e.split("|"):[];return x4t(n).then(o=>{r||t(o)}),()=>{r=!0}}function R4t(e){let[t,r]=(0,Mpe.useState)(new Set);return(0,Mpe.useEffect)(()=>UEn(e,r),[e]),[t,r]}var A4t=S(E(),1),P4t=(0,iT.createContext)(null);function Npe({sessions:e,setSessionStarred:t,children:r}){let n=b4t(e).join("|"),[o,i]=R4t(n),a=(0,iT.useCallback)(u=>_4t(o,u),[o]),s=(0,iT.useCallback)(u=>E4t(i,t,u),[i,t]),l=(0,iT.useMemo)(()=>({isStarred:a,toggleStar:s}),[a,s]);return(0,A4t.jsx)(P4t.Provider,{value:l,children:r})}function Vg(){let e=(0,iT.useContext)(P4t);if(!e)throw new Error("useStarredSessions must be used within a StarredSessionsProvider");return e}function Ope(e){return e.flatMap(t=>t.kind==="single"?[t.session]:t.rows.flatMap(r=>[r.session,...r.children]))}var m8e="assist:group-order";var HA=null;function VEn(){if(HA)return HA;try{let e=JSON.parse(localStorage.getItem(m8e)??"[]");HA=Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{HA=[]}return HA}function WEn(e){HA=e;try{localStorage.setItem(m8e,JSON.stringify(e))}catch{}}function GEn(e,t){let r=e.length-200;return r<=0?e:e.filter(n=>t.has(n)||r--<=0)}function qEn(e){let t=VEn(),r=e.filter(o=>!t.includes(o)),n=r.length>0?GEn([...t,...r],new Set(e)):t;return n!==t&&WEn(n),new Map(n.map((o,i)=>[o,i]))}function jEn(){HA=null;try{localStorage.removeItem(m8e)}catch{}}var L4t={rank:qEn,clear:jEn};function I4t(e){let t=new Map;for(let n of e){let o=q0(n)??` nogroup:${n.id}`,i=t.get(o);if(i){i.members.push(n);continue}t.set(o,{key:o,label:cs($l(n)??o),members:[n]})}let r=L4t.rank([...t.keys()]);return[...t.values()].sort((n,o)=>(r.get(n.key)??0)-(r.get(o.key)??0))}function D4t(e){let t=new Map(e.map(o=>[g8e(o,o.id),o])),r=YEn(e),n=new Map;for(let o of e){let i=KEn(o,t)??ZEn(o,r);i&&n.set(o,i)}return n}function YEn(e){let t=new Map;for(let r of e){let n=N4t(r);!n||!M4t(r)||t.has(n)||t.set(n,r)}return t}function KEn(e,t){let r=e.launchedFrom?t.get(g8e(e,e.launchedFrom)):void 0;if(!(!r||r===e))return XEn(e,r)?r:void 0}function XEn(e,t){return e.cwd!==void 0&&e.cwd===t.cwd&&e.node===t.node}function ZEn(e,t){if(M4t(e))return;let r=N4t(e),n=r?t.get(r):void 0;return n===e?void 0:n}function M4t(e){return e.activity?.kind==="backlog"}function N4t(e){let{cwd:t,repoGroup:r}=e;if(!(!t||!r||r.clone===t))return g8e(e,t)}function g8e(e,t){return JSON.stringify([e.node??null,t])}function Bpe(e){let t=D4t(e),r=new Map;for(let i of e){let a=QEn(i,t);a&&r.set(i,a)}let n=new Map,o=[];for(let i of e){if(r.has(i))continue;let a={session:i,children:[]};n.set(i,a),o.push(a)}for(let i of e){let a=r.get(i);a&&n.get(a)?.children.push(i)}return o}function QEn(e,t){let r=new Set([e]),n=t.get(e);for(;n;){if(r.has(n))return;let o=t.get(n);if(!o)return n;r.add(n),n=o}}function y8e(e,t){return[...e.filter(r=>t(r)),...e.filter(r=>!t(r))]}function $pe(e,t,r=2){let n=I4t(e).map(({key:o,label:i,members:a})=>a.length<r?{kind:"single",session:a[0]}:{kind:"repo",key:o,label:i,rows:y8e(Bpe(a),s=>O4t(s).some(t))});return y8e(n,o=>JEn(o).some(t))}function O4t(e){return[e.session,...e.children]}function JEn(e){return e.kind==="repo"?e.rows.flatMap(O4t):[e.session]}var e4n=()=>!1;function Fpe(e,t,r=e4n,n=2){return Ope($pe(e,t,n).filter(o=>o.kind==="single"||!r(o.key)))}function $4t({sessions:e,onSelect:t}){let{isStarred:r}=Vg(),{isCollapsed:n}=$O();return(0,B4t.useCallback)(o=>{if(!Lpe(o.nativeEvent))return;let i=o.target.closest("[data-session-id]");if(!i)return;let a=Fpe(e,r,n,1).map(u=>u.id),s=i.getAttribute("data-session-id"),l=g4t(a,s,o.shiftKey?-1:1);!l||l===s||(o.preventDefault(),t(l),Ppe(l),Ape(l))},[e,r,n,t])}var v8e=S(E(),1),t4n={flex:1,overflow:"auto"},r4n={py:.5};function F4t({sessions:e,onSelect:t,children:r}){let n=$4t({sessions:e,onSelect:t});return(0,v8e.jsx)(H,{sx:t4n,onKeyDown:n,children:(0,v8e.jsx)(H,{sx:r4n,children:r})})}var H4t=S(E(),1),n4n={display:"block",textAlign:"center",p:2};function z4t(){return(0,H4t.jsx)(Se,{variant:"caption",color:"text.disabled",sx:n4n,children:"No sessions yet"})}var U4t=S(E(),1),Bo=ot((0,U4t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var V4t=S(E(),1),zO=ot((0,V4t.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded");var q1=S(E(),1),o4n={...spe(!1),cursor:"default",position:"relative"},i4n={position:"absolute",top:4,right:4,color:"text.disabled","&:hover":{color:"text.primary"}},a4n={display:"flex",alignItems:"center",gap:1,pr:3},s4n={color:"text.primary",overflowWrap:"anywhere"};function l4n(e){return{display:"block",mt:.5,color:e?"error.main":"text.secondary",overflowWrap:"anywhere"}}function c4n(e){return e.node?`Starting session on ${e.node}\u2026`:"Starting session\u2026"}function W4t({launch:e,onDismiss:t}){let r=e.status==="error";return(0,q1.jsxs)(H,{sx:o4n,children:[(0,q1.jsx)(Ht,{size:"small",onClick:()=>t(e.id),title:"Dismiss",sx:i4n,children:(0,q1.jsx)(Bo,{sx:{fontSize:16}})}),(0,q1.jsxs)(H,{sx:a4n,children:[r?(0,q1.jsx)(zO,{color:"error",sx:{fontSize:18}}):(0,q1.jsx)(oo,{size:16}),(0,q1.jsx)(Se,{variant:"body2",sx:s4n,children:e.title})]}),(0,q1.jsx)(Se,{variant:"caption",sx:l4n(r),children:r?e.error:c4n(e)})]})}function G4t(e){return new Set(e.filter(t=>t.cwd&&t.cwd===t.repoGroup?.clone).map(t=>t.id))}function b8e(e){return e.commandType==="run"&&e.server===!0&&e.status!=="done"&&e.status!=="error"}function q4t(e){return e.filter(b8e)}var j4t=S(E(),1),zpe=ot((0,j4t.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch");var Hpe=S(oe(),1),x8e=(0,Hpe.createContext)({nodes:null,names:[],visible:!1,selected:void 0,select:()=>{}});function us(){return(0,Hpe.useContext)(x8e)}function u4n(e){return e?e.startsWith("/")?e:`/${e}`:""}function Y4t(e,t,r,n="http",o){let i=t&&t!==r?.local?r?.links.find(s=>s.name===t):void 0,a=u4n(o);return i?{url:`${n}://${new URL(i.url).hostname}:${e}${a}`,remote:!0}:{url:`${n}://localhost:${e}${a}`,remote:!1}}var K4t=S(E(),1);function Upe({port:e,node:t,protocol:r,urlPath:n}){let{nodes:o}=us(),{url:i,remote:a}=Y4t(e,t,o,r,n);return(0,K4t.jsxs)(Xr,{href:i,title:a?`Opens ${i} on ${t}; the dev server must listen on the tailnet (e.g. --host 0.0.0.0)`:i,target:"_blank",rel:"noopener noreferrer",color:"inherit",onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[":",e]})}var j1=S(E(),1),d4n={display:"flex",alignItems:"center",gap:.5,px:"10px",py:.25,borderRadius:0,borderLeft:2,borderLeftColor:"success.main",bgcolor:"success.dark"},f4n={flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"success.contrastText"};function X4t({serving:e,onJump:t}){let r=cs(e.cwd),n=r?` \xB7 ${r} \xB7 ${e.name}`:` \xB7 ${e.name}`,o=`${e.port?`serving :${e.port}`:"serving"}${n}`;return(0,j1.jsxs)(H,{sx:d4n,children:[(0,j1.jsxs)(Se,{variant:"caption",title:o,sx:f4n,children:["serving",e.port?(0,j1.jsxs)(j1.Fragment,{children:[" ",(0,j1.jsx)(Upe,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath})]}):null,n]}),(0,j1.jsx)(it,{size:"small",startIcon:(0,j1.jsx)(zpe,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t()},sx:{color:"success.contrastText",minWidth:0},children:"Jump"})]})}var WZ=S(E(),1);function Z4t({sessions:e,onJump:t}){let r=q4t(e);return r.length===0?null:(0,WZ.jsx)(WZ.Fragment,{children:r.map(n=>(0,WZ.jsx)(X4t,{serving:n,onJump:()=>t(n.id)},n.id))})}function Q4t(e){return e.flatMap(t=>[t.session,...t.children])}var GZ=S(E(),1),p4n={position:"relative","&::before":{content:'""',position:"absolute",left:0,top:"-1px",width:"6px",height:"19.5px",borderLeft:1,borderBottom:1,borderColor:"divider"},"&:not(:last-of-type)::after":{content:'""',position:"absolute",left:0,top:0,bottom:"-1px",borderLeft:1,borderColor:"divider"}},h4n={ml:"13px"};function J4t({rows:e,renderCard:t}){let r=(n,o,i=!0)=>(0,GZ.jsx)(H,{sx:i?p4n:void 0,children:t(n,o)},n.id);return e.map(n=>n.children.length===0?r(n.session,void 0,!1):(0,GZ.jsxs)(H,{children:[r(n.session,n.children,!1),(0,GZ.jsx)(H,{sx:h4n,children:n.children.map(o=>r(o))})]},n.session.id))}var aT=S(E(),1);function $o({onConfirm:e,onCancel:t,title:r="Confirm deletion",message:n="Are you sure you want to delete this item?",confirmLabel:o="Delete",confirmColor:i="error",busy:a=!1,autoFocusConfirm:s=!1}){return(0,aT.jsxs)(_a,{open:!0,onClose:a?void 0:t,maxWidth:"xs",fullWidth:!0,children:[(0,aT.jsx)(Dl,{children:r}),(0,aT.jsx)(Il,{children:(0,aT.jsx)(l_,{children:n})}),(0,aT.jsxs)(Yc,{children:[(0,aT.jsx)(it,{onClick:t,disabled:a,children:"Cancel"}),(0,aT.jsx)(it,{variant:"contained",color:i,onClick:e,loading:a,autoFocus:s,children:o})]})]})}var e5t=S(oe(),1),m4n="(Shift skips confirmation)";function ds(e,{needsConfirm:t=!0,onOpen:r}={}){let[n,o]=(0,e5t.useState)(!1),i=r??(()=>o(!0));return{confirming:n,close:()=>o(!1),triggerHandlers:{onClick:a=>{a.stopPropagation(),a.shiftKey||!t?e():i()},onKeyDown:a=>{a.key!=="Enter"||!a.shiftKey||(a.preventDefault(),a.stopPropagation(),e())}},withHint:a=>`${a} ${m4n}`}}var sT=S(E(),1),S8e="group-close",g4n={p:"2px",my:"-2px",opacity:0,color:"text.disabled","&:hover":{color:"text.primary"},"&:focus-visible":{opacity:1}};function t5t({label:e,sessionIds:t,onDismiss:r}){let n=()=>{for(let d of t)r(d)},{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(n),l=t.length,u=l===1?"session":"sessions";return(0,sT.jsxs)(sT.Fragment,{children:[(0,sT.jsx)(Ht,{size:"small",className:S8e,...a,title:s(`Close all sessions in ${e}`),sx:g4n,children:(0,sT.jsx)(Bo,{sx:{fontSize:14}})}),o&&(0,sT.jsx)(sa,{children:(0,sT.jsx)($o,{title:`Close ${e}`,message:`This will close all ${l} ${u} in ${e}, including starred and nested sessions. Running sessions will be stopped.`,confirmLabel:`Close ${l}`,onConfirm:()=>{i(),n()},onCancel:i})})]})}var y4n=new Set(["question","backlog-item","github-issue","github-issue-edit","github-issue-comment","pr-comment","design"]);function Xi(e){let t=e.pendingPrPreview;return t&&t.kind!=="show"&&(e.status==="running"||e.status==="waiting")?y4n.has(t.kind)?"question":t.kind==="check"?"check":"waiting":e.status}var v4n=["check","waiting","running","done"];function b4n(e){return e==="question"?"waiting":e}function r5t(e){return v4n.map(t=>({status:t,count:e.filter(r=>b4n(Xi(r))===t).length})).filter(t=>t.count>0)}var x4n={claude:{red:30,yellow:20},"claude-sdk":{red:30,yellow:20},codex:{red:75,yellow:50},pi:{red:30,yellow:20}};function n5t(e,t){let{red:r,yellow:n}=x4n[Wd(t)];return e>=r?"red":e>=n?"yellow":"dim"}var Ku={running:"success.main",idle:"text.disabled",waiting:"warning.main",question:"warning.main",check:"warning.main",done:"info.main",error:"error.main",stopped:"text.secondary"};function Vpe(e,t){switch(n5t(e,t)){case"red":return"error.main";case"yellow":return"warning.main";default:return"text.disabled"}}var o5t={d:"M6 1.34A6 6 0 0 0 6.5 12.81V16h3v-3.19A6 6 0 0 0 10 1.34V6H6z",transform:"rotate(45 8 8)"};var T8e=S(E(),1),S4n={fontSize:"inherit",verticalAlign:"-0.125em"};function i5t(){return(0,T8e.jsx)(E1,{viewBox:"0 0 16 16",sx:S4n,"data-testid":"wrench-head",children:(0,T8e.jsx)("path",{...o5t})})}var eE={running:"\u25CF",idle:"\u25CF",waiting:"\u25C6",question:"?",done:"\u2713",error:"\u2715",stopped:"\u25CB"};var a5t=S(E(),1);function Y1({status:e}){return e==="check"?(0,a5t.jsx)(i5t,{}):eE[e]}var HO=S(E(),1),T4n={display:"flex",gap:1,flexShrink:0,color:"text.secondary",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function s5t({sessions:e}){return(0,HO.jsx)(H,{sx:T4n,children:r5t(e).map(({status:t,count:r})=>(0,HO.jsxs)(Se,{variant:"caption","data-tally":t,children:[(0,HO.jsx)(H,{component:"span",sx:{color:Ku[t]},children:(0,HO.jsx)(Y1,{status:t})})," ",r," ",t]},t))})}var l5t=S(E(),1),Fo=ot((0,l5t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var c5t=S(E(),1),Ra=ot((0,c5t.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var d5t=S(E(),1),w4n={fontSize:12,color:"text.secondary",flexShrink:0};function u5t({collapsed:e}){return(0,d5t.jsx)(e?Fo:Ra,{sx:w4n})}var f5t=S(E(),1),p5t=ot((0,f5t.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined");var tE=S(E(),1),C4n={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:600,lineHeight:"16px",letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},k4n={fontSize:14,color:"text.disabled",flexShrink:0};function h5t({label:e,pinned:t}){return(0,tE.jsxs)(tE.Fragment,{children:[(0,tE.jsx)(Se,{variant:"body1",title:e,sx:C4n,children:e}),t&&(0,tE.jsx)(pr,{title:"Collapsed by you. Stays collapsed until you open it.",children:(0,tE.jsx)(p5t,{"data-testid":"group-pinned","aria-label":"Collapsed by you",sx:k4n})})]})}var w8e={toggle:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.75,justifyContent:"flex-start",textAlign:"left",borderRadius:.5,"&:focus-visible":{outline:1,outlineColor:"primary.main"}},count:{color:"text.disabled",fontVariantNumeric:"tabular-nums",fontFamily:"fontFamilyMono",fontSize:11,lineHeight:1}};var UO=S(E(),1);function m5t({label:e,count:t,collapsedSummary:r,collapsed:n,pinned:o,onToggle:i}){return(0,UO.jsxs)(Zt,{"aria-expanded":!n,onClick:i,sx:w8e.toggle,children:[(0,UO.jsx)(u5t,{collapsed:n}),(0,UO.jsx)(h5t,{label:e,pinned:o}),n?r:(0,UO.jsx)(Se,{variant:"caption",sx:w8e.count,children:t})]})}var VO=S(E(),1),_4n={display:"flex",alignItems:"center",gap:.75,p:"8px 12px 4px",bgcolor:"background.paper",position:"sticky",top:0,zIndex:1,[`&:hover .${S8e}`]:{opacity:1}};function g5t({label:e,sessions:t,collapsed:r,pinned:n,onToggle:o,onDismiss:i}){return(0,VO.jsxs)(H,{sx:_4n,children:[(0,VO.jsx)(m5t,{label:e,count:t.length,collapsedSummary:(0,VO.jsx)(s5t,{sessions:t}),collapsed:r,pinned:n,onToggle:o}),(0,VO.jsx)(t5t,{label:e,sessionIds:t.map(a=>a.id),onDismiss:i})]})}var Wpe=S(oe(),1),C8e=(0,Wpe.createContext)(!1);function y5t(){return(0,Wpe.useContext)(C8e)}var qZ=S(E(),1),E4n={mb:.5};function v5t({groupKey:e,label:t,sessions:r,onDismiss:n,children:o}){let{isCollapsed:i,setCollapsed:a}=$O(),s=i(e);return(0,qZ.jsxs)(H,{sx:E4n,children:[(0,qZ.jsx)(g5t,{label:t,sessions:r,collapsed:s,pinned:s,onToggle:()=>a(e,!s),onDismiss:n}),!s&&(0,qZ.jsx)(C8e.Provider,{value:!0,children:o})]})}function Gpe(e,t,r){if(t.length===0)return;let n=()=>{for(let o of t)r(o.id)};return{childCount:t.length,onDismissAll:()=>{r(e.id),n()},onDismissChildren:n}}function qpe(e,t){return e.sdk?!1:!t.has(e.id)&&e.status!=="done"&&e.status!=="error"&&e.status!=="stopped"}function rE(e){let t=e.claudeSessionId??e.harnessSessionId;if(t)return e.harness?{conversationId:t,harness:e.harness}:{conversationId:t}}var lT="branch";function b5t(e,t){return[{value:"all",label:"All changes"},{value:"uncommitted",label:"Uncommitted"},...t?[{value:lT,label:"Branch",note:`vs ${t}`}]:[],...e.map(r=>({value:r.sha,label:r.title||r.sha.slice(0,7)}))]}function x5t(e,t){return e.find(r=>r.value===t)??{value:"all",label:"All changes"}}var jpe=S(oe(),1);var nE=S(oe(),1);function S5t(e,t,r){let n=e[t];return n&&n.cwd===r.cwd&&n.scope===r.scope?k8e(e,t):{...e,[t]:{...r,mode:n?.mode??"half"}}}function k8e(e,t){let{[t]:r,...n}=e;return r?n:e}function T5t(e,t){let r=new Set(t),n=Object.entries(e).filter(([o])=>r.has(o));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function w5t(e,t,r){let n=e[t];return n?{...e,[t]:{...n,scope:r}}:e}function C5t(e,t){let r=e[t];if(!r)return e;let n=r.mode==="half"?"full":"half";return{...e,[t]:{...r,mode:n}}}function k5t(e,t){let[r,n]=(0,nE.useState)({}),o=e.join(" ");(0,nE.useEffect)(()=>{let a=o===""?[]:o.split(" ");n(s=>T5t(s,a))},[o]);let i=(0,nE.useCallback)((a,s)=>{t(a),n(l=>S5t(l,a,s))},[t]);return(0,nE.useMemo)(()=>({panelFor:a=>a===null?void 0:r[a],togglePanel:i,closePanel:a=>n(s=>k8e(s,a)),setPanelScope:(a,s)=>n(l=>w5t(l,a,s)),togglePanelMode:a=>n(s=>C5t(s,a))}),[r,i])}var R5t=S(E(),1),_5t=(0,jpe.createContext)(null);function E5t({sessionIds:e,onActivateSession:t,children:r}){let n=k5t(e,t);return(0,R5t.jsx)(_5t.Provider,{value:n,children:r})}function K1(){let e=(0,jpe.useContext)(_5t);if(!e)throw new Error("useDiffPanels must be used within a DiffPanelsProvider");return e}function Ype(e,t,r){let{togglePanel:n}=K1(),o=hr();return i=>n(e,{cwd:t,conversation:r,scope:i,node:o})}var A5t=S(E(),1);function P5t({panelSessionId:e,cwd:t,conversation:r,defaultBranch:n}){let o=Ype(e,t,r),i=`Diff against ${n}`;return(0,A5t.jsxs)(Xr,{component:"button",type:"button",title:i,"aria-label":i,onClick:()=>o(lT),variant:"caption",underline:"hover",color:"inherit",sx:{border:0,p:0,bgcolor:"transparent",cursor:"pointer",fontFamily:"fontFamilyMono",whiteSpace:"nowrap",color:"text.disabled","&:hover":{color:"text.primary"}},children:["vs ",n]})}function WO(){return/Mac|iPhone|iPad/.test(globalThis.navigator?.platform??"")}var R4n={Ctrl:"\u2303",Alt:"\u2325",Shift:"\u21E7",Mod:"\u2318",Meta:"\u2318"},P4n={Mod:"Ctrl"};function L5t(e,t=WO()){let r=t?R4n:P4n;return e.map(n=>r[n]??n)}function Kpe(e,t=WO()){return L5t(e,t).join(t?"":"+")}var I5t=S(E(),1),A4n={px:.5,border:1,borderColor:"grey.500",borderRadius:.5,fontFamily:"fontFamilyMono",fontSize:11,whiteSpace:"nowrap"};function Xpe({chords:e}){return e.map(t=>{let r=Kpe(t);return(0,I5t.jsx)(H,{component:"kbd",sx:A4n,children:r},r)})}var jZ=S(E(),1);function Gd({label:e,chords:t}){return(0,jZ.jsxs)(St,{direction:"row",spacing:.75,sx:{alignItems:"center"},children:[(0,jZ.jsx)("span",{children:e}),(0,jZ.jsx)(Xpe,{chords:t})]})}var L4n={"/":"Slash",".":"Period",",":"Comma",";":"Semicolon","'":"Quote","[":"BracketLeft","]":"BracketRight","\\":"Backslash","-":"Minus","=":"Equal","`":"Backquote"},I4n=["Enter","Space","Escape","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function D5t(e){if(/^[a-z]$/i.test(e)){let n=e.toUpperCase();return{code:`Key${n}`,label:n}}if(/^\d$/.test(e))return{code:`Digit${e}`,label:e};let t=L4n[e];if(t)return{code:t,label:e};if(/^F([1-9]|1[0-2])$/i.test(e)){let n=e.toUpperCase();return{code:n,label:n}}let r=I4n.find(n=>n.toLowerCase()===e.toLowerCase());return r?{code:r,label:r}:void 0}var D4n={mod:"Mod",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",meta:"Meta",cmd:"Meta",command:"Meta",win:"Meta"},M4n=["Mod","Ctrl","Alt","Shift","Meta"];function M5t(e,t){let r=new Set;for(let n of e){let o=D4n[n.toLowerCase()];if(!o)return{ok:!1,error:`"${n}" is not a modifier in "${t}"`};if(r.has(o))return{ok:!1,error:`"${n}" is repeated in "${t}"`};r.add(o)}return[...r].some(n=>n!=="Shift")?r.has("Mod")&&(r.has("Ctrl")||r.has("Meta"))?{ok:!1,error:`"${t}" combines Mod with Ctrl or Meta, which Mod already means`}:{ok:!0,modifiers:M4n.filter(n=>r.has(n))}:{ok:!1,error:`"${t}" needs at least one of Mod, Ctrl, Alt or Meta`}}function N5t(e,{modifiersOnly:t=!1}={}){let r=e.split("+").map(s=>s.trim()),n=t?void 0:r.pop(),o=M5t(r,e);if(!o.ok)return o;let{modifiers:i}=o;if(n===void 0)return{ok:!0,chord:{modifiers:i}};let a=D5t(n);return a?{ok:!0,chord:{modifiers:i,key:a}}:{ok:!1,error:`"${n}" is not a key in "${e}"`}}function Zpe({modifiers:e,key:t},r,n=WO()){if(r.type!=="keydown"||t&&r.code!==t.code)return!1;let o=e.includes("Mod");return r.ctrlKey===(e.includes("Ctrl")||o&&!n)&&r.metaKey===(e.includes("Meta")||o&&n)&&r.altKey===e.includes("Alt")&&r.shiftKey===e.includes("Shift")}var N4n=/^Digit([1-6])$/;function YZ(e,t){if(!t.some(n=>Zpe(n,e)))return;let r=N4n.exec(e.code);return r?Number(r[1])-1:void 0}var GO={navTab:{label:"Switch top-level tab",group:"Navigate"},focusSidebar:{label:"Focus sidebar (backlog: last-selected session card)",group:"Navigate"},focusTerminal:{label:"Focus terminal (backlog: search / back)",group:"Navigate"},toggleDiff:{label:"Open / close diff panel, or focus preview pane",group:"Navigate"},focusRepoPicker:{label:"Focus repo picker",group:"Navigate"},openUpdates:{label:"Open nodes",group:"Navigate"},openConfig:{label:"Open config",group:"Navigate"},openMenu:{label:"Open menu",group:"Navigate"},cycleCards:{label:"Next / previous sidebar card",group:"Navigate"},nextWaiting:{label:"Next waiting session",group:"Sessions"},focusAddAgent:{label:"Focus add agent",group:"Sessions"},focusVsCode:{label:"Focus VS Code",group:"Sessions"},focusDone:{label:"Focus done",group:"Sessions"},newSession:{label:"New session",group:"Sessions"},quickOpen:{label:"Quick open file",group:"Files"},save:{label:"Save file",group:"Files"},shortcutsSheet:{label:"Keyboard shortcuts",group:"Help"}};var O4n="1\u20136",O5t=new WeakMap;function oE(e,t){let r=O5t.get(t);r||(r=new Map,O5t.set(t,r));let n=r.get(e);return n||(n=B4n(e,t),r.set(e,n)),n}function B4n(e,t){let{label:r,group:n}=GO[e];if(e==="cycleCards")return{label:r,group:n,chords:[["Tab"],["Shift","Tab"]],bound:[],matches:Lpe};let o=e==="navTab",i=t[e].flatMap(a=>{let s=N5t(a,{modifiersOnly:o});return s.ok?[s.chord]:[]});return{label:r,group:n,chords:i.map(a=>$4n(a)),bound:i,matches:o?a=>YZ(a,i)!==void 0:a=>i.some(s=>Zpe(s,a))}}function $4n({modifiers:e,key:t}){return[...e,t?.label??O4n]}var F5t=S(oe(),1);var B5t={navTab:["Alt"],focusSidebar:["Alt+A"],focusTerminal:["Alt+S"],toggleDiff:["Alt+D"],focusRepoPicker:["Alt+R"],openUpdates:["Alt+Q"],openConfig:["Alt+W"],openMenu:["Alt+E"],focusAddAgent:["Alt+Z"],focusVsCode:["Alt+X"],focusDone:["Alt+C"],nextWaiting:["Mod+."],newSession:["Mod+N","Alt+N"],quickOpen:["Mod+P"],save:["Mod+S"],shortcutsSheet:["Mod+/"]};var $5t=B5t,_8e=new Set,UA={get:()=>$5t,set(e){$5t=e;for(let t of _8e)t()},subscribe(e){return _8e.add(e),()=>_8e.delete(e)}};function qO(){return(0,F5t.useSyncExternalStore)(UA.subscribe,UA.get)}function vo(e){return oE(e,qO())}var E8e=S(E(),1);function z5t({show:e,children:t}){let{label:r,chords:n}=vo("toggleDiff");return(0,E8e.jsx)(pr,{describeChild:!0,title:e?(0,E8e.jsx)(Gd,{label:r,chords:n}):"",children:t})}function H5t(e){return t=>({px:1,py:"3px",border:1,borderRadius:`${t.tokens.radius.sm}px`,borderColor:e?Ur(t.palette.primary.main,.55):"divider",bgcolor:e?t.tokens.color.selected:"background.default",fontSize:11,textDecoration:"none",transition:"border-color .2s ease, background-color .2s ease","&:hover":{textDecoration:"none",borderColor:e?Ur(t.palette.primary.main,.55):t.palette.text.disabled}})}function U5t(e,t,r){let n=K1().panelFor(e);if(!r)return;let o=n!==void 0&&(t==="uncommitted"?n.scope===t:n.scope!=="uncommitted");return{pressed:o,sx:H5t(o)}}var W5t=S(E(),1);function V5t({groups:e}){return e.map(t=>(0,W5t.jsxs)(H,{component:"span",sx:{color:t.color},children:[t.prefix,t.count]},t.key))}var VA=S(E(),1),F4n={display:"flex",alignItems:"center",gap:.75,fontFamily:"fontFamilyMono",whiteSpace:"nowrap",border:0,p:0,bgcolor:"transparent",cursor:"pointer"};function R8e({panelSessionId:e,cwd:t,conversation:r,scope:n,groups:o,bracketed:i,toggleChordHint:a=!1,countButton:s=!1}){let l=Ype(e,t,r),u=U5t(e,n,s);return(0,VA.jsx)(z5t,{show:a,children:(0,VA.jsxs)(Xr,{component:"button",type:"button",onClick:()=>l(n),variant:"caption",underline:u?"none":"hover",color:"inherit","aria-pressed":u?.pressed,sx:[F4n,u?.sx??{}],children:[i&&(0,VA.jsx)(H,{component:"span",children:"("}),(0,VA.jsx)(V5t,{groups:o}),i&&(0,VA.jsx)(H,{component:"span",children:")"})]})})}var jO=S(E(),1),z4n={display:"flex",alignItems:"center",gap:.75,minWidth:0},G5t=[{key:"new",prefix:"+",color:"success.main"},{key:"modified",prefix:"~",color:"warning.main"},{key:"deleted",prefix:"-",color:"error.main"}];function q5t({panelSessionId:e,cwd:t,conversation:r,groups:n,uncommitted:o,toggleChordHint:i,countButton:a}){return(0,jO.jsx)(sa,{children:(0,jO.jsxs)(H,{sx:z4n,"data-testid":"git-status-counts",children:[n.length>0&&(0,jO.jsx)(R8e,{panelSessionId:e,cwd:t,conversation:r,scope:"all",groups:n,toggleChordHint:i,countButton:a}),o&&o.length>0&&(0,jO.jsx)(R8e,{panelSessionId:e,cwd:t,conversation:r,scope:"uncommitted",groups:o,bracketed:!0,countButton:a})]})})}function j5t(e){return G5t.map(t=>({...t,count:e[t.key]?.length??0})).filter(t=>t.count>0)}function Y5t(e){if(!e)return null;let t=j5t(e),r=e.hasCommits&&e.uncommitted?j5t(e.uncommitted):void 0;return t.length>0||(r?.length??0)>0?{kind:"counts",groups:t,uncommitted:r}:e.defaultBranch&&e.onDefaultBranch===!1?{kind:"branch",defaultBranch:e.defaultBranch}:null}var iE=S(oe(),1);function YO(e,t,r){let n=new URLSearchParams({cwd:e});return t&&(n.set("session",t.conversationId),t.harness&&n.set("harness",t.harness)),r&&r!=="all"&&n.set("scope",r),n.toString()}var H4n=new Set([502,504]);function K5t(){let e=!1;return{shouldRecord:t=>H4n.has(t)?e?!0:(e=!0,!1):(e=!1,!0),reset:()=>{e=!1}}}function X5t(e){let t=2**Math.max(0,e-1);return Math.min(5e3*t,6e4)}function Qpe(e){let t=new AbortController,r=!1,n=0,o,i=async()=>{if(r||t.signal.aborted)return;r=!0,clearTimeout(o);let a=await e(t.signal);r=!1,!t.signal.aborted&&(n=a?.failed?n+1:0,o=setTimeout(i,X5t(n)))};return i(),{poll:i,stop:()=>{t.abort(),clearTimeout(o)}}}async function Z5t(e,t,r){try{let n=await Wt(e,{blipGate:t,signal:r});return n.ok?await n.json().then(o=>({counts:o??null}),()=>{}):{counts:null,failed:!0}}catch(n){return r?.aborted?void 0:(wr(n,"git status counts"),{counts:null,failed:!0})}}function Q5t(e,t){let r=K5t();return Qpe(async n=>{let o=await Z5t(e,r,n);return o&&t(o.counts),o&&{failed:!!o.failed}})}function Jpe(e,t,r=!0){let[n,o]=(0,iE.useState)(null),i=(0,iE.useRef)(()=>{}),a=hr(),s=YO(e,t);return(0,iE.useEffect)(()=>{if(i.current=()=>{},!e||!r){o(null);return}let l=Q5t(Vr(`/api/git-status?${s}`,a),o);return i.current=l.poll,l.stop},[e,s,a,r]),{counts:n,refresh:(0,iE.useCallback)(()=>i.current(),[])}}function J5t(e,t){return Jpe(e,t).counts}var P8e=S(E(),1);function ehe({panelSessionId:e,cwd:t,conversation:r,offerBranchDiff:n=!1,toggleChordHint:o=!1,countButton:i=!1}){let a=Y5t(J5t(t,r));return a?a.kind==="branch"?n?(0,P8e.jsx)(P5t,{panelSessionId:e,cwd:t,conversation:r,defaultBranch:a.defaultBranch}):null:(0,P8e.jsx)(q5t,{panelSessionId:e,cwd:t,conversation:r,groups:a.groups,uncommitted:a.uncommitted,toggleChordHint:o,countButton:i}):null}var aE=S(E(),1);function eRt({restored:e,usedPct:t,harness:r,undurable:n}){return(0,aE.jsxs)(aE.Fragment,{children:[n&&(0,aE.jsx)(Se,{variant:"caption",sx:{color:"warning.main"},children:n.reason}),e!==void 0&&(0,aE.jsx)(Se,{variant:"caption",sx:{color:e?"success.main":"warning.main"},children:e?"restored":"not restored"}),t!==void 0&&(0,aE.jsxs)(Se,{variant:"caption",sx:{color:Vpe(t,r),opacity:.6,fontSize:"0.8rem"},children:[Math.round(t),"%"]})]})}var KZ=S(E(),1),U4n={gridColumn:3,gridRow:2,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.75,minWidth:0};function tRt({session:e}){return(0,KZ.jsxs)(H,{sx:U4n,children:[(0,KZ.jsx)(eRt,{usedPct:e.usedPct,harness:e.harness,undurable:e.undurable}),e.cwd&&(0,KZ.jsx)(ehe,{panelSessionId:e.id,cwd:e.cwd,conversation:rE(e)})]})}function the(e,t){if(t)return!0;let r=e.commandType==="assist"&&e.activity===void 0,n=e.status==="done"||e.status==="error";return r&&!n}var A8e=S(E(),1),V4n=Vo("neutral");function rRt({clone:e}){return(0,A8e.jsx)(pr,{title:`Clone \u2014 ${e}`,children:(0,A8e.jsx)(H,{component:"span",sx:V4n,children:"clone"})})}var rhe=[Vo("primary"),e=>({bgcolor:e.palette.primary.main,borderColor:e.palette.primary.main,color:e.palette.primary.contrastText})];var L8e=S(E(),1),W4n=Vo("success");function nRt({session:e}){return b8e(e)?(0,L8e.jsx)(H,{component:"span",sx:W4n,children:e.port?(0,L8e.jsx)(Upe,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath}):"serving"}):null}var nhe=S(oe(),1),I8e=(0,nhe.createContext)(new Set);function oRt(){return(0,nhe.useContext)(I8e)}var Wg=S(E(),1),G4n=Vo("check");function q4n({label:e}){return(0,Wg.jsx)(H,{component:"span",sx:rhe,children:e})}function iRt({session:e}){let t=oRt().has(e.id),r=e.repoGroup?.clone,{activity:n}=e,o=n?.kind==="backlog"&&n.phase===n.totalPhases;return(0,Wg.jsxs)(Wg.Fragment,{children:[Xi(e)==="check"&&(0,Wg.jsx)(H,{component:"span",sx:G4n,children:"Check"}),(0,Wg.jsx)(nRt,{session:e}),(0,Wg.jsx)(mpe,{harness:e.harness}),t&&r&&(0,Wg.jsx)(rRt,{clone:r}),(0,Wg.jsx)(Spe,{node:e.node}),o&&(0,Wg.jsx)(q4n,{label:`${n.phase}/${n.totalPhases}`})]})}var gRt=S(oe(),1);function ohe(e){return e?.itemIds?.length?e.itemIds:e?.itemId==null?[]:[e.itemId]}var sRt=S(E(),1),j4n=Vo("primary");function aRt({itemId:e,session:t}){let r=hr();return(0,sRt.jsx)(Xr,{component:Sa,to:Vd(e,$l(t),r),underline:"hover",sx:j4n,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:pn(e)})}var D8e=S(E(),1),lRt=Vo("secondary");function cRt({prNumber:e,url:t}){let r=`#${e}`;return t?(0,D8e.jsx)(Xr,{href:t,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:lRt,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:r}):(0,D8e.jsx)(H,{component:"span",sx:lRt,children:r})}var dRt=S(E(),1),Y4n={color:"text.secondary",whiteSpace:"nowrap"};function uRt(e,t){let r=AO(t)?cs(e):"";if(r)return{key:"repo",node:(0,dRt.jsx)(H,{component:"span",sx:Y4n,children:r})}}function fRt(e,t){return!e?.jiraKey&&e?.githubIssue?.toLowerCase()===t.toLowerCase()}var hRt=S(E(),1);function pRt(e,t){if(!(!e||fRt(t,e)))return{key:"prompt-issue",node:(0,hRt.jsx)(X_,{githubIssue:e,variant:"token"})}}function sE(e){if(e.activity?.kind==="backlog")return"next";if(e.design)return"design";switch(e.commandType){case"assist":{let t=e.assistArgs?.[0];return t==="review-pr-comments"||t==="fix-conflict"?"review":t==="draft"||t==="bug"||t==="next"||t==="refine"||t==="review"||t==="update"?t:"prompt"}case"run":return"run";default:return e.promptType??"prompt"}}var ihe=S(E(),1);function mRt(e,t,r,n){let o=[],i=sE(e),a=t?void 0:uRt(e.cwd,i),{activity:s}=e;a&&o.push(a),s?.kind==="backlog"?s.phase!==s.totalPhases&&o.push({key:"phase",node:`${s.phase}/${s.totalPhases}`}):o.push({key:"type",node:i}),r.number!==void 0&&o.push({key:"pr",badge:!0,node:(0,ihe.jsx)(cRt,{prNumber:r.number,url:r.url})});for(let u of ohe(s))o.push({key:`item-${u}`,badge:!0,node:(0,ihe.jsx)(aRt,{itemId:u,session:e})});n&&o.push({key:"tracker",node:(0,ihe.jsx)(fpe,{tracker:n,variant:"token"})});let l=pRt(e.promptIssue,n);return l&&o.push(l),o}var K4n=["review","review-pr-comments","fix-conflict"];function X1(e){let t=e.assistArgs?.[0];if(!t||!K4n.includes(t))return;let r=e.assistArgs?.slice(1).map(o=>Number(o)).find(o=>Number.isInteger(o)&&o>0);if(r!==void 0)return r;let n=e.subtitle?.match(/^#(\d+)/);return n?Number(n[1]):void 0}var ahe=S(oe(),1);function KO(e,t,r){let[n,o]=(0,ahe.useState)(null),i=hr();return(0,ahe.useEffect)(()=>{if(!e){o(null);return}let a=!1,s=t!==void 0?`&number=${t}`:"";return Wt(Vr(`/api/pr-status?cwd=${encodeURIComponent(e)}${s}`,i)).then(l=>l.json()).then(l=>{a||o(typeof l?.pr?.number=="number"?l.pr:null)}).catch(l=>{wr(l,"PR status"),a||o(null)}),()=>{a=!0}},[e,i,t,r]),n}var WA=S(E(),1),X4n={opacity:.35,mx:.5};function yRt({session:e}){let t=y5t(),r=xpe(e.cwd),n=X1(e)??e.promptPr,o=KO(e.cwd,n,e.status),i=mRt(e,t,{number:n??o?.number,url:o?.url},r(e.activity?.itemId)),a=s=>s>0&&!i[s].badge&&!i[s-1].badge;return(0,WA.jsx)(WA.Fragment,{children:i.map((s,l)=>(0,WA.jsxs)(gRt.Fragment,{children:[a(l)&&(0,WA.jsx)(H,{component:"span",sx:X4n,children:"\xB7"}),s.node]},s.key))})}var GA=S(E(),1);function vRt({session:e}){return(0,GA.jsxs)(GA.Fragment,{children:[(0,GA.jsx)(yRt,{session:e}),(0,GA.jsx)(iRt,{session:e})]})}var M8e=S(E(),1),Z4n={color:"text.disabled",fontSize:"0.65rem",lineHeight:1.4};function bRt({toggles:e}){let t=e.flatMap(r=>r.caption??[]);return t.length===0?null:(0,M8e.jsx)(H,{sx:{display:"flex",gap:1,minWidth:0},children:t.map(r=>(0,M8e.jsx)(Se,{sx:Z4n,children:r},r))})}function XO({activity:e}){return e?.kind==="backlog"&&!!e.phase&&e.phase===e.totalPhases}function ZO(e){let t=[],r=sE(e);if(r==="draft"||r==="bug"||r==="refine"){let n=e.autoApprove??!1;t.push({key:"autoApprove",label:"Auto start",checked:n,...n?{caption:"will auto start"}:{}})}if(e.activity?.kind==="backlog"){let n=e.autoAdvance??!0;XO(e)||t.push({key:"autoAdvance",label:"Continue",checked:n,...n?{}:{caption:"won't continue"}})}return t}var XZ=S(E(),1),Q4n={gridColumn:2,gridRow:2,display:"flex",alignItems:"center",gap:.625,minWidth:0,overflow:"hidden",fontSize:"0.6875rem",lineHeight:"16px",color:"text.secondary"};function xRt({session:e}){return the(e,!1)?null:(0,XZ.jsxs)(H,{sx:Q4n,children:[(0,XZ.jsx)(vRt,{session:e}),(0,XZ.jsx)(bRt,{toggles:ZO(e)})]})}var qA=S(E(),1);function SRt({session:e,loading:t}){return t?null:(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(xRt,{session:e}),(0,qA.jsx)(tRt,{session:e})]})}var she="session-card-title";var lE="session-card-close";var TRt=S(E(),1),wRt=ot((0,TRt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever");var lhe=S(oe(),1),N8e=(0,lhe.createContext)({onStop:()=>{},onStart:()=>{},onDiscard:()=>{}});function QO(){return(0,lhe.useContext)(N8e)}var cT=S(E(),1);function CRt({id:e,reason:t,path:r,removesTree:n}){let{onDiscard:o}=QO(),{confirming:i,close:a,triggerHandlers:s,withHint:l}=ds(()=>o(e)),u=t?` (${t})`:"",d=r??"its working tree";return(0,cT.jsxs)(cT.Fragment,{children:[(0,cT.jsx)(Ht,{size:"small",...s,title:l(n?"Discard changes and remove worktree":"Drop this card and stop tracking its unlanded work"),sx:{color:"text.disabled","&:hover":{color:"error.main"}},children:(0,cT.jsx)(wRt,{sx:{fontSize:16}})}),i&&(0,cT.jsx)(sa,{children:(0,cT.jsx)($o,{title:n?"Discard all changes":"Stop tracking this work",message:n?`This permanently deletes the worktree ${d} and the work it holds${u}. This cannot be undone.`:`This drops the card and stops tracking the unlanded work in ${d}${u}. Nothing on disk is deleted.`,confirmLabel:n?"Discard changes":"Drop card",onConfirm:()=>{a(),o(e)},onCancel:a})})]})}var Z1=S(E(),1);function kRt({childCount:e,onDismissThis:t,onDismissAll:r,onCancel:n}){let o=e===1?"session":"sessions";return(0,Z1.jsxs)(_a,{open:!0,onClose:n,maxWidth:"xs",fullWidth:!0,children:[(0,Z1.jsx)(Dl,{children:"Close nested sessions?"}),(0,Z1.jsx)(Il,{children:(0,Z1.jsx)(l_,{children:`This session has ${e} nested ${o}. Close just this session, or close it along with its nested ${o}? Running sessions will be stopped.`})}),(0,Z1.jsxs)(Yc,{children:[(0,Z1.jsx)(it,{onClick:n,children:"Cancel"}),(0,Z1.jsx)(it,{onClick:t,children:"Close this only"}),(0,Z1.jsx)(it,{variant:"contained",color:"error",onClick:r,children:`Close all ${e+1}`})]})]})}var che=S(E(),1);function _Rt({onDismiss:e,childDismiss:t,onClose:r}){let n=o=>{r(),o()};return(0,che.jsx)(sa,{children:t?(0,che.jsx)(kRt,{childCount:t.childCount,onDismissThis:()=>n(e),onDismissAll:()=>n(t.onDismissAll),onCancel:r}):(0,che.jsx)($o,{title:"End session",message:"This will stop the running session and kill its process. Are you sure?",confirmLabel:"End session",onConfirm:()=>n(e),onCancel:r})})}var cE=S(E(),1);function uhe({id:e,status:t,onDismiss:r,childDismiss:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(n?.onDismissAll??r,{needsConfirm:t!=="done"||!!n});return(0,cE.jsxs)(cE.Fragment,{children:[(0,cE.jsx)(Ht,{size:"small",...a,title:s(`Dismiss session ${e}`),sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,cE.jsx)(Bo,{sx:{fontSize:16}})}),o&&(0,cE.jsx)(_Rt,{onDismiss:r,childDismiss:n,onClose:i})]})}var lo={supported:!0};function Pa(e,t,r){return r?{supported:!1,reason:e,remediation:t,followUp:r}:{supported:!1,reason:e,remediation:t}}var ERt={"skills.native":lo,"launch.terminal":lo,"conversation.resume":lo,"conversation.relocate":lo,"conversation.id":lo,"conversation.preassignId":lo,"systemPrompt.append":lo,"tasks.notifyOnExit":lo,"artifacts.publish":lo,"transcript.read":lo,"oneShot.text":lo,"oneShot.structured":lo,"usage.rateLimits":lo,"tools.restrict":lo,"connector.gmail.read":lo,"connector.slack.read":lo,"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":lo,"intercept.question":lo,"slashCommands.suggest":lo},RRt={claude:ERt,"claude-sdk":ERt,codex:{"skills.native":lo,"launch.terminal":lo,"conversation.resume":lo,"conversation.relocate":lo,"conversation.id":lo,"conversation.preassignId":Pa("Codex assigns its own conversation id when its rollout starts","assist binds the Codex conversation id from the rollout after launch"),"systemPrompt.append":Pa("Design launches on Codex have not passed manual testing: sessions arrived without the design prompt or stopped before designing anything","start design sessions with Claude","a1589"),"tasks.notifyOnExit":Pa("Codex runs a background command in an exec session that reports nothing back once the turn ends, so an agent that ends its turn never sees a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; Codex asks its questions in chat","a1573"),"artifacts.publish":Pa("Codex has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","design in Codex and deliver the HTML file, then review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":lo,"oneShot.text":lo,"oneShot.structured":lo,"usage.rateLimits":lo,"tools.restrict":Pa("assist cannot yet limit a headless Codex run to an allow-list of connector tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":Pa("Codex has no verified read-only Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":Pa("Codex has no verified read-only Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":Pa("assist's maintainability-override and comment guards run only in Claude's edit hook, so Codex patches are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":lo,"slashCommands.suggest":Pa("assist reads skills and commands only from Claude's home and project dirs","type the Codex skill name in full in the phone reply bar")},pi:{"skills.native":lo,"launch.terminal":lo,"conversation.resume":Pa("pi sessions cannot be resumed yet","restart starts a fresh pi conversation; pick Claude or Codex to keep the conversation across restarts","a696"),"conversation.relocate":Pa("pi sessions cannot be resumed, so a pi conversation cannot continue in a replacement worktree","start a fresh session in the replacement worktree; pick Claude or Codex to keep the conversation across worktree replacement","a696"),"conversation.id":Pa("assist records no conversation id for pi sessions","comment from the session's own diff panel; a standalone /diff link cannot find a pi session","a696"),"conversation.preassignId":Pa("pi does not accept a caller-assigned conversation id","the session card tracks pi without a conversation id"),"systemPrompt.append":Pa("assist has not verified a pi flag that appends a system prompt at launch and on resume","start design sessions with Claude or Codex, or run /design inside a pi session to read the design prompt from disk","a696"),"tasks.notifyOnExit":Pa("assist has not verified a pi tool that wakes the agent when a background command exits, so an agent that ends its turn would never see a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"artifacts.publish":Pa("pi has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","deliver the HTML file and review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":Pa("assist cannot read pi conversation transcripts yet","pi session cards show no message previews or transcript-derived status and title; pick Claude or Codex for those","a696"),"oneShot.text":Pa("assist has no headless pi one-shot yet","the derived fallback is used instead (slug from the description, no generated title); set harness.engine to claude or codex for generated suggestions","a696"),"oneShot.structured":Pa("assist has no headless streaming pi run yet","pick Claude or Codex for review synthesis (review.synthesisHarness); pi cannot be a reviewer","a696"),"usage.rateLimits":Pa("pi reports no account rate-limit windows to assist","pi sessions show no usage windows; Claude and Codex usage is still tracked under their own accounts","a696"),"tools.restrict":Pa("assist cannot limit a headless pi run to an allow-list of tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":Pa("pi has no Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":Pa("pi has no Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":Pa("assist's maintainability-override and comment guards run only in Claude's edit hook, so pi edits and writes are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":lo,"slashCommands.suggest":Pa("assist reads skills and commands only from Claude's home and project dirs","type the pi prompt name in full in the phone reply bar")}};function PRt(e,t){let r=e[t];return typeof r=="function"?r():r}function dhe(e,t){return PRt(RRt[Wd(e)],t)}function fhe(e){return dhe(e,"conversation.resume").supported}var ARt=S(E(),1),Gs=ot((0,ARt.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var phe=S(oe(),1);var uE=S(E(),1);function LRt({id:e,onStartOver:t,anchor:r,onClose:n}){let o=ds(()=>{n(),t()});return(0,uE.jsxs)(uE.Fragment,{children:[(0,uE.jsx)(ci,{anchorEl:r,open:r!==null,onClose:n,onClick:i=>i.stopPropagation(),children:(0,uE.jsx)(Br,{title:o.withHint("Start over"),...o.triggerHandlers,onClick:i=>{n(),o.triggerHandlers.onClick(i)},children:"Start over"})}),o.confirming&&(0,uE.jsx)($o,{title:`Start over session ${e}`,message:"Start over? The conversation history is discarded. This stops the running process and starts a new conversation with only the initial prompt, or opens idle if there was none.",confirmLabel:"Start over",onConfirm:()=>{o.close(),t()},onCancel:o.close})]})}var uT=S(E(),1);function IRt({id:e,onStartOver:t,children:r}){let n=(0,phe.useRef)(null),[o,i]=(0,phe.useState)(null);return(0,uT.jsxs)(uT.Fragment,{children:[(0,uT.jsxs)(I1,{ref:n,variant:"outlined",color:"inherit",size:"small","aria-label":"Restart session",sx:{color:"text.secondary",flexShrink:0,"& .MuiButtonGroup-grouped":{borderColor:"divider"},"& .MuiButtonGroup-lastButton":{minWidth:0,px:.25}},children:[r,(0,uT.jsx)(it,{"aria-label":"Restart options","aria-haspopup":"menu","aria-expanded":o!==null,onClick:a=>{a.stopPropagation(),i(n.current)},children:(0,uT.jsx)(Gs,{sx:{fontSize:16}})})]}),(0,uT.jsx)(LRt,{id:e,onStartOver:t,anchor:o,onClose:()=>i(null)})]})}var DRt=S(E(),1),dT=ot((0,DRt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var hhe=S(oe(),1),O8e=(0,hhe.createContext)(!1);function mhe(){return(0,hhe.useContext)(O8e)}var ghe=S(E(),1);function MRt({title:e,onClick:t,onKeyDown:r}){let n=mhe();return(0,ghe.jsx)(it,{size:"small","aria-label":"Restart",title:e,onClick:t,onKeyDown:r,startIcon:n?(0,ghe.jsx)(dT,{sx:{fontSize:14}}):void 0,sx:{textTransform:"none",minWidth:0,px:1,whiteSpace:"nowrap"},children:n?"Restart":(0,ghe.jsx)(dT,{sx:{fontSize:14}})})}var dE=S(E(),1);function J4n(e){return fhe(e)?"resumes the conversation":"relaunches it from the start"}function yhe({id:e,onRestart:t,onStartOver:r,harness:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(t),l=(0,dE.jsx)(MRt,{title:s(`Restart session ${e}`),...a});return(0,dE.jsxs)(dE.Fragment,{children:[r?(0,dE.jsx)(IRt,{id:e,onStartOver:r,children:l}):l,o&&(0,dE.jsx)($o,{title:`Restart session ${e}`,message:`Restart this ${_i(n)} session? It ${J4n(n)}, stopping the running process first.`,confirmLabel:"Restart",onConfirm:()=>{i(),t()},onCancel:i})]})}var Q1=S(E(),1);function NRt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){let{status:i,id:a,harness:s}=e;return e.closing?null:i!=="stopped"?(0,Q1.jsx)("span",{className:lE,children:(0,Q1.jsx)(uhe,{id:a,status:i,onDismiss:n,childDismiss:o})}):(0,Q1.jsxs)(Q1.Fragment,{children:[e.undurable&&(0,Q1.jsx)("span",{className:lE,children:(0,Q1.jsx)(CRt,{id:a,reason:e.undurable.reason,path:e.cwd,removesTree:e.undurable.removesTree})}),t&&(0,Q1.jsx)(yhe,{id:a,onRestart:t,onStartOver:r,harness:s})]})}var B8e=S(E(),1);function ORt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){return(0,B8e.jsx)(sa,{children:(0,B8e.jsx)(NRt,{session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o})})}var $8e=S(E(),1),e5n={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25};function BRt({session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a}){return(0,$8e.jsx)(H,{sx:e5n,children:(0,$8e.jsx)(ORt,{session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a})})}function vhe(e){return e.verifying===!0&&Xi(e)==="running"}var JO=S(E(),1),t5n=Si`
|
|
3816
|
+
Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let d=ki(),f;if(t){let y=typeof t=="string"?Hg(t):t;qn(l==="/"||y.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${y.pathname}" was given in the \`location\` prop.`),f=y}else f=d;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=r&&r.state.matches.length?r.state.matches.map(y=>Object.assign(y,{route:r.manifest[y.route.id]||y.route})):P7e(e,{pathname:h});xO&&(ls(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ls(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let g=h_n(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:zg([l,n.encodeLocation?n.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:zg([l,n.encodeLocation?n.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),o,r);return t&&g?Fr.createElement(kO.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function u_n(){let e=iEt(),t=wO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},a=null;return xO&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=Fr.createElement(Fr.Fragment,null,Fr.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),Fr.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Fr.createElement("code",{style:i},"ErrorBoundary")," or"," ",Fr.createElement("code",{style:i},"errorElement")," prop on your route."))),Fr.createElement(Fr.Fragment,null,Fr.createElement("h2",null,"Unexpected Application Error!"),Fr.createElement("h3",{style:{fontStyle:"italic"}},t),r?Fr.createElement("pre",{style:o},r):null,a)}var d_n=Fr.createElement(u_n,null),rEt=class extends Fr.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=s_n(e.digest);r&&(e=r)}let t=e!==void 0?Fr.createElement(nm.Provider,{value:this.props.routeContext},Fr.createElement(B7e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?Fr.createElement(f_n,{error:e},t):t}};rEt.contextType=j_t;var x7e=new WeakMap;function f_n({children:e,error:t}){let{basename:r,navigator:n}=Fr.useContext(Ud);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=a_n(t.digest);if(o){let i=x7e.get(t);if(i)throw i;let a=L_t(o.location,r),s=a.absoluteURL||a.to;if(vO(o.location,s,I7e(n),"allow-explicit"),k7e(s))throw new Error("Invalid redirect location");if(A_t&&!x7e.get(t))if(a.isExternal||o.reloadDocument)window.location.href=s;else{let l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw x7e.set(t,l),l}return Fr.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function p_n({routeContext:e,match:t,children:r}){let n=Fr.useContext(j_);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),Fr.createElement(nm.Provider,{value:e},r)}function h_n(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n?.errors;if(i!=null){let d=o.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);qn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let a=!1,s=-1;if(r&&n){a=n.renderFallback;for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=d),f.route.id){let{loaderData:p,errors:h}=n,m=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!h||h[f.route.id]===void 0);if(f.route.lazy||m){r.isStatic&&(a=!0),s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}}let l=r?.onError,u=n&&l?(d,f)=>{l(d,{location:n.location,params:n.matches?.[0]?.params??{},pattern:MZ(n.matches),errorInfo:f})}:void 0;return o.reduceRight((d,f,p)=>{let h,m=!1,g=null,y=null;n&&(h=i&&f.route.id?i[f.route.id]:void 0,g=f.route.errorElement||d_n,a&&(s<0&&p===0?(aEt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):s===p&&(m=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=g:m?x=y:f.route.Component?x=Fr.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,Fr.createElement(p_n,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?Fr.createElement(rEt,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):b()},null)}function F7e(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nEt(e){let t=Fr.useContext(j_);return qn(t,F7e(e)),t}function rpe(e){let t=Fr.useContext(NA);return qn(t,F7e(e)),t}function m_n(e){let t=Fr.useContext(nm);return qn(t,F7e(e)),t}function z7e(e){let t=m_n(e),r=t.matches[t.matches.length-1];return qn(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function g_n(){return z7e("useRouteId")}function oEt(){let e=rpe("useNavigation");return Fr.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function H7e(){let{matches:e,loaderData:t}=rpe("useMatches");return Fr.useMemo(()=>e.map(r=>T_t(r,t)),[e,t])}function iEt(){let e=Fr.useContext(B7e),t=rpe("useRouteError"),r=z7e("useRouteError");return e!==void 0?e:t.errors?.[r]}var y_n=0;function U7e(e){let{router:t,basename:r}=nEt("useBlocker"),n=rpe("useBlocker"),[o,i]=Fr.useState(""),a=Fr.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:l,nextLocation:u,historyAction:d}=s;return e({currentLocation:{...l,pathname:Pf(l.pathname,r)||l.pathname},nextLocation:{...u,pathname:Pf(u.pathname,r)||u.pathname},historyAction:d})},[r,e]);return Fr.useEffect(()=>{let s=String(++y_n);return i(s),()=>t.deleteBlocker(s)},[t]),Fr.useEffect(()=>{o!==""&&t.getBlocker(o,a)},[t,o,a]),o&&n.blockers.has(o)?n.blockers.get(o):DA}function v_n(){let{router:e}=nEt("useNavigate"),t=z7e("useNavigate"),r=Fr.useRef(!1);return Q_t(()=>{r.current=!0}),Fr.useCallback(async(o,i={})=>{ls(r.current,Z_t),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var u_t={};function aEt(e,t,r){!t&&!u_t[e]&&(u_t[e]=!0,ls(!1,r))}var d_t={};function f_t(e,t){!e&&!d_t[t]&&(d_t[t]=!0,console.warn(t))}var b_n="useOptimistic",p_t=dn[b_n],x_n=()=>{};function S_n(e){return p_t?p_t(e):[e,x_n]}function sEt(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(xO&&e.element&&ls(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:dn.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(xO&&e.hydrateFallbackElement&&ls(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:dn.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(xO&&e.errorElement&&ls(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:dn.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var lEt=["HydrateFallback","hydrateFallbackElement"];var T_n=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function V7e({router:e,flushSync:t,onError:r,useTransitions:n}){n=Y_t()||n;let[i,a]=dn.useState(e.state),[s,l]=S_n(i),[u,d]=dn.useState(),[f,p]=dn.useState({isTransitioning:!1}),[h,m]=dn.useState(),[g,y]=dn.useState(),[v,b]=dn.useState(),x=dn.useRef(new Map),w=dn.useCallback((R,{deletedFetchers:D,newErrors:N,flushSync:$,viewTransitionOpts:P})=>{N&&r&&Object.values(N).forEach(L=>r(L,{location:R.location,params:R.matches[0]?.params??{},pattern:MZ(R.matches)})),R.fetchers.forEach((L,I)=>{L.data!==void 0&&x.current.set(I,L.data)}),D.forEach(L=>x.current.delete(L)),f_t($===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(f_t(P==null||A,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!A){t&&$?t(()=>a(R)):n===!1?a(R):dn.startTransition(()=>{n===!0&&l(L=>h_t(L,R)),a(R)});return}if(t&&$){t(()=>{g&&(h?.resolve(),g.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>a(R))});L.finished.finally(()=>{t(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})})}),t(()=>y(L));return}g?(h?.resolve(),g.skipTransition(),b({state:R,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(d(R),p({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,h,n,l,r]);dn.useLayoutEffect(()=>e.subscribe(w),[e,w]),dn.useEffect(()=>{f.isTransitioning&&!f.flushSync&&m(new T_n)},[f]),dn.useEffect(()=>{if(h&&u&&e.window){let R=u,D=h.promise,N=e.window.document.startViewTransition(async()=>{n===!1?a(R):dn.startTransition(()=>{n===!0&&l($=>h_t($,R)),a(R)}),await D});N.finished.finally(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})}),y(N)}},[u,h,e.window,n,l]),dn.useEffect(()=>{h&&u&&s.location.key===u.location.key&&h.resolve()},[h,g,s.location,u]),dn.useEffect(()=>{!f.isTransitioning&&v&&(d(v.state),p({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[f.isTransitioning,v]);let C=dn.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:R=>e.navigate(R),push:(R,D,N)=>e.navigate(R,{state:D,preventScrollReset:N?.preventScrollReset}),replace:(R,D,N)=>e.navigate(R,{replace:!0,state:D,preventScrollReset:N?.preventScrollReset})}),[e]),k=e.basename||"/",_=dn.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:r}),[e,C,k,r]);return dn.createElement(dn.Fragment,null,dn.createElement(j_.Provider,{value:_},dn.createElement(NA.Provider,{value:s},dn.createElement(O7e.Provider,{value:x.current},dn.createElement(tpe.Provider,{value:f},dn.createElement(G7e,{basename:k,location:s.location,navigationType:s.historyAction,navigator:C,useTransitions:n},dn.createElement(w_n,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function h_t(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var w_n=dn.memo(C_n);function C_n({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:i}){return tEt(e,void 0,{manifest:t,state:n,isStatic:o,onError:i,future:r})}function OA({to:e,replace:t,state:r,relative:n}){qn(Y_(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:i}=dn.useContext(Ud);ls(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=dn.useContext(nm),{pathname:s}=ki(),l=sn(),u=DZ(e,epe(a),s,n==="path");vO(typeof e=="string"?e:Hd(e),i.createHref(u),I7e(i),"reject");let d=JSON.stringify(u);return dn.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:n})},[l,d,n,t,r]),null}function W7e(e){return J_t(e.context)}function Oo(e){qn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function G7e({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1,useTransitions:a}){qn(!Y_(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=dn.useMemo(()=>({basename:s,navigator:o,static:i,useTransitions:a,future:{}}),[s,o,i,a]);typeof r=="string"&&(r=Hg(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default",mask:m}=r,g=dn.useMemo(()=>{let y=Pf(u,s);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:h,mask:m},navigationType:n}},[s,u,d,f,p,h,n,m]);return ls(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:dn.createElement(Ud.Provider,{value:l},dn.createElement(kO.Provider,{children:t,value:g}))}function tT({children:e,location:t}){return eEt(Xfe(e),t)}function Xfe(e,t=[]){let r=[];return dn.Children.forEach(e,(n,o)=>{if(!dn.isValidElement(n))return;let i=[...t,o];if(n.type===dn.Fragment){r.push.apply(r,Xfe(n.props.children,i));return}qn(n.type===Oo,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qn(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=Xfe(n.props.children,i)),r.push(a)}),r}var Yfe="get",Kfe="application/x-www-form-urlencoded";function npe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function k_n(e){return npe(e)&&e.tagName.toLowerCase()==="button"}function __n(e){return npe(e)&&e.tagName.toLowerCase()==="form"}function E_n(e){return npe(e)&&e.tagName.toLowerCase()==="input"}function R_n(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function P_n(e,t){return e.button===0&&(!t||t==="_self")&&!R_n(e)}function Zfe(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function A_n(e,t){let r=Zfe(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}var Vfe=null;function L_n(){if(Vfe===null)try{new FormData(document.createElement("form"),0),Vfe=!1}catch{Vfe=!0}return Vfe}var I_n=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function S7e(e){return e!=null&&!I_n.has(e)?(ls(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kfe}"`),null):e}function D_n(e,t){let r,n,o,i,a;if(__n(e)){let s=e.getAttribute("action");n=s?Pf(s,t):null,r=e.getAttribute("method")||Yfe,o=S7e(e.getAttribute("enctype"))||Kfe,i=new FormData(e)}else if(k_n(e)||E_n(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?Pf(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Yfe,o=S7e(e.getAttribute("formenctype"))||S7e(s.getAttribute("enctype"))||Kfe,i=new FormData(s,e),!L_n()){let{name:u,type:d,value:f}=e;if(d==="image"){let p=u?`${u}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else u&&i.append(u,f)}}else{if(npe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Yfe,n=null,o=Kfe,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:i,body:a}}var G7i=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var M_n={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},N_n=/[&><\u2028\u2029]/g;function m_t(e){return e.replace(N_n,t=>M_n[t])}function j7e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cEt(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&Pf(o.pathname,t)==="/"?o.pathname=`${TO(t)}/_root.${n}`:o.pathname=`${TO(o.pathname)}.${n}`,o}async function O_n(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&aEn.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function B_n(e){return e!=null&&typeof e.page=="string"}function $_n(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function F_n(e,t,r){let n=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await O_n(i,r);return a.links?a.links():[]}return[]}));return V_n(n.flat(1).filter($_n).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function g_t(e,t,r,n,o,i){let a=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return i==="assets"?t.filter((l,u)=>a(l,u)||s(l,u)):i==="data"?t.filter((l,u)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(a(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function z_n(e,t,{includeHydrateFallback:r}={}){return H_n(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function H_n(e){return[...new Set(e)]}function U_n(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function V_n(e,t){let r=new Set,n=new Set(t);return e.reduce((o,i)=>{if(t&&!B_n(i)&&i.as==="script"&&i.href&&n.has(i.href))return o;let s=JSON.stringify(U_n(i));return r.has(s)||(r.add(s),o.push({key:s,link:i})),o},[])}function Y7e(){let e=No.useContext(j_);return j7e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function j_n(){let e=No.useContext(NA);return j7e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var NZ=No.createContext(void 0);NZ.displayName="FrameworkContext";function ope(){let e=No.useContext(NZ);return j7e(e,"You must render this element inside a <HydratedRouter> element"),e}function Y_n(e,t){let r=No.useContext(NZ),[n,o]=No.useState(!1),[i,a]=No.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=No.useRef(null);No.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let g=v=>{v.forEach(b=>{a(b.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return p.current&&y.observe(p.current),()=>{y.disconnect()}}},[e]),No.useEffect(()=>{if(n){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[n]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return r?e!=="intent"?[i,p,{}]:[i,p,{onFocus:EZ(s,h),onBlur:EZ(l,m),onMouseEnter:EZ(u,h),onMouseLeave:EZ(d,m),onTouchStart:EZ(f,h)}]:[!1,p,{}]}function EZ(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function dEt({page:e,...t}){let r=Y_t(),{nonce:n}=ope(),{router:o}=Y7e(),i=No.useMemo(()=>P7e(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?(t.nonce==null&&n&&(t={...t,nonce:n}),r?No.createElement(X_n,{page:e,matches:i,...t}):No.createElement(Z_n,{page:e,matches:i,...t})):null}function K_n(e){let{manifest:t,routeModules:r}=ope(),[n,o]=No.useState([]);return No.useEffect(()=>{let i=!1;return F_n(e,t,r).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,r]),n}function X_n({page:e,matches:t,...r}){let n=ki(),{future:o}=ope(),{basename:i}=Y7e(),a=No.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=cEt(e,i,o.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,u=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?l=!0:u.push(d.route.id);return l&&u.length>0&&s.searchParams.set("_routes",u.join(",")),[s.pathname+s.search]},[i,o.v8_trailingSlashAwareDataRequests,e,n,t]);return No.createElement(No.Fragment,null,a.map(s=>No.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function Z_n({page:e,matches:t,...r}){let n=ki(),{future:o,manifest:i,routeModules:a}=ope(),{basename:s}=Y7e(),{loaderData:l,matches:u}=j_n(),d=No.useMemo(()=>g_t(e,t,u,i,n,"data"),[e,t,u,i,n]),f=No.useMemo(()=>g_t(e,t,u,i,n,"assets"),[e,t,u,i,n]),p=No.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,y=!1;if(t.forEach(b=>{let x=i.routes[b.route.id];!x||!x.hasLoader||(!d.some(w=>w.route.id===b.route.id)&&b.route.id in l&&a[b.route.id]?.shouldRevalidate||x.hasClientLoader?y=!0:g.add(b.route.id))}),g.size===0)return[];let v=cEt(e,s,o.v8_trailingSlashAwareDataRequests,"data");return y&&g.size>0&&v.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[s,o.v8_trailingSlashAwareDataRequests,l,n,i,d,t,e,a]),h=No.useMemo(()=>z_n(f,i),[f,i]),m=K_n(f);return No.createElement(No.Fragment,null,p.map(g=>No.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),h.map(g=>No.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),m.map(({key:g,link:y})=>No.createElement("link",{key:g,nonce:r.nonce,...y,crossOrigin:y.crossOrigin??r.crossOrigin})))}function Q_n(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var J_n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{J_n&&(window.__reactRouterVersion="7.18.5")}catch{}function K7e(e,t){return $_t({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:x_t({window:t?.window}),hydrationData:t?.hydrationData||eEn(),routes:e,mapRouteProperties:sEt,hydrationRouteProperties:lEt,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function eEn(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:tEn(e.errors)}),e}function tEn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new CO(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&vkn.includes(o.__subType)){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}function fEt({basename:e,children:t,history:r,useTransitions:n}){let[o,i]=fn.useState({action:r.action,location:r.location}),a=fn.useCallback(s=>{n===!1?i(s):fn.startTransition(()=>i(s))},[n]);return fn.useLayoutEffect(()=>r.listen(a),[r,a]),fn.createElement(G7e,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}fEt.displayName="unstable_HistoryRouter";var Sa=fn.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:i,replace:a,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:h,...m},g){let{basename:y,navigator:v,useTransitions:b}=fn.useContext(Ud),x=typeof d=="string"&&Qfe.test(d),w=L_t(d,y);d=w.to;let C=X_t(d,{relative:o}),k=ki(),_=null;if(s){let I=DZ(s,[],k.mask?k.mask.pathname:"/",!0);y!=="/"&&(I.pathname=I.pathname==="/"?y:zg([y,I.pathname])),_=v.createHref(I)}let[R,D,N]=Y_n(n,m),$=yEt(d,{replace:a,mask:s,state:l,target:u,preventScrollReset:f,relative:o,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b});function P(I){t&&t(I),I.defaultPrevented||$(I)}let A=!(w.isExternal||i),L=fn.createElement("a",{...m,...N,href:(A?_:void 0)||w.absoluteURL||C,onClick:A?P:t,ref:Q_n(g,D),target:u,"data-discover":!x&&r==="render"?"true":void 0});return R&&!x?fn.createElement(fn.Fragment,null,L,fn.createElement(dEt,{page:C})):L});Sa.displayName="Link";var pEt=fn.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...u},d){let f=_O(a,{relative:u.relative}),p=ki(),h=fn.useContext(NA),{navigator:m,basename:g}=fn.useContext(Ud),y=h!=null&&SEt(f)&&s===!0,v=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=p.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(b=b.toLowerCase(),x=x?x.toLowerCase():null,v=v.toLowerCase()),x&&g&&(x=Pf(x,g)||x);let w=v!=="/"&&v.endsWith("/")?v.length-1:v.length,C=b===v||!o&&b.startsWith(v)&&b.charAt(w)==="/",k=x!=null&&(x===v||!o&&x.startsWith(v)&&x.charAt(v.length)==="/"),_={isActive:C,isPending:k,isTransitioning:y},R=C?t:void 0,D;typeof n=="function"?D=n(_):D=[n,C?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof i=="function"?i(_):i;return fn.createElement(Sa,{...u,"aria-current":R,className:D,ref:d,style:N,to:a,viewTransition:s},typeof l=="function"?l(_):l)});pEt.displayName="NavLink";var hEt=fn.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:a=Yfe,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},m)=>{let{useTransitions:g}=fn.useContext(Ud),y=vEt(),v=bEt(s,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&Qfe.test(s);return fn.createElement("form",{ref:m,method:b,action:v,onSubmit:n?l:C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,_=k?.getAttribute("formmethod")||a,R=()=>y(k||C.currentTarget,{fetcherKey:t,method:_,navigate:r,replace:o,state:i,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?fn.startTransition(()=>R()):R()},...h,"data-discover":!x&&e==="render"?"true":void 0})});hEt.displayName="Form";function mEt({getKey:e,storageKey:t,...r}){let n=fn.useContext(NZ),{basename:o}=fn.useContext(Ud),i=ki(),a=H7e();xEt({getKey:e,storageKey:t});let s=fn.useMemo(()=>{if(!n||!e)return null;let u=R7e(i,a,o,e);return u!==i.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,d)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),fn.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${m_t(JSON.stringify(t||E7e))}, ${m_t(JSON.stringify(s))})`}})}mEt.displayName="ScrollRestoration";function gEt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X7e(e){let t=fn.useContext(j_);return qn(t,gEt(e)),t}function rEn(e){let t=fn.useContext(NA);return qn(t,gEt(e)),t}function yEt(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=sn(),f=ki(),p=_O(e,{relative:a});return fn.useCallback(h=>{if(P_n(h,t)){h.preventDefault();let m=r!==void 0?r:Hd(f)===Hd(p),g=()=>d(e,{replace:m,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l});u?fn.startTransition(()=>g()):g()}},[f,d,p,r,n,o,t,e,i,a,s,l,u])}function Ga(e){ls(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=fn.useRef(Zfe(e)),r=fn.useRef(!1),n=ki(),o=fn.useMemo(()=>A_n(n.search,r.current?null:t.current),[n.search]),i=sn(),a=fn.useCallback((s,l)=>{let u=Zfe(typeof s=="function"?s(new URLSearchParams(o)):s);r.current=!0,i("?"+u,l)},[i,o]);return[o,a]}var nEn=0,oEn=()=>`__${String(++nEn)}__`;function vEt(){let{router:e}=X7e("useSubmit"),{basename:t}=fn.useContext(Ud),r=g_n(),n=e.fetch,o=e.navigate;return fn.useCallback(async(i,a={})=>{let{action:s,method:l,encType:u,formData:d,body:f}=D_n(i,t);if(a.navigate===!1){let p=a.fetcherKey||oEn();await n(p,r,a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await o(a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,o,t,r])}function bEt(e,{relative:t}={}){let{basename:r}=fn.useContext(Ud),n=fn.useContext(nm);qn(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={..._O(e||".",{relative:t})},a=ki();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(d=>d==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let d=s.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:zg([r,i.pathname])),Hd(i)}var E7e="react-router-scroll-positions",Wfe={};function R7e(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:Pf(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}function xEt({getKey:e,storageKey:t}={}){let{router:r}=X7e("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=rEn("useScrollRestoration"),{basename:i}=fn.useContext(Ud),a=ki(),s=H7e(),l=oEt();fn.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),iEn(fn.useCallback(()=>{if(l.state==="idle"){let u=R7e(a,s,i,e);Wfe[u]=window.scrollY}try{sessionStorage.setItem(t||E7e,JSON.stringify(Wfe))}catch(u){ls(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,i,a,s,t])),typeof document<"u"&&(fn.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||E7e);u&&(Wfe=JSON.parse(u))}catch{}},[t]),fn.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Wfe,()=>window.scrollY,e?(d,f)=>R7e(d,f,i,e):void 0);return()=>u&&u()},[r,i,e]),fn.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{ls(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[a,n,o]))}function iEn(e,t){let{capture:r}=t||{};fn.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function SEt(e,{relative:t}={}){let r=fn.useContext(tpe);qn(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=X7e("useViewTransitionState"),o=_O(e,{relative:t});if(!r.isTransitioning)return!1;let i=Pf(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=Pf(r.nextLocation.pathname,n)||r.nextLocation.pathname;return SO(o.pathname,a)!=null||SO(o.pathname,i)!=null}var Min=S(oe(),1);var ipe=S(oe(),1),Z7e=(0,ipe.createContext)({nodes:null,transfer:()=>{},cancel:()=>{}});function ape(){return(0,ipe.useContext)(Z7e)}var wEt=S(E(),1);function K_({inputRef:e,value:t,onChange:r,onKeyDown:n,placeholder:o,autoFocus:i}){return(0,wEt.jsx)(Yn,{autoFocus:i,inputRef:e,value:t,onChange:a=>r(a.target.value),onKeyDown:n,placeholder:o,size:"small",fullWidth:!0,slotProps:{input:{sx:{fontSize:12}}},sx:{p:.5}})}var rT=S(oe(),1),EEt=S(E(),1),CEt=(0,rT.createContext)({query:"",setQuery:()=>{},viewedTerm:"",setViewedTerm:()=>{}});function kEt({children:e}){let[t,r]=(0,rT.useState)(""),[n,o]=(0,rT.useState)(""),i=(0,rT.useMemo)(()=>({query:t,setQuery:r,viewedTerm:n,setViewedTerm:o}),[t,n]);return(0,EEt.jsx)(CEt.Provider,{value:i,children:e})}function OZ(){return(0,rT.useContext)(CEt)}function _Et(){let{query:e,viewedTerm:t}=OZ();return e.trim()?t:""}var REt=S(E(),1),G0=ot((0,REt.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");function spe(e){return{display:"block",width:"100%",textAlign:"left",p:"5px 10px",borderRadius:0,bgcolor:e?"action.selected":"background.default",borderLeft:2,borderLeftColor:e?"primary.main":"transparent",cursor:e?"default":"pointer",transition:"background 0.15s","&:hover":e?void 0:{bgcolor:"action.hover"}}}var cOi=S(oe(),1);var PEt=S(E(),1),lpe=ot((0,PEt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");var sEn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function cpe(e){let t=sEn.exec(e);if(!t)return;let[,r,n,o]=t;return`https://github.com/${r}/${n}/issues/${o}`}var lEn=/^[^/\s]+\/[^/\s]+#(\d+)$/;function AEt(e){let t=lEn.exec(e);return t?`#${t[1]}`:e}var cEn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function LEt(e,t){let r=cEn.exec(e);if(!r||!t)return e;let[,n,o,i]=r;return`github.com/${n}/${o}`.toLowerCase()===t.toLowerCase()?`#${i}`:e}var Q7e=S(E(),1),IEt={height:18,fontSize:"0.65rem"};function DEt({label:e,url:t,title:r}){return t?(0,Q7e.jsx)(xn,{label:e,title:r,size:"small",sx:IEt,clickable:!0,component:"a",href:t,target:"_blank",rel:"noopener",onClick:n=>n.stopPropagation()}):(0,Q7e.jsx)(xn,{label:e,title:r,size:"small",sx:IEt,clickable:!1,onClick:n=>n.stopPropagation()})}var EO=S(E(),1),MEt={display:"inline-flex",alignItems:"center",gap:.375,whiteSpace:"nowrap","& svg":{fontSize:14}};function NEt({icon:e,label:t,title:r,url:n}){return n?(0,EO.jsx)(pr,{title:r,children:(0,EO.jsxs)(Xr,{href:n,target:"_blank",rel:"noopener",underline:"hover",sx:MEt,children:[e,t]})}):(0,EO.jsx)(pr,{title:r,children:(0,EO.jsxs)(H,{component:"span",sx:{...MEt,color:"text.disabled"},children:[e,t]})})}var BEt=S(E(),1),uEn={color:"primary.main",opacity:.85,whiteSpace:"nowrap"};function OEt({label:e,url:t,title:r}){return t?(0,BEt.jsx)(Xr,{href:t,title:r,target:"_blank",rel:"noopener",underline:"hover",sx:uEn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:e}):e}var RO=S(E(),1),$Et={fontSize:"0.875rem"};function upe({label:e,url:t,variant:r="link",icon:n,title:o}){return r==="chip"?(0,RO.jsx)(DEt,{label:e,url:t,title:o}):r==="token"?(0,RO.jsx)(OEt,{label:e,url:t,title:o}):r==="icon"?(0,RO.jsx)(NEt,{icon:n,label:e,title:o??e,url:t}):t?(0,RO.jsx)(Xr,{href:t,target:"_blank",rel:"noopener",onClick:i=>i.stopPropagation(),sx:$Et,children:e}):(0,RO.jsx)(Se,{variant:"body2",color:"text.disabled",sx:$Et,children:e})}var J7e=S(E(),1);function X_({githubIssue:e,origin:t,variant:r="link"}){return e?(0,J7e.jsx)(upe,{label:r==="link"?LEt(e,t):AEt(e),title:e,url:cpe(e),icon:(0,J7e.jsx)(lpe,{}),variant:r}):null}var dpe=S(oe(),1);function FEt(){let[e,t]=(0,dpe.useState)(null);return(0,dpe.useEffect)(()=>{let r=!1;return(async()=>{try{let o=await(await fetch("/api/jira-site")).json();r||t(o?.site??null)}catch{r||t(null)}})(),()=>{r=!0}},[]),e}var zEt=S(E(),1);function PO({jiraKey:e,variant:t="link"}){let r=FEt();if(!e)return null;let n=r?`https://${r}/browse/${e}`:void 0;return(0,zEt.jsx)(upe,{label:e,url:n,variant:t})}var e8e=S(E(),1);function fpe({tracker:e,variant:t="link"}){return e?.jiraKey?(0,e8e.jsx)(PO,{jiraKey:e.jiraKey,variant:t}):e?.githubIssue?(0,e8e.jsx)(X_,{githubIssue:e.githubIssue,origin:e.origin,variant:t}):null}var t8e=class extends Error{constructor(){super(...arguments);yr(this,"name","InvalidItemIdError")}};function pn(e){return`a${e}`}var dEn=/^a?(\d+)$/;function Z_(e){let t=dEn.exec(e.trim());if(!t)throw new t8e(`Invalid backlog item id "${e}" (e.g. a574 or 574).`);return Number.parseInt(t[1],10)}function Vr(e,t){if(!t)return e;let r=e.includes("?")?"&":"?";return`${e}${r}node=${encodeURIComponent(t)}`}function gc(e,t,r){if(!t)return Vr(e,r);let n=e.includes("?")?"&":"?";return Vr(`${e}${n}cwd=${encodeURIComponent(t)}`,r)}function Vd(e,t,r){return gc(`/backlog/items/${pn(e)}`,t,t&&r)}function fEn(e,t){if(t==="neutral")return{color:e.palette.text.secondary,borderColor:e.palette.divider};let{main:r}=e.palette[t];return{color:r,borderColor:Ur(r,.35)}}function Vo(e){return t=>({display:"inline-block",fontFamily:t.typography.fontFamilyMono,fontSize:10,fontWeight:400,lineHeight:"16px",px:"5px",border:1,borderRadius:"4px",whiteSpace:"nowrap",opacity:1,...fEn(t,e)})}var ppe=S(oe(),1),yc=(0,ppe.createContext)(void 0);function hr(){return(0,ppe.useContext)(yc)}var UEt=S(E(),1),pEn=[Vo("primary"),{flexShrink:0,textDecoration:"none"}],HEt=e=>e.stopPropagation();function hpe({itemId:e,cwd:t}){let r=hr();return(0,UEt.jsx)(H,{component:Sa,to:Vd(e,t,r),onMouseDown:HEt,onClick:HEt,sx:pEn,children:pn(e)})}var hEn={claude:"Claude","claude-sdk":"Claude (SDK)",codex:"Codex",pi:"pi"},mEn={claude:"Claude Code","claude-sdk":"Claude Code",codex:"Codex",pi:"pi"},Ug="claude";function Wd(e){return e??Ug}function _i(e){return hEn[Wd(e)]}function VEt(e){return mEn[Wd(e)]}var WEt=S(E(),1),gEn=Vo("neutral");function mpe({harness:e}){return Wd(e)===Ug?null:(0,WEt.jsx)(H,{component:"span",sx:gEn,children:_i(e).toLowerCase()})}var yEn=["update"];function AO(e){return!e||!yEn.includes(e)}function cs(e){if(!e)return"";let t=e.split(/[/\\]/).filter(Boolean);return t[t.length-1]??""}function q0(e){return e.repoGroup?.origin||e.cwd||void 0}function $l(e){return e.repoGroup?.clone||e.cwd||void 0}function LO(e,t){if(!e)return e;for(let r of t){let n=r.repoGroup;if(n&&(n.clone===e||r.cwd===e))return n.origin}return e}var bpe=S(oe(),1);var GEt="";function r8e(e){GEt=e.replace(/\/+$/,"")}function nT(e){return`${GEt}${e}`}function qEt(e){let t=new URL(nT(e),location.href);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}var jEt=new WeakSet;function BA(e){typeof e=="object"&&e!==null&&jEt.add(e)}function BZ(e){return typeof e=="object"&&e!==null&&jEt.has(e)}var vEn="/api/client-errors",a8e=1e3,bEn=6e4,xEn=1e4,SEn=50,TEn=500,IO=[],n8e,o8e=!1,gpe=a8e;function i8e(e){n8e||o8e||(n8e=setTimeout(()=>{n8e=void 0,CEn()},e))}async function wEn(e){try{return(await fetch(nT(vEn),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({failures:e}),signal:AbortSignal.timeout(xEn)})).ok}catch{return!1}}async function CEn(){let e=IO.slice(0,SEn);if(e.length===0)return;o8e=!0;let t=await wEn(e);if(o8e=!1,t){IO=IO.slice(e.length),gpe=a8e,IO.length>0&&i8e(0);return}gpe=Math.min(gpe*2,bEn),i8e(gpe)}function YEt(e){IO=[...IO,e].slice(-TEn),i8e(a8e)}var kEn=100,l8e=[],s8e=new Set;function KEt(e){l8e=e;for(let t of s8e)t()}function DO(e){KEt([e,...l8e].slice(0,kEn)),YEt(e)}function c8e(){return l8e}function XEt(){KEt([])}function ZEt(e){return s8e.add(e),()=>{s8e.delete(e)}}function _En(e){return new URL(e,"http://local").searchParams.get("node")??void 0}function QEt(e,t,r){let n=Date.now();return o=>{r&&DO({at:new Date(n).toISOString(),method:(t??"GET").toUpperCase(),path:e,base:nT("")||location.origin,node:_En(e),durationMs:Date.now()-n,...o})}}var EEn="x-assist-trace-id";async function REn(e){try{let t=await e.clone().json();if(t&&typeof t=="object"&&"error"in t){let{error:r}=t;if(typeof r=="string"&&r)return r}}catch{}}async function ype(e){let t=await REn(e)??(e.statusText||void 0),r=e.headers?.get(EEn);return r?t?`${t} (trace=${r})`:`trace=${r}`:t}function JEt(e,t){let r=new AbortController,n=()=>r.abort(e?.reason);e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(new DOMException(`timed out after ${t/1e3}s`,"TimeoutError")),t);return{signal:r.signal,clear:()=>{clearTimeout(o),e?.removeEventListener("abort",n)}}}var PEn=3e4;function AEn(e){return e instanceof DOMException&&e.name==="TimeoutError"}async function Wt(e,t={}){let{timeoutMs:r=PEn,capture:n=!0,blipGate:o,signal:i,...a}=t,{signal:s,clear:l}=JEt(i,r),u=QEt(e,a.method,n);try{let d=await fetch(nT(e),{...a,signal:s});return d.ok?o?.reset():(o?.shouldRecord(d.status)??!0)&&u({status:d.status,error:await ype(d)}),d}catch(d){let f=s.aborted?s.reason:d;throw(!s.aborted||AEn(f))&&(u({error:f instanceof Error?f.message:String(f)}),BA(f)),f}finally{l()}}var LEn={error:"ERROR",rejection:"REJECT",caught:"CAUGHT"};function $Z(e,t){DO({at:new Date().toISOString(),kind:e,method:LEn[e],path:location.pathname+location.search,base:location.origin,error:t,durationMs:0})}function wr(e,t){if(BZ(e))return;BA(e);let r=e instanceof Error?e.message:String(e);$Z("caught",`${t}: ${r}`)}var e4t=new Map;function vpe(e,t){let r=`${t??""}\0${e??""}`,n=e4t.get(r);return n||(n=(async()=>{let i=await(await Wt(gc("/api/items",e,t))).json(),a=new Map;for(let s of i)!s.jiraKey&&!s.githubIssue||a.set(s.id,{jiraKey:s.jiraKey,githubIssue:s.githubIssue,origin:s.origin});return a})().catch(o=>(wr(o,"item trackers"),new Map)),e4t.set(r,n)),n}function xpe(e){let[t,r]=(0,bpe.useState)(()=>new Map),n=hr();return(0,bpe.useEffect)(()=>{let o=!1;return vpe(e,n).then(i=>{o||r(i)}),()=>{o=!0}},[e,n]),o=>o==null?void 0:t.get(o)}var u8e=S(E(),1),IEn=Vo("neutral");function Spe({node:e}){return e?(0,u8e.jsx)(pr,{title:`Running on ${e}`,children:(0,u8e.jsx)(H,{component:"span",sx:IEn,children:e})}):null}var j0=S(E(),1),t4t={height:18,fontSize:"0.65rem"};function r4t({session:e}){let t=AO(e.sessionType)?cs(e.cwd):"",r=xpe(e.cwd);return(0,j0.jsxs)(j0.Fragment,{children:[t&&(0,j0.jsx)(xn,{label:t,size:"small",sx:t4t}),(0,j0.jsx)(mpe,{harness:e.harness}),(0,j0.jsx)(Spe,{node:e.node}),e.sessionType&&e.sessionType!=="next"&&(0,j0.jsx)(xn,{label:e.sessionType,size:"small",color:"primary",variant:"outlined",sx:t4t}),e.itemId!=null&&(0,j0.jsx)(hpe,{itemId:e.itemId,cwd:$l(e)}),(0,j0.jsx)(fpe,{variant:"chip",tracker:r(e.itemId)})]})}function so(e){let t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var n4t=S(E(),1);function sa({children:e}){let t=r=>r.stopPropagation();return(0,n4t.jsx)(H,{sx:{display:"contents"},onClick:t,onMouseDown:t,onTouchStart:t,children:e})}var MO=S(oe(),1),DEn=1200;function Q_(e){let[t,r]=(0,MO.useState)(!1),n=(0,MO.useRef)(void 0);return(0,MO.useEffect)(()=>()=>clearTimeout(n.current),[]),{copied:t,copy:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),clearTimeout(n.current),n.current=setTimeout(()=>r(!1),DEn)})}}}var FZ=S(E(),1);function o4t({sessionId:e,harness:t}){let{copied:r,copy:n}=Q_(e),o=i=>{i.stopPropagation(),n()};return(0,FZ.jsx)(sa,{children:(0,FZ.jsx)(pr,{title:r?"Copied!":`Copy ${_i(t)} session id`,open:r||void 0,children:(0,FZ.jsx)(Zt,{onClick:o,sx:{borderRadius:.5,px:.25},children:(0,FZ.jsx)(Se,{variant:"caption",color:"text.disabled",sx:{fontFamily:"fontFamilyMono"},children:e.slice(0,8)})})})})}var zZ=S(E(),1);function i4t({session:e}){return(0,zZ.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,alignSelf:"flex-end"},children:[e.sessionId&&(0,zZ.jsx)(o4t,{sessionId:e.sessionId,harness:e.harness}),(0,zZ.jsx)(Se,{variant:"caption",color:"text.disabled",children:so(e.lastActivity??e.timestamp)})]})}var a4t=S(E(),1);function Tpe({children:e}){return(0,a4t.jsx)(H,{component:"mark",sx:{bgcolor:"warning.main",color:"warning.contrastText",borderRadius:.5,px:.25},children:e})}var wpe=S(E(),1);function s4t({snippet:e}){return(0,wpe.jsxs)(Se,{variant:"caption",sx:{color:"text.secondary",overflowWrap:"anywhere"},children:[e.before,(0,wpe.jsx)(Tpe,{children:e.match}),e.after]})}function l4t(e){return e.prompt||e.name}var $A=S(E(),1);function c4t({session:e}){return(0,$A.jsxs)($A.Fragment,{children:[e.title&&(0,$A.jsx)(Se,{variant:"body2",sx:{color:"text.primary",fontWeight:500,overflowWrap:"anywhere"},children:e.title}),(0,$A.jsx)(Se,{variant:e.title?"caption":"body2",sx:{color:e.title?"text.secondary":"text.primary",overflowWrap:"anywhere"},children:l4t(e)})]})}var Af=S(E(),1);function MEn({onResume:e}){return(0,Af.jsx)(Ht,{size:"small",onClick:t=>{t.stopPropagation(),e()},title:"Resume",sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,Af.jsx)(G0,{sx:{fontSize:14}})})}function u4t({session:e,selected:t=!1,onView:r,onResume:n}){return(0,Af.jsx)(yc.Provider,{value:e.node,children:(0,Af.jsx)(Zt,{onClick:()=>r(e),sx:spe(t),"aria-current":t||void 0,children:(0,Af.jsxs)(H,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[(0,Af.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,Af.jsx)(r4t,{session:e}),(0,Af.jsx)(H,{sx:{flex:1}}),(0,Af.jsx)(sa,{children:(0,Af.jsx)(MEn,{onResume:()=>n(e)})})]}),(0,Af.jsx)(c4t,{session:e}),e.snippet&&(0,Af.jsx)(s4t,{snippet:e.snippet}),(0,Af.jsx)(i4t,{session:e})]})})})}var kpe=S(E(),1);function Cpe({sessions:e,viewingId:t,onView:r,onResume:n,empty:o}){return(0,kpe.jsxs)(H,{sx:{flex:1,overflow:"auto",p:1},children:[e.map(i=>(0,kpe.jsx)(u4t,{session:i,selected:i.sessionId===t,onView:r,onResume:n},i.sessionId)),e.length===0&&o]})}var d4t=S(E(),1);function NO({children:e,color:t="text.disabled"}){return(0,d4t.jsx)(Se,{variant:"caption",color:t,role:"status",sx:{display:"block",textAlign:"center",p:2},children:e})}var OO=S(E(),1);function f4t({search:e,viewingId:t,...r}){return e.status==="loading"?(0,OO.jsx)(NO,{children:"Searching\u2026"}):e.status==="error"?(0,OO.jsxs)(NO,{color:"error.main",children:["Search failed: ",e.message]}):(0,OO.jsx)(Cpe,{sessions:e.sessions,viewingId:t,empty:(0,OO.jsx)(NO,{children:"No sessions match"}),...r})}var _pe=S(oe(),1);async function p4t(e,t,r,n){let o=await Wt(Vr(`/api/history/search?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,r),{signal:n}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(i.error??`HTTP ${o.status}`);let a=Array.isArray(i.sessions)?i.sessions:[];return r?a.map(s=>({...s,node:r})):a}var NEn=300;function h4t(e,t,r){let n=r.trim(),[o,i]=(0,_pe.useState)({status:"idle"});return(0,_pe.useEffect)(()=>{if(!e||!n){i({status:"idle"});return}i({status:"loading"});let a=new AbortController,s=setTimeout(()=>{p4t(e,n,t,a.signal).then(l=>{a.signal.aborted||i({status:"done",sessions:l})},l=>{if(a.signal.aborted)return;let u=l instanceof Error?l.message:String(l);i({status:"error",message:u})})},NEn);return()=>{clearTimeout(s),a.abort()}},[e,t,n]),o}var Epe=S(oe(),1),HZ=(0,Epe.createContext)({repos:[],selectedCwd:"",worktreeCwd:"",setSelectedCwd:()=>{},cloneOn:e=>e,originOf:()=>{}});function Ln(){return(0,Epe.useContext)(HZ)}var FA=S(E(),1);function m4t({sessions:e,...t}){let{selectedCwd:r,selectedNode:n}=Ln(),{query:o,setQuery:i}=OZ(),a=h4t(r,n,o),s=LO(r,e),l=r?e.filter(u=>q0(u)===s||$l(u)===r):[];return(0,FA.jsxs)(H,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[r&&(0,FA.jsx)(K_,{value:o,onChange:i,placeholder:"Search history..."}),a.status==="idle"?(0,FA.jsx)(Cpe,{sessions:l,empty:(0,FA.jsx)(NO,{children:"No history for this repo"}),...t}):(0,FA.jsx)(f4t,{search:a,...t,onView:u=>t.onView(u,o.trim())})]})}var B4t=S(oe(),1);function g4t(e,t,r){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return n===-1?r===1?e[0]:e.at(-1):e[(n+r+e.length)%e.length]}var d8e=null;function Rpe(e){d8e=e,e.focus({preventScroll:!0})}function BO(){let e=globalThis.document;return e.querySelector('[role="dialog"][aria-modal="true"]')?!0:d8e!==null&&e.activeElement===d8e}function Ppe(e){let t=globalThis.document.querySelector(`[data-session-id="${e}"]`);t&&Rpe(t)}function Ape(e){globalThis.requestAnimationFrame(()=>{globalThis.document.querySelector(`[data-session-id="${e}"]`)?.scrollIntoView({block:"nearest"})})}function Lpe(e){return e.key==="Tab"&&!e.ctrlKey&&!e.altKey&&!e.metaKey}var zA=S(oe(),1);var y4t="assist:group-collapse",f8e=new Set;function p8e(){try{return localStorage.getItem(y4t)??""}catch{return""}}function h8e(e){if(!e)return{};try{let t=JSON.parse(e);return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r=="object"))}catch{return{}}}function v4t(e){try{localStorage.setItem(y4t,JSON.stringify(e))}catch{}for(let t of f8e)t()}function OEn(e,t){v4t({...h8e(p8e()),[e]:t})}function BEn(e){let t=h8e(p8e()),r=Object.fromEntries(Object.entries(t).filter(([n])=>!e.includes(n)));Object.keys(r).length!==Object.keys(t).length&&v4t(r)}function $En(e){return f8e.add(e),()=>{f8e.delete(e)}}var oT={getRaw:p8e,parse:h8e,setChoice:OEn,removeChoices:BEn,subscribe:$En};function $O(){let e=(0,zA.useSyncExternalStore)(oT.subscribe,oT.getRaw),t=(0,zA.useMemo)(()=>oT.parse(e),[e]),r=(0,zA.useCallback)(n=>{let o=t[n];return o!==void 0&&"collapsedAt"in o},[t]);return(0,zA.useMemo)(()=>({isCollapsed:r,setCollapsed:(n,o)=>oT.setChoice(n,o?{collapsedAt:Date.now()}:{openedAt:Date.now()})}),[r])}var iT=S(oe(),1);function FEn(e,t){let r=new URLSearchParams;e&&r.set("q",e),t&&t!=="todo"&&r.set("filter",t);let n=r.toString();return n?`/api/items?${n}`:"/api/items"}async function J_({query:e,cwd:t,node:r,signal:n,filter:o}={}){let i=await Wt(gc(FEn(e,o),t,r),{signal:n});if(!i.ok){let a=await i.json().catch(()=>null);throw new Error(a?.error??`HTTP ${i.status}`)}return i.json()}function UZ(e){let t=e.activity?.itemId;if(!(!e.cwd||e.activity?.kind!=="backlog"||t==null))return{cwd:e.cwd,itemId:t}}function VZ(e,t){return`${e}::${t}`}function b4t(e){let t=new Set;for(let r of e){let n=UZ(r);n&&t.add(n.cwd)}return[...t].sort()}async function zEn(e){try{return(await J_({cwd:e,filter:"all"})).filter(r=>r.starred).map(r=>VZ(e,r.id))}catch(t){return wr(t,"starred keys"),[]}}async function x4t(e){let t=await Promise.all(e.map(zEn));return new Set(t.flat())}var Mpe=S(oe(),1);var S4t="/api/backlog/docs-refresh";async function Ipe(e,t,r){let n=await Wt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`${t} ${e} failed: ${n.status}`);return n.json()}async function T4t(e,t,r){await Wt(gc(`/api/items/${pn(e)}`,t,r),{method:"DELETE"})}function FO(e,t,r,n){return Ipe(gc(`/api/items/${pn(e)}`,r,n),"PATCH",{status:t})}function Dpe(e,t,r,n){return Ipe(gc(`/api/items/${pn(e)}/star`,r,n),"POST",{starred:t})}function w4t(e,t,r,n,o){return Ipe(gc(`/api/items/${pn(e)}/rewind`,n,o),"POST",{phase:t,reason:r})}async function C4t(e,t,r){return(await Wt(gc(S4t,e,t),{signal:r})).json()}function k4t(e,t){return Ipe(gc(S4t,e,t),"POST",{})}function HEn(e,t,r){let n=new Set(e);return r?n.add(t):n.delete(t),n}function _4t(e,t){let r=UZ(t);return r?e.has(VZ(r.cwd,r.itemId)):t.starred??!1}function E4t(e,t,r){let n=UZ(r);if(!n){t(r.id,!(r.starred??!1));return}let o=VZ(n.cwd,n.itemId);e(i=>{let a=!i.has(o);return Dpe(n.itemId,a,n.cwd),HEn(i,o,a)})}function UEn(e,t){let r=!1,n=e?e.split("|"):[];return x4t(n).then(o=>{r||t(o)}),()=>{r=!0}}function R4t(e){let[t,r]=(0,Mpe.useState)(new Set);return(0,Mpe.useEffect)(()=>UEn(e,r),[e]),[t,r]}var A4t=S(E(),1),P4t=(0,iT.createContext)(null);function Npe({sessions:e,setSessionStarred:t,children:r}){let n=b4t(e).join("|"),[o,i]=R4t(n),a=(0,iT.useCallback)(u=>_4t(o,u),[o]),s=(0,iT.useCallback)(u=>E4t(i,t,u),[i,t]),l=(0,iT.useMemo)(()=>({isStarred:a,toggleStar:s}),[a,s]);return(0,A4t.jsx)(P4t.Provider,{value:l,children:r})}function Vg(){let e=(0,iT.useContext)(P4t);if(!e)throw new Error("useStarredSessions must be used within a StarredSessionsProvider");return e}function Ope(e){return e.flatMap(t=>t.kind==="single"?[t.session]:t.rows.flatMap(r=>[r.session,...r.children]))}var m8e="assist:group-order";var HA=null;function VEn(){if(HA)return HA;try{let e=JSON.parse(localStorage.getItem(m8e)??"[]");HA=Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{HA=[]}return HA}function WEn(e){HA=e;try{localStorage.setItem(m8e,JSON.stringify(e))}catch{}}function GEn(e,t){let r=e.length-200;return r<=0?e:e.filter(n=>t.has(n)||r--<=0)}function qEn(e){let t=VEn(),r=e.filter(o=>!t.includes(o)),n=r.length>0?GEn([...t,...r],new Set(e)):t;return n!==t&&WEn(n),new Map(n.map((o,i)=>[o,i]))}function jEn(){HA=null;try{localStorage.removeItem(m8e)}catch{}}var L4t={rank:qEn,clear:jEn};function I4t(e){let t=new Map;for(let n of e){let o=q0(n)??` nogroup:${n.id}`,i=t.get(o);if(i){i.members.push(n);continue}t.set(o,{key:o,label:cs($l(n)??o),members:[n]})}let r=L4t.rank([...t.keys()]);return[...t.values()].sort((n,o)=>(r.get(n.key)??0)-(r.get(o.key)??0))}function D4t(e){let t=new Map(e.map(o=>[g8e(o,o.id),o])),r=YEn(e),n=new Map;for(let o of e){let i=KEn(o,t)??ZEn(o,r);i&&n.set(o,i)}return n}function YEn(e){let t=new Map;for(let r of e){let n=N4t(r);!n||!M4t(r)||t.has(n)||t.set(n,r)}return t}function KEn(e,t){let r=e.launchedFrom?t.get(g8e(e,e.launchedFrom)):void 0;if(!(!r||r===e))return XEn(e,r)?r:void 0}function XEn(e,t){return e.cwd!==void 0&&e.cwd===t.cwd&&e.node===t.node}function ZEn(e,t){if(M4t(e))return;let r=N4t(e),n=r?t.get(r):void 0;return n===e?void 0:n}function M4t(e){return e.activity?.kind==="backlog"}function N4t(e){let{cwd:t,repoGroup:r}=e;if(!(!t||!r||r.clone===t))return g8e(e,t)}function g8e(e,t){return JSON.stringify([e.node??null,t])}function Bpe(e){let t=D4t(e),r=new Map;for(let i of e){let a=QEn(i,t);a&&r.set(i,a)}let n=new Map,o=[];for(let i of e){if(r.has(i))continue;let a={session:i,children:[]};n.set(i,a),o.push(a)}for(let i of e){let a=r.get(i);a&&n.get(a)?.children.push(i)}return o}function QEn(e,t){let r=new Set([e]),n=t.get(e);for(;n;){if(r.has(n))return;let o=t.get(n);if(!o)return n;r.add(n),n=o}}function y8e(e,t){return[...e.filter(r=>t(r)),...e.filter(r=>!t(r))]}function $pe(e,t,r=2){let n=I4t(e).map(({key:o,label:i,members:a})=>a.length<r?{kind:"single",session:a[0]}:{kind:"repo",key:o,label:i,rows:y8e(Bpe(a),s=>O4t(s).some(t))});return y8e(n,o=>JEn(o).some(t))}function O4t(e){return[e.session,...e.children]}function JEn(e){return e.kind==="repo"?e.rows.flatMap(O4t):[e.session]}var e4n=()=>!1;function Fpe(e,t,r=e4n,n=2){return Ope($pe(e,t,n).filter(o=>o.kind==="single"||!r(o.key)))}function $4t({sessions:e,onSelect:t}){let{isStarred:r}=Vg(),{isCollapsed:n}=$O();return(0,B4t.useCallback)(o=>{if(!Lpe(o.nativeEvent))return;let i=o.target.closest("[data-session-id]");if(!i)return;let a=Fpe(e,r,n,1).map(u=>u.id),s=i.getAttribute("data-session-id"),l=g4t(a,s,o.shiftKey?-1:1);!l||l===s||(o.preventDefault(),t(l),Ppe(l),Ape(l))},[e,r,n,t])}var v8e=S(E(),1),t4n={flex:1,overflow:"auto"},r4n={py:.5};function F4t({sessions:e,onSelect:t,children:r}){let n=$4t({sessions:e,onSelect:t});return(0,v8e.jsx)(H,{sx:t4n,onKeyDown:n,children:(0,v8e.jsx)(H,{sx:r4n,children:r})})}var H4t=S(E(),1),n4n={display:"block",textAlign:"center",p:2};function z4t(){return(0,H4t.jsx)(Se,{variant:"caption",color:"text.disabled",sx:n4n,children:"No sessions yet"})}var U4t=S(E(),1),Bo=ot((0,U4t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var V4t=S(E(),1),zO=ot((0,V4t.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded");var q1=S(E(),1),o4n={...spe(!1),cursor:"default",position:"relative"},i4n={position:"absolute",top:4,right:4,color:"text.disabled","&:hover":{color:"text.primary"}},a4n={display:"flex",alignItems:"center",gap:1,pr:3},s4n={color:"text.primary",overflowWrap:"anywhere"};function l4n(e){return{display:"block",mt:.5,color:e?"error.main":"text.secondary",overflowWrap:"anywhere"}}function c4n(e){return e.node?`Starting session on ${e.node}\u2026`:"Starting session\u2026"}function W4t({launch:e,onDismiss:t}){let r=e.status==="error";return(0,q1.jsxs)(H,{sx:o4n,children:[(0,q1.jsx)(Ht,{size:"small",onClick:()=>t(e.id),title:"Dismiss",sx:i4n,children:(0,q1.jsx)(Bo,{sx:{fontSize:16}})}),(0,q1.jsxs)(H,{sx:a4n,children:[r?(0,q1.jsx)(zO,{color:"error",sx:{fontSize:18}}):(0,q1.jsx)(oo,{size:16}),(0,q1.jsx)(Se,{variant:"body2",sx:s4n,children:e.title})]}),(0,q1.jsx)(Se,{variant:"caption",sx:l4n(r),children:r?e.error:c4n(e)})]})}function G4t(e){return new Set(e.filter(t=>t.cwd&&t.cwd===t.repoGroup?.clone).map(t=>t.id))}function b8e(e){return e.commandType==="run"&&e.server===!0&&e.status!=="done"&&e.status!=="error"}function q4t(e){return e.filter(b8e)}var j4t=S(E(),1),zpe=ot((0,j4t.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch");var Hpe=S(oe(),1),x8e=(0,Hpe.createContext)({nodes:null,names:[],visible:!1,selected:void 0,select:()=>{}});function us(){return(0,Hpe.useContext)(x8e)}function u4n(e){return e?e.startsWith("/")?e:`/${e}`:""}function Y4t(e,t,r,n="http",o){let i=t&&t!==r?.local?r?.links.find(s=>s.name===t):void 0,a=u4n(o);return i?{url:`${n}://${new URL(i.url).hostname}:${e}${a}`,remote:!0}:{url:`${n}://localhost:${e}${a}`,remote:!1}}var K4t=S(E(),1);function Upe({port:e,node:t,protocol:r,urlPath:n}){let{nodes:o}=us(),{url:i,remote:a}=Y4t(e,t,o,r,n);return(0,K4t.jsxs)(Xr,{href:i,title:a?`Opens ${i} on ${t}; the dev server must listen on the tailnet (e.g. --host 0.0.0.0)`:i,target:"_blank",rel:"noopener noreferrer",color:"inherit",onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[":",e]})}var j1=S(E(),1),d4n={display:"flex",alignItems:"center",gap:.5,px:"10px",py:.25,borderRadius:0,borderLeft:2,borderLeftColor:"success.main",bgcolor:"success.dark"},f4n={flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"success.contrastText"};function X4t({serving:e,onJump:t}){let r=cs(e.cwd),n=r?` \xB7 ${r} \xB7 ${e.name}`:` \xB7 ${e.name}`,o=`${e.port?`serving :${e.port}`:"serving"}${n}`;return(0,j1.jsxs)(H,{sx:d4n,children:[(0,j1.jsxs)(Se,{variant:"caption",title:o,sx:f4n,children:["serving",e.port?(0,j1.jsxs)(j1.Fragment,{children:[" ",(0,j1.jsx)(Upe,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath})]}):null,n]}),(0,j1.jsx)(it,{size:"small",startIcon:(0,j1.jsx)(zpe,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t()},sx:{color:"success.contrastText",minWidth:0},children:"Jump"})]})}var WZ=S(E(),1);function Z4t({sessions:e,onJump:t}){let r=q4t(e);return r.length===0?null:(0,WZ.jsx)(WZ.Fragment,{children:r.map(n=>(0,WZ.jsx)(X4t,{serving:n,onJump:()=>t(n.id)},n.id))})}function Q4t(e){return e.flatMap(t=>[t.session,...t.children])}var GZ=S(E(),1),p4n={position:"relative","&::before":{content:'""',position:"absolute",left:0,top:"-1px",width:"6px",height:"19.5px",borderLeft:1,borderBottom:1,borderColor:"divider"},"&:not(:last-of-type)::after":{content:'""',position:"absolute",left:0,top:0,bottom:"-1px",borderLeft:1,borderColor:"divider"}},h4n={ml:"13px"};function J4t({rows:e,renderCard:t}){let r=(n,o,i=!0)=>(0,GZ.jsx)(H,{sx:i?p4n:void 0,children:t(n,o)},n.id);return e.map(n=>n.children.length===0?r(n.session,void 0,!1):(0,GZ.jsxs)(H,{children:[r(n.session,n.children,!1),(0,GZ.jsx)(H,{sx:h4n,children:n.children.map(o=>r(o))})]},n.session.id))}var aT=S(E(),1);function $o({onConfirm:e,onCancel:t,title:r="Confirm deletion",message:n="Are you sure you want to delete this item?",confirmLabel:o="Delete",confirmColor:i="error",busy:a=!1,autoFocusConfirm:s=!1}){return(0,aT.jsxs)(_a,{open:!0,onClose:a?void 0:t,maxWidth:"xs",fullWidth:!0,children:[(0,aT.jsx)(Dl,{children:r}),(0,aT.jsx)(Il,{children:(0,aT.jsx)(l_,{children:n})}),(0,aT.jsxs)(Yc,{children:[(0,aT.jsx)(it,{onClick:t,disabled:a,children:"Cancel"}),(0,aT.jsx)(it,{variant:"contained",color:i,onClick:e,loading:a,autoFocus:s,children:o})]})]})}var e5t=S(oe(),1),m4n="(Shift skips confirmation)";function ds(e,{needsConfirm:t=!0,onOpen:r}={}){let[n,o]=(0,e5t.useState)(!1),i=r??(()=>o(!0));return{confirming:n,close:()=>o(!1),triggerHandlers:{onClick:a=>{a.stopPropagation(),a.shiftKey||!t?e():i()},onKeyDown:a=>{a.key!=="Enter"||!a.shiftKey||(a.preventDefault(),a.stopPropagation(),e())}},withHint:a=>`${a} ${m4n}`}}var sT=S(E(),1),S8e="group-close",g4n={p:"2px",my:"-2px",opacity:0,color:"text.disabled","&:hover":{color:"text.primary"},"&:focus-visible":{opacity:1}};function t5t({label:e,sessionIds:t,onDismiss:r}){let n=()=>{for(let d of t)r(d)},{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(n),l=t.length,u=l===1?"session":"sessions";return(0,sT.jsxs)(sT.Fragment,{children:[(0,sT.jsx)(Ht,{size:"small",className:S8e,...a,title:s(`Close all sessions in ${e}`),sx:g4n,children:(0,sT.jsx)(Bo,{sx:{fontSize:14}})}),o&&(0,sT.jsx)(sa,{children:(0,sT.jsx)($o,{title:`Close ${e}`,message:`This will close all ${l} ${u} in ${e}, including starred and nested sessions. Running sessions will be stopped.`,confirmLabel:`Close ${l}`,onConfirm:()=>{i(),n()},onCancel:i})})]})}var y4n=new Set(["question","backlog-item","github-issue","github-issue-edit","github-issue-comment","pr-comment","design"]);function Xi(e){let t=e.pendingPrPreview;return t&&t.kind!=="show"&&(e.status==="running"||e.status==="waiting")?y4n.has(t.kind)?"question":t.kind==="check"?"check":"waiting":e.status}var v4n=["check","waiting","running","done"];function b4n(e){return e==="question"?"waiting":e}function r5t(e){return v4n.map(t=>({status:t,count:e.filter(r=>b4n(Xi(r))===t).length})).filter(t=>t.count>0)}var x4n={claude:{red:30,yellow:20},"claude-sdk":{red:30,yellow:20},codex:{red:75,yellow:50},pi:{red:30,yellow:20}};function n5t(e,t){let{red:r,yellow:n}=x4n[Wd(t)];return e>=r?"red":e>=n?"yellow":"dim"}var Ku={running:"success.main",idle:"text.disabled",waiting:"warning.main",question:"warning.main",check:"warning.main",done:"info.main",error:"error.main",stopped:"text.secondary"};function Vpe(e,t){switch(n5t(e,t)){case"red":return"error.main";case"yellow":return"warning.main";default:return"text.disabled"}}var o5t={d:"M-1.62 -3.93A4.25 4.25 0 0 0 -1.62 3.93V6.93H1.62V3.93A4.25 4.25 0 0 0 1.62 -3.93V0.25H-1.62Z",transform:"translate(8 8) scale(1.46) translate(0.9 -0.9) rotate(45)"};var T8e=S(E(),1),S4n={fontSize:"inherit",verticalAlign:"-0.125em"};function i5t(){return(0,T8e.jsx)(E1,{viewBox:"0 0 16 16",sx:S4n,"data-testid":"wrench-head",children:(0,T8e.jsx)("path",{...o5t})})}var eE={running:"\u25CF",idle:"\u25CF",waiting:"\u25C6",question:"?",done:"\u2713",error:"\u2715",stopped:"\u25CB"};var a5t=S(E(),1);function Y1({status:e}){return e==="check"?(0,a5t.jsx)(i5t,{}):eE[e]}var HO=S(E(),1),T4n={display:"flex",gap:1,flexShrink:0,color:"text.secondary",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function s5t({sessions:e}){return(0,HO.jsx)(H,{sx:T4n,children:r5t(e).map(({status:t,count:r})=>(0,HO.jsxs)(Se,{variant:"caption","data-tally":t,children:[(0,HO.jsx)(H,{component:"span",sx:{color:Ku[t]},children:(0,HO.jsx)(Y1,{status:t})})," ",r," ",t]},t))})}var l5t=S(E(),1),Fo=ot((0,l5t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var c5t=S(E(),1),Ra=ot((0,c5t.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var d5t=S(E(),1),w4n={fontSize:12,color:"text.secondary",flexShrink:0};function u5t({collapsed:e}){return(0,d5t.jsx)(e?Fo:Ra,{sx:w4n})}var f5t=S(E(),1),p5t=ot((0,f5t.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined");var tE=S(E(),1),C4n={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:600,lineHeight:"16px",letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},k4n={fontSize:14,color:"text.disabled",flexShrink:0};function h5t({label:e,pinned:t}){return(0,tE.jsxs)(tE.Fragment,{children:[(0,tE.jsx)(Se,{variant:"body1",title:e,sx:C4n,children:e}),t&&(0,tE.jsx)(pr,{title:"Collapsed by you. Stays collapsed until you open it.",children:(0,tE.jsx)(p5t,{"data-testid":"group-pinned","aria-label":"Collapsed by you",sx:k4n})})]})}var w8e={toggle:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.75,justifyContent:"flex-start",textAlign:"left",borderRadius:.5,"&:focus-visible":{outline:1,outlineColor:"primary.main"}},count:{color:"text.disabled",fontVariantNumeric:"tabular-nums",fontFamily:"fontFamilyMono",fontSize:11,lineHeight:1}};var UO=S(E(),1);function m5t({label:e,count:t,collapsedSummary:r,collapsed:n,pinned:o,onToggle:i}){return(0,UO.jsxs)(Zt,{"aria-expanded":!n,onClick:i,sx:w8e.toggle,children:[(0,UO.jsx)(u5t,{collapsed:n}),(0,UO.jsx)(h5t,{label:e,pinned:o}),n?r:(0,UO.jsx)(Se,{variant:"caption",sx:w8e.count,children:t})]})}var VO=S(E(),1),_4n={display:"flex",alignItems:"center",gap:.75,p:"8px 12px 4px",bgcolor:"background.paper",position:"sticky",top:0,zIndex:1,[`&:hover .${S8e}`]:{opacity:1}};function g5t({label:e,sessions:t,collapsed:r,pinned:n,onToggle:o,onDismiss:i}){return(0,VO.jsxs)(H,{sx:_4n,children:[(0,VO.jsx)(m5t,{label:e,count:t.length,collapsedSummary:(0,VO.jsx)(s5t,{sessions:t}),collapsed:r,pinned:n,onToggle:o}),(0,VO.jsx)(t5t,{label:e,sessionIds:t.map(a=>a.id),onDismiss:i})]})}var Wpe=S(oe(),1),C8e=(0,Wpe.createContext)(!1);function y5t(){return(0,Wpe.useContext)(C8e)}var qZ=S(E(),1),E4n={mb:.5};function v5t({groupKey:e,label:t,sessions:r,onDismiss:n,children:o}){let{isCollapsed:i,setCollapsed:a}=$O(),s=i(e);return(0,qZ.jsxs)(H,{sx:E4n,children:[(0,qZ.jsx)(g5t,{label:t,sessions:r,collapsed:s,pinned:s,onToggle:()=>a(e,!s),onDismiss:n}),!s&&(0,qZ.jsx)(C8e.Provider,{value:!0,children:o})]})}function Gpe(e,t,r){if(t.length===0)return;let n=()=>{for(let o of t)r(o.id)};return{childCount:t.length,onDismissAll:()=>{r(e.id),n()},onDismissChildren:n}}function qpe(e,t){return e.sdk?!1:!t.has(e.id)&&e.status!=="done"&&e.status!=="error"&&e.status!=="stopped"}function rE(e){let t=e.claudeSessionId??e.harnessSessionId;if(t)return e.harness?{conversationId:t,harness:e.harness}:{conversationId:t}}var lT="branch";function b5t(e,t){return[{value:"all",label:"All changes"},{value:"uncommitted",label:"Uncommitted"},...t?[{value:lT,label:"Branch",note:`vs ${t}`}]:[],...e.map(r=>({value:r.sha,label:r.title||r.sha.slice(0,7)}))]}function x5t(e,t){return e.find(r=>r.value===t)??{value:"all",label:"All changes"}}var jpe=S(oe(),1);var nE=S(oe(),1);function S5t(e,t,r){let n=e[t];return n&&n.cwd===r.cwd&&n.scope===r.scope?k8e(e,t):{...e,[t]:{...r,mode:n?.mode??"half"}}}function k8e(e,t){let{[t]:r,...n}=e;return r?n:e}function T5t(e,t){let r=new Set(t),n=Object.entries(e).filter(([o])=>r.has(o));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function w5t(e,t,r){let n=e[t];return n?{...e,[t]:{...n,scope:r}}:e}function C5t(e,t){let r=e[t];if(!r)return e;let n=r.mode==="half"?"full":"half";return{...e,[t]:{...r,mode:n}}}function k5t(e,t){let[r,n]=(0,nE.useState)({}),o=e.join(" ");(0,nE.useEffect)(()=>{let a=o===""?[]:o.split(" ");n(s=>T5t(s,a))},[o]);let i=(0,nE.useCallback)((a,s)=>{t(a),n(l=>S5t(l,a,s))},[t]);return(0,nE.useMemo)(()=>({panelFor:a=>a===null?void 0:r[a],togglePanel:i,closePanel:a=>n(s=>k8e(s,a)),setPanelScope:(a,s)=>n(l=>w5t(l,a,s)),togglePanelMode:a=>n(s=>C5t(s,a))}),[r,i])}var R5t=S(E(),1),_5t=(0,jpe.createContext)(null);function E5t({sessionIds:e,onActivateSession:t,children:r}){let n=k5t(e,t);return(0,R5t.jsx)(_5t.Provider,{value:n,children:r})}function K1(){let e=(0,jpe.useContext)(_5t);if(!e)throw new Error("useDiffPanels must be used within a DiffPanelsProvider");return e}function Ype(e,t,r){let{togglePanel:n}=K1(),o=hr();return i=>n(e,{cwd:t,conversation:r,scope:i,node:o})}var A5t=S(E(),1);function P5t({panelSessionId:e,cwd:t,conversation:r,defaultBranch:n}){let o=Ype(e,t,r),i=`Diff against ${n}`;return(0,A5t.jsxs)(Xr,{component:"button",type:"button",title:i,"aria-label":i,onClick:()=>o(lT),variant:"caption",underline:"hover",color:"inherit",sx:{border:0,p:0,bgcolor:"transparent",cursor:"pointer",fontFamily:"fontFamilyMono",whiteSpace:"nowrap",color:"text.disabled","&:hover":{color:"text.primary"}},children:["vs ",n]})}function WO(){return/Mac|iPhone|iPad/.test(globalThis.navigator?.platform??"")}var R4n={Ctrl:"\u2303",Alt:"\u2325",Shift:"\u21E7",Mod:"\u2318",Meta:"\u2318"},P4n={Mod:"Ctrl"};function L5t(e,t=WO()){let r=t?R4n:P4n;return e.map(n=>r[n]??n)}function Kpe(e,t=WO()){return L5t(e,t).join(t?"":"+")}var I5t=S(E(),1),A4n={px:.5,border:1,borderColor:"grey.500",borderRadius:.5,fontFamily:"fontFamilyMono",fontSize:11,whiteSpace:"nowrap"};function Xpe({chords:e}){return e.map(t=>{let r=Kpe(t);return(0,I5t.jsx)(H,{component:"kbd",sx:A4n,children:r},r)})}var jZ=S(E(),1);function Gd({label:e,chords:t}){return(0,jZ.jsxs)(St,{direction:"row",spacing:.75,sx:{alignItems:"center"},children:[(0,jZ.jsx)("span",{children:e}),(0,jZ.jsx)(Xpe,{chords:t})]})}var L4n={"/":"Slash",".":"Period",",":"Comma",";":"Semicolon","'":"Quote","[":"BracketLeft","]":"BracketRight","\\":"Backslash","-":"Minus","=":"Equal","`":"Backquote"},I4n=["Enter","Space","Escape","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function D5t(e){if(/^[a-z]$/i.test(e)){let n=e.toUpperCase();return{code:`Key${n}`,label:n}}if(/^\d$/.test(e))return{code:`Digit${e}`,label:e};let t=L4n[e];if(t)return{code:t,label:e};if(/^F([1-9]|1[0-2])$/i.test(e)){let n=e.toUpperCase();return{code:n,label:n}}let r=I4n.find(n=>n.toLowerCase()===e.toLowerCase());return r?{code:r,label:r}:void 0}var D4n={mod:"Mod",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",meta:"Meta",cmd:"Meta",command:"Meta",win:"Meta"},M4n=["Mod","Ctrl","Alt","Shift","Meta"];function M5t(e,t){let r=new Set;for(let n of e){let o=D4n[n.toLowerCase()];if(!o)return{ok:!1,error:`"${n}" is not a modifier in "${t}"`};if(r.has(o))return{ok:!1,error:`"${n}" is repeated in "${t}"`};r.add(o)}return[...r].some(n=>n!=="Shift")?r.has("Mod")&&(r.has("Ctrl")||r.has("Meta"))?{ok:!1,error:`"${t}" combines Mod with Ctrl or Meta, which Mod already means`}:{ok:!0,modifiers:M4n.filter(n=>r.has(n))}:{ok:!1,error:`"${t}" needs at least one of Mod, Ctrl, Alt or Meta`}}function N5t(e,{modifiersOnly:t=!1}={}){let r=e.split("+").map(s=>s.trim()),n=t?void 0:r.pop(),o=M5t(r,e);if(!o.ok)return o;let{modifiers:i}=o;if(n===void 0)return{ok:!0,chord:{modifiers:i}};let a=D5t(n);return a?{ok:!0,chord:{modifiers:i,key:a}}:{ok:!1,error:`"${n}" is not a key in "${e}"`}}function Zpe({modifiers:e,key:t},r,n=WO()){if(r.type!=="keydown"||t&&r.code!==t.code)return!1;let o=e.includes("Mod");return r.ctrlKey===(e.includes("Ctrl")||o&&!n)&&r.metaKey===(e.includes("Meta")||o&&n)&&r.altKey===e.includes("Alt")&&r.shiftKey===e.includes("Shift")}var N4n=/^Digit([1-6])$/;function YZ(e,t){if(!t.some(n=>Zpe(n,e)))return;let r=N4n.exec(e.code);return r?Number(r[1])-1:void 0}var GO={navTab:{label:"Switch top-level tab",group:"Navigate"},focusSidebar:{label:"Focus sidebar (backlog: last-selected session card)",group:"Navigate"},focusTerminal:{label:"Focus terminal (backlog: search / back)",group:"Navigate"},toggleDiff:{label:"Open / close diff panel, or focus preview pane",group:"Navigate"},focusRepoPicker:{label:"Focus repo picker",group:"Navigate"},openUpdates:{label:"Open nodes",group:"Navigate"},openConfig:{label:"Open config",group:"Navigate"},openMenu:{label:"Open menu",group:"Navigate"},cycleCards:{label:"Next / previous sidebar card",group:"Navigate"},nextWaiting:{label:"Next waiting session",group:"Sessions"},focusAddAgent:{label:"Focus add agent",group:"Sessions"},focusVsCode:{label:"Focus VS Code",group:"Sessions"},focusDone:{label:"Focus done",group:"Sessions"},newSession:{label:"New session",group:"Sessions"},quickOpen:{label:"Quick open file",group:"Files"},save:{label:"Save file",group:"Files"},shortcutsSheet:{label:"Keyboard shortcuts",group:"Help"}};var O4n="1\u20136",O5t=new WeakMap;function oE(e,t){let r=O5t.get(t);r||(r=new Map,O5t.set(t,r));let n=r.get(e);return n||(n=B4n(e,t),r.set(e,n)),n}function B4n(e,t){let{label:r,group:n}=GO[e];if(e==="cycleCards")return{label:r,group:n,chords:[["Tab"],["Shift","Tab"]],bound:[],matches:Lpe};let o=e==="navTab",i=t[e].flatMap(a=>{let s=N5t(a,{modifiersOnly:o});return s.ok?[s.chord]:[]});return{label:r,group:n,chords:i.map(a=>$4n(a)),bound:i,matches:o?a=>YZ(a,i)!==void 0:a=>i.some(s=>Zpe(s,a))}}function $4n({modifiers:e,key:t}){return[...e,t?.label??O4n]}var F5t=S(oe(),1);var B5t={navTab:["Alt"],focusSidebar:["Alt+A"],focusTerminal:["Alt+S"],toggleDiff:["Alt+D"],focusRepoPicker:["Alt+R"],openUpdates:["Alt+Q"],openConfig:["Alt+W"],openMenu:["Alt+E"],focusAddAgent:["Alt+Z"],focusVsCode:["Alt+X"],focusDone:["Alt+C"],nextWaiting:["Mod+."],newSession:["Mod+N","Alt+N"],quickOpen:["Mod+P"],save:["Mod+S"],shortcutsSheet:["Mod+/"]};var $5t=B5t,_8e=new Set,UA={get:()=>$5t,set(e){$5t=e;for(let t of _8e)t()},subscribe(e){return _8e.add(e),()=>_8e.delete(e)}};function qO(){return(0,F5t.useSyncExternalStore)(UA.subscribe,UA.get)}function vo(e){return oE(e,qO())}var E8e=S(E(),1);function z5t({show:e,children:t}){let{label:r,chords:n}=vo("toggleDiff");return(0,E8e.jsx)(pr,{describeChild:!0,title:e?(0,E8e.jsx)(Gd,{label:r,chords:n}):"",children:t})}function H5t(e){return t=>({px:1,py:"3px",border:1,borderRadius:`${t.tokens.radius.sm}px`,borderColor:e?Ur(t.palette.primary.main,.55):"divider",bgcolor:e?t.tokens.color.selected:"background.default",fontSize:11,textDecoration:"none",transition:"border-color .2s ease, background-color .2s ease","&:hover":{textDecoration:"none",borderColor:e?Ur(t.palette.primary.main,.55):t.palette.text.disabled}})}function U5t(e,t,r){let n=K1().panelFor(e);if(!r)return;let o=n!==void 0&&(t==="uncommitted"?n.scope===t:n.scope!=="uncommitted");return{pressed:o,sx:H5t(o)}}var W5t=S(E(),1);function V5t({groups:e}){return e.map(t=>(0,W5t.jsxs)(H,{component:"span",sx:{color:t.color},children:[t.prefix,t.count]},t.key))}var VA=S(E(),1),F4n={display:"flex",alignItems:"center",gap:.75,fontFamily:"fontFamilyMono",whiteSpace:"nowrap",border:0,p:0,bgcolor:"transparent",cursor:"pointer"};function R8e({panelSessionId:e,cwd:t,conversation:r,scope:n,groups:o,bracketed:i,toggleChordHint:a=!1,countButton:s=!1}){let l=Ype(e,t,r),u=U5t(e,n,s);return(0,VA.jsx)(z5t,{show:a,children:(0,VA.jsxs)(Xr,{component:"button",type:"button",onClick:()=>l(n),variant:"caption",underline:u?"none":"hover",color:"inherit","aria-pressed":u?.pressed,sx:[F4n,u?.sx??{}],children:[i&&(0,VA.jsx)(H,{component:"span",children:"("}),(0,VA.jsx)(V5t,{groups:o}),i&&(0,VA.jsx)(H,{component:"span",children:")"})]})})}var jO=S(E(),1),z4n={display:"flex",alignItems:"center",gap:.75,minWidth:0},G5t=[{key:"new",prefix:"+",color:"success.main"},{key:"modified",prefix:"~",color:"warning.main"},{key:"deleted",prefix:"-",color:"error.main"}];function q5t({panelSessionId:e,cwd:t,conversation:r,groups:n,uncommitted:o,toggleChordHint:i,countButton:a}){return(0,jO.jsx)(sa,{children:(0,jO.jsxs)(H,{sx:z4n,"data-testid":"git-status-counts",children:[n.length>0&&(0,jO.jsx)(R8e,{panelSessionId:e,cwd:t,conversation:r,scope:"all",groups:n,toggleChordHint:i,countButton:a}),o&&o.length>0&&(0,jO.jsx)(R8e,{panelSessionId:e,cwd:t,conversation:r,scope:"uncommitted",groups:o,bracketed:!0,countButton:a})]})})}function j5t(e){return G5t.map(t=>({...t,count:e[t.key]?.length??0})).filter(t=>t.count>0)}function Y5t(e){if(!e)return null;let t=j5t(e),r=e.hasCommits&&e.uncommitted?j5t(e.uncommitted):void 0;return t.length>0||(r?.length??0)>0?{kind:"counts",groups:t,uncommitted:r}:e.defaultBranch&&e.onDefaultBranch===!1?{kind:"branch",defaultBranch:e.defaultBranch}:null}var iE=S(oe(),1);function YO(e,t,r){let n=new URLSearchParams({cwd:e});return t&&(n.set("session",t.conversationId),t.harness&&n.set("harness",t.harness)),r&&r!=="all"&&n.set("scope",r),n.toString()}var H4n=new Set([502,504]);function K5t(){let e=!1;return{shouldRecord:t=>H4n.has(t)?e?!0:(e=!0,!1):(e=!1,!0),reset:()=>{e=!1}}}function X5t(e){let t=2**Math.max(0,e-1);return Math.min(5e3*t,6e4)}function Qpe(e){let t=new AbortController,r=!1,n=0,o,i=async()=>{if(r||t.signal.aborted)return;r=!0,clearTimeout(o);let a=await e(t.signal);r=!1,!t.signal.aborted&&(n=a?.failed?n+1:0,o=setTimeout(i,X5t(n)))};return i(),{poll:i,stop:()=>{t.abort(),clearTimeout(o)}}}async function Z5t(e,t,r){try{let n=await Wt(e,{blipGate:t,signal:r});return n.ok?await n.json().then(o=>({counts:o??null}),()=>{}):{counts:null,failed:!0}}catch(n){return r?.aborted?void 0:(wr(n,"git status counts"),{counts:null,failed:!0})}}function Q5t(e,t){let r=K5t();return Qpe(async n=>{let o=await Z5t(e,r,n);return o&&t(o.counts),o&&{failed:!!o.failed}})}function Jpe(e,t,r=!0){let[n,o]=(0,iE.useState)(null),i=(0,iE.useRef)(()=>{}),a=hr(),s=YO(e,t);return(0,iE.useEffect)(()=>{if(i.current=()=>{},!e||!r){o(null);return}let l=Q5t(Vr(`/api/git-status?${s}`,a),o);return i.current=l.poll,l.stop},[e,s,a,r]),{counts:n,refresh:(0,iE.useCallback)(()=>i.current(),[])}}function J5t(e,t){return Jpe(e,t).counts}var P8e=S(E(),1);function ehe({panelSessionId:e,cwd:t,conversation:r,offerBranchDiff:n=!1,toggleChordHint:o=!1,countButton:i=!1}){let a=Y5t(J5t(t,r));return a?a.kind==="branch"?n?(0,P8e.jsx)(P5t,{panelSessionId:e,cwd:t,conversation:r,defaultBranch:a.defaultBranch}):null:(0,P8e.jsx)(q5t,{panelSessionId:e,cwd:t,conversation:r,groups:a.groups,uncommitted:a.uncommitted,toggleChordHint:o,countButton:i}):null}var aE=S(E(),1);function eRt({restored:e,usedPct:t,harness:r,undurable:n}){return(0,aE.jsxs)(aE.Fragment,{children:[n&&(0,aE.jsx)(Se,{variant:"caption",sx:{color:"warning.main"},children:n.reason}),e!==void 0&&(0,aE.jsx)(Se,{variant:"caption",sx:{color:e?"success.main":"warning.main"},children:e?"restored":"not restored"}),t!==void 0&&(0,aE.jsxs)(Se,{variant:"caption",sx:{color:Vpe(t,r),opacity:.6,fontSize:"0.8rem"},children:[Math.round(t),"%"]})]})}var KZ=S(E(),1),U4n={gridColumn:3,gridRow:2,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.75,minWidth:0};function tRt({session:e}){return(0,KZ.jsxs)(H,{sx:U4n,children:[(0,KZ.jsx)(eRt,{usedPct:e.usedPct,harness:e.harness,undurable:e.undurable}),e.cwd&&(0,KZ.jsx)(ehe,{panelSessionId:e.id,cwd:e.cwd,conversation:rE(e)})]})}function the(e,t){if(t)return!0;let r=e.commandType==="assist"&&e.activity===void 0,n=e.status==="done"||e.status==="error";return r&&!n}var A8e=S(E(),1),V4n=Vo("neutral");function rRt({clone:e}){return(0,A8e.jsx)(pr,{title:`Clone \u2014 ${e}`,children:(0,A8e.jsx)(H,{component:"span",sx:V4n,children:"clone"})})}var rhe=[Vo("primary"),e=>({bgcolor:e.palette.primary.main,borderColor:e.palette.primary.main,color:e.palette.primary.contrastText})];var L8e=S(E(),1),W4n=Vo("success");function nRt({session:e}){return b8e(e)?(0,L8e.jsx)(H,{component:"span",sx:W4n,children:e.port?(0,L8e.jsx)(Upe,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath}):"serving"}):null}var nhe=S(oe(),1),I8e=(0,nhe.createContext)(new Set);function oRt(){return(0,nhe.useContext)(I8e)}var Wg=S(E(),1),G4n=Vo("check");function q4n({label:e}){return(0,Wg.jsx)(H,{component:"span",sx:rhe,children:e})}function iRt({session:e}){let t=oRt().has(e.id),r=e.repoGroup?.clone,{activity:n}=e,o=n?.kind==="backlog"&&n.phase===n.totalPhases;return(0,Wg.jsxs)(Wg.Fragment,{children:[Xi(e)==="check"&&(0,Wg.jsx)(H,{component:"span",sx:G4n,children:"Check"}),(0,Wg.jsx)(nRt,{session:e}),(0,Wg.jsx)(mpe,{harness:e.harness}),t&&r&&(0,Wg.jsx)(rRt,{clone:r}),(0,Wg.jsx)(Spe,{node:e.node}),o&&(0,Wg.jsx)(q4n,{label:`${n.phase}/${n.totalPhases}`})]})}var gRt=S(oe(),1);function ohe(e){return e?.itemIds?.length?e.itemIds:e?.itemId==null?[]:[e.itemId]}var sRt=S(E(),1),j4n=Vo("primary");function aRt({itemId:e,session:t}){let r=hr();return(0,sRt.jsx)(Xr,{component:Sa,to:Vd(e,$l(t),r),underline:"hover",sx:j4n,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:pn(e)})}var D8e=S(E(),1),lRt=Vo("secondary");function cRt({prNumber:e,url:t}){let r=`#${e}`;return t?(0,D8e.jsx)(Xr,{href:t,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:lRt,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:r}):(0,D8e.jsx)(H,{component:"span",sx:lRt,children:r})}var dRt=S(E(),1),Y4n={color:"text.secondary",whiteSpace:"nowrap"};function uRt(e,t){let r=AO(t)?cs(e):"";if(r)return{key:"repo",node:(0,dRt.jsx)(H,{component:"span",sx:Y4n,children:r})}}function fRt(e,t){return!e?.jiraKey&&e?.githubIssue?.toLowerCase()===t.toLowerCase()}var hRt=S(E(),1);function pRt(e,t){if(!(!e||fRt(t,e)))return{key:"prompt-issue",node:(0,hRt.jsx)(X_,{githubIssue:e,variant:"token"})}}function sE(e){if(e.activity?.kind==="backlog")return"next";if(e.design)return"design";switch(e.commandType){case"assist":{let t=e.assistArgs?.[0];return t==="review-pr-comments"||t==="fix-conflict"?"review":t==="draft"||t==="bug"||t==="next"||t==="refine"||t==="review"||t==="update"?t:"prompt"}case"run":return"run";default:return e.promptType??"prompt"}}var ihe=S(E(),1);function mRt(e,t,r,n){let o=[],i=sE(e),a=t?void 0:uRt(e.cwd,i),{activity:s}=e;a&&o.push(a),s?.kind==="backlog"?s.phase!==s.totalPhases&&o.push({key:"phase",node:`${s.phase}/${s.totalPhases}`}):o.push({key:"type",node:i}),r.number!==void 0&&o.push({key:"pr",badge:!0,node:(0,ihe.jsx)(cRt,{prNumber:r.number,url:r.url})});for(let u of ohe(s))o.push({key:`item-${u}`,badge:!0,node:(0,ihe.jsx)(aRt,{itemId:u,session:e})});n&&o.push({key:"tracker",node:(0,ihe.jsx)(fpe,{tracker:n,variant:"token"})});let l=pRt(e.promptIssue,n);return l&&o.push(l),o}var K4n=["review","review-pr-comments","fix-conflict"];function X1(e){let t=e.assistArgs?.[0];if(!t||!K4n.includes(t))return;let r=e.assistArgs?.slice(1).map(o=>Number(o)).find(o=>Number.isInteger(o)&&o>0);if(r!==void 0)return r;let n=e.subtitle?.match(/^#(\d+)/);return n?Number(n[1]):void 0}var ahe=S(oe(),1);function KO(e,t,r){let[n,o]=(0,ahe.useState)(null),i=hr();return(0,ahe.useEffect)(()=>{if(!e){o(null);return}let a=!1,s=t!==void 0?`&number=${t}`:"";return Wt(Vr(`/api/pr-status?cwd=${encodeURIComponent(e)}${s}`,i)).then(l=>l.json()).then(l=>{a||o(typeof l?.pr?.number=="number"?l.pr:null)}).catch(l=>{wr(l,"PR status"),a||o(null)}),()=>{a=!0}},[e,i,t,r]),n}var WA=S(E(),1),X4n={opacity:.35,mx:.5};function yRt({session:e}){let t=y5t(),r=xpe(e.cwd),n=X1(e)??e.promptPr,o=KO(e.cwd,n,e.status),i=mRt(e,t,{number:n??o?.number,url:o?.url},r(e.activity?.itemId)),a=s=>s>0&&!i[s].badge&&!i[s-1].badge;return(0,WA.jsx)(WA.Fragment,{children:i.map((s,l)=>(0,WA.jsxs)(gRt.Fragment,{children:[a(l)&&(0,WA.jsx)(H,{component:"span",sx:X4n,children:"\xB7"}),s.node]},s.key))})}var GA=S(E(),1);function vRt({session:e}){return(0,GA.jsxs)(GA.Fragment,{children:[(0,GA.jsx)(yRt,{session:e}),(0,GA.jsx)(iRt,{session:e})]})}var M8e=S(E(),1),Z4n={color:"text.disabled",fontSize:"0.65rem",lineHeight:1.4};function bRt({toggles:e}){let t=e.flatMap(r=>r.caption??[]);return t.length===0?null:(0,M8e.jsx)(H,{sx:{display:"flex",gap:1,minWidth:0},children:t.map(r=>(0,M8e.jsx)(Se,{sx:Z4n,children:r},r))})}function XO({activity:e}){return e?.kind==="backlog"&&!!e.phase&&e.phase===e.totalPhases}function ZO(e){let t=[],r=sE(e);if(r==="draft"||r==="bug"||r==="refine"){let n=e.autoApprove??!1;t.push({key:"autoApprove",label:"Auto start",checked:n,...n?{caption:"will auto start"}:{}})}if(e.activity?.kind==="backlog"){let n=e.autoAdvance??!0;XO(e)||t.push({key:"autoAdvance",label:"Continue",checked:n,...n?{}:{caption:"won't continue"}})}return t}var XZ=S(E(),1),Q4n={gridColumn:2,gridRow:2,display:"flex",alignItems:"center",gap:.625,minWidth:0,overflow:"hidden",fontSize:"0.6875rem",lineHeight:"16px",color:"text.secondary"};function xRt({session:e}){return the(e,!1)?null:(0,XZ.jsxs)(H,{sx:Q4n,children:[(0,XZ.jsx)(vRt,{session:e}),(0,XZ.jsx)(bRt,{toggles:ZO(e)})]})}var qA=S(E(),1);function SRt({session:e,loading:t}){return t?null:(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(xRt,{session:e}),(0,qA.jsx)(tRt,{session:e})]})}var she="session-card-title";var lE="session-card-close";var TRt=S(E(),1),wRt=ot((0,TRt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever");var lhe=S(oe(),1),N8e=(0,lhe.createContext)({onStop:()=>{},onStart:()=>{},onDiscard:()=>{}});function QO(){return(0,lhe.useContext)(N8e)}var cT=S(E(),1);function CRt({id:e,reason:t,path:r,removesTree:n}){let{onDiscard:o}=QO(),{confirming:i,close:a,triggerHandlers:s,withHint:l}=ds(()=>o(e)),u=t?` (${t})`:"",d=r??"its working tree";return(0,cT.jsxs)(cT.Fragment,{children:[(0,cT.jsx)(Ht,{size:"small",...s,title:l(n?"Discard changes and remove worktree":"Drop this card and stop tracking its unlanded work"),sx:{color:"text.disabled","&:hover":{color:"error.main"}},children:(0,cT.jsx)(wRt,{sx:{fontSize:16}})}),i&&(0,cT.jsx)(sa,{children:(0,cT.jsx)($o,{title:n?"Discard all changes":"Stop tracking this work",message:n?`This permanently deletes the worktree ${d} and the work it holds${u}. This cannot be undone.`:`This drops the card and stops tracking the unlanded work in ${d}${u}. Nothing on disk is deleted.`,confirmLabel:n?"Discard changes":"Drop card",onConfirm:()=>{a(),o(e)},onCancel:a})})]})}var Z1=S(E(),1);function kRt({childCount:e,onDismissThis:t,onDismissAll:r,onCancel:n}){let o=e===1?"session":"sessions";return(0,Z1.jsxs)(_a,{open:!0,onClose:n,maxWidth:"xs",fullWidth:!0,children:[(0,Z1.jsx)(Dl,{children:"Close nested sessions?"}),(0,Z1.jsx)(Il,{children:(0,Z1.jsx)(l_,{children:`This session has ${e} nested ${o}. Close just this session, or close it along with its nested ${o}? Running sessions will be stopped.`})}),(0,Z1.jsxs)(Yc,{children:[(0,Z1.jsx)(it,{onClick:n,children:"Cancel"}),(0,Z1.jsx)(it,{onClick:t,children:"Close this only"}),(0,Z1.jsx)(it,{variant:"contained",color:"error",onClick:r,children:`Close all ${e+1}`})]})]})}var che=S(E(),1);function _Rt({onDismiss:e,childDismiss:t,onClose:r}){let n=o=>{r(),o()};return(0,che.jsx)(sa,{children:t?(0,che.jsx)(kRt,{childCount:t.childCount,onDismissThis:()=>n(e),onDismissAll:()=>n(t.onDismissAll),onCancel:r}):(0,che.jsx)($o,{title:"End session",message:"This will stop the running session and kill its process. Are you sure?",confirmLabel:"End session",onConfirm:()=>n(e),onCancel:r})})}var cE=S(E(),1);function uhe({id:e,status:t,onDismiss:r,childDismiss:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(n?.onDismissAll??r,{needsConfirm:t!=="done"||!!n});return(0,cE.jsxs)(cE.Fragment,{children:[(0,cE.jsx)(Ht,{size:"small",...a,title:s(`Dismiss session ${e}`),sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,cE.jsx)(Bo,{sx:{fontSize:16}})}),o&&(0,cE.jsx)(_Rt,{onDismiss:r,childDismiss:n,onClose:i})]})}var lo={supported:!0};function Pa(e,t,r){return r?{supported:!1,reason:e,remediation:t,followUp:r}:{supported:!1,reason:e,remediation:t}}var ERt={"skills.native":lo,"launch.terminal":lo,"conversation.resume":lo,"conversation.relocate":lo,"conversation.id":lo,"conversation.preassignId":lo,"systemPrompt.append":lo,"tasks.notifyOnExit":lo,"artifacts.publish":lo,"transcript.read":lo,"oneShot.text":lo,"oneShot.structured":lo,"usage.rateLimits":lo,"tools.restrict":lo,"connector.gmail.read":lo,"connector.slack.read":lo,"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":lo,"intercept.question":lo,"slashCommands.suggest":lo},RRt={claude:ERt,"claude-sdk":ERt,codex:{"skills.native":lo,"launch.terminal":lo,"conversation.resume":lo,"conversation.relocate":lo,"conversation.id":lo,"conversation.preassignId":Pa("Codex assigns its own conversation id when its rollout starts","assist binds the Codex conversation id from the rollout after launch"),"systemPrompt.append":Pa("Design launches on Codex have not passed manual testing: sessions arrived without the design prompt or stopped before designing anything","start design sessions with Claude","a1589"),"tasks.notifyOnExit":Pa("Codex runs a background command in an exec session that reports nothing back once the turn ends, so an agent that ends its turn never sees a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; Codex asks its questions in chat","a1573"),"artifacts.publish":Pa("Codex has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","design in Codex and deliver the HTML file, then review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":lo,"oneShot.text":lo,"oneShot.structured":lo,"usage.rateLimits":lo,"tools.restrict":Pa("assist cannot yet limit a headless Codex run to an allow-list of connector tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":Pa("Codex has no verified read-only Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":Pa("Codex has no verified read-only Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":Pa("assist's maintainability-override and comment guards run only in Claude's edit hook, so Codex patches are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":lo,"slashCommands.suggest":Pa("assist reads skills and commands only from Claude's home and project dirs","type the Codex skill name in full in the phone reply bar")},pi:{"skills.native":lo,"launch.terminal":lo,"conversation.resume":Pa("pi sessions cannot be resumed yet","restart starts a fresh pi conversation; pick Claude or Codex to keep the conversation across restarts","a696"),"conversation.relocate":Pa("pi sessions cannot be resumed, so a pi conversation cannot continue in a replacement worktree","start a fresh session in the replacement worktree; pick Claude or Codex to keep the conversation across worktree replacement","a696"),"conversation.id":Pa("assist records no conversation id for pi sessions","comment from the session's own diff panel; a standalone /diff link cannot find a pi session","a696"),"conversation.preassignId":Pa("pi does not accept a caller-assigned conversation id","the session card tracks pi without a conversation id"),"systemPrompt.append":Pa("assist has not verified a pi flag that appends a system prompt at launch and on resume","start design sessions with Claude or Codex, or run /design inside a pi session to read the design prompt from disk","a696"),"tasks.notifyOnExit":Pa("assist has not verified a pi tool that wakes the agent when a background command exits, so an agent that ends its turn would never see a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"artifacts.publish":Pa("pi has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","deliver the HTML file and review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":Pa("assist cannot read pi conversation transcripts yet","pi session cards show no message previews or transcript-derived status and title; pick Claude or Codex for those","a696"),"oneShot.text":Pa("assist has no headless pi one-shot yet","the derived fallback is used instead (slug from the description, no generated title); set harness.engine to claude or codex for generated suggestions","a696"),"oneShot.structured":Pa("assist has no headless streaming pi run yet","pick Claude or Codex for review synthesis (review.synthesisHarness); pi cannot be a reviewer","a696"),"usage.rateLimits":Pa("pi reports no account rate-limit windows to assist","pi sessions show no usage windows; Claude and Codex usage is still tracked under their own accounts","a696"),"tools.restrict":Pa("assist cannot limit a headless pi run to an allow-list of tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":Pa("pi has no Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":Pa("pi has no Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":lo,"intercept.fileRead":lo,"intercept.fileWrite":lo,"intercept.editDiff":Pa("assist's maintainability-override and comment guards run only in Claude's edit hook, so pi edits and writes are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":lo,"slashCommands.suggest":Pa("assist reads skills and commands only from Claude's home and project dirs","type the pi prompt name in full in the phone reply bar")}};function PRt(e,t){let r=e[t];return typeof r=="function"?r():r}function dhe(e,t){return PRt(RRt[Wd(e)],t)}function fhe(e){return dhe(e,"conversation.resume").supported}var ARt=S(E(),1),Gs=ot((0,ARt.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var phe=S(oe(),1);var uE=S(E(),1);function LRt({id:e,onStartOver:t,anchor:r,onClose:n}){let o=ds(()=>{n(),t()});return(0,uE.jsxs)(uE.Fragment,{children:[(0,uE.jsx)(ci,{anchorEl:r,open:r!==null,onClose:n,onClick:i=>i.stopPropagation(),children:(0,uE.jsx)(Br,{title:o.withHint("Start over"),...o.triggerHandlers,onClick:i=>{n(),o.triggerHandlers.onClick(i)},children:"Start over"})}),o.confirming&&(0,uE.jsx)($o,{title:`Start over session ${e}`,message:"Start over? The conversation history is discarded. This stops the running process and starts a new conversation with only the initial prompt, or opens idle if there was none.",confirmLabel:"Start over",onConfirm:()=>{o.close(),t()},onCancel:o.close})]})}var uT=S(E(),1);function IRt({id:e,onStartOver:t,children:r}){let n=(0,phe.useRef)(null),[o,i]=(0,phe.useState)(null);return(0,uT.jsxs)(uT.Fragment,{children:[(0,uT.jsxs)(I1,{ref:n,variant:"outlined",color:"inherit",size:"small","aria-label":"Restart session",sx:{color:"text.secondary",flexShrink:0,"& .MuiButtonGroup-grouped":{borderColor:"divider"},"& .MuiButtonGroup-lastButton":{minWidth:0,px:.25}},children:[r,(0,uT.jsx)(it,{"aria-label":"Restart options","aria-haspopup":"menu","aria-expanded":o!==null,onClick:a=>{a.stopPropagation(),i(n.current)},children:(0,uT.jsx)(Gs,{sx:{fontSize:16}})})]}),(0,uT.jsx)(LRt,{id:e,onStartOver:t,anchor:o,onClose:()=>i(null)})]})}var DRt=S(E(),1),dT=ot((0,DRt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var hhe=S(oe(),1),O8e=(0,hhe.createContext)(!1);function mhe(){return(0,hhe.useContext)(O8e)}var ghe=S(E(),1);function MRt({title:e,onClick:t,onKeyDown:r}){let n=mhe();return(0,ghe.jsx)(it,{size:"small","aria-label":"Restart",title:e,onClick:t,onKeyDown:r,startIcon:n?(0,ghe.jsx)(dT,{sx:{fontSize:14}}):void 0,sx:{textTransform:"none",minWidth:0,px:1,whiteSpace:"nowrap"},children:n?"Restart":(0,ghe.jsx)(dT,{sx:{fontSize:14}})})}var dE=S(E(),1);function J4n(e){return fhe(e)?"resumes the conversation":"relaunches it from the start"}function yhe({id:e,onRestart:t,onStartOver:r,harness:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=ds(t),l=(0,dE.jsx)(MRt,{title:s(`Restart session ${e}`),...a});return(0,dE.jsxs)(dE.Fragment,{children:[r?(0,dE.jsx)(IRt,{id:e,onStartOver:r,children:l}):l,o&&(0,dE.jsx)($o,{title:`Restart session ${e}`,message:`Restart this ${_i(n)} session? It ${J4n(n)}, stopping the running process first.`,confirmLabel:"Restart",onConfirm:()=>{i(),t()},onCancel:i})]})}var Q1=S(E(),1);function NRt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){let{status:i,id:a,harness:s}=e;return e.closing?null:i!=="stopped"?(0,Q1.jsx)("span",{className:lE,children:(0,Q1.jsx)(uhe,{id:a,status:i,onDismiss:n,childDismiss:o})}):(0,Q1.jsxs)(Q1.Fragment,{children:[e.undurable&&(0,Q1.jsx)("span",{className:lE,children:(0,Q1.jsx)(CRt,{id:a,reason:e.undurable.reason,path:e.cwd,removesTree:e.undurable.removesTree})}),t&&(0,Q1.jsx)(yhe,{id:a,onRestart:t,onStartOver:r,harness:s})]})}var B8e=S(E(),1);function ORt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){return(0,B8e.jsx)(sa,{children:(0,B8e.jsx)(NRt,{session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o})})}var $8e=S(E(),1),e5n={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25};function BRt({session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a}){return(0,$8e.jsx)(H,{sx:e5n,children:(0,$8e.jsx)(ORt,{session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a})})}function vhe(e){return e.verifying===!0&&Xi(e)==="running"}var JO=S(E(),1),t5n=Si`
|
|
3817
3817
|
to { transform: rotate(360deg); }
|
|
3818
3818
|
`,bhe=8,r5n=3,n5n=6.25,o5n=1.5,i5n={gridColumn:1,gridRow:1,justifySelf:"center",alignSelf:"center",display:"block",color:Ku.running,"& .verify-ring":{fill:"none",stroke:"currentColor",strokeWidth:o5n,strokeDasharray:"70 30",opacity:.45,transformBox:"fill-box",transformOrigin:"center",animation:`${t5n} 1.1s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none",strokeDasharray:"none"}}};function xhe({ring:e=!1,title:t="running"}){return(0,JO.jsxs)(H,{component:"svg",viewBox:"0 0 16 16",width:16,height:16,sx:i5n,children:[(0,JO.jsx)("title",{children:t}),(0,JO.jsx)("circle",{cx:bhe,cy:bhe,r:r5n,fill:"currentColor",shapeRendering:"geometricPrecision"}),e&&(0,JO.jsx)("circle",{className:"verify-ring",cx:bhe,cy:bhe,r:n5n,pathLength:100})]})}function fE(e){return e==="waiting"||e==="question"||e==="check"}var She=S(E(),1),a5n=Si`
|
|
3819
3819
|
0%, 100% { opacity: 1; }
|
|
@@ -4125,7 +4125,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4125
4125
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4126
4126
|
${r}`}return t}function LWr(e){return AWr(e??"").filter(t=>t.startsWith("@@"))}function GFo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function qFo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4127
4127
|
`)[0]??""}function IWr(e,t){return e.reduce((r,n)=>r+PWr(n,t),0)}function DWr(e,t,r){let n=LWr(e.patch),o=[],i=[];return n.forEach((a,s)=>{let l=r.get(`${e.path}#${s}`)??[];l.includes(t)?o.push(a):i.push({oldStart:GFo(a),header:qFo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4128
|
-
`),additions:IWr(o,"+"),deletions:IWr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function MWr(e){return e.flatMap(t=>{if(t.kind==="dir")return MWr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function jFo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function NWr(e,t,r=new Set,n=new Set){let o=MWr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=jFo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Wq));return RWr(o.filter(u=>l.has(u.path)).map(u=>DWr(u,s+1,i)))})}function YFo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Wq(s)===e).length;a>n&&(r=i,n=a)}),r}function OWr(e,t){let r=t.map(()=>[]);for(let n of e)r[YFo(n.path,t)]?.push(n);return r}function BWr(e,t){let r=NWr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=OWr(e.tests,t),o=RRe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function $Wr(e){if(!e.slices)return;let t=BWr(e,e.slices);return{entries:xWr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function FWr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var Mpt="assist:high-level-progress:",KFo=`${Mpt}head:`,XFo=720*60*60*1e3,Uae=e=>`${Mpt}${e}`,Npt=e=>`${KFo}${e}`,Dpt=e=>ll(e)[0];function ZFo(e,t){let r=e?Dpt(Uae(e)):void 0;return e&&Lv(Uae(e)),r??(t?Dpt(Npt(t)):void 0)}function zWr(e,t,r){return Dx(Mpt,XFo),Dpt(Uae(e))??ZFo(t,r)}function HWr(e,t,r){Rl(Uae(e),[r]),t&&Rl(Npt(t),[r])}function UWr(e,t){Lv(Uae(e)),t&&Lv(Npt(t))}function VWr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function IM(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Jq={repo:"",prNumber:0,headSha:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function WWr(e){let t;try{t=JSON.parse(e)}catch{return Jq}return typeof t!="object"||t===null?Jq:{repo:typeof t.repo=="string"?t.repo:Jq.repo,prNumber:typeof t.prNumber=="number"?t.prNumber:Jq.prNumber,headSha:typeof t.headSha=="string"?t.headSha:Jq.headSha,checks:IM(t.checks,VWr),structure:{...Jq.structure,...t.structure},criticalDiffs:IM(t.criticalDiffs),criticalPaths:IM(t.criticalPaths),tests:IM(t.tests),testPaths:IM(t.testPaths),collapsedPaths:IM(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function GWr(e){let t=(0,XRe.useMemo)(()=>WWr(e.body),[e.body]),r=(0,XRe.useMemo)(()=>$Wr(t),[t]),n=FWr(t),o=(0,XRe.useMemo)(()=>zWr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var qWr=S(oe(),1);function jWr(e){let[t,r]=(0,qWr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var YWr=S(oe(),1);function KWr(e,t,r,n){(0,YWr.useEffect)(()=>{HWr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function ZWr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=GWr(e),s=bWr(n.checks,i,o?.slicing),l=jWr(i),u=cWr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=cRe(t,r),h={...d,onQueue:l.onQueue};KWr(e.requestId,a,s.items,l.queued);let m=(0,XWr.useMemo)(()=>hWr(n),[n]);return{payload:n,checklist:s,queue:l,details:pWr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var yS=S(E(),1);function QWr({preview:e,session:t,sendInput:r,onDecision:n}){let o=ZWr(e,t,r);return(0,yS.jsxs)(H,{sx:Xy,children:[(0,yS.jsx)(Th,{preview:e,draft:!1}),(0,yS.jsx)(Zq,{items:e.metadata??[]}),(0,yS.jsx)(Gn,{}),(0,yS.jsx)(YVr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,yS.jsx)(Gn,{}),(0,yS.jsx)(sWr,{pane:o,onDecision:(i,a)=>{UWr(e.requestId,o.head),n(i,a)}}),(0,yS.jsx)(Iy,{sessionName:o.sentTo,onClose:o.clearSent})]})}var aGr=S(oe(),1);var DM=S(E(),1);function QFo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function JWr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,DM.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,DM.jsx)(Se,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:QFo(e)}),(0,DM.jsx)(it,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,DM.jsx)(it,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,DM.jsx)(it,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var JFo={"top-left":ec.miro.topLeft,"bottom-right":ec.miro.bottomRight};function eGr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?JFo[t]:ec.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var Vae=S(E(),1);function tGr({box:e,role:t,onSelect:r}){let n=eGr(e,t);return(0,Vae.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,Vae.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,Vae.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ec.miro.text,children:e.text})]})}function rGr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var ZRe=S(E(),1);function nGr({boxes:e,selection:t}){return(0,ZRe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,ZRe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:rGr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,ZRe.jsx)(tGr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function ezo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function oGr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(ezo):[]}catch{return[]}}var Opt=S(oe(),1);function iGr(){let[e,t]=(0,Opt.useState)(null),[r,n]=(0,Opt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var y3=S(E(),1);function sGr({preview:e,onDecision:t}){let r=(0,aGr.useMemo)(()=>oGr(e.body),[e.body]),n=iGr();return(0,y3.jsxs)(H,{sx:Xy,children:[(0,y3.jsx)(Th,{preview:e,draft:!1}),(0,y3.jsx)(Gn,{}),(0,y3.jsx)(nGr,{boxes:r,selection:n}),(0,y3.jsx)(Gn,{}),(0,y3.jsx)(JWr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",zc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",zc())})]})}var $Gr=S(oe(),1);function lGr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function QRe(e){return e*22}function cGr(e){return Math.round(e/22)}var uGr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},dGr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},fGr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},pGr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Bpt={p:.25,mt:"2px"},hGr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var gGr=S(E(),1),tzo=8;function mGr({drag:e}){return e?(0,gGr.jsx)(H,{sx:hGr,style:{top:e.top-1,left:tzo+QRe(e.depth)}}):null}var yGr=S(E(),1),vGr=ot((0,yGr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var $pt=S(E(),1);function bGr({number:e,onGrip:t}){return(0,$pt.jsx)(Ht,{size:"small",className:"criterion-action",sx:dGr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,$pt.jsx)(vGr,{fontSize:"inherit"})})}var YC=S(E(),1);function xGr({number:e,onAdd:t,onDelete:r}){return(0,YC.jsxs)(YC.Fragment,{children:[(0,YC.jsx)(Ht,{size:"small",className:"criterion-action",sx:Bpt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,YC.jsx)(qd,{fontSize:"inherit"})}),(0,YC.jsx)(Ht,{size:"small",className:"criterion-action",sx:Bpt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,YC.jsx)(Bo,{fontSize:"inherit"})})]})}var JRe=S(oe(),1);function SGr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function TGr(e){let t=(0,JRe.useRef)(null);return(0,JRe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=SGr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var MM=S(E(),1);function wGr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=TGr(n.focus?.index===e?n.focus:null),s={marginLeft:QRe(r.depth),opacity:o?.4:1};return(0,MM.jsxs)(H,{sx:uGr,"data-criterion-row":!0,style:s,children:[(0,MM.jsx)(bGr,{number:t,onGrip:i}),(0,MM.jsx)(H,{component:"span",sx:fGr,"aria-hidden":"true",children:`${t}.`}),(0,MM.jsx)($i,{multiline:!0,value:r.text,sx:pGr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,MM.jsx)(xGr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var AGr=S(oe(),1);function CGr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function v3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function e3e(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:v3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function Zm(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function t3e(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function kGr(e,t){let r=Zm(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function _Gr(e,t,r){let n=r<0?t3e(e,t):kGr(e,t);if(n<0)return null;let o=Zm(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:Zm(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function r3e(e,t){let r=Zm(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:v3(n),index:Math.max(0,t-1)}}function EGr(e,t,r){if(r<0&&e[t].depth===0||r>0&&t3e(e,t)<0)return null;let n=Zm(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function n3e(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function rzo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return n3e(e3e(e,t,o,n.slice(r)),"start")}function nzo(e,t,{shift:r,caret:n}){let o=EGr(e,t,r?-1:1);return n3e(o?{items:o,index:t}:null,n)}function RGr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?rzo(e,t,r):n==="Tab"?nzo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?n3e(_Gr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?n3e(r3e(e,t),"end"):null}function PGr(e,t,r){return RGr(e,t,r)??CGr(e,t,r)}function LGr(e,t){let[r,n]=(0,AGr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=PGr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(e3e(e,a,e[a].text,""),"start"),onDelete:a=>o(r3e(e,a),"end")}}var OGr=S(oe(),1);function ozo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=Zm(t,r);return o>r&&o<i?r:o}function izo(e,t,r,n){let o=Zm(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+cGr(n),s))}function azo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function IGr(e,t,r,n,o){let i=ozo(e,t,r,o);return{target:i,depth:izo(t,r,i,n),top:azo(e,i)}}function szo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function DGr(e,t,r,n){return o=>{let{boxes:i,origin:a}=szo(t);return IGr(i,e,r,o.clientX-n,o.clientY-a)}}function MGr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function NGr(e,t,r,n){let o=Zm(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:v3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function BGr(e,t,r){let[n,o]=(0,OGr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),MGr(s.currentTarget,s.pointerId,DGr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(NGr(e,a,d.target,d.depth))})(s)}}}var Wae=S(E(),1),lzo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},czo=[{text:"",depth:0}];function FGr({items:e,onChange:t}){let r=(0,$Gr.useRef)(null),n=e.length>0?e:czo,o=LGr(n,t),{drag:i,onGrip:a}=BGr(n,r,o.onDrop),s=lGr(n.map(l=>l.depth));return(0,Wae.jsxs)(H,{sx:lzo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,Wae.jsx)(wGr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,Wae.jsx)(mGr,{drag:i})]})}var zGr=S(E(),1),HGr=ot((0,zGr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var Gae=S(E(),1),uzo={insert:"Add acceptance criteria",convert:"Convert to outline"};function UGr({kind:e,onClick:t}){return(0,Gae.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,Gae.jsx)(it,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,Gae.jsx)(qd,{}):(0,Gae.jsx)(HGr,{}),onClick:t,children:uzo[e]})})}var qae=S(oe(),1);function VGr(e,t,{color:r,pin:n}){let o=a6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>dzo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function dzo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function WGr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function GGr(e,t){for(let r of t){let n=CIt(e,r);n&&VGr(e,n,r)}}var jae=S(E(),1);function qGr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,qae.useMemo)(()=>cD(e),[e]),a=(0,qae.useMemo)(()=>cD(r??""),[r]);return(0,qae.useLayoutEffect)(()=>{let s=o.current;s&&(WGr(s),GGr(s,n))},[i,a,n,o]),(0,jae.jsxs)(H,{ref:o,children:[(0,jae.jsx)(aD,{segments:i,skipDiagramText:!0}),t,t?(0,jae.jsx)(aD,{segments:a,skipDiagramText:!0}):null]})}var NM=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function o3e(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[NM("")]:{lineHeight:1.6},[NM("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[NM("ul, ol")]:{pl:2.5,mb:2},[NM("li")]:{mb:"6px"},[NM("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[NM("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[NM("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var jGr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...n$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...o3e(e)});var ej=S(E(),1);function YGr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,ej.jsxs)(H,{ref:o,onMouseDown:l,sx:jGr,children:[(0,ej.jsx)(qGr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,ej.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,ej.jsx)(jB,{rects:a,color:s})]})}function KGr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var i3e=S(oe(),1),XGr=S(E(),1);function Fpt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,i3e.useState)(t);return(0,i3e.useEffect)(()=>i(t),[t]),(0,XGr.jsx)(Yn,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var Yae=S(E(),1),zpt="screenshot-groups";function fzo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function ZGr({screenshot:e,onUpdate:t}){return(0,Yae.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,Yae.jsx)(Fpt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||fzo(e.path)})}),(0,Yae.jsx)(Fpt,{label:"Group",value:e.group??"",listId:zpt,onCommit:r=>t(e.id,{group:r})})]})}var b3=S(E(),1),QGr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},pzo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function JGr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,b3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,b3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:QGr}):(0,b3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:QGr}),(0,b3.jsx)(Ht,{size:"small","aria-label":"Remove screenshot",sx:pzo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,b3.jsx)(Bo,{fontSize:"small"})}),(0,b3.jsx)(ZGr,{screenshot:e,onUpdate:r})]})}var o0=S(E(),1);function hzo(){return(0,o0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,o0.jsx)(oo,{size:16}),(0,o0.jsx)(Se,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function mzo({error:e}){return(0,o0.jsx)(Se,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function eqr({uploads:e,empty:t}){return e.length>0?(0,o0.jsx)(o0.Fragment,{children:e.map(r=>r.error?(0,o0.jsx)(mzo,{error:r.error},r.id):(0,o0.jsx)(hzo,{},r.id))}):t?(0,o0.jsx)(Se,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var i0=S(E(),1),gzo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function tqr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=KGr(e),a=s=>(0,i0.jsx)(JGr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,i0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,i0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,i0.jsx)("datalist",{id:zpt,children:o.map(([s])=>(0,i0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,i0.jsxs)(H,{sx:{mb:2},children:[(0,i0.jsx)(H,{component:"h3",children:s}),(0,i0.jsx)(H,{sx:gzo,children:l.map(a)})]},s)),(0,i0.jsxs)(St,{spacing:1,children:[i.map(a),(0,i0.jsx)(eqr,{uploads:t,empty:e.length===0})]})]})}var Kae=S(E(),1);function yzo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,Kae.jsx)(FGr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,Kae.jsx)(UGr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function a3e({pane:e,screenshots:t}){return(0,Kae.jsx)(YGr,{...yzo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,Kae.jsx)(tqr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var rqr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),nqr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},oqr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),iqr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var KC=S(E(),1);function aqr({comments:e,colors:t,onRemove:r}){return(0,KC.jsxs)(H,{sx:rqr,children:[(0,KC.jsxs)(Se,{sx:nqr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,KC.jsxs)(H,{sx:oqr,children:[(0,KC.jsx)(VB,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,KC.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,KC.jsx)(Ht,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:iqr,children:(0,KC.jsx)(Bo,{})})]},n.id))]})}var lqr=S(E(),1);function sqr(e){return e.comments.length===0?null:(0,lqr.jsx)(aqr,{...e})}var cqr=S(E(),1),s3e=ot((0,cqr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var mqr=S(oe(),1);var uqr=S(E(),1),dqr=ot((0,uqr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var a0="0.1148.1";var vzo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function fqr(e){return e?vzo[e]:"success.main"}function pqr(e){return e.split("-")[0].split(".").map(Number)}function hqr(e,t){if(!e||!t||e===t)return;let r=pqr(e),n=pqr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var l3e=S(oe(),1),Hpt=(0,l3e.createContext)(null);function c3e(){return(0,l3e.useContext)(Hpt)}var OM=S(E(),1),bzo={height:16,fontSize:10},xzo={opacity:.6,fontSize:"0.85em"};function Szo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function x3({nodes:e,name:t,showVersion:r=!1}){let n=c3e()??a0,o=e.links.find(a=>a.name===t),i=hqr(o?.peerVersion,n);return(0,OM.jsx)(pr,{title:Szo(e,t),placement:"right",children:(0,OM.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,OM.jsx)(dqr,{sx:{fontSize:8,color:fqr(o?.state)}}),t,r&&o?.peerVersion&&(0,OM.jsxs)(H,{component:"span",sx:xzo,children:["v",o.peerVersion]}),i&&(0,OM.jsx)(xn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:bzo})]})})}var s0=S(E(),1),Tzo={textTransform:"none"};function u3e({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,mqr.useState)(null);return(0,s0.jsxs)(s0.Fragment,{children:[(0,s0.jsx)(it,{size:"small",color:"inherit",startIcon:(0,s0.jsx)(s3e,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Tzo,children:(0,s0.jsx)(x3,{nodes:e,name:r.node})}),(0,s0.jsx)(ci,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,s0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,s0.jsx)(Uu,{primary:(0,s0.jsx)(x3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var gqr=S(oe(),1);function wzo(e,t){return e?.toLowerCase()===t.toLowerCase()}function d3e(e,t){let{nodes:r,names:n,visible:o}=us(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=Ln(),[d,f]=(0,gqr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>wzo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var S3=S(E(),1);function yqr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Rhe(),a=d3e(r,t);return(0,S3.jsxs)(S3.Fragment,{children:[(0,S3.jsx)(it,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,S3.jsx)(u3e,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,S3.jsx)(it,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Upt=S(E(),1),Czo={"& .MuiFormControlLabel-label":{fontSize:12}};function Xae({label:e,title:t,checked:r,onChange:n}){return(0,Upt.jsx)(Nd,{control:(0,Upt.jsx)(Ep,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Czo})}var BM=S(E(),1);function f3e({chain:e,newPr:t,onChange:r}){return(0,BM.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,BM.jsx)(Xae,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,BM.jsx)(Xae,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,BM.jsx)(Xae,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,BM.jsx)(Xae,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var $M=S(E(),1);function vqr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,$M.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,$M.jsx)(f3e,{chain:t,newPr:r,onChange:i}),(0,$M.jsx)(it,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,$M.jsxs)(it,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,$M.jsx)(yqr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var xqr=S(E(),1);function bqr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,xqr.jsx)(vqr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var XC=S(E(),1);function Sqr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,XC.jsxs)(XC.Fragment,{children:[(0,XC.jsx)(sqr,{comments:t,colors:r,onRemove:d}),(0,XC.jsx)(Gn,{}),(0,XC.jsx)(bqr,{...e}),(0,XC.jsx)(Wme,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var Zae=S(E(),1),kzo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},_zo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Tqr({url:e}){return(0,Zae.jsxs)(H,{sx:kzo,children:[(0,Zae.jsx)(it,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,Zae.jsx)(Se,{variant:"body2",sx:_zo,title:e,children:e})]})}var Vpt=S(E(),1);function wqr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Vpt.jsx)(Tqr,{url:t}):(0,Vpt.jsx)(Zq,{items:e.metadata??[]})}function Cqr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function tj(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue",editable:t==="github-issue-edit",closeOnly:t==="show"}}function kqr(e,t){return e?`${e}:${t??"pr"}`:void 0}function p3e(e,t,r,n){return{...tj(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:kqr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function _qr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&bu(t,e,ICe({quote:r,note:o})),n()}}function Eqr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&bu(t,e,Dy(r,Lme(o))),n()}}function h3e(e,t,r,n){return{onCite:Eqr(e,t,r,n),onAddRule:_qr(e,t,r,n)}}function Rqr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var Bqr=S(oe(),1);var ZC=S(oe(),1);var Pqr="assist:pr-preview-comments:",Wpt=e=>`${Pqr}${e}`;function Gpt(e){return ll(Wpt(e))}function Qae(e,t){Rl(Wpt(e),t)}function m3e(e){Lv(Wpt(e))}function Aqr(){Dx(Pqr)}function Lqr(e){let t=a6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function Ezo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function Iqr(e,t){return e.flatMap(r=>{let n=Ezo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function Dqr(e,t,r){let n=Gpt(e);if(n.length>0||!t||!r)return n;let o=Iqr(Gpt(t),Lqr(r));return Qae(e,o),m3e(t),o}function Mqr(e,t,r){let[n,o]=(0,ZC.useState)([]),i=(0,ZC.useRef)(0);(0,ZC.useEffect)(()=>{Aqr(),o(Dqr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,ZC.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return Qae(e,d),d})},[e]),s=(0,ZC.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return Qae(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function Nqr(e,t){let r=e.map((i,a)=>RW(a).solid),n=RW(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:RW(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function Oqr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function $qr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Lx(),{comments:d,add:f,remove:p}=Mqr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,Bqr.useMemo)(()=>Nqr(d,i),[d,i]),{onAdd:y,onCollapse:v}=Oqr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var y3e=S(oe(),1);var qpt="assist:preview-screenshots:",jpt=e=>`${qpt}${e}`,g3e=e=>`${qpt}seeded:${e}`;function Fqr(e){return e?(Dx(qpt),ll(jpt(e)).filter(t=>typeof t.path=="string")):[]}function FM(e,t){e&&Rl(jpt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function zqr(e){e&&(Lv(jpt(e)),Lv(g3e(e)))}var zM=S(oe(),1);var Hqr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function Rzo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(Hqr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function Uqr(e){return e.map(t=>({...t,contentType:Rzo(t.path),seeded:!0}))}function Vqr(e,t,r){if(!e)return Uqr(r);let n=Fqr(e);if(ll(g3e(e))[0]===t)return n;let o=[...Uqr(r),...n.filter(i=>!i.seeded)];return FM(e,o),Rl(g3e(e),[t]),o}function Wqr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),nT(`/api/pr-preview/image?${r}`)}function Gqr(e,t,r){let[n,o]=(0,zM.useState)([]),i=(0,zM.useRef)(0),a=hr(),s=(0,zM.useRef)(r);return s.current=r,(0,zM.useEffect)(()=>{o(Vqr(e,t,s.current).map(l=>({...l,url:Wqr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var qqr=S(oe(),1);function jqr(e,t){return(0,qqr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return FM(e,i),i})},[e,t])}function Yqr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=Gqr(e,t,r),a=(0,y3e.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return FM(e,p),p})},[e,o,i]),s=(0,y3e.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return FM(e,h),h})},[e,o]),l=jqr(e,o),u=(0,y3e.useCallback)(()=>zqr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var rj=S(oe(),1);async function Kqr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Wt(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var Jqr=S(oe(),1);function Xqr(e){return e.startsWith("image/")||e.startsWith("video/")}function Zqr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&Xqr(t.type)){let r=t.getAsFile();if(r)return r}return null}function Qqr(e){return e?Array.from(e.files).find(t=>Xqr(t.type))??null:null}function ejr(e,t){return(0,Jqr.useEffect)(()=>{if(!t)return;let o=i=>{let a=Zqr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=Qqr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function tjr(e,t,r){let[n,o]=(0,rj.useState)([]),i=(0,rj.useRef)(0),a=hr(),s=(0,rj.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await Kqr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=ejr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function rjr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=Yqr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=tjr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var djr=S(oe(),1);var njr="assist:pr-preview-chain:",Ypt=e=>`${njr}${e}`;function ojr(e){if(e)return ll(Ypt(e))[0]}function ijr(e,t){e&&Rl(Ypt(e),[t])}function ajr(e){e&&Lv(Ypt(e))}function sjr(){Dx(njr)}function ljr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};sjr();let n=ojr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function cjr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function ujr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function fjr(e,t,r,n,o,i,a){let[s,l]=(0,djr.useState)(()=>ljr(n,t,o));return{chain:s,setChain:f=>{l(f),ijr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...cjr(m,p,s,m?i.attachments():[],a()),...ujr(m,h)}),m3e(e),m&&(ajr(t),i.clearPersisted())}}}var Tjr=S(oe(),1);var Pzo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Azo=/^ {0,3}#{1,6}[ \t]/;function T3(e){let t=e.split(`
|
|
4128
|
+
`),additions:IWr(o,"+"),deletions:IWr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function MWr(e){return e.flatMap(t=>{if(t.kind==="dir")return MWr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function jFo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function NWr(e,t,r=new Set,n=new Set){let o=MWr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=jFo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Wq));return RWr(o.filter(u=>l.has(u.path)).map(u=>DWr(u,s+1,i)))})}function YFo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Wq(s)===e).length;a>n&&(r=i,n=a)}),r}function OWr(e,t){let r=t.map(()=>[]);for(let n of e)r[YFo(n.path,t)]?.push(n);return r}function BWr(e,t){let r=NWr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=OWr(e.tests,t),o=RRe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function $Wr(e){if(!e.slices)return;let t=BWr(e,e.slices);return{entries:xWr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function FWr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var Mpt="assist:high-level-progress:",KFo=`${Mpt}head:`,XFo=720*60*60*1e3,Uae=e=>`${Mpt}${e}`,Npt=e=>`${KFo}${e}`,Dpt=e=>ll(e)[0];function ZFo(e,t){let r=e?Dpt(Uae(e)):void 0;return e&&Lv(Uae(e)),r??(t?Dpt(Npt(t)):void 0)}function zWr(e,t,r){return Dx(Mpt,XFo),Dpt(Uae(e))??ZFo(t,r)}function HWr(e,t,r){Rl(Uae(e),[r]),t&&Rl(Npt(t),[r])}function UWr(e,t){Lv(Uae(e)),t&&Lv(Npt(t))}function VWr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function IM(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Jq={repo:"",prNumber:0,headSha:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function WWr(e){let t;try{t=JSON.parse(e)}catch{return Jq}return typeof t!="object"||t===null?Jq:{repo:typeof t.repo=="string"?t.repo:Jq.repo,prNumber:typeof t.prNumber=="number"?t.prNumber:Jq.prNumber,headSha:typeof t.headSha=="string"?t.headSha:Jq.headSha,checks:IM(t.checks,VWr),structure:{...Jq.structure,...t.structure},criticalDiffs:IM(t.criticalDiffs),criticalPaths:IM(t.criticalPaths),tests:IM(t.tests),testPaths:IM(t.testPaths),collapsedPaths:IM(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function GWr(e){let t=(0,XRe.useMemo)(()=>WWr(e.body),[e.body]),r=(0,XRe.useMemo)(()=>$Wr(t),[t]),n=FWr(t),o=(0,XRe.useMemo)(()=>zWr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var qWr=S(oe(),1);function jWr(e){let[t,r]=(0,qWr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var YWr=S(oe(),1);function KWr(e,t,r,n){(0,YWr.useEffect)(()=>{HWr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function ZWr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=GWr(e),s=bWr(n.checks,i,o?.slicing),l=jWr(i),u=cWr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=cRe(t,r),h={...d,onQueue:l.onQueue};KWr(e.requestId,a,s.items,l.queued);let m=(0,XWr.useMemo)(()=>hWr(n),[n]);return{payload:n,checklist:s,queue:l,details:pWr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var yS=S(E(),1);function QWr({preview:e,session:t,sendInput:r,onDecision:n}){let o=ZWr(e,t,r);return(0,yS.jsxs)(H,{sx:Xy,children:[(0,yS.jsx)(Th,{preview:e,draft:!1}),(0,yS.jsx)(Zq,{items:e.metadata??[]}),(0,yS.jsx)(Gn,{}),(0,yS.jsx)(YVr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,yS.jsx)(Gn,{}),(0,yS.jsx)(sWr,{pane:o,onDecision:(i,a)=>{UWr(e.requestId,o.head),n(i,a)}}),(0,yS.jsx)(Iy,{sessionName:o.sentTo,onClose:o.clearSent})]})}var aGr=S(oe(),1);var DM=S(E(),1);function QFo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function JWr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,DM.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,DM.jsx)(Se,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:QFo(e)}),(0,DM.jsx)(it,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,DM.jsx)(it,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,DM.jsx)(it,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var JFo={"top-left":ec.miro.topLeft,"bottom-right":ec.miro.bottomRight};function eGr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?JFo[t]:ec.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var Vae=S(E(),1);function tGr({box:e,role:t,onSelect:r}){let n=eGr(e,t);return(0,Vae.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,Vae.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,Vae.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ec.miro.text,children:e.text})]})}function rGr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var ZRe=S(E(),1);function nGr({boxes:e,selection:t}){return(0,ZRe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,ZRe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:rGr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,ZRe.jsx)(tGr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function ezo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function oGr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(ezo):[]}catch{return[]}}var Opt=S(oe(),1);function iGr(){let[e,t]=(0,Opt.useState)(null),[r,n]=(0,Opt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var y3=S(E(),1);function sGr({preview:e,onDecision:t}){let r=(0,aGr.useMemo)(()=>oGr(e.body),[e.body]),n=iGr();return(0,y3.jsxs)(H,{sx:Xy,children:[(0,y3.jsx)(Th,{preview:e,draft:!1}),(0,y3.jsx)(Gn,{}),(0,y3.jsx)(nGr,{boxes:r,selection:n}),(0,y3.jsx)(Gn,{}),(0,y3.jsx)(JWr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",zc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",zc())})]})}var $Gr=S(oe(),1);function lGr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function QRe(e){return e*22}function cGr(e){return Math.round(e/22)}var uGr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},dGr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},fGr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},pGr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Bpt={p:.25,mt:"2px"},hGr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var gGr=S(E(),1),tzo=8;function mGr({drag:e}){return e?(0,gGr.jsx)(H,{sx:hGr,style:{top:e.top-1,left:tzo+QRe(e.depth)}}):null}var yGr=S(E(),1),vGr=ot((0,yGr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var $pt=S(E(),1);function bGr({number:e,onGrip:t}){return(0,$pt.jsx)(Ht,{size:"small",className:"criterion-action",sx:dGr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,$pt.jsx)(vGr,{fontSize:"inherit"})})}var YC=S(E(),1);function xGr({number:e,onAdd:t,onDelete:r}){return(0,YC.jsxs)(YC.Fragment,{children:[(0,YC.jsx)(Ht,{size:"small",className:"criterion-action",sx:Bpt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,YC.jsx)(qd,{fontSize:"inherit"})}),(0,YC.jsx)(Ht,{size:"small",className:"criterion-action",sx:Bpt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,YC.jsx)(Bo,{fontSize:"inherit"})})]})}var JRe=S(oe(),1);function SGr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function TGr(e){let t=(0,JRe.useRef)(null);return(0,JRe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=SGr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var MM=S(E(),1);function wGr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=TGr(n.focus?.index===e?n.focus:null),s={marginLeft:QRe(r.depth),opacity:o?.4:1};return(0,MM.jsxs)(H,{sx:uGr,"data-criterion-row":!0,style:s,children:[(0,MM.jsx)(bGr,{number:t,onGrip:i}),(0,MM.jsx)(H,{component:"span",sx:fGr,"aria-hidden":"true",children:`${t}.`}),(0,MM.jsx)($i,{multiline:!0,value:r.text,sx:pGr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,MM.jsx)(xGr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var AGr=S(oe(),1);function CGr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function v3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function e3e(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:v3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function Zm(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function t3e(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function kGr(e,t){let r=Zm(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function _Gr(e,t,r){let n=r<0?t3e(e,t):kGr(e,t);if(n<0)return null;let o=Zm(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:Zm(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function r3e(e,t){let r=Zm(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:v3(n),index:Math.max(0,t-1)}}function EGr(e,t,r){if(r<0&&e[t].depth===0||r>0&&t3e(e,t)<0)return null;let n=Zm(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function n3e(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function rzo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return n3e(e3e(e,t,o,n.slice(r)),"start")}function nzo(e,t,{shift:r,caret:n}){let o=EGr(e,t,r?-1:1);return n3e(o?{items:o,index:t}:null,n)}function RGr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?rzo(e,t,r):n==="Tab"?nzo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?n3e(_Gr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?n3e(r3e(e,t),"end"):null}function PGr(e,t,r){return RGr(e,t,r)??CGr(e,t,r)}function LGr(e,t){let[r,n]=(0,AGr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=PGr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(e3e(e,a,e[a].text,""),"start"),onDelete:a=>o(r3e(e,a),"end")}}var OGr=S(oe(),1);function ozo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=Zm(t,r);return o>r&&o<i?r:o}function izo(e,t,r,n){let o=Zm(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+cGr(n),s))}function azo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function IGr(e,t,r,n,o){let i=ozo(e,t,r,o);return{target:i,depth:izo(t,r,i,n),top:azo(e,i)}}function szo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function DGr(e,t,r,n){return o=>{let{boxes:i,origin:a}=szo(t);return IGr(i,e,r,o.clientX-n,o.clientY-a)}}function MGr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function NGr(e,t,r,n){let o=Zm(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:v3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function BGr(e,t,r){let[n,o]=(0,OGr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),MGr(s.currentTarget,s.pointerId,DGr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(NGr(e,a,d.target,d.depth))})(s)}}}var Wae=S(E(),1),lzo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},czo=[{text:"",depth:0}];function FGr({items:e,onChange:t}){let r=(0,$Gr.useRef)(null),n=e.length>0?e:czo,o=LGr(n,t),{drag:i,onGrip:a}=BGr(n,r,o.onDrop),s=lGr(n.map(l=>l.depth));return(0,Wae.jsxs)(H,{sx:lzo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,Wae.jsx)(wGr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,Wae.jsx)(mGr,{drag:i})]})}var zGr=S(E(),1),HGr=ot((0,zGr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var Gae=S(E(),1),uzo={insert:"Add acceptance criteria",convert:"Convert to outline"};function UGr({kind:e,onClick:t}){return(0,Gae.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,Gae.jsx)(it,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,Gae.jsx)(qd,{}):(0,Gae.jsx)(HGr,{}),onClick:t,children:uzo[e]})})}var qae=S(oe(),1);function VGr(e,t,{color:r,pin:n}){let o=a6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>dzo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function dzo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function WGr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function GGr(e,t){for(let r of t){let n=CIt(e,r);n&&VGr(e,n,r)}}var jae=S(E(),1);function qGr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,qae.useMemo)(()=>cD(e),[e]),a=(0,qae.useMemo)(()=>cD(r??""),[r]);return(0,qae.useLayoutEffect)(()=>{let s=o.current;s&&(WGr(s),GGr(s,n))},[i,a,n,o]),(0,jae.jsxs)(H,{ref:o,children:[(0,jae.jsx)(aD,{segments:i,skipDiagramText:!0}),t,t?(0,jae.jsx)(aD,{segments:a,skipDiagramText:!0}):null]})}var NM=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function o3e(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[NM("")]:{lineHeight:1.6},[NM("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[NM("ul, ol")]:{pl:2.5,mb:2},[NM("li")]:{mb:"6px"},[NM("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[NM("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[NM("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var jGr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...n$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...o3e(e)});var ej=S(E(),1);function YGr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,ej.jsxs)(H,{ref:o,onMouseDown:l,sx:jGr,children:[(0,ej.jsx)(qGr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,ej.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,ej.jsx)(jB,{rects:a,color:s})]})}function KGr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var i3e=S(oe(),1),XGr=S(E(),1);function Fpt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,i3e.useState)(t);return(0,i3e.useEffect)(()=>i(t),[t]),(0,XGr.jsx)(Yn,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var Yae=S(E(),1),zpt="screenshot-groups";function fzo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function ZGr({screenshot:e,onUpdate:t}){return(0,Yae.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,Yae.jsx)(Fpt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||fzo(e.path)})}),(0,Yae.jsx)(Fpt,{label:"Group",value:e.group??"",listId:zpt,onCommit:r=>t(e.id,{group:r})})]})}var b3=S(E(),1),QGr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},pzo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function JGr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,b3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,b3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:QGr}):(0,b3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:QGr}),(0,b3.jsx)(Ht,{size:"small","aria-label":"Remove screenshot",sx:pzo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,b3.jsx)(Bo,{fontSize:"small"})}),(0,b3.jsx)(ZGr,{screenshot:e,onUpdate:r})]})}var o0=S(E(),1);function hzo(){return(0,o0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,o0.jsx)(oo,{size:16}),(0,o0.jsx)(Se,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function mzo({error:e}){return(0,o0.jsx)(Se,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function eqr({uploads:e,empty:t}){return e.length>0?(0,o0.jsx)(o0.Fragment,{children:e.map(r=>r.error?(0,o0.jsx)(mzo,{error:r.error},r.id):(0,o0.jsx)(hzo,{},r.id))}):t?(0,o0.jsx)(Se,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var i0=S(E(),1),gzo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function tqr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=KGr(e),a=s=>(0,i0.jsx)(JGr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,i0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,i0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,i0.jsx)("datalist",{id:zpt,children:o.map(([s])=>(0,i0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,i0.jsxs)(H,{sx:{mb:2},children:[(0,i0.jsx)(H,{component:"h3",children:s}),(0,i0.jsx)(H,{sx:gzo,children:l.map(a)})]},s)),(0,i0.jsxs)(St,{spacing:1,children:[i.map(a),(0,i0.jsx)(eqr,{uploads:t,empty:e.length===0})]})]})}var Kae=S(E(),1);function yzo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,Kae.jsx)(FGr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,Kae.jsx)(UGr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function a3e({pane:e,screenshots:t}){return(0,Kae.jsx)(YGr,{...yzo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,Kae.jsx)(tqr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var rqr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),nqr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},oqr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),iqr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var KC=S(E(),1);function aqr({comments:e,colors:t,onRemove:r}){return(0,KC.jsxs)(H,{sx:rqr,children:[(0,KC.jsxs)(Se,{sx:nqr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,KC.jsxs)(H,{sx:oqr,children:[(0,KC.jsx)(VB,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,KC.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,KC.jsx)(Ht,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:iqr,children:(0,KC.jsx)(Bo,{})})]},n.id))]})}var lqr=S(E(),1);function sqr(e){return e.comments.length===0?null:(0,lqr.jsx)(aqr,{...e})}var cqr=S(E(),1),s3e=ot((0,cqr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var mqr=S(oe(),1);var uqr=S(E(),1),dqr=ot((0,uqr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var a0="0.1148.2";var vzo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function fqr(e){return e?vzo[e]:"success.main"}function pqr(e){return e.split("-")[0].split(".").map(Number)}function hqr(e,t){if(!e||!t||e===t)return;let r=pqr(e),n=pqr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var l3e=S(oe(),1),Hpt=(0,l3e.createContext)(null);function c3e(){return(0,l3e.useContext)(Hpt)}var OM=S(E(),1),bzo={height:16,fontSize:10},xzo={opacity:.6,fontSize:"0.85em"};function Szo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function x3({nodes:e,name:t,showVersion:r=!1}){let n=c3e()??a0,o=e.links.find(a=>a.name===t),i=hqr(o?.peerVersion,n);return(0,OM.jsx)(pr,{title:Szo(e,t),placement:"right",children:(0,OM.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,OM.jsx)(dqr,{sx:{fontSize:8,color:fqr(o?.state)}}),t,r&&o?.peerVersion&&(0,OM.jsxs)(H,{component:"span",sx:xzo,children:["v",o.peerVersion]}),i&&(0,OM.jsx)(xn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:bzo})]})})}var s0=S(E(),1),Tzo={textTransform:"none"};function u3e({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,mqr.useState)(null);return(0,s0.jsxs)(s0.Fragment,{children:[(0,s0.jsx)(it,{size:"small",color:"inherit",startIcon:(0,s0.jsx)(s3e,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Tzo,children:(0,s0.jsx)(x3,{nodes:e,name:r.node})}),(0,s0.jsx)(ci,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,s0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,s0.jsx)(Uu,{primary:(0,s0.jsx)(x3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var gqr=S(oe(),1);function wzo(e,t){return e?.toLowerCase()===t.toLowerCase()}function d3e(e,t){let{nodes:r,names:n,visible:o}=us(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=Ln(),[d,f]=(0,gqr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>wzo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var S3=S(E(),1);function yqr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Rhe(),a=d3e(r,t);return(0,S3.jsxs)(S3.Fragment,{children:[(0,S3.jsx)(it,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,S3.jsx)(u3e,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,S3.jsx)(it,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Upt=S(E(),1),Czo={"& .MuiFormControlLabel-label":{fontSize:12}};function Xae({label:e,title:t,checked:r,onChange:n}){return(0,Upt.jsx)(Nd,{control:(0,Upt.jsx)(Ep,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Czo})}var BM=S(E(),1);function f3e({chain:e,newPr:t,onChange:r}){return(0,BM.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,BM.jsx)(Xae,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,BM.jsx)(Xae,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,BM.jsx)(Xae,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,BM.jsx)(Xae,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var $M=S(E(),1);function vqr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,$M.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,$M.jsx)(f3e,{chain:t,newPr:r,onChange:i}),(0,$M.jsx)(it,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,$M.jsxs)(it,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,$M.jsx)(yqr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var xqr=S(E(),1);function bqr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,xqr.jsx)(vqr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var XC=S(E(),1);function Sqr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,XC.jsxs)(XC.Fragment,{children:[(0,XC.jsx)(sqr,{comments:t,colors:r,onRemove:d}),(0,XC.jsx)(Gn,{}),(0,XC.jsx)(bqr,{...e}),(0,XC.jsx)(Wme,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var Zae=S(E(),1),kzo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},_zo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Tqr({url:e}){return(0,Zae.jsxs)(H,{sx:kzo,children:[(0,Zae.jsx)(it,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,Zae.jsx)(Se,{variant:"body2",sx:_zo,title:e,children:e})]})}var Vpt=S(E(),1);function wqr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Vpt.jsx)(Tqr,{url:t}):(0,Vpt.jsx)(Zq,{items:e.metadata??[]})}function Cqr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function tj(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue",editable:t==="github-issue-edit",closeOnly:t==="show"}}function kqr(e,t){return e?`${e}:${t??"pr"}`:void 0}function p3e(e,t,r,n){return{...tj(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:kqr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function _qr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&bu(t,e,ICe({quote:r,note:o})),n()}}function Eqr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&bu(t,e,Dy(r,Lme(o))),n()}}function h3e(e,t,r,n){return{onCite:Eqr(e,t,r,n),onAddRule:_qr(e,t,r,n)}}function Rqr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var Bqr=S(oe(),1);var ZC=S(oe(),1);var Pqr="assist:pr-preview-comments:",Wpt=e=>`${Pqr}${e}`;function Gpt(e){return ll(Wpt(e))}function Qae(e,t){Rl(Wpt(e),t)}function m3e(e){Lv(Wpt(e))}function Aqr(){Dx(Pqr)}function Lqr(e){let t=a6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function Ezo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function Iqr(e,t){return e.flatMap(r=>{let n=Ezo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function Dqr(e,t,r){let n=Gpt(e);if(n.length>0||!t||!r)return n;let o=Iqr(Gpt(t),Lqr(r));return Qae(e,o),m3e(t),o}function Mqr(e,t,r){let[n,o]=(0,ZC.useState)([]),i=(0,ZC.useRef)(0);(0,ZC.useEffect)(()=>{Aqr(),o(Dqr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,ZC.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return Qae(e,d),d})},[e]),s=(0,ZC.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return Qae(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function Nqr(e,t){let r=e.map((i,a)=>RW(a).solid),n=RW(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:RW(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function Oqr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function $qr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Lx(),{comments:d,add:f,remove:p}=Mqr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,Bqr.useMemo)(()=>Nqr(d,i),[d,i]),{onAdd:y,onCollapse:v}=Oqr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var y3e=S(oe(),1);var qpt="assist:preview-screenshots:",jpt=e=>`${qpt}${e}`,g3e=e=>`${qpt}seeded:${e}`;function Fqr(e){return e?(Dx(qpt),ll(jpt(e)).filter(t=>typeof t.path=="string")):[]}function FM(e,t){e&&Rl(jpt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function zqr(e){e&&(Lv(jpt(e)),Lv(g3e(e)))}var zM=S(oe(),1);var Hqr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function Rzo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(Hqr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function Uqr(e){return e.map(t=>({...t,contentType:Rzo(t.path),seeded:!0}))}function Vqr(e,t,r){if(!e)return Uqr(r);let n=Fqr(e);if(ll(g3e(e))[0]===t)return n;let o=[...Uqr(r),...n.filter(i=>!i.seeded)];return FM(e,o),Rl(g3e(e),[t]),o}function Wqr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),nT(`/api/pr-preview/image?${r}`)}function Gqr(e,t,r){let[n,o]=(0,zM.useState)([]),i=(0,zM.useRef)(0),a=hr(),s=(0,zM.useRef)(r);return s.current=r,(0,zM.useEffect)(()=>{o(Vqr(e,t,s.current).map(l=>({...l,url:Wqr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var qqr=S(oe(),1);function jqr(e,t){return(0,qqr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return FM(e,i),i})},[e,t])}function Yqr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=Gqr(e,t,r),a=(0,y3e.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return FM(e,p),p})},[e,o,i]),s=(0,y3e.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return FM(e,h),h})},[e,o]),l=jqr(e,o),u=(0,y3e.useCallback)(()=>zqr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var rj=S(oe(),1);async function Kqr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Wt(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var Jqr=S(oe(),1);function Xqr(e){return e.startsWith("image/")||e.startsWith("video/")}function Zqr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&Xqr(t.type)){let r=t.getAsFile();if(r)return r}return null}function Qqr(e){return e?Array.from(e.files).find(t=>Xqr(t.type))??null:null}function ejr(e,t){return(0,Jqr.useEffect)(()=>{if(!t)return;let o=i=>{let a=Zqr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=Qqr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function tjr(e,t,r){let[n,o]=(0,rj.useState)([]),i=(0,rj.useRef)(0),a=hr(),s=(0,rj.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await Kqr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=ejr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function rjr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=Yqr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=tjr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var djr=S(oe(),1);var njr="assist:pr-preview-chain:",Ypt=e=>`${njr}${e}`;function ojr(e){if(e)return ll(Ypt(e))[0]}function ijr(e,t){e&&Rl(Ypt(e),[t])}function ajr(e){e&&Lv(Ypt(e))}function sjr(){Dx(njr)}function ljr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};sjr();let n=ojr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function cjr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function ujr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function fjr(e,t,r,n,o,i,a){let[s,l]=(0,djr.useState)(()=>ljr(n,t,o));return{chain:s,setChain:f=>{l(f),ijr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...cjr(m,p,s,m?i.attachments():[],a()),...ujr(m,h)}),m3e(e),m&&(ajr(t),i.clearPersisted())}}}var Tjr=S(oe(),1);var Pzo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Azo=/^ {0,3}#{1,6}[ \t]/;function T3(e){let t=e.split(`
|
|
4129
4129
|
`),r=t.findIndex(a=>Pzo.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!Azo.test(t[n]);)n+=1;let o=r+1;for(;o<n&&t[o].trim()==="";)o+=1;let i=n;for(;i>o&&t[i-1].trim()==="";)i-=1;return o===n&&(o=r+1,i=r+1),{before:t.slice(0,o),lines:t.slice(o,i),after:t.slice(i)}}function v3e(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function b3e(e){let t=[];return e.map(r=>{for(;t.length>0&&r<t[t.length-1];)t.pop();return(t.length===0||r>t[t.length-1])&&t.push(r),t.length-1})}var Lzo=" ";function Izo({text:e,depth:t}){let r=`${Lzo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function x3e(e,t){let r=T3(e);return r?[...r.before,...t.map(Izo),...r.after].join(`
|
|
4130
4130
|
`):e}var Dzo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,Mzo=/^\[[ xX]\][ \t]*/;function Nzo(e){return e.slice(0,e.length-e.trimStart().length)}function pjr(e){let t=T3(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=Dzo.exec(o);return{width:v3e(i?i[1]:Nzo(o)),text:(i?i[2]??"":o.trim()).replace(Mzo,"")}}),n=b3e(r.map(o=>o.width));return x3e(e,v3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var hjr=`## Acceptance criteria
|
|
4131
4131
|
|