@lacneu/atrium 0.44.0 → 0.44.1

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.
Files changed (35) hide show
  1. package/dist/assets/{AccessTab-DIQGYONr.js → AccessTab-D0JX5_mH.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-DvEno3Aq.js → AdvancedFilter-C2V1UpGN.js} +1 -1
  3. package/dist/assets/{AgentFilesTab-D58Ewnxq.js → AgentFilesTab-C3K357SP.js} +1 -1
  4. package/dist/assets/{AnomaliesTab-BlhZZGZK.js → AnomaliesTab-DrZDQWE-.js} +1 -1
  5. package/dist/assets/{AuditTab-BvVSi2_w.js → AuditTab-Dya-8fsa.js} +1 -1
  6. package/dist/assets/{BridgeTab-D2Qg8iKI.js → BridgeTab-hb74bUWf.js} +1 -1
  7. package/dist/assets/{ChatDefaultsTab-CidvTjIU.js → ChatDefaultsTab-Dew3JIDA.js} +1 -1
  8. package/dist/assets/{DataTableShell-C_uiwnG-.js → DataTableShell-BYoFVC-r.js} +1 -1
  9. package/dist/assets/{DetailChips-Bi7POigs.js → DetailChips-CTEdEWG0.js} +1 -1
  10. package/dist/assets/{FeedbacksTab-DK6ZRozw.js → FeedbacksTab-Cev0HZud.js} +1 -1
  11. package/dist/assets/{FieldLabel-aA5o4R2f.js → FieldLabel-DGjTbsLi.js} +1 -1
  12. package/dist/assets/{FilesTab-N0bxhD0W.js → FilesTab-kPVOWWll.js} +1 -1
  13. package/dist/assets/{FilterBar-hVahB9Hp.js → FilterBar-CVU7c-v_.js} +1 -1
  14. package/dist/assets/{GroupsTab-D-5SYzK-.js → GroupsTab-BitxCqvs.js} +1 -1
  15. package/dist/assets/{InstancesTab-BuWsscmq.js → InstancesTab-C2LweWWX.js} +1 -1
  16. package/dist/assets/{IntegrationsTab-x8t35z2u.js → IntegrationsTab-C9agAKR0.js} +1 -1
  17. package/dist/assets/{KpiTab-DYi2oDFh.js → KpiTab-EJ3olSOM.js} +1 -1
  18. package/dist/assets/{PreferencesTab-DIS_GpwC.js → PreferencesTab-CQXSbXS3.js} +1 -1
  19. package/dist/assets/{PromptInjectionsTab-BKs4VaBY.js → PromptInjectionsTab-Gwd3CkwY.js} +1 -1
  20. package/dist/assets/{RolesTab-oG79jIyV.js → RolesTab-DnckeL9t.js} +1 -1
  21. package/dist/assets/{ServiceAccountsTab-OLN1AmBk.js → ServiceAccountsTab-CoF3np7F.js} +1 -1
  22. package/dist/assets/{SubAgentReportsTab-B5Jv9cGp.js → SubAgentReportsTab-DXymt-IL.js} +1 -1
  23. package/dist/assets/{ThemeShowroom-jXfQmTvF.js → ThemeShowroom-B0VjVJkx.js} +1 -1
  24. package/dist/assets/{TimeRangePicker-Ys5YJrFa.js → TimeRangePicker-BlUshfcd.js} +1 -1
  25. package/dist/assets/{TracesTab-DS0dtQjd.js → TracesTab-CfJUlNIH.js} +1 -1
  26. package/dist/assets/{UsersTab-CtJNzVXo.js → UsersTab-DGaxkYl7.js} +1 -1
  27. package/dist/assets/{VoiceTab-CPvagmjD.js → VoiceTab-Bt3Lxg8m.js} +1 -1
  28. package/dist/assets/{highlighted-body-OFNGDK62-YEbKkO5h.js → highlighted-body-OFNGDK62-CS3Oy50y.js} +1 -1
  29. package/dist/assets/{index-BygEdn-c.js → index-Cw1UFCV-.js} +4 -4
  30. package/dist/assets/{index-EeiigULY.css → index-DOTJd3Hv.css} +1 -1
  31. package/dist/assets/mermaid-GHXKKRXX-DhO1q99Q.js +1 -0
  32. package/dist/assets/{tabs-1TpabOuW.js → tabs-DYLGMjrm.js} +1 -1
  33. package/dist/index.html +13 -2
  34. package/package.json +1 -1
  35. package/dist/assets/mermaid-GHXKKRXX-a-Uqa-4Y.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-YEbKkO5h.js","assets/bundle-mjs-C73ZY4La.js","assets/RolesTab-oG79jIyV.js","assets/dist-C2CRpdq8.js","assets/roleDescriptions-BU3_Xc_1.js","assets/button-B39xibrh.js","assets/InstancesTab-BuWsscmq.js","assets/FieldLabel-aA5o4R2f.js","assets/curation-CQksaIbm.js","assets/locales-CPjguROj.js","assets/BridgeTab-D2Qg8iKI.js","assets/compatView-CzBpE4XD.js","assets/dist-uBTiN353.js","assets/tabs-1TpabOuW.js","assets/chevrons-up-down-BL8pPwMe.js","assets/FilterBar-hVahB9Hp.js","assets/TimeRangePicker-Ys5YJrFa.js","assets/table-BNCY2kTQ.js","assets/dispatchErrorInfo-C7BQ_n4r.js","assets/DataTableShell-C_uiwnG-.js","assets/PromptInjectionsTab-BKs4VaBY.js","assets/localePickerView-C2RmOS86.js","assets/confTabs-C35Io1ep.css","assets/GroupsTab-D-5SYzK-.js","assets/x-BbitkL6D.js","assets/DetailChips-Bi7POigs.js","assets/IntegrationsTab-x8t35z2u.js","assets/FeedbacksTab-DK6ZRozw.js","assets/SubAgentReportsTab-B5Jv9cGp.js","assets/FilesTab-N0bxhD0W.js","assets/AgentFilesTab-D58Ewnxq.js","assets/PreferencesTab-DIS_GpwC.js","assets/ChatDefaultsTab-CidvTjIU.js","assets/AccessTab-DIQGYONr.js","assets/ThemeShowroom-jXfQmTvF.js","assets/dist-BB8NhuRg.js","assets/AdvancedFilter-DvEno3Aq.js","assets/card-BV_9rQvt.js","assets/TracesTab-DS0dtQjd.js","assets/VoiceTab-CPvagmjD.js","assets/AuditTab-BvVSi2_w.js","assets/AnomaliesTab-BlhZZGZK.js","assets/KpiTab-DYi2oDFh.js","assets/ServiceAccountsTab-OLN1AmBk.js","assets/UsersTab-CtJNzVXo.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-CS3Oy50y.js","assets/bundle-mjs-C73ZY4La.js","assets/RolesTab-DnckeL9t.js","assets/dist-C2CRpdq8.js","assets/roleDescriptions-BU3_Xc_1.js","assets/button-B39xibrh.js","assets/InstancesTab-C2LweWWX.js","assets/FieldLabel-DGjTbsLi.js","assets/curation-CQksaIbm.js","assets/locales-CPjguROj.js","assets/BridgeTab-hb74bUWf.js","assets/compatView-CzBpE4XD.js","assets/dist-uBTiN353.js","assets/tabs-DYLGMjrm.js","assets/chevrons-up-down-BL8pPwMe.js","assets/FilterBar-CVU7c-v_.js","assets/TimeRangePicker-BlUshfcd.js","assets/table-BNCY2kTQ.js","assets/dispatchErrorInfo-C7BQ_n4r.js","assets/DataTableShell-BYoFVC-r.js","assets/PromptInjectionsTab-Gwd3CkwY.js","assets/localePickerView-C2RmOS86.js","assets/confTabs-C35Io1ep.css","assets/GroupsTab-BitxCqvs.js","assets/x-BbitkL6D.js","assets/DetailChips-CTEdEWG0.js","assets/IntegrationsTab-C9agAKR0.js","assets/FeedbacksTab-Cev0HZud.js","assets/SubAgentReportsTab-DXymt-IL.js","assets/FilesTab-kPVOWWll.js","assets/AgentFilesTab-C3K357SP.js","assets/PreferencesTab-CQXSbXS3.js","assets/ChatDefaultsTab-Dew3JIDA.js","assets/AccessTab-D0JX5_mH.js","assets/ThemeShowroom-B0VjVJkx.js","assets/dist-BB8NhuRg.js","assets/AdvancedFilter-C2V1UpGN.js","assets/card-BV_9rQvt.js","assets/TracesTab-CfJUlNIH.js","assets/VoiceTab-Bt3Lxg8m.js","assets/AuditTab-Dya-8fsa.js","assets/AnomaliesTab-DrZDQWE-.js","assets/KpiTab-EJ3olSOM.js","assets/ServiceAccountsTab-CoF3np7F.js","assets/UsersTab-DGaxkYl7.js"])))=>i.map(i=>d[i]);
2
2
  import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./bundle-mjs-C73ZY4La.js";import{$T as l,$_ as u,$c as d,$f as f,$o as p,$p as m,$r as h,$u as g,$w as _,AC as v,AE as y,AT as b,A_ as x,Aa as S,Ac as C,Af as w,Ag as T,Aj as E,An as D,Ao as O,Ap as k,Ar as A,B as j,BC as M,BT as N,B_ as ee,Ba as P,Bc as F,Bf as te,Bg as ne,Bo as re,Bp as ie,Br as ae,Bu as oe,Bw as se,C as ce,CE as le,CT as ue,Cc as de,Cd as fe,Cf as pe,Cg as me,Ch as he,Ci as ge,Cj as _e,Cn as ve,Co as ye,Cp as be,D as I,DC as xe,DE as Se,DT as Ce,Da as we,Dc as Te,Df as Ee,Dg as De,Di as Oe,Dj as ke,Dn as Ae,Do as je,Dp as Me,E as L,EE as Ne,ET as Pe,Ec as Fe,Ef as Ie,Eg as Le,Ei as Re,Ej as ze,En as Be,Eo as Ve,Ep as He,FC as Ue,FE as We,FT as Ge,F_ as Ke,Fa as qe,Fc as Je,Ff as Ye,Fg as Xe,Fn as Ze,Fo as Qe,Fp as $e,Fr as et,Fw as tt,GT as nt,G_ as rt,Gc as it,Go as at,Gp as ot,Gr as st,Gu as ct,Gw as lt,HC as ut,HT as dt,H_ as ft,Ha as pt,Hc as mt,Hg as ht,Ho as gt,Hp as _t,Hr as vt,Hs as yt,Hu as bt,Hw as xt,IC as St,IE as Ct,IT as wt,I_ as Tt,Ia as Et,Ic as Dt,If as Ot,Ig as kt,In as At,Io as jt,Ip as Mt,Ir as Nt,It as Pt,Iw as Ft,JA as It,JT as Lt,J_ as Rt,Jc as zt,Jo as Bt,Jp as Vt,Jr as Ht,Ju as Ut,Jw as Wt,KT as Gt,K_ as Kt,Kc as qt,Ko as Jt,Kp as Yt,Kr as Xt,Ku as Zt,Kw as Qt,LC as $t,LE as en,LT as tn,L_ as nn,La as rn,Lc as an,Lf as on,Lg as sn,Lo as cn,Lp as ln,Lr as un,Lt as dn,Lw as fn,MC as pn,ME as mn,MT as hn,M_ as gn,Ma as _n,Mc as vn,Mf as yn,Mg as bn,Mj as xn,Mn as Sn,Mo as Cn,Mp as wn,NC as Tn,NE as En,NT as Dn,N_ as On,Na as kn,Nc as An,Nf as jn,Ng as Mn,Nj as Nn,Nn as Pn,No as Fn,Np as In,O as Ln,OC as Rn,OE as zn,OT as Bn,Oa as Vn,Oc as Hn,Of as Un,Og as Wn,Oi as Gn,Oj as Kn,On as qn,Oo as Jn,Op as Yn,Or as Xn,PC as Zn,PE as Qn,PT as $n,P_ as er,Pa as tr,Pc as nr,Pf as rr,Pg as ir,Pn as ar,Po as or,Pp as sr,Pr as cr,QT as lr,Q_ as ur,Qc as dr,Qf as fr,Qo as pr,Qp as mr,Qr as hr,Qu as gr,Qw as _r,R as vr,RC as yr,RE as br,RT as xr,R_ as Sr,Ra as Cr,Rc as wr,Rf as Tr,Rg as Er,Ro as Dr,Rp as Or,Rr as kr,Rt as Ar,Ru as jr,Rw as Mr,S as Nr,SE as Pr,ST as Fr,Sc as Ir,Sd as Lr,Sf as Rr,Sg as zr,Si as Br,Sj as R,So as Vr,Sp as Hr,T as Ur,TE as Wr,TT as Gr,Tc as Kr,Tf as qr,Tg as Jr,Ti as Yr,Tj as Xr,Tn as Zr,To as Qr,Tp as $r,Tr as ei,UC as ti,UT as ni,U_ as ri,Ua as ii,Uc as ai,Ug as oi,Uo as si,Up as ci,Ur as li,Uu as ui,Uw as di,VC as fi,VT as pi,V_ as mi,Va as hi,Vc as gi,Vf as _i,Vg as vi,Vo as yi,Vp as bi,Vr as xi,Vu as Si,Vw as Ci,WC as wi,WT as Ti,W_ as Ei,Wa as Di,Wc as Oi,Wg as ki,Wo as Ai,Wp as ji,Wr as Mi,Wt as Ni,Wu as Pi,Ww as Fi,XT as Ii,X_ as Li,Xc as Ri,Xf as zi,Xo as Bi,Xp as Vi,Xr as Hi,Xu as Ui,Xw as Wi,YT as Gi,Y_ as Ki,Yc as qi,Yf as Ji,Yo as Yi,Yp as Xi,Yr as Zi,Yu as Qi,Yw as $i,ZT as ea,Z_ as ta,Zc as na,Zf as ra,Zo as ia,Zp as aa,Zr as oa,Zu as sa,Zw as ca,_ as la,_E as ua,_T as da,_d as fa,_f as pa,_i as ma,_j as ha,_o as ga,_p as _a,a as va,aE as ya,aT as ba,ad as xa,ai as Sa,al as Ca,an as wa,ao as Ta,ap as Ea,as as Da,at as Oa,b as ka,bE as Aa,bT as ja,bc as Ma,bd as Na,bf as Pa,bg as Fa,bi as Ia,bj as La,bo as Ra,bp as za,c as Ba,cE as Va,cT as Ha,cd as Ua,cj as Wa,cl as Ga,cn as Ka,co as qa,cp as Ja,cs as Ya,ct as Xa,d as Za,dA as Qa,dE as $a,dT as eo,dd as to,df as no,dj as ro,dl as io,dn as ao,do as oo,dp as so,ds as co,eE as lo,eT as uo,ed as fo,ei as po,el as mo,en as ho,eo as go,ep as _o,es as vo,ev as yo,f as bo,fE as xo,fT as So,fd as Co,ff as wo,fj as To,fl as Eo,fn as Do,fo as Oo,fp as ko,fs as Ao,g as jo,gE as Mo,gT as No,gd as Po,gf as Fo,gi as Io,gj as Lo,go as Ro,gp as zo,h as Bo,hE as Vo,hT as Ho,hd as Uo,hf as Wo,hi as Go,hj as Ko,ho as qo,hp as Jo,i as Yo,iE as Xo,iT as Zo,id as Qo,ii as $o,il as es,in as ts,io as ns,ip as rs,is,it as as,jC as os,jE as ss,jT as cs,j_ as ls,ja as us,jc as ds,jf as fs,jg as ps,jj as ms,jn as hs,jo as gs,jp as _s,jr as vs,kC as ys,kE as bs,kT as xs,ka as Ss,kc as Cs,kf as ws,kg as Ts,kn as Es,ko as Ds,kp as Os,l as ks,lE as As,lT as js,ld as Ms,lf as Ns,lj as Ps,ll as Fs,ln as Is,lo as Ls,lp as Rs,ls as zs,lt as Bs,mE as Vs,mT as Hs,md as Us,mf as Ws,mj as Gs,mo as Ks,mp as qs,n as Js,nE as Ys,nT as Xs,nd as Zs,ni as Qs,nl as $s,nn as ec,no as tc,np as nc,ns as rc,nv as ic,o as ac,oE as oc,oT as sc,od as cc,oi as lc,oj as uc,ol as dc,on as fc,oo as pc,op as mc,os as hc,ot as gc,p as _c,pE as vc,pT as yc,pd as bc,pf as xc,pj as Sc,pn as Cc,po as wc,pp as Tc,ps as Ec,qT as Dc,q_ as Oc,qc as kc,qo as Ac,qp as jc,qr as Mc,qu as Nc,qw as Pc,r as Fc,rE as Ic,rT as Lc,rd as Rc,ri as zc,rl as Bc,rn as Vc,ro as Hc,rp as Uc,rs as Wc,rt as Gc,s as Kc,sE as qc,sT as Jc,sd as Yc,si as Xc,sj as Zc,sl as Qc,sn as $c,so as el,sp as tl,ss as nl,st as rl,t as il,tE as al,tT as ol,td as sl,ti as cl,tl as ll,tn as ul,to as dl,tp as fl,ts as pl,tv as ml,u as hl,uE as gl,uT as _l,ud as vl,uf as yl,uj as bl,ul as xl,un as Sl,uo as Cl,up as wl,us as Tl,v as z,vE as El,vT as Dl,vd as Ol,vf as kl,vg as Al,vi as jl,vj as Ml,vo as Nl,vp as Pl,w as Fl,wE as Il,wT as Ll,wc as Rl,wd as zl,wf as Bl,wg as Vl,wi as Hl,wj as Ul,wn as Wl,wo as Gl,wp as Kl,wr as ql,x as Jl,xE as Yl,xT as Xl,xc as Zl,xd as Ql,xf as $l,xg as eu,xi as tu,xj as nu,xo as ru,xp as iu,y as au,yE as ou,yT as su,yc as cu,yd as lu,yf as uu,yg as du,yi as fu,yj as pu,yo as mu,yp as hu,z as gu,zC as _u,zE as vu,zT as yu,z_ as bu,za as xu,zc as Su,zf as Cu,zg as wu,zo as Tu,zp as Eu,zr as Du,zu as Ou,zw as ku}from"./dist-C2CRpdq8.js";import{n as Au,t as ju}from"./dist-BB8NhuRg.js";import{i as Mu,n as Nu,r as Pu,t as Fu}from"./dist-uBTiN353.js";import{t as Iu}from"./x-BbitkL6D.js";import{a as Lu,c as Ru,i as zu,l as Bu,n as Vu,o as Hu,r as Uu,s as Wu,t as Gu,u as Ku}from"./dist-D1sIakMz.js";import{n as qu,t as Ju}from"./button-B39xibrh.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Yu=a((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),eee=a(((e,t)=>{t.exports=Yu()})),Xu=a((t=>{var r=eee(),i=e(),a=n();function o(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 s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var ee=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var se=ie(null),ce=ie(null),le=ie(null),ue=ie(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qd(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function fe(){ae(se),ae(ce),ae(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=$d(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(ae(se),ae(ce)),ue.current===e&&(ae(ue),lp._currentValue=te)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -200,14 +200,14 @@ ${e}</tr>
200
200
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${F4(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=I4(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+F4(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=I4(e);if(i===null)return F4(n);e=i;let a=`<img src="${e}" alt="${F4(n)}"`;return t&&(a+=` title="${F4(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:F4(e.text)}},U4=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},W4=class e{options;renderer;textRenderer;constructor(e){this.options=e||r4,this.options.renderer=this.options.renderer||new H4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new U4}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},G4=class{options;block;constructor(e){this.options=e||r4}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?V4.lex:V4.lexInline}provideParser(e=this.block){return e?W4.parse:W4.parseInline}},K4=new class{defaults=n4();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W4;Renderer=H4;TextRenderer=U4;Lexer=V4;Tokenizer=B4;Hooks=G4;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new H4(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new B4(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new G4;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];G4.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&G4.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return V4.lex(e,t??this.defaults)}parser(e,t){return W4.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?V4.lex:V4.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?W4.parse:W4.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?V4.lex:V4.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?W4.parse:W4.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
201
201
  Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+F4(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function q4(e,t){return K4.parse(e,t)}q4.options=q4.setOptions=function(e){return K4.setOptions(e),q4.defaults=K4.defaults,i4(q4.defaults),q4},q4.getDefaults=n4,q4.defaults=r4,q4.use=function(...e){return K4.use(...e),q4.defaults=K4.defaults,i4(q4.defaults),q4},q4.walkTokens=function(e,t){return K4.walkTokens(e,t)},q4.parseInline=K4.parseInline,q4.Parser=W4,q4.parser=W4.parse,q4.Renderer=H4,q4.TextRenderer=U4,q4.Lexer=V4,q4.lexer=V4.lex,q4.Tokenizer=B4,q4.Hooks=G4,q4.parse=q4,q4.options,q4.setOptions,q4.use,q4.walkTokens,q4.parseInline,W4.parse,V4.lex;var Vde=`modulepreload`,Hde=function(e){return`/`+e},J4={},Y4=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Hde(t,n),t in J4)return;J4[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Vde,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ude=300,Wde=`300px`,Gde=500;function Kde(e={}){let{immediate:t=!1,debounceDelay:n=Ude,rootMargin:r=Wde,idleTimeout:i=Gde}=e,[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,B.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,B.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,B.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var X4=/\s/,qde=/^\s+$/,Jde=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),Yde=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,Xde=e=>e.some(e=>Yde(e)&&Jde.has(e.tagName)),Zde=e=>{let t=[],n=``,r=!1;for(let i of e){let e=X4.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},Qde=e=>{let t=[],n=``;for(let r of e)X4.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},$de=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},efe=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(Xde(t))return VW;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?Qde(c):Zde(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,qde.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return $de(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},tfe=0;function Z4(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=tfe++,i=()=>e=>{let r={count:0,newIndex:0};HW(e,`text`,(e,i)=>efe(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}Z4();var Q4=(0,B.createContext)(!1),nfe=()=>(0,B.useContext)(Q4),$4=(...e)=>c(i(e)),rfe=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},ife=e=>e?(...t)=>rfe(e,c(i(t))):$4,e3=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},t3=(0,B.createContext)($4),n3=()=>(0,B.useContext)(t3),afe=$4(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),ofe=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},r3=(0,B.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=n3(),c=(0,B.useMemo)(()=>s(afe),[s]),l=(0,B.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,ofe(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,V.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,V.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,V.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,V.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
202
202
  `:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,V.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),sfe=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,V.jsx)(`div`,{className:n3()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),i3=(0,B.createContext)({code:``}),a3=()=>(0,B.useContext)(i3),cfe=({language:e})=>{let t=n3();return(0,V.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,V.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},lfe=e=>{let t=e.length;for(;t>0&&e[t-1]===`
203
- `;)t--;return e.slice(0,t)},ufe=(0,B.lazy)(()=>Y4(()=>import(`./highlighted-body-OFNGDK62-YEbKkO5h.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),dfe=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=n3(),l=(0,B.useMemo)(()=>lfe(e),[e]),u=(0,B.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
203
+ `;)t--;return e.slice(0,t)},ufe=(0,B.lazy)(()=>Y4(()=>import(`./highlighted-body-OFNGDK62-CS3Oy50y.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),dfe=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=n3(),l=(0,B.useMemo)(()=>lfe(e),[e]),u=(0,B.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
204
204
  `).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,V.jsx)(i3.Provider,{value:{code:e},children:(0,V.jsxs)(sfe,{isIncomplete:i,language:t,children:[(0,V.jsx)(cfe,{language:t}),r?(0,V.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,V.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(r3,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,V.jsx)(ufe,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},o3={CheckIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,V.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,V.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,V.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,V.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,V.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},s3=(0,B.createContext)(o3),ffe=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},c3=({icons:e,children:t})=>{let n=(0,B.useRef)(e),r=(0,B.useRef)(e?{...o3,...e}:o3);ffe(n.current,e)||(n.current=e,r.current=e?{...o3,...e}:o3);let i=r.current;return(0,V.jsx)(s3.Provider,{value:i,children:t})},l3=()=>(0,B.useContext)(s3),u3={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},d3=(0,B.createContext)(u3),f3=()=>(0,B.useContext)(d3),p3=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=n3(),[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(0),{code:d}=a3(),{isAnimating:f}=(0,B.useContext)(S6),p=f3(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,B.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=l3(),_=c?g.CheckIcon:g.CopyIcon;return(0,V.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,V.jsx)(_,{size:14})})},m3={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},pfe=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=n3(),{code:c}=a3(),{isAnimating:l}=(0,B.useContext)(S6),u=f3(),d=l3(),f=a??c,p=`file.${n&&n in m3?m3[n]:`txt`}`;return(0,V.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{e3(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,V.jsx)(d.DownloadIcon,{size:14})})},h3=()=>{let{Loader2Icon:e}=l3(),t=n3();return(0,V.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,V.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,V.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,V.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},mfe=/\.[^/.]+$/,hfe=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=l3(),c=n3(),l=(0,B.useRef)(null),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),m=f3(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,B.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,B.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,B.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(mfe,``)}.${i}`}e3(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,V.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,V.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,V.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,V.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,V.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,V.jsx)(s,{size:14})})]}):null},g3=0,_3=()=>{g3+=1,g3===1&&(document.body.style.overflow=`hidden`)},v3=()=>{g3=Math.max(0,g3-1),g3===0&&(document.body.style.overflow=``)},gfe=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=l3(),c=n3(),[l,u]=(0,B.useState)(!1),d=f3(),f=(0,B.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,B.useCallback)(()=>{r(),n()},[r,n]);return(0,B.useEffect)(()=>{if(t){_3();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),v3()}}},[t,n]),t?(0,V.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,V.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,V.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,V.jsx)(s,{size:16})}),(0,V.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,V.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,V.jsx)(o,{size:20}),(0,V.jsx)(`span`,{children:d.openExternalLink})]}),(0,V.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,V.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,V.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,V.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{size:14}),(0,V.jsx)(`span`,{children:d.copied})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a,{size:14}),(0,V.jsx)(`span`,{children:d.copyLink})]})}),(0,V.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,V.jsx)(o,{size:14}),(0,V.jsx)(`span`,{children:d.openLink})]})]})]})}):null},y3=(0,B.createContext)(null),b3=()=>(0,B.useContext)(y3),_fe=()=>b3()?.code??null,x3=()=>b3()?.mermaid??null,vfe=e=>{var t;let n=b3();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},yfe=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),bfe=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=n3(),[s,c]=(0,B.useState)(!1),l=(0,B.useRef)(null),{isAnimating:u}=(0,B.useContext)(S6),d=l3(),f=x3(),p=f3(),m=async t=>{try{if(t===`mmd`){e3(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){e3(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){e3(`diagram.png`,await yfe(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,B.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,V.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,V.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,V.jsx)(d.DownloadIcon,{size:14})}),s?(0,V.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,V.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,V.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,V.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},xfe=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=l3(),c=n3(),[l,u]=(0,B.useState)(!1),{isAnimating:d,controls:f}=(0,B.useContext)(S6),p=f3(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,B.useEffect)(()=>{if(l){_3();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),v3()}}},[l]),(0,B.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,V.jsx)(o,{size:14})}),l?(0,Gm.createPortal)((0,V.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,V.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,V.jsx)(s,{size:20})}),(0,V.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,V.jsx)(T6,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},S3=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},C3=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
205
205
  `)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
206
206
  `)},Sfe=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
207
207
  `||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
208
208
  `?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
209
209
  `)},w3=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},T3=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>w3(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?w3(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>w3(e)).join(` | `)} |`,i+=1;return r.join(`
210
- `)},E3=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=n3(),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(null),d=(0,B.useRef)(0),{isAnimating:f}=(0,B.useContext)(S6),p=f3(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=S3(t),o=({csv:C3,tsv:Sfe,md:T3}[e]||T3)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,B.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=l3(),g=c?h.CheckIcon:h.CopyIcon;return(0,V.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,V.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,V.jsx)(g,{height:14,width:14})}),o?(0,V.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},D3=({children:e,className:t,onDownload:n,onError:r})=>{let i=n3(),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(null),{isAnimating:c}=(0,B.useContext)(S6),l=f3(),u=l3(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=S3(t),a=e===`csv`?C3(i):T3(i);e3(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,B.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,V.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,V.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,V.jsx)(u.DownloadIcon,{size:14})}),a?(0,V.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,V.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,V.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},Cfe=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=l3(),o=n3(),[s,c]=(0,B.useState)(!1),{isAnimating:l}=(0,B.useContext)(S6),u=f3(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,B.useEffect)(()=>{if(s){_3();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),v3()}}},[s]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,V.jsx)(i,{size:14})}),s?(0,Gm.createPortal)((0,V.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,V.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,V.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,V.jsx)(E3,{}):null,r?(0,V.jsx)(D3,{}):null,(0,V.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,V.jsx)(a,{size:20})})]}),(0,V.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,V.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},wfe=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=n3(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,V.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,V.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,V.jsx)(E3,{}):null,l?(0,V.jsx)(D3,{}):null,u?(0,V.jsx)(Cfe,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,V.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,V.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},Tfe=/startLine=(\d+)/,Efe=/\bnoLineNumbers\b/,Dfe=(0,B.lazy)(()=>Y4(()=>import(`./mermaid-GHXKKRXX-a-Uqa-4Y.js`).then(e=>({default:e.Mermaid})),[])),Ofe=/language-([^\s]+)/;function O3(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function k3(e,t){return e.className===t.className&&O3(e.node,t.node)}var A3=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,j3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},M3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},N3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},P3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`ol`,{className:n3()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>k3(e,t));P3.displayName=`MarkdownOl`;var F3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`li`,{className:n3()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&O3(e.node,t.node));F3.displayName=`MarkdownLi`;var I3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`ul`,{className:n3()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>k3(e,t));I3.displayName=`MarkdownUl`;var L3=(0,B.memo)(({className:e,node:t,...n})=>(0,V.jsx)(`hr`,{className:n3()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>k3(e,t));L3.displayName=`MarkdownHr`;var R3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`span`,{className:n3()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>k3(e,t));R3.displayName=`MarkdownStrong`;var z3=(0,B.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=n3(),{linkSafety:o}=(0,B.useContext)(S6),[s,c]=(0,B.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,B.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,B.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,B.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,V.jsx)(gfe,{...p})]}):(0,V.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>k3(e,t)&&e.href===t.href);z3.displayName=`MarkdownA`;var B3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h1`,{className:n3()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>k3(e,t));B3.displayName=`MarkdownH1`;var V3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h2`,{className:n3()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>k3(e,t));V3.displayName=`MarkdownH2`;var H3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h3`,{className:n3()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>k3(e,t));H3.displayName=`MarkdownH3`;var U3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h4`,{className:n3()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>k3(e,t));U3.displayName=`MarkdownH4`;var W3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h5`,{className:n3()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>k3(e,t));W3.displayName=`MarkdownH5`;var G3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h6`,{className:n3()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>k3(e,t));G3.displayName=`MarkdownH6`;var K3=(0,B.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,B.useContext)(S6);return(0,V.jsx)(wfe,{className:t,showControls:A3(i,`table`),showCopy:j3(i,`copy`),showDownload:j3(i,`download`),showFullscreen:j3(i,`fullscreen`),...r,children:e})},(e,t)=>k3(e,t));K3.displayName=`MarkdownTable`;var q3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`thead`,{className:n3()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>k3(e,t));q3.displayName=`MarkdownThead`;var J3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`tbody`,{className:n3()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>k3(e,t));J3.displayName=`MarkdownTbody`;var Y3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`tr`,{className:n3()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>k3(e,t));Y3.displayName=`MarkdownTr`;var X3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`th`,{className:n3()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>k3(e,t));X3.displayName=`MarkdownTh`;var Z3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`td`,{className:n3()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>k3(e,t));Z3.displayName=`MarkdownTd`;var Q3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`blockquote`,{className:n3()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>k3(e,t));Q3.displayName=`MarkdownBlockquote`;var $3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`sup`,{className:n3()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>k3(e,t));$3.displayName=`MarkdownSup`;var e6=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`sub`,{className:n3()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>k3(e,t));e6.displayName=`MarkdownSub`;var t6=(0,B.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,B.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,B.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,B.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,B.isValidElement)(e))return e;if(e.type===P3){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,V.jsx)(`section`,{className:t,...r,children:i}):null}return(0,V.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>k3(e,t));t6.displayName=`MarkdownSection`;var n6=(0,B.memo)(({node:e,className:t,children:n,...r})=>{let i=n3(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,B.useContext)(S6),l=x3(),u=nfe(),d=(t?.match(Ofe))?.at(1)??``,f=vfe(d);if(a)return(0,V.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Tfe),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&Efe.test(p))&&c!==!1,v=``;if((0,B.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(h3,{}),children:(0,V.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=A3(s,`mermaid`),n=N3(s,`download`),r=N3(s,`copy`),a=N3(s,`fullscreen`),c=N3(s,`panZoom`),l=e&&(n||r||a);return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(h3,{}),children:(0,V.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,V.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,V.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,V.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,V.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,V.jsx)(bfe,{chart:v,config:o?.config}):null,r?(0,V.jsx)(p3,{code:v}):null,a?(0,V.jsx)(xfe,{chart:v,config:o?.config}):null]})}):null,(0,V.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,V.jsx)(Dfe,{chart:v,config:o?.config,showControls:c})})]})})}let y=A3(s,`code`),b=M3(s,`download`),x=M3(s,`copy`);return(0,V.jsx)(dfe,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,V.jsxs)(V.Fragment,{children:[b?(0,V.jsx)(pfe,{code:v,language:d}):null,x?(0,V.jsx)(p3,{}):null]}):null})},(e,t)=>e.className===t.className&&O3(e.node,t.node));n6.displayName=`MarkdownCode`;var r6=(0,B.memo)(hfe,(e,t)=>e.className===t.className&&O3(e.node,t.node));r6.displayName=`MarkdownImg`;var i6=(0,B.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,B.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,V.jsx)(V.Fragment,{children:e})}return(0,V.jsx)(`p`,{...n,children:e})},(e,t)=>k3(e,t));i6.displayName=`MarkdownParagraph`;var kfe={ol:P3,li:F3,ul:I3,hr:L3,strong:R3,a:z3,h1:B3,h2:V3,h3:H3,h4:U3,h5:W3,h6:G3,table:K3,thead:q3,tbody:J3,tr:Y3,th:X3,td:Z3,blockquote:Q3,code:n6,img:r6,pre:({children:e})=>(0,B.isValidElement)(e)?(0,B.cloneElement)(e,{"data-block":`true`}):e,sup:$3,sub:e6,p:i6,section:t6},Afe=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,jfe=/\p{L}/u;function a6(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(Afe.test(e))return`rtl`;if(jfe.test(e))return`ltr`}return`ltr`}var Mfe=/^[ \t]{0,3}(`{3,}|~{3,})/,Nfe=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,o6=e=>{let t=e.split(`
210
+ `)},E3=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=n3(),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(null),d=(0,B.useRef)(0),{isAnimating:f}=(0,B.useContext)(S6),p=f3(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=S3(t),o=({csv:C3,tsv:Sfe,md:T3}[e]||T3)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,B.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=l3(),g=c?h.CheckIcon:h.CopyIcon;return(0,V.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,V.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,V.jsx)(g,{height:14,width:14})}),o?(0,V.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,V.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},D3=({children:e,className:t,onDownload:n,onError:r})=>{let i=n3(),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(null),{isAnimating:c}=(0,B.useContext)(S6),l=f3(),u=l3(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=S3(t),a=e===`csv`?C3(i):T3(i);e3(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,B.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,V.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,V.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,V.jsx)(u.DownloadIcon,{size:14})}),a?(0,V.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,V.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,V.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},Cfe=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=l3(),o=n3(),[s,c]=(0,B.useState)(!1),{isAnimating:l}=(0,B.useContext)(S6),u=f3(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,B.useEffect)(()=>{if(s){_3();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),v3()}}},[s]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,V.jsx)(i,{size:14})}),s?(0,Gm.createPortal)((0,V.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,V.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,V.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,V.jsx)(E3,{}):null,r?(0,V.jsx)(D3,{}):null,(0,V.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,V.jsx)(a,{size:20})})]}),(0,V.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,V.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},wfe=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=n3(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,V.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,V.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,V.jsx)(E3,{}):null,l?(0,V.jsx)(D3,{}):null,u?(0,V.jsx)(Cfe,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,V.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,V.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},Tfe=/startLine=(\d+)/,Efe=/\bnoLineNumbers\b/,Dfe=(0,B.lazy)(()=>Y4(()=>import(`./mermaid-GHXKKRXX-DhO1q99Q.js`).then(e=>({default:e.Mermaid})),[])),Ofe=/language-([^\s]+)/;function O3(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function k3(e,t){return e.className===t.className&&O3(e.node,t.node)}var A3=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,j3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},M3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},N3=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},P3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`ol`,{className:n3()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>k3(e,t));P3.displayName=`MarkdownOl`;var F3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`li`,{className:n3()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&O3(e.node,t.node));F3.displayName=`MarkdownLi`;var I3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`ul`,{className:n3()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>k3(e,t));I3.displayName=`MarkdownUl`;var L3=(0,B.memo)(({className:e,node:t,...n})=>(0,V.jsx)(`hr`,{className:n3()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>k3(e,t));L3.displayName=`MarkdownHr`;var R3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`span`,{className:n3()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>k3(e,t));R3.displayName=`MarkdownStrong`;var z3=(0,B.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=n3(),{linkSafety:o}=(0,B.useContext)(S6),[s,c]=(0,B.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,B.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,B.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,B.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,V.jsx)(gfe,{...p})]}):(0,V.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>k3(e,t)&&e.href===t.href);z3.displayName=`MarkdownA`;var B3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h1`,{className:n3()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>k3(e,t));B3.displayName=`MarkdownH1`;var V3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h2`,{className:n3()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>k3(e,t));V3.displayName=`MarkdownH2`;var H3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h3`,{className:n3()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>k3(e,t));H3.displayName=`MarkdownH3`;var U3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h4`,{className:n3()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>k3(e,t));U3.displayName=`MarkdownH4`;var W3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h5`,{className:n3()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>k3(e,t));W3.displayName=`MarkdownH5`;var G3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`h6`,{className:n3()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>k3(e,t));G3.displayName=`MarkdownH6`;var K3=(0,B.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,B.useContext)(S6);return(0,V.jsx)(wfe,{className:t,showControls:A3(i,`table`),showCopy:j3(i,`copy`),showDownload:j3(i,`download`),showFullscreen:j3(i,`fullscreen`),...r,children:e})},(e,t)=>k3(e,t));K3.displayName=`MarkdownTable`;var q3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`thead`,{className:n3()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>k3(e,t));q3.displayName=`MarkdownThead`;var J3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`tbody`,{className:n3()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>k3(e,t));J3.displayName=`MarkdownTbody`;var Y3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`tr`,{className:n3()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>k3(e,t));Y3.displayName=`MarkdownTr`;var X3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`th`,{className:n3()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>k3(e,t));X3.displayName=`MarkdownTh`;var Z3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`td`,{className:n3()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>k3(e,t));Z3.displayName=`MarkdownTd`;var Q3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`blockquote`,{className:n3()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>k3(e,t));Q3.displayName=`MarkdownBlockquote`;var $3=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`sup`,{className:n3()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>k3(e,t));$3.displayName=`MarkdownSup`;var e6=(0,B.memo)(({children:e,className:t,node:n,...r})=>(0,V.jsx)(`sub`,{className:n3()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>k3(e,t));e6.displayName=`MarkdownSub`;var t6=(0,B.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,B.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,B.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,B.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,B.isValidElement)(e))return e;if(e.type===P3){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,V.jsx)(`section`,{className:t,...r,children:i}):null}return(0,V.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>k3(e,t));t6.displayName=`MarkdownSection`;var n6=(0,B.memo)(({node:e,className:t,children:n,...r})=>{let i=n3(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,B.useContext)(S6),l=x3(),u=nfe(),d=(t?.match(Ofe))?.at(1)??``,f=vfe(d);if(a)return(0,V.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Tfe),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&Efe.test(p))&&c!==!1,v=``;if((0,B.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(h3,{}),children:(0,V.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=A3(s,`mermaid`),n=N3(s,`download`),r=N3(s,`copy`),a=N3(s,`fullscreen`),c=N3(s,`panZoom`),l=e&&(n||r||a);return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(h3,{}),children:(0,V.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,V.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,V.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,V.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,V.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,V.jsx)(bfe,{chart:v,config:o?.config}):null,r?(0,V.jsx)(p3,{code:v}):null,a?(0,V.jsx)(xfe,{chart:v,config:o?.config}):null]})}):null,(0,V.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,V.jsx)(Dfe,{chart:v,config:o?.config,showControls:c})})]})})}let y=A3(s,`code`),b=M3(s,`download`),x=M3(s,`copy`);return(0,V.jsx)(dfe,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,V.jsxs)(V.Fragment,{children:[b?(0,V.jsx)(pfe,{code:v,language:d}):null,x?(0,V.jsx)(p3,{}):null]}):null})},(e,t)=>e.className===t.className&&O3(e.node,t.node));n6.displayName=`MarkdownCode`;var r6=(0,B.memo)(hfe,(e,t)=>e.className===t.className&&O3(e.node,t.node));r6.displayName=`MarkdownImg`;var i6=(0,B.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,B.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,V.jsx)(V.Fragment,{children:e})}return(0,V.jsx)(`p`,{...n,children:e})},(e,t)=>k3(e,t));i6.displayName=`MarkdownParagraph`;var kfe={ol:P3,li:F3,ul:I3,hr:L3,strong:R3,a:z3,h1:B3,h2:V3,h3:H3,h4:U3,h5:W3,h6:G3,table:K3,thead:q3,tbody:J3,tr:Y3,th:X3,td:Z3,blockquote:Q3,code:n6,img:r6,pre:({children:e})=>(0,B.isValidElement)(e)?(0,B.cloneElement)(e,{"data-block":`true`}):e,sup:$3,sub:e6,p:i6,section:t6},Afe=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,jfe=/\p{L}/u;function a6(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(Afe.test(e))return`rtl`;if(jfe.test(e))return`ltr`}return`ltr`}var Mfe=/^[ \t]{0,3}(`{3,}|~{3,})/,Nfe=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,o6=e=>{let t=e.split(`
211
211
  `),n=null,r=0;for(let e of t){let t=Mfe.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},Pfe=e=>{let t=e.split(`
212
212
  `);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&Nfe.test(t))return!0}return!1},Ffe=()=>e=>{WW(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},s6=[],c6={allowDangerousHtml:!0},l6=new WeakMap,u6=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=l6.get(e);n||(n=e.name,l6.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=l6.get(r);e||(e=r.name,l6.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},d6=e=>{let t=Ife(e),n=e.children||``;return Ufe(t.runSync(t.parse(n),n),e)},Ife=e=>{let t=u6.get(e);if(t)return t;let n=Rfe(e);return u6.set(e,n),n},Lfe=e=>e.some(e=>Array.isArray(e)?e[0]===hZ:e===hZ),Rfe=e=>{let t=e.rehypePlugins||s6,n=e.remarkPlugins||s6,r=Lfe(t)?n:[...n,Ffe],i=e.remarkRehypeOptions?{...c6,...e.remarkRehypeOptions}:c6;return $ue().use($le).use(r).use(Fue,i).use(t)},zfe=e=>e,Bfe=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},Vfe=(e,t)=>{for(let n in S2)if(Object.hasOwn(S2,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=S2[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Hfe=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},Ufe=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||zfe;WW(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return Bfe(c,s,a,e.value),s;if(e.type===`element`&&(Vfe(e,t),Hfe(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return sle(e,{Fragment:V.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.jsxs,passKeys:!0,passNode:!0})},Wfe=/\[\^[\w-]{1,200}\](?!:)/,Gfe=/\[\^[\w-]{1,200}\]:/,Kfe=/<(\w+)[\s>]/,qfe=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),f6=new Map,p6=new Map,Jfe=e=>{let t=e.toLowerCase(),n=f6.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return f6.set(t,r),r},Yfe=e=>{let t=e.toLowerCase(),n=p6.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return p6.set(t,r),r},m6=(e,t)=>{if(qfe.has(t.toLowerCase()))return 0;let n=e.match(Jfe(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},h6=(e,t)=>{let n=e.match(Yfe(t));return n?n.length:0},Xfe=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},Zfe=e=>{let t=Wfe.test(e),n=Gfe.test(e);if(t||n)return[e];let r=V4.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=m6(t,e),o=h6(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(Kfe);if(e){let n=e[1];m6(t,n)>h6(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(Xfe(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},Qfe=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
213
213
 
@@ -230,4 +230,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
230
230
  To pick up a draggable item, press the space bar.
231
231
  While dragging, use the arrow keys to move the item.
232
232
  Press space again to drop the item in its new position, or press escape to cancel.
233
- `},Lhe={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Rhe(e){let{announcements:t=Lhe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ihe}=e,{announce:a,announcement:o}=Nhe(),s=O5(`DndLiveRegion`),[c,l]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{l(!0)},[]),Phe((0,B.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=B.createElement(B.Fragment,null,B.createElement(jhe,{id:r,value:i.draggable}),B.createElement(Mhe,{id:s,announcement:o}));return n?(0,Gm.createPortal)(u,n):u}var L5;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(L5||={});function R5(){}function z5(e,t){return(0,B.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function B5(){var e=[...arguments];return(0,B.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var V5=Object.freeze({x:0,y:0});function H5(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function zhe(e,t){let n=N5(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function U5(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Bhe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function W5(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function G5(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function K5(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Vhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=K5(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=H5(K5(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(U5)},q5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=W5(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=W5(r),o=i.reduce((e,t,r)=>e+H5(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(U5)};function Hhe(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var Uhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Hhe(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Bhe)};function Whe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function J5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:V5}function Ghe(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Khe=Ghe(1);function Y5(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qhe(e,t,n){let r=Y5(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Jhe={ignoreTransform:!1};function X5(e,t){t===void 0&&(t=Jhe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=g5(e).getComputedStyle(e);t&&(n=qhe(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Z5(e){return X5(e,{ignoreTransform:!0})}function Yhe(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Xhe(e,t){return t===void 0&&(t=g5(e).getComputedStyle(e)),t.position===`fixed`}function Zhe(e,t){t===void 0&&(t=g5(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function Q5(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(_5(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!v5(i)||y5(i)||n.includes(i))return n;let a=g5(e).getComputedStyle(i);return i!==e&&Zhe(i,a)&&n.push(i),Xhe(i,a)?n:r(i.parentNode)}return e?r(e):n}function $5(e){let[t]=Q5(e,1);return t??null}function e7(e){return!p5||!e?null:m5(e)?e:h5(e)?_5(e)||e===b5(e).scrollingElement?window:v5(e)?e:null:null}function t7(e){return m5(e)?e.scrollX:e.scrollLeft}function n7(e){return m5(e)?e.scrollY:e.scrollTop}function r7(e){return{x:t7(e),y:n7(e)}}var i7;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(i7||={});function a7(e){return!p5||!e?!1:e===document.scrollingElement}function o7(e){let t={x:0,y:0},n=a7(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Qhe={x:.2,y:.2};function $he(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Qhe);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=o7(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=i7.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=i7.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=i7.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=i7.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ege(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function s7(e){return e.reduce((e,t)=>A5(e,r7(t)),V5)}function tge(e){return e.reduce((e,t)=>e+t7(t),0)}function nge(e){return e.reduce((e,t)=>e+n7(t),0)}function c7(e,t){if(t===void 0&&(t=X5),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);$5(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var rge=[[`x`,[`left`,`right`],tge],[`y`,[`top`,`bottom`],nge]],l7=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Q5(t),r=s7(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of rge)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},u7=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function ige(e){let{EventTarget:t}=g5(e);return e instanceof t?e:b5(e)}function d7(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var f7;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(f7||={});function p7(e){e.preventDefault()}function age(e){e.stopPropagation()}var m7;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(m7||={});var h7={start:[m7.Space,m7.Enter],cancel:[m7.Esc],end:[m7.Space,m7.Enter,m7.Tab]},oge=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case m7.Right:return{...n,x:n.x+25};case m7.Left:return{...n,x:n.x-25};case m7.Down:return{...n,y:n.y+25};case m7.Up:return{...n,y:n.y-25}}},g7=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new u7(b5(t)),this.windowListeners=new u7(g5(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(f7.Resize,this.handleCancel),this.windowListeners.add(f7.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(f7.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&c7(n),t(V5)}handleKeyDown(e){if(M5(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=h7,coordinateGetter:a=oge,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:V5;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=j5(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=o7(n),p=ege(n),m={x:Math.min(i===m7.Right?p.right-p.width/2:p.right,Math.max(i===m7.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===m7.Down?p.bottom-p.height/2:p.bottom,Math.max(i===m7.Down?p.top:p.top+p.height/2,u.y))},h=i===m7.Right&&!s||i===m7.Left&&!c,g=i===m7.Down&&!l||i===m7.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===m7.Right&&e<=d.x||i===m7.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===m7.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===m7.Down&&e<=d.y||i===m7.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===m7.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,A5(j5(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};g7.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=h7,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function _7(e){return!!(e&&`distance`in e)}function v7(e){return!!(e&&`delay`in e)}var y7=class{constructor(e,t,n){n===void 0&&(n=ige(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=b5(i),this.documentListeners=new u7(this.document),this.listeners=new u7(n),this.windowListeners=new u7(g5(i)),this.initialCoordinates=N5(r)??V5,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(f7.Resize,this.handleCancel),this.windowListeners.add(f7.DragStart,p7),this.windowListeners.add(f7.VisibilityChange,this.handleCancel),this.windowListeners.add(f7.ContextMenu,p7),this.documentListeners.add(f7.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(v7(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(_7(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(f7.Click,age,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(f7.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=N5(e)??V5,s=j5(n,o);if(!t&&a){if(_7(a)){if(a.tolerance!=null&&d7(s,a.tolerance))return this.handleCancel();if(d7(s,a.distance))return this.handleStart()}if(v7(a)&&d7(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===m7.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},sge={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},b7=class extends y7{constructor(e){let{event:t}=e,n=b5(t.target);super(e,sge,n)}};b7.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var cge={move:{name:`mousemove`},end:{name:`mouseup`}},x7;(function(e){e[e.RightClick=2]=`RightClick`})(x7||={});var lge=class extends y7{constructor(e){super(e,cge,b5(e.event.target))}};lge.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===x7.RightClick?!1:(r?.({event:n}),!0)}}];var S7={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},uge=class extends y7{constructor(e){super(e,S7)}static setup(){return window.addEventListener(S7.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(S7.move.name,e)};function e(){}}};uge.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var C7;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(C7||={});var w7;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(w7||={});function dge(e){let{acceleration:t,activator:n=C7.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=w7.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=pge({delta:d,disabled:!a}),[m,h]=Ehe(),g=(0,B.useRef)({x:0,y:0}),_=(0,B.useRef)({x:0,y:0}),v=(0,B.useMemo)(()=>{switch(n){case C7.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case C7.DraggableRect:return i}},[n,i,c]),y=(0,B.useRef)(null),b=(0,B.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,B.useMemo)(()=>s===w7.TreeOrder?[...l].reverse():l,[s,l]);(0,B.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=$he(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var fge={x:{[i7.Backward]:!1,[i7.Forward]:!1},y:{[i7.Backward]:!1,[i7.Forward]:!1}};function pge(e){let{delta:t,disabled:n}=e,r=E5(t);return w5(e=>{if(n||!r||!e)return fge;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[i7.Backward]:e.x[i7.Backward]||i.x===-1,[i7.Forward]:e.x[i7.Forward]||i.x===1},y:{[i7.Backward]:e.y[i7.Backward]||i.y===-1,[i7.Forward]:e.y[i7.Forward]||i.y===1}}},[n,t,r])}function mge(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return w5(e=>t==null?null:r??e??null,[r,t])}function hge(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var T7;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(T7||={});var E7;(function(e){e.Optimized=`optimized`})(E7||={});var D7=new Map;function gge(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,B.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,B.useRef)(e),d=g(),f=C5(d),p=(0,B.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,B.useRef)(null),h=w5(t=>{if(d&&!n)return D7;if(!t||t===D7||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new l7(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,B.useEffect)(()=>{u.current=e},[e]),(0,B.useEffect)(()=>{d||p()},[n,d]),(0,B.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,B.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case T7.Always:return!1;case T7.BeforeDragging:return n;default:return!n}}}function O7(e,t){return w5(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function _ge(e,t){return O7(e,t)}function vge(e){let{callback:t,disabled:n}=e,r=S5(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function k7(e){let{callback:t,disabled:n}=e,r=S5(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function yge(e){return new l7(X5(e),e)}function A7(e,t,n){t===void 0&&(t=yge);let[r,i]=(0,B.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=vge({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=k7({callback:a});return x5(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function bge(e){return J5(e,O7(e))}var j7=[];function xge(e){let t=(0,B.useRef)(e),n=w5(n=>e?n&&n!==j7&&e&&t.current&&e.parentNode===t.current.parentNode?n:Q5(e):j7,[e]);return(0,B.useEffect)(()=>{t.current=e},[e]),n}function Sge(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e),i=(0,B.useCallback)(e=>{let t=e7(e.target);t&&n(e=>e?(e.set(t,r7(t)),new Map(e)):null)},[]);return(0,B.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=e7(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,r7(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{e7(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,B.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>A5(e,t),V5):s7(e):V5,[e,t])}function M7(e,t){t===void 0&&(t=[]);let n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{n.current=null},t),(0,B.useEffect)(()=>{let t=e!==V5;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?j5(e,n.current):V5}function Cge(e){(0,B.useEffect)(()=>{if(!p5)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function wge(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function N7(e){return(0,B.useMemo)(()=>e?Yhe(e):null,[e])}var P7=[];function Tge(e,t){t===void 0&&(t=X5);let[n]=e,r=N7(n?g5(n):null),[i,a]=(0,B.useState)(P7);function o(){a(()=>e.length?e.map(e=>a7(e)?r:new l7(t(e),e)):P7)}let s=k7({callback:o});return x5(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function F7(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return v5(t)?t:e}function Ege(e){let{measure:t}=e,[n,r]=(0,B.useState)(null),i=k7({callback:(0,B.useCallback)(e=>{for(let{target:n}of e)if(v5(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=T5((0,B.useCallback)(e=>{let n=F7(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,B.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Dge=[{sensor:b7,options:{}},{sensor:g7,options:{}}],Oge={current:{}},I7={draggable:{measure:Z5},droppable:{measure:Z5,strategy:T7.WhileDragging,frequency:E7.Optimized},dragOverlay:{measure:X5}},L7=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},kge={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new L7,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:R5},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:I7,measureDroppableContainers:R5,windowRect:null,measuringScheduled:!1},R7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:R5,draggableNodes:new Map,over:null,measureDroppableContainers:R5},z7=(0,B.createContext)(R7),B7=(0,B.createContext)(kge);function Age(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new L7}}}function jge(e,t){switch(t.type){case L5.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case L5.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case L5.DragEnd:case L5.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case L5.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new L7(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case L5.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new L7(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case L5.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new L7(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Mge(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,B.useContext)(z7),a=E5(r),o=E5(n?.id);return(0,B.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!M5(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=khe(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function V7(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Nge(e){return(0,B.useMemo)(()=>({draggable:{...I7.draggable,...e?.draggable},droppable:{...I7.droppable,...e?.droppable},dragOverlay:{...I7.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Pge(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,B.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;x5(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=J5(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=$5(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var H7=(0,B.createContext)({...V5,scaleX:1,scaleY:1}),U7;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(U7||={});var W7=(0,B.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Dge,collisionDetection:o=Uhe,measuring:s,modifiers:c,...l}=e,[u,d]=(0,B.useReducer)(jge,void 0,Age),[f,p]=Fhe(),[m,h]=(0,B.useState)(U7.Uninitialized),g=m===U7.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,B.useRef)({initial:null,translated:null}),C=(0,B.useMemo)(()=>_==null?null:{id:_,data:x?.data??Oge,rect:S},[_,x]),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=C5(l,Object.values(l)),A=O5(`DndDescribedBy`,t),j=(0,B.useMemo)(()=>b.getEnabled(),[b]),M=Nge(s),{droppableRects:N,measureDroppableContainers:ee,measuringScheduled:P}=gge(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),F=mge(v,_),te=(0,B.useMemo)(()=>D?N5(D):null,[D]),ne=Me(),re=_ge(F,M.draggable.measure);Pge({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:M.draggable.measure});let ie=A7(F,M.draggable.measure,re),ae=A7(F?F.parentElement:null),oe=(0,B.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=Ege({measure:M.dragOverlay.measure}),le=ce.nodeRef.current??F,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=bge(de?null:ie),pe=N7(le?g5(le):null),me=xge(g?se??F:null),he=Tge(me),ge=V7(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=te?A5(te,y):null,ve=Sge(me),ye=M7(ve),be=M7(ve,[ie]),I=A5(ge,ye),xe=ue?Khe(ue,ge):null,Se=C&&xe?o({active:C,collisionRect:xe,droppableRects:N,droppableContainers:j,pointerCoordinates:_e}):null,Ce=G5(Se,`id`),[we,Te]=(0,B.useState)(null),Ee=Whe(de?ge:A5(ge,be),we?.rect??null,ie),De=(0,B.useRef)(null),Oe=(0,B.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;De.current=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Gm.unstable_batchedUpdates)(()=>{r?.(i),h(U7.Initializing),d({type:L5.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(De.current),O(a)})},onMove(e){d({type:L5.DragMove,coordinates:e})},onEnd:o(L5.DragEnd),onCancel:o(L5.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===L5.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=L5.DragCancel)}w.current=null,(0,Gm.unstable_batchedUpdates)(()=>{d({type:e}),h(U7.Uninitialized),Te(null),E(null),O(null),De.current=null;let t=e===L5.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),ke=hge(a,(0,B.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Oe(n,t))},[v,Oe]));Cge(a),x5(()=>{ie&&m===U7.Initializing&&h(U7.Initialized)},[ie,m]),(0,B.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:I.x,y:I.y},over:i};(0,Gm.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[I.x,I.y]),(0,B.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(Ce),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Gm.unstable_batchedUpdates)(()=>{Te(s),a?.(c),f({type:`onDragOver`,event:c})})},[Ce]),x5(()=>{oe.current={activatorEvent:D,active:C,activeNode:F,collisionRect:xe,collisions:Se,droppableRects:N,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:we,scrollableAncestors:me,scrollAdjustedTranslate:I},S.current={initial:ue,translated:xe}},[C,F,Se,xe,v,le,ue,N,b,we,me,I]),dge({...ne,delta:y,draggingRect:xe,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let Ae=(0,B.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:ie,activatorEvent:D,collisions:Se,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:N,over:we,measureDroppableContainers:ee,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:M,measuringScheduled:P,windowRect:pe}),[C,F,ie,D,Se,ae,ce,v,b,N,we,ee,me,he,M,P,pe]),je=(0,B.useMemo)(()=>({activatorEvent:D,activators:ke,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:we,measureDroppableContainers:ee}),[D,ke,C,ie,d,A,v,we,ee]);return B.createElement(I5.Provider,{value:p},B.createElement(z7.Provider,{value:je},B.createElement(B7.Provider,{value:Ae},B.createElement(H7.Provider,{value:Ee},i)),B.createElement(Mge,{disabled:n?.restoreFocus===!1})),B.createElement(Rhe,{...n,hiddenTextDescribedById:A}));function Me(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Fge=(0,B.createContext)(null),G7=`button`,Ige=`Draggable`;function Lge(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=O5(Ige),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,B.useContext)(z7),{role:p=G7,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,B.useContext)(g?H7:Fge),[v,y]=T5(),[b,x]=T5(),S=wge(o,t),C=C5(n);return x5(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,B.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===G7?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function K7(){return(0,B.useContext)(B7)}var Rge=`Droppable`,zge={timeout:25};function q7(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=O5(Rge),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,B.useContext)(z7),u=(0,B.useRef)({disabled:n}),d=(0,B.useRef)(!1),f=(0,B.useRef)(null),p=(0,B.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...zge,...i},_=C5(h??r),v=k7({callback:(0,B.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=T5((0,B.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=C5(t);return(0,B.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,B.useEffect)(()=>(s({type:L5.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:L5.UnregisterDroppable,key:a,id:r})),[r]),(0,B.useEffect)(()=>{n!==u.current.disabled&&(s({type:L5.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Bge(e){let{animation:t,children:n}=e,[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null),s=E5(n);return!n&&!r&&s&&i(s),x5(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),B.createElement(B.Fragment,null,n,r?(0,B.cloneElement)(r,{ref:o}):null)}var Vge={x:0,y:0,scaleX:1,scaleY:1};function Hge(e){let{children:t}=e;return B.createElement(z7.Provider,{value:R7},B.createElement(H7.Provider,{value:Vge},t))}var Uge={position:`fixed`,touchAction:`none`},Wge=e=>M5(e)?`transform 250ms ease`:void 0,Gge=(0,B.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Wge}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Uge,width:s.width,height:s.height,top:s.top,left:s.left,transform:P5.Transform.toString(d),transformOrigin:i&&r?zhe(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return B.createElement(n,{className:o,style:f,ref:t},a)}),Kge={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:P5.Transform.toString(t)},{transform:P5.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function qge(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return S5((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=F7(a);if(!c)return;let{transform:l}=g5(a).getComputedStyle(a),u=Y5(l);if(!u)return;let d=typeof t==`function`?t:Jge(t);return c7(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Jge(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Kge,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var J7=0;function Yge(e){return(0,B.useMemo)(()=>{if(e!=null)return J7++,J7},[e])}var Xge=B.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=K7(),S=(0,B.useContext)(H7),C=Yge(d?.id),w=V7(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=O7(f),E=qge({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return B.createElement(Hge,null,B.createElement(Bge,{animation:E},d&&C?B.createElement(Gge,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),Zge=e=>{let{transform:t}=e;return{...t,y:0}};function Qge(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var $ge=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:Qge(n,t,i)},e_e=e=>{let{transform:t}=e;return{...t,x:0}};function Y7(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function t_e(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function X7(e){return e!==null&&e>=0}function n_e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function r_e(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Z7={scaleX:1,scaleY:1},i_e=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=a_e(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...Z7}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...Z7}:a<r&&a>=i?{x:o.width+s,y:0,...Z7}:{x:0,y:0,...Z7}};function a_e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return!r||!i&&!a?0:n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width)}var Q7=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Y7(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},$7={scaleX:1,scaleY:1},o_e=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...$7}:null}let s=s_e(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...$7}:r<t&&r>=a?{x:0,y:o.height+s,...$7}:{x:0,y:0,...$7}};function s_e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var e9=`Sortable`,t9=B.createContext({activeIndex:-1,containerId:e9,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Q7,disabled:{draggable:!1,droppable:!1}});function n9(e){let{children:t,id:n,items:r,strategy:i=Q7,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=K7(),d=O5(e9,n),f=s.rect!==null,p=(0,B.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,B.useRef)(p),v=!n_e(p,_.current),y=g!==-1&&h===-1||v,b=r_e(a);x5(()=>{v&&m&&u(p)},[v,p,m,u]),(0,B.useEffect)(()=>{_.current=p},[p]);let x=(0,B.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:t_e(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return B.createElement(t9.Provider,{value:x},t)}var c_e=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Y7(n,r,i).indexOf(t)},l_e=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},u_e={duration:200,easing:`ease`},r9=`transform`,d_e=P5.Transition.toString({property:r9,duration:0,easing:`linear`}),f_e={roleDescription:`sortable`};function p_e(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,B.useState)(null),s=(0,B.useRef)(n);return x5(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=X5(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,B.useEffect)(()=>{a&&o(null)},[a]),a}function i9(e){let{animateLayoutChanges:t=l_e,attributes:n,disabled:r,data:i,getNewIndex:a=c_e,id:o,strategy:s,resizeObserverConfig:c,transition:l=u_e}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,B.useContext)(t9),y=m_e(r,p),b=u.indexOf(o),x=(0,B.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,B.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=q7({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:ee,setActivatorNodeRef:P,transform:F}=Lge({id:o,data:x,attributes:{...f_e,...n},disabled:y.draggable}),te=The(E,j),ne=!!D,re=ne&&!m&&X7(f)&&X7(g),ie=!_&&N,ae=re?(ie&&re?F:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,oe=X7(f)&&X7(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=D?.id,ce=(0,B.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:D,containerId:d,isDragging:N,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=p_e({disabled:!ue,index:b,node:w,rect:C});return(0,B.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,B.useEffect)(()=>{if(se===ce.current.activeId)return;if(se!=null&&ce.current.activeId==null){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:N,listeners:M,node:w,overIndex:g,over:ee,setNodeRef:te,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return d_e;if(!(ie&&!M5(O)||!l)&&(ne||ue))return P5.Transition.toString({...l,property:r9})}}function m_e(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function a9(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var h_e=[m7.Down,m7.Right,m7.Up,m7.Left],o9=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(h_e.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case m7.Down:r.top<a.top&&t.push(n);break;case m7.Up:r.top>a.top&&t.push(n);break;case m7.Left:r.left>a.left&&t.push(n);break;case m7.Right:r.left<a.left&&t.push(n);break}});let c=q5({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=G5(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=Q5(c).some((e,t)=>s[t]!==e),i=s9(e,t),a=g_e(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:j5(u,l)}}}};function s9(e,t){return!a9(e)||!a9(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function g_e(e,t){return!a9(e)||!a9(t)||!s9(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function c9({open:e,onOpenChange:t,title:n,description:r,children:i,onSubmit:a,submitLabel:o,submitting:s=!1,canSubmit:c=!0}){let[l,u]=(0,B.useState)(!1),d=s||l;async function f(){if(!(!c||d))try{u(!0),await a()}finally{u(!1)}}return(0,V.jsx)(T8,{open:e,onOpenChange:t,children:(0,V.jsxs)(E8,{side:`right`,className:`w-4/5 sm:max-w-none gap-0 p-0`,children:[(0,V.jsxs)(D8,{className:`border-b px-6 py-4`,children:[(0,V.jsx)(k8,{children:n}),r?(0,V.jsx)(A8,{children:r}):null]}),(0,V.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,V.jsx)(`div`,{className:`oc-sheet__body flex-1 overflow-y-auto px-6 py-4`,children:i}),(0,V.jsxs)(O8,{className:`border-t px-6 py-4`,children:[(0,V.jsxs)(Ju,{type:`submit`,disabled:!c||d,children:[d?(0,V.jsx)(Cb,{className:`size-4 animate-spin`}):null,o??qn()]}),(0,V.jsx)(Ju,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:Ae()})]})]})]})})}var l9=6e4,u9=60*l9,d9=24*u9,f9=7*d9,p9=30*d9,m9=365*d9;function __e(e,t){let n=t-e;if(n<l9)return`maintenant`;if(n<u9)return`${Math.floor(n/l9)}min`;if(n<d9)return`${Math.floor(n/u9)}h`;if(n<f9)return`${Math.floor(n/d9)}j`;if(n<p9)return`${Math.floor(n/f9)}sem`;if(n<m9)return`${Math.floor(n/p9)}mois`;let r=Math.floor(n/m9);return`${r}an${r>1?`s`:``}`}var h9=[{value:`red`,hue:`oklch(0.63 0.21 25)`},{value:`orange`,hue:`oklch(0.7 0.17 50)`},{value:`amber`,hue:`oklch(0.8 0.15 85)`},{value:`green`,hue:`oklch(0.7 0.16 150)`},{value:`teal`,hue:`oklch(0.7 0.12 190)`},{value:`blue`,hue:`oklch(0.62 0.19 250)`},{value:`violet`,hue:`oklch(0.6 0.2 300)`},{value:`pink`,hue:`oklch(0.7 0.2 350)`}],g9=e=>h9.find(t=>t.value===e)?.hue??null,_9=`project:none`,v_e=e=>`project:${e}`,v9=`oc.noproject.collapsed`;function y9(){return(0,V.jsx)(`div`,{className:`oc-sidebar__skeleton`,"aria-hidden":`true`,children:Array.from({length:7}).map((e,t)=>(0,V.jsx)(`div`,{className:`oc-skel oc-skel--row`},t))})}function y_e({activeChatId:e,onSelect:t,onNewChat:n,newChatShortcut:r}){let i=R(L.messages.listChats,{}),a=R(L.projects.listProjects,{}),o=R(L.me.getMe,{host:QR})?.ui?.effective,s=o?.showChatProvider??!0,c=o?.showChatAge??!0,l=new Set((i??[]).map(e=>e.providerKind).filter(e=>e!=null)),u=s&&l.size>1,[,d]=(0,B.useState)(0);(0,B.useEffect)(()=>{if(!c)return;let e=window.setInterval(()=>d(e=>e+1),6e4);return()=>window.clearInterval(e)},[c]);let f=nu(L.projects.createProject),p=nu(L.projects.setProjectCollapsed),m=nu(L.chats.reorderChat),h=nu(L.chats.moveChatToProject),g=IB(),_=Eu(),v=(0,B.useRef)(null),y=(0,B.useRef)(null),b=(0,B.useRef)(null),[x,S]=(0,B.useState)(`full`);(0,B.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=()=>{let t=e.clientWidth,n=y.current?.offsetWidth??0,r=b.current?.offsetWidth??0,i=n===0||t>=n?`full`:t>=r?`label`:`icon`;S(e=>e===i?e:i)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[_,r]);let[C,w]=(0,B.useState)(null),T=(0,B.useRef)(!1);(0,B.useEffect)(()=>{!T.current&&i&&w(i)},[i]);let E=C??i??[],D=i===void 0&&C===null,[O,k]=(0,B.useState)(null),[A,j]=(0,B.useState)(()=>localStorage.getItem(v9)===`1`);function M(){j(e=>(localStorage.setItem(v9,e?`0`:`1`),!e))}let N=B5(z5(b7,{activationConstraint:{distance:4}}),z5(g7,{coordinateGetter:o9})),ee=E.filter(e=>e.pinned),P=E.filter(e=>!e.pinned),F=e=>P.filter(t=>(t.projectId??null)===e);function te(e){return E.find(t=>t._id===e)}async function ne(e){k(null);let{active:t,over:n}=e;if(!n)return;let r=te(String(t.id));if(!r)return;let i=String(n.id);if(i.startsWith(`project:`)){let e=i===_9?null:i.slice(8);if((r.projectId??null)===e)return;T.current=!0,w(t=>(t??E).map(t=>t._id===r._id?{...t,projectId:e}:t));try{await h({chatId:r._id,projectId:e})}finally{T.current=!1}return}let a=te(i);if(!a||t.id===n.id)return;if((a.projectId??null)!==(r.projectId??null)||a.pinned!==r.pinned){if(r.pinned||a.pinned)return;T.current=!0,w(e=>(e??E).map(e=>e._id===r._id?{...e,projectId:a.projectId??null}:e));try{await h({chatId:r._id,projectId:a.projectId??null})}finally{T.current=!1}return}let o=a.pinned?ee:F(a.projectId??null),s=o.map(e=>e._id),c=s.indexOf(r._id),l=s.indexOf(a._id);if(c<0||l<0)return;let u=[...o];u.splice(c,1),u.splice(l,0,r);let d=u[l-1]??null,f=u[l+1]??null;T.current=!0,w(e=>[...(e??E).filter(e=>!o.some(t=>t._id===e._id)),...u]);try{await m({chatId:r._id,prevKey:d?d.sortKey:null,nextKey:f?f.sortKey:null})}finally{T.current=!1}}let re=O?te(O):null;return(0,V.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,V.jsxs)(`div`,{className:`oc-sidebar__top`,ref:v,children:[(0,V.jsxs)(Ju,{className:x===`icon`?`oc-newchat flex-1 justify-center`:`oc-newchat flex-1 justify-start`,onClick:n,title:`${_} (${r})`,"aria-label":_,children:[(0,V.jsx)(Vb,{}),x===`icon`?null:(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_}),x===`full`?(0,V.jsx)(`kbd`,{className:`oc-newchat__kbd`,"aria-hidden":!0,children:r}):null]}),(0,V.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,V.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:y,children:[(0,V.jsxs)(Ju,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,V.jsx)(Vb,{}),(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_}),(0,V.jsx)(`kbd`,{className:`oc-newchat__kbd`,children:r})]}),(0,V.jsx)(Ju,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,V.jsx)(vb,{})})]})}),(0,V.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,V.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:b,children:[(0,V.jsxs)(Ju,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,V.jsx)(Vb,{}),(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_})]}),(0,V.jsx)(Ju,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,V.jsx)(vb,{})})]})}),(0,V.jsx)(Ju,{className:`oc-newproject`,variant:`outline`,size:`icon`,"aria-label":Or(),title:Or(),onClick:async()=>{let e=await g({title:Or(),label:ln(),placeholder:Mt(),confirmLabel:$e()});e&&await f({name:e})},children:(0,V.jsx)(vb,{})})]}),(0,V.jsxs)(W7,{sensors:N,collisionDetection:q5,modifiers:[e_e,$ge],onDragStart:e=>k(e.active.id),onDragCancel:()=>k(null),onDragEnd:ne,children:[(0,V.jsx)(`div`,{className:`oc-sidebar__scroll`,children:D?(0,V.jsx)(y9,{}):(0,V.jsxs)(V.Fragment,{children:[ee.length>0?(0,V.jsx)(b9,{label:sr(),chats:ee,children:ee.map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))}):null,(a??[]).map(n=>{let r=F(n._id);return(0,V.jsx)(b9,{label:n.name,dropId:v_e(n._id),projectId:n._id,chats:r,collapsible:!0,collapsed:n.collapsed,onToggle:()=>void p({projectId:n._id,collapsed:!n.collapsed}),children:n.collapsed?null:r.length===0?(0,V.jsx)(`div`,{className:`oc-sidebar__empty`,children:In()}):r.map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))},n._id)}),(0,V.jsx)(b9,{label:wn(),dropId:_9,chats:F(null),collapsible:!0,collapsed:A,onToggle:M,children:A?null:F(null).map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))})]})}),(0,V.jsx)(Xge,{children:re?(0,V.jsxs)(`div`,{className:`oc-chatitem oc-chatitem--overlay`,children:[(0,V.jsx)(bb,{className:`size-3.5 opacity-60`}),g9(re.color)?(0,V.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:g9(re.color)}}):(0,V.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,V.jsx)(`span`,{className:`oc-chatitem__label`,children:re.title||_s()})]}):null})]})]})}function b9({label:e,dropId:t,projectId:n,chats:r,collapsible:i,collapsed:a,onToggle:o,children:s}){let c=nu(L.projects.deleteProject),l=FB(),u=R(L.projects.projectChatCount,n?{projectId:n}:`skip`),{setNodeRef:d,isOver:f}=q7({id:t??`static:${e}`});return(0,V.jsxs)(`div`,{ref:t?d:void 0,className:`oc-sidebar__group`+(f?` oc-sidebar__group--over`:``),children:[(0,V.jsxs)(`div`,{className:`oc-sidebar__group-head`+(i?` oc-sidebar__group-head--btn`:``),...i?{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>{i&&o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}}:{},children:[i?a?(0,V.jsx)(tb,{className:`size-3.5`}):(0,V.jsx)(Mu,{className:`size-3.5`}):null,(0,V.jsx)(`span`,{className:`oc-sidebar__group-label`,children:e}),n?(0,V.jsx)(`button`,{className:`oc-sidebar__group-del`,"aria-label":Os(),onClick:async t=>{t.stopPropagation();let r=u??0;await l({title:Yn({name:e}),description:r>0?Me({count:r}):He(),confirmWord:$r(),confirmLabel:Os(),destructive:!0})&&await c({projectId:n})},children:(0,V.jsx)(Jb,{className:`size-3.5`})}):null]}),(0,V.jsx)(n9,{items:r.map(e=>e._id),strategy:o_e,children:s})]})}var x9={openclaw:`OpenClaw`,hermes:`Hermes`};function S9({chat:e,active:t,projects:n,onSelect:r,showProviderBadge:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=i9({id:e._id}),d=nu(L.chats.renameChat),f=nu(L.chats.deleteChat),p=nu(L.chats.pinChat),m=nu(L.chats.setChatColor),h=R(L.me.getMe,{host:QR})?.ui?.effective?.showChatAge??!0,g=FB(),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(e.title??``),x={transform:P5.Transform.toString(c),transition:l,opacity:+!u},S=g9(e.color);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{ref:s,style:x,className:`oc-chatitem group/row`+(t?` oc-chatitem--active`:``),children:[(0,V.jsx)(`button`,{className:`oc-chatitem__grip`,"aria-label":Kl(),...a,...o,children:(0,V.jsx)(bb,{className:`size-3.5`})}),S?(0,V.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:S}}):(0,V.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,V.jsx)(`button`,{className:`oc-chatitem__label`,onClick:()=>r(e._id),children:e.title||_s()}),e.readOnly?(0,V.jsx)(`span`,{className:`oc-chatitem__readonly`,title:k(),children:(0,V.jsx)(wb,{size:12,"aria-label":k()})}):null,i&&e.providerKind?(0,V.jsx)(`span`,{className:`oc-chatitem__bridge oc-chatitem__bridge--${e.providerKind} group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:Jo({provider:x9[e.providerKind]}),children:x9[e.providerKind]}):null,h?(0,V.jsx)(`span`,{className:`oc-chatitem__age group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:wH(e.updatedAt),children:__e(e.updatedAt,Date.now())}):null,(0,V.jsxs)(dB,{children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsx)(Ju,{variant:`ghost`,size:`icon-xs`,"aria-label":be(),className:`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,V.jsx)(fb,{})})}),(0,V.jsxs)(pB,{align:`end`,className:`w-48`,children:[(0,V.jsxs)(mB,{onSelect:()=>{b(e.title??``),v(!0)},children:[(0,V.jsx)(Rb,{}),` `,Hr()]}),(0,V.jsxs)(mB,{onSelect:()=>void p({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,V.jsx)(Bb,{}):(0,V.jsx)(zb,{}),e.pinned?iu():za()]}),(0,V.jsx)(hB,{children:hu()}),(0,V.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({chatId:e._id,color:null}),"aria-label":Pl(),children:`✕`}),h9.map(t=>(0,V.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void m({chatId:e._id,color:t.value})},t.value))]}),(0,V.jsx)(gB,{}),(0,V.jsxs)(mB,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await g({title:_a(),description:zo(),confirmLabel:$r(),destructive:!0})&&await f({chatId:e._id})})},children:[(0,V.jsx)(Jb,{}),` `,$r()]})]})]})]}),(0,V.jsx)(c9,{open:_,onOpenChange:v,title:qs(),canSubmit:y.trim().length>0,onSubmit:async()=>{await d({chatId:e._id,title:y.trim()}),v(!1)},children:(0,V.jsx)(`div`,{className:`oc-form`,children:(0,V.jsxs)(`label`,{className:`oc-field`,children:[(0,V.jsx)(`span`,{className:`oc-field__label`,children:Tc()}),(0,V.jsx)(Hz,{value:y,onChange:e=>b(e.target.value),autoFocus:!0})]})})})]})}function b_e(e){let t=nu(L.chats.createChat),n=R(L.agents.listMyAgents),[r,i]=(0,B.useState)(!1),a=(0,B.useCallback)(async(n,r)=>{e(await t({instanceName:n,agentId:r}))},[t,e]);return{startNewChat:(0,B.useCallback)(async()=>{let e=n;if(e&&e.length===1&&e[0].state!==`deleted`){await a(e[0].instanceName,e[0].agentId);return}i(!0)},[n,a]),picker:(0,V.jsx)(qz,{open:r,onOpenChange:i,agents:n,onPick:(e,t)=>{i(!1),a(e,t)}})}}var C9=[`admin`,`user`,`pending`];function w9(){let e=R(L.me.authProviders)?.anonymous===!0,[t,n]=(0,B.useState)(!1),r=R(L.dev.listUsersDev,e?{}:`skip`),i=R(L.me.getImpersonation),a=nu(L.dev.setMyRole),o=nu(L.dev.setRole),s=nu(L.admin.startImpersonation),c=nu(L.admin.stopImpersonation);if(!e)return null;let l=r?.find(e=>e.isMe),u=l?.role===`admin`,d=i?.impersonating===!0,f=(r??[]).filter(e=>!e.isMe);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-devfab`,onClick:()=>n(!0),title:m(),children:[(0,V.jsx)(Zb,{size:13}),`DEV`]}),(0,V.jsx)(Pz,{open:t,onOpenChange:n,children:(0,V.jsxs)(Lz,{children:[(0,V.jsxs)(Rz,{children:[(0,V.jsx)(Bz,{children:mr()}),(0,V.jsx)(Vz,{children:aa()})]}),(0,V.jsxs)(`div`,{className:`oc-devsw__me`,children:[(0,V.jsxs)(`span`,{className:`oc-devsw__melabel`,children:[Vi({canonical:l?.canonical??`…`}),` `,(0,V.jsx)(Wz,{variant:`outline`,children:l?.role??`…`})]}),(0,V.jsx)(`div`,{className:`oc-devsw__roles`,children:C9.map(e=>(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:l?.role===e?`secondary`:`ghost`,disabled:l?.role===e,onClick:()=>void a({role:e}),children:e===`admin`?Xi():e===`user`?Vt():jc()},e))})]}),d?(0,V.jsxs)(`div`,{className:`oc-devsw__imp`,children:[Yt(),` `,(0,V.jsx)(`strong`,{children:i.targetLabel}),`.`,(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>void c(),children:ot()})]}):null,(0,V.jsx)(`div`,{className:`oc-devsw__list`,children:f.length===0?(0,V.jsx)(`p`,{className:`oc-devsw__empty`,children:ji()}):f.map(e=>(0,V.jsxs)(`div`,{className:`oc-devsw__row`,children:[(0,V.jsx)(`span`,{className:`oc-devsw__label`,children:e.name||e.email||e.canonical||e.userId.slice(0,8)}),(0,V.jsx)(`select`,{className:`oc-devsw__select`,value:e.role,disabled:!e.canonical,onChange:t=>e.canonical&&void o({canonical:e.canonical,role:t.target.value}),children:C9.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))}),(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:`ghost`,disabled:!u||e.role===`pending`,title:u?e.role===`pending`?_t():bi():ci(),onClick:()=>{s({profileId:e.profileId}),n(!1)},children:ie()})]},e.profileId))})]})})]})}function T9({label:e,mode:t,minimal:n=!1}){let{signOut:r}=jd(),i=nu(L.me.setThemeMode).withOptimisticUpdate((e,{mode:t})=>{let n=e.getQuery(L.me.getMe,{host:QR});if(!n)return;let r=t===null?n.defaultThemeMode??`system`:t;e.setQuery(L.me.getMe,{host:QR},{...n,themeMode:t,resolvedThemeMode:r})}),a=t??`default`;return(0,V.jsxs)(dB,{children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsxs)(Ju,{variant:`ghost`,size:`sm`,className:`gap-1.5`,children:[e,(0,V.jsx)(Mu,{className:`opacity-60`})]})}),(0,V.jsx)(pB,{align:`end`,className:`w-52`,children:n?(0,V.jsxs)(mB,{onClick:()=>void r(),children:[(0,V.jsx)(Tb,{}),` `,Zc()]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(hB,{children:To()}),(0,V.jsxs)(_B,{value:a,onValueChange:e=>void i({mode:e==="default"?null:e}),children:[(0,V.jsxs)(vB,{value:`light`,children:[(0,V.jsx)(Tne,{}),` `,ro()]}),(0,V.jsxs)(vB,{value:`dark`,children:[(0,V.jsx)(Nb,{}),` `,bl()]}),(0,V.jsxs)(vB,{value:`system`,children:[(0,V.jsx)(Mb,{}),` `,Ps()]}),(0,V.jsx)(vB,{value:`default`,children:Wa()})]}),(0,V.jsx)(gB,{}),(0,V.jsxs)(mB,{onClick:()=>void r(),children:[(0,V.jsx)(Tb,{}),` `,Zc()]})]})})]})}var x_e={altered_words:()=>Rc(),incorrect:()=>Zs(),incoherence:()=>sl(),formatting:()=>fo(),latency:()=>g(),api_error:()=>gr(),other:()=>sa()},S_e=e=>x_e[e]?.()??e,C_e={anomaly_open:Yb,anomaly_resolved:rb,feedback_reply:Ob,feedback_resolved:Ob,curation:hb},w_e={notif_feedback_reply_admin:()=>({title:xa(),body:Qo()}),notif_feedback_reply:()=>({title:xa(),body:Qo()}),notif_feedback_resolved:()=>({title:ei(),body:ql()}),notif_curation_proposed:e=>({title:Cc(),body:Do({name:e.name??`?`,agentId:e.agentId??`?`})}),notif_curation_failed:e=>({title:ao(),body:Sl({name:e.name??`?`,reason:e.reason??`unknown`})}),notif_curation_relaunch_refused:e=>({title:Is(),body:Ka({name:e.name??`?`,reason:e.reason??`unknown`})}),notif_anomaly_open:(e,t)=>({title:$c({kind:e.kind??`?`}),body:t.body}),notif_anomaly_resolved:(e,t)=>({title:fc({kind:e.kind??`?`}),body:t.body})};function T_e(e){let t=e.messageKey?w_e[e.messageKey]:void 0;return t?t(e.params??{},e):e.kind===`feedback_reply`?{title:xa(),body:Qo()}:e.kind===`feedback_resolved`?{title:ei(),body:ql()}:{title:e.title,body:e.body}}function E_e(){let e=R(L.notifications.myUnreadCount)??0,t=R(L.notifications.myNotifications),n=R(L.feedback.myFeedback),r=nu(L.notifications.markRead),i=nu(L.notifications.markAllRead),a=nu(L.notifications.clearOne),o=nu(L.notifications.clearAll),s=nu(L.feedback.closeMyFeedback),c=Um(),[l,u]=(0,B.useState)(!1),d=e=>{if(e.unread&&r({notificationId:e._id}),!e.href)return;if(u(!1),e.href.startsWith(`/chat/`)){c({to:`/chat/$chatId`,params:{chatId:e.href.slice(6)}});return}let[t,n]=e.href.split(`?`);c({to:t,search:Object.fromEntries(new URLSearchParams(n??``))})};return(0,V.jsxs)(dB,{open:l,onOpenChange:u,children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,className:`oc-bell`,"aria-label":e>0?zl({count:e}):fe(),children:[(0,V.jsx)(Qy,{size:18,"aria-hidden":!0}),e>0?(0,V.jsx)(`span`,{className:`oc-bell__badge`,"aria-hidden":!0,children:e>9?`9+`:e}):null]})}),(0,V.jsxs)(pB,{align:`end`,className:`oc-notif`,children:[(0,V.jsxs)(`div`,{className:`oc-notif__head`,children:[(0,V.jsx)(`span`,{children:Lr()}),t&&t.length>0?(0,V.jsxs)(`span`,{className:`oc-notif__bulk`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__act`,disabled:e===0,onClick:()=>void i({}),children:Ql()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__act`,onClick:()=>void o({}),children:Na()})]}):null]}),t===void 0?(0,V.jsx)(`div`,{className:`oc-notif__empty`,children:Sc()}):t.length===0?(0,V.jsx)(`div`,{className:`oc-notif__empty`,children:lu()}):(0,V.jsx)(`div`,{className:`oc-notif__list`,children:t.map(e=>{let t=C_e[e.kind]??Qy,{title:n,body:i}=T_e(e);return(0,V.jsxs)(`div`,{className:`oc-notif__item${e.unread?` is-unread`:``}${e.href?` is-link`:``}`,role:e.href?`button`:void 0,tabIndex:e.href?0:void 0,onClick:e.href?()=>d(e):void 0,children:[(0,V.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,V.jsx)(t,{size:14,className:`oc-notif__kind oc-notif__kind--${e.kind}`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`oc-notif__title`,children:n}),(0,V.jsxs)(`span`,{className:`oc-notif__row-actions`,children:[e.unread?(0,V.jsx)(`button`,{type:`button`,title:Ol(),"aria-label":Ol(),onClick:t=>{t.stopPropagation(),r({notificationId:e._id})},children:(0,V.jsx)(Au,{size:13})}):null,(0,V.jsx)(`button`,{type:`button`,title:fa(),"aria-label":fa(),onClick:t=>{t.stopPropagation(),a({notificationId:e._id})},children:(0,V.jsx)(Iu,{size:13})})]})]}),(0,V.jsx)(`p`,{className:`oc-notif__body`,children:i}),(0,V.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.createdAt).toLocaleString(Ko())})]},e._id)})}),n&&n.length>0?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`oc-notif__head oc-notif__head--sub`,children:Po()}),(0,V.jsx)(`div`,{className:`oc-notif__list`,children:n.map(e=>(0,V.jsx)(D_e,{it:e,onClose:t=>s({feedbackId:e._id,reason:t}),onNavigate:()=>u(!1)},e._id))})]}):null]})]})}function D_e({it:e,onClose:t,onNavigate:n}){let r=VB(),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1);async function f(){d(!0);try{await t(c.trim()||void 0)}catch(e){r.error(Ms(),e)}finally{d(!1)}}return(0,V.jsxs)(`div`,{className:`oc-notif__item`,children:[(0,V.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,V.jsx)(`span`,{className:`oc-notif__title`,children:S_e(e.category)}),(0,V.jsx)(`span`,{className:`oc-notif__status${e.answered||e.resolvedAt?` is-answered`:``}`,children:e.resolvedAt?Xn():e.answered?Uo():Us()})]}),(0,V.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.at).toLocaleString(Ko())}),e.thread.length>0?(0,V.jsx)(`div`,{className:`oc-notif__thread`,children:e.thread.map((e,t)=>(0,V.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,V.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?bc():e.authorRole===`agent`?A():Co()}),(0,V.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):null,e.messageText?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-notif__report-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[i?(0,V.jsx)(Mu,{size:13,"aria-hidden":!0}):(0,V.jsx)(tb,{size:13,"aria-hidden":!0}),vl()]}),i?(0,V.jsx)(`div`,{className:`oc-notif__report-msg`,children:e.messageText}):null]}):null,(0,V.jsxs)(`div`,{className:`oc-notif__report-actions`,children:[(0,V.jsx)(rh,{to:`/chat/$chatId`,params:{chatId:e.chatId},search:{m:e.messageId},className:`oc-notif__link`,onClick:n,children:to()}),o?null:(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__link oc-notif__link--muted`,onClick:()=>s(!0),children:Ms()})]}),o?(0,V.jsxs)(`div`,{className:`oc-notif__close-form`,children:[(0,V.jsx)(`textarea`,{className:`oc-notif__close-input`,rows:2,value:c,onChange:e=>l(e.target.value),placeholder:Ua()}),(0,V.jsxs)(`div`,{className:`oc-notif__close-actions`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__close-confirm`,disabled:u,onClick:()=>void f(),children:Yc()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__close-cancel`,onClick:()=>{s(!1),l(``)},children:cc()})]})]}):null]})}var E9=2,O_e=180;function k_e(){let e=Um(),t=(0,B.useRef)(null),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(0),d=(0,B.useMemo)(()=>lz(rz,cz()),[]);(0,B.useEffect)(()=>{let e=setTimeout(()=>c(a),O_e);return()=>clearTimeout(e)},[a]);let f=s.trim(),p=R(L.search.searchConversations,f.length>=E9?{query:f}:`skip`),m=p??[],h=f.length>=E9&&p===void 0;(0,B.useEffect)(()=>{let e=e=>{uz(e,rz)&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.useEffect)(()=>{r&&(o(``),c(``),u(0))},[r]),(0,B.useEffect)(()=>{u(0)},[p]),(0,B.useEffect)(()=>{(n.current?.querySelector(`[data-index="${l}"]`))?.scrollIntoView({block:`nearest`})},[l]);let g=(0,B.useCallback)((t,n)=>{i(!1),n&&a.trim()&&sme(n,a.trim()),e({to:`/chat/$chatId`,params:{chatId:t},...n?{search:{m:n}}:{}})},[e,a]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-search-trigger`,onClick:()=>i(!0),"aria-label":fs(),children:[(0,V.jsx)(Ub,{className:`oc-search-trigger__icon`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`oc-search-trigger__label`,children:w()}),(0,V.jsx)(`kbd`,{className:`oc-search-trigger__kbd`,children:d})]}),(0,V.jsx)(Pz,{open:r,onOpenChange:i,children:(0,V.jsxs)(Lz,{showCloseButton:!1,className:`oc-search-palette top-[12vh] translate-y-0 max-w-xl gap-0 overflow-hidden p-0`,onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},children:[(0,V.jsx)(Bz,{className:`sr-only`,children:ws()}),(0,V.jsxs)(`div`,{className:`oc-search-palette__head`,children:[(0,V.jsx)(Ub,{className:`oc-search-palette__head-icon`,"aria-hidden":!0}),(0,V.jsx)(`input`,{ref:t,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,m.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=m[l];t&&g(t.chatId,t.messageId)}},placeholder:Un(),className:`oc-search-palette__field`,autoComplete:`off`,spellCheck:!1,"aria-label":Ee()})]}),(0,V.jsx)(`div`,{className:`oc-search-palette__results`,ref:n,role:`listbox`,children:f.length<E9?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:Ie({count:E9})}):h?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:qr()}):m.length===0?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:Bl({term:f})}):m.map((e,t)=>(0,V.jsxs)(`button`,{type:`button`,"data-index":t,role:`option`,"aria-selected":t===l,className:Js(`oc-search-result`,t===l&&`is-active`),onMouseMove:()=>u(t),onClick:()=>g(e.chatId,e.messageId),children:[(0,V.jsx)(`span`,{className:`oc-search-result__icon`,"aria-hidden":!0,children:e.matchedIn===`title`?(0,V.jsx)(xb,{size:15}):(0,V.jsx)(Ob,{size:15})}),(0,V.jsxs)(`span`,{className:`oc-search-result__body`,children:[(0,V.jsx)(`span`,{className:`oc-search-result__title`,children:e.title||pe()}),e.snippet?(0,V.jsx)(`span`,{className:`oc-search-result__snippet`,children:e.snippet}):null]}),(0,V.jsx)(`span`,{className:`oc-search-result__tag`,children:e.matchedIn===`title`?Rr():$l()})]},e.chatId))}),(0,V.jsxs)(`div`,{className:`oc-search-palette__footer`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↑`}),(0,V.jsx)(`kbd`,{children:`↓`}),` `,Pa()]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↵`}),` `,uu()]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:kl()}),` `,pa()]})]})]})})]})}var D9=[`users`,`groups`,`instances`,`bridge`,`injections`,`serviceAccounts`,`roles`,`access`,`traces`,`kpi`,`anomalies`,`files`,`agentFiles`,`preferences`,`integrations`,`theme`,`chatDefaults`,`audit`,`feedbacks`,`subagentReports`,`voice`],O9=[`groups`,`access`,`roles`,`integrations`,`instances`,`injections`,`theme`,`feedbacks`,`subagentReports`,`files`,`agentFiles`,`preferences`,`chatDefaults`],k9={users:()=>Ui(),groups:()=>Ou(),instances:()=>Qi(),bridge:()=>Ut(),injections:()=>he(),serviceAccounts:()=>Nc(),roles:()=>Zt(),access:()=>jr(),traces:()=>ct(),kpi:()=>Pi(),anomalies:()=>ui(),files:()=>It(),agentFiles:()=>cu(),preferences:()=>uc(),integrations:()=>bt(),theme:()=>Qa(),chatDefaults:()=>yt(),audit:()=>Si(),feedbacks:()=>oe(),subagentReports:()=>Di(),voice:()=>Pt()},A9={users:`admin.manage`,groups:`groups.manage`,instances:`admin.manage`,bridge:`bridge.read`,injections:`admin.manage`,serviceAccounts:`admin.manage`,roles:`admin.manage`,access:`admin.manage`,traces:`traces.read`,kpi:`kpi.read`,anomalies:`anomalies.read`,files:`chats.read`,agentFiles:`agents.files.read`,preferences:`chats.read`,integrations:`admin.manage`,theme:`chats.read`,chatDefaults:`admin.manage`,audit:`admin.manage`,feedbacks:`admin.manage`,subagentReports:`admin.manage`,voice:`admin.manage`},A_e=[`traces`,`kpi`,`anomalies`,`bridge`,`agentFiles`,`groups`];function j9(e){let t=new Set(e);return D9.filter(e=>t.has(A9[e]))}function M9(e){return`/settings/${e}`}function N9(e){let t=e.split(`/`)[2];return D9.includes(t)?t:void 0}var j_e={uiprefs:`preferences`},P9=[{id:`personal`,label:()=>Ga(),tabs:[`preferences`,`theme`,`files`]},{id:`agents`,label:()=>Qc(),tabs:[`instances`,`agentFiles`,`chatDefaults`,`voice`,`bridge`,`injections`]},{id:`access`,label:()=>dc(),tabs:[`users`,`groups`,`access`,`roles`,`serviceAccounts`]},{id:`observability`,label:()=>Ca(),tabs:[`traces`,`kpi`,`anomalies`,`audit`,`feedbacks`,`subagentReports`,`integrations`]}],M_e=new Map(P9.flatMap(e=>e.tabs.map(t=>[t,e.id])));function F9(e){let t=M_e.get(e);if(!t)throw Error(`Settings tab "${e}" belongs to no group`);return t}function N_e(e,t){return e.find(e=>F9(e)===t)}P9.flatMap(e=>[...e.tabs]);function P_e(){let e=R(L.bridgeHealth.getBridgeAvailability,{});if(e===void 0)return null;let t=e.known?e.available?`ok`:`error`:`idle`,n=e.known?e.available?`${te()}${e.checkedAt?Cu({time:EH(e.checkedAt)}):``}`:Tr({reason:e.reason??`?`}):_i();return(0,V.jsx)(X6,{delayDuration:150,children:(0,V.jsxs)(Z6,{children:[(0,V.jsx)(Q6,{asChild:!0,children:(0,V.jsx)(`span`,{className:`oc-bridge-dot oc-bridge-dot--${t}`,role:`img`,"aria-label":n})}),(0,V.jsx)($6,{children:n})]})})}function I9(e){let t=new Set(D9),n=new Set,r=[];for(let i of e??[])t.has(i)&&!n.has(i)&&(r.push(i),n.add(i));for(let e of D9)n.has(e)||r.push(e);return r}function F_e(e,t){let n=new Set(t),r=[...t];return e.map(e=>n.has(e)?r.shift():e)}function I_e({tab:e,active:t}){let n=k9[e](),r=`oc-settings-tabs__tab`+(t?` is-active`:``),i=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`oc-settings-tabs__label`,children:n}),e===`bridge`?(0,V.jsx)(P_e,{}):null]});return O9.includes(e)?(0,V.jsx)(rh,{to:`/settings/$tab`,params:{tab:e},className:r,role:`tab`,"aria-selected":t,children:i}):(0,V.jsx)(rh,{to:`/settings/${e}`,className:r,role:`tab`,"aria-selected":t,children:i})}function L_e({tab:e,active:t}){let{attributes:n,listeners:r,setNodeRef:i,transform:a,transition:o,isDragging:s}=i9({id:e});return(0,V.jsxs)(`div`,{ref:i,style:{transform:P5.Transform.toString(a),transition:o,opacity:s?.5:1},className:`oc-settings-tabs__item`,role:`presentation`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-settings-tabs__grip`,"aria-label":Eo(),...n,...r,children:(0,V.jsx)(bb,{size:14,"aria-hidden":!0})}),(0,V.jsx)(I_e,{tab:e,active:t})]})}function R_e(){let e=R(L.me.getMe,{host:QR}),t=nu(L.me.setSettingsTabOrder),n=N9(_h({select:e=>e.pathname})),r=n===void 0?void 0:F9(n),i=(0,B.useMemo)(()=>I9(e?.settingsTabOrder??null),[e?.settingsTabOrder]),[a,o]=(0,B.useState)(i);(0,B.useEffect)(()=>o(i),[i]);let s=(0,B.useMemo)(()=>new Set(j9(e?.permissions??[])),[e?.permissions]),c=(0,B.useMemo)(()=>r===void 0?[]:a.filter(e=>s.has(e)&&F9(e)===r),[a,s,r]),l=B5(z5(b7,{activationConstraint:{distance:5}}),z5(g7,{coordinateGetter:o9}));if(r===void 0||c.length===0)return null;let u=P9.find(e=>e.id===r);function d(e){let{active:n,over:r}=e;if(!r||n.id===r.id)return;let i=c.indexOf(n.id),s=c.indexOf(r.id);if(i<0||s<0)return;let l=F_e(a,Y7(c,i,s));o(l),t({order:l})}return(0,V.jsx)(`div`,{className:`oc-settings-tabs`,role:`tablist`,"aria-label":u?.label(),children:(0,V.jsx)(W7,{sensors:l,collisionDetection:Vhe,modifiers:[Zge],onDragEnd:d,children:(0,V.jsx)(n9,{items:c,strategy:i_e,children:c.map(e=>(0,V.jsx)(L_e,{tab:e,active:e===n},e))})})})}function z_e(){let e=R(L.me.getMe,{host:QR}),t=Um(),n=N9(_h({select:e=>e.pathname})),r=n===void 0?void 0:F9(n),i=(0,B.useMemo)(()=>new Set(j9(e?.permissions??[])),[e?.permissions]),a=(0,B.useMemo)(()=>I9(e?.settingsTabOrder??null).filter(e=>i.has(e)),[e?.settingsTabOrder,i]),o=P9.filter(e=>e.tabs.some(e=>i.has(e)));function s(e){let n=N_e(a,e.id);n&&t({to:M9(n)})}return(0,V.jsxs)(`nav`,{className:`oc-settings-nav`,"aria-label":io(),children:[(0,V.jsx)(rh,{to:`/`,className:`oc-settings-nav__back`,children:xl()}),(0,V.jsx)(`div`,{className:`oc-settings-nav__title`,children:Fs()}),(0,V.jsx)(`div`,{className:`oc-settings-nav__list`,children:o.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`oc-settings-nav__group`+(e.id===r?` is-active`:``),"aria-current":e.id===r?`true`:void 0,onClick:()=>s(e),children:e.label()},e.id))})]})}var B_e=[`eq`,`neq`,`contains`,`gt`,`gte`,`lt`,`lte`],L9=[50,100,200,500],R9=`now-30d`,V_e=`now-24h`;function H_e(e,t,n=R9,r=`now`){let i=e??n,a=t??r,o=Number(i),s=Number(a);return i!==``&&a!==``&&Number.isFinite(o)&&Number.isFinite(s)?{kind:`absolute`,from:o,to:s}:{kind:`relative`,from:i,to:a}}function U_e(e){return e.kind===`absolute`?{from:String(e.from),to:String(e.to)}:{from:e.from,to:e.to}}function W_e(e){if(e.length!==0)return JSON.stringify(e)}function G_e(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e,r=t.field,i=t.op,a=t.value;typeof r!=`string`||r===``||typeof i!=`string`||!B_e.includes(i)||typeof a!=`string`&&typeof a!=`number`&&typeof a!=`boolean`||n.push({field:r,op:i,value:a})}return n}var z9=Bv().optional(),B9=Bv().optional(),V9=Bv().optional(),H9=Bv().optional().catch(void 0),K_e=_y({q:z9,section:Cy([`latency`,`events`]).default(`events`).catch(`events`),kind:Bv().default(`all`).catch(`all`),limit:Yy().pipe(yy([Ty(L9[0]),Ty(L9[1]),Ty(L9[2]),Ty(L9[3])])).catch(100),statusClass:Cy([`2xx`,`4xx`,`5xx`]).optional().catch(void 0),principalType:Cy([`user`,`service`,`system`]).optional().catch(void 0),direction:Cy([`inbound`,`outbound`,`internal`]).optional().catch(void 0),roleKey:H9,from:B9,to:B9,adv:V9}),q_e=_y({q:z9,action:H9,impersonated:Cy([`yes`,`no`]).optional().catch(void 0),resource:H9,from:B9,to:B9,adv:V9}),J_e=_y({q:z9,status:Cy([`open`,`acknowledged`,`resolved`,`all`]).default(`open`).catch(`open`),severity:Cy([`info`,`warn`,`critical`]).optional().catch(void 0),kind:H9,from:B9,to:B9}),Y_e=_y({from:B9,to:B9}),X_e=_y({q:z9,status:Cy([`active`,`disabled`]).optional().catch(void 0)}),Z_e=_y({q:z9,role:H9});_y({q:z9,mode:Cy([`per-user`,`shared`]).optional().catch(void 0)});var Q_e=_y({section:Cy([`readaloud`,`dictation`,`talk`]).default(`readaloud`).catch(`readaloud`)}),$_e=_y({section:Bv().max(32).default(`openclaw`).catch(`openclaw`)}),U9=`oc.theme`;function W9(e){let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}function G9(e){(0,B.useEffect)(()=>{let t=e??localStorage.getItem(U9)??`system`;if(localStorage.setItem(U9,t),W9(t),t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>W9(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e])}function eve(e){(0,B.useEffect)(()=>{if(!e)return;document.documentElement.lang=e;let t;try{t=Ko()}catch{t=void 0}t!==e&&Lo(e)},[e])}var tve=(0,B.lazy)(()=>Y4(()=>import(`./RolesTab-oG79jIyV.js`).then(e=>({default:e.RolesTab})),__vite__mapDeps([2,1,3,4,5]))),nve=(0,B.lazy)(()=>Y4(()=>import(`./InstancesTab-BuWsscmq.js`).then(e=>({default:e.InstancesTab})),__vite__mapDeps([6,1,3,7,8,9,10,11,12,13,14,15,16,5,17,18,19]))),rve=(0,B.lazy)(()=>Y4(()=>import(`./PromptInjectionsTab-BKs4VaBY.js`).then(e=>({default:e.PromptInjectionsTab})),__vite__mapDeps([20,1,3,7,8,9,21,5,22]))),ive=(0,B.lazy)(()=>Y4(()=>import(`./GroupsTab-D-5SYzK-.js`).then(e=>({default:e.GroupsTab})),__vite__mapDeps([23,1,3,13,12,24,19,14,5,17,25,15,16]))),ave=(0,B.lazy)(()=>Y4(()=>import(`./IntegrationsTab-x8t35z2u.js`).then(e=>({default:e.IntegrationsTab})),__vite__mapDeps([26,1,3,5]))),ove=(0,B.lazy)(()=>Y4(()=>import(`./FeedbacksTab-DK6ZRozw.js`).then(e=>({default:e.FeedbacksTab})),__vite__mapDeps([27,1,3,19,12,14,5,17]))),sve=(0,B.lazy)(()=>Y4(()=>import(`./SubAgentReportsTab-B5Jv9cGp.js`).then(e=>({default:e.SubAgentReportsTab})),__vite__mapDeps([28,1,3,19,12,14,5,17]))),cve=(0,B.lazy)(()=>Y4(()=>import(`./FilesTab-N0bxhD0W.js`).then(e=>({default:e.FilesTab})),__vite__mapDeps([29,1,3,5,17]))),lve=(0,B.lazy)(()=>Y4(()=>import(`./AgentFilesTab-D58Ewnxq.js`).then(e=>({default:e.AgentFilesTab})),__vite__mapDeps([30,1,3,11,8,5,22]))),K9=(0,B.lazy)(()=>Y4(()=>import(`./PreferencesTab-DIS_GpwC.js`).then(e=>({default:e.PreferencesTab})),__vite__mapDeps([31,1,3,21,9,5]))),uve=(0,B.lazy)(()=>Y4(()=>import(`./ChatDefaultsTab-CidvTjIU.js`).then(e=>({default:e.ChatDefaultsTab})),__vite__mapDeps([32,1,3,11,5,22]))),dve=(0,B.lazy)(()=>Y4(()=>import(`./AccessTab-DIQGYONr.js`).then(e=>({default:e.AccessTab})),__vite__mapDeps([33,1,3]))),fve=(0,B.lazy)(()=>Y4(()=>import(`./ThemeShowroom-jXfQmTvF.js`).then(e=>({default:e.ThemeShowroom})),__vite__mapDeps([34,1,3,35,24,36,12,16,5,15,21,9,37,17])));function pve(){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(dd,{children:(0,V.jsx)(`div`,{className:`oc-boot`,children:ki()})}),(0,V.jsx)(ud,{children:(0,V.jsx)(hve,{})}),(0,V.jsx)(ld,{children:(0,V.jsx)(BB,{children:(0,V.jsx)(_ve,{})})})]})}function mve(){return(0,V.jsxs)(`svg`,{className:`oc-provider__logo`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[(0,V.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,V.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,V.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,V.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function hve(){let{signIn:e}=jd();G9(void 0);let t=R(L.charts.brandForHost,{host:QR}),n=tz(QR),r=t??n??null,i=gz(void 0);vz(r?.tokens??null,i),(0,B.useEffect)(()=>{t&&nz(QR,t)},[t]);let a=r?.brand,o=a&&!a.isDefault?Tz(a,i):null,s=a?.label??`Atrium`,c=R(L.me.authProviders),[l,u]=(0,B.useState)(null);async function d(t){u(null);try{await e(t)}catch{u(oi())}}let f=c!==void 0&&!c.google&&!c.microsoft&&!c.anonymous;return(0,V.jsxs)(`div`,{className:`oc-signin`,children:[(0,V.jsxs)(`svg`,{className:`oc-signin__motif`,viewBox:`0 0 1200 1000`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,V.jsx)(`polyline`,{className:`oc-signin__line`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,vectorEffect:`non-scaling-stroke`}),(0,V.jsx)(`polyline`,{className:`oc-signin__pulse`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,pathLength:`100`,vectorEffect:`non-scaling-stroke`})]}),(0,V.jsxs)(`div`,{className:`oc-signin__brand`,children:[o?(0,V.jsx)(`img`,{className:`oc-signin__brandlogo`,src:o,alt:``}):null,(0,V.jsx)(`span`,{className:`oc-signin__wordmark`,children:s})]}),(0,V.jsxs)(`div`,{className:`oc-signin__card`,children:[(0,V.jsx)(`h1`,{className:`oc-signin__title`,children:ht()}),(0,V.jsx)(`p`,{className:`oc-signin__subtitle`,children:vi()}),(0,V.jsx)(`div`,{className:`oc-signin__providers`,children:c?.google?(0,V.jsxs)(`button`,{type:`button`,className:`oc-provider oc-provider--google`,onClick:()=>void d(`google`),children:[(0,V.jsx)(mve,{}),(0,V.jsx)(`span`,{children:ne()})]}):null}),l?(0,V.jsx)(`p`,{className:`oc-signin__error`,children:l}):null,f?(0,V.jsx)(`p`,{className:`oc-signin__error`,children:wu()}):null,c?.anonymous?(0,V.jsx)(`button`,{type:`button`,className:`oc-signin__dev`,onClick:()=>void e(`anonymous`),children:Er()}):null]})]})}function gve(){let{width:e,collapsed:t,isMobile:n}=w8();return(0,V.jsxs)(`div`,{className:`oc-shell`,children:[(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`1.75rem`,height:`1.75rem`}}),(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`5.5rem`,height:`1.1rem`}})]}),(0,V.jsx)(`div`,{className:`oc-topbar__search`,children:(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`100%`,height:`2.25rem`}})}),(0,V.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`1.75rem`,height:`1.75rem`,borderRadius:`999px`}})})]}),(0,V.jsxs)(`div`,{className:n?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[!t&&!n?(0,V.jsx)(`div`,{className:`oc-sidebar-col`,style:{width:e,flex:`0 0 ${e}px`},children:(0,V.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,V.jsx)(`div`,{className:`oc-skel`,style:{height:`2.25rem`,margin:`0.25rem 0.25rem 0`}}),(0,V.jsx)(y9,{})]})}):null,(0,V.jsx)(`main`,{className:`oc-main`})]})]})}function _ve(){let e=R(L.me.getMe,{host:QR}),t=nu(L.me.bootstrap),n=Um();(0,B.useEffect)(()=>{e&&!e.hasProfile&&t()},[e,t]),G9(e?.resolvedThemeMode);let r=gz(e?.resolvedThemeMode);vz(e?.resolvedChartTokens,r),eve(e?.resolvedLocale);let i=(0,B.useRef)(null);if((0,B.useEffect)(()=>{e&&(i.current!==null&&i.current!==e.userId&&n({to:`/`}),i.current=e.userId)},[e,n]),e===void 0)return(0,V.jsx)(gve,{});let a=e.name||e.email||sn();return e.role===`pending`?(0,V.jsxs)(`div`,{className:`oc-shell`,children:[(0,V.jsx)(q9,{}),(0,V.jsx)(w9,{}),(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsx)(`span`,{className:`oc-topbar__brand`,children:(0,V.jsx)(J9,{brand:e.resolvedChartBrand,resolvedThemeMode:e.resolvedThemeMode})}),(0,V.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,V.jsx)(T9,{label:a,mode:e.themeMode,minimal:!0})})]}),(0,V.jsxs)(`div`,{className:`oc-pending`,children:[(0,V.jsx)(`h1`,{className:`oc-pending__title`,children:kt()}),(0,V.jsx)(`p`,{className:`oc-pending__body`,children:Xe()})]})]}):(0,V.jsx)(yve,{canOpenSettings:j9(e.permissions??[]).length>0,userLabel:a,themeMode:e.themeMode,resolvedThemeMode:e.resolvedThemeMode,brand:e.resolvedChartBrand},e.userId)}function q9(){let e=R(L.me.getImpersonation),t=nu(L.admin.stopImpersonation);return!e||!e.impersonating?null:(0,V.jsxs)(`div`,{className:`oc-imp`,role:`alert`,children:[(0,V.jsx)(mb,{className:`size-4 shrink-0`}),(0,V.jsxs)(`span`,{className:`oc-imp__text`,children:[ir(),` `,(0,V.jsx)(`strong`,{children:e.targetLabel}),Mn(),(0,V.jsx)(`strong`,{children:e.realLabel}),bn()]}),(0,V.jsx)(Ju,{size:`sm`,variant:`outline`,className:`oc-imp__exit`,onClick:()=>void t(),children:ps()})]})}function J9({brand:e,resolvedThemeMode:t}){let n=gz(t),r=e?.label??`Atrium`,i=e?.isDefault??!0,a=Tz(e,n),[o,s]=(0,B.useState)(!1);return(0,B.useEffect)(()=>s(!1),[a]),(0,V.jsxs)(V.Fragment,{children:[a!==null&&!o?(0,V.jsx)(`img`,{className:`oc-brand__logo`,src:a,alt:``,"aria-hidden":`true`,onError:()=>s(!0)}):i?(0,V.jsx)(kz,{className:`oc-brand__logo`}):null,(0,V.jsx)(`span`,{className:`oc-brand__label`,children:r})]})}function vve({userLabel:e,themeMode:t,resolvedThemeMode:n,brand:r,collapsed:i,onToggleSidebar:a}){return(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,V.jsx)(Ju,{variant:`ghost`,size:`icon-sm`,"aria-label":i?T():Ts(),onClick:a,children:i?(0,V.jsx)(Ib,{}):(0,V.jsx)(Fb,{})}),(0,V.jsx)(rh,{to:`/`,className:`oc-topbar__brand`,children:(0,V.jsx)(J9,{brand:r,resolvedThemeMode:n})})]}),(0,V.jsx)(`div`,{className:`oc-topbar__search`,children:(0,V.jsx)(k_e,{})}),(0,V.jsxs)(`div`,{className:`oc-topbar__actions`,children:[(0,V.jsx)(E_e,{}),(0,V.jsx)(T9,{label:e,mode:t})]})]})}function yve({canOpenSettings:e,userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i}){let{width:a,collapsed:o,toggleCollapsed:s,collapse:c,startResize:l,isMobile:u}=w8(),d=See(),f=Vm({strict:!1}),p=Um(),m=!!d({to:`/settings`,fuzzy:!0});(0,B.useEffect)(()=>{u&&c()},[_h({select:e=>e.pathname}),u,c]);let h=(0,B.useCallback)(e=>{p({to:`/chat/$chatId`,params:{chatId:e}})},[p]),{startNewChat:g,picker:_}=b_e(h),v=(0,B.useMemo)(()=>lz(iz,cz()),[]);return(0,B.useEffect)(()=>{let e=e=>{uz(e,iz)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]),(0,V.jsxs)(`div`,{className:`oc-shell`,children:[_,(0,V.jsx)(q9,{}),(0,V.jsx)(w9,{}),(0,V.jsx)(vve,{userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i,collapsed:o,onToggleSidebar:s}),(0,V.jsxs)(`div`,{className:u?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[u&&!o?(0,V.jsx)(`div`,{className:`oc-sidebar-backdrop`,onClick:c,"aria-hidden":!0}):null,o?null:(0,V.jsxs)(`div`,{className:`oc-sidebar-col`,style:u?void 0:{width:a,flex:`0 0 ${a}px`},children:[m?(0,V.jsx)(z_e,{}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(y_e,{activeChatId:f.chatId??null,onSelect:h,onNewChat:()=>void g(),newChatShortcut:v}),e?(0,V.jsx)(Ju,{variant:`ghost`,className:`m-2 justify-start`,asChild:!0,children:(0,V.jsx)(rh,{to:`/settings`,children:Wn()})}):null]}),(0,V.jsx)(`div`,{className:`oc-sidebar-resizer`,onPointerDown:l,role:`separator`,"aria-orientation":`vertical`,"aria-label":De()})]}),(0,V.jsx)(`main`,{className:`oc-main`,children:(0,V.jsx)(gh,{})})]})]})}function bve(){let e=R(L.me.getMe,{host:QR}),t=Um(),n=_h({select:e=>e.pathname}),r=(0,B.useMemo)(()=>e?j9(e.permissions??[]):[],[e]),i=e!==void 0&&r.length===0;if((0,B.useEffect)(()=>{i&&t({to:`/`})},[i,t]),e===void 0)return(0,V.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:ki()});if(i)return null;let a=N9(n),o=a!==void 0&&!r.includes(a);return(0,V.jsxs)(`div`,{className:`oc-admin`,children:[(0,V.jsx)(R_e,{}),(0,V.jsx)(`div`,{className:`oc-admin__body`,children:o?(0,V.jsx)(xve,{}):(0,V.jsx)(gh,{})})]})}function xve(){return(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(Yb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:Le()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Jr()})]})}function Sve(){let e=R(L.me.getMe,{host:QR}),t=Um();return(0,B.useEffect)(()=>{if(e===void 0)return;let n=j9(e.permissions??[]);t({to:n.includes(`files`)?M9(`files`):n.length>0?M9(n[0]):`/`,replace:!0})},[e,t]),(0,V.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:ki()})}function Cve(e){switch(e){case`groups`:return(0,V.jsx)(ive,{});case`integrations`:return(0,V.jsx)(ave,{});case`instances`:return(0,V.jsx)(nve,{});case`injections`:return(0,V.jsx)(rve,{});case`theme`:return(0,V.jsx)(fve,{});case`feedbacks`:return(0,V.jsx)(ove,{});case`subagentReports`:return(0,V.jsx)(sve,{});case`files`:return(0,V.jsx)(cve,{});case`agentFiles`:return(0,V.jsx)(lve,{});case`preferences`:return(0,V.jsx)(K9,{});case`chatDefaults`:return(0,V.jsx)(uve,{});case`access`:return(0,V.jsx)(dve,{});default:return(0,V.jsx)(tve,{})}}function wve(){let{tab:e}=Vm({from:`/settings/$tab`});return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`}),children:Cve(e)})}function Tve(){let{chatId:e}=Vm({from:`/chat/$chatId`}),{m:t}=Hm({from:`/chat/$chatId`});return(0,B.useEffect)(()=>{One(e)},[e]),(0,V.jsx)(n5,{chatId:e,focusMessageId:t??null})}function Eve(){let e=Um(),t=kne(),n=R(L.messages.listChats,{}),r=t!==null&&n!==void 0&&n.some(e=>e._id===t);return(0,B.useEffect)(()=>{r&&t&&e({to:`/chat/$chatId`,params:{chatId:t},replace:!0})},[r,t,e]),t!==null&&(n===void 0||r)?(0,V.jsx)(`div`,{className:`oc-boot`,children:ki()}):(0,V.jsx)(n5,{chatId:null})}var Y9=ch({component:pve}),Dve=oh({getParentRoute:()=>Y9,path:`/`,component:Eve}),Ove=oh({getParentRoute:()=>Y9,path:`chat/$chatId`,component:Tve,validateSearch:e=>({m:typeof e.m==`string`?e.m:void 0})}),X9=oh({getParentRoute:()=>Y9,path:`settings`,component:bve}),kve=oh({getParentRoute:()=>X9,path:`/`,component:Sve}),Ave=oh({getParentRoute:()=>X9,path:`traces`,validateSearch:K_e,component:lh(()=>Y4(()=>import(`./TracesTab-DS0dtQjd.js`),__vite__mapDeps([38,1,3,13,12,35,24,19,14,5,17,36,16,15])),`TracesTab`)}),jve=oh({getParentRoute:()=>X9,path:`bridge`,validateSearch:$_e,component:lh(()=>Y4(()=>import(`./BridgeTab-D2Qg8iKI.js`),__vite__mapDeps([10,1,3,11,7,8,9,12,13,14,15,16,5,17,18])),`BridgeTab`)}),Mve=oh({getParentRoute:()=>X9,path:`voice`,validateSearch:Q_e,component:lh(()=>Y4(()=>import(`./VoiceTab-CPvagmjD.js`),__vite__mapDeps([39,1,3,13,12,5,22])),`VoiceTab`)}),Nve=oh({getParentRoute:()=>X9,path:`audit`,validateSearch:q_e,component:lh(()=>Y4(()=>import(`./AuditTab-BvVSi2_w.js`),__vite__mapDeps([40,1,3,19,12,14,5,17,36,24,16,15])),`AuditTab`)}),Pve=oh({getParentRoute:()=>X9,path:`anomalies`,validateSearch:J_e,component:lh(()=>Y4(()=>import(`./AnomaliesTab-BlhZZGZK.js`),__vite__mapDeps([41,1,3,19,12,14,5,17,15,16,18])),`AnomaliesTab`)}),Fve=oh({getParentRoute:()=>X9,path:`kpi`,validateSearch:Y_e,component:lh(()=>Y4(()=>import(`./KpiTab-DYi2oDFh.js`),__vite__mapDeps([42,1,3,16,5,37])),`KpiTab`)}),Ive=oh({getParentRoute:()=>X9,path:`serviceAccounts`,validateSearch:X_e,component:lh(()=>Y4(()=>import(`./ServiceAccountsTab-OLN1AmBk.js`),__vite__mapDeps([43,1,3,12,35,19,14,5,17,15,16,4])),`ServiceAccountsTab`)}),Lve=oh({getParentRoute:()=>X9,path:`users`,validateSearch:Z_e,component:lh(()=>Y4(()=>import(`./UsersTab-CtJNzVXo.js`),__vite__mapDeps([44,1,3,19,12,14,5,17,25,15,16])),`UsersTab`)}),Rve=oh({getParentRoute:()=>X9,path:`uiprefs`,beforeLoad:()=>{throw rp({to:`/settings/$tab`,params:{tab:j_e.uiprefs},replace:!0})}}),zve=oh({getParentRoute:()=>X9,path:`$tab`,parseParams:e=>({tab:Cy([...O9]).catch(`roles`).parse(e.tab)}),component:wve});function Bve({error:e,reset:t}){let n=Um(),r=Ane(e),[i]=(0,B.useState)(()=>r&&Nne(Date.now()));return(0,B.useEffect)(()=>{i&&window.location.reload()},[i]),i?(0,V.jsx)(`div`,{className:`oc-route-error`,role:`status`,children:(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Vl()})}):(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(Yb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:me()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:zr()}),(0,V.jsxs)(`div`,{className:`oc-route-error__actions`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>{r?window.location.reload():t()},children:eu()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta oc-route-error__cta--ghost`,onClick:()=>void n({to:`/`}),children:Fa()})]})]})}function Vve(){let e=Um();return(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`status`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(cb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:du()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Al()}),(0,V.jsx)(`div`,{className:`oc-route-error__actions`,children:(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>void e({to:`/`}),children:Fa()})})]})}var Z9=wee({routeTree:Y9.addChildren([Dve,Ove,X9.addChildren([kve,Ave,Mve,jve,Nve,Pve,Fve,Ive,Lve,Rve,zve])]),defaultPreload:`intent`,defaultErrorComponent:Bve,defaultNotFoundComponent:Vve}),Hve=()=>null;function Q9({children:e}){return(0,V.jsx)(`div`,{style:{display:`flex`,minHeight:`100vh`,alignItems:`center`,justifyContent:`center`,padding:`2rem`,textAlign:`center`,font:`14px system-ui, sans-serif`,opacity:.6},children:e})}var $9=fd.createRoot(document.getElementById(`root`));$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(Q9,{children:Sc()})})),DV().then(e=>{let t=new Ml(e);$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(Md,{client:t,children:(0,V.jsxs)(NB,{children:[(0,V.jsx)(Ome,{children:(0,V.jsx)(Dee,{router:Z9})}),(0,V.jsx)(B.Suspense,{fallback:null,children:(0,V.jsx)(Hve,{router:Z9,position:`bottom-right`})})]})})}))}).catch(e=>{console.error(`Boot failed:`,e),$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsxs)(Q9,{children:[Wl(),` `,e instanceof Error?e.message:String(e)]})}))});export{xB as $,wH as A,Jb as At,WB as B,mb as Bt,j6 as C,bP as Ct,S6 as D,WM as Dt,_fe as E,YM as Et,ZB as F,Vb as Ft,AB as G,rb as Gt,FB as H,db as Ht,HB as I,kb as It,kB as J,Hm as Jt,jB as K,tb as Kt,GB as L,wb as Lt,KV as M,Wb as Mt,IV as N,Ub as Nt,T6 as O,Xb as Ot,JB as P,Hb as Pt,yB as Q,QB as R,Cb as Rt,N6 as S,SP as St,r3 as T,XM as Tt,IB as U,lb as Ut,VB as V,fb as Vt,SB as W,ob as Wt,EB as X,DB as Y,OB as Z,X6 as _,cz as _t,U_e as a,gB as at,k6 as b,QR as bt,k9 as c,Hz as ct,z8 as d,Vz as dt,bB as et,I8 as f,zz as ft,$6 as g,hz as gt,Z6 as h,gz as ht,W_e as i,hB as it,EH as j,qb as jt,TH as k,Yb as kt,A9 as l,Pz as lt,e8 as m,Bz as mt,V_e as n,pB as nt,G_e as o,fB as ot,r8 as p,Rz as pt,TB as q,Um as qt,H_e as r,mB as rt,A_e as s,Wz as st,R9 as t,dB as tt,c9 as u,Lz as ut,Q6 as v,pz as vt,A6 as w,xP as wt,M6 as x,CP as xt,Ype as y,lz as yt,KB as z,yb as zt};
233
+ `},Lhe={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Rhe(e){let{announcements:t=Lhe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ihe}=e,{announce:a,announcement:o}=Nhe(),s=O5(`DndLiveRegion`),[c,l]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{l(!0)},[]),Phe((0,B.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=B.createElement(B.Fragment,null,B.createElement(jhe,{id:r,value:i.draggable}),B.createElement(Mhe,{id:s,announcement:o}));return n?(0,Gm.createPortal)(u,n):u}var L5;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(L5||={});function R5(){}function z5(e,t){return(0,B.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function B5(){var e=[...arguments];return(0,B.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var V5=Object.freeze({x:0,y:0});function H5(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function zhe(e,t){let n=N5(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function U5(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Bhe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function W5(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function G5(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function K5(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Vhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=K5(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=H5(K5(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(U5)},q5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=W5(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=W5(r),o=i.reduce((e,t,r)=>e+H5(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(U5)};function Hhe(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var Uhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Hhe(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Bhe)};function Whe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function J5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:V5}function Ghe(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Khe=Ghe(1);function Y5(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qhe(e,t,n){let r=Y5(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Jhe={ignoreTransform:!1};function X5(e,t){t===void 0&&(t=Jhe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=g5(e).getComputedStyle(e);t&&(n=qhe(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Z5(e){return X5(e,{ignoreTransform:!0})}function Yhe(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Xhe(e,t){return t===void 0&&(t=g5(e).getComputedStyle(e)),t.position===`fixed`}function Zhe(e,t){t===void 0&&(t=g5(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function Q5(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(_5(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!v5(i)||y5(i)||n.includes(i))return n;let a=g5(e).getComputedStyle(i);return i!==e&&Zhe(i,a)&&n.push(i),Xhe(i,a)?n:r(i.parentNode)}return e?r(e):n}function $5(e){let[t]=Q5(e,1);return t??null}function e7(e){return!p5||!e?null:m5(e)?e:h5(e)?_5(e)||e===b5(e).scrollingElement?window:v5(e)?e:null:null}function t7(e){return m5(e)?e.scrollX:e.scrollLeft}function n7(e){return m5(e)?e.scrollY:e.scrollTop}function r7(e){return{x:t7(e),y:n7(e)}}var i7;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(i7||={});function a7(e){return!p5||!e?!1:e===document.scrollingElement}function o7(e){let t={x:0,y:0},n=a7(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Qhe={x:.2,y:.2};function $he(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Qhe);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=o7(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=i7.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=i7.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=i7.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=i7.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ege(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function s7(e){return e.reduce((e,t)=>A5(e,r7(t)),V5)}function tge(e){return e.reduce((e,t)=>e+t7(t),0)}function nge(e){return e.reduce((e,t)=>e+n7(t),0)}function c7(e,t){if(t===void 0&&(t=X5),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);$5(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var rge=[[`x`,[`left`,`right`],tge],[`y`,[`top`,`bottom`],nge]],l7=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Q5(t),r=s7(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of rge)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},u7=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function ige(e){let{EventTarget:t}=g5(e);return e instanceof t?e:b5(e)}function d7(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var f7;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(f7||={});function p7(e){e.preventDefault()}function age(e){e.stopPropagation()}var m7;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(m7||={});var h7={start:[m7.Space,m7.Enter],cancel:[m7.Esc],end:[m7.Space,m7.Enter,m7.Tab]},oge=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case m7.Right:return{...n,x:n.x+25};case m7.Left:return{...n,x:n.x-25};case m7.Down:return{...n,y:n.y+25};case m7.Up:return{...n,y:n.y-25}}},g7=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new u7(b5(t)),this.windowListeners=new u7(g5(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(f7.Resize,this.handleCancel),this.windowListeners.add(f7.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(f7.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&c7(n),t(V5)}handleKeyDown(e){if(M5(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=h7,coordinateGetter:a=oge,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:V5;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=j5(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=o7(n),p=ege(n),m={x:Math.min(i===m7.Right?p.right-p.width/2:p.right,Math.max(i===m7.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===m7.Down?p.bottom-p.height/2:p.bottom,Math.max(i===m7.Down?p.top:p.top+p.height/2,u.y))},h=i===m7.Right&&!s||i===m7.Left&&!c,g=i===m7.Down&&!l||i===m7.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===m7.Right&&e<=d.x||i===m7.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===m7.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===m7.Down&&e<=d.y||i===m7.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===m7.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,A5(j5(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};g7.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=h7,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function _7(e){return!!(e&&`distance`in e)}function v7(e){return!!(e&&`delay`in e)}var y7=class{constructor(e,t,n){n===void 0&&(n=ige(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=b5(i),this.documentListeners=new u7(this.document),this.listeners=new u7(n),this.windowListeners=new u7(g5(i)),this.initialCoordinates=N5(r)??V5,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(f7.Resize,this.handleCancel),this.windowListeners.add(f7.DragStart,p7),this.windowListeners.add(f7.VisibilityChange,this.handleCancel),this.windowListeners.add(f7.ContextMenu,p7),this.documentListeners.add(f7.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(v7(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(_7(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(f7.Click,age,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(f7.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=N5(e)??V5,s=j5(n,o);if(!t&&a){if(_7(a)){if(a.tolerance!=null&&d7(s,a.tolerance))return this.handleCancel();if(d7(s,a.distance))return this.handleStart()}if(v7(a)&&d7(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===m7.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},sge={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},b7=class extends y7{constructor(e){let{event:t}=e,n=b5(t.target);super(e,sge,n)}};b7.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var cge={move:{name:`mousemove`},end:{name:`mouseup`}},x7;(function(e){e[e.RightClick=2]=`RightClick`})(x7||={});var lge=class extends y7{constructor(e){super(e,cge,b5(e.event.target))}};lge.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===x7.RightClick?!1:(r?.({event:n}),!0)}}];var S7={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},uge=class extends y7{constructor(e){super(e,S7)}static setup(){return window.addEventListener(S7.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(S7.move.name,e)};function e(){}}};uge.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var C7;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(C7||={});var w7;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(w7||={});function dge(e){let{acceleration:t,activator:n=C7.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=w7.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=pge({delta:d,disabled:!a}),[m,h]=Ehe(),g=(0,B.useRef)({x:0,y:0}),_=(0,B.useRef)({x:0,y:0}),v=(0,B.useMemo)(()=>{switch(n){case C7.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case C7.DraggableRect:return i}},[n,i,c]),y=(0,B.useRef)(null),b=(0,B.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,B.useMemo)(()=>s===w7.TreeOrder?[...l].reverse():l,[s,l]);(0,B.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=$he(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var fge={x:{[i7.Backward]:!1,[i7.Forward]:!1},y:{[i7.Backward]:!1,[i7.Forward]:!1}};function pge(e){let{delta:t,disabled:n}=e,r=E5(t);return w5(e=>{if(n||!r||!e)return fge;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[i7.Backward]:e.x[i7.Backward]||i.x===-1,[i7.Forward]:e.x[i7.Forward]||i.x===1},y:{[i7.Backward]:e.y[i7.Backward]||i.y===-1,[i7.Forward]:e.y[i7.Forward]||i.y===1}}},[n,t,r])}function mge(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return w5(e=>t==null?null:r??e??null,[r,t])}function hge(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var T7;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(T7||={});var E7;(function(e){e.Optimized=`optimized`})(E7||={});var D7=new Map;function gge(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,B.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,B.useRef)(e),d=g(),f=C5(d),p=(0,B.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,B.useRef)(null),h=w5(t=>{if(d&&!n)return D7;if(!t||t===D7||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new l7(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,B.useEffect)(()=>{u.current=e},[e]),(0,B.useEffect)(()=>{d||p()},[n,d]),(0,B.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,B.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case T7.Always:return!1;case T7.BeforeDragging:return n;default:return!n}}}function O7(e,t){return w5(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function _ge(e,t){return O7(e,t)}function vge(e){let{callback:t,disabled:n}=e,r=S5(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function k7(e){let{callback:t,disabled:n}=e,r=S5(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function yge(e){return new l7(X5(e),e)}function A7(e,t,n){t===void 0&&(t=yge);let[r,i]=(0,B.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=vge({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=k7({callback:a});return x5(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function bge(e){return J5(e,O7(e))}var j7=[];function xge(e){let t=(0,B.useRef)(e),n=w5(n=>e?n&&n!==j7&&e&&t.current&&e.parentNode===t.current.parentNode?n:Q5(e):j7,[e]);return(0,B.useEffect)(()=>{t.current=e},[e]),n}function Sge(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e),i=(0,B.useCallback)(e=>{let t=e7(e.target);t&&n(e=>e?(e.set(t,r7(t)),new Map(e)):null)},[]);return(0,B.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=e7(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,r7(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{e7(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,B.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>A5(e,t),V5):s7(e):V5,[e,t])}function M7(e,t){t===void 0&&(t=[]);let n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{n.current=null},t),(0,B.useEffect)(()=>{let t=e!==V5;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?j5(e,n.current):V5}function Cge(e){(0,B.useEffect)(()=>{if(!p5)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function wge(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function N7(e){return(0,B.useMemo)(()=>e?Yhe(e):null,[e])}var P7=[];function Tge(e,t){t===void 0&&(t=X5);let[n]=e,r=N7(n?g5(n):null),[i,a]=(0,B.useState)(P7);function o(){a(()=>e.length?e.map(e=>a7(e)?r:new l7(t(e),e)):P7)}let s=k7({callback:o});return x5(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function F7(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return v5(t)?t:e}function Ege(e){let{measure:t}=e,[n,r]=(0,B.useState)(null),i=k7({callback:(0,B.useCallback)(e=>{for(let{target:n}of e)if(v5(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=T5((0,B.useCallback)(e=>{let n=F7(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,B.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Dge=[{sensor:b7,options:{}},{sensor:g7,options:{}}],Oge={current:{}},I7={draggable:{measure:Z5},droppable:{measure:Z5,strategy:T7.WhileDragging,frequency:E7.Optimized},dragOverlay:{measure:X5}},L7=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},kge={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new L7,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:R5},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:I7,measureDroppableContainers:R5,windowRect:null,measuringScheduled:!1},R7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:R5,draggableNodes:new Map,over:null,measureDroppableContainers:R5},z7=(0,B.createContext)(R7),B7=(0,B.createContext)(kge);function Age(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new L7}}}function jge(e,t){switch(t.type){case L5.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case L5.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case L5.DragEnd:case L5.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case L5.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new L7(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case L5.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new L7(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case L5.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new L7(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Mge(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,B.useContext)(z7),a=E5(r),o=E5(n?.id);return(0,B.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!M5(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=khe(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function V7(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Nge(e){return(0,B.useMemo)(()=>({draggable:{...I7.draggable,...e?.draggable},droppable:{...I7.droppable,...e?.droppable},dragOverlay:{...I7.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Pge(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,B.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;x5(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=J5(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=$5(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var H7=(0,B.createContext)({...V5,scaleX:1,scaleY:1}),U7;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(U7||={});var W7=(0,B.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Dge,collisionDetection:o=Uhe,measuring:s,modifiers:c,...l}=e,[u,d]=(0,B.useReducer)(jge,void 0,Age),[f,p]=Fhe(),[m,h]=(0,B.useState)(U7.Uninitialized),g=m===U7.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,B.useRef)({initial:null,translated:null}),C=(0,B.useMemo)(()=>_==null?null:{id:_,data:x?.data??Oge,rect:S},[_,x]),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=C5(l,Object.values(l)),A=O5(`DndDescribedBy`,t),j=(0,B.useMemo)(()=>b.getEnabled(),[b]),M=Nge(s),{droppableRects:N,measureDroppableContainers:ee,measuringScheduled:P}=gge(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),F=mge(v,_),te=(0,B.useMemo)(()=>D?N5(D):null,[D]),ne=Me(),re=_ge(F,M.draggable.measure);Pge({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:M.draggable.measure});let ie=A7(F,M.draggable.measure,re),ae=A7(F?F.parentElement:null),oe=(0,B.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=Ege({measure:M.dragOverlay.measure}),le=ce.nodeRef.current??F,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=bge(de?null:ie),pe=N7(le?g5(le):null),me=xge(g?se??F:null),he=Tge(me),ge=V7(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=te?A5(te,y):null,ve=Sge(me),ye=M7(ve),be=M7(ve,[ie]),I=A5(ge,ye),xe=ue?Khe(ue,ge):null,Se=C&&xe?o({active:C,collisionRect:xe,droppableRects:N,droppableContainers:j,pointerCoordinates:_e}):null,Ce=G5(Se,`id`),[we,Te]=(0,B.useState)(null),Ee=Whe(de?ge:A5(ge,be),we?.rect??null,ie),De=(0,B.useRef)(null),Oe=(0,B.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;De.current=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Gm.unstable_batchedUpdates)(()=>{r?.(i),h(U7.Initializing),d({type:L5.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(De.current),O(a)})},onMove(e){d({type:L5.DragMove,coordinates:e})},onEnd:o(L5.DragEnd),onCancel:o(L5.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===L5.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=L5.DragCancel)}w.current=null,(0,Gm.unstable_batchedUpdates)(()=>{d({type:e}),h(U7.Uninitialized),Te(null),E(null),O(null),De.current=null;let t=e===L5.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),ke=hge(a,(0,B.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Oe(n,t))},[v,Oe]));Cge(a),x5(()=>{ie&&m===U7.Initializing&&h(U7.Initialized)},[ie,m]),(0,B.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:I.x,y:I.y},over:i};(0,Gm.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[I.x,I.y]),(0,B.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(Ce),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Gm.unstable_batchedUpdates)(()=>{Te(s),a?.(c),f({type:`onDragOver`,event:c})})},[Ce]),x5(()=>{oe.current={activatorEvent:D,active:C,activeNode:F,collisionRect:xe,collisions:Se,droppableRects:N,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:we,scrollableAncestors:me,scrollAdjustedTranslate:I},S.current={initial:ue,translated:xe}},[C,F,Se,xe,v,le,ue,N,b,we,me,I]),dge({...ne,delta:y,draggingRect:xe,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let Ae=(0,B.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:ie,activatorEvent:D,collisions:Se,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:N,over:we,measureDroppableContainers:ee,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:M,measuringScheduled:P,windowRect:pe}),[C,F,ie,D,Se,ae,ce,v,b,N,we,ee,me,he,M,P,pe]),je=(0,B.useMemo)(()=>({activatorEvent:D,activators:ke,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:we,measureDroppableContainers:ee}),[D,ke,C,ie,d,A,v,we,ee]);return B.createElement(I5.Provider,{value:p},B.createElement(z7.Provider,{value:je},B.createElement(B7.Provider,{value:Ae},B.createElement(H7.Provider,{value:Ee},i)),B.createElement(Mge,{disabled:n?.restoreFocus===!1})),B.createElement(Rhe,{...n,hiddenTextDescribedById:A}));function Me(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Fge=(0,B.createContext)(null),G7=`button`,Ige=`Draggable`;function Lge(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=O5(Ige),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,B.useContext)(z7),{role:p=G7,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,B.useContext)(g?H7:Fge),[v,y]=T5(),[b,x]=T5(),S=wge(o,t),C=C5(n);return x5(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,B.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===G7?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function K7(){return(0,B.useContext)(B7)}var Rge=`Droppable`,zge={timeout:25};function q7(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=O5(Rge),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,B.useContext)(z7),u=(0,B.useRef)({disabled:n}),d=(0,B.useRef)(!1),f=(0,B.useRef)(null),p=(0,B.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...zge,...i},_=C5(h??r),v=k7({callback:(0,B.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=T5((0,B.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=C5(t);return(0,B.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,B.useEffect)(()=>(s({type:L5.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:L5.UnregisterDroppable,key:a,id:r})),[r]),(0,B.useEffect)(()=>{n!==u.current.disabled&&(s({type:L5.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Bge(e){let{animation:t,children:n}=e,[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null),s=E5(n);return!n&&!r&&s&&i(s),x5(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),B.createElement(B.Fragment,null,n,r?(0,B.cloneElement)(r,{ref:o}):null)}var Vge={x:0,y:0,scaleX:1,scaleY:1};function Hge(e){let{children:t}=e;return B.createElement(z7.Provider,{value:R7},B.createElement(H7.Provider,{value:Vge},t))}var Uge={position:`fixed`,touchAction:`none`},Wge=e=>M5(e)?`transform 250ms ease`:void 0,Gge=(0,B.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Wge}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Uge,width:s.width,height:s.height,top:s.top,left:s.left,transform:P5.Transform.toString(d),transformOrigin:i&&r?zhe(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return B.createElement(n,{className:o,style:f,ref:t},a)}),Kge={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:P5.Transform.toString(t)},{transform:P5.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function qge(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return S5((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=F7(a);if(!c)return;let{transform:l}=g5(a).getComputedStyle(a),u=Y5(l);if(!u)return;let d=typeof t==`function`?t:Jge(t);return c7(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Jge(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Kge,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var J7=0;function Yge(e){return(0,B.useMemo)(()=>{if(e!=null)return J7++,J7},[e])}var Xge=B.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=K7(),S=(0,B.useContext)(H7),C=Yge(d?.id),w=V7(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=O7(f),E=qge({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return B.createElement(Hge,null,B.createElement(Bge,{animation:E},d&&C?B.createElement(Gge,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),Zge=e=>{let{transform:t}=e;return{...t,y:0}};function Qge(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var $ge=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:Qge(n,t,i)},e_e=e=>{let{transform:t}=e;return{...t,x:0}};function Y7(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function t_e(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function X7(e){return e!==null&&e>=0}function n_e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function r_e(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Z7={scaleX:1,scaleY:1},i_e=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=a_e(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...Z7}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...Z7}:a<r&&a>=i?{x:o.width+s,y:0,...Z7}:{x:0,y:0,...Z7}};function a_e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return!r||!i&&!a?0:n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width)}var Q7=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Y7(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},$7={scaleX:1,scaleY:1},o_e=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...$7}:null}let s=s_e(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...$7}:r<t&&r>=a?{x:0,y:o.height+s,...$7}:{x:0,y:0,...$7}};function s_e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var e9=`Sortable`,t9=B.createContext({activeIndex:-1,containerId:e9,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Q7,disabled:{draggable:!1,droppable:!1}});function n9(e){let{children:t,id:n,items:r,strategy:i=Q7,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=K7(),d=O5(e9,n),f=s.rect!==null,p=(0,B.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,B.useRef)(p),v=!n_e(p,_.current),y=g!==-1&&h===-1||v,b=r_e(a);x5(()=>{v&&m&&u(p)},[v,p,m,u]),(0,B.useEffect)(()=>{_.current=p},[p]);let x=(0,B.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:t_e(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return B.createElement(t9.Provider,{value:x},t)}var c_e=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Y7(n,r,i).indexOf(t)},l_e=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},u_e={duration:200,easing:`ease`},r9=`transform`,d_e=P5.Transition.toString({property:r9,duration:0,easing:`linear`}),f_e={roleDescription:`sortable`};function p_e(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,B.useState)(null),s=(0,B.useRef)(n);return x5(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=X5(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,B.useEffect)(()=>{a&&o(null)},[a]),a}function i9(e){let{animateLayoutChanges:t=l_e,attributes:n,disabled:r,data:i,getNewIndex:a=c_e,id:o,strategy:s,resizeObserverConfig:c,transition:l=u_e}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,B.useContext)(t9),y=m_e(r,p),b=u.indexOf(o),x=(0,B.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,B.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=q7({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:ee,setActivatorNodeRef:P,transform:F}=Lge({id:o,data:x,attributes:{...f_e,...n},disabled:y.draggable}),te=The(E,j),ne=!!D,re=ne&&!m&&X7(f)&&X7(g),ie=!_&&N,ae=re?(ie&&re?F:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,oe=X7(f)&&X7(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=D?.id,ce=(0,B.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:D,containerId:d,isDragging:N,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=p_e({disabled:!ue,index:b,node:w,rect:C});return(0,B.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,B.useEffect)(()=>{if(se===ce.current.activeId)return;if(se!=null&&ce.current.activeId==null){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:N,listeners:M,node:w,overIndex:g,over:ee,setNodeRef:te,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return d_e;if(!(ie&&!M5(O)||!l)&&(ne||ue))return P5.Transition.toString({...l,property:r9})}}function m_e(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function a9(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var h_e=[m7.Down,m7.Right,m7.Up,m7.Left],o9=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(h_e.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case m7.Down:r.top<a.top&&t.push(n);break;case m7.Up:r.top>a.top&&t.push(n);break;case m7.Left:r.left>a.left&&t.push(n);break;case m7.Right:r.left<a.left&&t.push(n);break}});let c=q5({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=G5(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=Q5(c).some((e,t)=>s[t]!==e),i=s9(e,t),a=g_e(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:j5(u,l)}}}};function s9(e,t){return!a9(e)||!a9(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function g_e(e,t){return!a9(e)||!a9(t)||!s9(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function c9({open:e,onOpenChange:t,title:n,description:r,children:i,onSubmit:a,submitLabel:o,submitting:s=!1,canSubmit:c=!0}){let[l,u]=(0,B.useState)(!1),d=s||l;async function f(){if(!(!c||d))try{u(!0),await a()}finally{u(!1)}}return(0,V.jsx)(T8,{open:e,onOpenChange:t,children:(0,V.jsxs)(E8,{side:`right`,className:`w-4/5 sm:max-w-none gap-0 p-0`,children:[(0,V.jsxs)(D8,{className:`border-b px-6 py-4`,children:[(0,V.jsx)(k8,{children:n}),r?(0,V.jsx)(A8,{children:r}):null]}),(0,V.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,V.jsx)(`div`,{className:`oc-sheet__body flex-1 overflow-y-auto px-6 py-4`,children:i}),(0,V.jsxs)(O8,{className:`border-t px-6 py-4`,children:[(0,V.jsxs)(Ju,{type:`submit`,disabled:!c||d,children:[d?(0,V.jsx)(Cb,{className:`size-4 animate-spin`}):null,o??qn()]}),(0,V.jsx)(Ju,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:Ae()})]})]})]})})}var l9=6e4,u9=60*l9,d9=24*u9,f9=7*d9,p9=30*d9,m9=365*d9;function __e(e,t){let n=t-e;if(n<l9)return`maintenant`;if(n<u9)return`${Math.floor(n/l9)}min`;if(n<d9)return`${Math.floor(n/u9)}h`;if(n<f9)return`${Math.floor(n/d9)}j`;if(n<p9)return`${Math.floor(n/f9)}sem`;if(n<m9)return`${Math.floor(n/p9)}mois`;let r=Math.floor(n/m9);return`${r}an${r>1?`s`:``}`}var h9=[{value:`red`,hue:`oklch(0.63 0.21 25)`},{value:`orange`,hue:`oklch(0.7 0.17 50)`},{value:`amber`,hue:`oklch(0.8 0.15 85)`},{value:`green`,hue:`oklch(0.7 0.16 150)`},{value:`teal`,hue:`oklch(0.7 0.12 190)`},{value:`blue`,hue:`oklch(0.62 0.19 250)`},{value:`violet`,hue:`oklch(0.6 0.2 300)`},{value:`pink`,hue:`oklch(0.7 0.2 350)`}],g9=e=>h9.find(t=>t.value===e)?.hue??null,_9=`project:none`,v_e=e=>`project:${e}`,v9=`oc.noproject.collapsed`;function y9(){return(0,V.jsx)(`div`,{className:`oc-sidebar__skeleton`,"aria-hidden":`true`,children:Array.from({length:7}).map((e,t)=>(0,V.jsx)(`div`,{className:`oc-skel oc-skel--row`},t))})}function y_e({activeChatId:e,onSelect:t,onNewChat:n,newChatShortcut:r}){let i=R(L.messages.listChats,{}),a=R(L.projects.listProjects,{}),o=R(L.me.getMe,{host:QR})?.ui?.effective,s=o?.showChatProvider??!0,c=o?.showChatAge??!0,l=new Set((i??[]).map(e=>e.providerKind).filter(e=>e!=null)),u=s&&l.size>1,[,d]=(0,B.useState)(0);(0,B.useEffect)(()=>{if(!c)return;let e=window.setInterval(()=>d(e=>e+1),6e4);return()=>window.clearInterval(e)},[c]);let f=nu(L.projects.createProject),p=nu(L.projects.setProjectCollapsed),m=nu(L.chats.reorderChat),h=nu(L.chats.moveChatToProject),g=IB(),_=Eu(),v=(0,B.useRef)(null),y=(0,B.useRef)(null),b=(0,B.useRef)(null),[x,S]=(0,B.useState)(`full`);(0,B.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=()=>{let t=e.clientWidth,n=y.current?.offsetWidth??0,r=b.current?.offsetWidth??0,i=n===0||t>=n?`full`:t>=r?`label`:`icon`;S(e=>e===i?e:i)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[_,r]);let[C,w]=(0,B.useState)(null),T=(0,B.useRef)(!1);(0,B.useEffect)(()=>{!T.current&&i&&w(i)},[i]);let E=C??i??[],D=i===void 0&&C===null,[O,k]=(0,B.useState)(null),[A,j]=(0,B.useState)(()=>localStorage.getItem(v9)===`1`);function M(){j(e=>(localStorage.setItem(v9,e?`0`:`1`),!e))}let N=B5(z5(b7,{activationConstraint:{distance:4}}),z5(g7,{coordinateGetter:o9})),ee=E.filter(e=>e.pinned),P=E.filter(e=>!e.pinned),F=e=>P.filter(t=>(t.projectId??null)===e);function te(e){return E.find(t=>t._id===e)}async function ne(e){k(null);let{active:t,over:n}=e;if(!n)return;let r=te(String(t.id));if(!r)return;let i=String(n.id);if(i.startsWith(`project:`)){let e=i===_9?null:i.slice(8);if((r.projectId??null)===e)return;T.current=!0,w(t=>(t??E).map(t=>t._id===r._id?{...t,projectId:e}:t));try{await h({chatId:r._id,projectId:e})}finally{T.current=!1}return}let a=te(i);if(!a||t.id===n.id)return;if((a.projectId??null)!==(r.projectId??null)||a.pinned!==r.pinned){if(r.pinned||a.pinned)return;T.current=!0,w(e=>(e??E).map(e=>e._id===r._id?{...e,projectId:a.projectId??null}:e));try{await h({chatId:r._id,projectId:a.projectId??null})}finally{T.current=!1}return}let o=a.pinned?ee:F(a.projectId??null),s=o.map(e=>e._id),c=s.indexOf(r._id),l=s.indexOf(a._id);if(c<0||l<0)return;let u=[...o];u.splice(c,1),u.splice(l,0,r);let d=u[l-1]??null,f=u[l+1]??null;T.current=!0,w(e=>[...(e??E).filter(e=>!o.some(t=>t._id===e._id)),...u]);try{await m({chatId:r._id,prevKey:d?d.sortKey:null,nextKey:f?f.sortKey:null})}finally{T.current=!1}}let re=O?te(O):null;return(0,V.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,V.jsxs)(`div`,{className:`oc-sidebar__top`,ref:v,children:[(0,V.jsxs)(Ju,{className:x===`icon`?`oc-newchat flex-1 justify-center`:`oc-newchat flex-1 justify-start`,onClick:n,title:`${_} (${r})`,"aria-label":_,children:[(0,V.jsx)(Vb,{}),x===`icon`?null:(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_}),x===`full`?(0,V.jsx)(`kbd`,{className:`oc-newchat__kbd`,"aria-hidden":!0,children:r}):null]}),(0,V.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,V.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:y,children:[(0,V.jsxs)(Ju,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,V.jsx)(Vb,{}),(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_}),(0,V.jsx)(`kbd`,{className:`oc-newchat__kbd`,children:r})]}),(0,V.jsx)(Ju,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,V.jsx)(vb,{})})]})}),(0,V.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,V.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:b,children:[(0,V.jsxs)(Ju,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,V.jsx)(Vb,{}),(0,V.jsx)(`span`,{className:`oc-newchat__label`,children:_})]}),(0,V.jsx)(Ju,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,V.jsx)(vb,{})})]})}),(0,V.jsx)(Ju,{className:`oc-newproject`,variant:`outline`,size:`icon`,"aria-label":Or(),title:Or(),onClick:async()=>{let e=await g({title:Or(),label:ln(),placeholder:Mt(),confirmLabel:$e()});e&&await f({name:e})},children:(0,V.jsx)(vb,{})})]}),(0,V.jsxs)(W7,{sensors:N,collisionDetection:q5,modifiers:[e_e,$ge],onDragStart:e=>k(e.active.id),onDragCancel:()=>k(null),onDragEnd:ne,children:[(0,V.jsx)(`div`,{className:`oc-sidebar__scroll`,children:D?(0,V.jsx)(y9,{}):(0,V.jsxs)(V.Fragment,{children:[ee.length>0?(0,V.jsx)(b9,{label:sr(),chats:ee,children:ee.map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))}):null,(a??[]).map(n=>{let r=F(n._id);return(0,V.jsx)(b9,{label:n.name,dropId:v_e(n._id),projectId:n._id,chats:r,collapsible:!0,collapsed:n.collapsed,onToggle:()=>void p({projectId:n._id,collapsed:!n.collapsed}),children:n.collapsed?null:r.length===0?(0,V.jsx)(`div`,{className:`oc-sidebar__empty`,children:In()}):r.map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))},n._id)}),(0,V.jsx)(b9,{label:wn(),dropId:_9,chats:F(null),collapsible:!0,collapsed:A,onToggle:M,children:A?null:F(null).map(n=>(0,V.jsx)(S9,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))})]})}),(0,V.jsx)(Xge,{children:re?(0,V.jsxs)(`div`,{className:`oc-chatitem oc-chatitem--overlay`,children:[(0,V.jsx)(bb,{className:`size-3.5 opacity-60`}),g9(re.color)?(0,V.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:g9(re.color)}}):(0,V.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,V.jsx)(`span`,{className:`oc-chatitem__label`,children:re.title||_s()})]}):null})]})]})}function b9({label:e,dropId:t,projectId:n,chats:r,collapsible:i,collapsed:a,onToggle:o,children:s}){let c=nu(L.projects.deleteProject),l=FB(),u=R(L.projects.projectChatCount,n?{projectId:n}:`skip`),{setNodeRef:d,isOver:f}=q7({id:t??`static:${e}`});return(0,V.jsxs)(`div`,{ref:t?d:void 0,className:`oc-sidebar__group`+(f?` oc-sidebar__group--over`:``),children:[(0,V.jsxs)(`div`,{className:`oc-sidebar__group-head`+(i?` oc-sidebar__group-head--btn`:``),...i?{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>{i&&o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}}:{},children:[i?a?(0,V.jsx)(tb,{className:`size-3.5`}):(0,V.jsx)(Mu,{className:`size-3.5`}):null,(0,V.jsx)(`span`,{className:`oc-sidebar__group-label`,children:e}),n?(0,V.jsx)(`button`,{className:`oc-sidebar__group-del`,"aria-label":Os(),onClick:async t=>{t.stopPropagation();let r=u??0;await l({title:Yn({name:e}),description:r>0?Me({count:r}):He(),confirmWord:$r(),confirmLabel:Os(),destructive:!0})&&await c({projectId:n})},children:(0,V.jsx)(Jb,{className:`size-3.5`})}):null]}),(0,V.jsx)(n9,{items:r.map(e=>e._id),strategy:o_e,children:s})]})}var x9={openclaw:`OpenClaw`,hermes:`Hermes`};function S9({chat:e,active:t,projects:n,onSelect:r,showProviderBadge:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=i9({id:e._id}),d=nu(L.chats.renameChat),f=nu(L.chats.deleteChat),p=nu(L.chats.pinChat),m=nu(L.chats.setChatColor),h=R(L.me.getMe,{host:QR})?.ui?.effective?.showChatAge??!0,g=FB(),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(e.title??``),x={transform:P5.Transform.toString(c),transition:l,opacity:+!u},S=g9(e.color);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{ref:s,style:x,className:`oc-chatitem group/row`+(t?` oc-chatitem--active`:``),children:[(0,V.jsx)(`button`,{className:`oc-chatitem__grip`,"aria-label":Kl(),...a,...o,children:(0,V.jsx)(bb,{className:`size-3.5`})}),S?(0,V.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:S}}):(0,V.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,V.jsx)(`button`,{className:`oc-chatitem__label`,onClick:()=>r(e._id),children:e.title||_s()}),e.readOnly?(0,V.jsx)(`span`,{className:`oc-chatitem__readonly`,title:k(),children:(0,V.jsx)(wb,{size:12,"aria-label":k()})}):null,i&&e.providerKind?(0,V.jsx)(`span`,{className:`oc-chatitem__bridge oc-chatitem__bridge--${e.providerKind} group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:Jo({provider:x9[e.providerKind]}),children:x9[e.providerKind]}):null,h?(0,V.jsx)(`span`,{className:`oc-chatitem__age group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:wH(e.updatedAt),children:__e(e.updatedAt,Date.now())}):null,(0,V.jsxs)(dB,{children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsx)(Ju,{variant:`ghost`,size:`icon-xs`,"aria-label":be(),className:`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,V.jsx)(fb,{})})}),(0,V.jsxs)(pB,{align:`end`,className:`w-48`,children:[(0,V.jsxs)(mB,{onSelect:()=>{b(e.title??``),v(!0)},children:[(0,V.jsx)(Rb,{}),` `,Hr()]}),(0,V.jsxs)(mB,{onSelect:()=>void p({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,V.jsx)(Bb,{}):(0,V.jsx)(zb,{}),e.pinned?iu():za()]}),(0,V.jsx)(hB,{children:hu()}),(0,V.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({chatId:e._id,color:null}),"aria-label":Pl(),children:`✕`}),h9.map(t=>(0,V.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void m({chatId:e._id,color:t.value})},t.value))]}),(0,V.jsx)(gB,{}),(0,V.jsxs)(mB,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await g({title:_a(),description:zo(),confirmLabel:$r(),destructive:!0})&&await f({chatId:e._id})})},children:[(0,V.jsx)(Jb,{}),` `,$r()]})]})]})]}),(0,V.jsx)(c9,{open:_,onOpenChange:v,title:qs(),canSubmit:y.trim().length>0,onSubmit:async()=>{await d({chatId:e._id,title:y.trim()}),v(!1)},children:(0,V.jsx)(`div`,{className:`oc-form`,children:(0,V.jsxs)(`label`,{className:`oc-field`,children:[(0,V.jsx)(`span`,{className:`oc-field__label`,children:Tc()}),(0,V.jsx)(Hz,{value:y,onChange:e=>b(e.target.value),autoFocus:!0})]})})})]})}function b_e(e){let t=nu(L.chats.createChat),n=R(L.agents.listMyAgents),[r,i]=(0,B.useState)(!1),a=(0,B.useCallback)(async(n,r)=>{e(await t({instanceName:n,agentId:r}))},[t,e]);return{startNewChat:(0,B.useCallback)(async()=>{let e=n;if(e&&e.length===1&&e[0].state!==`deleted`){await a(e[0].instanceName,e[0].agentId);return}i(!0)},[n,a]),picker:(0,V.jsx)(qz,{open:r,onOpenChange:i,agents:n,onPick:(e,t)=>{i(!1),a(e,t)}})}}var C9=[`admin`,`user`,`pending`];function w9(){let e=R(L.me.authProviders)?.anonymous===!0,[t,n]=(0,B.useState)(!1),r=R(L.dev.listUsersDev,e?{}:`skip`),i=R(L.me.getImpersonation),a=nu(L.dev.setMyRole),o=nu(L.dev.setRole),s=nu(L.admin.startImpersonation),c=nu(L.admin.stopImpersonation);if(!e)return null;let l=r?.find(e=>e.isMe),u=l?.role===`admin`,d=i?.impersonating===!0,f=(r??[]).filter(e=>!e.isMe);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-devfab`,onClick:()=>n(!0),title:m(),children:[(0,V.jsx)(Zb,{size:13}),`DEV`]}),(0,V.jsx)(Pz,{open:t,onOpenChange:n,children:(0,V.jsxs)(Lz,{children:[(0,V.jsxs)(Rz,{children:[(0,V.jsx)(Bz,{children:mr()}),(0,V.jsx)(Vz,{children:aa()})]}),(0,V.jsxs)(`div`,{className:`oc-devsw__me`,children:[(0,V.jsxs)(`span`,{className:`oc-devsw__melabel`,children:[Vi({canonical:l?.canonical??`…`}),` `,(0,V.jsx)(Wz,{variant:`outline`,children:l?.role??`…`})]}),(0,V.jsx)(`div`,{className:`oc-devsw__roles`,children:C9.map(e=>(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:l?.role===e?`secondary`:`ghost`,disabled:l?.role===e,onClick:()=>void a({role:e}),children:e===`admin`?Xi():e===`user`?Vt():jc()},e))})]}),d?(0,V.jsxs)(`div`,{className:`oc-devsw__imp`,children:[Yt(),` `,(0,V.jsx)(`strong`,{children:i.targetLabel}),`.`,(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>void c(),children:ot()})]}):null,(0,V.jsx)(`div`,{className:`oc-devsw__list`,children:f.length===0?(0,V.jsx)(`p`,{className:`oc-devsw__empty`,children:ji()}):f.map(e=>(0,V.jsxs)(`div`,{className:`oc-devsw__row`,children:[(0,V.jsx)(`span`,{className:`oc-devsw__label`,children:e.name||e.email||e.canonical||e.userId.slice(0,8)}),(0,V.jsx)(`select`,{className:`oc-devsw__select`,value:e.role,disabled:!e.canonical,onChange:t=>e.canonical&&void o({canonical:e.canonical,role:t.target.value}),children:C9.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))}),(0,V.jsx)(Ju,{type:`button`,size:`xs`,variant:`ghost`,disabled:!u||e.role===`pending`,title:u?e.role===`pending`?_t():bi():ci(),onClick:()=>{s({profileId:e.profileId}),n(!1)},children:ie()})]},e.profileId))})]})})]})}function T9({label:e,mode:t,minimal:n=!1}){let{signOut:r}=jd(),i=nu(L.me.setThemeMode).withOptimisticUpdate((e,{mode:t})=>{let n=e.getQuery(L.me.getMe,{host:QR});if(!n)return;let r=t===null?n.defaultThemeMode??`system`:t;e.setQuery(L.me.getMe,{host:QR},{...n,themeMode:t,resolvedThemeMode:r})}),a=t??`default`;return(0,V.jsxs)(dB,{children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsxs)(Ju,{variant:`ghost`,size:`sm`,className:`gap-1.5`,children:[e,(0,V.jsx)(Mu,{className:`opacity-60`})]})}),(0,V.jsx)(pB,{align:`end`,className:`w-52`,children:n?(0,V.jsxs)(mB,{onClick:()=>void r(),children:[(0,V.jsx)(Tb,{}),` `,Zc()]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(hB,{children:To()}),(0,V.jsxs)(_B,{value:a,onValueChange:e=>void i({mode:e==="default"?null:e}),children:[(0,V.jsxs)(vB,{value:`light`,children:[(0,V.jsx)(Tne,{}),` `,ro()]}),(0,V.jsxs)(vB,{value:`dark`,children:[(0,V.jsx)(Nb,{}),` `,bl()]}),(0,V.jsxs)(vB,{value:`system`,children:[(0,V.jsx)(Mb,{}),` `,Ps()]}),(0,V.jsx)(vB,{value:`default`,children:Wa()})]}),(0,V.jsx)(gB,{}),(0,V.jsxs)(mB,{onClick:()=>void r(),children:[(0,V.jsx)(Tb,{}),` `,Zc()]})]})})]})}var x_e={altered_words:()=>Rc(),incorrect:()=>Zs(),incoherence:()=>sl(),formatting:()=>fo(),latency:()=>g(),api_error:()=>gr(),other:()=>sa()},S_e=e=>x_e[e]?.()??e,C_e={anomaly_open:Yb,anomaly_resolved:rb,feedback_reply:Ob,feedback_resolved:Ob,curation:hb},w_e={notif_feedback_reply_admin:()=>({title:xa(),body:Qo()}),notif_feedback_reply:()=>({title:xa(),body:Qo()}),notif_feedback_resolved:()=>({title:ei(),body:ql()}),notif_curation_proposed:e=>({title:Cc(),body:Do({name:e.name??`?`,agentId:e.agentId??`?`})}),notif_curation_failed:e=>({title:ao(),body:Sl({name:e.name??`?`,reason:e.reason??`unknown`})}),notif_curation_relaunch_refused:e=>({title:Is(),body:Ka({name:e.name??`?`,reason:e.reason??`unknown`})}),notif_anomaly_open:(e,t)=>({title:$c({kind:e.kind??`?`}),body:t.body}),notif_anomaly_resolved:(e,t)=>({title:fc({kind:e.kind??`?`}),body:t.body})};function T_e(e){let t=e.messageKey?w_e[e.messageKey]:void 0;return t?t(e.params??{},e):e.kind===`feedback_reply`?{title:xa(),body:Qo()}:e.kind===`feedback_resolved`?{title:ei(),body:ql()}:{title:e.title,body:e.body}}function E_e(){let e=R(L.notifications.myUnreadCount)??0,t=R(L.notifications.myNotifications),n=R(L.feedback.myFeedback),r=nu(L.notifications.markRead),i=nu(L.notifications.markAllRead),a=nu(L.notifications.clearOne),o=nu(L.notifications.clearAll),s=nu(L.feedback.closeMyFeedback),c=Um(),[l,u]=(0,B.useState)(!1),d=e=>{if(e.unread&&r({notificationId:e._id}),!e.href)return;if(u(!1),e.href.startsWith(`/chat/`)){c({to:`/chat/$chatId`,params:{chatId:e.href.slice(6)}});return}let[t,n]=e.href.split(`?`);c({to:t,search:Object.fromEntries(new URLSearchParams(n??``))})};return(0,V.jsxs)(dB,{open:l,onOpenChange:u,children:[(0,V.jsx)(fB,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,className:`oc-bell`,"aria-label":e>0?zl({count:e}):fe(),children:[(0,V.jsx)(Qy,{size:18,"aria-hidden":!0}),e>0?(0,V.jsx)(`span`,{className:`oc-bell__badge`,"aria-hidden":!0,children:e>9?`9+`:e}):null]})}),(0,V.jsxs)(pB,{align:`end`,className:`oc-notif`,children:[(0,V.jsxs)(`div`,{className:`oc-notif__head`,children:[(0,V.jsx)(`span`,{children:Lr()}),t&&t.length>0?(0,V.jsxs)(`span`,{className:`oc-notif__bulk`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__act`,disabled:e===0,onClick:()=>void i({}),children:Ql()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__act`,onClick:()=>void o({}),children:Na()})]}):null]}),t===void 0?(0,V.jsx)(`div`,{className:`oc-notif__empty`,children:Sc()}):t.length===0?(0,V.jsx)(`div`,{className:`oc-notif__empty`,children:lu()}):(0,V.jsx)(`div`,{className:`oc-notif__list`,children:t.map(e=>{let t=C_e[e.kind]??Qy,{title:n,body:i}=T_e(e);return(0,V.jsxs)(`div`,{className:`oc-notif__item${e.unread?` is-unread`:``}${e.href?` is-link`:``}`,role:e.href?`button`:void 0,tabIndex:e.href?0:void 0,onClick:e.href?()=>d(e):void 0,children:[(0,V.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,V.jsx)(t,{size:14,className:`oc-notif__kind oc-notif__kind--${e.kind}`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`oc-notif__title`,children:n}),(0,V.jsxs)(`span`,{className:`oc-notif__row-actions`,children:[e.unread?(0,V.jsx)(`button`,{type:`button`,title:Ol(),"aria-label":Ol(),onClick:t=>{t.stopPropagation(),r({notificationId:e._id})},children:(0,V.jsx)(Au,{size:13})}):null,(0,V.jsx)(`button`,{type:`button`,title:fa(),"aria-label":fa(),onClick:t=>{t.stopPropagation(),a({notificationId:e._id})},children:(0,V.jsx)(Iu,{size:13})})]})]}),(0,V.jsx)(`p`,{className:`oc-notif__body`,children:i}),(0,V.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.createdAt).toLocaleString(Ko())})]},e._id)})}),n&&n.length>0?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`oc-notif__head oc-notif__head--sub`,children:Po()}),(0,V.jsx)(`div`,{className:`oc-notif__list`,children:n.map(e=>(0,V.jsx)(D_e,{it:e,onClose:t=>s({feedbackId:e._id,reason:t}),onNavigate:()=>u(!1)},e._id))})]}):null]})]})}function D_e({it:e,onClose:t,onNavigate:n}){let r=VB(),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1);async function f(){d(!0);try{await t(c.trim()||void 0)}catch(e){r.error(Ms(),e)}finally{d(!1)}}return(0,V.jsxs)(`div`,{className:`oc-notif__item`,children:[(0,V.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,V.jsx)(`span`,{className:`oc-notif__title`,children:S_e(e.category)}),(0,V.jsx)(`span`,{className:`oc-notif__status${e.answered||e.resolvedAt?` is-answered`:``}`,children:e.resolvedAt?Xn():e.answered?Uo():Us()})]}),(0,V.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.at).toLocaleString(Ko())}),e.thread.length>0?(0,V.jsx)(`div`,{className:`oc-notif__thread`,children:e.thread.map((e,t)=>(0,V.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,V.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?bc():e.authorRole===`agent`?A():Co()}),(0,V.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):null,e.messageText?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-notif__report-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[i?(0,V.jsx)(Mu,{size:13,"aria-hidden":!0}):(0,V.jsx)(tb,{size:13,"aria-hidden":!0}),vl()]}),i?(0,V.jsx)(`div`,{className:`oc-notif__report-msg`,children:e.messageText}):null]}):null,(0,V.jsxs)(`div`,{className:`oc-notif__report-actions`,children:[(0,V.jsx)(rh,{to:`/chat/$chatId`,params:{chatId:e.chatId},search:{m:e.messageId},className:`oc-notif__link`,onClick:n,children:to()}),o?null:(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__link oc-notif__link--muted`,onClick:()=>s(!0),children:Ms()})]}),o?(0,V.jsxs)(`div`,{className:`oc-notif__close-form`,children:[(0,V.jsx)(`textarea`,{className:`oc-notif__close-input`,rows:2,value:c,onChange:e=>l(e.target.value),placeholder:Ua()}),(0,V.jsxs)(`div`,{className:`oc-notif__close-actions`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__close-confirm`,disabled:u,onClick:()=>void f(),children:Yc()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-notif__close-cancel`,onClick:()=>{s(!1),l(``)},children:cc()})]})]}):null]})}var E9=2,O_e=180;function k_e(){let e=Um(),t=(0,B.useRef)(null),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(0),d=(0,B.useMemo)(()=>lz(rz,cz()),[]);(0,B.useEffect)(()=>{let e=setTimeout(()=>c(a),O_e);return()=>clearTimeout(e)},[a]);let f=s.trim(),p=R(L.search.searchConversations,f.length>=E9?{query:f}:`skip`),m=p??[],h=f.length>=E9&&p===void 0;(0,B.useEffect)(()=>{let e=e=>{uz(e,rz)&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.useEffect)(()=>{r&&(o(``),c(``),u(0))},[r]),(0,B.useEffect)(()=>{u(0)},[p]),(0,B.useEffect)(()=>{(n.current?.querySelector(`[data-index="${l}"]`))?.scrollIntoView({block:`nearest`})},[l]);let g=(0,B.useCallback)((t,n)=>{i(!1),n&&a.trim()&&sme(n,a.trim()),e({to:`/chat/$chatId`,params:{chatId:t},...n?{search:{m:n}}:{}})},[e,a]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`oc-search-trigger`,onClick:()=>i(!0),"aria-label":fs(),children:[(0,V.jsx)(Ub,{className:`oc-search-trigger__icon`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`oc-search-trigger__label`,children:w()}),(0,V.jsx)(`kbd`,{className:`oc-search-trigger__kbd`,children:d})]}),(0,V.jsx)(Pz,{open:r,onOpenChange:i,children:(0,V.jsxs)(Lz,{showCloseButton:!1,className:`oc-search-palette top-[12vh] translate-y-0 max-w-xl gap-0 overflow-hidden p-0`,onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},children:[(0,V.jsx)(Bz,{className:`sr-only`,children:ws()}),(0,V.jsxs)(`div`,{className:`oc-search-palette__head`,children:[(0,V.jsx)(Ub,{className:`oc-search-palette__head-icon`,"aria-hidden":!0}),(0,V.jsx)(`input`,{ref:t,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,m.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=m[l];t&&g(t.chatId,t.messageId)}},placeholder:Un(),className:`oc-search-palette__field`,autoComplete:`off`,spellCheck:!1,"aria-label":Ee()})]}),(0,V.jsx)(`div`,{className:`oc-search-palette__results`,ref:n,role:`listbox`,children:f.length<E9?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:Ie({count:E9})}):h?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:qr()}):m.length===0?(0,V.jsx)(`div`,{className:`oc-search-palette__hint`,children:Bl({term:f})}):m.map((e,t)=>(0,V.jsxs)(`button`,{type:`button`,"data-index":t,role:`option`,"aria-selected":t===l,className:Js(`oc-search-result`,t===l&&`is-active`),onMouseMove:()=>u(t),onClick:()=>g(e.chatId,e.messageId),children:[(0,V.jsx)(`span`,{className:`oc-search-result__icon`,"aria-hidden":!0,children:e.matchedIn===`title`?(0,V.jsx)(xb,{size:15}):(0,V.jsx)(Ob,{size:15})}),(0,V.jsxs)(`span`,{className:`oc-search-result__body`,children:[(0,V.jsx)(`span`,{className:`oc-search-result__title`,children:e.title||pe()}),e.snippet?(0,V.jsx)(`span`,{className:`oc-search-result__snippet`,children:e.snippet}):null]}),(0,V.jsx)(`span`,{className:`oc-search-result__tag`,children:e.matchedIn===`title`?Rr():$l()})]},e.chatId))}),(0,V.jsxs)(`div`,{className:`oc-search-palette__footer`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↑`}),(0,V.jsx)(`kbd`,{children:`↓`}),` `,Pa()]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↵`}),` `,uu()]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:kl()}),` `,pa()]})]})]})})]})}var D9=[`users`,`groups`,`instances`,`bridge`,`injections`,`serviceAccounts`,`roles`,`access`,`traces`,`kpi`,`anomalies`,`files`,`agentFiles`,`preferences`,`integrations`,`theme`,`chatDefaults`,`audit`,`feedbacks`,`subagentReports`,`voice`],O9=[`groups`,`access`,`roles`,`integrations`,`instances`,`injections`,`theme`,`feedbacks`,`subagentReports`,`files`,`agentFiles`,`preferences`,`chatDefaults`],k9={users:()=>Ui(),groups:()=>Ou(),instances:()=>Qi(),bridge:()=>Ut(),injections:()=>he(),serviceAccounts:()=>Nc(),roles:()=>Zt(),access:()=>jr(),traces:()=>ct(),kpi:()=>Pi(),anomalies:()=>ui(),files:()=>It(),agentFiles:()=>cu(),preferences:()=>uc(),integrations:()=>bt(),theme:()=>Qa(),chatDefaults:()=>yt(),audit:()=>Si(),feedbacks:()=>oe(),subagentReports:()=>Di(),voice:()=>Pt()},A9={users:`admin.manage`,groups:`groups.manage`,instances:`admin.manage`,bridge:`bridge.read`,injections:`admin.manage`,serviceAccounts:`admin.manage`,roles:`admin.manage`,access:`admin.manage`,traces:`traces.read`,kpi:`kpi.read`,anomalies:`anomalies.read`,files:`chats.read`,agentFiles:`agents.files.read`,preferences:`chats.read`,integrations:`admin.manage`,theme:`chats.read`,chatDefaults:`admin.manage`,audit:`admin.manage`,feedbacks:`admin.manage`,subagentReports:`admin.manage`,voice:`admin.manage`},A_e=[`traces`,`kpi`,`anomalies`,`bridge`,`agentFiles`,`groups`];function j9(e){let t=new Set(e);return D9.filter(e=>t.has(A9[e]))}function M9(e){return`/settings/${e}`}function N9(e){let t=e.split(`/`)[2];return D9.includes(t)?t:void 0}var j_e={uiprefs:`preferences`},P9=[{id:`personal`,label:()=>Ga(),tabs:[`preferences`,`theme`,`files`]},{id:`agents`,label:()=>Qc(),tabs:[`instances`,`agentFiles`,`chatDefaults`,`voice`,`bridge`,`injections`]},{id:`access`,label:()=>dc(),tabs:[`users`,`groups`,`access`,`roles`,`serviceAccounts`]},{id:`observability`,label:()=>Ca(),tabs:[`traces`,`kpi`,`anomalies`,`audit`,`feedbacks`,`subagentReports`,`integrations`]}],M_e=new Map(P9.flatMap(e=>e.tabs.map(t=>[t,e.id])));function F9(e){let t=M_e.get(e);if(!t)throw Error(`Settings tab "${e}" belongs to no group`);return t}function N_e(e,t){return e.find(e=>F9(e)===t)}P9.flatMap(e=>[...e.tabs]);function P_e(){let e=R(L.bridgeHealth.getBridgeAvailability,{});if(e===void 0)return null;let t=e.known?e.available?`ok`:`error`:`idle`,n=e.known?e.available?`${te()}${e.checkedAt?Cu({time:EH(e.checkedAt)}):``}`:Tr({reason:e.reason??`?`}):_i();return(0,V.jsx)(X6,{delayDuration:150,children:(0,V.jsxs)(Z6,{children:[(0,V.jsx)(Q6,{asChild:!0,children:(0,V.jsx)(`span`,{className:`oc-bridge-dot oc-bridge-dot--${t}`,role:`img`,"aria-label":n})}),(0,V.jsx)($6,{children:n})]})})}function I9(e){let t=new Set(D9),n=new Set,r=[];for(let i of e??[])t.has(i)&&!n.has(i)&&(r.push(i),n.add(i));for(let e of D9)n.has(e)||r.push(e);return r}function F_e(e,t){let n=new Set(t),r=[...t];return e.map(e=>n.has(e)?r.shift():e)}function I_e({tab:e,active:t}){let n=k9[e](),r=`oc-settings-tabs__tab`+(t?` is-active`:``),i=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`oc-settings-tabs__label`,children:n}),e===`bridge`?(0,V.jsx)(P_e,{}):null]});return O9.includes(e)?(0,V.jsx)(rh,{to:`/settings/$tab`,params:{tab:e},className:r,role:`tab`,"aria-selected":t,children:i}):(0,V.jsx)(rh,{to:`/settings/${e}`,className:r,role:`tab`,"aria-selected":t,children:i})}function L_e({tab:e,active:t}){let{attributes:n,listeners:r,setNodeRef:i,transform:a,transition:o,isDragging:s}=i9({id:e});return(0,V.jsxs)(`div`,{ref:i,style:{transform:P5.Transform.toString(a),transition:o,opacity:s?.5:1},className:`oc-settings-tabs__item`,role:`presentation`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-settings-tabs__grip`,"aria-label":Eo(),...n,...r,children:(0,V.jsx)(bb,{size:14,"aria-hidden":!0})}),(0,V.jsx)(I_e,{tab:e,active:t})]})}function R_e(){let e=R(L.me.getMe,{host:QR}),t=nu(L.me.setSettingsTabOrder),n=N9(_h({select:e=>e.pathname})),r=n===void 0?void 0:F9(n),i=(0,B.useMemo)(()=>I9(e?.settingsTabOrder??null),[e?.settingsTabOrder]),[a,o]=(0,B.useState)(i);(0,B.useEffect)(()=>o(i),[i]);let s=(0,B.useMemo)(()=>new Set(j9(e?.permissions??[])),[e?.permissions]),c=(0,B.useMemo)(()=>r===void 0?[]:a.filter(e=>s.has(e)&&F9(e)===r),[a,s,r]),l=B5(z5(b7,{activationConstraint:{distance:5}}),z5(g7,{coordinateGetter:o9}));if(r===void 0||c.length===0)return null;let u=P9.find(e=>e.id===r);function d(e){let{active:n,over:r}=e;if(!r||n.id===r.id)return;let i=c.indexOf(n.id),s=c.indexOf(r.id);if(i<0||s<0)return;let l=F_e(a,Y7(c,i,s));o(l),t({order:l})}return(0,V.jsx)(`div`,{className:`oc-settings-tabs`,role:`tablist`,"aria-label":u?.label(),children:(0,V.jsx)(W7,{sensors:l,collisionDetection:Vhe,modifiers:[Zge],onDragEnd:d,children:(0,V.jsx)(n9,{items:c,strategy:i_e,children:c.map(e=>(0,V.jsx)(L_e,{tab:e,active:e===n},e))})})})}function z_e(){let e=R(L.me.getMe,{host:QR}),t=Um(),n=N9(_h({select:e=>e.pathname})),r=n===void 0?void 0:F9(n),i=(0,B.useMemo)(()=>new Set(j9(e?.permissions??[])),[e?.permissions]),a=(0,B.useMemo)(()=>I9(e?.settingsTabOrder??null).filter(e=>i.has(e)),[e?.settingsTabOrder,i]),o=P9.filter(e=>e.tabs.some(e=>i.has(e)));function s(e){let n=N_e(a,e.id);n&&t({to:M9(n)})}return(0,V.jsxs)(`nav`,{className:`oc-settings-nav`,"aria-label":io(),children:[(0,V.jsx)(rh,{to:`/`,className:`oc-settings-nav__back`,children:xl()}),(0,V.jsx)(`div`,{className:`oc-settings-nav__title`,children:Fs()}),(0,V.jsx)(`div`,{className:`oc-settings-nav__list`,children:o.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`oc-settings-nav__group`+(e.id===r?` is-active`:``),"aria-current":e.id===r?`true`:void 0,onClick:()=>s(e),children:e.label()},e.id))})]})}var B_e=[`eq`,`neq`,`contains`,`gt`,`gte`,`lt`,`lte`],L9=[50,100,200,500],R9=`now-30d`,V_e=`now-24h`;function H_e(e,t,n=R9,r=`now`){let i=e??n,a=t??r,o=Number(i),s=Number(a);return i!==``&&a!==``&&Number.isFinite(o)&&Number.isFinite(s)?{kind:`absolute`,from:o,to:s}:{kind:`relative`,from:i,to:a}}function U_e(e){return e.kind===`absolute`?{from:String(e.from),to:String(e.to)}:{from:e.from,to:e.to}}function W_e(e){if(e.length!==0)return JSON.stringify(e)}function G_e(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e,r=t.field,i=t.op,a=t.value;typeof r!=`string`||r===``||typeof i!=`string`||!B_e.includes(i)||typeof a!=`string`&&typeof a!=`number`&&typeof a!=`boolean`||n.push({field:r,op:i,value:a})}return n}var z9=Bv().optional(),B9=Bv().optional(),V9=Bv().optional(),H9=Bv().optional().catch(void 0),K_e=_y({q:z9,section:Cy([`latency`,`events`]).default(`events`).catch(`events`),kind:Bv().default(`all`).catch(`all`),limit:Yy().pipe(yy([Ty(L9[0]),Ty(L9[1]),Ty(L9[2]),Ty(L9[3])])).catch(100),statusClass:Cy([`2xx`,`4xx`,`5xx`]).optional().catch(void 0),principalType:Cy([`user`,`service`,`system`]).optional().catch(void 0),direction:Cy([`inbound`,`outbound`,`internal`]).optional().catch(void 0),roleKey:H9,from:B9,to:B9,adv:V9}),q_e=_y({q:z9,action:H9,impersonated:Cy([`yes`,`no`]).optional().catch(void 0),resource:H9,from:B9,to:B9,adv:V9}),J_e=_y({q:z9,status:Cy([`open`,`acknowledged`,`resolved`,`all`]).default(`open`).catch(`open`),severity:Cy([`info`,`warn`,`critical`]).optional().catch(void 0),kind:H9,from:B9,to:B9}),Y_e=_y({from:B9,to:B9}),X_e=_y({q:z9,status:Cy([`active`,`disabled`]).optional().catch(void 0)}),Z_e=_y({q:z9,role:H9});_y({q:z9,mode:Cy([`per-user`,`shared`]).optional().catch(void 0)});var Q_e=_y({section:Cy([`readaloud`,`dictation`,`talk`]).default(`readaloud`).catch(`readaloud`)}),$_e=_y({section:Bv().max(32).default(`openclaw`).catch(`openclaw`)}),U9=`oc.theme`;function W9(e){let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}function G9(e){(0,B.useEffect)(()=>{let t=e??localStorage.getItem(U9)??`system`;if(localStorage.setItem(U9,t),W9(t),t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>W9(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e])}function eve(e){(0,B.useEffect)(()=>{if(!e)return;document.documentElement.lang=e;let t;try{t=Ko()}catch{t=void 0}t!==e&&Lo(e)},[e])}var tve=(0,B.lazy)(()=>Y4(()=>import(`./RolesTab-DnckeL9t.js`).then(e=>({default:e.RolesTab})),__vite__mapDeps([2,1,3,4,5]))),nve=(0,B.lazy)(()=>Y4(()=>import(`./InstancesTab-C2LweWWX.js`).then(e=>({default:e.InstancesTab})),__vite__mapDeps([6,1,3,7,8,9,10,11,12,13,14,15,16,5,17,18,19]))),rve=(0,B.lazy)(()=>Y4(()=>import(`./PromptInjectionsTab-Gwd3CkwY.js`).then(e=>({default:e.PromptInjectionsTab})),__vite__mapDeps([20,1,3,7,8,9,21,5,22]))),ive=(0,B.lazy)(()=>Y4(()=>import(`./GroupsTab-BitxCqvs.js`).then(e=>({default:e.GroupsTab})),__vite__mapDeps([23,1,3,13,12,24,19,14,5,17,25,15,16]))),ave=(0,B.lazy)(()=>Y4(()=>import(`./IntegrationsTab-C9agAKR0.js`).then(e=>({default:e.IntegrationsTab})),__vite__mapDeps([26,1,3,5]))),ove=(0,B.lazy)(()=>Y4(()=>import(`./FeedbacksTab-Cev0HZud.js`).then(e=>({default:e.FeedbacksTab})),__vite__mapDeps([27,1,3,19,12,14,5,17]))),sve=(0,B.lazy)(()=>Y4(()=>import(`./SubAgentReportsTab-DXymt-IL.js`).then(e=>({default:e.SubAgentReportsTab})),__vite__mapDeps([28,1,3,19,12,14,5,17]))),cve=(0,B.lazy)(()=>Y4(()=>import(`./FilesTab-kPVOWWll.js`).then(e=>({default:e.FilesTab})),__vite__mapDeps([29,1,3,5,17]))),lve=(0,B.lazy)(()=>Y4(()=>import(`./AgentFilesTab-C3K357SP.js`).then(e=>({default:e.AgentFilesTab})),__vite__mapDeps([30,1,3,11,8,5,22]))),K9=(0,B.lazy)(()=>Y4(()=>import(`./PreferencesTab-CQXSbXS3.js`).then(e=>({default:e.PreferencesTab})),__vite__mapDeps([31,1,3,21,9,5]))),uve=(0,B.lazy)(()=>Y4(()=>import(`./ChatDefaultsTab-Dew3JIDA.js`).then(e=>({default:e.ChatDefaultsTab})),__vite__mapDeps([32,1,3,11,5,22]))),dve=(0,B.lazy)(()=>Y4(()=>import(`./AccessTab-D0JX5_mH.js`).then(e=>({default:e.AccessTab})),__vite__mapDeps([33,1,3]))),fve=(0,B.lazy)(()=>Y4(()=>import(`./ThemeShowroom-B0VjVJkx.js`).then(e=>({default:e.ThemeShowroom})),__vite__mapDeps([34,1,3,35,24,36,12,16,5,15,21,9,37,17])));function pve(){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(dd,{children:(0,V.jsx)(`div`,{className:`oc-boot`,children:ki()})}),(0,V.jsx)(ud,{children:(0,V.jsx)(hve,{})}),(0,V.jsx)(ld,{children:(0,V.jsx)(BB,{children:(0,V.jsx)(_ve,{})})})]})}function mve(){return(0,V.jsxs)(`svg`,{className:`oc-provider__logo`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[(0,V.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,V.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,V.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,V.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function hve(){let{signIn:e}=jd();G9(void 0);let t=R(L.charts.brandForHost,{host:QR}),n=tz(QR),r=t??n??null,i=gz(void 0);vz(r?.tokens??null,i),(0,B.useEffect)(()=>{t&&nz(QR,t)},[t]);let a=r?.brand,o=a&&!a.isDefault?Tz(a,i):null,s=a?.label??`Atrium`,c=R(L.me.authProviders),[l,u]=(0,B.useState)(null);async function d(t){u(null);try{await e(t)}catch{u(oi())}}let f=c!==void 0&&!c.google&&!c.microsoft&&!c.anonymous;return(0,V.jsxs)(`div`,{className:`oc-signin`,children:[(0,V.jsxs)(`svg`,{className:`oc-signin__motif`,viewBox:`0 0 1200 1000`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,V.jsx)(`polyline`,{className:`oc-signin__line`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,vectorEffect:`non-scaling-stroke`}),(0,V.jsx)(`polyline`,{className:`oc-signin__pulse`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,pathLength:`100`,vectorEffect:`non-scaling-stroke`})]}),(0,V.jsxs)(`div`,{className:`oc-signin__brand`,children:[o?(0,V.jsx)(`img`,{className:`oc-signin__brandlogo`,src:o,alt:``}):null,(0,V.jsx)(`span`,{className:`oc-signin__wordmark`,children:s})]}),(0,V.jsxs)(`div`,{className:`oc-signin__card`,children:[(0,V.jsx)(`h1`,{className:`oc-signin__title`,children:ht()}),(0,V.jsx)(`p`,{className:`oc-signin__subtitle`,children:vi()}),(0,V.jsx)(`div`,{className:`oc-signin__providers`,children:c?.google?(0,V.jsxs)(`button`,{type:`button`,className:`oc-provider oc-provider--google`,onClick:()=>void d(`google`),children:[(0,V.jsx)(mve,{}),(0,V.jsx)(`span`,{children:ne()})]}):null}),l?(0,V.jsx)(`p`,{className:`oc-signin__error`,children:l}):null,f?(0,V.jsx)(`p`,{className:`oc-signin__error`,children:wu()}):null,c?.anonymous?(0,V.jsx)(`button`,{type:`button`,className:`oc-signin__dev`,onClick:()=>void e(`anonymous`),children:Er()}):null]})]})}function gve(){let{width:e,collapsed:t,isMobile:n}=w8();return(0,V.jsxs)(`div`,{className:`oc-shell`,children:[(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`1.75rem`,height:`1.75rem`}}),(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`5.5rem`,height:`1.1rem`}})]}),(0,V.jsx)(`div`,{className:`oc-topbar__search`,children:(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`100%`,height:`2.25rem`}})}),(0,V.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,V.jsx)(`div`,{className:`oc-skel`,style:{width:`1.75rem`,height:`1.75rem`,borderRadius:`999px`}})})]}),(0,V.jsxs)(`div`,{className:n?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[!t&&!n?(0,V.jsx)(`div`,{className:`oc-sidebar-col`,style:{width:e,flex:`0 0 ${e}px`},children:(0,V.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,V.jsx)(`div`,{className:`oc-skel`,style:{height:`2.25rem`,margin:`0.25rem 0.25rem 0`}}),(0,V.jsx)(y9,{})]})}):null,(0,V.jsx)(`main`,{className:`oc-main`})]})]})}function _ve(){let e=R(L.me.getMe,{host:QR}),t=nu(L.me.bootstrap),n=Um();(0,B.useEffect)(()=>{e&&!e.hasProfile&&t()},[e,t]),G9(e?.resolvedThemeMode);let r=gz(e?.resolvedThemeMode);vz(e?.resolvedChartTokens,r),eve(e?.resolvedLocale);let i=(0,B.useRef)(null);if((0,B.useEffect)(()=>{e&&(i.current!==null&&i.current!==e.userId&&n({to:`/`}),i.current=e.userId)},[e,n]),e===void 0)return(0,V.jsx)(gve,{});let a=e.name||e.email||sn();return e.role===`pending`?(0,V.jsxs)(`div`,{className:`oc-shell`,children:[(0,V.jsx)(q9,{}),(0,V.jsx)(w9,{}),(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsx)(`span`,{className:`oc-topbar__brand`,children:(0,V.jsx)(J9,{brand:e.resolvedChartBrand,resolvedThemeMode:e.resolvedThemeMode})}),(0,V.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,V.jsx)(T9,{label:a,mode:e.themeMode,minimal:!0})})]}),(0,V.jsxs)(`div`,{className:`oc-pending`,children:[(0,V.jsx)(`h1`,{className:`oc-pending__title`,children:kt()}),(0,V.jsx)(`p`,{className:`oc-pending__body`,children:Xe()})]})]}):(0,V.jsx)(yve,{canOpenSettings:j9(e.permissions??[]).length>0,userLabel:a,themeMode:e.themeMode,resolvedThemeMode:e.resolvedThemeMode,brand:e.resolvedChartBrand},e.userId)}function q9(){let e=R(L.me.getImpersonation),t=nu(L.admin.stopImpersonation);return!e||!e.impersonating?null:(0,V.jsxs)(`div`,{className:`oc-imp`,role:`alert`,children:[(0,V.jsx)(mb,{className:`size-4 shrink-0`}),(0,V.jsxs)(`span`,{className:`oc-imp__text`,children:[ir(),` `,(0,V.jsx)(`strong`,{children:e.targetLabel}),Mn(),(0,V.jsx)(`strong`,{children:e.realLabel}),bn()]}),(0,V.jsx)(Ju,{size:`sm`,variant:`outline`,className:`oc-imp__exit`,onClick:()=>void t(),children:ps()})]})}function J9({brand:e,resolvedThemeMode:t}){let n=gz(t),r=e?.label??`Atrium`,i=e?.isDefault??!0,a=Tz(e,n),[o,s]=(0,B.useState)(!1);return(0,B.useEffect)(()=>s(!1),[a]),(0,V.jsxs)(V.Fragment,{children:[a!==null&&!o?(0,V.jsx)(`img`,{className:`oc-brand__logo`,src:a,alt:``,"aria-hidden":`true`,onError:()=>s(!0)}):i?(0,V.jsx)(kz,{className:`oc-brand__logo`}):null,(0,V.jsx)(`span`,{className:`oc-brand__label`,children:r})]})}function vve({userLabel:e,themeMode:t,resolvedThemeMode:n,brand:r,collapsed:i,onToggleSidebar:a}){return(0,V.jsxs)(`header`,{className:`oc-topbar`,children:[(0,V.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,V.jsx)(Ju,{variant:`ghost`,size:`icon-sm`,"aria-label":i?T():Ts(),onClick:a,children:i?(0,V.jsx)(Ib,{}):(0,V.jsx)(Fb,{})}),(0,V.jsx)(rh,{to:`/`,className:`oc-topbar__brand`,children:(0,V.jsx)(J9,{brand:r,resolvedThemeMode:n})})]}),(0,V.jsx)(`div`,{className:`oc-topbar__search`,children:(0,V.jsx)(k_e,{})}),(0,V.jsxs)(`div`,{className:`oc-topbar__actions`,children:[(0,V.jsx)(E_e,{}),(0,V.jsx)(T9,{label:e,mode:t})]})]})}function yve({canOpenSettings:e,userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i}){let{width:a,collapsed:o,toggleCollapsed:s,collapse:c,startResize:l,isMobile:u}=w8(),d=See(),f=Vm({strict:!1}),p=Um(),m=!!d({to:`/settings`,fuzzy:!0});(0,B.useEffect)(()=>{u&&c()},[_h({select:e=>e.pathname}),u,c]);let h=(0,B.useCallback)(e=>{p({to:`/chat/$chatId`,params:{chatId:e}})},[p]),{startNewChat:g,picker:_}=b_e(h),v=(0,B.useMemo)(()=>lz(iz,cz()),[]);return(0,B.useEffect)(()=>{let e=e=>{uz(e,iz)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]),(0,V.jsxs)(`div`,{className:`oc-shell`,children:[_,(0,V.jsx)(q9,{}),(0,V.jsx)(w9,{}),(0,V.jsx)(vve,{userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i,collapsed:o,onToggleSidebar:s}),(0,V.jsxs)(`div`,{className:u?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[u&&!o?(0,V.jsx)(`div`,{className:`oc-sidebar-backdrop`,onClick:c,"aria-hidden":!0}):null,o?null:(0,V.jsxs)(`div`,{className:`oc-sidebar-col`,style:u?void 0:{width:a,flex:`0 0 ${a}px`},children:[m?(0,V.jsx)(z_e,{}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(y_e,{activeChatId:f.chatId??null,onSelect:h,onNewChat:()=>void g(),newChatShortcut:v}),e?(0,V.jsx)(Ju,{variant:`ghost`,className:`m-2 justify-start`,asChild:!0,children:(0,V.jsx)(rh,{to:`/settings`,children:Wn()})}):null]}),(0,V.jsx)(`div`,{className:`oc-sidebar-resizer`,onPointerDown:l,role:`separator`,"aria-orientation":`vertical`,"aria-label":De()})]}),(0,V.jsx)(`main`,{className:`oc-main`,children:(0,V.jsx)(gh,{})})]})]})}function bve(){let e=R(L.me.getMe,{host:QR}),t=Um(),n=_h({select:e=>e.pathname}),r=(0,B.useMemo)(()=>e?j9(e.permissions??[]):[],[e]),i=e!==void 0&&r.length===0;if((0,B.useEffect)(()=>{i&&t({to:`/`})},[i,t]),e===void 0)return(0,V.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:ki()});if(i)return null;let a=N9(n),o=a!==void 0&&!r.includes(a);return(0,V.jsxs)(`div`,{className:`oc-admin`,children:[(0,V.jsx)(R_e,{}),(0,V.jsx)(`div`,{className:`oc-admin__body`,children:o?(0,V.jsx)(xve,{}):(0,V.jsx)(gh,{})})]})}function xve(){return(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(Yb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:Le()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Jr()})]})}function Sve(){let e=R(L.me.getMe,{host:QR}),t=Um();return(0,B.useEffect)(()=>{if(e===void 0)return;let n=j9(e.permissions??[]);t({to:n.includes(`files`)?M9(`files`):n.length>0?M9(n[0]):`/`,replace:!0})},[e,t]),(0,V.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:ki()})}function Cve(e){switch(e){case`groups`:return(0,V.jsx)(ive,{});case`integrations`:return(0,V.jsx)(ave,{});case`instances`:return(0,V.jsx)(nve,{});case`injections`:return(0,V.jsx)(rve,{});case`theme`:return(0,V.jsx)(fve,{});case`feedbacks`:return(0,V.jsx)(ove,{});case`subagentReports`:return(0,V.jsx)(sve,{});case`files`:return(0,V.jsx)(cve,{});case`agentFiles`:return(0,V.jsx)(lve,{});case`preferences`:return(0,V.jsx)(K9,{});case`chatDefaults`:return(0,V.jsx)(uve,{});case`access`:return(0,V.jsx)(dve,{});default:return(0,V.jsx)(tve,{})}}function wve(){let{tab:e}=Vm({from:`/settings/$tab`});return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`}),children:Cve(e)})}function Tve(){let{chatId:e}=Vm({from:`/chat/$chatId`}),{m:t}=Hm({from:`/chat/$chatId`});return(0,B.useEffect)(()=>{One(e)},[e]),(0,V.jsx)(n5,{chatId:e,focusMessageId:t??null})}function Eve(){let e=Um(),t=kne(),n=R(L.messages.listChats,{}),r=t!==null&&n!==void 0&&n.some(e=>e._id===t);return(0,B.useEffect)(()=>{r&&t&&e({to:`/chat/$chatId`,params:{chatId:t},replace:!0})},[r,t,e]),t!==null&&(n===void 0||r)?(0,V.jsx)(`div`,{className:`oc-boot`,children:ki()}):(0,V.jsx)(n5,{chatId:null})}var Y9=ch({component:pve}),Dve=oh({getParentRoute:()=>Y9,path:`/`,component:Eve}),Ove=oh({getParentRoute:()=>Y9,path:`chat/$chatId`,component:Tve,validateSearch:e=>({m:typeof e.m==`string`?e.m:void 0})}),X9=oh({getParentRoute:()=>Y9,path:`settings`,component:bve}),kve=oh({getParentRoute:()=>X9,path:`/`,component:Sve}),Ave=oh({getParentRoute:()=>X9,path:`traces`,validateSearch:K_e,component:lh(()=>Y4(()=>import(`./TracesTab-CfJUlNIH.js`),__vite__mapDeps([38,1,3,13,12,35,24,19,14,5,17,36,16,15])),`TracesTab`)}),jve=oh({getParentRoute:()=>X9,path:`bridge`,validateSearch:$_e,component:lh(()=>Y4(()=>import(`./BridgeTab-hb74bUWf.js`),__vite__mapDeps([10,1,3,11,7,8,9,12,13,14,15,16,5,17,18])),`BridgeTab`)}),Mve=oh({getParentRoute:()=>X9,path:`voice`,validateSearch:Q_e,component:lh(()=>Y4(()=>import(`./VoiceTab-Bt3Lxg8m.js`),__vite__mapDeps([39,1,3,13,12,5,22])),`VoiceTab`)}),Nve=oh({getParentRoute:()=>X9,path:`audit`,validateSearch:q_e,component:lh(()=>Y4(()=>import(`./AuditTab-Dya-8fsa.js`),__vite__mapDeps([40,1,3,19,12,14,5,17,36,24,16,15])),`AuditTab`)}),Pve=oh({getParentRoute:()=>X9,path:`anomalies`,validateSearch:J_e,component:lh(()=>Y4(()=>import(`./AnomaliesTab-DrZDQWE-.js`),__vite__mapDeps([41,1,3,19,12,14,5,17,15,16,18])),`AnomaliesTab`)}),Fve=oh({getParentRoute:()=>X9,path:`kpi`,validateSearch:Y_e,component:lh(()=>Y4(()=>import(`./KpiTab-EJ3olSOM.js`),__vite__mapDeps([42,1,3,16,5,37])),`KpiTab`)}),Ive=oh({getParentRoute:()=>X9,path:`serviceAccounts`,validateSearch:X_e,component:lh(()=>Y4(()=>import(`./ServiceAccountsTab-CoF3np7F.js`),__vite__mapDeps([43,1,3,12,35,19,14,5,17,15,16,4])),`ServiceAccountsTab`)}),Lve=oh({getParentRoute:()=>X9,path:`users`,validateSearch:Z_e,component:lh(()=>Y4(()=>import(`./UsersTab-DGaxkYl7.js`),__vite__mapDeps([44,1,3,19,12,14,5,17,25,15,16])),`UsersTab`)}),Rve=oh({getParentRoute:()=>X9,path:`uiprefs`,beforeLoad:()=>{throw rp({to:`/settings/$tab`,params:{tab:j_e.uiprefs},replace:!0})}}),zve=oh({getParentRoute:()=>X9,path:`$tab`,parseParams:e=>({tab:Cy([...O9]).catch(`roles`).parse(e.tab)}),component:wve});function Bve({error:e,reset:t}){let n=Um(),r=Ane(e),[i]=(0,B.useState)(()=>r&&Nne(Date.now()));return(0,B.useEffect)(()=>{i&&window.location.reload()},[i]),i?(0,V.jsx)(`div`,{className:`oc-route-error`,role:`status`,children:(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Vl()})}):(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(Yb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:me()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:zr()}),(0,V.jsxs)(`div`,{className:`oc-route-error__actions`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>{r?window.location.reload():t()},children:eu()}),(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta oc-route-error__cta--ghost`,onClick:()=>void n({to:`/`}),children:Fa()})]})]})}function Vve(){let e=Um();return(0,V.jsxs)(`div`,{className:`oc-route-error`,role:`status`,children:[(0,V.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,V.jsx)(cb,{size:28})}),(0,V.jsx)(`h2`,{className:`oc-route-error__title`,children:du()}),(0,V.jsx)(`p`,{className:`oc-route-error__body`,children:Al()}),(0,V.jsx)(`div`,{className:`oc-route-error__actions`,children:(0,V.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>void e({to:`/`}),children:Fa()})})]})}var Z9=wee({routeTree:Y9.addChildren([Dve,Ove,X9.addChildren([kve,Ave,Mve,jve,Nve,Pve,Fve,Ive,Lve,Rve,zve])]),defaultPreload:`intent`,defaultErrorComponent:Bve,defaultNotFoundComponent:Vve}),Hve=()=>null;function Q9({children:e}){return(0,V.jsx)(`div`,{style:{display:`flex`,minHeight:`100vh`,alignItems:`center`,justifyContent:`center`,padding:`2rem`,textAlign:`center`,font:`14px system-ui, sans-serif`,opacity:.6},children:e})}var $9=fd.createRoot(document.getElementById(`root`));$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(Q9,{children:Sc()})})),DV().then(e=>{let t=new Ml(e);$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(Md,{client:t,children:(0,V.jsxs)(NB,{children:[(0,V.jsx)(Ome,{children:(0,V.jsx)(Dee,{router:Z9})}),(0,V.jsx)(B.Suspense,{fallback:null,children:(0,V.jsx)(Hve,{router:Z9,position:`bottom-right`})})]})})}))}).catch(e=>{console.error(`Boot failed:`,e),$9.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsxs)(Q9,{children:[Wl(),` `,e instanceof Error?e.message:String(e)]})}))});export{xB as $,wH as A,Jb as At,WB as B,mb as Bt,j6 as C,bP as Ct,S6 as D,WM as Dt,_fe as E,YM as Et,ZB as F,Vb as Ft,AB as G,rb as Gt,FB as H,db as Ht,HB as I,kb as It,kB as J,Hm as Jt,jB as K,tb as Kt,GB as L,wb as Lt,KV as M,Wb as Mt,IV as N,Ub as Nt,T6 as O,Xb as Ot,JB as P,Hb as Pt,yB as Q,QB as R,Cb as Rt,N6 as S,SP as St,r3 as T,XM as Tt,IB as U,lb as Ut,VB as V,fb as Vt,SB as W,ob as Wt,EB as X,DB as Y,OB as Z,X6 as _,cz as _t,U_e as a,gB as at,k6 as b,QR as bt,k9 as c,Hz as ct,z8 as d,Vz as dt,bB as et,I8 as f,zz as ft,$6 as g,hz as gt,Z6 as h,gz as ht,W_e as i,hB as it,EH as j,qb as jt,TH as k,Yb as kt,A9 as l,Pz as lt,e8 as m,Bz as mt,V_e as n,pB as nt,G_e as o,fB as ot,r8 as p,Rz as pt,TB as q,Um as qt,H_e as r,mB as rt,A_e as s,Wz as st,R9 as t,dB as tt,c9 as u,Lz as ut,Q6 as v,pz as vt,A6 as w,xP as wt,M6 as x,CP as xt,Ype as y,lz as yt,KB as z,yb as zt};