@cotal-ai/web 0.164.2 → 0.164.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,B as n,C as r,G as i,Gt as a,Ht as o,I as s,Ir as c,J as l,K as u,L as d,M as ee,Pr as f,S as p,Sr as m,T as h,U as g,Vt as _,W as v,Wt as y,Xn as b,Y as te,Zt as ne,_ as x,a as S,at as C,b as w,br as re,bt as T,c as ie,cn as E,d as D,dr as ae,dt as oe,en as se,fn as O,ft as ce,g as le,gr as k,h as ue,i as de,in as A,ir as fe,it as pe,jr as me,l as j,ln as he,lt as ge,m as _e,mt as ve,nt as ye,o as M,pt as N,q as P,r as be,rn as xe,s as Se,st as Ce,tn as we,tr as F,u as Te,un as I,ur as Ee,v as L,w as De,wr as Oe,x as R,xt as z,y as B,yr as ke}from"./controller-S0XMj89g.js";var Ae=[[`path`,{d:`M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],V=[[`path`,{d:`M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.5 12.5H15.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],H=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],U=e(c(),1),W=b();function G({icon:e,title:t,children:n,action:r}){return(0,W.jsxs)(g,{children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(P,{variant:`icon`,children:(0,W.jsx)(z,{icon:e})}),(0,W.jsx)(l,{children:t}),n&&(0,W.jsx)(i,{children:n})]}),r&&(0,W.jsx)(v,{children:r})]})}var K=e=>Number.isFinite(e.ts)?e.ts:-1/0;function je(e){let t=new Map;for(let{msg:n}of e){let e=typeof n.channel==`string`?n.channel:void 0,r=e===void 0&&typeof n.to==`string`?n.to:void 0;if(e===void 0&&r===void 0)continue;let i=e===void 0?`dm:${r}`:`channel:${e}`,a=t.get(i);a||t.set(i,a={key:i,...e===void 0?{to:r}:{channel:e},rows:[]}),a.rows.push(n)}let n=[...t.values()];for(let e of n)e.rows.sort((e,t)=>K(t)-K(e));return n.sort((e,t)=>K(t.rows[0])-K(e.rows[0]))}function q({msg:e,row:t,place:n,href:r,label:i}){let a=s();return(0,W.jsxs)(`div`,{className:`ui-msg ox-msg`,"data-post":e.id,children:[(0,W.jsx)(`div`,{className:`ui-gut`,children:(0,W.jsx)(d,{vendor:t.harness,status:t.status,size:34,dot:!1,badge:a(t.id)})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`ui-mh`,children:[(0,W.jsx)(`b`,{children:t.name}),(0,W.jsx)(T,{variant:`secondary`,children:n}),(0,W.jsx)(S,{ts:e.ts}),(0,W.jsx)(`span`,{className:`ui-sp`}),(0,W.jsxs)(`a`,{className:`ox-act`,href:r,children:[i,(0,W.jsx)(z,{icon:he,size:16})]})]}),(0,W.jsx)(M,{className:`ui-tx`,src:Oe(e.parts)})]})]})}function Me({groups:e,row:t,nameOf:n}){return(0,W.jsxs)(`div`,{className:`ox-msgs`,children:[e.length===0&&(0,W.jsx)(G,{icon:E,title:`No messages from ${t.name} on this page yet`}),e.map(e=>{let i=e.rows.length;if(e.channel!==void 0){let n=e.channel,a=k({view:`channel`,channel:n});return(0,W.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,W.jsxs)(R,{className:`ox-marker`,children:[(0,W.jsx)(r,{children:(0,W.jsx)(z,{icon:A,size:16})}),(0,W.jsxs)(p,{children:[(0,W.jsx)(`b`,{children:`#${n}`}),` · ${i===1?`1 post`:`${i} posts`}`]})]}),e.rows.map(e=>(0,W.jsx)(q,{msg:e,row:t,place:`in #${n}`,href:a,label:`Open in #${n}`},e.id))]},e.key)}let a=e.to??``,o=n(a),s=k({view:`dm`,peer:t.id,with:a});return(0,W.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,W.jsxs)(R,{className:`ox-marker`,children:[(0,W.jsx)(r,{children:(0,W.jsx)(z,{icon:E,size:16})}),(0,W.jsxs)(p,{children:[(0,W.jsx)(`b`,{children:`Direct messages`}),` · ${i} with ${o}`]})]}),e.rows.map(e=>(0,W.jsx)(q,{msg:e,row:t,place:`to ${o}`,href:s,label:`Open conversation`},e.id))]},e.key)}),(0,W.jsx)(`p`,{className:`ox-msgs-more`,children:`Older messages are in each channel's history.`})]})}var J=1e3,Y={on:`Published. Tool inputs and results appear when payload access is permitted.`,off:`Not published`};function Ne({store:e,id:t,clock:r=Date.now}){let i=F(e,e=>e.roster),a=F(e,e=>e.channels),o=F(e,e=>e.membership),c=F(e,e=>e.activity),[,l]=(0,U.useReducer)(e=>e+1,0);(0,U.useEffect)(()=>{let e=setInterval(l,J);return()=>clearInterval(e)},[]);let u=s(),p=i.find(e=>e.card.id===t),h=(0,U.useMemo)(()=>p?te(t,o,a.map(e=>e.channel),c,p.channelModes):{channels:[],wide:!1},[p,t,o,a,c]);if(!p)return(0,W.jsx)(`p`,{className:`ui-nr`,children:`Not on the roster`});let g=fe([p],{includeOffline:!0})[0],_=typeof g.statusSince==`number`&&Number.isFinite(g.statusSince)?`Reported ${m(new Date(g.statusSince))}`:void 0,v=(p.card.skills??[]).map(e=>e.name).filter(e=>typeof e==`string`&&e!==``);return(0,W.jsxs)(`div`,{className:`ox-profile`,children:[(0,W.jsx)(`div`,{className:`ui-big`,children:(0,W.jsx)(d,{vendor:g.harness,status:g.status,size:88,dot:!1,badge:u(g.id)})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`ui-sline`,children:[(0,W.jsx)(n,{row:g}),(0,W.jsx)(`span`,{style:{color:`var(--ink)`},children:g.activity||`No current activity`}),_&&(0,W.jsx)(`small`,{children:_}),B(g,r())&&(0,W.jsx)(`small`,{className:`ui-facts`,children:B(g,r())})]}),(0,W.jsxs)(`div`,{className:`ui-actions`,children:[(0,W.jsx)(C,{icon:V,command:`cotal attach --name ${f(g.name)}`}),(0,W.jsx)(C,{icon:H,command:`cotal stop --name ${f(g.name)}`})]}),(0,W.jsxs)(`dl`,{className:`ui-kv`,children:[g.harness&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Harness`}),(0,W.jsx)(`dd`,{children:ee(g.harness)})]}),(0,W.jsx)(`dt`,{children:`Model`}),g.model?(0,W.jsx)(`dd`,{className:`ui-mono`,style:{fontSize:12.5},children:g.model}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),g.host&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Host`}),(0,W.jsx)(`dd`,{children:g.host})]}),(g.attention===`dnd`||g.attention===`focus`)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Attention`}),(0,W.jsx)(`dd`,{children:(0,W.jsx)(x,{attention:g.attention})})]}),(0,W.jsx)(`dt`,{children:`Heartbeat`}),Number.isFinite(g.ts)?(0,W.jsxs)(`dd`,{className:`ui-num`,children:[w(r()-g.ts),` ago`]}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),(0,W.jsx)(`dt`,{children:`Work events`}),g.events?(0,W.jsx)(`dd`,{children:Y[g.events]}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`})]}),(h.wide||h.channels.length>0)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h5`,{children:`Channels`}),h.wide&&(0,W.jsxs)(`div`,{className:`ui-chrow`,children:[(0,W.jsx)(`span`,{children:`Reads every channel`}),(0,W.jsx)(`span`,{})]}),h.channels.map(e=>(0,W.jsxs)(`div`,{className:`ui-chrow`,children:[(0,W.jsx)(`span`,{children:`#${e.channel}`}),(0,W.jsx)(`span`,{children:e.mode??``})]},e.channel))]}),v.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h5`,{style:{marginTop:10},children:`Skills`}),(0,W.jsx)(`div`,{className:`ui-tags`,children:v.map(e=>(0,W.jsx)(T,{variant:`secondary`,children:e},e))})]})]})]})}var Pe=24,Fe=[];function Ie(e){return e.items.flatMap(e=>e.kind===`turn`?[e,...e.steps]:[e]).flatMap(e=>[{key:e.key,live:e.live,...e.kind===`post`?{post:e.msg.id}:{}},...e.kind===`tools`?e.calls.slice(1).map(e=>({key:e.key,live:e.live})):[]])}function Le(){let e=e=>(0,W.jsx)(a,{className:`h-2.5`,style:{width:e}});return(0,W.jsx)(`div`,{className:`ox-col`,"aria-busy":`true`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-hidden":`true`,children:[e(`36%`),e(`88%`),e(`64%`),e(`42%`),e(`30%`),e(`76%`)]})})}function Re({steps:e,away:t}){let{end:n}=ve(),{scrollToEnd:r}=N(),[i,a]=(0,U.useState)(null),o=n||t;o&&i===null&&a(new Set(e.map(e=>e.key))),!o&&i!==null&&a(null);let s=i?e.filter(e=>e.live&&!i.has(e.key)).length:0;return s===0?null:(0,W.jsxs)(O,{type:`button`,variant:`outline`,size:`sm`,className:`ox-newsteps`,"data-active":`true`,onClick:()=>r({behavior:L()?`auto`:`smooth`}),children:[(0,W.jsx)(z,{icon:I,"data-icon":`inline-start`}),s===1?`1 new step`:`${s} new steps`]})}function X({store:e,controller:r,id:i,tab:a,at:c,back:l,phone:u=!1,panelOpen:f=!1,onTogglePanel:m}){le(r,i);let g=(0,U.useContext)(be),v=F(e,e=>e.roster),b=F(e,e=>e.operatorId),te=F(e,e=>e.post),x=F(e,e=>e.sessions[i]),S=(0,U.useMemo)(()=>ae(v),[v]),w=v.find(e=>e.card.id===i),T=(0,U.useMemo)(()=>w?fe([w],{includeOffline:!0})[0]:void 0,[w]),E=T?.name??Ee(i,S,b),A=T??{id:i,name:E,status:`offline`,ts:NaN},he=(0,U.useMemo)(()=>_e(w),[w]),ve=s(),M=x?.frames??Fe,N=ue(e,i),P=(0,U.useMemo)(()=>re(M,N),[M,N]),I=(0,U.useMemo)(()=>Ie(P),[P]),L=(0,U.useMemo)(()=>je(N),[N]),Oe=L.reduce((e,t)=>e+t.rows.length,0),B=(0,U.useMemo)(()=>e=>Ee(e,S,b),[S,b]),V=(0,U.useMemo)(()=>({kind:`dm`,to:i}),[i]),H=[T?.role,T?.harness&&ee(T.harness)].filter(Boolean).join(` · `),K=T?.events,q=x?.load??`loading`,[J,Y]=(0,U.useState)(!0);a!==`work`&&!J&&Y(!0);let X=(0,U.useRef)(null),ze=()=>X.current,Be=()=>{let e=ze();!J&&e&&e.scrollHeight-e.scrollTop-e.clientHeight<=Pe&&Y(!0)},Z=(0,U.useRef)(void 0),Ve=c!==void 0&&I.some(e=>e.post===c);(0,U.useLayoutEffect)(()=>{if(!Ve||c===void 0||Z.current===c||q===`loading`)return;let e=ze();if(!e)return;let t=Array.from(e.querySelectorAll(`[data-post]`)).find(e=>e.getAttribute(`data-post`)===c);t&&(Z.current=c,Y(!1),t.scrollIntoView?.({block:`center`}))});let He=ke(M)>=2e3||(x?.limit??0)>=2e3,Ue=x?.more===!0&&K!==`off`,We=f?`Close panel`:`Open panel`,Q=`Back to ${l.label}`,Ge=k(me(i,b)),Ke=()=>pe(V),$=(0,W.jsx)(de,{payloadRead:x?.payloadRead,work:P,row:A,condition:he,highlight:c,nameOf:B}),qe;return qe=q===`loading`&&I.length===0?(0,W.jsx)(Le,{}):q===`refused`?(0,W.jsxs)(`div`,{className:`ox-col`,children:[(0,W.jsxs)(G,{icon:t,title:`This dashboard can't read ${E}'s work`,action:x?.grant&&(0,W.jsx)(C,{command:x.grant}),children:[(0,W.jsx)(`p`,{children:`The broker refused it: ${x?.reason??``}.`}),x?.grant&&(0,W.jsx)(`p`,{children:`The mesh owner can grant a read on that channel:`})]}),I.length>0&&$]}):q===`failed`&&I.length===0?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:xe,title:`${E}'s work didn't load`,action:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`}),children:(0,W.jsx)(`p`,{children:x?.reason??``})})}):K===`off`&&q!==`failed`?(0,W.jsxs)(`div`,{className:`ox-col`,children:[(0,W.jsxs)(Se,{children:[`${E} publishes no work events, so Work shows only what ${E} posted. Agents started with `,(0,W.jsx)(`code`,{children:`cotal spawn`}),` publish them unless started with `,(0,W.jsx)(`code`,{children:`--no-events`}),`.`]}),$]}):I.length===0&&K===`on`?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:ne,title:`${E} hasn't started a turn yet`,children:(0,W.jsx)(`p`,{children:`Its first turn shows here as soon as it starts.`})})}):I.length===0?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:xe,title:`Nothing has arrived from ${E} yet`,children:(0,W.jsxs)(`p`,{children:[`Agents started with `,(0,W.jsx)(`code`,{children:`cotal spawn`}),` publish one unless started with `,(0,W.jsx)(`code`,{children:`--no-events`}),`. An agent you started yourself may not publish one at all.`]})})}):(0,W.jsxs)(`div`,{className:`ox-col`,children:[q===`failed`&&(0,W.jsx)(Se,{action:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`}),children:`${E}'s work didn't load. ${x?.reason??``}`}),Ue&&!He&&(0,W.jsx)(R,{variant:`separator`,className:`mb-3`,children:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:q===`loading`,onClick:()=>void r?.loadEarlier(i),children:`Load earlier`})}),Ue&&He&&(0,W.jsx)(R,{className:`mb-3`,children:(0,W.jsx)(p,{children:`Showing the newest 2,000 events`})}),q===`loading`&&(0,W.jsx)(R,{className:`mb-3`,role:`status`,children:(0,W.jsx)(p,{children:`Loading`})}),$]}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`header`,{className:`ox-head`,children:[(0,W.jsx)(De,{}),u?(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(O,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,W.jsx)(`a`,{href:k(l.route),"aria-label":Q,children:(0,W.jsx)(z,{icon:Ae})})})}),(0,W.jsx)(o,{children:Q})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsxs)(`a`,{className:`ui-crumb`,href:k(l.route),"aria-label":Q,children:[(0,W.jsx)(z,{icon:Ae,size:16,className:`ui-ic`}),l.label]})}),(0,W.jsx)(o,{children:Q})]}),(0,W.jsx)(`span`,{className:`ox-sep`})]}),(0,W.jsx)(d,{vendor:T?.harness,status:A.status,size:30,badge:T?ve(i):void 0}),(0,W.jsx)(`h1`,{children:E}),!u&&H&&(0,W.jsx)(`span`,{className:`ui-topic`,children:H}),T&&(0,W.jsx)(n,{row:T}),(0,W.jsx)(`span`,{className:`ui-sp`}),u?(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(O,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,W.jsx)(`a`,{href:Ge,"aria-label":`Message ${E}`,onClick:Ke,children:(0,W.jsx)(z,{icon:we})})})}),(0,W.jsx)(o,{children:`Message ${E}`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(O,{asChild:!0,variant:`outline`,size:`sm`,children:(0,W.jsxs)(`a`,{href:Ge,onClick:Ke,children:[(0,W.jsx)(z,{icon:we,"data-icon":`inline-start`}),`Message`]})}),m&&(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(h,{"aria-label":We,pressed:f,onPressedChange:m,children:(0,W.jsx)(z,{icon:se})})}),(0,W.jsx)(o,{children:We})]})]})]}),(0,W.jsxs)(ie,{value:a,activationMode:`manual`,onValueChange:e=>(e===`work`||e===`messages`||e===`profile`)&&g({view:`agent`,id:i,tab:e}),className:`ox-tabs`,children:[(0,W.jsx)(`div`,{className:`ox-tablist`,children:(0,W.jsxs)(Te,{"aria-label":E,children:[(0,W.jsx)(D,{value:`work`,children:`Work`}),(0,W.jsxs)(D,{value:`messages`,children:[`Messages `,(0,W.jsx)(`span`,{className:`ox-n`,children:Oe})]}),(0,W.jsx)(D,{value:`profile`,children:`Profile`})]})}),(0,W.jsx)(j,{value:`work`,className:`ox-tabc`,children:(0,W.jsx)(oe,{autoScroll:J,children:(0,W.jsxs)(Ce,{className:`ox-scroller`,children:[(0,W.jsx)(ce,{ref:X,"aria-label":`Work`,onScroll:Be,children:(0,W.jsx)(ge,{className:`ox-scrollc`,children:qe})}),(0,W.jsx)(Re,{steps:I,away:!J})]})})}),(0,W.jsx)(j,{value:`messages`,className:`ox-tabc`,children:(0,W.jsx)(`div`,{className:`ui-scroll`,children:(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(Me,{groups:L,row:A,nameOf:B})})})}),(0,W.jsx)(j,{value:`profile`,className:`ox-tabc`,children:(0,W.jsx)(`div`,{className:`ui-scroll`,children:(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(Ne,{store:e,id:i})})})})]}),te&&(0,W.jsx)(`div`,{className:`ui-dock`,children:(0,W.jsx)(`div`,{className:`ui-dock-in`,children:(0,W.jsx)(ye,{store:e,target:V,where:E,to:`to ${E} · direct message`})})})]})}export{X as AgentPage};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,B as n,C as r,G as i,Gt as a,Ht as o,I as s,Ir as c,J as l,K as u,L as d,M as ee,Pr as f,S as p,Sr as m,T as h,U as g,Vt as _,W as v,Wt as y,Xn as b,Y as te,Zt as ne,_ as x,a as S,at as C,b as w,br as re,bt as T,c as ie,cn as E,d as D,dr as ae,dt as oe,en as se,fn as O,ft as ce,g as le,gr as k,h as ue,i as de,in as A,ir as fe,it as pe,jr as me,l as j,ln as he,lt as ge,m as _e,mt as ve,nt as ye,o as M,pt as N,q as P,r as be,rn as xe,s as Se,st as Ce,tn as we,tr as F,u as Te,un as I,ur as Ee,v as L,w as De,wr as Oe,x as R,xt as z,y as B,yr as ke}from"./controller-21WQbPde.js";var Ae=[[`path`,{d:`M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],V=[[`path`,{d:`M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.5 12.5H15.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],H=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],U=e(c(),1),W=b();function G({icon:e,title:t,children:n,action:r}){return(0,W.jsxs)(g,{children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(P,{variant:`icon`,children:(0,W.jsx)(z,{icon:e})}),(0,W.jsx)(l,{children:t}),n&&(0,W.jsx)(i,{children:n})]}),r&&(0,W.jsx)(v,{children:r})]})}var K=e=>Number.isFinite(e.ts)?e.ts:-1/0;function je(e){let t=new Map;for(let{msg:n}of e){let e=typeof n.channel==`string`?n.channel:void 0,r=e===void 0&&typeof n.to==`string`?n.to:void 0;if(e===void 0&&r===void 0)continue;let i=e===void 0?`dm:${r}`:`channel:${e}`,a=t.get(i);a||t.set(i,a={key:i,...e===void 0?{to:r}:{channel:e},rows:[]}),a.rows.push(n)}let n=[...t.values()];for(let e of n)e.rows.sort((e,t)=>K(t)-K(e));return n.sort((e,t)=>K(t.rows[0])-K(e.rows[0]))}function q({msg:e,row:t,place:n,href:r,label:i}){let a=s();return(0,W.jsxs)(`div`,{className:`ui-msg ox-msg`,"data-post":e.id,children:[(0,W.jsx)(`div`,{className:`ui-gut`,children:(0,W.jsx)(d,{vendor:t.harness,status:t.status,size:34,dot:!1,badge:a(t.id)})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`ui-mh`,children:[(0,W.jsx)(`b`,{children:t.name}),(0,W.jsx)(T,{variant:`secondary`,children:n}),(0,W.jsx)(S,{ts:e.ts}),(0,W.jsx)(`span`,{className:`ui-sp`}),(0,W.jsxs)(`a`,{className:`ox-act`,href:r,children:[i,(0,W.jsx)(z,{icon:he,size:16})]})]}),(0,W.jsx)(M,{className:`ui-tx`,src:Oe(e.parts)})]})]})}function Me({groups:e,row:t,nameOf:n}){return(0,W.jsxs)(`div`,{className:`ox-msgs`,children:[e.length===0&&(0,W.jsx)(G,{icon:E,title:`No messages from ${t.name} on this page yet`}),e.map(e=>{let i=e.rows.length;if(e.channel!==void 0){let n=e.channel,a=k({view:`channel`,channel:n});return(0,W.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,W.jsxs)(R,{className:`ox-marker`,children:[(0,W.jsx)(r,{children:(0,W.jsx)(z,{icon:A,size:16})}),(0,W.jsxs)(p,{children:[(0,W.jsx)(`b`,{children:`#${n}`}),` · ${i===1?`1 post`:`${i} posts`}`]})]}),e.rows.map(e=>(0,W.jsx)(q,{msg:e,row:t,place:`in #${n}`,href:a,label:`Open in #${n}`},e.id))]},e.key)}let a=e.to??``,o=n(a),s=k({view:`dm`,peer:t.id,with:a});return(0,W.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,W.jsxs)(R,{className:`ox-marker`,children:[(0,W.jsx)(r,{children:(0,W.jsx)(z,{icon:E,size:16})}),(0,W.jsxs)(p,{children:[(0,W.jsx)(`b`,{children:`Direct messages`}),` · ${i} with ${o}`]})]}),e.rows.map(e=>(0,W.jsx)(q,{msg:e,row:t,place:`to ${o}`,href:s,label:`Open conversation`},e.id))]},e.key)}),(0,W.jsx)(`p`,{className:`ox-msgs-more`,children:`Older messages are in each channel's history.`})]})}var J=1e3,Y={on:`Published. Tool inputs and results appear when payload access is permitted.`,off:`Not published`};function Ne({store:e,id:t,clock:r=Date.now}){let i=F(e,e=>e.roster),a=F(e,e=>e.channels),o=F(e,e=>e.membership),c=F(e,e=>e.activity),[,l]=(0,U.useReducer)(e=>e+1,0);(0,U.useEffect)(()=>{let e=setInterval(l,J);return()=>clearInterval(e)},[]);let u=s(),p=i.find(e=>e.card.id===t),h=(0,U.useMemo)(()=>p?te(t,o,a.map(e=>e.channel),c,p.channelModes):{channels:[],wide:!1},[p,t,o,a,c]);if(!p)return(0,W.jsx)(`p`,{className:`ui-nr`,children:`Not on the roster`});let g=fe([p],{includeOffline:!0})[0],_=typeof g.statusSince==`number`&&Number.isFinite(g.statusSince)?`Reported ${m(new Date(g.statusSince))}`:void 0,v=(p.card.skills??[]).map(e=>e.name).filter(e=>typeof e==`string`&&e!==``);return(0,W.jsxs)(`div`,{className:`ox-profile`,children:[(0,W.jsx)(`div`,{className:`ui-big`,children:(0,W.jsx)(d,{vendor:g.harness,status:g.status,size:88,dot:!1,badge:u(g.id)})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`ui-sline`,children:[(0,W.jsx)(n,{row:g}),(0,W.jsx)(`span`,{style:{color:`var(--ink)`},children:g.activity||`No current activity`}),_&&(0,W.jsx)(`small`,{children:_}),B(g,r())&&(0,W.jsx)(`small`,{className:`ui-facts`,children:B(g,r())})]}),(0,W.jsxs)(`div`,{className:`ui-actions`,children:[(0,W.jsx)(C,{icon:V,command:`cotal attach --name ${f(g.name)}`}),(0,W.jsx)(C,{icon:H,command:`cotal stop --name ${f(g.name)}`})]}),(0,W.jsxs)(`dl`,{className:`ui-kv`,children:[g.harness&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Harness`}),(0,W.jsx)(`dd`,{children:ee(g.harness)})]}),(0,W.jsx)(`dt`,{children:`Model`}),g.model?(0,W.jsx)(`dd`,{className:`ui-mono`,style:{fontSize:12.5},children:g.model}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),g.host&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Host`}),(0,W.jsx)(`dd`,{children:g.host})]}),(g.attention===`dnd`||g.attention===`focus`)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Attention`}),(0,W.jsx)(`dd`,{children:(0,W.jsx)(x,{attention:g.attention})})]}),(0,W.jsx)(`dt`,{children:`Heartbeat`}),Number.isFinite(g.ts)?(0,W.jsxs)(`dd`,{className:`ui-num`,children:[w(r()-g.ts),` ago`]}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),(0,W.jsx)(`dt`,{children:`Work events`}),g.events?(0,W.jsx)(`dd`,{children:Y[g.events]}):(0,W.jsx)(`dd`,{className:`ui-nr`,children:`not reported`})]}),(h.wide||h.channels.length>0)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h5`,{children:`Channels`}),h.wide&&(0,W.jsxs)(`div`,{className:`ui-chrow`,children:[(0,W.jsx)(`span`,{children:`Reads every channel`}),(0,W.jsx)(`span`,{})]}),h.channels.map(e=>(0,W.jsxs)(`div`,{className:`ui-chrow`,children:[(0,W.jsx)(`span`,{children:`#${e.channel}`}),(0,W.jsx)(`span`,{children:e.mode??``})]},e.channel))]}),v.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h5`,{style:{marginTop:10},children:`Skills`}),(0,W.jsx)(`div`,{className:`ui-tags`,children:v.map(e=>(0,W.jsx)(T,{variant:`secondary`,children:e},e))})]})]})]})}var Pe=24,Fe=[];function Ie(e){return e.items.flatMap(e=>e.kind===`turn`?[e,...e.steps]:[e]).flatMap(e=>[{key:e.key,live:e.live,...e.kind===`post`?{post:e.msg.id}:{}},...e.kind===`tools`?e.calls.slice(1).map(e=>({key:e.key,live:e.live})):[]])}function Le(){let e=e=>(0,W.jsx)(a,{className:`h-2.5`,style:{width:e}});return(0,W.jsx)(`div`,{className:`ox-col`,"aria-busy":`true`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-hidden":`true`,children:[e(`36%`),e(`88%`),e(`64%`),e(`42%`),e(`30%`),e(`76%`)]})})}function Re({steps:e,away:t}){let{end:n}=ve(),{scrollToEnd:r}=N(),[i,a]=(0,U.useState)(null),o=n||t;o&&i===null&&a(new Set(e.map(e=>e.key))),!o&&i!==null&&a(null);let s=i?e.filter(e=>e.live&&!i.has(e.key)).length:0;return s===0?null:(0,W.jsxs)(O,{type:`button`,variant:`outline`,size:`sm`,className:`ox-newsteps`,"data-active":`true`,onClick:()=>r({behavior:L()?`auto`:`smooth`}),children:[(0,W.jsx)(z,{icon:I,"data-icon":`inline-start`}),s===1?`1 new step`:`${s} new steps`]})}function X({store:e,controller:r,id:i,tab:a,at:c,back:l,phone:u=!1,panelOpen:f=!1,onTogglePanel:m}){le(r,i);let g=(0,U.useContext)(be),v=F(e,e=>e.roster),b=F(e,e=>e.operatorId),te=F(e,e=>e.post),x=F(e,e=>e.sessions[i]),S=(0,U.useMemo)(()=>ae(v),[v]),w=v.find(e=>e.card.id===i),T=(0,U.useMemo)(()=>w?fe([w],{includeOffline:!0})[0]:void 0,[w]),E=T?.name??Ee(i,S,b),A=T??{id:i,name:E,status:`offline`,ts:NaN},he=(0,U.useMemo)(()=>_e(w),[w]),ve=s(),M=x?.frames??Fe,N=ue(e,i),P=(0,U.useMemo)(()=>re(M,N),[M,N]),I=(0,U.useMemo)(()=>Ie(P),[P]),L=(0,U.useMemo)(()=>je(N),[N]),Oe=L.reduce((e,t)=>e+t.rows.length,0),B=(0,U.useMemo)(()=>e=>Ee(e,S,b),[S,b]),V=(0,U.useMemo)(()=>({kind:`dm`,to:i}),[i]),H=[T?.role,T?.harness&&ee(T.harness)].filter(Boolean).join(` · `),K=T?.events,q=x?.load??`loading`,[J,Y]=(0,U.useState)(!0);a!==`work`&&!J&&Y(!0);let X=(0,U.useRef)(null),ze=()=>X.current,Be=()=>{let e=ze();!J&&e&&e.scrollHeight-e.scrollTop-e.clientHeight<=Pe&&Y(!0)},Z=(0,U.useRef)(void 0),Ve=c!==void 0&&I.some(e=>e.post===c);(0,U.useLayoutEffect)(()=>{if(!Ve||c===void 0||Z.current===c||q===`loading`)return;let e=ze();if(!e)return;let t=Array.from(e.querySelectorAll(`[data-post]`)).find(e=>e.getAttribute(`data-post`)===c);t&&(Z.current=c,Y(!1),t.scrollIntoView?.({block:`center`}))});let He=ke(M)>=2e3||(x?.limit??0)>=2e3,Ue=x?.more===!0&&K!==`off`,We=f?`Close panel`:`Open panel`,Q=`Back to ${l.label}`,Ge=k(me(i,b)),Ke=()=>pe(V),$=(0,W.jsx)(de,{payloadRead:x?.payloadRead,work:P,row:A,condition:he,highlight:c,nameOf:B}),qe;return qe=q===`loading`&&I.length===0?(0,W.jsx)(Le,{}):q===`refused`?(0,W.jsxs)(`div`,{className:`ox-col`,children:[(0,W.jsxs)(G,{icon:t,title:`This dashboard can't read ${E}'s work`,action:x?.grant&&(0,W.jsx)(C,{command:x.grant}),children:[(0,W.jsx)(`p`,{children:`The broker refused it: ${x?.reason??``}.`}),x?.grant&&(0,W.jsx)(`p`,{children:`The mesh owner can grant a read on that channel:`})]}),I.length>0&&$]}):q===`failed`&&I.length===0?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:xe,title:`${E}'s work didn't load`,action:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`}),children:(0,W.jsx)(`p`,{children:x?.reason??``})})}):K===`off`&&q!==`failed`?(0,W.jsxs)(`div`,{className:`ox-col`,children:[(0,W.jsxs)(Se,{children:[`${E} publishes no work events, so Work shows only what ${E} posted. Agents started with `,(0,W.jsx)(`code`,{children:`cotal spawn`}),` publish them unless started with `,(0,W.jsx)(`code`,{children:`--no-events`}),`.`]}),$]}):I.length===0&&K===`on`?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:ne,title:`${E} hasn't started a turn yet`,children:(0,W.jsx)(`p`,{children:`Its first turn shows here as soon as it starts.`})})}):I.length===0?(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(G,{icon:xe,title:`Nothing has arrived from ${E} yet`,children:(0,W.jsxs)(`p`,{children:[`Agents started with `,(0,W.jsx)(`code`,{children:`cotal spawn`}),` publish one unless started with `,(0,W.jsx)(`code`,{children:`--no-events`}),`. An agent you started yourself may not publish one at all.`]})})}):(0,W.jsxs)(`div`,{className:`ox-col`,children:[q===`failed`&&(0,W.jsx)(Se,{action:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`}),children:`${E}'s work didn't load. ${x?.reason??``}`}),Ue&&!He&&(0,W.jsx)(R,{variant:`separator`,className:`mb-3`,children:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:q===`loading`,onClick:()=>void r?.loadEarlier(i),children:`Load earlier`})}),Ue&&He&&(0,W.jsx)(R,{className:`mb-3`,children:(0,W.jsx)(p,{children:`Showing the newest 2,000 events`})}),q===`loading`&&(0,W.jsx)(R,{className:`mb-3`,role:`status`,children:(0,W.jsx)(p,{children:`Loading`})}),$]}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`header`,{className:`ox-head`,children:[(0,W.jsx)(De,{}),u?(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(O,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,W.jsx)(`a`,{href:k(l.route),"aria-label":Q,children:(0,W.jsx)(z,{icon:Ae})})})}),(0,W.jsx)(o,{children:Q})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsxs)(`a`,{className:`ui-crumb`,href:k(l.route),"aria-label":Q,children:[(0,W.jsx)(z,{icon:Ae,size:16,className:`ui-ic`}),l.label]})}),(0,W.jsx)(o,{children:Q})]}),(0,W.jsx)(`span`,{className:`ox-sep`})]}),(0,W.jsx)(d,{vendor:T?.harness,status:A.status,size:30,badge:T?ve(i):void 0}),(0,W.jsx)(`h1`,{children:E}),!u&&H&&(0,W.jsx)(`span`,{className:`ui-topic`,children:H}),T&&(0,W.jsx)(n,{row:T}),(0,W.jsx)(`span`,{className:`ui-sp`}),u?(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(O,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,W.jsx)(`a`,{href:Ge,"aria-label":`Message ${E}`,onClick:Ke,children:(0,W.jsx)(z,{icon:we})})})}),(0,W.jsx)(o,{children:`Message ${E}`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(O,{asChild:!0,variant:`outline`,size:`sm`,children:(0,W.jsxs)(`a`,{href:Ge,onClick:Ke,children:[(0,W.jsx)(z,{icon:we,"data-icon":`inline-start`}),`Message`]})}),m&&(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{asChild:!0,children:(0,W.jsx)(h,{"aria-label":We,pressed:f,onPressedChange:m,children:(0,W.jsx)(z,{icon:se})})}),(0,W.jsx)(o,{children:We})]})]})]}),(0,W.jsxs)(ie,{value:a,activationMode:`manual`,onValueChange:e=>(e===`work`||e===`messages`||e===`profile`)&&g({view:`agent`,id:i,tab:e}),className:`ox-tabs`,children:[(0,W.jsx)(`div`,{className:`ox-tablist`,children:(0,W.jsxs)(Te,{"aria-label":E,children:[(0,W.jsx)(D,{value:`work`,children:`Work`}),(0,W.jsxs)(D,{value:`messages`,children:[`Messages `,(0,W.jsx)(`span`,{className:`ox-n`,children:Oe})]}),(0,W.jsx)(D,{value:`profile`,children:`Profile`})]})}),(0,W.jsx)(j,{value:`work`,className:`ox-tabc`,children:(0,W.jsx)(oe,{autoScroll:J,children:(0,W.jsxs)(Ce,{className:`ox-scroller`,children:[(0,W.jsx)(ce,{ref:X,"aria-label":`Work`,onScroll:Be,children:(0,W.jsx)(ge,{className:`ox-scrollc`,children:qe})}),(0,W.jsx)(Re,{steps:I,away:!J})]})})}),(0,W.jsx)(j,{value:`messages`,className:`ox-tabc`,children:(0,W.jsx)(`div`,{className:`ui-scroll`,children:(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(Me,{groups:L,row:A,nameOf:B})})})}),(0,W.jsx)(j,{value:`profile`,className:`ox-tabc`,children:(0,W.jsx)(`div`,{className:`ui-scroll`,children:(0,W.jsx)(`div`,{className:`ox-col`,children:(0,W.jsx)(Ne,{store:e,id:i})})})})]}),te&&(0,W.jsx)(`div`,{className:`ui-dock`,children:(0,W.jsx)(`div`,{className:`ui-dock-in`,children:(0,W.jsx)(ye,{store:e,target:V,where:E,to:`to ${E} · direct message`})})})]})}export{X as AgentPage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Bfff_dYO.js","assets/rolldown-runtime-XKyaHtl9.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),a=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e(r(),1),s=e(a(),1),c=e=>e.kind===`msg`?`msg\u0001${e.channel}`:`dm\u0001${e.to}`;function l(e,t){if(e.view===`channel`)return{kind:`msg`,channel:e.channel};if(e.view!==`dm`)return;let n=t??void 0;if(e.with===void 0)return e.peer===n?void 0:{kind:`dm`,to:e.peer};if(e.peer===n)return{kind:`dm`,to:e.with};if(e.with===n)return{kind:`dm`,to:e.peer}}var u=`You'll show on the roster as operator when you post. Replies come to your DMs.`;function d(e){return e.mode===`participant`?u:e.reason===`This dashboard was started with --creds, which can only read.`?"Restart `cotal web` without `--creds` to post here.":``}function f(e){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function p(e){return e.kind===`msg`?`cotal send -c ${f(e.channel)} "<text>"`:`cotal send -t ${f(e.to)} "<text>"`}function m(e,t){return t?{view:`dm`,peer:e,with:t}:{view:`dm`,peer:e}}function h(e,t){if(e!==null)return e.mode===`off`?{text:`Read only`,title:e.reason}:t?{text:`On the roster`,title:`You show on the roster as operator once you post, so agents can reply to you.`}:{text:`Not on the roster`,title:u}}var g=class extends Error{status;error;constructor(e,t){super(t),this.status=e,this.error=t,this.name=`SendRefused`}};async function _(e){let t=``;try{let n=await e.json();n&&typeof n.error==`string`&&(t=n.error)}catch{}return new g(e.status,t)}function v(e,t){let n=t instanceof g?t.status:void 0,r=(t instanceof g?t.error:t instanceof Error?t.message:String(t)).trim()||(n===void 0?`the request failed`:`HTTP ${n}`),i=/[.?!]$/.test(r)?r:`${r}.`;return`Couldn't post to ${e}. ${n===502?`The broker refused it: ${i}`:i} Your message is still here.`}async function y(e,t){if(!e.ok){let n=``;try{let t=await e.json();t&&typeof t.error==`string`&&(n=`: ${t.error}`)}catch{}throw Error(`${t} refused with HTTP ${e.status}${n}`)}return e.json()}async function b(e){let t=await Promise.all(e.map(async e=>{try{return{value:await e.read()}}catch(e){return{error:e}}})),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(`error`in i){let t=i.error;n.push({kind:`refused`,name:e[r].name,reason:t&&t.message?t.message:String(i.error)})}else e[r].apply(i.value)}return n}function x(e){if(!e.length)return``;let t=e.filter(e=>e.kind!==`partial`).map(e=>e.name),n=e.filter(e=>e.kind===`partial`).map(e=>e.name),r=[];return t.length&&r.push(`stale: ${t.join(`, `)}`),n.length&&r.push(`partial: ${n.join(`, `)}`),r.join(` · `)}var S=new Map;function C(e,t){S.set(e,t)}function w(e){if(e.kind===`text`)return e.text;if(e.kind===`artifact`)return`[artifact ${e.name} (${e.mediaType}, ${e.size} bytes) ${e.digest}]`;if(e.kind===`data`){let t=JSON.stringify(e.data);return t===void 0?`[empty data part]`:t}let t=e.kind,n=S.has(t)?S.get(t):void 0;if(typeof n==`function`){let r;try{r=n(e)}catch(e){let n=e;return`[renderer for part kind ${JSON.stringify(t)} failed: ${n&&n.message?n.message:String(e)}]`}return typeof r==`string`?r:`[renderer for part kind ${JSON.stringify(t)} returned ${typeof r}, expected a string]`}let r=JSON.stringify(e.data);return r===void 0?`[unrenderable part kind ${JSON.stringify(t)} \u2014 no renderer for it on this surface]`:`[${t}] ${r}`}function T(e){return(e||[]).map(e=>w(e)).join(` `)}function E(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CUSTOM`||t.name!==`cotal.toolResult`)return;let n=t.value;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=Object.keys(n);if(r.length!==2||!r.includes(`toolCallId`)||!r.includes(`isError`))return;let i=n;if(typeof i.toolCallId==`string`&&typeof i.isError==`boolean`)return{toolCallId:i.toolCallId,isError:i.isError}}function D(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}var O=e=>`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,k=e=>{let t=D(e);return t&&O(t)},A=2e3,j=`ag-ui.frame`,M=e=>typeof e==`string`?e:void 0,N=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,P=class{label;constructor(e){this.label=e}};function F(e,t){if(typeof e.id!=`string`)return[];let n=Array.isArray(e.parts)?e.parts:[],r=[];for(let i of n){if(typeof i!=`object`||!i||i.kind!==j)continue;let n=i.events,a=r.length===0?e.id:`${e.id}#${r.length}`;r.push({id:a,ts:e.ts,events:Array.isArray(n)&&n.length>0?n:[new P(`A frame with no events`)],live:t})}return r.length>0?r:[{id:e.id,ts:e.ts,events:[new P(T(n))],live:t}]}function I(e){let t=e.lastIndexOf(`__`);return t<0?e:e.slice(t+2)}var ee=new Map([[`Bash`,`command`],[`Edit`,`edit`],[`MultiEdit`,`edit`],[`NotebookEdit`,`edit`],[`Write`,`write`],[`Read`,`read`],[`cotal_send`,`send`],[`cotal_dm`,`dm`],[`cotal_inbox`,`inbox`]]);function L(e){return ee.get(e)??`other`}function te(e){let t=/^events\.([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return t?`${t[1]}.${t[2]}`:void 0}function ne(e){let t=0;for(let n of e)t+=n.events.length;return t}var re=new Map([[`human`,`prompt`],[`sdk`,`prompt`],[`channel`,`mesh`],[`auto-continuation`,`continuation`],[`notification`,`notification`]]);function ie(e){let t=e.cotal,n=typeof t==`object`&&t?M(t.turnSource):void 0;return n===void 0?void 0:re.get(n)}function R(e){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=!1,s=(e,t,n,r,i)=>{let a=e.get(t);if(a!==void 0)return a.at=r,a.live=a.live&&i,a;let o={text:``,user:!1,key:n,at:r,live:i};return e.set(t,o),o},c=(e,t,n,r,i)=>{let a=s(e,t,n,r,i);return a.text=``,a.user=!1,a.key=n,a.live=i,a},l=(e,n,r,i,a,o=!0)=>{let s=e.get(n);if(e.delete(n),s===void 0||s.text.length===0)return;let c=r===`said`&&s.user?`prompt`:r;t.push({item:{kind:c,key:s.key,text:s.text,cut:i},at:a??s.at,live:s.live&&o})},u=()=>{for(let e of[...n.keys()])l(n,e,`said`,!0);for(let e of[...r.keys()])l(r,e,`reasoning`,!0)};for(let d of e){let e=N(d.ts);d.events.forEach((f,p)=>{let m=`${d.id}:${p}`,h=d.live;if(f instanceof P){t.push({item:{kind:`unknown`,key:m,label:f.label,ts:e},at:e,live:h});return}let g=f,_=typeof g==`object`&&!!g,v=_?M(g.type):void 0,y=(_?N(g.timestamp):void 0)??e;switch((v===`RUN_STARTED`||v===`RUN_FINISHED`||v===`RUN_ERROR`)&&u(),v){case`RUN_STARTED`:{let e=ie(g);t.push({item:{kind:`turn`,key:m,ts:y,...e?{source:e}:{}},at:y,live:h});break}case`RUN_FINISHED`:t.push({item:{kind:`turnEnd`,key:m,ts:y},at:y,live:h});break;case`RUN_ERROR`:t.push({item:{kind:`runError`,key:m,ts:y},at:y,live:h});break;case`TEXT_MESSAGE_START`:c(n,M(g.messageId)??``,m,y,h).user=M(g.role)===`user`;break;case`TEXT_MESSAGE_CONTENT`:{let e=s(n,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`TEXT_MESSAGE_END`:l(n,M(g.messageId)??``,`said`,!1,y,h);break;case`REASONING_MESSAGE_START`:c(r,M(g.messageId)??``,m,y,h);break;case`REASONING_MESSAGE_CONTENT`:{let e=s(r,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`REASONING_MESSAGE_END`:l(r,M(g.messageId)??``,`reasoning`,!1,y,h);break;case`TOOL_CALL_START`:{let e=M(g.toolCallName)??`?`,n=I(e),r={key:m,id:M(g.toolCallId)??``,name:n,full:e,kind:L(n),...y===void 0?{}:{ts:y},live:h};if(r.id!==``){i.set(r.id,r);let e=a.get(r.id);e&&(r.input=e.input,r.result=e.result,r.live=r.live&&e.live,a.delete(r.id))}t.push({call:r,at:y,live:h});break}case`TOOL_CALL_END`:break;case`TOOL_CALL_ARGS`:case`TOOL_CALL_RESULT`:{let e=M(g.toolCallId)??``,t=i.get(e),n=M(v===`TOOL_CALL_ARGS`?g.delta:g.content);if(n!==void 0&&e!==``){let r=t??a.get(e)??{live:h};v===`TOOL_CALL_ARGS`?r.input=(r.input??``)+n:r.result=n,r.live=r.live&&h,t||a.set(e,r)}break}case`CUSTOM`:{let e=E(g);if(e!==void 0){o=!0;let t=i.get(e.toolCallId);t!==void 0&&(y!==void 0&&(t.end=y),t.failed=e.isError,t.live=t.live&&h);break}t.push({item:{kind:`unknown`,key:m,label:`Custom event ${M(g.name)===void 0?`(unnamed)`:JSON.stringify(g.name)}`,ts:y},at:y,live:h});break}default:t.push({item:{kind:`unknown`,key:m,label:`Unrecognised event ${JSON.stringify(v??null)}`,ts:y},at:y,live:h})}})}return u(),{flat:t,marked:o}}function z(e,t){return e.filter(e=>t(e.msg)).map((e,t)=>({msg:e.msg,i:t,at:N(e.msg.ts)})).sort((e,t)=>(e.at??1/0)-(t.at??1/0)||e.i-t.i).map(({msg:e,at:t})=>({msg:e,at:t}))}function ae(e,t){let n=(e,t)=>e!==void 0&&t!==void 0&&e<t,r=[],i=0;for(let a of e){for(;i<t.length&&n(t[i].at,a.at);)r.push(t[i++]);r.push(a)}for(;i<t.length;)r.push(t[i++]);return r}function B(e,t){let{flat:n,marked:r}=R(e),i=z(t,e=>typeof e.channel==`string`||typeof e.to==`string`).map(({msg:e,at:t})=>({post:{kind:`post`,key:`post:${e.id}`,msg:e,...typeof e.channel==`string`?{channel:e.channel}:{to:e.to},live:!0},at:t})),a=[],o,s,c=e=>{s=void 0,(o?.steps??a).push(e)},l=(e,t,n)=>{o!==void 0&&(o.outcome=e,t!==void 0&&(o.end=t),o.live=o.live&&n,o=void 0)};for(let e of ae(n,i)){if(`post`in e){c(e.post);continue}if(`call`in e){if(s!==void 0)s.calls.push(e.call),s.live=s.live&&e.call.live;else{let t={kind:`tools`,key:e.call.key,calls:[e.call],live:e.call.live};c(t),s=t}continue}let t=e.item;switch(t.kind){case`turn`:s=void 0,o!==void 0&&(o.superseded=!0),o={kind:`turn`,key:t.key,...t.ts===void 0?{}:{start:t.ts},outcome:`open`,superseded:!1,...t.source?{source:t.source}:{},steps:[],live:e.live},a.push(o);break;case`turnEnd`:s=void 0,o===void 0?a.push({kind:`turnEnd`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}):l(`finished`,t.ts,e.live);break;case`runError`:c({kind:`runError`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}),l(`failed`,t.ts,e.live);break;case`said`:case`prompt`:case`reasoning`:c({...t,...e.at===void 0?{}:{ts:e.at},live:e.live});break;case`unknown`:c({...t,live:e.live})}}let u=a.some(e=>e.kind===`turn`&&e.outcome!==`open`&&e.steps.some(e=>e.kind===`tools`));return{items:a,toolStatus:r||!u}}function V(e,t){if(e.failed!==void 0)return e.failed?`failed`:`done`;if(!t.toolStatus||!t.trailing)return`called`;let n=t.turn;return n===void 0||n.outcome!==`open`||n.superseded?`noResult`:t.status===`working`?`running`:t.status===`waiting`?`pending`:`noResult`}var H={command:{title:{running:`Running a command`,done:`Ran a command`,failed:`A command failed`,pending:`A command hasn't finished`,noResult:`No result arrived for a command`},one:`ran a command`,many:`ran # commands`,noun:[`command`,`commands`]},edit:{title:{running:`Editing a file`,done:`Edited a file`,failed:`An edit failed`,pending:`An edit hasn't finished`,noResult:`No result arrived for an edit`},one:`made an edit`,many:`made # edits`,noun:[`edit`,`edits`]},write:{title:{running:`Writing a file`,done:`Wrote a file`,failed:`A write failed`,pending:`A write hasn't finished`,noResult:`No result arrived for a write`},one:`wrote a file`,many:`wrote # times`,noun:[`write`,`writes`]},read:{title:{running:`Reading a file`,done:`Read a file`,failed:`A read failed`,pending:`A read hasn't finished`,noResult:`No result arrived for a read`},one:`read a file`,many:`read # times`,noun:[`read`,`reads`]},send:{title:{running:`Sending a message`,done:`Sent a message`,failed:`A message failed`,pending:`A message hasn't finished`,noResult:`No result arrived for a message`},one:`sent a message`,many:`sent # messages`,noun:[`message`,`messages`]},dm:{title:{running:`Sending a direct message`,done:`Sent a direct message`,failed:`A direct message failed`,pending:`A direct message hasn't finished`,noResult:`No result arrived for a direct message`},one:`sent a direct message`,many:`sent # direct messages`,noun:[`direct message`,`direct messages`]},inbox:{title:{running:`Checking the inbox`,done:`Checked the inbox`,failed:`An inbox check failed`,pending:`An inbox check hasn't finished`,noResult:`No result arrived for an inbox check`},one:`checked the inbox`,many:`checked the inbox # times`,noun:[`inbox check`,`inbox checks`]},other:{title:{running:`Using a tool`,done:`Used a tool`,failed:`A tool call failed`,pending:`A tool call hasn't finished`,noResult:`No result arrived for a tool call`},one:`called a tool`,many:`called # tools`,noun:[`tool call`,`tool calls`]}},oe={one:`called another tool`,many:`called # other tools`},U=e=>e.charAt(0).toUpperCase()+e.slice(1),se=(e,t)=>t===1?e.one:e.many.replace(`#`,String(t)),ce=(e,t,n)=>`${e} ${e===1?t:n}`;function le(e,t=64){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function ue(e,t,n){return t===`called`?`Called ${le(n)}`:H[e].title[t]}function de(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>le(e.name));return{title:`Called ${t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} and ${t.at(-1)}`}`,failed:n}}let r=new Map;for(let t of e)r.set(t.kind,(r.get(t.kind)??0)+1);let i=r.size>1;return{title:U([...r].map(([e,t])=>se(e===`other`&&i?oe:H[e],t)).join(`, `)),failed:n}}var fe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function pe(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ve(t-e,!1),i=(e,t,n)=>t===void 0?n:`${e} ${t}`,a;a=e.outcome===`finished`?i(`Worked for`,r(e.start,e.end),`Worked`):e.outcome===`failed`?i(`Turn failed after`,r(e.start,e.end),`Turn failed`):e.superseded||t!==`working`&&t!==`waiting`?`No end arrived for this turn`:t===`working`?i(`Working for`,r(e.start,n),`Working`):i(`Open for`,r(e.start,n),`Turn open`);let o=fe(e).filter(e=>e.failed===!0);if(o.length===0)return{title:a};let[s,c]=new Set(o.map(e=>e.kind)).size===1?H[o[0].kind].noun:[`call`,`calls`];return{title:a,failed:`${ce(o.length,s,c)} failed`}}var me={prompt:`started by a prompt`,mesh:`started by a message from the mesh`,continuation:`started by the harness continuing itself`,notification:`started by a notification`};function he(e){let t=[],n=k(e.start),r=k(e.end);e.outcome===`open`?n!==void 0&&t.push(`since ${n}`):n!==void 0&&r!==void 0&&t.push(n===r?n:`${n} to ${r}`),e.source!==void 0&&t.push(me[e.source]);let i=0;for(let t of e.steps)t.kind===`tools`?i+=t.calls.length:(t.kind===`said`||t.kind===`prompt`||t.kind===`reasoning`||t.kind===`post`)&&i++;t.push(ce(i,`step`,`steps`));let a=e.steps.find(e=>e.kind===`post`&&e.channel!==void 0);return a?.kind===`post`&&t.push(`posted in #${a.channel}`),t.join(` · `)}function ge(e,t,n){let r=k(e.ts);if(t===`called`)return r??``;let i;i=t===`done`||t===`failed`?e.ts===void 0||e.end===void 0?void 0:ve(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ve(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=le(e.name);return i===void 0?a:`${a} · ${i}`}function _e(e,t){if(t){let t=ce(e.length,`step`,`steps`),n=e.length>0&&e.every(e=>e.ts!==void 0&&e.end!==void 0)?ve(Math.max(...e.map(e=>e.end))-e[0].ts,!0):void 0;return n===void 0?t:`${t} · ${n}`}let n=ce(e.length,`call`,`calls`),r=k(e[0]?.ts),i=k(e.at(-1)?.ts),a=r===void 0?i:i===void 0||i===r?r:`${r} to ${i}`;return a===void 0?n:`${n} · ${a}`}function ve(e,t){if(!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3);return n<60?t?`${(Math.floor(e/100)/10).toFixed(1)}s`:`${n}s`:n<3600?`${Math.floor(n/60)}m ${n%60}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}var ye=[`work`,`messages`,`profile`],be=e=>ye.includes(e),xe={view:`activity`},Se={view:`topology`},Ce=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function we(e){try{return decodeURIComponent(e)}catch{return}}function Te(e){let t=e.replace(/^#/,``).split(`/`);if(t[0]!==``)return;let[,n,r,i,a,...o]=t;if(!(o.length>0||a!==void 0&&n!==`agent`))switch(n){case`channel`:{if(!r||i!==void 0)return;let e=we(r);if(!e)return;let t=te(e);return t?{view:`agent`,id:t,tab:`work`}:{view:`channel`,channel:e}}case`agent`:{if(!r)return;let e=we(r);if(!e||!Ce.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(be(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:we(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:we(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=we(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:we(i);return t?{view:`dm`,peer:e,with:t}:void 0}case`agents`:return i===void 0?r===void 0||r===`status`?{view:`agents`,group:`status`}:r===`host`?{view:`agents`,group:`host`}:void 0:void 0;case`activity`:case`topology`:case`needs`:return r===void 0?{view:n}:void 0;default:return}}function Ee(e,t){return Te(e)??(t===`/graph`?Se:xe)}function De(e){switch(e.view){case`channel`:return`#/channel/${encodeURIComponent(e.channel)}`;case`dm`:return`#/dm/${encodeURIComponent(e.peer)}${e.with===void 0?``:`/${encodeURIComponent(e.with)}`}`;case`agents`:return e.group===`status`?`#/agents`:`#/agents/${e.group}`;case`agent`:{let t=`#/agent/${encodeURIComponent(e.id)}`;return e.at===void 0?e.tab===`work`?t:`${t}/${e.tab}`:`${t}/work/${encodeURIComponent(e.at)}`}default:return`#/${e.view}`}}function Oe(e){return Ee(e.location.hash,e.location.pathname)}function ke(e,t){let n=()=>t(Oe(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function Ae(e,t){if(t.view!==`agent`)return;let n=De(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function je(e,t){e.location.hash=De(t)}function Me(e){return typeof e==`string`&&e.trim()?e:void 0}function Ne(e){let t=new Map;for(let n of e){let e=Me(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Pe=`operator (you)`;function Fe(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Pe;if(typeof e==`object`)return Fe(e.id,t);let r=t.get(e);if(Me(r))return r;let i=/^([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return i&&i[2].length>=32?`${i[1]}.${i[2].slice(0,6)}…`:/^[A-Z2-7]{32,}$/.test(e)?e.slice(0,6)+`…`:e}var Ie=``,Le=(e,t)=>[e,t].sort().join(Ie);function Re(e){let t=new Map;for(let n of e){let e=n.senderId??n.msg.from?.id,r=typeof n.msg.to==`string`?n.msg.to:void 0;if(!e||!r||e===r)continue;let i=[e,r].sort(),a=i.join(Ie),o=t.get(a);o||t.set(a,o={parts:i,messages:[]}),o.messages.push(n)}let n=[];for(let[e,{parts:r,messages:i}]of t){i.sort((e,t)=>e.msg.ts-t.msg.ts);let t=i[0];n.push({key:e,parts:r,opener:t.senderId??t.msg.from?.id??r[0],messages:i,last:i[i.length-1]?.msg.ts??0,verified:i.every(e=>e.senderId!==void 0)})}return n}function ze(e){return Re(e).sort((e,t)=>t.last-e.last)}function Be(e,t){let n=Ne(t),r=new Map;for(let e of t)e.card?.id&&r.set(e.card.id,e);let i=e=>r.get(e)?.status??`offline`,a=new Map;for(let{key:t,parts:n,messages:r,last:i,verified:o}of Re(e))for(let e of n){let s=n[0]===e?n[1]:n[0],c=a.get(e);c||a.set(e,c={id:e,conversations:[],last:0}),c.conversations.push({key:t,with:s,messages:r,last:i,verified:o}),c.last=Math.max(c.last,i)}return[...a.values()].map(e=>({id:e.id,name:Fe(e.id,n),role:r.get(e.id)?.card?.role,status:i(e.id),conversations:e.conversations.sort((e,t)=>t.last-e.last),threads:e.conversations.length,last:e.last})).sort((e,t)=>t.last-e.last)}var Ve=[`waiting`,`working`,`idle`,`offline`],He=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},Ue=e=>{let t=He(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},We=e=>{let t=Ve.indexOf(e);return t===-1?Ve.length:t};function Ge(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>We(e.status)-We(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Me(e.card.name)??e.card.id,role:e.card.role,status:e.status,activity:e.activity,harness:He(e.card.meta,`connector`),host:He(e.card.meta,`host`),attention:e.attention,model:He(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...Ue(e.card.meta)}))}var Ke=e=>e.filter(e=>e.status===`waiting`);function qe(e){let t=e.filter(e=>e.status!==`offline`&&typeof e.ts==`number`).map(e=>e.ts);return t.length?Math.min(...t):void 0}var Je=e=>e.status;function Ye(e){if(!e||e.fresh)return;if(e.state===`unpopulated`)return{kind:`refused`,name:`roster`,reason:`observer presence snapshot still loading`};let t={kind:`refused`,name:`roster`,reason:`observer presence watch silent since ${Number.isFinite(e.staleSince)?new Date(e.staleSince).toISOString():`unknown`}`};return Number.isFinite(e.staleSince)?{...t,since:e.staleSince}:t}function W(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Xe=48,Ze=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Xe-t;return n},Qe=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},$e=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Xe;n+=i>>>1^-(i&1),t[r]=n}return t},et=384,tt=[],nt=Qe(Ze(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),rt=Qe(Ze(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),it=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,at=(()=>{let e=nt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=nt[n];i<nt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(nt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=nt[i];a<nt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),ot=Ze(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),st=Qe(Ze(`123333359346463635126536711576`)),ct=Ze(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),lt=Ze(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ut=$e(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),dt=(()=>{let e=new Int32Array(319).fill(-1),t=$e(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=$e(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),ft=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),pt=$e(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),mt=$e(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),ht=$e(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),gt=new Int32Array(987),_t=new Int32Array(987),vt=new Int32Array(987),yt=``,bt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<pt.length;r++)for(let i of ft[ht[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),bt[a*2]=yt.length,bt[a*2+1]=i.length,yt+=i),gt[n]=pt[r],_t[n]=mt[r],vt[n]=a,n++}}var xt=$e(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),St=Qe(Ze(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Ct=$e(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),wt=Ze(`ij`),Tt=Ze(``),Et=Ze(`1`),Dt={GROUP_COUNT:et,customValidatorNames:tt,edgeStart:nt,labelStart:rt,labelText:it,edgeTarget:at,nodeGroup:ot,nodeVlist:dt,vlistPat:st,vlistOps:ct,vlistRef:lt,vlistGroup:ut,litAnchor:gt,litGroup:_t,litPool:vt,poolOffsets:bt,poolText:yt,adjGid:xt,adjStart:St,adjTgt:Ct,patGid:wt,patTgt:Tt,postfixLookupGroups:Et,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ot=`line`in Error(),kt=-1,At=-1,jt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Mt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Nt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(jt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(jt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},te=n.cacheSize??8192,ne=n.prefix??e.prefix??``,re=ne===``?``:ne+`:`,ie=re.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,oe=-1,U=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(H=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,U=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(oe>=0){for(let e of ve[i])if(fe(t,oe,U,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return z.test(e)&&!ae.test(e)}case 3:return he(t.slice(se,ce));case 4:return V.test(t.slice(se,ce));default:return B.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=jt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||xe.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[We,Ge,Ke,qe]=Ue,Je=new Uint8Array(He),Ye=new Uint8Array(He),W=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[We,Ge,Ke,qe]=Ue;let e=new Uint8Array(He);e.set(Je),Je=e,Ye=new Uint8Array(He)},Xe=64,Ze=new Int32Array(Xe),Qe=new Int32Array(Xe),$e=new Int32Array(r),et=2048,tt=21,nt=new Float64Array(et),rt=new Int32Array(et),it=0,at=(e,t)=>{if(e===0&&t<r)return $e[t]===it?1:($e[t]=it,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>tt;for(;rt[i]===it;){if(nt[i]===n)return 1;i=i+1&et-1}return nt[i]=n,rt[i]=it,0},ot=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?kt:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Qe[t];if(r>n)continue;let i=Ze[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return kt},st=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&W();let _=n++;We[_]=p,Ge[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ke[_]=Ie[t],qe[_]=Le[t],Je[_]=Re[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Ke[_]=kt,Be(y,e,p,h,v,kt,0,0);continue}b=p+ie}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Ze[0]=0,Qe[0]=M,L=1);let te=At,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?At:P,ne=L),P!==At){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=At;else{let e=i[P],t=i[P+1],c=At;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Xe){Xe*=2;let e=new Int32Array(Xe);e.set(Ze),Ze=e;let t=new Int32Array(Xe);t.set(Qe),Qe=t}Ze[L]=r,Qe[L]=t+2,L++}}A===D&&(te=F<I?At:P,ne=L);let R=F<I?At:P,z,ae=!1;if(A>=0){if(ae=!0,z=ot(e,E,A,te,ne),z!==kt&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==kt&&t!==z&&(z=t,ae=!1)}else z===kt&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===kt?Ke[_]=kt:(V=+!!ae,B=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ke[_]=z,Je[_]=V,qe[_]=B),Be(y,e,p,h,v,z,B,V)}if(n===0)return``;if(n===1)return We[0]===0&&Ge[0]===t?e:e.slice(We[0],Ge[0]);if(n*k>et){for(;n*k>et;)et<<=1,tt--;nt=new Float64Array(et),rt=new Int32Array(et)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);it=it+1|0,it===0&&($e.fill(0),rt.fill(0),it=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ke[e];if(t===kt){Ye[e]=1;continue}let n=qe[e];if(at(n,t)===1)Ye[e]=0,f=!0;else if(Ye[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)at(n,x[e]);if(Je[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&at(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ye[m]){m++;continue}let t=We[m],r=Ge[m],i=m+1;for(;i<n&&Ye[i]&&We[i]===r+1&&e.charCodeAt(r)===32;)r=Ge[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ct=16384,lt=new Int32Array(ct*2),ut=0,dt=1,ft=Object.create(null),pt=Object.create(null),mt=new Map,ht=new Map,gt=0,_t=0,vt=()=>{ut^=ct,dt=dt+1|0,_t=0},yt=e=>{let t=ft[e];if(t!==void 0)return t;let n=Mt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=pt[e],t!==void 0)?(ft[e]=t,t):(t=st(e),i?(ft[e]=t,++gt>te&&(gt=0,pt=ft,ft=Object.create(null),vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},bt=e=>{let t=mt.get(e);if(t!==void 0)return t;let n=Mt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=ht.get(e),t!==void 0)?(mt.set(e,t),t):(t=st(e),i?(mt.set(e,t),++gt>te&&(gt=0,ht=mt,mt=new Map,vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},xt=e=>{let t=Mt(e,0,e.length),n=(t&16383)+ut;return lt[n]===(t^dt)||lt[n^ct]===(t^dt-1)||(lt[n]=t^dt,++_t>ct&&vt(),!1)},St=te===0?st:Ot?e=>{let t=mt.get(e);return t===void 0?bt(e):t}:yt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?St(arguments[0]):St(It.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},Pt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Pt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Ft=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Pt(i,t);a&&(n&&(n+=` `),n+=a)}return n},It=function(){return Ft(arguments,!1)},Lt=256,Rt=16,zt=1024,Bt=4096,Vt=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Bt).fill(``),l=Array(Bt).fill(``),u=Array(Bt).fill(``));let i=Mt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Pt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Rt&&(_.miss=Rt,_.skip=zt,_.e.length=0,_.at=0);let u=_.e;u.length<Lt?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Pt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ht=Nt(Dt),G=Vt(Ht.mergeString,Ht);Ht.merge;var Ut=Object.defineProperty,Wt=(e,t)=>Ut(e,`name`,{value:t,configurable:!0});function Gt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Wt(Gt,`setRef`);function Kt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Gt(e[t],null)}}}}Wt(Kt,`composeRefs`);function K(...e){return o.useCallback(Kt(...e),e)}Wt(K,`useComposedRefs`);var qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0});function Yt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=sn(r),o.Children.forEach(r,e=>{if(nn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;an(n)&&typeof dn==`function`;)n=dn(n._payload);a=$t(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?tn(a):void 0,u=K(n,l);if(!a){if(r||r===0)throw Error(s?un(e):ln(e));return r}let d=en(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Jt(Yt,`createSlot`);var Xt=Yt(`Slot`),Zt=Symbol.for(`radix.slottable`);function Qt(e){let t=Jt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Zt,t}Jt(Qt,`createSlottable`);var $t=Jt((e,t)=>`child`in e.props?o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null:o.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function en(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=cn(a,i))}return{...e,...n}}Jt(en,`mergeProps`);function tn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jt(tn,`getElementRef`);function nn(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zt}Jt(nn,`isSlottable`);var rn=Symbol.for(`react.lazy`);function an(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rn&&`_payload`in e&&on(e._payload)}Jt(an,`isLazyComponent`);function on(e){return typeof e==`object`&&!!e&&`then`in e}Jt(on,`isPromiseLike`);function sn(e){let t=e;for(;an(t)&&typeof dn==`function`;)t=dn(t._payload);return t}Jt(sn,`useUnwrappedLazy`);function cn(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Jt(cn,`concatAriaDescribedby`);var ln=Jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),un=Jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),dn=o.use,fn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),pn=t(((e,t)=>{t.exports=fn()})),q=pn(),mn=Object.defineProperty,hn=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Yt(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}hn(gn,`dispatchDiscreteCustomEvent`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),bn=o.forwardRef(vn(function(e,t){return(0,q.jsx)(J.span,{...e,ref:t,style:{...yn,...e.style}})},`VisuallyHidden`)),xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0});function Cn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=Sn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Sn(i,`useContext`),[r,i]}Sn(Cn,`createContext`);function wn(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=Sn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,q.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return Sn(c,`useContext`),[s,c]}Sn(r,`createContext`);let i=Sn(()=>{let t=n.map(e=>o.createContext(e));return Sn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Tn(i,...t)]}Sn(wn,`createContextScope`);function Tn(...e){let t=e[0];if(e.length===1)return t;let n=Sn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Sn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Sn(Tn,`composeContextScopes`);var En=globalThis?.document?o.useLayoutEffect:()=>{},Dn=Object.defineProperty,On=(e,t)=>Dn(e,`name`,{value:t,configurable:!0});function kn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=On(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Yt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(c,n).collectionRef);return(0,q.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Yt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=K(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,q.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return On(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}On(kn,`createCollection`);var An=new WeakMap,jn=class e extends Map{static{On(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],An.set(this,!0)}set(e,t){return An.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Pn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Mn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Mn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Mn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Mn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Nn(e,t);return n===-1?void 0:e[n]}On(Mn,`at`);function Nn(e,t){let n=e.length,r=Pn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}On(Nn,`toSafeIndex`);function Pn(e){return e!==e||e===0?0:Math.trunc(e)}On(Pn,`toSafeInteger`);function Fn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=On(({state:e,...t})=>e?(0,q.jsx)(d,{...t,state:e}):(0,q.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=On(e=>{let t=v();return(0,q.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=On(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=K(a,l),[d,f]=r,p=o.useRef(new jn),m=o.useCallback(()=>{let e=p.current;return Rn(e)||e.sort(zn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Bn(()=>{f(e=>{let t=e.toSorted(zn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,q.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,q.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Yt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(f,n).collectionElementRef);return(0,q.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Yt(h),_=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),{setCollection:c,registryRef:l}=a(h,n),u=o.useRef(i);In(u.current,i)||(u.current=i);let d=u.current,f=K(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);En(()=>{let e=s.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let p=o.useRef(null);return o.useEffect(()=>{let e=s.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(p.current=e?{element:e,itemData:d}:null,c(n=>{let r=new jn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(zn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new jn(t);return n.delete(e.element),n})},[c]),(0,q.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new jn)}On(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}On(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return On(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}On(Fn,`createCollection`);function In(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}On(In,`shallowEqual`);function Ln(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}On(Ln,`isElementPreceding`);function Rn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}On(Rn,`isInDocumentOrder`);function zn(e,t){return!e[1].element||!t[1].element?0:Ln(e[1].element,t[1].element)?-1:1}On(zn,`sortByDocumentPosition`);function Bn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}On(Bn,`getChildListObserver`);var Vn=Object.defineProperty,Hn=(e,t)=>Vn(e,`name`,{value:t,configurable:!0}),Un=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return Hn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Hn(Y,`composeEventHandlers`);function Wn(e){if(!Un)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Hn(Wn,`getOwnerWindow`);function Gn(e){if(!Un)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Hn(Gn,`getOwnerDocument`);function Kn(e,t=!1){let{activeElement:n}=Gn(e);if(!n?.nodeName)return null;if(qn(n)&&n.contentDocument)return Kn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gn(n).getElementById(e);if(t)return t}}return n}Hn(Kn,`getActiveElement`);function qn(e){return e.tagName===`IFRAME`}Hn(qn,`isFrame`);var Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=o.useEffectEvent,Zn=o.useInsertionEffect;function Qn(e){if(typeof Xn==`function`)return Xn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Zn==`function`?Zn(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Yn(Qn,`useEffectEvent`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),tr=o.useInsertionEffect||En;function nr({prop:e,defaultProp:t,onChange:n=er(()=>{},`onChange`),caller:r}){let[i,a,s]=rr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=ir(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}er(nr,`useControllableState`);function rr({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return tr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}er(rr,`useUncontrolledState`);function ir(e){return typeof e==`function`}er(ir,`isFunction`);var ar=Symbol(`RADIX:SYNC_STATE`);function or(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=Qn(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===ar)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=o.useRef(m);o.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=o.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return o.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:ar,state:i})},[i,f.state,l]),[g,p]}er(or,`useControllableStateReducer`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0});function lr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}cr(lr,`useStateMachine`);var ur=cr(e=>{let{present:t,children:n}=e,r=dr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=pr(r.ref,hr(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function dr(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=lr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??mr(r.current),s.current=void 0):a.current=`none`},[c]),En(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=mr(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),En(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=cr(a=>{let o=mr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=cr(e=>{e.target===t&&(a.current=mr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=mr(t)}else r.current=null;n(e)},[])}}cr(dr,`usePresence`);function fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}cr(fr,`setRef`);function pr(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=fr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():fr(n[e],null)}}},[])}cr(pr,`useStableComposedRefs`);function mr(e){return e?.animationName||`none`}cr(mr,`getAnimationName`);function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}cr(hr,`getElementRef`);var gr=Object.defineProperty,_r=(e,t)=>gr(e,`name`,{value:t,configurable:!0}),vr=o.useId||(()=>void 0),yr=0;function br(e){let[t,n]=o.useState(vr());return En(()=>{e||n(e=>e??String(yr++))},[e]),e||(t?`radix-${t}`:``)}_r(br,`useId`);var xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),Cr=`Collapsible`,[wr,Tr]=wn(Cr),[Er,Dr]=wr(Cr),Or=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=nr({prop:r,defaultProp:i??!1,onChange:s,caller:Cr});return(0,q.jsx)(Er,{scope:n,disabled:a,contentId:br(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,q.jsx)(J.div,{"data-state":Pr(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),kr=`CollapsibleTrigger`,Ar=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Dr(kr,n);return(0,q.jsx)(J.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Pr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),jr=`CollapsibleContent`,Mr=o.forwardRef(Sr(function(e,t){let{forceMount:n,...r}=e,i=Dr(jr,e.__scopeCollapsible);return(0,q.jsx)(ur,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Nr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Nr=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=Dr(jr,n),[c,l]=o.useState(r),u=o.useRef(null),d=K(t,u),f=o.useRef(0),p=f.current,m=o.useRef(0),h=m.current,g=s.open||c,_=o.useRef(g),v=o.useRef(void 0);return o.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),En(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,q.jsx)(J.div,{"data-state":Pr(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Pr(e){return e?`open`:`closed`}Sr(Pr,`getState`);var Fr=Object.defineProperty,Ir=(e,t)=>Fr(e,`name`,{value:t,configurable:!0}),Lr={LTR:`ltr`,RTL:`rtl`},Rr=o.createContext(void 0);function zr(e){let t=o.useContext(Rr);return e||t||Lr.LTR}Ir(zr,`useDirection`);var Br=Object.defineProperty,Vr=(e,t)=>Br(e,`name`,{value:t,configurable:!0}),Hr=o.useInsertionEffect;function Ur(e){let t=o.useRef(e);return typeof Hr==`function`?Hr(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vr(Ur,`useCallbackRef`);var Wr=Object.defineProperty,Gr=(e,t)=>Wr(e,`name`,{value:t,configurable:!0}),Kr=`dismissableLayer.update`,qr=`dismissableLayer.pointerDownOutside`,Jr=`dismissableLayer.focusOutside`,Yr,Xr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zr=o.forwardRef(Gr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(Xr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=K(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=o.useRef(!1),w=ei(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=ti(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Ur(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ni(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Yr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ni())},[f,d]),o.useEffect(()=>{let e=Gr(()=>h({}),`handleUpdate`);return document.addEventListener(Kr,e),()=>document.removeEventListener(Kr,e)},[]),(0,q.jsx)(J.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Qr(){let e=o.useContext(Xr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gr(Qr,`useDismissableLayerSurface`);var $r=Gr(()=>!0,`IS_TRUE`);function ei(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=$r}=t,c=Ur(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}Gr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}Gr(t,`isOutsideInteractionIntercepted`);function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}Gr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}Gr(p,`handleInteractionBubble`);let m=Gr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ri(qr,c,p,{discrete:!0})};if(Gr(o,`handleAndDispatchPointerDownOutsideEvent`),!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:Gr(()=>l.current=!0,`onPointerDownCapture`)}}Gr(ei,`usePointerDownOutside`);function ti(e,t=globalThis?.document){let n=Ur(e),r=o.useRef(!1);return o.useEffect(()=>{let e=Gr(e=>{e.target&&!r.current&&ri(Jr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gr(()=>r.current=!1,`onBlurCapture`)}}Gr(ti,`useFocusOutside`);function ni(){let e=new CustomEvent(Kr);document.dispatchEvent(e)}Gr(ni,`dispatchUpdate`);function ri(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?gn(i,a):i.dispatchEvent(a)}Gr(ri,`handleAndDispatchCustomEvent`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),oi=`focusScope.autoFocusOnMount`,si=`focusScope.autoFocusOnUnmount`,ci={bubbles:!1,cancelable:!0},li=o.forwardRef(ai(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Ur(a),f=Ur(s),p=o.useRef(null),m=K(t,u),h=o.useRef(i);o.useEffect(()=>{h.current=i});let g=o.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:bi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||bi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bi(l)};ai(e,`handleFocusIn`),ai(t,`handleFocusOut`),ai(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused,g]),o.useEffect(()=>{if(l){xi.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(oi,ci);l.addEventListener(oi,d),l.dispatchEvent(t),t.defaultPrevented||(mi(wi(gi(l)),{select:!0}),document.activeElement===e&&bi(l))}return()=>{l.removeEventListener(oi,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(si,ci);l.addEventListener(si,f),l.dispatchEvent(r),r.defaultPrevented||bi(e??t.body,{select:!0}),l.removeEventListener(si,f),xi.remove(_)},0)}}},[l,d,f,_]);let v=o.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,q.jsx)(J.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),ui=o.createContext(null);function di({registry:e,children:t}){return e?(0,q.jsx)(ui.Provider,{value:e,children:t}):t}ai(di,`FocusScopeBranchProvider`);function fi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:ai(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ai(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ai(fi,`useFocusScopeBranchRegistry`);function pi(e){let t=o.useContext(ui);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ai(pi,`useFocusScopeBranch`);function mi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bi(r,{select:t}),document.activeElement!==n)return}ai(mi,`focusFirst`);function hi(e){let t=gi(e);return[_i(t,e),_i(t.reverse(),e)]}ai(hi,`getTabbableEdges`);function gi(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ai(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ai(gi,`getTabbableCandidates`);function _i(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vi(r,{upTo:t})))return r}ai(_i,`findVisible`);function vi(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ai(vi,`isHidden`);function yi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ai(yi,`isSelectableInput`);function bi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&yi(e)&&t&&e.select()}}ai(bi,`focus`);var xi=Si();function Si(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ci(e,t),e.unshift(t)},remove(t){e=Ci(e,t),e[0]?.resume()}}}ai(Si,`createFocusScopesStack`);function Ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ai(Ci,`arrayRemove`);function wi(e){return e.filter(e=>e.tagName!==`A`)}ai(wi,`removeLinks`);var Ti=Object.defineProperty,Ei=o.forwardRef(((e,t)=>Ti(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);En(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,q.jsx)(J.div,{...r,ref:t}),c):null},`Portal`)),Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=0,Ai=null;function ji(e){return Mi(),e.children}Oi(ji,`FocusGuards`);function Mi(){o.useEffect(()=>{Ai||={start:Ni(),end:Ni()};let{start:e,end:t}=Ai;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ki++,()=>{ki===1&&(Ai?.start.remove(),Ai?.end.remove(),Ai=null),ki=Math.max(0,ki-1)}},[])}Oi(Mi,`useFocusGuards`);function Ni(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Oi(Ni,`createFocusGuard`);var Pi=function(){return Pi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pi.apply(this,arguments)};function Fi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ii(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Li=`right-scroll-bar-position`,Ri=`width-before-scroll-bar`,zi=`with-scroll-bars-hidden`,Bi=`--removed-body-scroll-bar-size`;function Vi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Hi(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ui=typeof window<`u`?o.useLayoutEffect:o.useEffect,Wi=new WeakMap;function Gi(e,t){var n=Hi(t||null,function(t){return e.forEach(function(e){return Vi(e,t)})});return Ui(function(){var t=Wi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Vi(e,null)}),i.forEach(function(e){r.has(e)||Vi(e,a)})}Wi.set(n,e)},[e]),n}function Ki(e){return e}function qi(e,t){t===void 0&&(t=Ki);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ji(e){e===void 0&&(e={});var t=qi(null);return t.options=Pi({async:!0,ssr:!1},e),t}var Yi=function(e){var t=e.sideCar,n=Fi(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,Pi({},n))};Yi.isSideCarExport=!0;function Xi(e,t){return e.useMedium(t),Yi}var Zi=Ji(),Qi=function(){},$i=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Qi,onWheelCapture:Qi,onTouchMoveCapture:Qi}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Fi(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Gi([n,t]),w=Pi(Pi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Zi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Pi(Pi({},w),{ref:C})):o.createElement(y,Pi({},w,{className:l,ref:C}),c))});$i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$i.classNames={fullWidth:Ri,zeroRight:Li};var ea=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ta(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ea();return t&&e.setAttribute(`nonce`,t),e}function na(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ra(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ia=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ta())&&(na(t,n),ra(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aa=function(){var e=ia();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oa=function(){var e=aa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sa={left:0,top:0,right:0,gap:0},ca=function(e){return parseInt(e||``,10)||0},la=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ca(n),ca(r),ca(i)]},ua=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sa;var t=la(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},da=oa(),fa=`data-scroll-locked`,pa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),a=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e(r(),1),s=e(a(),1),c=e=>e.kind===`msg`?`msg\u0001${e.channel}`:`dm\u0001${e.to}`;function l(e,t){if(e.view===`channel`)return{kind:`msg`,channel:e.channel};if(e.view!==`dm`)return;let n=t??void 0;if(e.with===void 0)return e.peer===n?void 0:{kind:`dm`,to:e.peer};if(e.peer===n)return{kind:`dm`,to:e.with};if(e.with===n)return{kind:`dm`,to:e.peer}}var u=`You'll show on the roster as operator when you post. Replies come to your DMs.`;function d(e){return e.mode===`participant`?u:e.reason===`This dashboard was started with --creds, which can only read.`?"Restart `cotal web` without `--creds` to post here.":``}function f(e){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function p(e){return e.kind===`msg`?`cotal send -c ${f(e.channel)} "<text>"`:`cotal send -t ${f(e.to)} "<text>"`}function m(e,t){return t?{view:`dm`,peer:e,with:t}:{view:`dm`,peer:e}}function h(e,t){if(e!==null)return e.mode===`off`?{text:`Read only`,title:e.reason}:t?{text:`On the roster`,title:`You show on the roster as operator once you post, so agents can reply to you.`}:{text:`Not on the roster`,title:u}}var g=class extends Error{status;error;constructor(e,t){super(t),this.status=e,this.error=t,this.name=`SendRefused`}};async function _(e){let t=``;try{let n=await e.json();n&&typeof n.error==`string`&&(t=n.error)}catch{}return new g(e.status,t)}function v(e,t){let n=t instanceof g?t.status:void 0,r=(t instanceof g?t.error:t instanceof Error?t.message:String(t)).trim()||(n===void 0?`the request failed`:`HTTP ${n}`),i=/[.?!]$/.test(r)?r:`${r}.`;return`Couldn't post to ${e}. ${n===502?`The broker refused it: ${i}`:i} Your message is still here.`}async function y(e,t){if(!e.ok){let n=``;try{let t=await e.json();t&&typeof t.error==`string`&&(n=`: ${t.error}`)}catch{}throw Error(`${t} refused with HTTP ${e.status}${n}`)}return e.json()}async function b(e){let t=await Promise.all(e.map(async e=>{try{return{value:await e.read()}}catch(e){return{error:e}}})),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(`error`in i){let t=i.error;n.push({kind:`refused`,name:e[r].name,reason:t&&t.message?t.message:String(i.error)})}else e[r].apply(i.value)}return n}function x(e){if(!e.length)return``;let t=e.filter(e=>e.kind!==`partial`).map(e=>e.name),n=e.filter(e=>e.kind===`partial`).map(e=>e.name),r=[];return t.length&&r.push(`stale: ${t.join(`, `)}`),n.length&&r.push(`partial: ${n.join(`, `)}`),r.join(` · `)}var S=new Map;function C(e,t){S.set(e,t)}function w(e){if(e.kind===`text`)return e.text;if(e.kind===`artifact`)return`[artifact ${e.name} (${e.mediaType}, ${e.size} bytes) ${e.digest}]`;if(e.kind===`data`){let t=JSON.stringify(e.data);return t===void 0?`[empty data part]`:t}let t=e.kind,n=S.has(t)?S.get(t):void 0;if(typeof n==`function`){let r;try{r=n(e)}catch(e){let n=e;return`[renderer for part kind ${JSON.stringify(t)} failed: ${n&&n.message?n.message:String(e)}]`}return typeof r==`string`?r:`[renderer for part kind ${JSON.stringify(t)} returned ${typeof r}, expected a string]`}let r=JSON.stringify(e.data);return r===void 0?`[unrenderable part kind ${JSON.stringify(t)} \u2014 no renderer for it on this surface]`:`[${t}] ${r}`}function T(e){return(e||[]).map(e=>w(e)).join(` `)}function E(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CUSTOM`||t.name!==`cotal.toolResult`)return;let n=t.value;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=Object.keys(n);if(r.length!==2||!r.includes(`toolCallId`)||!r.includes(`isError`))return;let i=n;if(typeof i.toolCallId==`string`&&typeof i.isError==`boolean`)return{toolCallId:i.toolCallId,isError:i.isError}}function D(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}var O=e=>`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,k=e=>{let t=D(e);return t&&O(t)},A=2e3,j=`ag-ui.frame`,M=e=>typeof e==`string`?e:void 0,N=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,P=class{label;constructor(e){this.label=e}};function F(e,t){if(typeof e.id!=`string`)return[];let n=Array.isArray(e.parts)?e.parts:[],r=[];for(let i of n){if(typeof i!=`object`||!i||i.kind!==j)continue;let n=i.events,a=r.length===0?e.id:`${e.id}#${r.length}`;r.push({id:a,ts:e.ts,events:Array.isArray(n)&&n.length>0?n:[new P(`A frame with no events`)],live:t})}return r.length>0?r:[{id:e.id,ts:e.ts,events:[new P(T(n))],live:t}]}function I(e){let t=e.lastIndexOf(`__`);return t<0?e:e.slice(t+2)}var ee=new Map([[`Bash`,`command`],[`Edit`,`edit`],[`MultiEdit`,`edit`],[`NotebookEdit`,`edit`],[`Write`,`write`],[`Read`,`read`],[`cotal_send`,`send`],[`cotal_dm`,`dm`],[`cotal_inbox`,`inbox`]]);function L(e){return ee.get(e)??`other`}function te(e){let t=/^events\.([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return t?`${t[1]}.${t[2]}`:void 0}function ne(e){let t=0;for(let n of e)t+=n.events.length;return t}var re=new Map([[`human`,`prompt`],[`sdk`,`prompt`],[`channel`,`mesh`],[`auto-continuation`,`continuation`],[`notification`,`notification`]]);function ie(e){let t=e.cotal,n=typeof t==`object`&&t?M(t.turnSource):void 0;return n===void 0?void 0:re.get(n)}function R(e){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=!1,s=(e,t,n,r,i)=>{let a=e.get(t);if(a!==void 0)return a.at=r,a.live=a.live&&i,a;let o={text:``,user:!1,key:n,at:r,live:i};return e.set(t,o),o},c=(e,t,n,r,i)=>{let a=s(e,t,n,r,i);return a.text=``,a.user=!1,a.key=n,a.live=i,a},l=(e,n,r,i,a,o=!0)=>{let s=e.get(n);if(e.delete(n),s===void 0||s.text.length===0)return;let c=r===`said`&&s.user?`prompt`:r;t.push({item:{kind:c,key:s.key,text:s.text,cut:i},at:a??s.at,live:s.live&&o})},u=()=>{for(let e of[...n.keys()])l(n,e,`said`,!0);for(let e of[...r.keys()])l(r,e,`reasoning`,!0)};for(let d of e){let e=N(d.ts);d.events.forEach((f,p)=>{let m=`${d.id}:${p}`,h=d.live;if(f instanceof P){t.push({item:{kind:`unknown`,key:m,label:f.label,ts:e},at:e,live:h});return}let g=f,_=typeof g==`object`&&!!g,v=_?M(g.type):void 0,y=(_?N(g.timestamp):void 0)??e;switch((v===`RUN_STARTED`||v===`RUN_FINISHED`||v===`RUN_ERROR`)&&u(),v){case`RUN_STARTED`:{let e=ie(g);t.push({item:{kind:`turn`,key:m,ts:y,...e?{source:e}:{}},at:y,live:h});break}case`RUN_FINISHED`:t.push({item:{kind:`turnEnd`,key:m,ts:y},at:y,live:h});break;case`RUN_ERROR`:t.push({item:{kind:`runError`,key:m,ts:y},at:y,live:h});break;case`TEXT_MESSAGE_START`:c(n,M(g.messageId)??``,m,y,h).user=M(g.role)===`user`;break;case`TEXT_MESSAGE_CONTENT`:{let e=s(n,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`TEXT_MESSAGE_END`:l(n,M(g.messageId)??``,`said`,!1,y,h);break;case`REASONING_MESSAGE_START`:c(r,M(g.messageId)??``,m,y,h);break;case`REASONING_MESSAGE_CONTENT`:{let e=s(r,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`REASONING_MESSAGE_END`:l(r,M(g.messageId)??``,`reasoning`,!1,y,h);break;case`TOOL_CALL_START`:{let e=M(g.toolCallName)??`?`,n=I(e),r={key:m,id:M(g.toolCallId)??``,name:n,full:e,kind:L(n),...y===void 0?{}:{ts:y},live:h};if(r.id!==``){i.set(r.id,r);let e=a.get(r.id);e&&(r.input=e.input,r.result=e.result,r.live=r.live&&e.live,a.delete(r.id))}t.push({call:r,at:y,live:h});break}case`TOOL_CALL_END`:break;case`TOOL_CALL_ARGS`:case`TOOL_CALL_RESULT`:{let e=M(g.toolCallId)??``,t=i.get(e),n=M(v===`TOOL_CALL_ARGS`?g.delta:g.content);if(n!==void 0&&e!==``){let r=t??a.get(e)??{live:h};v===`TOOL_CALL_ARGS`?r.input=(r.input??``)+n:r.result=n,r.live=r.live&&h,t||a.set(e,r)}break}case`CUSTOM`:{let e=E(g);if(e!==void 0){o=!0;let t=i.get(e.toolCallId);t!==void 0&&(y!==void 0&&(t.end=y),t.failed=e.isError,t.live=t.live&&h);break}t.push({item:{kind:`unknown`,key:m,label:`Custom event ${M(g.name)===void 0?`(unnamed)`:JSON.stringify(g.name)}`,ts:y},at:y,live:h});break}default:t.push({item:{kind:`unknown`,key:m,label:`Unrecognised event ${JSON.stringify(v??null)}`,ts:y},at:y,live:h})}})}return u(),{flat:t,marked:o}}function z(e,t){return e.filter(e=>t(e.msg)).map((e,t)=>({msg:e.msg,i:t,at:N(e.msg.ts)})).sort((e,t)=>(e.at??1/0)-(t.at??1/0)||e.i-t.i).map(({msg:e,at:t})=>({msg:e,at:t}))}function ae(e,t){let n=(e,t)=>e!==void 0&&t!==void 0&&e<t,r=[],i=0;for(let a of e){for(;i<t.length&&n(t[i].at,a.at);)r.push(t[i++]);r.push(a)}for(;i<t.length;)r.push(t[i++]);return r}function B(e,t){let{flat:n,marked:r}=R(e),i=z(t,e=>typeof e.channel==`string`||typeof e.to==`string`).map(({msg:e,at:t})=>({post:{kind:`post`,key:`post:${e.id}`,msg:e,...typeof e.channel==`string`?{channel:e.channel}:{to:e.to},live:!0},at:t})),a=[],o,s,c=e=>{s=void 0,(o?.steps??a).push(e)},l=(e,t,n)=>{o!==void 0&&(o.outcome=e,t!==void 0&&(o.end=t),o.live=o.live&&n,o=void 0)};for(let e of ae(n,i)){if(`post`in e){c(e.post);continue}if(`call`in e){if(s!==void 0)s.calls.push(e.call),s.live=s.live&&e.call.live;else{let t={kind:`tools`,key:e.call.key,calls:[e.call],live:e.call.live};c(t),s=t}continue}let t=e.item;switch(t.kind){case`turn`:s=void 0,o!==void 0&&(o.superseded=!0),o={kind:`turn`,key:t.key,...t.ts===void 0?{}:{start:t.ts},outcome:`open`,superseded:!1,...t.source?{source:t.source}:{},steps:[],live:e.live},a.push(o);break;case`turnEnd`:s=void 0,o===void 0?a.push({kind:`turnEnd`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}):l(`finished`,t.ts,e.live);break;case`runError`:c({kind:`runError`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}),l(`failed`,t.ts,e.live);break;case`said`:case`prompt`:case`reasoning`:c({...t,...e.at===void 0?{}:{ts:e.at},live:e.live});break;case`unknown`:c({...t,live:e.live})}}let u=a.some(e=>e.kind===`turn`&&e.outcome!==`open`&&e.steps.some(e=>e.kind===`tools`));return{items:a,toolStatus:r||!u}}function V(e,t){if(e.failed!==void 0)return e.failed?`failed`:`done`;if(!t.toolStatus||!t.trailing)return`called`;let n=t.turn;return n===void 0||n.outcome!==`open`||n.superseded?`noResult`:t.status===`working`?`running`:t.status===`waiting`?`pending`:`noResult`}var H={command:{title:{running:`Running a command`,done:`Ran a command`,failed:`A command failed`,pending:`A command hasn't finished`,noResult:`No result arrived for a command`},one:`ran a command`,many:`ran # commands`,noun:[`command`,`commands`]},edit:{title:{running:`Editing a file`,done:`Edited a file`,failed:`An edit failed`,pending:`An edit hasn't finished`,noResult:`No result arrived for an edit`},one:`made an edit`,many:`made # edits`,noun:[`edit`,`edits`]},write:{title:{running:`Writing a file`,done:`Wrote a file`,failed:`A write failed`,pending:`A write hasn't finished`,noResult:`No result arrived for a write`},one:`wrote a file`,many:`wrote # times`,noun:[`write`,`writes`]},read:{title:{running:`Reading a file`,done:`Read a file`,failed:`A read failed`,pending:`A read hasn't finished`,noResult:`No result arrived for a read`},one:`read a file`,many:`read # times`,noun:[`read`,`reads`]},send:{title:{running:`Sending a message`,done:`Sent a message`,failed:`A message failed`,pending:`A message hasn't finished`,noResult:`No result arrived for a message`},one:`sent a message`,many:`sent # messages`,noun:[`message`,`messages`]},dm:{title:{running:`Sending a direct message`,done:`Sent a direct message`,failed:`A direct message failed`,pending:`A direct message hasn't finished`,noResult:`No result arrived for a direct message`},one:`sent a direct message`,many:`sent # direct messages`,noun:[`direct message`,`direct messages`]},inbox:{title:{running:`Checking the inbox`,done:`Checked the inbox`,failed:`An inbox check failed`,pending:`An inbox check hasn't finished`,noResult:`No result arrived for an inbox check`},one:`checked the inbox`,many:`checked the inbox # times`,noun:[`inbox check`,`inbox checks`]},other:{title:{running:`Using a tool`,done:`Used a tool`,failed:`A tool call failed`,pending:`A tool call hasn't finished`,noResult:`No result arrived for a tool call`},one:`called a tool`,many:`called # tools`,noun:[`tool call`,`tool calls`]}},oe={one:`called another tool`,many:`called # other tools`},U=e=>e.charAt(0).toUpperCase()+e.slice(1),se=(e,t)=>t===1?e.one:e.many.replace(`#`,String(t)),ce=(e,t,n)=>`${e} ${e===1?t:n}`;function le(e,t=64){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function ue(e,t,n){return t===`called`?`Called ${le(n)}`:H[e].title[t]}function de(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>le(e.name));return{title:`Called ${t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} and ${t.at(-1)}`}`,failed:n}}let r=new Map;for(let t of e)r.set(t.kind,(r.get(t.kind)??0)+1);let i=r.size>1;return{title:U([...r].map(([e,t])=>se(e===`other`&&i?oe:H[e],t)).join(`, `)),failed:n}}var fe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function pe(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ve(t-e,!1),i=(e,t,n)=>t===void 0?n:`${e} ${t}`,a;a=e.outcome===`finished`?i(`Worked for`,r(e.start,e.end),`Worked`):e.outcome===`failed`?i(`Turn failed after`,r(e.start,e.end),`Turn failed`):e.superseded||t!==`working`&&t!==`waiting`?`No end arrived for this turn`:t===`working`?i(`Working for`,r(e.start,n),`Working`):i(`Open for`,r(e.start,n),`Turn open`);let o=fe(e).filter(e=>e.failed===!0);if(o.length===0)return{title:a};let[s,c]=new Set(o.map(e=>e.kind)).size===1?H[o[0].kind].noun:[`call`,`calls`];return{title:a,failed:`${ce(o.length,s,c)} failed`}}var me={prompt:`started by a prompt`,mesh:`started by a message from the mesh`,continuation:`started by the harness continuing itself`,notification:`started by a notification`};function he(e){let t=[],n=k(e.start),r=k(e.end);e.outcome===`open`?n!==void 0&&t.push(`since ${n}`):n!==void 0&&r!==void 0&&t.push(n===r?n:`${n} to ${r}`),e.source!==void 0&&t.push(me[e.source]);let i=0;for(let t of e.steps)t.kind===`tools`?i+=t.calls.length:(t.kind===`said`||t.kind===`prompt`||t.kind===`reasoning`||t.kind===`post`)&&i++;t.push(ce(i,`step`,`steps`));let a=e.steps.find(e=>e.kind===`post`&&e.channel!==void 0);return a?.kind===`post`&&t.push(`posted in #${a.channel}`),t.join(` · `)}function ge(e,t,n){let r=k(e.ts);if(t===`called`)return r??``;let i;i=t===`done`||t===`failed`?e.ts===void 0||e.end===void 0?void 0:ve(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ve(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=le(e.name);return i===void 0?a:`${a} · ${i}`}function _e(e,t){if(t){let t=ce(e.length,`step`,`steps`),n=e.length>0&&e.every(e=>e.ts!==void 0&&e.end!==void 0)?ve(Math.max(...e.map(e=>e.end))-e[0].ts,!0):void 0;return n===void 0?t:`${t} · ${n}`}let n=ce(e.length,`call`,`calls`),r=k(e[0]?.ts),i=k(e.at(-1)?.ts),a=r===void 0?i:i===void 0||i===r?r:`${r} to ${i}`;return a===void 0?n:`${n} · ${a}`}function ve(e,t){if(!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3);return n<60?t?`${(Math.floor(e/100)/10).toFixed(1)}s`:`${n}s`:n<3600?`${Math.floor(n/60)}m ${n%60}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}var ye=[`work`,`messages`,`profile`],be=e=>ye.includes(e),xe={view:`activity`},Se={view:`topology`},Ce=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function we(e){try{return decodeURIComponent(e)}catch{return}}function Te(e){let t=e.replace(/^#/,``).split(`/`);if(t[0]!==``)return;let[,n,r,i,a,...o]=t;if(!(o.length>0||a!==void 0&&n!==`agent`))switch(n){case`channel`:{if(!r||i!==void 0)return;let e=we(r);if(!e)return;let t=te(e);return t?{view:`agent`,id:t,tab:`work`}:{view:`channel`,channel:e}}case`agent`:{if(!r)return;let e=we(r);if(!e||!Ce.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(be(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:we(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:we(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=we(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:we(i);return t?{view:`dm`,peer:e,with:t}:void 0}case`agents`:return i===void 0?r===void 0||r===`status`?{view:`agents`,group:`status`}:r===`host`?{view:`agents`,group:`host`}:void 0:void 0;case`activity`:case`topology`:case`needs`:return r===void 0?{view:n}:void 0;default:return}}function Ee(e,t){return Te(e)??(t===`/graph`?Se:xe)}function De(e){switch(e.view){case`channel`:return`#/channel/${encodeURIComponent(e.channel)}`;case`dm`:return`#/dm/${encodeURIComponent(e.peer)}${e.with===void 0?``:`/${encodeURIComponent(e.with)}`}`;case`agents`:return e.group===`status`?`#/agents`:`#/agents/${e.group}`;case`agent`:{let t=`#/agent/${encodeURIComponent(e.id)}`;return e.at===void 0?e.tab===`work`?t:`${t}/${e.tab}`:`${t}/work/${encodeURIComponent(e.at)}`}default:return`#/${e.view}`}}function Oe(e){return Ee(e.location.hash,e.location.pathname)}function ke(e,t){let n=()=>t(Oe(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function Ae(e,t){if(t.view!==`agent`)return;let n=De(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function je(e,t){e.location.hash=De(t)}function Me(e){return typeof e==`string`&&e.trim()?e:void 0}function Ne(e){let t=new Map;for(let n of e){let e=Me(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Pe=`operator (you)`;function Fe(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Pe;if(typeof e==`object`)return Fe(e.id,t);let r=t.get(e);if(Me(r))return r;let i=/^([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return i&&i[2].length>=32?`${i[1]}.${i[2].slice(0,6)}…`:/^[A-Z2-7]{32,}$/.test(e)?e.slice(0,6)+`…`:e}var Ie=``,Le=(e,t)=>[e,t].sort().join(Ie);function Re(e){let t=new Map;for(let n of e){let e=n.senderId??n.msg.from?.id,r=typeof n.msg.to==`string`?n.msg.to:void 0;if(!e||!r||e===r)continue;let i=[e,r].sort(),a=i.join(Ie),o=t.get(a);o||t.set(a,o={parts:i,messages:[]}),o.messages.push(n)}let n=[];for(let[e,{parts:r,messages:i}]of t){i.sort((e,t)=>e.msg.ts-t.msg.ts);let t=i[0];n.push({key:e,parts:r,opener:t.senderId??t.msg.from?.id??r[0],messages:i,last:i[i.length-1]?.msg.ts??0,verified:i.every(e=>e.senderId!==void 0)})}return n}function ze(e){return Re(e).sort((e,t)=>t.last-e.last)}function Be(e,t){let n=Ne(t),r=new Map;for(let e of t)e.card?.id&&r.set(e.card.id,e);let i=e=>r.get(e)?.status??`offline`,a=new Map;for(let{key:t,parts:n,messages:r,last:i,verified:o}of Re(e))for(let e of n){let s=n[0]===e?n[1]:n[0],c=a.get(e);c||a.set(e,c={id:e,conversations:[],last:0}),c.conversations.push({key:t,with:s,messages:r,last:i,verified:o}),c.last=Math.max(c.last,i)}return[...a.values()].map(e=>({id:e.id,name:Fe(e.id,n),role:r.get(e.id)?.card?.role,status:i(e.id),conversations:e.conversations.sort((e,t)=>t.last-e.last),threads:e.conversations.length,last:e.last})).sort((e,t)=>t.last-e.last)}var Ve=[`waiting`,`working`,`idle`,`offline`],He=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},Ue=e=>{let t=He(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},We=e=>{let t=Ve.indexOf(e);return t===-1?Ve.length:t};function Ge(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>We(e.status)-We(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Me(e.card.name)??e.card.id,role:Me(e.card.role),status:e.status,activity:e.activity,harness:He(e.card.meta,`connector`),host:He(e.card.meta,`host`),attention:e.attention,model:He(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...Ue(e.card.meta)}))}var Ke=e=>e.filter(e=>e.status===`waiting`);function qe(e){let t=e.filter(e=>e.status!==`offline`&&typeof e.ts==`number`).map(e=>e.ts);return t.length?Math.min(...t):void 0}var Je=e=>e.status;function Ye(e){if(!e||e.fresh)return;if(e.state===`unpopulated`)return{kind:`refused`,name:`roster`,reason:`observer presence snapshot still loading`};let t={kind:`refused`,name:`roster`,reason:`observer presence watch silent since ${Number.isFinite(e.staleSince)?new Date(e.staleSince).toISOString():`unknown`}`};return Number.isFinite(e.staleSince)?{...t,since:e.staleSince}:t}function W(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Xe=48,Ze=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Xe-t;return n},Qe=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},$e=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Xe;n+=i>>>1^-(i&1),t[r]=n}return t},et=384,tt=[],nt=Qe(Ze(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),rt=Qe(Ze(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),it=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,at=(()=>{let e=nt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=nt[n];i<nt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(nt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=nt[i];a<nt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),ot=Ze(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),st=Qe(Ze(`123333359346463635126536711576`)),ct=Ze(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),lt=Ze(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ut=$e(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),dt=(()=>{let e=new Int32Array(319).fill(-1),t=$e(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=$e(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),ft=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),pt=$e(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),mt=$e(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),ht=$e(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),gt=new Int32Array(987),_t=new Int32Array(987),vt=new Int32Array(987),yt=``,bt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<pt.length;r++)for(let i of ft[ht[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),bt[a*2]=yt.length,bt[a*2+1]=i.length,yt+=i),gt[n]=pt[r],_t[n]=mt[r],vt[n]=a,n++}}var xt=$e(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),St=Qe(Ze(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Ct=$e(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),wt=Ze(`ij`),Tt=Ze(``),Et=Ze(`1`),Dt={GROUP_COUNT:et,customValidatorNames:tt,edgeStart:nt,labelStart:rt,labelText:it,edgeTarget:at,nodeGroup:ot,nodeVlist:dt,vlistPat:st,vlistOps:ct,vlistRef:lt,vlistGroup:ut,litAnchor:gt,litGroup:_t,litPool:vt,poolOffsets:bt,poolText:yt,adjGid:xt,adjStart:St,adjTgt:Ct,patGid:wt,patTgt:Tt,postfixLookupGroups:Et,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ot=`line`in Error(),kt=-1,At=-1,jt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Mt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Nt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(jt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(jt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},te=n.cacheSize??8192,ne=n.prefix??e.prefix??``,re=ne===``?``:ne+`:`,ie=re.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,oe=-1,U=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(H=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,U=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(oe>=0){for(let e of ve[i])if(fe(t,oe,U,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return z.test(e)&&!ae.test(e)}case 3:return he(t.slice(se,ce));case 4:return V.test(t.slice(se,ce));default:return B.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=jt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||xe.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[We,Ge,Ke,qe]=Ue,Je=new Uint8Array(He),Ye=new Uint8Array(He),W=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[We,Ge,Ke,qe]=Ue;let e=new Uint8Array(He);e.set(Je),Je=e,Ye=new Uint8Array(He)},Xe=64,Ze=new Int32Array(Xe),Qe=new Int32Array(Xe),$e=new Int32Array(r),et=2048,tt=21,nt=new Float64Array(et),rt=new Int32Array(et),it=0,at=(e,t)=>{if(e===0&&t<r)return $e[t]===it?1:($e[t]=it,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>tt;for(;rt[i]===it;){if(nt[i]===n)return 1;i=i+1&et-1}return nt[i]=n,rt[i]=it,0},ot=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?kt:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Qe[t];if(r>n)continue;let i=Ze[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return kt},st=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&W();let _=n++;We[_]=p,Ge[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ke[_]=Ie[t],qe[_]=Le[t],Je[_]=Re[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Ke[_]=kt,Be(y,e,p,h,v,kt,0,0);continue}b=p+ie}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Ze[0]=0,Qe[0]=M,L=1);let te=At,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?At:P,ne=L),P!==At){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=At;else{let e=i[P],t=i[P+1],c=At;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Xe){Xe*=2;let e=new Int32Array(Xe);e.set(Ze),Ze=e;let t=new Int32Array(Xe);t.set(Qe),Qe=t}Ze[L]=r,Qe[L]=t+2,L++}}A===D&&(te=F<I?At:P,ne=L);let R=F<I?At:P,z,ae=!1;if(A>=0){if(ae=!0,z=ot(e,E,A,te,ne),z!==kt&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==kt&&t!==z&&(z=t,ae=!1)}else z===kt&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===kt?Ke[_]=kt:(V=+!!ae,B=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ke[_]=z,Je[_]=V,qe[_]=B),Be(y,e,p,h,v,z,B,V)}if(n===0)return``;if(n===1)return We[0]===0&&Ge[0]===t?e:e.slice(We[0],Ge[0]);if(n*k>et){for(;n*k>et;)et<<=1,tt--;nt=new Float64Array(et),rt=new Int32Array(et)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);it=it+1|0,it===0&&($e.fill(0),rt.fill(0),it=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ke[e];if(t===kt){Ye[e]=1;continue}let n=qe[e];if(at(n,t)===1)Ye[e]=0,f=!0;else if(Ye[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)at(n,x[e]);if(Je[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&at(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ye[m]){m++;continue}let t=We[m],r=Ge[m],i=m+1;for(;i<n&&Ye[i]&&We[i]===r+1&&e.charCodeAt(r)===32;)r=Ge[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ct=16384,lt=new Int32Array(ct*2),ut=0,dt=1,ft=Object.create(null),pt=Object.create(null),mt=new Map,ht=new Map,gt=0,_t=0,vt=()=>{ut^=ct,dt=dt+1|0,_t=0},yt=e=>{let t=ft[e];if(t!==void 0)return t;let n=Mt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=pt[e],t!==void 0)?(ft[e]=t,t):(t=st(e),i?(ft[e]=t,++gt>te&&(gt=0,pt=ft,ft=Object.create(null),vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},bt=e=>{let t=mt.get(e);if(t!==void 0)return t;let n=Mt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=ht.get(e),t!==void 0)?(mt.set(e,t),t):(t=st(e),i?(mt.set(e,t),++gt>te&&(gt=0,ht=mt,mt=new Map,vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},xt=e=>{let t=Mt(e,0,e.length),n=(t&16383)+ut;return lt[n]===(t^dt)||lt[n^ct]===(t^dt-1)||(lt[n]=t^dt,++_t>ct&&vt(),!1)},St=te===0?st:Ot?e=>{let t=mt.get(e);return t===void 0?bt(e):t}:yt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?St(arguments[0]):St(It.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},Pt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Pt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Ft=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Pt(i,t);a&&(n&&(n+=` `),n+=a)}return n},It=function(){return Ft(arguments,!1)},Lt=256,Rt=16,zt=1024,Bt=4096,Vt=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Bt).fill(``),l=Array(Bt).fill(``),u=Array(Bt).fill(``));let i=Mt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Pt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Rt&&(_.miss=Rt,_.skip=zt,_.e.length=0,_.at=0);let u=_.e;u.length<Lt?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Pt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ht=Nt(Dt),G=Vt(Ht.mergeString,Ht);Ht.merge;var Ut=Object.defineProperty,Wt=(e,t)=>Ut(e,`name`,{value:t,configurable:!0});function Gt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Wt(Gt,`setRef`);function Kt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Gt(e[t],null)}}}}Wt(Kt,`composeRefs`);function K(...e){return o.useCallback(Kt(...e),e)}Wt(K,`useComposedRefs`);var qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0});function Yt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=sn(r),o.Children.forEach(r,e=>{if(nn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;an(n)&&typeof dn==`function`;)n=dn(n._payload);a=$t(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?tn(a):void 0,u=K(n,l);if(!a){if(r||r===0)throw Error(s?un(e):ln(e));return r}let d=en(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Jt(Yt,`createSlot`);var Xt=Yt(`Slot`),Zt=Symbol.for(`radix.slottable`);function Qt(e){let t=Jt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Zt,t}Jt(Qt,`createSlottable`);var $t=Jt((e,t)=>`child`in e.props?o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null:o.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function en(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=cn(a,i))}return{...e,...n}}Jt(en,`mergeProps`);function tn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jt(tn,`getElementRef`);function nn(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zt}Jt(nn,`isSlottable`);var rn=Symbol.for(`react.lazy`);function an(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rn&&`_payload`in e&&on(e._payload)}Jt(an,`isLazyComponent`);function on(e){return typeof e==`object`&&!!e&&`then`in e}Jt(on,`isPromiseLike`);function sn(e){let t=e;for(;an(t)&&typeof dn==`function`;)t=dn(t._payload);return t}Jt(sn,`useUnwrappedLazy`);function cn(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Jt(cn,`concatAriaDescribedby`);var ln=Jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),un=Jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),dn=o.use,fn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),pn=t(((e,t)=>{t.exports=fn()})),q=pn(),mn=Object.defineProperty,hn=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Yt(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}hn(gn,`dispatchDiscreteCustomEvent`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),bn=o.forwardRef(vn(function(e,t){return(0,q.jsx)(J.span,{...e,ref:t,style:{...yn,...e.style}})},`VisuallyHidden`)),xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0});function Cn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=Sn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Sn(i,`useContext`),[r,i]}Sn(Cn,`createContext`);function wn(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=Sn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,q.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return Sn(c,`useContext`),[s,c]}Sn(r,`createContext`);let i=Sn(()=>{let t=n.map(e=>o.createContext(e));return Sn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Tn(i,...t)]}Sn(wn,`createContextScope`);function Tn(...e){let t=e[0];if(e.length===1)return t;let n=Sn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Sn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Sn(Tn,`composeContextScopes`);var En=globalThis?.document?o.useLayoutEffect:()=>{},Dn=Object.defineProperty,On=(e,t)=>Dn(e,`name`,{value:t,configurable:!0});function kn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=On(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Yt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(c,n).collectionRef);return(0,q.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Yt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=K(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,q.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return On(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}On(kn,`createCollection`);var An=new WeakMap,jn=class e extends Map{static{On(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],An.set(this,!0)}set(e,t){return An.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Pn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Mn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Mn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Mn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Mn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Nn(e,t);return n===-1?void 0:e[n]}On(Mn,`at`);function Nn(e,t){let n=e.length,r=Pn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}On(Nn,`toSafeIndex`);function Pn(e){return e!==e||e===0?0:Math.trunc(e)}On(Pn,`toSafeInteger`);function Fn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=On(({state:e,...t})=>e?(0,q.jsx)(d,{...t,state:e}):(0,q.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=On(e=>{let t=v();return(0,q.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=On(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=K(a,l),[d,f]=r,p=o.useRef(new jn),m=o.useCallback(()=>{let e=p.current;return Rn(e)||e.sort(zn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Bn(()=>{f(e=>{let t=e.toSorted(zn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,q.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,q.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Yt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(f,n).collectionElementRef);return(0,q.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Yt(h),_=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),{setCollection:c,registryRef:l}=a(h,n),u=o.useRef(i);In(u.current,i)||(u.current=i);let d=u.current,f=K(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);En(()=>{let e=s.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let p=o.useRef(null);return o.useEffect(()=>{let e=s.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(p.current=e?{element:e,itemData:d}:null,c(n=>{let r=new jn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(zn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new jn(t);return n.delete(e.element),n})},[c]),(0,q.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new jn)}On(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}On(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return On(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}On(Fn,`createCollection`);function In(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}On(In,`shallowEqual`);function Ln(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}On(Ln,`isElementPreceding`);function Rn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}On(Rn,`isInDocumentOrder`);function zn(e,t){return!e[1].element||!t[1].element?0:Ln(e[1].element,t[1].element)?-1:1}On(zn,`sortByDocumentPosition`);function Bn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}On(Bn,`getChildListObserver`);var Vn=Object.defineProperty,Hn=(e,t)=>Vn(e,`name`,{value:t,configurable:!0}),Un=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return Hn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Hn(Y,`composeEventHandlers`);function Wn(e){if(!Un)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Hn(Wn,`getOwnerWindow`);function Gn(e){if(!Un)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Hn(Gn,`getOwnerDocument`);function Kn(e,t=!1){let{activeElement:n}=Gn(e);if(!n?.nodeName)return null;if(qn(n)&&n.contentDocument)return Kn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gn(n).getElementById(e);if(t)return t}}return n}Hn(Kn,`getActiveElement`);function qn(e){return e.tagName===`IFRAME`}Hn(qn,`isFrame`);var Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=o.useEffectEvent,Zn=o.useInsertionEffect;function Qn(e){if(typeof Xn==`function`)return Xn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Zn==`function`?Zn(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Yn(Qn,`useEffectEvent`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),tr=o.useInsertionEffect||En;function nr({prop:e,defaultProp:t,onChange:n=er(()=>{},`onChange`),caller:r}){let[i,a,s]=rr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=ir(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}er(nr,`useControllableState`);function rr({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return tr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}er(rr,`useUncontrolledState`);function ir(e){return typeof e==`function`}er(ir,`isFunction`);var ar=Symbol(`RADIX:SYNC_STATE`);function or(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=Qn(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===ar)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=o.useRef(m);o.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=o.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return o.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:ar,state:i})},[i,f.state,l]),[g,p]}er(or,`useControllableStateReducer`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0});function lr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}cr(lr,`useStateMachine`);var ur=cr(e=>{let{present:t,children:n}=e,r=dr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=pr(r.ref,hr(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function dr(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=lr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??mr(r.current),s.current=void 0):a.current=`none`},[c]),En(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=mr(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),En(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=cr(a=>{let o=mr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=cr(e=>{e.target===t&&(a.current=mr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=mr(t)}else r.current=null;n(e)},[])}}cr(dr,`usePresence`);function fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}cr(fr,`setRef`);function pr(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=fr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():fr(n[e],null)}}},[])}cr(pr,`useStableComposedRefs`);function mr(e){return e?.animationName||`none`}cr(mr,`getAnimationName`);function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}cr(hr,`getElementRef`);var gr=Object.defineProperty,_r=(e,t)=>gr(e,`name`,{value:t,configurable:!0}),vr=o.useId||(()=>void 0),yr=0;function br(e){let[t,n]=o.useState(vr());return En(()=>{e||n(e=>e??String(yr++))},[e]),e||(t?`radix-${t}`:``)}_r(br,`useId`);var xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),Cr=`Collapsible`,[wr,Tr]=wn(Cr),[Er,Dr]=wr(Cr),Or=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=nr({prop:r,defaultProp:i??!1,onChange:s,caller:Cr});return(0,q.jsx)(Er,{scope:n,disabled:a,contentId:br(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,q.jsx)(J.div,{"data-state":Pr(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),kr=`CollapsibleTrigger`,Ar=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Dr(kr,n);return(0,q.jsx)(J.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Pr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),jr=`CollapsibleContent`,Mr=o.forwardRef(Sr(function(e,t){let{forceMount:n,...r}=e,i=Dr(jr,e.__scopeCollapsible);return(0,q.jsx)(ur,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Nr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Nr=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=Dr(jr,n),[c,l]=o.useState(r),u=o.useRef(null),d=K(t,u),f=o.useRef(0),p=f.current,m=o.useRef(0),h=m.current,g=s.open||c,_=o.useRef(g),v=o.useRef(void 0);return o.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),En(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,q.jsx)(J.div,{"data-state":Pr(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Pr(e){return e?`open`:`closed`}Sr(Pr,`getState`);var Fr=Object.defineProperty,Ir=(e,t)=>Fr(e,`name`,{value:t,configurable:!0}),Lr={LTR:`ltr`,RTL:`rtl`},Rr=o.createContext(void 0);function zr(e){let t=o.useContext(Rr);return e||t||Lr.LTR}Ir(zr,`useDirection`);var Br=Object.defineProperty,Vr=(e,t)=>Br(e,`name`,{value:t,configurable:!0}),Hr=o.useInsertionEffect;function Ur(e){let t=o.useRef(e);return typeof Hr==`function`?Hr(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vr(Ur,`useCallbackRef`);var Wr=Object.defineProperty,Gr=(e,t)=>Wr(e,`name`,{value:t,configurable:!0}),Kr=`dismissableLayer.update`,qr=`dismissableLayer.pointerDownOutside`,Jr=`dismissableLayer.focusOutside`,Yr,Xr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zr=o.forwardRef(Gr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(Xr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=K(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=o.useRef(!1),w=ei(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=ti(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Ur(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ni(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Yr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ni())},[f,d]),o.useEffect(()=>{let e=Gr(()=>h({}),`handleUpdate`);return document.addEventListener(Kr,e),()=>document.removeEventListener(Kr,e)},[]),(0,q.jsx)(J.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Qr(){let e=o.useContext(Xr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gr(Qr,`useDismissableLayerSurface`);var $r=Gr(()=>!0,`IS_TRUE`);function ei(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=$r}=t,c=Ur(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}Gr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}Gr(t,`isOutsideInteractionIntercepted`);function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}Gr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}Gr(p,`handleInteractionBubble`);let m=Gr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ri(qr,c,p,{discrete:!0})};if(Gr(o,`handleAndDispatchPointerDownOutsideEvent`),!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:Gr(()=>l.current=!0,`onPointerDownCapture`)}}Gr(ei,`usePointerDownOutside`);function ti(e,t=globalThis?.document){let n=Ur(e),r=o.useRef(!1);return o.useEffect(()=>{let e=Gr(e=>{e.target&&!r.current&&ri(Jr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gr(()=>r.current=!1,`onBlurCapture`)}}Gr(ti,`useFocusOutside`);function ni(){let e=new CustomEvent(Kr);document.dispatchEvent(e)}Gr(ni,`dispatchUpdate`);function ri(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?gn(i,a):i.dispatchEvent(a)}Gr(ri,`handleAndDispatchCustomEvent`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),oi=`focusScope.autoFocusOnMount`,si=`focusScope.autoFocusOnUnmount`,ci={bubbles:!1,cancelable:!0},li=o.forwardRef(ai(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Ur(a),f=Ur(s),p=o.useRef(null),m=K(t,u),h=o.useRef(i);o.useEffect(()=>{h.current=i});let g=o.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:bi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||bi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bi(l)};ai(e,`handleFocusIn`),ai(t,`handleFocusOut`),ai(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused,g]),o.useEffect(()=>{if(l){xi.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(oi,ci);l.addEventListener(oi,d),l.dispatchEvent(t),t.defaultPrevented||(mi(wi(gi(l)),{select:!0}),document.activeElement===e&&bi(l))}return()=>{l.removeEventListener(oi,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(si,ci);l.addEventListener(si,f),l.dispatchEvent(r),r.defaultPrevented||bi(e??t.body,{select:!0}),l.removeEventListener(si,f),xi.remove(_)},0)}}},[l,d,f,_]);let v=o.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,q.jsx)(J.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),ui=o.createContext(null);function di({registry:e,children:t}){return e?(0,q.jsx)(ui.Provider,{value:e,children:t}):t}ai(di,`FocusScopeBranchProvider`);function fi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:ai(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ai(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ai(fi,`useFocusScopeBranchRegistry`);function pi(e){let t=o.useContext(ui);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ai(pi,`useFocusScopeBranch`);function mi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bi(r,{select:t}),document.activeElement!==n)return}ai(mi,`focusFirst`);function hi(e){let t=gi(e);return[_i(t,e),_i(t.reverse(),e)]}ai(hi,`getTabbableEdges`);function gi(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ai(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ai(gi,`getTabbableCandidates`);function _i(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vi(r,{upTo:t})))return r}ai(_i,`findVisible`);function vi(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ai(vi,`isHidden`);function yi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ai(yi,`isSelectableInput`);function bi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&yi(e)&&t&&e.select()}}ai(bi,`focus`);var xi=Si();function Si(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ci(e,t),e.unshift(t)},remove(t){e=Ci(e,t),e[0]?.resume()}}}ai(Si,`createFocusScopesStack`);function Ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ai(Ci,`arrayRemove`);function wi(e){return e.filter(e=>e.tagName!==`A`)}ai(wi,`removeLinks`);var Ti=Object.defineProperty,Ei=o.forwardRef(((e,t)=>Ti(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);En(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,q.jsx)(J.div,{...r,ref:t}),c):null},`Portal`)),Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=0,Ai=null;function ji(e){return Mi(),e.children}Oi(ji,`FocusGuards`);function Mi(){o.useEffect(()=>{Ai||={start:Ni(),end:Ni()};let{start:e,end:t}=Ai;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ki++,()=>{ki===1&&(Ai?.start.remove(),Ai?.end.remove(),Ai=null),ki=Math.max(0,ki-1)}},[])}Oi(Mi,`useFocusGuards`);function Ni(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Oi(Ni,`createFocusGuard`);var Pi=function(){return Pi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pi.apply(this,arguments)};function Fi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ii(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Li=`right-scroll-bar-position`,Ri=`width-before-scroll-bar`,zi=`with-scroll-bars-hidden`,Bi=`--removed-body-scroll-bar-size`;function Vi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Hi(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ui=typeof window<`u`?o.useLayoutEffect:o.useEffect,Wi=new WeakMap;function Gi(e,t){var n=Hi(t||null,function(t){return e.forEach(function(e){return Vi(e,t)})});return Ui(function(){var t=Wi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Vi(e,null)}),i.forEach(function(e){r.has(e)||Vi(e,a)})}Wi.set(n,e)},[e]),n}function Ki(e){return e}function qi(e,t){t===void 0&&(t=Ki);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ji(e){e===void 0&&(e={});var t=qi(null);return t.options=Pi({async:!0,ssr:!1},e),t}var Yi=function(e){var t=e.sideCar,n=Fi(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,Pi({},n))};Yi.isSideCarExport=!0;function Xi(e,t){return e.useMedium(t),Yi}var Zi=Ji(),Qi=function(){},$i=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Qi,onWheelCapture:Qi,onTouchMoveCapture:Qi}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Fi(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Gi([n,t]),w=Pi(Pi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Zi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Pi(Pi({},w),{ref:C})):o.createElement(y,Pi({},w,{className:l,ref:C}),c))});$i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$i.classNames={fullWidth:Ri,zeroRight:Li};var ea=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ta(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ea();return t&&e.setAttribute(`nonce`,t),e}function na(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ra(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ia=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ta())&&(na(t,n),ra(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aa=function(){var e=ia();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oa=function(){var e=aa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sa={left:0,top:0,right:0,gap:0},ca=function(e){return parseInt(e||``,10)||0},la=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ca(n),ca(r),ca(i)]},ua=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sa;var t=la(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},da=oa(),fa=`data-scroll-locked`,pa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
3
3
|
.${zi} {
|
|
4
4
|
overflow: hidden ${r};
|
|
5
5
|
padding-right: ${s}px ${r};
|