@cotal-ai/web 0.178.0 → 0.180.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,Ar as n,B as r,C as i,Cr as a,Fr as o,G as s,Gt as c,Ht as l,I as u,J as d,K as f,L as p,M as ee,Nr as m,Qt as h,S as g,T as _,U as te,Vt as v,W as y,Wt as b,Xt as ne,Y as x,Yn as re,_ as S,a as C,at as w,b as T,bt as E,c as ie,cn as D,d as O,dn as k,dt as ae,en as oe,er as A,ft as se,g as ce,h as le,hr as j,i as ue,it as de,l as M,ln as N,lr as fe,lt as pe,m as me,mt as he,nn as ge,nt as _e,o as ve,pt as P,q as F,r as ye,rn as I,rr as be,s as xe,sn as L,st as Se,u as Ce,ur as we,v as R,vr as Te,w as Ee,x as z,xr as De,xt as B,y as V,yr as Oe}from"./controller-BghUQrbm.js";var ke=[[`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`}]],H=[[`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`}]],U=[[`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`}]],W=e(o(),1),G=re();function K({icon:e,title:t,children:n,action:r}){return(0,G.jsxs)(te,{children:[(0,G.jsxs)(f,{children:[(0,G.jsx)(F,{variant:`icon`,children:(0,G.jsx)(B,{icon:e})}),(0,G.jsx)(d,{children:t}),n&&(0,G.jsx)(s,{children:n})]}),r&&(0,G.jsx)(y,{children:r})]})}var q=e=>Number.isFinite(e.ts)?e.ts:-1/0;function Ae(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)=>q(t)-q(e));return n.sort((e,t)=>q(t.rows[0])-q(e.rows[0]))}function J({msg:e,row:t,place:n,href:r,label:i}){let o=u();return(0,G.jsxs)(`div`,{className:`ui-msg ox-msg`,"data-post":e.id,children:[(0,G.jsx)(`div`,{className:`ui-gut`,children:(0,G.jsx)(p,{vendor:t.harness,status:t.status,size:34,dot:!1,badge:o(t.id)})}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`ui-mh`,children:[(0,G.jsx)(`b`,{children:t.name}),(0,G.jsx)(E,{variant:`secondary`,children:n}),(0,G.jsx)(C,{ts:e.ts}),(0,G.jsx)(`span`,{className:`ui-sp`}),(0,G.jsxs)(`a`,{className:`ox-act`,href:r,children:[i,(0,G.jsx)(B,{icon:D,size:16})]})]}),(0,G.jsx)(ve,{className:`ui-tx`,src:a(e.parts)})]})]})}function je({groups:e,row:t,nameOf:n}){return(0,G.jsxs)(`div`,{className:`ox-msgs`,children:[e.length===0&&(0,G.jsx)(K,{icon:L,title:`No messages from ${t.name} on this page yet`}),e.map(e=>{let r=e.rows.length;if(e.channel!==void 0){let n=e.channel,a=j({view:`channel`,channel:n});return(0,G.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,G.jsxs)(z,{className:`ox-marker`,children:[(0,G.jsx)(i,{children:(0,G.jsx)(B,{icon:I,size:16})}),(0,G.jsxs)(g,{children:[(0,G.jsx)(`b`,{children:`#${n}`}),` · ${r===1?`1 post`:`${r} posts`}`]})]}),e.rows.map(e=>(0,G.jsx)(J,{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=j({view:`dm`,peer:t.id,with:a});return(0,G.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,G.jsxs)(z,{className:`ox-marker`,children:[(0,G.jsx)(i,{children:(0,G.jsx)(B,{icon:L,size:16})}),(0,G.jsxs)(g,{children:[(0,G.jsx)(`b`,{children:`Direct messages`}),` · ${r} with ${o}`]})]}),e.rows.map(e=>(0,G.jsx)(J,{msg:e,row:t,place:`to ${o}`,href:s,label:`Open conversation`},e.id))]},e.key)}),(0,G.jsx)(`p`,{className:`ox-msgs-more`,children:`Older messages are in each channel's history.`})]})}var Y=1e3,X={on:`Published. Tool inputs and results appear when payload access is permitted.`,off:`Not published`};function Me({store:e,id:t,clock:n=Date.now}){let i=A(e,e=>e.roster),a=A(e,e=>e.channels),o=A(e,e=>e.membership),s=A(e,e=>e.activity),[,c]=(0,W.useReducer)(e=>e+1,0);(0,W.useEffect)(()=>{let e=setInterval(c,Y);return()=>clearInterval(e)},[]);let l=u(),d=i.find(e=>e.card.id===t),f=(0,W.useMemo)(()=>d?x(t,o,a.map(e=>e.channel),s,d.channelModes):{channels:[],wide:!1},[d,t,o,a,s]);if(!d)return(0,G.jsx)(`p`,{className:`ui-nr`,children:`Not on the roster`});let h=be([d],{includeOffline:!0})[0],g=typeof h.statusSince==`number`&&Number.isFinite(h.statusSince)?`Reported ${De(new Date(h.statusSince))}`:void 0,_=(d.card.skills??[]).map(e=>e.name).filter(e=>typeof e==`string`&&e!==``);return(0,G.jsxs)(`div`,{className:`ox-profile`,children:[(0,G.jsx)(`div`,{className:`ui-big`,children:(0,G.jsx)(p,{vendor:h.harness,status:h.status,size:88,dot:!1,badge:l(h.id)})}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`ui-sline`,children:[(0,G.jsx)(r,{row:h}),(0,G.jsx)(`span`,{style:{color:`var(--ink)`},children:h.activity||`No current activity`}),g&&(0,G.jsx)(`small`,{children:g}),V(h,n())&&(0,G.jsx)(`small`,{className:`ui-facts`,children:V(h,n())})]}),(0,G.jsxs)(`div`,{className:`ui-actions`,children:[(0,G.jsx)(w,{icon:H,command:`cotal attach --name ${m(h.name)}`}),(0,G.jsx)(w,{icon:U,command:`cotal stop --name ${m(h.name)}`})]}),(0,G.jsxs)(`dl`,{className:`ui-kv`,children:[h.harness&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Harness`}),(0,G.jsx)(`dd`,{children:ee(h.harness)})]}),(0,G.jsx)(`dt`,{children:`Model`}),h.model?(0,G.jsx)(`dd`,{className:`ui-mono`,style:{fontSize:12.5},children:h.model}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),h.host&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Host`}),(0,G.jsx)(`dd`,{children:h.host})]}),(h.attention===`dnd`||h.attention===`focus`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Attention`}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(S,{attention:h.attention})})]}),(0,G.jsx)(`dt`,{children:`Heartbeat`}),Number.isFinite(h.ts)?(0,G.jsxs)(`dd`,{className:`ui-num`,children:[T(n()-h.ts),` ago`]}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),(0,G.jsx)(`dt`,{children:`Work events`}),h.events?(0,G.jsx)(`dd`,{children:X[h.events]}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`})]}),(f.wide||f.channels.length>0)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h5`,{children:`Channels`}),f.wide&&(0,G.jsxs)(`div`,{className:`ui-chrow`,children:[(0,G.jsx)(`span`,{children:`Reads every channel`}),(0,G.jsx)(`span`,{})]}),f.channels.map(e=>(0,G.jsxs)(`div`,{className:`ui-chrow`,children:[(0,G.jsx)(`span`,{children:`#${e.channel}`}),(0,G.jsx)(`span`,{children:e.mode??``})]},e.channel))]}),_.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h5`,{style:{marginTop:10},children:`Skills`}),(0,G.jsx)(`div`,{className:`ui-tags`,children:_.map(e=>(0,G.jsx)(E,{variant:`secondary`,children:e},e))})]})]})]})}var Ne=24,Pe=[];function Fe(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 Ie(){let e=e=>(0,G.jsx)(c,{className:`h-2.5`,style:{width:e}});return(0,G.jsx)(`div`,{className:`ox-col`,"aria-busy":`true`,children:(0,G.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 Le({steps:e,away:t}){let{end:n}=he(),{scrollToEnd:r}=P(),[i,a]=(0,W.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,G.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,className:`ox-newsteps`,"data-active":`true`,onClick:()=>r({behavior:R()?`auto`:`smooth`}),children:[(0,G.jsx)(B,{icon:N,"data-icon":`inline-start`}),s===1?`1 new step`:`${s} new steps`]})}function Z({store:e,controller:i,id:a,tab:o,at:s,back:c,phone:d=!1,panelOpen:f=!1,onTogglePanel:m}){ce(i,a);let te=(0,W.useContext)(ye),y=A(e,e=>e.roster),x=A(e,e=>e.operatorId),re=A(e,e=>e.post),S=A(e,e=>e.sessions[a]),C=(0,W.useMemo)(()=>we(y),[y]),T=y.find(e=>e.card.id===a),E=(0,W.useMemo)(()=>T?be([T],{includeOffline:!0})[0]:void 0,[T]),D=E?.name??fe(a,C,x),N=E??{id:a,name:D,status:`offline`,ts:NaN},he=(0,W.useMemo)(()=>me(T),[T]),ve=u(),P=S?.frames??Pe,F=le(e,a),I=(0,W.useMemo)(()=>Oe(P,F),[P,F]),L=(0,W.useMemo)(()=>Fe(I),[I]),R=(0,W.useMemo)(()=>Ae(F),[F]),De=R.reduce((e,t)=>e+t.rows.length,0),V=(0,W.useMemo)(()=>e=>fe(e,C,x),[C,x]),H=(0,W.useMemo)(()=>({kind:`dm`,to:a}),[a]),U=[E?.role,E?.harness&&ee(E.harness)].filter(Boolean).join(` · `),q=E?.events,J=S?.load??`loading`,[Y,X]=(0,W.useState)(!0);o!==`work`&&!Y&&X(!0);let Z=(0,W.useRef)(null),Re=()=>Z.current,ze=()=>{let e=Re();!Y&&e&&e.scrollHeight-e.scrollTop-e.clientHeight<=Ne&&X(!0)},Be=(0,W.useRef)(void 0),Ve=s!==void 0&&L.some(e=>e.post===s);(0,W.useLayoutEffect)(()=>{if(!Ve||s===void 0||Be.current===s||J===`loading`)return;let e=Re();if(!e)return;let t=Array.from(e.querySelectorAll(`[data-post]`)).find(e=>e.getAttribute(`data-post`)===s);t&&(Be.current=s,X(!1),t.scrollIntoView?.({block:`center`}))});let He=Te(P)>=2e3||(S?.limit??0)>=2e3,Ue=S?.more===!0&&q!==`off`,We=f?`Close panel`:`Open panel`,Q=`Back to ${c.label}`,Ge=j(n(a,x)),Ke=()=>de(H),$=(0,G.jsx)(ue,{payloadRead:S?.payloadRead,work:I,row:N,condition:he,highlight:s,nameOf:V}),qe;return qe=J===`loading`&&L.length===0?(0,G.jsx)(Ie,{}):J===`refused`?(0,G.jsxs)(`div`,{className:`ox-col`,children:[(0,G.jsxs)(K,{icon:h,title:`This dashboard can't read ${D}'s work`,action:S?.grant&&(0,G.jsx)(w,{command:S.grant}),children:[(0,G.jsx)(`p`,{children:`The broker refused it: ${S?.reason??``}.`}),S?.grant&&(0,G.jsx)(`p`,{children:`The mesh owner can grant a read on that channel:`})]}),L.length>0&&$]}):J===`failed`&&L.length===0?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ge,title:`${D}'s work didn't load`,action:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i?.reloadSession(a),children:`Try again`}),children:(0,G.jsx)(`p`,{children:S?.reason??``})})}):q===`off`&&J!==`failed`?(0,G.jsxs)(`div`,{className:`ox-col`,children:[(0,G.jsxs)(xe,{children:[`${D} publishes no work events, so Work shows only what ${D} posted. Agents started with `,(0,G.jsx)(`code`,{children:`cotal spawn`}),` publish them unless started with `,(0,G.jsx)(`code`,{children:`--no-events`}),`.`]}),$]}):L.length===0&&q===`on`?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ne,title:`${D} hasn't started a turn yet`,children:(0,G.jsx)(`p`,{children:`Its first turn shows here as soon as it starts.`})})}):L.length===0?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ge,title:`Nothing has arrived from ${D} yet`,children:(0,G.jsxs)(`p`,{children:[`Agents started with `,(0,G.jsx)(`code`,{children:`cotal spawn`}),` publish one unless started with `,(0,G.jsx)(`code`,{children:`--no-events`}),`. An agent you started yourself may not publish one at all.`]})})}):(0,G.jsxs)(`div`,{className:`ox-col`,children:[J===`failed`&&(0,G.jsx)(xe,{action:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i?.reloadSession(a),children:`Try again`}),children:`${D}'s work didn't load. ${S?.reason??``}`}),Ue&&!He&&(0,G.jsx)(z,{variant:`separator`,className:`mb-3`,children:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,disabled:J===`loading`,onClick:()=>void i?.loadEarlier(a),children:`Load earlier`})}),Ue&&He&&(0,G.jsx)(z,{className:`mb-3`,children:(0,G.jsx)(g,{children:`Showing the newest 2,000 events`})}),J===`loading`&&(0,G.jsx)(z,{className:`mb-3`,role:`status`,children:(0,G.jsx)(g,{children:`Loading`})}),$]}),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:`ox-head`,children:[(0,G.jsx)(Ee,{}),d?(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(k,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,G.jsx)(`a`,{href:j(c.route),"aria-label":Q,children:(0,G.jsx)(B,{icon:ke})})})}),(0,G.jsx)(l,{children:Q})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsxs)(`a`,{className:`ui-crumb`,href:j(c.route),"aria-label":Q,children:[(0,G.jsx)(B,{icon:ke,size:16,className:`ui-ic`}),c.label]})}),(0,G.jsx)(l,{children:Q})]}),(0,G.jsx)(`span`,{className:`ox-sep`})]}),(0,G.jsx)(p,{vendor:E?.harness,status:N.status,size:30,badge:E?ve(a):void 0}),(0,G.jsx)(`h1`,{children:D}),!d&&U&&(0,G.jsx)(`span`,{className:`ui-topic`,children:U}),E&&(0,G.jsx)(r,{row:E}),(0,G.jsx)(`span`,{className:`ui-sp`}),d?(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(k,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,G.jsx)(`a`,{href:Ge,"aria-label":`Message ${D}`,onClick:Ke,children:(0,G.jsx)(B,{icon:oe})})})}),(0,G.jsx)(l,{children:`Message ${D}`})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(k,{asChild:!0,variant:`outline`,size:`sm`,children:(0,G.jsxs)(`a`,{href:Ge,onClick:Ke,children:[(0,G.jsx)(B,{icon:oe,"data-icon":`inline-start`}),`Message`]})}),m&&(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(_,{"aria-label":We,pressed:f,onPressedChange:m,children:(0,G.jsx)(B,{icon:t})})}),(0,G.jsx)(l,{children:We})]})]})]}),(0,G.jsxs)(ie,{value:o,activationMode:`manual`,onValueChange:e=>(e===`work`||e===`messages`||e===`profile`)&&te({view:`agent`,id:a,tab:e}),className:`ox-tabs`,children:[(0,G.jsx)(`div`,{className:`ox-tablist`,children:(0,G.jsxs)(Ce,{"aria-label":D,children:[(0,G.jsx)(O,{value:`work`,children:`Work`}),(0,G.jsxs)(O,{value:`messages`,children:[`Messages `,(0,G.jsx)(`span`,{className:`ox-n`,children:De})]}),(0,G.jsx)(O,{value:`profile`,children:`Profile`})]})}),(0,G.jsx)(M,{value:`work`,className:`ox-tabc`,children:(0,G.jsx)(ae,{autoScroll:Y,children:(0,G.jsxs)(Se,{className:`ox-scroller`,children:[(0,G.jsx)(se,{ref:Z,"aria-label":`Work`,onScroll:ze,children:(0,G.jsx)(pe,{className:`ox-scrollc`,children:qe})}),(0,G.jsx)(Le,{steps:L,away:!Y})]})})}),(0,G.jsx)(M,{value:`messages`,className:`ox-tabc`,children:(0,G.jsx)(`div`,{className:`ui-scroll`,children:(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(je,{groups:R,row:N,nameOf:V})})})}),(0,G.jsx)(M,{value:`profile`,className:`ox-tabc`,children:(0,G.jsx)(`div`,{className:`ui-scroll`,children:(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(Me,{store:e,id:a})})})})]}),re&&(0,G.jsx)(`div`,{className:`ui-dock`,children:(0,G.jsx)(`div`,{className:`ui-dock-in`,children:(0,G.jsx)(_e,{store:e,target:H,where:D,to:`to ${D} · direct message`})})})]})}export{Z as AgentPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,Ar as n,B as r,C as i,Cr as a,Fr as o,G as s,Gt as c,Ht as l,I as u,J as d,K as f,L as p,M as ee,Nr as m,Qt as h,S as g,T as _,U as te,Vt as v,W as y,Wt as b,Xt as ne,Y as x,Yn as re,_ as S,a as C,at as w,b as T,bt as E,c as ie,cn as D,d as O,dn as k,dt as ae,en as oe,er as A,ft as se,g as ce,h as le,hr as j,i as ue,it as de,l as M,ln as N,lr as fe,lt as pe,m as me,mt as he,nn as ge,nt as _e,o as ve,pt as P,q as F,r as ye,rn as I,rr as be,s as xe,sn as L,st as Se,u as Ce,ur as we,v as R,vr as Te,w as Ee,x as z,xr as De,xt as B,y as V,yr as Oe}from"./controller-QscYCnaV.js";var ke=[[`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`}]],H=[[`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`}]],U=[[`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`}]],W=e(o(),1),G=re();function K({icon:e,title:t,children:n,action:r}){return(0,G.jsxs)(te,{children:[(0,G.jsxs)(f,{children:[(0,G.jsx)(F,{variant:`icon`,children:(0,G.jsx)(B,{icon:e})}),(0,G.jsx)(d,{children:t}),n&&(0,G.jsx)(s,{children:n})]}),r&&(0,G.jsx)(y,{children:r})]})}var q=e=>Number.isFinite(e.ts)?e.ts:-1/0;function Ae(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)=>q(t)-q(e));return n.sort((e,t)=>q(t.rows[0])-q(e.rows[0]))}function J({msg:e,row:t,place:n,href:r,label:i}){let o=u();return(0,G.jsxs)(`div`,{className:`ui-msg ox-msg`,"data-post":e.id,children:[(0,G.jsx)(`div`,{className:`ui-gut`,children:(0,G.jsx)(p,{vendor:t.harness,status:t.status,size:34,dot:!1,badge:o(t.id)})}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`ui-mh`,children:[(0,G.jsx)(`b`,{children:t.name}),(0,G.jsx)(E,{variant:`secondary`,children:n}),(0,G.jsx)(C,{ts:e.ts}),(0,G.jsx)(`span`,{className:`ui-sp`}),(0,G.jsxs)(`a`,{className:`ox-act`,href:r,children:[i,(0,G.jsx)(B,{icon:D,size:16})]})]}),(0,G.jsx)(ve,{className:`ui-tx`,src:a(e.parts)})]})]})}function je({groups:e,row:t,nameOf:n}){return(0,G.jsxs)(`div`,{className:`ox-msgs`,children:[e.length===0&&(0,G.jsx)(K,{icon:L,title:`No messages from ${t.name} on this page yet`}),e.map(e=>{let r=e.rows.length;if(e.channel!==void 0){let n=e.channel,a=j({view:`channel`,channel:n});return(0,G.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,G.jsxs)(z,{className:`ox-marker`,children:[(0,G.jsx)(i,{children:(0,G.jsx)(B,{icon:I,size:16})}),(0,G.jsxs)(g,{children:[(0,G.jsx)(`b`,{children:`#${n}`}),` · ${r===1?`1 post`:`${r} posts`}`]})]}),e.rows.map(e=>(0,G.jsx)(J,{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=j({view:`dm`,peer:t.id,with:a});return(0,G.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,G.jsxs)(z,{className:`ox-marker`,children:[(0,G.jsx)(i,{children:(0,G.jsx)(B,{icon:L,size:16})}),(0,G.jsxs)(g,{children:[(0,G.jsx)(`b`,{children:`Direct messages`}),` · ${r} with ${o}`]})]}),e.rows.map(e=>(0,G.jsx)(J,{msg:e,row:t,place:`to ${o}`,href:s,label:`Open conversation`},e.id))]},e.key)}),(0,G.jsx)(`p`,{className:`ox-msgs-more`,children:`Older messages are in each channel's history.`})]})}var Y=1e3,X={on:`Published. Tool inputs and results appear when payload access is permitted.`,off:`Not published`};function Me({store:e,id:t,clock:n=Date.now}){let i=A(e,e=>e.roster),a=A(e,e=>e.channels),o=A(e,e=>e.membership),s=A(e,e=>e.activity),[,c]=(0,W.useReducer)(e=>e+1,0);(0,W.useEffect)(()=>{let e=setInterval(c,Y);return()=>clearInterval(e)},[]);let l=u(),d=i.find(e=>e.card.id===t),f=(0,W.useMemo)(()=>d?x(t,o,a.map(e=>e.channel),s,d.channelModes):{channels:[],wide:!1},[d,t,o,a,s]);if(!d)return(0,G.jsx)(`p`,{className:`ui-nr`,children:`Not on the roster`});let h=be([d],{includeOffline:!0})[0],g=typeof h.statusSince==`number`&&Number.isFinite(h.statusSince)?`Reported ${De(new Date(h.statusSince))}`:void 0,_=(d.card.skills??[]).map(e=>e.name).filter(e=>typeof e==`string`&&e!==``);return(0,G.jsxs)(`div`,{className:`ox-profile`,children:[(0,G.jsx)(`div`,{className:`ui-big`,children:(0,G.jsx)(p,{vendor:h.harness,status:h.status,size:88,dot:!1,badge:l(h.id)})}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`ui-sline`,children:[(0,G.jsx)(r,{row:h}),(0,G.jsx)(`span`,{style:{color:`var(--ink)`},children:h.activity||`No current activity`}),g&&(0,G.jsx)(`small`,{children:g}),V(h,n())&&(0,G.jsx)(`small`,{className:`ui-facts`,children:V(h,n())})]}),(0,G.jsxs)(`div`,{className:`ui-actions`,children:[(0,G.jsx)(w,{icon:H,command:`cotal attach --name ${m(h.name)}`}),(0,G.jsx)(w,{icon:U,command:`cotal stop --name ${m(h.name)}`})]}),(0,G.jsxs)(`dl`,{className:`ui-kv`,children:[h.harness&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Harness`}),(0,G.jsx)(`dd`,{children:ee(h.harness)})]}),(0,G.jsx)(`dt`,{children:`Model`}),h.model?(0,G.jsx)(`dd`,{className:`ui-mono`,style:{fontSize:12.5},children:h.model}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),h.host&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Host`}),(0,G.jsx)(`dd`,{children:h.host})]}),(h.attention===`dnd`||h.attention===`focus`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:`Attention`}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(S,{attention:h.attention})})]}),(0,G.jsx)(`dt`,{children:`Heartbeat`}),Number.isFinite(h.ts)?(0,G.jsxs)(`dd`,{className:`ui-num`,children:[T(n()-h.ts),` ago`]}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),(0,G.jsx)(`dt`,{children:`Work events`}),h.events?(0,G.jsx)(`dd`,{children:X[h.events]}):(0,G.jsx)(`dd`,{className:`ui-nr`,children:`not reported`})]}),(f.wide||f.channels.length>0)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h5`,{children:`Channels`}),f.wide&&(0,G.jsxs)(`div`,{className:`ui-chrow`,children:[(0,G.jsx)(`span`,{children:`Reads every channel`}),(0,G.jsx)(`span`,{})]}),f.channels.map(e=>(0,G.jsxs)(`div`,{className:`ui-chrow`,children:[(0,G.jsx)(`span`,{children:`#${e.channel}`}),(0,G.jsx)(`span`,{children:e.mode??``})]},e.channel))]}),_.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h5`,{style:{marginTop:10},children:`Skills`}),(0,G.jsx)(`div`,{className:`ui-tags`,children:_.map(e=>(0,G.jsx)(E,{variant:`secondary`,children:e},e))})]})]})]})}var Ne=24,Pe=[];function Fe(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 Ie(){let e=e=>(0,G.jsx)(c,{className:`h-2.5`,style:{width:e}});return(0,G.jsx)(`div`,{className:`ox-col`,"aria-busy":`true`,children:(0,G.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 Le({steps:e,away:t}){let{end:n}=he(),{scrollToEnd:r}=P(),[i,a]=(0,W.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,G.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,className:`ox-newsteps`,"data-active":`true`,onClick:()=>r({behavior:R()?`auto`:`smooth`}),children:[(0,G.jsx)(B,{icon:N,"data-icon":`inline-start`}),s===1?`1 new step`:`${s} new steps`]})}function Z({store:e,controller:i,id:a,tab:o,at:s,back:c,phone:d=!1,panelOpen:f=!1,onTogglePanel:m}){ce(i,a);let te=(0,W.useContext)(ye),y=A(e,e=>e.roster),x=A(e,e=>e.operatorId),re=A(e,e=>e.post),S=A(e,e=>e.sessions[a]),C=(0,W.useMemo)(()=>we(y),[y]),T=y.find(e=>e.card.id===a),E=(0,W.useMemo)(()=>T?be([T],{includeOffline:!0})[0]:void 0,[T]),D=E?.name??fe(a,C,x),N=E??{id:a,name:D,status:`offline`,ts:NaN},he=(0,W.useMemo)(()=>me(T),[T]),ve=u(),P=S?.frames??Pe,F=le(e,a),I=(0,W.useMemo)(()=>Oe(P,F),[P,F]),L=(0,W.useMemo)(()=>Fe(I),[I]),R=(0,W.useMemo)(()=>Ae(F),[F]),De=R.reduce((e,t)=>e+t.rows.length,0),V=(0,W.useMemo)(()=>e=>fe(e,C,x),[C,x]),H=(0,W.useMemo)(()=>({kind:`dm`,to:a}),[a]),U=[E?.role,E?.harness&&ee(E.harness)].filter(Boolean).join(` · `),q=E?.events,J=S?.load??`loading`,[Y,X]=(0,W.useState)(!0);o!==`work`&&!Y&&X(!0);let Z=(0,W.useRef)(null),Re=()=>Z.current,ze=()=>{let e=Re();!Y&&e&&e.scrollHeight-e.scrollTop-e.clientHeight<=Ne&&X(!0)},Be=(0,W.useRef)(void 0),Ve=s!==void 0&&L.some(e=>e.post===s);(0,W.useLayoutEffect)(()=>{if(!Ve||s===void 0||Be.current===s||J===`loading`)return;let e=Re();if(!e)return;let t=Array.from(e.querySelectorAll(`[data-post]`)).find(e=>e.getAttribute(`data-post`)===s);t&&(Be.current=s,X(!1),t.scrollIntoView?.({block:`center`}))});let He=Te(P)>=2e3||(S?.limit??0)>=2e3,Ue=S?.more===!0&&q!==`off`,We=f?`Close panel`:`Open panel`,Q=`Back to ${c.label}`,Ge=j(n(a,x)),Ke=()=>de(H),$=(0,G.jsx)(ue,{payloadRead:S?.payloadRead,work:I,row:N,condition:he,highlight:s,nameOf:V}),qe;return qe=J===`loading`&&L.length===0?(0,G.jsx)(Ie,{}):J===`refused`?(0,G.jsxs)(`div`,{className:`ox-col`,children:[(0,G.jsxs)(K,{icon:h,title:`This dashboard can't read ${D}'s work`,action:S?.grant&&(0,G.jsx)(w,{command:S.grant}),children:[(0,G.jsx)(`p`,{children:`The broker refused it: ${S?.reason??``}.`}),S?.grant&&(0,G.jsx)(`p`,{children:`The mesh owner can grant a read on that channel:`})]}),L.length>0&&$]}):J===`failed`&&L.length===0?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ge,title:`${D}'s work didn't load`,action:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i?.reloadSession(a),children:`Try again`}),children:(0,G.jsx)(`p`,{children:S?.reason??``})})}):q===`off`&&J!==`failed`?(0,G.jsxs)(`div`,{className:`ox-col`,children:[(0,G.jsxs)(xe,{children:[`${D} publishes no work events, so Work shows only what ${D} posted. Agents started with `,(0,G.jsx)(`code`,{children:`cotal spawn`}),` publish them unless started with `,(0,G.jsx)(`code`,{children:`--no-events`}),`.`]}),$]}):L.length===0&&q===`on`?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ne,title:`${D} hasn't started a turn yet`,children:(0,G.jsx)(`p`,{children:`Its first turn shows here as soon as it starts.`})})}):L.length===0?(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(K,{icon:ge,title:`Nothing has arrived from ${D} yet`,children:(0,G.jsxs)(`p`,{children:[`Agents started with `,(0,G.jsx)(`code`,{children:`cotal spawn`}),` publish one unless started with `,(0,G.jsx)(`code`,{children:`--no-events`}),`. An agent you started yourself may not publish one at all.`]})})}):(0,G.jsxs)(`div`,{className:`ox-col`,children:[J===`failed`&&(0,G.jsx)(xe,{action:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i?.reloadSession(a),children:`Try again`}),children:`${D}'s work didn't load. ${S?.reason??``}`}),Ue&&!He&&(0,G.jsx)(z,{variant:`separator`,className:`mb-3`,children:(0,G.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,disabled:J===`loading`,onClick:()=>void i?.loadEarlier(a),children:`Load earlier`})}),Ue&&He&&(0,G.jsx)(z,{className:`mb-3`,children:(0,G.jsx)(g,{children:`Showing the newest 2,000 events`})}),J===`loading`&&(0,G.jsx)(z,{className:`mb-3`,role:`status`,children:(0,G.jsx)(g,{children:`Loading`})}),$]}),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:`ox-head`,children:[(0,G.jsx)(Ee,{}),d?(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(k,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,G.jsx)(`a`,{href:j(c.route),"aria-label":Q,children:(0,G.jsx)(B,{icon:ke})})})}),(0,G.jsx)(l,{children:Q})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsxs)(`a`,{className:`ui-crumb`,href:j(c.route),"aria-label":Q,children:[(0,G.jsx)(B,{icon:ke,size:16,className:`ui-ic`}),c.label]})}),(0,G.jsx)(l,{children:Q})]}),(0,G.jsx)(`span`,{className:`ox-sep`})]}),(0,G.jsx)(p,{vendor:E?.harness,status:N.status,size:30,badge:E?ve(a):void 0}),(0,G.jsx)(`h1`,{children:D}),!d&&U&&(0,G.jsx)(`span`,{className:`ui-topic`,children:U}),E&&(0,G.jsx)(r,{row:E}),(0,G.jsx)(`span`,{className:`ui-sp`}),d?(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(k,{asChild:!0,variant:`ghost`,size:`icon`,children:(0,G.jsx)(`a`,{href:Ge,"aria-label":`Message ${D}`,onClick:Ke,children:(0,G.jsx)(B,{icon:oe})})})}),(0,G.jsx)(l,{children:`Message ${D}`})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(k,{asChild:!0,variant:`outline`,size:`sm`,children:(0,G.jsxs)(`a`,{href:Ge,onClick:Ke,children:[(0,G.jsx)(B,{icon:oe,"data-icon":`inline-start`}),`Message`]})}),m&&(0,G.jsxs)(v,{children:[(0,G.jsx)(b,{asChild:!0,children:(0,G.jsx)(_,{"aria-label":We,pressed:f,onPressedChange:m,children:(0,G.jsx)(B,{icon:t})})}),(0,G.jsx)(l,{children:We})]})]})]}),(0,G.jsxs)(ie,{value:o,activationMode:`manual`,onValueChange:e=>(e===`work`||e===`messages`||e===`profile`)&&te({view:`agent`,id:a,tab:e}),className:`ox-tabs`,children:[(0,G.jsx)(`div`,{className:`ox-tablist`,children:(0,G.jsxs)(Ce,{"aria-label":D,children:[(0,G.jsx)(O,{value:`work`,children:`Work`}),(0,G.jsxs)(O,{value:`messages`,children:[`Messages `,(0,G.jsx)(`span`,{className:`ox-n`,children:De})]}),(0,G.jsx)(O,{value:`profile`,children:`Profile`})]})}),(0,G.jsx)(M,{value:`work`,className:`ox-tabc`,children:(0,G.jsx)(ae,{autoScroll:Y,children:(0,G.jsxs)(Se,{className:`ox-scroller`,children:[(0,G.jsx)(se,{ref:Z,"aria-label":`Work`,onScroll:ze,children:(0,G.jsx)(pe,{className:`ox-scrollc`,children:qe})}),(0,G.jsx)(Le,{steps:L,away:!Y})]})})}),(0,G.jsx)(M,{value:`messages`,className:`ox-tabc`,children:(0,G.jsx)(`div`,{className:`ui-scroll`,children:(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(je,{groups:R,row:N,nameOf:V})})})}),(0,G.jsx)(M,{value:`profile`,className:`ox-tabc`,children:(0,G.jsx)(`div`,{className:`ui-scroll`,children:(0,G.jsx)(`div`,{className:`ox-col`,children:(0,G.jsx)(Me,{store:e,id:a})})})})]}),re&&(0,G.jsx)(`div`,{className:`ui-dock`,children:(0,G.jsx)(`div`,{className:`ui-dock-in`,children:(0,G.jsx)(_e,{store:e,target:H,where:D,to:`to ${D} · direct message`})})})]})}export{Z 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}`,le=64;function ue(e,t=le){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function de(e,t,n){return t===`called`?`Called ${ue(n)}`:H[e].title[t]}function fe(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>ue(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 pe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function me(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ye(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=pe(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 he={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 ge(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(he[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 _e(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:ye(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ye(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=ue(e.name);return i===void 0?a:`${a} · ${i}`}function ve(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)?ye(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 ye(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 be=[`work`,`messages`,`profile`],xe=e=>be.includes(e),Se={view:`activity`},Ce={view:`topology`},we=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function Te(e){try{return decodeURIComponent(e)}catch{return}}function Ee(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=Te(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=Te(r);if(!e||!we.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(xe(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:Te(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:Te(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=Te(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:Te(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 De(e,t){return Ee(e)??(t===`/graph`?Ce:Se)}function Oe(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 ke(e){return De(e.location.hash,e.location.pathname)}function Ae(e,t){let n=()=>t(ke(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function je(e,t){if(t.view!==`agent`)return;let n=Oe(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function Me(e,t){e.location.hash=Oe(t)}function Ne(e){return typeof e==`string`&&e.trim()?e:void 0}function Pe(e){let t=new Map;for(let n of e){let e=Ne(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Fe=`operator (you)`;function Ie(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Fe;if(typeof e==`object`)return Ie(e.id,t);let r=t.get(e);if(Ne(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 Le=``,Re=(e,t)=>[e,t].sort().join(Le);function ze(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(Le),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 Be(e){return ze(e).sort((e,t)=>t.last-e.last)}function Ve(e,t){let n=Pe(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 ze(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:Ie(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 He=[`waiting`,`working`,`idle`,`offline`],Ue=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},We=e=>{let t=Ue(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},Ge=e=>{let t=He.indexOf(e);return t===-1?He.length:t};function Ke(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>Ge(e.status)-Ge(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Ne(e.card.name)??e.card.id,role:Ne(e.card.role),status:e.status,activity:e.activity,harness:Ue(e.card.meta,`connector`),host:Ue(e.card.meta,`host`),attention:e.attention,model:Ue(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...We(e.card.meta)}))}var qe=e=>e.filter(e=>e.status===`waiting`);function Je(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 Ye=e=>e.status;function W(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 Xe(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Ze=48,Qe=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ze-t;return n},$e=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},et=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ze;n+=i>>>1^-(i&1),t[r]=n}return t},tt=384,nt=[],rt=$e(Qe(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),it=$e(Qe(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),at=`@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`,ot=(()=>{let e=rt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=rt[n];i<rt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(rt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=rt[i];a<rt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),st=Qe(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),ct=$e(Qe(`123333359346463635126536711576`)),lt=Qe(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ut=Qe(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),dt=et(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),ft=(()=>{let e=new Int32Array(319).fill(-1),t=et(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=et(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),pt=`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}),mt=et(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ht=et(`ɠ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`),gt=et(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),_t=new Int32Array(987),vt=new Int32Array(987),yt=new Int32Array(987),bt=``,xt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<mt.length;r++)for(let i of pt[gt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),xt[a*2]=bt.length,xt[a*2+1]=i.length,bt+=i),_t[n]=mt[r],vt[n]=ht[r],yt[n]=a,n++}}var St=et(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Ct=$e(Qe(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),wt=et(`2Š4A;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`),Tt=Qe(`ij`),Et=Qe(`—`),Dt=Qe(`1`),Ot={GROUP_COUNT:tt,customValidatorNames:nt,edgeStart:rt,labelStart:it,labelText:at,edgeTarget:ot,nodeGroup:st,nodeVlist:ft,vlistPat:ct,vlistOps:lt,vlistRef:ut,vlistGroup:dt,litAnchor:_t,litGroup:vt,litPool:yt,poolOffsets:xt,poolText:bt,adjGid:St,adjStart:Ct,adjTgt:wt,patGid:Tt,patTgt:Et,postfixLookupGroups:Dt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},kt=`line`in Error(),At=-1,jt=-1,Mt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Nt=(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},Pt=(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=(Mt(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=(Mt(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=Mt(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?At: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 At},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[_]=At,Be(y,e,p,h,v,At,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=jt,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?jt:P,ne=L),P!==jt){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=jt;else{let e=i[P],t=i[P+1],c=jt;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?jt:P,ne=L);let R=F<I?jt:P,z,ae=!1;if(A>=0){if(ae=!0,z=ot(e,E,A,te,ne),z!==At&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==At&&t!==z&&(z=t,ae=!1)}else z===At&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===At?Ke[_]=At:(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===At){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=Nt(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=Nt(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=Nt(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:kt?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(Lt.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},Ft=(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:Ft(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},It=(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:Ft(i,t);a&&(n&&(n+=` `),n+=a)}return n},Lt=function(){return It(arguments,!1)},Rt=256,zt=16,Bt=1024,Vt=4096,Ht=(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(Vt).fill(``),l=Array(Vt).fill(``),u=Array(Vt).fill(``));let i=Nt(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]=Ft(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>zt&&(_.miss=zt,_.skip=Bt,_.e.length=0,_.at=0);let u=_.e;u.length<Rt?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(Ft(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)}},Ut=Pt(Ot),G=Ht(Ut.mergeString,Ut);Ut.merge;var Wt=Object.defineProperty,Gt=(e,t)=>Wt(e,`name`,{value:t,configurable:!0});function Kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Gt(Kt,`setRef`);function qt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Kt(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():Kt(e[t],null)}}}}Gt(qt,`composeRefs`);function Jt(...e){return o.useCallback(qt(...e),e)}Gt(Jt,`useComposedRefs`);var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0});function Zt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=ln(r),o.Children.forEach(r,e=>{if(an(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;sn(n)&&typeof pn==`function`;)n=pn(n._payload);a=tn(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?rn(a):void 0,u=Jt(n,l);if(!a){if(r||r===0)throw Error(s?fn(e):dn(e));return r}let d=nn(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Xt(Zt,`createSlot`);var Qt=Zt(`Slot`),$t=Symbol.for(`radix.slottable`);function en(e){let t=Xt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=$t,t}Xt(en,`createSlottable`);var tn=Xt((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 nn(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]=un(a,i))}return{...e,...n}}Xt(nn,`mergeProps`);function rn(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)}Xt(rn,`getElementRef`);function an(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$t}Xt(an,`isSlottable`);var on=Symbol.for(`react.lazy`);function sn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===on&&`_payload`in e&&cn(e._payload)}Xt(sn,`isLazyComponent`);function cn(e){return typeof e==`object`&&!!e&&`then`in e}Xt(cn,`isPromiseLike`);function ln(e){let t=e;for(;sn(t)&&typeof pn==`function`;)t=pn(t._payload);return t}Xt(ln,`useUnwrappedLazy`);function un(...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}Xt(un,`concatAriaDescribedby`);var dn=Xt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),fn=Xt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),pn=o.use,mn=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})),hn=t(((e,t)=>{t.exports=mn()})),K=hn(),gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zt(`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,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}_n(vn,`dispatchDiscreteCustomEvent`);var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=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`}),Sn=o.forwardRef(bn(function(e,t){return(0,K.jsx)(q.span,{...e,ref:t,style:{...xn,...e.style}})},`VisuallyHidden`)),Cn=Object.defineProperty,wn=(e,t)=>Cn(e,`name`,{value:t,configurable:!0});function Tn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=wn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,K.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 wn(i,`useContext`),[r,i]}wn(Tn,`createContext`);function En(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=wn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,K.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 wn(c,`useContext`),[s,c]}wn(r,`createContext`);let i=wn(()=>{let t=n.map(e=>o.createContext(e));return wn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Dn(i,...t)]}wn(En,`createContextScope`);function Dn(...e){let t=e[0];if(e.length===1)return t;let n=wn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return wn(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}wn(Dn,`composeContextScopes`);var On=globalThis?.document?o.useLayoutEffect:()=>{},kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=An(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Zt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(c,n).collectionRef);return(0,K.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Zt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=Jt(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,K.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 An(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}An(jn,`createCollection`);var Mn=new WeakMap,Nn=class e extends Map{static{An(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Mn.set(this,!0)}set(e,t){return Mn.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=In(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=Pn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Pn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Pn(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 Pn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Fn(e,t);return n===-1?void 0:e[n]}An(Pn,`at`);function Fn(e,t){let n=e.length,r=In(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}An(Fn,`toSafeIndex`);function In(e){return e!==e||e===0?0:Math.trunc(e)}An(In,`toSafeInteger`);function Ln(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=An(({state:e,...t})=>e?(0,K.jsx)(d,{...t,state:e}):(0,K.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=An(e=>{let t=v();return(0,K.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=An(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=Jt(a,l),[d,f]=r,p=o.useRef(new Nn),m=o.useCallback(()=>{let e=p.current;return Bn(e)||e.sort(Vn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Hn(()=>{f(e=>{let t=e.toSorted(Vn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,K.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,K.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Zt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(f,n).collectionElementRef);return(0,K.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Zt(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);Rn(u.current,i)||(u.current=i);let d=u.current,f=Jt(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);On(()=>{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 Nn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(Vn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new Nn(t);return n.delete(e.element),n})},[c]),(0,K.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new Nn)}An(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}An(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return An(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}An(Ln,`createCollection`);function Rn(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}An(Rn,`shallowEqual`);function zn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}An(zn,`isElementPreceding`);function Bn(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}An(Bn,`isInDocumentOrder`);function Vn(e,t){return!e[1].element||!t[1].element?0:zn(e[1].element,t[1].element)?-1:1}An(Vn,`sortByDocumentPosition`);function Hn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}An(Hn,`getChildListObserver`);var Un=Object.defineProperty,Wn=(e,t)=>Un(e,`name`,{value:t,configurable:!0}),Gn=!!(typeof window<`u`&&window.document&&window.document.createElement);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return Wn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wn(J,`composeEventHandlers`);function Kn(e){if(!Gn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wn(Kn,`getOwnerWindow`);function qn(e){if(!Gn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wn(qn,`getOwnerDocument`);function Jn(e,t=!1){let{activeElement:n}=qn(e);if(!n?.nodeName)return null;if(Yn(n)&&n.contentDocument)return Jn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=qn(n).getElementById(e);if(t)return t}}return n}Wn(Jn,`getActiveElement`);function Yn(e){return e.tagName===`IFRAME`}Wn(Yn,`isFrame`);var Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Qn=o.useEffectEvent,$n=o.useInsertionEffect;function er(e){if(typeof Qn==`function`)return Qn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $n==`function`?$n(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zn(er,`useEffectEvent`);var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0}),rr=o.useInsertionEffect||On;function ir({prop:e,defaultProp:t,onChange:n=nr(()=>{},`onChange`),caller:r}){let[i,a,s]=ar({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=or(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}nr(ir,`useControllableState`);function ar({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return rr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nr(ar,`useUncontrolledState`);function or(e){return typeof e==`function`}nr(or,`isFunction`);var sr=Symbol(`RADIX:SYNC_STATE`);function cr(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=er(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===sr)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:sr,state:i})},[i,f.state,l]),[g,p]}nr(cr,`useControllableStateReducer`);var lr=Object.defineProperty,ur=(e,t)=>lr(e,`name`,{value:t,configurable:!0});function dr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}ur(dr,`useStateMachine`);var fr=ur(e=>{let{present:t,children:n}=e,r=pr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=hr(r.ref,_r(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function pr(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]=dr(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??gr(r.current),s.current=void 0):a.current=`none`},[c]),On(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=gr(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]),On(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ur(a=>{let o=gr(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=ur(e=>{e.target===t&&(a.current=gr(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=gr(t)}else r.current=null;n(e)},[])}}ur(pr,`usePresence`);function mr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ur(mr,`setRef`);function hr(...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=mr(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():mr(n[e],null)}}},[])}ur(hr,`useStableComposedRefs`);function gr(e){return e?.animationName||`none`}ur(gr,`getAnimationName`);function _r(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)}ur(_r,`getElementRef`);var vr=Object.defineProperty,yr=(e,t)=>vr(e,`name`,{value:t,configurable:!0}),br=o.useId||(()=>void 0),xr=0;function Sr(e){let[t,n]=o.useState(br());return On(()=>{e||n(e=>e??String(xr++))},[e]),e||(t?`radix-${t}`:``)}yr(Sr,`useId`);var Cr=Object.defineProperty,wr=(e,t)=>Cr(e,`name`,{value:t,configurable:!0}),Tr=`Collapsible`,[Er,Dr]=En(Tr),[Or,kr]=Er(Tr),Ar=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=ir({prop:r,defaultProp:i??!1,onChange:s,caller:Tr});return(0,K.jsx)(Or,{scope:n,disabled:a,contentId:Sr(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,K.jsx)(q.div,{"data-state":Ir(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),jr=`CollapsibleTrigger`,Mr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=kr(jr,n);return(0,K.jsx)(q.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Ir(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:J(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Nr=`CollapsibleContent`,Pr=o.forwardRef(wr(function(e,t){let{forceMount:n,...r}=e,i=kr(Nr,e.__scopeCollapsible);return(0,K.jsx)(fr,{present:n||i.open,children:({present:e})=>(0,K.jsx)(Fr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Fr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=kr(Nr,n),[c,l]=o.useState(r),u=o.useRef(null),d=Jt(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)},[]),On(()=>{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,K.jsx)(q.div,{"data-state":Ir(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 Ir(e){return e?`open`:`closed`}wr(Ir,`getState`);var Lr=Object.defineProperty,Rr=(e,t)=>Lr(e,`name`,{value:t,configurable:!0}),zr={LTR:`ltr`,RTL:`rtl`},Br=o.createContext(void 0);function Vr(e){let t=o.useContext(Br);return e||t||zr.LTR}Rr(Vr,`useDirection`);var Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0}),Wr=o.useInsertionEffect;function Gr(e){let t=o.useRef(e);return typeof Wr==`function`?Wr(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ur(Gr,`useCallbackRef`);var Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),Jr=`dismissableLayer.update`,Yr=`dismissableLayer.pointerDownOutside`,Xr=`dismissableLayer.focusOutside`,Zr,Qr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$r=o.forwardRef(qr(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(Qr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=Jt(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=ni(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=ri(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=Gr(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&&(Zr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ii(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Zr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ii())},[f,d]),o.useEffect(()=>{let e=qr(()=>h({}),`handleUpdate`);return document.addEventListener(Jr,e),()=>document.removeEventListener(Jr,e)},[]),(0,K.jsx)(q.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ei(){let e=o.useContext(Qr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}qr(ei,`useDismissableLayerSurface`);var ti=qr(()=>!0,`IS_TRUE`);function ni(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ti}=t,c=Gr(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()}qr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}qr(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)}qr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}qr(p,`handleInteractionBubble`);let m=qr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ai(Yr,c,p,{discrete:!0})};if(qr(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:qr(()=>l.current=!0,`onPointerDownCapture`)}}qr(ni,`usePointerDownOutside`);function ri(e,t=globalThis?.document){let n=Gr(e),r=o.useRef(!1);return o.useEffect(()=>{let e=qr(e=>{e.target&&!r.current&&ai(Xr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:qr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:qr(()=>r.current=!1,`onBlurCapture`)}}qr(ri,`useFocusOutside`);function ii(){let e=new CustomEvent(Jr);document.dispatchEvent(e)}qr(ii,`dispatchUpdate`);function ai(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?vn(i,a):i.dispatchEvent(a)}qr(ai,`handleAndDispatchCustomEvent`);var oi=Object.defineProperty,Y=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),si=`focusScope.autoFocusOnMount`,ci=`focusScope.autoFocusOnUnmount`,li={bubbles:!1,cancelable:!0},ui=o.forwardRef(Y(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Gr(a),f=Gr(s),p=o.useRef(null),m=Jt(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:xi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||xi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xi(l)};Y(e,`handleFocusIn`),Y(t,`handleFocusOut`),Y(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){Si.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(si,li);l.addEventListener(si,d),l.dispatchEvent(t),t.defaultPrevented||(hi(Ti(_i(l)),{select:!0}),document.activeElement===e&&xi(l))}return()=>{l.removeEventListener(si,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(ci,li);l.addEventListener(ci,f),l.dispatchEvent(r),r.defaultPrevented||xi(e??t.body,{select:!0}),l.removeEventListener(ci,f),Si.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]=gi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,K.jsx)(q.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),di=o.createContext(null);function fi({registry:e,children:t}){return e?(0,K.jsx)(di.Provider,{value:e,children:t}):t}Y(fi,`FocusScopeBranchProvider`);function pi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:Y(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Y(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Y(pi,`useFocusScopeBranchRegistry`);function mi(e){let t=o.useContext(di);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Y(mi,`useFocusScopeBranch`);function hi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xi(r,{select:t}),document.activeElement!==n)return}Y(hi,`focusFirst`);function gi(e){let t=_i(e);return[vi(t,e),vi(t.reverse(),e)]}Y(gi,`getTabbableEdges`);function _i(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Y(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}Y(_i,`getTabbableCandidates`);function vi(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):yi(r,{upTo:t})))return r}Y(vi,`findVisible`);function yi(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}Y(yi,`isHidden`);function bi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Y(bi,`isSelectableInput`);function xi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&bi(e)&&t&&e.select()}}Y(xi,`focus`);var Si=Ci();function Ci(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wi(e,t),e.unshift(t)},remove(t){e=wi(e,t),e[0]?.resume()}}}Y(Ci,`createFocusScopesStack`);function wi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Y(wi,`arrayRemove`);function Ti(e){return e.filter(e=>e.tagName!==`A`)}Y(Ti,`removeLinks`);var Ei=Object.defineProperty,Di=o.forwardRef(((e,t)=>Ei(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);On(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,K.jsx)(q.div,{...r,ref:t}),c):null},`Portal`)),Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=0,ji=null;function Mi(e){return Ni(),e.children}ki(Mi,`FocusGuards`);function Ni(){o.useEffect(()=>{ji||={start:Pi(),end:Pi()};let{start:e,end:t}=ji;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ai++,()=>{Ai===1&&(ji?.start.remove(),ji?.end.remove(),ji=null),Ai=Math.max(0,Ai-1)}},[])}ki(Ni,`useFocusGuards`);function Pi(){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}ki(Pi,`createFocusGuard`);var Fi=function(){return Fi=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},Fi.apply(this,arguments)};function Ii(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 Li(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 Ri=`right-scroll-bar-position`,zi=`width-before-scroll-bar`,Bi=`with-scroll-bars-hidden`,Vi=`--removed-body-scroll-bar-size`;function Hi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ui(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 Wi=typeof window<`u`?o.useLayoutEffect:o.useEffect,Gi=new WeakMap;function Ki(e,t){var n=Ui(t||null,function(t){return e.forEach(function(e){return Hi(e,t)})});return Wi(function(){var t=Gi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hi(e,null)}),i.forEach(function(e){r.has(e)||Hi(e,a)})}Gi.set(n,e)},[e]),n}function qi(e){return e}function Ji(e,t){t===void 0&&(t=qi);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 Yi(e){e===void 0&&(e={});var t=Ji(null);return t.options=Fi({async:!0,ssr:!1},e),t}var Xi=function(e){var t=e.sideCar,n=Ii(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,Fi({},n))};Xi.isSideCarExport=!0;function Zi(e,t){return e.useMedium(t),Xi}var Qi=Yi(),$i=function(){},ea=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:$i,onWheelCapture:$i,onTouchMoveCapture:$i}),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=Ii(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ki([n,t]),w=Fi(Fi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Qi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Fi(Fi({},w),{ref:C})):o.createElement(y,Fi({},w,{className:l,ref:C}),c))});ea.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ea.classNames={fullWidth:zi,zeroRight:Ri};var ta=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function na(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ta();return t&&e.setAttribute(`nonce`,t),e}function ra(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ia(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var aa=function(){var e=0,t=null;return{add:function(n){e==0&&(t=na())&&(ra(t,n),ia(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oa=function(){var e=aa();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sa=function(){var e=oa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ca={left:0,top:0,right:0,gap:0},la=function(e){return parseInt(e||``,10)||0},ua=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[la(n),la(r),la(i)]},da=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ca;var t=ua(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])}},fa=sa(),pa=`data-scroll-locked`,ma=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)||Object.keys(n).some(e=>e!==`toolCallId`&&e!==`isError`))return;let r=n;if(!(typeof r.toolCallId!=`string`||`isError`in r&&typeof r.isError!=`boolean`))return{toolCallId:r.toolCallId,...typeof r.isError==`boolean`?{isError:r.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===!0,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}`,le=64;function ue(e,t=le){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function de(e,t,n){return t===`called`?`Called ${ue(n)}`:H[e].title[t]}function fe(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>ue(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 pe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function me(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ye(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=pe(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 he={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 ge(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(he[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 _e(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:ye(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ye(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=ue(e.name);return i===void 0?a:`${a} · ${i}`}function ve(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)?ye(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 ye(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 be=[`work`,`messages`,`profile`],xe=e=>be.includes(e),Se={view:`activity`},Ce={view:`topology`},we=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function Te(e){try{return decodeURIComponent(e)}catch{return}}function Ee(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=Te(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=Te(r);if(!e||!we.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(xe(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:Te(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:Te(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=Te(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:Te(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 De(e,t){return Ee(e)??(t===`/graph`?Ce:Se)}function Oe(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 ke(e){return De(e.location.hash,e.location.pathname)}function Ae(e,t){let n=()=>t(ke(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function je(e,t){if(t.view!==`agent`)return;let n=Oe(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function Me(e,t){e.location.hash=Oe(t)}function Ne(e){return typeof e==`string`&&e.trim()?e:void 0}function Pe(e){let t=new Map;for(let n of e){let e=Ne(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Fe=`operator (you)`;function Ie(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Fe;if(typeof e==`object`)return Ie(e.id,t);let r=t.get(e);if(Ne(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 Le=``,Re=(e,t)=>[e,t].sort().join(Le);function ze(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(Le),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 Be(e){return ze(e).sort((e,t)=>t.last-e.last)}function Ve(e,t){let n=Pe(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 ze(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:Ie(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 He=[`waiting`,`working`,`idle`,`offline`],Ue=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},We=e=>{let t=Ue(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},Ge=e=>{let t=He.indexOf(e);return t===-1?He.length:t};function Ke(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>Ge(e.status)-Ge(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Ne(e.card.name)??e.card.id,role:Ne(e.card.role),status:e.status,activity:e.activity,harness:Ue(e.card.meta,`connector`),host:Ue(e.card.meta,`host`),attention:e.attention,model:Ue(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...We(e.card.meta)}))}var qe=e=>e.filter(e=>e.status===`waiting`);function Je(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 Ye=e=>e.status;function W(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 Xe(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Ze=48,Qe=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ze-t;return n},$e=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},et=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ze;n+=i>>>1^-(i&1),t[r]=n}return t},tt=384,nt=[],rt=$e(Qe(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),it=$e(Qe(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),at=`@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`,ot=(()=>{let e=rt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=rt[n];i<rt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(rt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=rt[i];a<rt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),st=Qe(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),ct=$e(Qe(`123333359346463635126536711576`)),lt=Qe(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ut=Qe(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),dt=et(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),ft=(()=>{let e=new Int32Array(319).fill(-1),t=et(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=et(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),pt=`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}),mt=et(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ht=et(`ɠ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`),gt=et(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),_t=new Int32Array(987),vt=new Int32Array(987),yt=new Int32Array(987),bt=``,xt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<mt.length;r++)for(let i of pt[gt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),xt[a*2]=bt.length,xt[a*2+1]=i.length,bt+=i),_t[n]=mt[r],vt[n]=ht[r],yt[n]=a,n++}}var St=et(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Ct=$e(Qe(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),wt=et(`2Š4A;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`),Tt=Qe(`ij`),Et=Qe(`—`),Dt=Qe(`1`),Ot={GROUP_COUNT:tt,customValidatorNames:nt,edgeStart:rt,labelStart:it,labelText:at,edgeTarget:ot,nodeGroup:st,nodeVlist:ft,vlistPat:ct,vlistOps:lt,vlistRef:ut,vlistGroup:dt,litAnchor:_t,litGroup:vt,litPool:yt,poolOffsets:xt,poolText:bt,adjGid:St,adjStart:Ct,adjTgt:wt,patGid:Tt,patTgt:Et,postfixLookupGroups:Dt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},kt=`line`in Error(),At=-1,jt=-1,Mt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Nt=(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},Pt=(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=(Mt(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=(Mt(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=Mt(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?At: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 At},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[_]=At,Be(y,e,p,h,v,At,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=jt,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?jt:P,ne=L),P!==jt){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=jt;else{let e=i[P],t=i[P+1],c=jt;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?jt:P,ne=L);let R=F<I?jt:P,z,ae=!1;if(A>=0){if(ae=!0,z=ot(e,E,A,te,ne),z!==At&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==At&&t!==z&&(z=t,ae=!1)}else z===At&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===At?Ke[_]=At:(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===At){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=Nt(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=Nt(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=Nt(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:kt?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(Lt.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},Ft=(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:Ft(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},It=(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:Ft(i,t);a&&(n&&(n+=` `),n+=a)}return n},Lt=function(){return It(arguments,!1)},Rt=256,zt=16,Bt=1024,Vt=4096,Ht=(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(Vt).fill(``),l=Array(Vt).fill(``),u=Array(Vt).fill(``));let i=Nt(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]=Ft(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>zt&&(_.miss=zt,_.skip=Bt,_.e.length=0,_.at=0);let u=_.e;u.length<Rt?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(Ft(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)}},Ut=Pt(Ot),G=Ht(Ut.mergeString,Ut);Ut.merge;var Wt=Object.defineProperty,Gt=(e,t)=>Wt(e,`name`,{value:t,configurable:!0});function Kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Gt(Kt,`setRef`);function qt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Kt(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():Kt(e[t],null)}}}}Gt(qt,`composeRefs`);function Jt(...e){return o.useCallback(qt(...e),e)}Gt(Jt,`useComposedRefs`);var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0});function Zt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=ln(r),o.Children.forEach(r,e=>{if(an(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;sn(n)&&typeof pn==`function`;)n=pn(n._payload);a=tn(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?rn(a):void 0,u=Jt(n,l);if(!a){if(r||r===0)throw Error(s?fn(e):dn(e));return r}let d=nn(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Xt(Zt,`createSlot`);var Qt=Zt(`Slot`),$t=Symbol.for(`radix.slottable`);function en(e){let t=Xt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=$t,t}Xt(en,`createSlottable`);var tn=Xt((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 nn(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]=un(a,i))}return{...e,...n}}Xt(nn,`mergeProps`);function rn(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)}Xt(rn,`getElementRef`);function an(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$t}Xt(an,`isSlottable`);var on=Symbol.for(`react.lazy`);function sn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===on&&`_payload`in e&&cn(e._payload)}Xt(sn,`isLazyComponent`);function cn(e){return typeof e==`object`&&!!e&&`then`in e}Xt(cn,`isPromiseLike`);function ln(e){let t=e;for(;sn(t)&&typeof pn==`function`;)t=pn(t._payload);return t}Xt(ln,`useUnwrappedLazy`);function un(...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}Xt(un,`concatAriaDescribedby`);var dn=Xt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),fn=Xt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),pn=o.use,mn=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})),hn=t(((e,t)=>{t.exports=mn()})),K=hn(),gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zt(`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,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}_n(vn,`dispatchDiscreteCustomEvent`);var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=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`}),Sn=o.forwardRef(bn(function(e,t){return(0,K.jsx)(q.span,{...e,ref:t,style:{...xn,...e.style}})},`VisuallyHidden`)),Cn=Object.defineProperty,wn=(e,t)=>Cn(e,`name`,{value:t,configurable:!0});function Tn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=wn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,K.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 wn(i,`useContext`),[r,i]}wn(Tn,`createContext`);function En(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=wn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,K.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 wn(c,`useContext`),[s,c]}wn(r,`createContext`);let i=wn(()=>{let t=n.map(e=>o.createContext(e));return wn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Dn(i,...t)]}wn(En,`createContextScope`);function Dn(...e){let t=e[0];if(e.length===1)return t;let n=wn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return wn(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}wn(Dn,`composeContextScopes`);var On=globalThis?.document?o.useLayoutEffect:()=>{},kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=An(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Zt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(c,n).collectionRef);return(0,K.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Zt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=Jt(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,K.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 An(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}An(jn,`createCollection`);var Mn=new WeakMap,Nn=class e extends Map{static{An(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Mn.set(this,!0)}set(e,t){return Mn.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=In(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=Pn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Pn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Pn(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 Pn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Fn(e,t);return n===-1?void 0:e[n]}An(Pn,`at`);function Fn(e,t){let n=e.length,r=In(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}An(Fn,`toSafeIndex`);function In(e){return e!==e||e===0?0:Math.trunc(e)}An(In,`toSafeInteger`);function Ln(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=An(({state:e,...t})=>e?(0,K.jsx)(d,{...t,state:e}):(0,K.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=An(e=>{let t=v();return(0,K.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=An(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=Jt(a,l),[d,f]=r,p=o.useRef(new Nn),m=o.useCallback(()=>{let e=p.current;return Bn(e)||e.sort(Vn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Hn(()=>{f(e=>{let t=e.toSorted(Vn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,K.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,K.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Zt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(f,n).collectionElementRef);return(0,K.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Zt(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);Rn(u.current,i)||(u.current=i);let d=u.current,f=Jt(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);On(()=>{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 Nn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(Vn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new Nn(t);return n.delete(e.element),n})},[c]),(0,K.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new Nn)}An(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}An(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return An(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}An(Ln,`createCollection`);function Rn(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}An(Rn,`shallowEqual`);function zn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}An(zn,`isElementPreceding`);function Bn(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}An(Bn,`isInDocumentOrder`);function Vn(e,t){return!e[1].element||!t[1].element?0:zn(e[1].element,t[1].element)?-1:1}An(Vn,`sortByDocumentPosition`);function Hn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}An(Hn,`getChildListObserver`);var Un=Object.defineProperty,Wn=(e,t)=>Un(e,`name`,{value:t,configurable:!0}),Gn=!!(typeof window<`u`&&window.document&&window.document.createElement);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return Wn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wn(J,`composeEventHandlers`);function Kn(e){if(!Gn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wn(Kn,`getOwnerWindow`);function qn(e){if(!Gn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wn(qn,`getOwnerDocument`);function Jn(e,t=!1){let{activeElement:n}=qn(e);if(!n?.nodeName)return null;if(Yn(n)&&n.contentDocument)return Jn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=qn(n).getElementById(e);if(t)return t}}return n}Wn(Jn,`getActiveElement`);function Yn(e){return e.tagName===`IFRAME`}Wn(Yn,`isFrame`);var Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Qn=o.useEffectEvent,$n=o.useInsertionEffect;function er(e){if(typeof Qn==`function`)return Qn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $n==`function`?$n(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zn(er,`useEffectEvent`);var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0}),rr=o.useInsertionEffect||On;function ir({prop:e,defaultProp:t,onChange:n=nr(()=>{},`onChange`),caller:r}){let[i,a,s]=ar({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=or(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}nr(ir,`useControllableState`);function ar({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return rr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nr(ar,`useUncontrolledState`);function or(e){return typeof e==`function`}nr(or,`isFunction`);var sr=Symbol(`RADIX:SYNC_STATE`);function cr(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=er(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===sr)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:sr,state:i})},[i,f.state,l]),[g,p]}nr(cr,`useControllableStateReducer`);var lr=Object.defineProperty,ur=(e,t)=>lr(e,`name`,{value:t,configurable:!0});function dr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}ur(dr,`useStateMachine`);var fr=ur(e=>{let{present:t,children:n}=e,r=pr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=hr(r.ref,_r(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function pr(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]=dr(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??gr(r.current),s.current=void 0):a.current=`none`},[c]),On(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=gr(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]),On(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ur(a=>{let o=gr(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=ur(e=>{e.target===t&&(a.current=gr(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=gr(t)}else r.current=null;n(e)},[])}}ur(pr,`usePresence`);function mr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ur(mr,`setRef`);function hr(...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=mr(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():mr(n[e],null)}}},[])}ur(hr,`useStableComposedRefs`);function gr(e){return e?.animationName||`none`}ur(gr,`getAnimationName`);function _r(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)}ur(_r,`getElementRef`);var vr=Object.defineProperty,yr=(e,t)=>vr(e,`name`,{value:t,configurable:!0}),br=o.useId||(()=>void 0),xr=0;function Sr(e){let[t,n]=o.useState(br());return On(()=>{e||n(e=>e??String(xr++))},[e]),e||(t?`radix-${t}`:``)}yr(Sr,`useId`);var Cr=Object.defineProperty,wr=(e,t)=>Cr(e,`name`,{value:t,configurable:!0}),Tr=`Collapsible`,[Er,Dr]=En(Tr),[Or,kr]=Er(Tr),Ar=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=ir({prop:r,defaultProp:i??!1,onChange:s,caller:Tr});return(0,K.jsx)(Or,{scope:n,disabled:a,contentId:Sr(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,K.jsx)(q.div,{"data-state":Ir(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),jr=`CollapsibleTrigger`,Mr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=kr(jr,n);return(0,K.jsx)(q.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Ir(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:J(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Nr=`CollapsibleContent`,Pr=o.forwardRef(wr(function(e,t){let{forceMount:n,...r}=e,i=kr(Nr,e.__scopeCollapsible);return(0,K.jsx)(fr,{present:n||i.open,children:({present:e})=>(0,K.jsx)(Fr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Fr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=kr(Nr,n),[c,l]=o.useState(r),u=o.useRef(null),d=Jt(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)},[]),On(()=>{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,K.jsx)(q.div,{"data-state":Ir(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 Ir(e){return e?`open`:`closed`}wr(Ir,`getState`);var Lr=Object.defineProperty,Rr=(e,t)=>Lr(e,`name`,{value:t,configurable:!0}),zr={LTR:`ltr`,RTL:`rtl`},Br=o.createContext(void 0);function Vr(e){let t=o.useContext(Br);return e||t||zr.LTR}Rr(Vr,`useDirection`);var Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0}),Wr=o.useInsertionEffect;function Gr(e){let t=o.useRef(e);return typeof Wr==`function`?Wr(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ur(Gr,`useCallbackRef`);var Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),Jr=`dismissableLayer.update`,Yr=`dismissableLayer.pointerDownOutside`,Xr=`dismissableLayer.focusOutside`,Zr,Qr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$r=o.forwardRef(qr(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(Qr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=Jt(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=ni(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=ri(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=Gr(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&&(Zr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ii(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Zr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ii())},[f,d]),o.useEffect(()=>{let e=qr(()=>h({}),`handleUpdate`);return document.addEventListener(Jr,e),()=>document.removeEventListener(Jr,e)},[]),(0,K.jsx)(q.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ei(){let e=o.useContext(Qr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}qr(ei,`useDismissableLayerSurface`);var ti=qr(()=>!0,`IS_TRUE`);function ni(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ti}=t,c=Gr(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()}qr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}qr(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)}qr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}qr(p,`handleInteractionBubble`);let m=qr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ai(Yr,c,p,{discrete:!0})};if(qr(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:qr(()=>l.current=!0,`onPointerDownCapture`)}}qr(ni,`usePointerDownOutside`);function ri(e,t=globalThis?.document){let n=Gr(e),r=o.useRef(!1);return o.useEffect(()=>{let e=qr(e=>{e.target&&!r.current&&ai(Xr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:qr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:qr(()=>r.current=!1,`onBlurCapture`)}}qr(ri,`useFocusOutside`);function ii(){let e=new CustomEvent(Jr);document.dispatchEvent(e)}qr(ii,`dispatchUpdate`);function ai(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?vn(i,a):i.dispatchEvent(a)}qr(ai,`handleAndDispatchCustomEvent`);var oi=Object.defineProperty,Y=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),si=`focusScope.autoFocusOnMount`,ci=`focusScope.autoFocusOnUnmount`,li={bubbles:!1,cancelable:!0},ui=o.forwardRef(Y(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Gr(a),f=Gr(s),p=o.useRef(null),m=Jt(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:xi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||xi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xi(l)};Y(e,`handleFocusIn`),Y(t,`handleFocusOut`),Y(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){Si.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(si,li);l.addEventListener(si,d),l.dispatchEvent(t),t.defaultPrevented||(hi(Ti(_i(l)),{select:!0}),document.activeElement===e&&xi(l))}return()=>{l.removeEventListener(si,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(ci,li);l.addEventListener(ci,f),l.dispatchEvent(r),r.defaultPrevented||xi(e??t.body,{select:!0}),l.removeEventListener(ci,f),Si.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]=gi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,K.jsx)(q.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),di=o.createContext(null);function fi({registry:e,children:t}){return e?(0,K.jsx)(di.Provider,{value:e,children:t}):t}Y(fi,`FocusScopeBranchProvider`);function pi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:Y(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Y(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Y(pi,`useFocusScopeBranchRegistry`);function mi(e){let t=o.useContext(di);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Y(mi,`useFocusScopeBranch`);function hi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xi(r,{select:t}),document.activeElement!==n)return}Y(hi,`focusFirst`);function gi(e){let t=_i(e);return[vi(t,e),vi(t.reverse(),e)]}Y(gi,`getTabbableEdges`);function _i(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Y(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}Y(_i,`getTabbableCandidates`);function vi(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):yi(r,{upTo:t})))return r}Y(vi,`findVisible`);function yi(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}Y(yi,`isHidden`);function bi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Y(bi,`isSelectableInput`);function xi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&bi(e)&&t&&e.select()}}Y(xi,`focus`);var Si=Ci();function Ci(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wi(e,t),e.unshift(t)},remove(t){e=wi(e,t),e[0]?.resume()}}}Y(Ci,`createFocusScopesStack`);function wi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Y(wi,`arrayRemove`);function Ti(e){return e.filter(e=>e.tagName!==`A`)}Y(Ti,`removeLinks`);var Ei=Object.defineProperty,Di=o.forwardRef(((e,t)=>Ei(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);On(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,K.jsx)(q.div,{...r,ref:t}),c):null},`Portal`)),Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=0,ji=null;function Mi(e){return Ni(),e.children}ki(Mi,`FocusGuards`);function Ni(){o.useEffect(()=>{ji||={start:Pi(),end:Pi()};let{start:e,end:t}=ji;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ai++,()=>{Ai===1&&(ji?.start.remove(),ji?.end.remove(),ji=null),Ai=Math.max(0,Ai-1)}},[])}ki(Ni,`useFocusGuards`);function Pi(){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}ki(Pi,`createFocusGuard`);var Fi=function(){return Fi=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},Fi.apply(this,arguments)};function Ii(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 Li(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 Ri=`right-scroll-bar-position`,zi=`width-before-scroll-bar`,Bi=`with-scroll-bars-hidden`,Vi=`--removed-body-scroll-bar-size`;function Hi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ui(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 Wi=typeof window<`u`?o.useLayoutEffect:o.useEffect,Gi=new WeakMap;function Ki(e,t){var n=Ui(t||null,function(t){return e.forEach(function(e){return Hi(e,t)})});return Wi(function(){var t=Gi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hi(e,null)}),i.forEach(function(e){r.has(e)||Hi(e,a)})}Gi.set(n,e)},[e]),n}function qi(e){return e}function Ji(e,t){t===void 0&&(t=qi);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 Yi(e){e===void 0&&(e={});var t=Ji(null);return t.options=Fi({async:!0,ssr:!1},e),t}var Xi=function(e){var t=e.sideCar,n=Ii(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,Fi({},n))};Xi.isSideCarExport=!0;function Zi(e,t){return e.useMedium(t),Xi}var Qi=Yi(),$i=function(){},ea=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:$i,onWheelCapture:$i,onTouchMoveCapture:$i}),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=Ii(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ki([n,t]),w=Fi(Fi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Qi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Fi(Fi({},w),{ref:C})):o.createElement(y,Fi({},w,{className:l,ref:C}),c))});ea.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ea.classNames={fullWidth:zi,zeroRight:Ri};var ta=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function na(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ta();return t&&e.setAttribute(`nonce`,t),e}function ra(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ia(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var aa=function(){var e=0,t=null;return{add:function(n){e==0&&(t=na())&&(ra(t,n),ia(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oa=function(){var e=aa();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sa=function(){var e=oa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ca={left:0,top:0,right:0,gap:0},la=function(e){return parseInt(e||``,10)||0},ua=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[la(n),la(r),la(i)]},da=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ca;var t=ua(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])}},fa=sa(),pa=`data-scroll-locked`,ma=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
  .${Bi} {
4
4
  overflow: hidden ${r};
5
5
  padding-right: ${s}px ${r};