@lacneu/atrium 0.87.0 → 0.87.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 (78) hide show
  1. package/dist/assets/AccessTab-BjWb2utN.js +1 -0
  2. package/dist/assets/{AdvancedFilter-DHhZAptC.js → AdvancedFilter-ksMf6bcD.js} +1 -1
  3. package/dist/assets/AgentFilesTab-DAHA88Tu.js +3 -0
  4. package/dist/assets/AnomaliesTab-CVua97lJ.js +1 -0
  5. package/dist/assets/AuditTab-hTs6iFsI.js +1 -0
  6. package/dist/assets/BridgeTab-DPbj0zcY.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-CdYRaOgV.js +1 -0
  8. package/dist/assets/{DataTableShell-DoTsQFjZ.js → DataTableShell-K5cImuMP.js} +1 -1
  9. package/dist/assets/{DetailChips-B3snpzri.js → DetailChips-Xge7xE-L.js} +1 -1
  10. package/dist/assets/FeedbacksTab-CvTz752R.js +1 -0
  11. package/dist/assets/{FieldLabel-CL1-4y9n.js → FieldLabel-DVWzsIR3.js} +1 -1
  12. package/dist/assets/FilesTab-BOw97zky.js +1 -0
  13. package/dist/assets/{FilterBar-X_wz_owJ.js → FilterBar-DLMcpn_E.js} +1 -1
  14. package/dist/assets/GroupsTab-D5ycprxr.js +1 -0
  15. package/dist/assets/InstancesTab-TaKSA8bY.js +1 -0
  16. package/dist/assets/IntegrationsTab-D59mPoaZ.js +1 -0
  17. package/dist/assets/KpiTab-1Hx_0Uao.js +1 -0
  18. package/dist/assets/PreferencesTab-3cXC4S1l.js +1 -0
  19. package/dist/assets/ProjectPage-nBPDSUUX.js +1 -0
  20. package/dist/assets/PromptInjectionsTab-BHhqTYDk.js +4 -0
  21. package/dist/assets/RolesTab-DWR9sNW0.js +1 -0
  22. package/dist/assets/ScheduledTab-R_UJhAFC.js +1 -0
  23. package/dist/assets/ServiceAccountsTab-CJoq437S.js +1 -0
  24. package/dist/assets/{SubAgentReportsTab-CA10l1S0.js → SubAgentReportsTab-DCrEW3GB.js} +1 -1
  25. package/dist/assets/ThemeShowroom-BePky4K4.js +1 -0
  26. package/dist/assets/{TimeRangePicker-BlFrDLB9.js → TimeRangePicker-BIobKXvm.js} +1 -1
  27. package/dist/assets/{TimezoneCombobox-BA3O6eZs.js → TimezoneCombobox-C_pawxor.js} +1 -1
  28. package/dist/assets/TracesTab-l-lueZac.js +1 -0
  29. package/dist/assets/UsersTab-CNvCzpBh.js +1 -0
  30. package/dist/assets/VoiceTab-LihfD0So.js +1 -0
  31. package/dist/assets/{api-D2Ea_rY6.js → api-CnXjOprV.js} +5 -5
  32. package/dist/assets/{button-C9c-3Njl.js → button-C7mIcWuE.js} +1 -1
  33. package/dist/assets/{card-COkNbPw9.js → card-D96d_4Et.js} +1 -1
  34. package/dist/assets/chevrons-up-down-CPB13Hhb.js +1 -0
  35. package/dist/assets/{compatView-0pkLFCNc.js → compatView-D2UZENK3.js} +1 -1
  36. package/dist/assets/dispatchErrorInfo-Ct8igIIE.js +1 -0
  37. package/dist/assets/{dist-BZt5yEXf.js → dist-CLt4MJ3r.js} +1 -1
  38. package/dist/assets/{dist-Chlu3Bel.js → dist-CNXx0sNo.js} +1 -1
  39. package/dist/assets/{dist-BSFr9rqq.js → dist-CU23SxxP.js} +1 -1
  40. package/dist/assets/{highlighted-body-OFNGDK62-CFhvI6xT.js → highlighted-body-OFNGDK62-CO9Mn_bf.js} +1 -1
  41. package/dist/assets/index-0t8eOneo.js +327 -0
  42. package/dist/assets/{index-CGoAo2H9.css → index-CURSwr6F.css} +1 -1
  43. package/dist/assets/{list-s8ElIDmd.js → list-PsjK33SL.js} +1 -1
  44. package/dist/assets/mermaid-GHXKKRXX-BxbNoi0T.js +1 -0
  45. package/dist/assets/{pdf-vrIUMkQk.js → pdf-jxqL4Jk_.js} +1 -1
  46. package/dist/assets/roleDescriptions-Bm8ptI3N.js +1 -0
  47. package/dist/assets/{table-D53vcOfn.js → table-CXJLU3m_.js} +1 -1
  48. package/dist/assets/x-Cd7Svlfj.js +1 -0
  49. package/dist/index.html +8 -8
  50. package/package.json +1 -1
  51. package/dist/assets/AccessTab-Cet_7r4V.js +0 -1
  52. package/dist/assets/AgentFilesTab-CTVR-pkS.js +0 -3
  53. package/dist/assets/AnomaliesTab-D7G9MCKb.js +0 -1
  54. package/dist/assets/AuditTab-CvwLRlTd.js +0 -1
  55. package/dist/assets/BridgeTab-CHIycJYg.js +0 -1
  56. package/dist/assets/ChatDefaultsTab-CWn54thx.js +0 -1
  57. package/dist/assets/FeedbacksTab-CGi92YyC.js +0 -1
  58. package/dist/assets/FilesTab-C1tAhkG0.js +0 -1
  59. package/dist/assets/GroupsTab-94Iw4jm-.js +0 -1
  60. package/dist/assets/InstancesTab-BNLNA4nb.js +0 -1
  61. package/dist/assets/IntegrationsTab-B3XCA4gw.js +0 -1
  62. package/dist/assets/KpiTab-BsOfR6tT.js +0 -1
  63. package/dist/assets/PreferencesTab-DKNZOBCb.js +0 -1
  64. package/dist/assets/ProjectPage-tdnC61Ri.js +0 -1
  65. package/dist/assets/PromptInjectionsTab-DpKasFs0.js +0 -4
  66. package/dist/assets/RolesTab-khMDI9wl.js +0 -1
  67. package/dist/assets/ScheduledTab-BYaln2ef.js +0 -1
  68. package/dist/assets/ServiceAccountsTab-D05azDp2.js +0 -1
  69. package/dist/assets/ThemeShowroom-CO51flds.js +0 -1
  70. package/dist/assets/TracesTab-C2UAlrlk.js +0 -1
  71. package/dist/assets/UsersTab-CFQ3xcc2.js +0 -1
  72. package/dist/assets/VoiceTab-CwEPSCNl.js +0 -1
  73. package/dist/assets/chevrons-up-down-Dwka889E.js +0 -1
  74. package/dist/assets/dispatchErrorInfo-dLN4uvIx.js +0 -1
  75. package/dist/assets/index-BzSSRi03.js +0 -327
  76. package/dist/assets/mermaid-GHXKKRXX-BC4jheGw.js +0 -1
  77. package/dist/assets/roleDescriptions-CzH2X2DX.js +0 -1
  78. package/dist/assets/x-CkieWYrV.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$R as r,AR as i,Az as a,BR as o,CR as s,Cz as ee,DR as te,Dz as ne,EG as re,ER as c,Ez as ie,FR as l,Fz as ae,GR as oe,HR as se,IR as u,Iz as ce,JR as le,KR as ue,LR as d,Lz as de,MR as f,Mz as p,NR as m,Nz as fe,OG as h,OR as pe,Oz as me,PR as he,Pz as ge,QR as _e,RR as ve,SR as g,Sz as ye,TR as _,Tz as be,UR as xe,VR as Se,WR as Ce,XR as we,YR as Te,ZR as Ee,_R as v,_z as De,az as Oe,bR as y,bz as ke,cz as Ae,dz as je,ez as Me,fz as Ne,gz as Pe,hz as Fe,iz as Ie,jR as b,jz as x,kG as S,kR as C,kz as Le,lz as Re,mz as ze,nz as Be,oz as Ve,pz as He,qR as Ue,rz as We,sz as Ge,t as w,tz as Ke,uz as qe,vR as T,vz as Je,wR as E,wz as Ye,xR as D,xz as Xe,yR as O,yz as Ze,zR as k}from"./api-D2Ea_rY6.js";import{r as Qe}from"./dist-BSFr9rqq.js";import{t as A}from"./button-C9c-3Njl.js";import{At as j,Ft as M,Gn as $e,Kn as et,Ln as N,Un as P,Vn as tt,_ as nt,at as F,ct as I,dt as L,et as R,ft as z,it as B,jt as rt,lt as V,nt as H,ot as it,q as at,rt as U,st as ot,tt as W,ut as G}from"./index-BzSSRi03.js";import{t as st}from"./FilterBar-X_wz_owJ.js";import{t as ct}from"./DataTableShell-DoTsQFjZ.js";import{t as lt}from"./roleDescriptions-CzH2X2DX.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>s(),days:null},{value:`30`,label:()=>g(),days:30},{value:`90`,label:()=>D(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=et({from:`/settings/serviceAccounts`}),t=$e({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[o,s]=(0,K.useState)(X),te=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),c=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),l=S(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:i===X?void 0:i===`disabled`}}),u=S(w.apiKeys.listKeys,{}),d=S(w.apiKeys.listRoles,{}),f=h(w.apiKeys.createServiceAccount),m=h(w.apiKeys.updateServiceAccount),pe=h(w.apiKeys.deleteServiceAccount),he=re(w.apiKeys.mintApiKey),ve=h(w.apiKeys.revokeApiKey),g=at(),_=rt(),v=n!==``||o!==X||i!==X;function y(){s(X),t({search:{},replace:!0})}let[b,C]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Z),[D,O]=(0,K.useState)(null),[k,N]=(0,K.useState)(new Set),[P,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[L,z]=(0,K.useState)(new Set),[V,it]=(0,K.useState)({}),[ot,G]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[u]);function Q(e){N(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await m({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),_.success(Ke())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),O(null),C(!1)}catch(e){_.error(D?Be():We(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),C(!0)}async function mt(e){if(I.current)return;I.current=!0;let t=V[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await he({serviceAccountId:e._id,expiresAt:r});G({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(Me(),e)}finally{I.current=!1,F(null)}}async function $(e){if(await g({title:r(),description:(0,q.jsxs)(q.Fragment,{children:[_e(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ee(),` `,(0,q.jsx)(`strong`,{children:we()}),` `,Te()]}),confirmWord:e.name,confirmLabel:le(),destructive:!0}))try{await pe({serviceAccountId:e._id}),_.success(Ue(),e.name)}catch(e){_.error(ue(),e)}}async function ht(e){if(await g({title:oe(),description:(0,q.jsxs)(q.Fragment,{children:[Ce(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,xe()]}),confirmLabel:se(),destructive:!0})&&!L.has(e._id)){z(t=>new Set(t).add(e._id));try{await ve({keyId:e._id})}catch(e){_.error(Se(),e)}finally{z(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:de()}),(0,q.jsxs)(st,{q:n,onQChange:te,searchPlaceholder:ce(),onReset:y,canReset:v,children:[(0,q.jsxs)(R,{value:o,onValueChange:s,children:[(0,q.jsx)(U,{size:`sm`,className:`w-40`,children:(0,q.jsx)(B,{placeholder:ae()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(H,{value:X,children:ge()}),(d??[]).map(e=>(0,q.jsx)(H,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(R,{value:i,onValueChange:c,children:[(0,q.jsx)(U,{size:`sm`,className:`w-36`,children:(0,q.jsx)(B,{})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(H,{value:X,children:fe()}),(0,q.jsx)(H,{value:`active`,children:p()}),(0,q.jsx)(H,{value:`disabled`,children:x()})]})]})]}),(0,q.jsx)(ct,{title:a(),rows:l,addLabel:Le(),onAdd:()=>{E(Z),O(null),C(!0)},emptyHint:me(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:L}),rowActions:e=>[...(e.managedBy??null)===null?[{label:Ye(),onSelect:()=>pt(e)},{label:ne(),onSelect:()=>void mt(e)}]:[],{label:k.has(e._id)?ie():be(),onSelect:()=>Q(e._id)},...(e.managedBy??null)===null?[{label:ee(),variant:`destructive`,onSelect:()=>void $(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ye():Xe(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,q.jsx)(Qe,{}):(0,q.jsx)(tt,{})})},{header:ke(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ze(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(j,{variant:`secondary`,children:e.roleKey})},{header:Je(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(j,{variant:`destructive`,children:x()}):(0,q.jsx)(j,{variant:`outline`,children:p()})},{header:De(),cell:e=>(0,q.jsxs)(R,{value:V[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(U,{size:`sm`,className:`w-32`,children:(0,q.jsx)(B,{})}),(0,q.jsx)(W,{children:J.map(e=>(0,q.jsx)(H,{value:e.value,children:e.label()},e.value))})]})},{header:Pe(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:P===e._id?Fe():ze({count:t})})}}]}),(0,q.jsx)(nt,{open:b,onOpenChange:e=>{C(e),e||O(null)},title:D?He():qe(),description:D?Ne():Re(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?je():Ae(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ge()}),(0,q.jsx)(M,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ve()}),(0,q.jsxs)(R,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(U,{className:`w-full`,children:(0,q.jsx)(B,{placeholder:Oe()})}),(0,q.jsx)(W,{children:(d??[]).map(e=>(0,q.jsxs)(H,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(d??[]).find(e=>e.key===T.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ie()}),(0,q.jsx)(M,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:ot,onClose:()=>G(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[o(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:ve()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:he()}),(0,q.jsx)(`th`,{children:m()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(j,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:z(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,q.jsx)(A,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?f():b()}):null})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function a(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(F,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(it,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(V,{children:[(0,q.jsx)(G,{children:i()}),(0,q.jsx)(ot,{children:C({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:pe()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void a(),"aria-label":te(),children:[n?(0,q.jsx)(P,{}):(0,q.jsx)(N,{}),n?c():_()]})]}),(0,q.jsx)(I,{children:(0,q.jsx)(A,{onClick:()=>{r(!1),t()},children:E()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?y():z(e)}function mt(e){return e===null?`—`:L(e)}function $(e){return e.disabled?(0,q.jsx)(j,{variant:`destructive`,children:O()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(j,{variant:`outline`,children:T()}):(0,q.jsx)(j,{variant:`outline`,children:v()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$B as r,AB as i,AV as a,BB as o,BV as s,CV as c,DB as l,DV as u,EB as d,EG as f,EV as p,FB as m,FV as h,GB as g,GV as _,HB as v,HV as ee,IB as te,IV as y,JB as ne,KB as re,KV as ie,LB as ae,LV as oe,MB as b,MV as se,NB as ce,NV as le,OB as x,OG as S,OV as ue,PB as de,PV as fe,QB as pe,RB as me,RV as he,SV as ge,TB as _e,TV as ve,UB as ye,UV as be,VB as xe,VV as Se,WB as C,WV as Ce,XB as we,YB as Te,ZB as Ee,_G as De,_V as Oe,aV as ke,af as Ae,bV as je,cV as Me,cf as w,dV as Ne,eV as Pe,fV as Fe,gG as Ie,gV as Le,hV as Re,iV as ze,jB as Be,jV as Ve,kB as He,kG as T,kV as Ue,lV as E,mV as We,nV as Ge,oV as Ke,of as qe,pV as Je,qB as Ye,r as Xe,rV as Ze,sV as Qe,sf as D,t as O,tV as $e,uV as et,vG as tt,vV as nt,wB as rt,wV as it,xV as at,yV as ot,zB as st,zV as ct}from"./api-D2Ea_rY6.js";import{t as k}from"./x-CkieWYrV.js";import{t as A}from"./button-C9c-3Njl.js";import{At as j,Bt as M,Fn as N,Ft as P,In as lt,It as ut,Lt as dt,Rt as F,Un as I,Vt as ft,X as pt,Y as mt,Z as L,et as R,it as z,ln as B,mt as V,nt as H,rt as U,tt as W,zt as ht}from"./index-BzSSRi03.js";import{t as gt}from"./localePickerView-C2RmOS86.js";import{a as _t,i as vt,n as yt,o as bt,r as xt,t as St}from"./card-COkNbPw9.js";import{a as Ct,i as G,n as wt,o as K,r as q,t as Tt}from"./table-D53vcOfn.js";import{t as Et}from"./TimeRangePicker-BlFrDLB9.js";import{t as Dt}from"./FilterBar-X_wz_owJ.js";import{t as Ot}from"./AdvancedFilter-DHhZAptC.js";var J=t(e(),1),kt=.1,At=[248,248,248],jt=[24,24,24];function Mt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Nt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function Pt(e,t,n){return Nt(e,t,n)>=kt}function Ft(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function It(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Ye());if(e.size>Lt)throw Error(re());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(C());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Mt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(C());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);Pt(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?At:jt):It(e.data),p.putImageData(e,0,0)}let m=Pt(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(ye());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return Ut(e)}async function Ut(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(g())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?tt():e===`dark`?De():Ie()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Xe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(I,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,X.jsx)(lt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=T(O.charts.listMyCharts),r=S(O.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:y(),subtitle:h(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?fe():n.via===`owner`?le():se({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()}):null]})}function Qt(){let e=S(O.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(E())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(Qe());return}let a;try{a=JSON.parse(r)}catch{o(E());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Re()}),(0,X.jsx)(P,{value:t,onChange:e=>n(e.target.value),placeholder:We(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Fe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(B,{className:`size-4`}),Ne(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:l,onClick:()=>void f(),children:et()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Me()}):null]})]})}function $t({chart:e}){let t=f(O.charts.setChartLogo),n=S(O.charts.removeChartLogo),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Vt(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function p(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function m({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Pe():r()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(B,{className:`size-4`}),t?Ee():pe(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void p(e),children:Te()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void d(e),children:we()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:$e()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(m,{mode:`light`}),(0,X.jsx)(m,{mode:`dark`})]}),i?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function en({chart:e}){let t=T(O.me.getMe,{host:L}),n=S(O.charts.addChartDomain),r=S(O.charts.removeChartDomain),[i,a]=(0,J.useState)(``),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=i.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:v()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:me()}):d.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ae({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{value:i,onChange:e=>a(e.target.value),placeholder:o(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:st()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:xe()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=S(O.charts.updateChart),n=S(O.charts.deleteChart),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(e.name),[s,c]=(0,J.useState)(()=>$(e.tokens)),[l,u]=(0,J.useState)(e.tokens.bpm??0),[d,f]=(0,J.useState)(null),[p,h]=(0,J.useState)(!1);function g(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function _(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(b()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:g,children:Ze()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:Ge()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:de()}),(0,X.jsx)(P,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:D()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":D()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?qe():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ce()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:p,onClick:()=>void _(),children:te()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:m()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=T(O.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=S(O.charts.addChartToGroupPool),r=S(O.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?c():e.kind===`custom`&&e.scope===`personal`?x():it()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:ge()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:je()}),(a??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":nt({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(U,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:ot()})}),(0,X.jsx)(W,{children:s.map(e=>(0,X.jsx)(H,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}):null]})]})}function an({chart:e}){let t=S(O.charts.promoteChartToCommon),n=S(O.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(b()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?l():x()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:d()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:_e()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=S(O.admin.setDefaultThemeMode),o=S(O.admin.setDefaultLocale),c=S(O.charts.setDefaultChart),l=T(O.charts.listChartsAdmin),d=T(O.groups.listGroups,{}),f=e??`system`,m=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:a()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ue()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void c({name:null}),children:y()}),pt.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void c({name:e.key}),children:e.name},e.key)),(l??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void c({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:u()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:d??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:p()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(()=>{let e=(l??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:gt().map(e=>(0,X.jsx)(A,{variant:m===e.value?`default`:`outline`,size:`sm`,onClick:()=>void o({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]})]})}function sn(){let e=T(O.me.getMe,{host:L}),t=mt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Se()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(P,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(U,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(H,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(H,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(V,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(Dt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(U,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes directions`}),(0,X.jsx)(H,{value:`inbound`,children:`inbound`}),(0,X.jsx)(H,{value:`outbound`,children:`outbound`}),(0,X.jsx)(H,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(U,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(H,{value:`info`,children:`info`}),(0,X.jsx)(H,{value:`warn`,children:`warn`}),(0,X.jsx)(H,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(Ot,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Et,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ut,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(dt,{align:`start`,children:[(0,X.jsx)(ht,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(St,{className:`w-80`,children:[(0,X.jsxs)(_t,{children:[(0,X.jsx)(bt,{children:`Instance`}),(0,X.jsx)(xt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(yt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(vt,{className:`gap-2`,children:[(0,X.jsx)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Tt,{children:[(0,X.jsx)(Ct,{children:(0,X.jsxs)(K,{children:[(0,X.jsx)(G,{className:`w-8`,children:(0,X.jsx)(V,{"aria-label":`select all`})}),(0,X.jsx)(G,{children:`Name`}),(0,X.jsx)(G,{children:`Mode`}),(0,X.jsx)(G,{className:`text-right`,children:`Status`}),(0,X.jsx)(G,{className:`w-8`})]})}),(0,X.jsx)(wt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(K,{children:[(0,X.jsx)(q,{children:(0,X.jsx)(V,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(q,{className:`font-medium`,children:e.n}),(0,X.jsx)(q,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(q,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(I,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(q,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,$N as i,AE as a,AP as o,BE as s,CP as c,D as l,DP as u,EP as d,FE as f,GE as p,GN as m,HE as h,HN as g,Hc as _,IE as v,JE as ee,JN as te,KE as ne,KN as y,LE as re,ME as ie,NE as ae,OE as b,OG as x,OP as S,PE as oe,QE as C,QN as w,RE as se,SP as T,TP as ce,UE as le,UN as ue,Uc as de,VE as fe,VN as pe,Vc as me,WE as he,WN as ge,XE as _e,XN as ve,YE as ye,YN as E,ZE as be,ZN as D,_P as O,aD as xe,bP as k,cD as Se,cP as A,dD as Ce,dP as j,eD as we,eP as Te,fP as M,gP as Ee,hP as De,iD as Oe,jE as ke,kE as Ae,kG as N,kP as je,lD as Me,lP as Ne,mP as Pe,nD as Fe,oD as Ie,oP as Le,pP as Re,qE as ze,qN as Be,rD as Ve,sD as He,sP as P,t as F,tD as Ue,tP as We,uD as Ge,uP as Ke,vP as I,wP as qe,xP as Je,yP as Ye,zE as Xe}from"./api-D2Ea_rY6.js";import{t as Ze}from"./x-CkieWYrV.js";import{t as L}from"./button-C9c-3Njl.js";import{At as R,G as Qe,Gn as $e,K as z,Kn as et,Ln as tt,Nn as nt,Pn as rt,U as it,Un as at,W as B,Z as ot,a as st,at as ct,et as V,ft as H,i as lt,it as U,kn as ut,lt as dt,nt as W,o as ft,ot as pt,pt as mt,rt as G,s as ht,st as gt,tt as K,ut as _t,z as vt}from"./index-BzSSRi03.js";import{n as yt}from"./TimeRangePicker-BlFrDLB9.js";import{t as bt}from"./FilterBar-X_wz_owJ.js";import{t as xt}from"./AdvancedFilter-DHhZAptC.js";import{t as St}from"./DataTableShell-DoTsQFjZ.js";var Ct=l(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?j():n===`agent`?`${Ke()} - ${r}`:e}function Tt(){let e=N(F.me.getMe,{host:ot})?.role===`admin`,t=N(F.deliveryTiming.getDeliveryStatus,{}),n=x(F.deliveryTiming.startDeliveryRecord),r=x(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[s,l]=(0,q.useState)(!1),f=t?.recording??!1,p=async()=>{l(!0);try{f?await r({}):await n({})}finally{l(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:o()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:je()})]}),e?(0,J.jsx)(L,{variant:f?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void p(),children:f?u():S()}):null]}),f?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(R,{variant:`secondary`,children:d()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:ce({time:mt(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?T():c()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(F.deliveryTiming.listDeliverySessions,{}),n=x(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[s,c]=(0,q.useState)(Y),[l,u]=(0,q.useState)(null),{from:d,to:f}=yt(s),p=s.to===`now`?1/0:f,m=r.trim()!==``||a!==`all`||s!==Y,h=()=>{i(``),o(`all`),c(Y)},_=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=d&&t.startedAt<=p).map(e=>({...e,_id:e.sessionId}))},[t,r,a,d,p]),v=e=>{let t=new Set((_??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),l!==null&&r.includes(l)&&u(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:k(),timeRange:s,onTimeRangeChange:c,onReset:h,canReset:m,children:(0,J.jsxs)(V,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(G,{size:`sm`,className:`w-36`,children:(0,J.jsx)(U,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(W,{value:`all`,children:Ye()}),(0,J.jsx)(W,{value:`active`,children:I()}),(0,J.jsx)(W,{value:`stopped`,children:O()})]})]})}),(0,J.jsx)(St,{title:Je(),rows:_,emptyHint:g(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(L,{variant:`ghost`,size:`icon`,"aria-label":l===e.sessionId?A():Ne(),onClick:()=>u(t=>t===e.sessionId?null:e.sessionId),children:l===e.sessionId?(0,J.jsx)(rt,{size:15,"aria-hidden":!0}):(0,J.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:Ee(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:H(e.startedAt)})},{header:De(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:H(e.stoppedAt)})},{header:Pe(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:Re(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:M(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(R,{variant:`secondary`,children:I()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:O()})}],rowActions:e?e=>[{label:P(),variant:`destructive`,onSelect:()=>v([e.sessionId])}]:void 0,bulkActions:e?[{label:P(),variant:`destructive`,onSelect:e=>v(e)}]:void 0,isExpanded:e=>e.sessionId===l,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(vt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Le()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:qe()});let r=e.segments,a=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,pe()]}),(0,J.jsxs)(L,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(at,{size:13,"aria-hidden":!0}):(0,J.jsx)(tt,{size:13,"aria-hidden":!0}),t?ue():ge()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:i()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:w()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:D()})]})}),(0,J.jsxs)(`tbody`,{children:[a(ve(),r.bridge),a(E(),r.A),a(te(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Be()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:y()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:de()},{value:`principalType`,label:_()},{value:`direction`,label:`direction`},{value:`roleKey`,label:me()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=et({from:`/settings/traces`}),t=$e({from:`/settings/traces`}),n=e.limit,i=e.kind,a=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,u=e.q??``,d=e.correlationId,m=lt(e.from,e.to),g=(0,q.useMemo)(()=>ht(e.adv),[e.adv]),{from:_,to:te}=yt(m),[y,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),T=e=>void t({search:t=>({...t,kind:e})}),ce=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),pe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),me=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ge=e=>void t({search:t=>({...t,...ft(e)})}),ve=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),E=N(F.observability.listEvents,{limit:n}),D=N(F.observability.listEvents,{limit:n,kind:i===Z?void 0:i,...d?{correlationId:d}:{},filter:{q:u||void 0,from:_,to:te,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:g.length>0?g:void 0}}),O=(0,q.useMemo)(()=>{let e=new Set;for(let t of E??[])e.add(t.kind);return[...e].sort()},[E]),k=(0,q.useMemo)(()=>{let e=new Set;for(let t of E??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[E]),A=u!==``||a!==Q||o!==Q||c!==Q||l!==Q||g.length>0||m.kind!==`relative`||m.from!==Nt.from;function j(){t({search:{limit:100,kind:`all`},replace:!0})}let M=y?E?.filter(e=>e.correlationId===y):D,Ee=e.section,De=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(it,{value:Ee,onValueChange:e=>De(e),children:[(0,J.jsxs)(Qe,{className:`w-full`,children:[(0,J.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(ut,{size:13,"aria-hidden":!0}),We()]}),(0,J.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Te()]})]}),(0,J.jsx)(B,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ce(),(0,J.jsx)(`strong`,{children:Ge()}),Me(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Se()})]}),(0,J.jsxs)(bt,{q:u,onQChange:ce,searchPlaceholder:He(),timeRange:m,onTimeRangeChange:ge,onReset:j,canReset:A,children:[(0,J.jsxs)(V,{value:a,onValueChange:ue,children:[(0,J.jsx)(G,{size:`sm`,className:`w-32`,children:(0,J.jsx)(U,{placeholder:Ie()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(W,{value:Q,children:xe()}),At.map(e=>(0,J.jsx)(W,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:o,onValueChange:de,children:[(0,J.jsx)(G,{size:`sm`,className:`w-32`,children:(0,J.jsx)(U,{placeholder:Oe()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(W,{value:Q,children:Ve()}),jt.map(e=>(0,J.jsx)(W,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:c,onValueChange:pe,children:[(0,J.jsx)(G,{size:`sm`,className:`w-32`,children:(0,J.jsx)(U,{placeholder:Fe()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(W,{value:Q,children:Ue()}),Mt.map(e=>(0,J.jsx)(W,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:l,onValueChange:me,children:[(0,J.jsx)(G,{size:`sm`,className:`w-36`,children:(0,J.jsx)(U,{placeholder:we()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(W,{value:Q,children:r()}),k.map(e=>(0,J.jsx)(W,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:i===Z?``:i,placeholder:C(),"aria-label":C(),onChange:e=>{let t=e.target.value.trim();T(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:O.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(V,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,J.jsx)(G,{size:`sm`,className:`w-28`,children:(0,J.jsx)(U,{})}),(0,J.jsx)(K,{children:kt.map(e=>(0,J.jsx)(W,{value:String(e),children:be({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:g,onChange:ve}),y?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:_e(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ye(),(0,J.jsx)(`code`,{children:$(y)})]}),(0,J.jsx)(Ze,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:ee()})]})}):null,(0,J.jsx)(St,{title:ze(),rows:M,emptyHint:y?ne():p(),columns:[{header:he(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:H(e.at)})},{header:le(),sort:e=>e.kind,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.kind})},{header:h(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":fe(),children:`✓`})}},{header:s(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(R,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Xe(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(R,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:se(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:re(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:v(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:f(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:oe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ae(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ie(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>S(e),children:ke()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:x,onClose:()=>S(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(ct,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(pt,{className:`max-w-lg`,children:[(0,J.jsxs)(dt,{children:[(0,J.jsxs)(_t,{className:`oc-traces__meta-title`,children:[a(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(R,{variant:`outline`,children:Ae()})]}),(0,J.jsx)(gt,{children:b()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$j as r,Aj as i,BT as a,Bj as o,Fj as s,GT as c,Gj as l,HT as u,Hj as d,Ij as f,JT as p,Jj as ee,KT as m,Kj as h,Lj as te,Mj as ne,Nj as re,OG as g,Pj as _,QT as v,Qj as ie,Rj as ae,UT as y,Uj as oe,VT as b,Vj as se,WT as x,Wj as ce,XT as S,Xj as le,YT as C,Yj as ue,ZT as w,Zj as de,__ as T,eM as fe,g_ as E,jj as pe,kG as D,kj as me,nM as O,qT as k,qj as he,rM as A,t as j,tM as M,uj as ge,v_ as N,zj as _e}from"./api-D2Ea_rY6.js";import{t as P}from"./button-C9c-3Njl.js";import{At as F,Gn as I,It as L,J as ve,Kn as ye,Lt as be,Rt as xe,Vt as Se,Z as Ce,at as we,c as R,et as z,fn as B,it as V,jt as H,l as Te,lt as Ee,mn as U,mt as W,nt as G,ot as De,q as Oe,rt as K,st as ke,tt as q,u as J,ut as Ae,zt as je}from"./index-BzSSRi03.js";import{t as Me}from"./FilterBar-X_wz_owJ.js";import{t as Ne}from"./DataTableShell-DoTsQFjZ.js";import{t as Pe}from"./DetailChips-B3snpzri.js";var Y=t(e(),1),X=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=D(j.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=D(j.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,l=s?`${s.instanceName}/${s.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!u.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],f=new Map;for(let e of d){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,X.jsx)(we,{open:n,onOpenChange:r,children:(0,X.jsxs)(De,{className:`oc-access`,children:[(0,X.jsxs)(Ee,{children:[(0,X.jsx)(Ae,{children:v({user:t})}),(0,X.jsx)(ke,{children:w()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?S():C()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:p()}):d.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:c()}):[...f.entries()].map(([t,n])=>(0,X.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:o}){let s=g(j.agents.assignAgent),c=g(j.agents.removeAgent),l=g(j.agents.setDefaultAgent),d=H();if(!e)return null;async function f(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(k(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(m(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(U,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(F,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),s=o===n,c=e.state===`deleted`,l=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,X.jsx)(W,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":x({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,X.jsx)(F,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,e.outOfPool?(0,X.jsx)(F,{variant:`outline`,className:`oc-access__gone`,children:u()}):null,r?s?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":b(),title:b(),children:(0,X.jsx)(B,{size:14,fill:`currentColor`})}):(0,X.jsx)(P,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":a(),title:a(),disabled:l,onClick:()=>void p(e.agentId),children:(0,X.jsx)(B,{size:14})}):null]},e.agentId)})]})}var Z=`__all__`;function Q(e){switch(e){case`pending`:return E();case`user`:return T();case`admin`:return N();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=R.filter(e=>n.has(J[e])).length;return(0,X.jsxs)(L,{children:[(0,X.jsx)(Se,{asChild:!0,children:(0,X.jsx)(P,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?A():O({count:r})})}),(0,X.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,X.jsx)(je,{children:M()}),R.map(e=>{let r=J[e];return(0,X.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(W,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:Te[e]()})]},e)})]})]})}function $(){let e=ye({from:`/settings/users`}),t=I({from:`/settings/users`}),n=e.q??``,a=e.role??Z,c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,role:e===Z?void 0:e})}),p=D(j.admin.listUsers,{filter:{q:n||void 0,role:a===Z?void 0:a},withAgents:!0}),m=D(j.me.getMe,{host:Ce}),v=g(j.admin.setRole),y=g(j.admin.setUserPermissions),b=g(j.admin.startImpersonation),x=g(j.admin.deleteUser),S=g(j.admin.setUserName),C=Oe(),w=ve(),T=H(),[E,O]=(0,Y.useState)(null),k=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of p??[])e.add(t.role);return[...e]},[p]),A=n!==``||a!==Z;function M(){t({search:{},replace:!0})}async function N(e){try{await v(e)}catch(e){T.error(fe(),e)}}async function P(e){try{await y(e)}catch(e){T.error(r(),e)}}async function F(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:h(),description:l({user:t}),confirmWord:ce(),confirmLabel:oe(),destructive:!0}))try{await x({profileId:e._id}),T.success(se({user:t}))}catch(e){T.error(d(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:_e(),label:ae({user:t}),placeholder:te(),defaultValue:e.name??``,confirmLabel:ge()});if(n!==null)try{await S({profileId:e._id,name:n}),T.success(f())}catch(e){T.error(s(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{q:n,onQChange:c,searchPlaceholder:ie(),onReset:M,canReset:A,children:(0,X.jsxs)(z,{value:a,onValueChange:u,children:[(0,X.jsx)(K,{size:`sm`,className:`w-36`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(q,{children:[(0,X.jsx)(G,{value:Z,children:de()}),k.map(e=>(0,X.jsx)(G,{value:e,children:Q(e)},e))]})]})}),(0,X.jsx)(Ne,{title:le(),rows:p,emptyHint:ue(),rowActions:e=>{let t=[{label:me(),onSelect:()=>O({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:o(),onSelect:()=>void L(e)}];return e.userId!==m?.userId&&t.push({label:ee(),onSelect:()=>void b({profileId:e._id})},{label:he(),variant:`destructive`,onSelect:()=>void F(e)}),t},columns:[{header:_(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:re(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(z,{value:e.role,onValueChange:t=>void N({profileId:e._id,role:t}),children:[(0,X.jsx)(K,{size:`sm`,className:`w-28`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(q,{children:[(0,X.jsx)(G,{value:`pending`,children:Q(`pending`)}),(0,X.jsx)(G,{value:`user`,children:Q(`user`)}),(0,X.jsx)(G,{value:`admin`,children:Q(`admin`)})]})]})},{header:ne(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:pe()}):(0,X.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),P({profileId:e._id,permissions:[...n]})}})},{header:i(),cell:e=>(0,X.jsx)(Pe,{icon:(0,X.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Fe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||O(null)}})]})}export{$ as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Ag as i,Bo as a,Bs as o,Do as ee,EG as te,Eo as ne,Gs as re,Hs as s,Jo as c,Js as l,Ks as u,Lo as d,Ls as f,Mo as p,No as m,OG as h,Oo as ie,Po as g,Qs as _,Ro as v,Rs as y,SG as b,Us as x,Vo as S,Vs as C,Ws as w,Xs as ae,Ys as oe,Zs as se,ac as ce,ah as le,bG as T,ec as ue,ic as de,jo as fe,kG as E,ko as D,mo as pe,nc as O,oc as me,qs as he,rc as k,sN as A,sc as j,sh as M,t as N,tc as P,zo as F,zs as I}from"./api-D2Ea_rY6.js";import{t as L}from"./button-C9c-3Njl.js";import{$t as R,At as z,G as ge,Gn as _e,K as B,Kn as ve,U as ye,W as V,Wn as be,Z as xe,an as Se,en as Ce,et as H,in as U,it as W,mt as G,nn as we,nt as K,rn as q,rt as J,sn as Y,tn as Te,tt as X,wn as Ee}from"./index-BzSSRi03.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>ue()],[`fr-FR`,()=>S()],[`en-US`,()=>a()],[`en-GB`,()=>F()],[`de-DE`,()=>v()],[`es-ES`,()=>d()]],Oe=[[`0.75`,()=>_()],[`1`,()=>se()],[`1.25`,()=>ae()],[`1.5`,()=>oe()]],$=0;function ke({instance:e}){let t=h(N.admin.upsertInstanceConfig),n=e.config??{},a={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[o,s]=(0,Z.useState)(a),[c,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(!1),_=te(N.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{s({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),d(`idle`)},[e._id]);let v=o.enabled!==a.enabled||o.engine!==a.engine||o.lang!==a.lang||o.rate!==a.rate||o.autoRead!==a.autoRead;async function y(){d(`saving`);try{let n={...e.config??{}};n.voiceEnabled=o.enabled,o.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,o.lang===`auto`?delete n.voiceLang:n.voiceLang=o.lang;let r=Number.parseFloat(o.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,o.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),d(`idle`)}catch{d(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(z,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:o.enabled,onCheckedChange:e=>s({...o,enabled:e===!0}),"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,Q.jsxs)(H,{value:o.engine,onValueChange:e=>s({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":D(),children:(0,Q.jsx)(W,{})}),(0,Q.jsxs)(X,{children:[(0,Q.jsx)(K,{value:`browser`,children:ie()}),e.kind===`hermes`?null:(0,Q.jsx)(K,{value:`gateway`,children:ee()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()}):null,o.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:P()}),(0,Q.jsxs)(H,{value:o.lang,onValueChange:e=>s({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":P(),children:(0,Q.jsx)(W,{})}),(0,Q.jsx)(X,{children:De.map(([e,t])=>(0,Q.jsx)(K,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,Q.jsxs)(H,{value:o.rate,onValueChange:e=>s({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(W,{})}),(0,Q.jsx)(X,{children:Oe.map(([e,t])=>(0,Q.jsx)(K,{value:e,children:t()},e))})]})]}),o.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:o.autoRead,onCheckedChange:e=>s({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":l()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:he()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(L,{size:`sm`,disabled:!v||c===`saving`,onClick:()=>void y(),children:c===`saving`?i():M()}),(0,Q.jsx)(L,{variant:`outline`,size:`sm`,disabled:!o.enabled||f,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(g(!1),U(),q(),o.engine!==`gateway`){we(w(),{lang:Te(o.lang,b()),rate:t});return}p(!0),_({instanceName:e.name,text:w()}).then(({mime:e,audioBase64:r})=>{n===$&&Ce(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>p(!1))},children:f?i():u()}),(0,Q.jsx)(L,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),U(),q()},children:re()})]}),c===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?pe():le()}):null]})}function Ae({stt:e}){let t=E(N.me.getMe,{host:xe}),n=h(N.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:s()}),(0,Q.jsx)(z,{variant:e?`secondary`:`outline`,children:e?y():f()}),(0,Q.jsx)(z,{variant:r?`secondary`:`destructive`,children:r?m():p()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:C()})]})}function je(){let e=E(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Se(),[]),n=(0,Z.useMemo)(()=>R(),[]),{section:r}=ve({from:`/settings/voice`}),i=_e({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(z,{variant:t?`secondary`:`destructive`,children:t?me():ce()}),(0,Q.jsx)(z,{variant:n?`secondary`:`destructive`,children:n?de():k()})]}),(0,Q.jsxs)(ye,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(ge,{className:`w-full`,children:[(0,Q.jsxs)(B,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Y,{size:13,"aria-hidden":!0}),fe()]}),(0,Q.jsxs)(B,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ee,{size:13,"aria-hidden":!0}),s()]}),(0,Q.jsxs)(B,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),o()]})]}),(0,Q.jsx)(V,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(V,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(V,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:o()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=h(N.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(z,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:c()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":A()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./api-D2Ea_rY6.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +0,0 @@
1
- import{Ay as e,Cy as t,Da as n,Dy as r,Ey as i,Fy as a,Iy as o,My as s,Ny as c,Oa as l,Oy as u,Py as d,Sy as f,Ty as p,_y as m,ay as h,by as g,ci as _,cy as v,di as y,dy as b,fy as x,gy as S,hy as C,iy as w,jy as T,ky as E,li as D,ly as O,my as k,ni as A,ny as j,oi as M,oy as N,py as P,ri as F,ry as I,si as L,sy as R,ui as z,uy as B,vy as V,wy as H,xy as U,yy as W}from"./api-D2Ea_rY6.js";var G={AGENT_NOT_FOUND:()=>({label:o(),hint:a()}),AUTH_TOKEN_MISMATCH:()=>({label:d(),hint:c()}),DEVICE_SIGNING_FAILED:()=>({label:s(),hint:T()}),SESSION_SCOPE_DENIED:()=>({label:e(),hint:E()}),GATEWAY_TIMEOUT:()=>({label:u(),hint:r()}),GATEWAY_DISCONNECTED:()=>({label:i(),hint:p()}),GATEWAY_RESTARTING:()=>({label:H(),hint:t()}),CONNECTION_SATURATED:()=>({label:f(),hint:U()}),DISPATCH_STALLED:()=>({label:l(),hint:n()}),ATTACHMENT_TOO_LARGE:()=>({label:V(),hint:m()}),ATTACHMENT_REJECTED:()=>({label:S(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:g(),hint:W()}),INVALID_REQUEST:()=>({label:k(),hint:P()}),chat_request_conflict:()=>({label:x(),hint:b()}),NOT_CONFIGURED:()=>({label:B(),hint:O()}),UNROUTED:()=>({label:v(),hint:R()}),attachment_name_too_long:()=>({label:F(),hint:A()}),attachment_path_refused:()=>({label:y(),hint:z()}),attachment_staging_failed:()=>({label:D(),hint:_()}),attachment_cleanup_unconfirmed:()=>({label:L(),hint:M()}),UPSTREAM_ERROR:()=>({label:N(),hint:h()}),UNKNOWN:()=>({label:w(),hint:I()})};function K(e){return e?G[e]?.()??{label:e,hint:j()}:G.UNKNOWN()}export{K as t};