@lacneu/atrium 0.62.2 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/assets/AccessTab-CAsqZ6Oe.js +1 -0
  2. package/dist/assets/AdvancedFilter-CAZse6g9.js +1 -0
  3. package/dist/assets/AgentFilesTab-BRgTx-O-.js +3 -0
  4. package/dist/assets/AnomaliesTab-QOz38Dl8.js +1 -0
  5. package/dist/assets/AuditTab-a5iD6OvB.js +1 -0
  6. package/dist/assets/BridgeTab-De8R_lT4.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-BOt-jkMY.js +1 -0
  8. package/dist/assets/DataTableShell-NMYUihjL.js +1 -0
  9. package/dist/assets/DetailChips-2kEsgn1k.js +1 -0
  10. package/dist/assets/FeedbacksTab-CdqQtSm1.js +1 -0
  11. package/dist/assets/{FieldLabel-z7bxzKHq.js → FieldLabel-C647EVei.js} +2 -2
  12. package/dist/assets/FilesTab-DKocgIqP.js +1 -0
  13. package/dist/assets/FilterBar-DHVMse_G.js +1 -0
  14. package/dist/assets/GroupsTab-CBVya3O8.js +1 -0
  15. package/dist/assets/InstancesTab-DaFyjZeq.js +1 -0
  16. package/dist/assets/IntegrationsTab-s2Ug2twA.js +1 -0
  17. package/dist/assets/KpiTab-Bxe5EM3h.js +1 -0
  18. package/dist/assets/PreferencesTab-D150a7hV.js +1 -0
  19. package/dist/assets/ProjectPage-BvCAGro7.js +1 -0
  20. package/dist/assets/ProjectPage-LzMKBi2V.css +1 -0
  21. package/dist/assets/PromptInjectionsTab-DcP-BjeV.js +4 -0
  22. package/dist/assets/RolesTab-DgNPzDM1.js +1 -0
  23. package/dist/assets/ScheduledTab-xwd7u-vS.js +1 -0
  24. package/dist/assets/ServiceAccountsTab-BPH6depc.js +1 -0
  25. package/dist/assets/SubAgentReportsTab-BPYm-SSC.js +1 -0
  26. package/dist/assets/ThemeShowroom-DfNiNZX7.js +1 -0
  27. package/dist/assets/TimeRangePicker-Dtw6LWMh.js +1 -0
  28. package/dist/assets/TracesTab-yLnuqGC_.js +1 -0
  29. package/dist/assets/UsersTab-CopN-6p5.js +1 -0
  30. package/dist/assets/VoiceTab-C0oik6ML.js +1 -0
  31. package/dist/assets/{button-BtQwDeC7.js → button-Bz9USCnz.js} +1 -1
  32. package/dist/assets/{card-BbBjwTkQ.js → card-DKADL750.js} +1 -1
  33. package/dist/assets/check-Wm4Ks3tL.js +1 -0
  34. package/dist/assets/chevron-up-BFinjgRw.js +1 -0
  35. package/dist/assets/chevrons-up-down-DKu9IjDi.js +1 -0
  36. package/dist/assets/{compatView-BvZyYwOM.js → compatView-BHdx-XYA.js} +1 -1
  37. package/dist/assets/{dispatchErrorInfo-CjAxcZ1X.js → dispatchErrorInfo-oI5p4wEL.js} +1 -1
  38. package/dist/assets/dist-DiGkpPjG.js +1 -0
  39. package/dist/assets/dist-_9JGogtQ.js +44 -0
  40. package/dist/assets/{dist-CHUv7VZU.js → dist-xYoBFyN7.js} +1 -1
  41. package/dist/assets/{highlighted-body-OFNGDK62-D3YWtB-x.js → highlighted-body-OFNGDK62-DSCsm23K.js} +1 -1
  42. package/dist/assets/index-CjUx3yzx.css +1 -0
  43. package/dist/assets/index-DIc5ekpE.js +238 -0
  44. package/dist/assets/mermaid-GHXKKRXX-BsmnBvV3.js +1 -0
  45. package/dist/assets/{pdf-BAfFGrd0.js → pdf-D0Fddibm.js} +1 -1
  46. package/dist/assets/roleDescriptions-5AP7N2O_.js +1 -0
  47. package/dist/assets/{table-C9PafBK9.js → table-C8QBboJq.js} +1 -1
  48. package/dist/assets/{tabs-CQ2rDwF5.js → tabs-DSFq9Jhc.js} +1 -1
  49. package/dist/assets/x-CfJhGjMr.js +1 -0
  50. package/dist/index.html +9 -8
  51. package/package.json +1 -1
  52. package/dist/assets/AccessTab-C0DMrq_T.js +0 -1
  53. package/dist/assets/AdvancedFilter-CjfYhQlT.js +0 -1
  54. package/dist/assets/AgentFilesTab-Vt7ogGL4.js +0 -3
  55. package/dist/assets/AnomaliesTab-Bl8B8nuQ.js +0 -1
  56. package/dist/assets/AuditTab-Jv3VbFgH.js +0 -1
  57. package/dist/assets/BridgeTab-BURazhGl.js +0 -1
  58. package/dist/assets/ChatDefaultsTab-A2iJG8ZL.js +0 -1
  59. package/dist/assets/DataTableShell-zzaGmfMk.js +0 -1
  60. package/dist/assets/DetailChips-DNNrvZqq.js +0 -1
  61. package/dist/assets/FeedbacksTab-ChZeDaM6.js +0 -1
  62. package/dist/assets/FilesTab-jc4m4WW7.js +0 -1
  63. package/dist/assets/FilterBar-DRRfKRTQ.js +0 -1
  64. package/dist/assets/GroupsTab-HTPhJMAF.js +0 -1
  65. package/dist/assets/InstancesTab-DUwMvn_C.js +0 -1
  66. package/dist/assets/IntegrationsTab-2PvwRR8s.js +0 -1
  67. package/dist/assets/KpiTab-D4aTV56S.js +0 -1
  68. package/dist/assets/PreferencesTab-LYojtSoz.js +0 -1
  69. package/dist/assets/PromptInjectionsTab-DN8RscNv.js +0 -4
  70. package/dist/assets/RolesTab-BexLEI7q.js +0 -1
  71. package/dist/assets/ScheduledTab-Cm1PSyqy.js +0 -1
  72. package/dist/assets/ServiceAccountsTab-Krm3IzaJ.js +0 -1
  73. package/dist/assets/SubAgentReportsTab-DJNmIHbP.js +0 -1
  74. package/dist/assets/ThemeShowroom-CN7-gPFJ.js +0 -1
  75. package/dist/assets/TimeRangePicker-BPVkrNZN.js +0 -1
  76. package/dist/assets/TracesTab-BTN0YBPo.js +0 -1
  77. package/dist/assets/UsersTab-CclKbkrB.js +0 -1
  78. package/dist/assets/VoiceTab-DS6LrGiz.js +0 -1
  79. package/dist/assets/chevrons-up-down-ImFHIr_N.js +0 -1
  80. package/dist/assets/dist-BCNlHm__.js +0 -1
  81. package/dist/assets/dist-CNZ9o3sc.js +0 -44
  82. package/dist/assets/dist-VGy3W8j2.js +0 -1
  83. package/dist/assets/index-9R1hg_pA.js +0 -238
  84. package/dist/assets/index-jScX6cAP.css +0 -2
  85. package/dist/assets/mermaid-GHXKKRXX-DM0jE2ZW.js +0 -1
  86. package/dist/assets/roleDescriptions-DGSYA21e.js +0 -1
  87. package/dist/assets/x-BR1chqO3.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AP as r,BN as i,BP as a,CP as o,D as s,DN as c,FI as l,FN as ee,FP as te,GN as u,HN as d,HP as f,IN as ne,IP as p,JN as m,KN as re,LN as ie,MP as ae,NN as oe,NP as se,OP as ce,PN as le,PP as ue,RN as de,RP as fe,SP as pe,T as h,UN as me,VN as he,VP as ge,WN as _e,XN as ve,YN as ye,_F as be,_P as xe,aF as Se,bP as Ce,cF as we,cP as Te,dF as Ee,dP as De,fF as Oe,fP as g,gF as ke,gP as Ae,hF as je,hP as _,jI as v,jP as Me,kI as y,kP as Ne,lF as Pe,lP as Fe,mF as Ie,mP as b,oF as Le,oP as x,pF as Re,pP as S,qN as ze,sF as Be,sP as Ve,uF as He,uP as C,vF as Ue,vP as We,wP as Ge,xP as Ke,yF as qe,yP as Je,zN as Ye,zP as Xe}from"./dist-_9JGogtQ.js";import{t as Ze}from"./check-Wm4Ks3tL.js";import{t as w}from"./chevrons-up-down-DKu9IjDi.js";import{t as T}from"./button-Bz9USCnz.js";import{$ as Qe,At as E,Ct as $e,Dt as D,Et as O,Mn as k,Ot as A,St as et,Tt as j,X as tt,Y as nt,_t as M,at as rt,bn as it,bt as at,cn as ot,et as st,gt as N,in as ct,it as lt,jn as P,jt as F,kt as I,mn as ut,nt as dt,ot as ft,pn as pt,qt as mt,rt as ht,tn as gt,tt as _t,un as vt,vt as yt,wt as L,xt as bt,yt as xt}from"./index-DIc5ekpE.js";import{a as St,i as R,n as Ct,o as wt,r as z,t as Tt}from"./table-C8QBboJq.js";import{t as Et}from"./FilterBar-DHVMse_G.js";var Dt=s(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Ot=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),B=t(e(),1);function V(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function kt(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var At={q:``,state:`all`,result:`all`};function jt(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function Mt(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&kt(e.enabled)!==t.state||t.result!==`all`&&V(e.lastRunStatus)!==t.result)}function H(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function U(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function W(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function G(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function K(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function q(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var J=n();function Nt({value:e,onChange:t,className:n}){let r=(0,B.useMemo)(()=>H(),[]),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(``);if(r.length===0)return(0,J.jsx)(M,{value:e,onChange:e=>t(e.target.value),placeholder:U()||`America/Toronto`,className:n});let c=W(r,o,60,e||void 0),l=e===``?U()||g():e;return(0,J.jsxs)(L,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":_(),children:[(0,J.jsx)(`span`,{className:`oc-tzcombo__value`,children:l}),(0,J.jsx)(w,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,J.jsxs)(j,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,J.jsx)(M,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:b(),className:`oc-tzcombo__search`}),(0,J.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:c.length===0?(0,J.jsx)(`p`,{className:`oc-tzcombo__empty`,children:S()}):c.map(n=>(0,J.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),a(!1),s(``)},children:[(0,J.jsx)(Ze,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,J.jsx)(`span`,{children:n})]},n))})]})]})}function Y(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Pt({value:e,onChange:t}){let n=q(e),r=(0,B.useMemo)(()=>new Date,[]),[i,a]=(0,B.useState)(()=>({year:n?.year??r.getFullYear(),month:n?.month??r.getMonth()})),[o,s]=(0,B.useState)(!1),c=(0,B.useMemo)(()=>Y(v()),[]),l=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{month:`long`,year:`numeric`}),[]),ee=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),te=G(i.year,i.month),u=n?.hour??9,d=n?.minute??0,f=(e,n,r,i,a)=>t(K(e,n,r,i,a)),ne=(e,t,n)=>{a({year:e,month:t}),f(e,t,n,u,d)},p=e=>{let t=new Date(i.year,i.month+e,1);a({year:t.getFullYear(),month:t.getMonth()})},m=n===null?C():ee.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,J.jsxs)(L,{open:o,onOpenChange:s,children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":De(),children:[(0,J.jsx)(Dt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,J.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:m})]})}),(0,J.jsxs)(j,{align:`start`,className:`oc-dtp__pop`,children:[(0,J.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,J.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":Fe(),onClick:()=>p(-1),children:(0,J.jsx)(k,{size:15,"aria-hidden":!0})}),(0,J.jsx)(`span`,{className:`oc-dtp__month`,children:l.format(new Date(i.year,i.month,1))}),(0,J.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":Te(),onClick:()=>p(1),children:(0,J.jsx)(P,{size:15,"aria-hidden":!0})})]}),(0,J.jsxs)(`div`,{className:`oc-dtp__grid`,children:[c.map((e,t)=>(0,J.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),te.map((e,t)=>{let i=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,J.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(i?` oc-dtp__day--sel`:``)+(a&&!i?` oc-dtp__day--today`:``),onClick:()=>ne(e.year,e.month,e.day),children:e.day},t)})]}),(0,J.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,J.jsxs)(D,{value:String(u),onValueChange:e=>f(i.year,i.month,n?.day??r.getDate(),Number(e),d),children:[(0,J.jsx)(E,{size:`sm`,"aria-label":Ve(),children:(0,J.jsx)(F,{})}),(0,J.jsx)(A,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,J.jsx)(I,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,J.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,J.jsxs)(D,{value:String(d),onValueChange:e=>f(i.year,i.month,n?.day??r.getDate(),u,Number(e)),children:[(0,J.jsx)(E,{size:`sm`,"aria-label":x(),children:(0,J.jsx)(F,{})}),(0,J.jsx)(A,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,J.jsx)(I,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}var X={minutes:6e4,hours:36e5,days:864e5};function Z(e){return e?.data?.code??`unknown`}function Ft({status:e}){switch(V(e)){case`ok`:return(0,J.jsx)(N,{variant:`secondary`,children:o()});case`error`:return(0,J.jsx)(N,{variant:`destructive`,children:pe()});case`running`:return(0,J.jsx)(N,{variant:`outline`,children:Ke()});case`other`:return(0,J.jsx)(N,{variant:`outline`,children:e});case`none`:return(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function Q(){let e=l(h.scheduled.listMyCrons),t=l(h.scheduled.getCronDetail),n=l(h.scheduled.listCronRuns),s=l(h.scheduled.updateCron),Te=l(h.scheduled.removeCron),De=l(h.scheduled.runCronNow),g=mt(),[_,Fe]=(0,B.useState)(null),[b,x]=(0,B.useState)(!1),[S,Ve]=(0,B.useState)(!1),[C,Ze]=(0,B.useState)(null),[w,O]=(0,B.useState)(null),[k,j]=(0,B.useState)(null),[P,L]=(0,B.useState)(null),[Dt,V]=(0,B.useState)(!1),[H,U]=(0,B.useState)(At),W=(0,B.useCallback)(async()=>{x(!0),Ve(!1);try{Fe(await e({}))}catch{Ve(!0)}finally{x(!1)}},[e]);(0,B.useEffect)(()=>{W()},[W]);let G=(0,B.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),K=(0,B.useRef)(null);(0,B.useEffect)(()=>{_!==null&&K.current!==null&&K.current.scrollIntoView({block:`center`})},[_]);let q=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),Y=async(e,t,n)=>{Ze(e);try{await t(),g.success(n),await W()}catch(e){g.toast({variant:`error`,title:p({code:Z(e)})})}finally{Ze(null)}},Q=(0,B.useRef)(0),$=(0,B.useRef)(0),It=async(e,t)=>{if(t.id===null)return;let r=++Q.current;j({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Q.current)return;j({name:t.name??t.id,entries:i})}catch(e){if(r!==Q.current)return;j(null),g.toast({variant:`error`,title:p({code:Z(e)})})}},Lt=async(e,n)=>{if(n.id===null)return;let r=++$.current;L({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%X.days===0?(s=String(e/X.days),c=`days`):e%X.hours===0?(s=String(e/X.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/X.minutes))),c=`minutes`))}if(r!==$.current)return;L(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==$.current)return;L(null),g.toast({variant:`error`,title:p({code:Z(e)})})}},Rt=async()=>{if(P===null)return;let e={};if(P.nameDirty&&P.name.trim()===``||P.messageDirty&&P.hasMessage&&P.message.trim()===``){g.toast({variant:`error`,title:oe()});return}if(P.nameDirty&&P.name.trim()!==``&&(e.name=P.name.trim()),P.scheduleDirty){if(P.scheduleKind===`cron`&&P.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:P.cronExpr.trim(),...P.tz.trim()===``?{}:{tz:P.tz.trim()}};else if(P.scheduleKind===`every`){let t=Number(P.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*X[P.everyUnit])})}else if(P.scheduleKind===`at`&&P.at!==``){let t=Date.parse(P.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(P.scheduleDirty&&e.schedule===void 0){g.toast({variant:`error`,title:le()});return}if(P.messageDirty&&P.hasMessage&&P.message.trim()!==``&&(e.message=P.message.trim()),Object.keys(e).length===0){L(null);return}let t=$.current;V(!0);try{await s({instanceName:P.instanceName,jobId:P.jobId,patch:e}),g.success(ze()),t===$.current&&L(null),await W()}catch(e){g.toast({variant:`error`,title:p({code:Z(e)})})}finally{V(!1)}},zt=_?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:qe()}),(0,J.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:()=>void W(),disabled:b,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,J.jsx)(ot,{size:14,"aria-hidden":!0}),Ue()]})]}),_!==null&&zt>0?(0,J.jsxs)(Et,{q:H.q,onQChange:e=>U(t=>({...t,q:e})),searchPlaceholder:Je(),onReset:()=>U(At),canReset:jt(H),children:[(0,J.jsxs)(D,{value:H.state,onValueChange:e=>U(t=>({...t,state:e})),children:[(0,J.jsx)(E,{size:`sm`,className:`w-40`,children:(0,J.jsx)(F,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(I,{value:`all`,children:We()}),(0,J.jsx)(I,{value:`active`,children:Se()}),(0,J.jsx)(I,{value:`paused`,children:Le()})]})]}),(0,J.jsxs)(D,{value:H.result,onValueChange:e=>U(t=>({...t,result:e})),children:[(0,J.jsx)(E,{size:`sm`,className:`w-40`,children:(0,J.jsx)(F,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(I,{value:`all`,children:xe()}),(0,J.jsx)(I,{value:`ok`,children:o()}),(0,J.jsx)(I,{value:`error`,children:pe()}),(0,J.jsx)(I,{value:`running`,children:Ke()}),(0,J.jsx)(I,{value:`none`,children:Ce()})]})]})]}):null,_===null?(0,J.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":b,children:S?be():y()}):(0,J.jsxs)(J.Fragment,{children:[S?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:be()}):null,_.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}):null,_.map(e=>{let t=e.jobs.filter(e=>Mt(e,H)),n=jt(H)&&e.jobs.length>0&&t.length===0;return(0,J.jsxs)(`section`,{style:{marginBottom:20},children:[_.length>1||e.error||!e.supported?(0,J.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,J.jsx)(N,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ie({code:e.error})}):e.jobs.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):n?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ae()}):(0,J.jsxs)(Tt,{children:[(0,J.jsx)(St,{children:(0,J.jsxs)(wt,{children:[(0,J.jsx)(R,{children:Oe()}),(0,J.jsx)(R,{children:Ee()}),(0,J.jsx)(R,{children:He()}),(0,J.jsx)(R,{children:Pe()}),(0,J.jsx)(R,{children:we()}),(0,J.jsx)(R,{children:Ge()}),(0,J.jsx)(R,{children:ve()})]})}),(0,J.jsx)(Ct,{children:t.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,i=C===r,o=e.manageSupported,c=e.kind===`openclaw`&&o;return(0,J.jsxs)(wt,{ref:t.id!==null&&t.id===G?K:void 0,"data-state":t.id!==null&&t.id===G?`selected`:void 0,children:[(0,J.jsx)(z,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Be()}),(0,J.jsx)(z,{children:(0,J.jsx)(N,{variant:`secondary`,children:t.agentId})}),(0,J.jsxs)(z,{className:`whitespace-nowrap`,children:[(0,J.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=nt(t.schedule),n=e===null?null:tt(e);return n===null?null:(0,J.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,J.jsx)(z,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:q.format(t.nextRunAtMs)}),(0,J.jsx)(z,{children:kt(t.enabled)===`active`?(0,J.jsx)(N,{variant:`secondary`,children:Se()}):kt(t.enabled)===`paused`?(0,J.jsx)(N,{variant:`outline`,children:Le()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,J.jsx)(z,{children:(0,J.jsx)(Ft,{status:t.lastRunStatus})}),(0,J.jsx)(z,{className:`whitespace-nowrap`,children:t.id===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):i?(0,J.jsx)(it,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,J.jsxs)(`span`,{className:`oc-cronactions`,children:[c?(0,J.jsx)(T,{variant:`ghost`,size:`icon-sm`,title:ge(),"aria-label":ge(),disabled:C!==null,onClick:()=>void Y(r,async()=>{let n=await De({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},te()),children:(0,J.jsx)(gt,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,J.jsx)(T,{variant:`ghost`,size:`icon-sm`,title:t.enabled?a():Xe(),"aria-label":t.enabled?a():Xe(),disabled:C!==null,onClick:()=>void Y(r,()=>s({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?ue():se()),children:t.enabled?(0,J.jsx)(ut,{size:14,"aria-hidden":!0}):(0,J.jsx)(vt,{size:14,"aria-hidden":!0})}):null,c?(0,J.jsx)(T,{variant:`ghost`,size:`icon-sm`,title:ye(),"aria-label":ye(),disabled:C!==null,onClick:()=>void Lt(e.instanceName,t),children:(0,J.jsx)(pt,{size:14,"aria-hidden":!0})}):null,c?(0,J.jsx)(T,{variant:`ghost`,size:`icon-sm`,title:m(),"aria-label":m(),disabled:C!==null,onClick:()=>void It(e.instanceName,t),children:(0,J.jsx)(Ot,{size:14,"aria-hidden":!0})}):null,o?(0,J.jsx)(T,{variant:`ghost`,size:`icon-sm`,title:fe(),"aria-label":fe(),disabled:C!==null,onClick:()=>O({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,J.jsx)(ct,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:je()})]},e.instanceName)}),zt>0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:c()}):null]}),(0,J.jsx)(Qe,{open:w!==null,onOpenChange:e=>{e||O(null)},children:(0,J.jsxs)(dt,{children:[(0,J.jsxs)(rt,{children:[(0,J.jsx)(ft,{children:Me()}),(0,J.jsx)(ht,{children:r({name:w?.name??``})})]}),(0,J.jsxs)(lt,{children:[(0,J.jsx)(_t,{children:Ne()}),(0,J.jsx)(st,{onClick:()=>{let e=w;O(null),e!==null&&Y(`${e.instanceName}:${e.jobId}`,()=>Te({instanceName:e.instanceName,jobId:e.jobId}),ae())},children:ce()})]})]})}),(0,J.jsx)(yt,{open:k!==null,onOpenChange:e=>{e||(Q.current++,j(null))},children:(0,J.jsxs)(xt,{style:{maxWidth:640},children:[(0,J.jsx)(et,{children:(0,J.jsx)($e,{children:re({name:k?.name??``})})}),k?.entries===null?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):k!==null&&k.entries.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):k===null?null:(0,J.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:k.entries.map((e,t)=>(0,J.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,J.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,J.jsx)(Ft,{status:e.status}),(0,J.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?q.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,J.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,J.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,J.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,J.jsx)(yt,{open:P!==null,onOpenChange:e=>{e||($.current++,L(null))},children:(0,J.jsxs)(xt,{className:`oc-cronedit`,children:[(0,J.jsxs)(et,{children:[(0,J.jsx)($e,{children:_e()}),(0,J.jsx)(at,{children:me()})]}),P===null?null:P.loading?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,J.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,J.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,J.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Oe()}),(0,J.jsx)(M,{value:P.name,maxLength:200,onChange:e=>L({...P,name:e.target.value,nameDirty:!0})})]}),(0,J.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,J.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:d()}),(0,J.jsxs)(D,{value:P.scheduleKind,onValueChange:e=>L({...P,scheduleKind:e,scheduleDirty:!0}),children:[(0,J.jsx)(E,{children:(0,J.jsx)(F,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(I,{value:`cron`,children:he()}),(0,J.jsx)(I,{value:`every`,children:i()}),(0,J.jsx)(I,{value:`at`,children:Ye()})]})]}),P.scheduleKind===`cron`?(0,J.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,J.jsx)(M,{value:P.cronExpr,onChange:e=>L({...P,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,J.jsx)(Nt,{value:P.tz,onChange:e=>L({...P,tz:e,scheduleDirty:!0})})]}):P.scheduleKind===`every`?(0,J.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,J.jsx)(M,{type:`number`,min:1,value:P.everyValue,onChange:e=>L({...P,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,J.jsxs)(D,{value:P.everyUnit,onValueChange:e=>L({...P,everyUnit:e,scheduleDirty:!0}),children:[(0,J.jsx)(E,{style:{maxWidth:160},children:(0,J.jsx)(F,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(I,{value:`minutes`,children:de()}),(0,J.jsx)(I,{value:`hours`,children:ie()}),(0,J.jsx)(I,{value:`days`,children:ne()})]})]})]}):(0,J.jsx)(Pt,{value:P.at,onChange:e=>L({...P,at:e,scheduleDirty:!0})})]}),P.hasMessage?(0,J.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,J.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:f()}),(0,J.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:P.message,onChange:e=>L({...P,message:e.target.value,messageDirty:!0})})]}):null]}),(0,J.jsxs)(bt,{children:[(0,J.jsx)(T,{variant:`ghost`,onClick:()=>L(null),children:Ne()}),(0,J.jsxs)(T,{onClick:()=>void Rt(),disabled:P===null||P.loading||Dt,children:[Dt?(0,J.jsx)(it,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,ee()]})]})]})})]})}export{Q as ScheduledTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$k as i,AA as ee,BA as te,CA as ne,DA as re,EA as ie,FA as ae,FI as oe,GA as se,HA as ce,IA as le,JA as ue,Jk as a,KA as de,LA as fe,LI as o,MA as pe,NA as me,OA as he,PA as ge,QA as _e,Qk as s,RA as ve,RI as c,SA as ye,T as l,TA as be,UA as xe,VA as Se,WA as Ce,XA as we,Xk as Te,YA as Ee,Yk as De,ZA as Oe,Zk as ke,_A as u,aA as d,aj as Ae,bA as je,cA as f,cj as p,dA as m,dj as Me,eA as h,ej as Ne,fA as g,fj as Pe,gA as _,hA as v,iA as y,ij as Fe,jA as Ie,kA as Le,lA as b,lj as x,mA as S,mj as Re,nA as C,nj as ze,oA as w,oj as Be,pA as T,pj as Ve,qA as He,rA as E,rj as Ue,sA as D,sj as We,tA as O,tj as Ge,uA as k,uj as Ke,vA as qe,wA as Je,xA as Ye,yA as Xe,zA as Ze}from"./dist-_9JGogtQ.js";import{t as A}from"./check-Wm4Ks3tL.js";import{r as Qe}from"./dist-DiGkpPjG.js";import{t as j}from"./button-Bz9USCnz.js";import{At as M,Ct as N,Dt as P,Fn as $e,On as F,Ot as I,Pn as et,St as L,Z as tt,_ as nt,_t as R,bt as z,ct as B,gt as V,jn as rt,jt as H,kt as U,qt as it,st as W,vt as at,xt as G,yt as K}from"./index-DIc5ekpE.js";import{t as ot}from"./FilterBar-DHVMse_G.js";import{t as st}from"./DataTableShell-NMYUihjL.js";import{t as ct}from"./roleDescriptions-5AP7N2O_.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>h(),days:null},{value:`30`,label:()=>i(),days:30},{value:`90`,label:()=>s(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=$e({from:`/settings/serviceAccounts`}),t=et({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[a,s]=(0,q.useState)(X),Te=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),De=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),ke=c(l.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===X?void 0:a,disabled:i===X?void 0:i===`disabled`}}),u=c(l.apiKeys.listKeys,{}),d=c(l.apiKeys.listRoles,{}),f=o(l.apiKeys.createServiceAccount),m=o(l.apiKeys.updateServiceAccount),h=o(l.apiKeys.deleteServiceAccount),g=oe(l.apiKeys.mintApiKey),_=o(l.apiKeys.revokeApiKey),v=tt(),y=it(),b=n!==``||a!==X||i!==X;function S(){s(X),t({search:{},replace:!0})}let[C,w]=(0,q.useState)(!1),[T,E]=(0,q.useState)(Z),[D,O]=(0,q.useState)(null),[k,A]=(0,q.useState)(new Set),[N,F]=(0,q.useState)(null),L=(0,q.useRef)(!1),[z,B]=(0,q.useState)(new Set),[W,at]=(0,q.useState)({}),[G,K]=(0,q.useState)(null),Y=(0,q.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){A(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}),y.success(pe())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),O(null),w(!1)}catch(e){y.error(D?me():ge(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function mt(e){if(L.current)return;L.current=!0;let t=W[e._id]??`never`,n=lt.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 g({serviceAccountId:e._id,expiresAt:r});K({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Ie(),e)}finally{L.current=!1,F(null)}}async function $(e){if(await v({title:ee(),description:(0,J.jsxs)(J.Fragment,{children:[Le(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,he(),` `,(0,J.jsx)(`strong`,{children:re()}),` `,ie()]}),confirmWord:e.name,confirmLabel:be(),destructive:!0}))try{await h({serviceAccountId:e._id}),y.success(Je(),e.name)}catch(e){y.error(ne(),e)}}async function ht(e){if(await v({title:ye(),description:(0,J.jsxs)(J.Fragment,{children:[Ye(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,je()]}),confirmLabel:Xe(),destructive:!0})&&!z.has(e._id)){B(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(qe(),e)}finally{B(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}),(0,J.jsxs)(ot,{q:n,onQChange:Te,searchPlaceholder:Ve(),onReset:S,canReset:b,children:[(0,J.jsxs)(P,{value:a,onValueChange:s,children:[(0,J.jsx)(M,{size:`sm`,className:`w-40`,children:(0,J.jsx)(H,{placeholder:Pe()})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(U,{value:X,children:Me()}),(d??[]).map(e=>(0,J.jsx)(U,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(P,{value:i,onValueChange:De,children:[(0,J.jsx)(M,{size:`sm`,className:`w-36`,children:(0,J.jsx)(H,{})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(U,{value:X,children:Ke()}),(0,J.jsx)(U,{value:`active`,children:x()}),(0,J.jsx)(U,{value:`disabled`,children:p()})]})]})]}),(0,J.jsx)(st,{title:We(),rows:ke,addLabel:Be(),onAdd:()=>{E(Z),O(null),w(!0)},emptyHint:Ae(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:z}),rowActions:e=>[{label:Ge(),onSelect:()=>pt(e)},{label:Fe(),onSelect:()=>void mt(e)},{label:k.has(e._id)?Ue():ze(),onSelect:()=>Q(e._id)},{label:Ne(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?r():_e(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,J.jsx)(Qe,{}):(0,J.jsx)(rt,{})})},{header:Oe(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:we(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey})},{header:Ee(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(V,{variant:`destructive`,children:p()}):(0,J.jsx)(V,{variant:`outline`,children:x()})},{header:ue(),cell:e=>(0,J.jsxs)(P,{value:W[e._id]??`never`,onValueChange:t=>at(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(M,{size:`sm`,className:`w-32`,children:(0,J.jsx)(H,{})}),(0,J.jsx)(I,{children:lt.map(e=>(0,J.jsx)(U,{value:e.value,children:e.label()},e.value))})]})},{header:He(),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,J.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?de():se({count:t})})}}]}),(0,J.jsx)(nt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?Ce():Se(),description:D?xe():te(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?ce():Ze(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ve()}),(0,J.jsx)(R,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:fe()}),(0,J.jsxs)(P,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(M,{className:`w-full`,children:(0,J.jsx)(H,{placeholder:le()})}),(0,J.jsx)(I,{children:(d??[]).map(e=>(0,J.jsxs)(U,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(d??[]).find(e=>e.key===T.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ae()}),(0,J.jsx)(R,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:G,onClose:()=>K(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[u(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:v()}),(0,J.jsx)(`th`,{children:S()}),(0,J.jsx)(`th`,{children:T()}),(0,J.jsx)(`th`,{children:g()}),(0,J.jsx)(`th`,{children:m()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:B(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?b():f()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(at,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(K,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(L,{children:[(0,J.jsx)(N,{children:D()}),(0,J.jsx)(z,{children:w({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:d()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":y(),children:[n?(0,J.jsx)(A,{}):(0,J.jsx)(F,{}),n?E():C()]})]}),(0,J.jsx)(G,{children:(0,J.jsx)(j,{onClick:()=>{r(!1),t()},children:O()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?ke():B(e)}function mt(e){return e===null?`—`:W(e)}function $(e){return e.disabled?(0,J.jsx)(V,{variant:`destructive`,children:Te()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(V,{variant:`outline`,children:De()}):(0,J.jsx)(V,{variant:`outline`,children:a()})}export{Q as ServiceAccountsTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,Bo as i,Cs as a,Go as o,Ho as s,Jo as c,Ko as l,LI as u,Qo as d,RI as f,Ss as p,T as m,Uo as h,Vo as g,Wo as _,Xo as v,Yo as y,Zo as b,_s as x,as as S,bs as C,cs as w,ds as T,es as E,fs as D,gs as O,hs as k,is as A,ls as j,ms as M,ns as N,os as P,ps as F,qo as I,rs as L,ss as R,ts as ee,us as z,vs as B,xs as V,ys as H,zo as U}from"./dist-_9JGogtQ.js";import{t as W}from"./button-Bz9USCnz.js";import{Z as G,ct as K}from"./index-DIc5ekpE.js";import{t as q}from"./DataTableShell-NMYUihjL.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>S(),error:()=>A(),other:()=>L()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=u(m.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[f,p]=(0,J.useState)(``),[g,x]=(0,J.useState)(!1);async function S(){let t=f.trim();if(!(!t||g)){x(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),p(``)}finally{x(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,N({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ee()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:E()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?r():d()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:b()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:f,maxLength:2e3,rows:3,onChange:e=>p(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void S(),disabled:!f.trim()||g,children:g?c():y()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${l()}`:``,t.textTruncated?` ${o()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${_()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:h()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:s()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=f(m.subAgentReports.listForAdmin,{}),t=u(m.subAgentReports.readReport),n=u(m.subAgentReports.deleteReport),r=G(),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function d(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function h(e){await r({title:g(),description:i(),confirmLabel:U(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Y.jsx)(`strong`,{children:C()}),` `,H()]}),(0,Y.jsx)(q,{title:a(),rows:e,emptyHint:p(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:B(),cell:e=>K(e.at),sort:e=>e.at},{header:x(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:O(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:k(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${D({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:M(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:F(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:T()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:z()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?w():j(),onSelect:()=>void d(e)},{label:R(),onSelect:()=>void h(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,AM as i,BM as a,CM as o,CN as s,D as c,DI as l,DM as u,E as d,EI as f,EM as p,FI as m,FM as h,Fo as g,GM as _,HM as v,IM as y,Io as ee,JM as te,KM as ne,LI as b,LM as re,Lo as x,MM as ie,NM as ae,OM as oe,PM as se,QM as ce,RI as S,RM as le,Ro as C,SM as ue,SN as de,T as w,TI as fe,TM as pe,UM as me,VM as he,WM as ge,XM as _e,YM as ve,ZM as ye,_M as be,_N as xe,aM as Se,aN as Ce,bM as we,bN as Te,cM as Ee,cN as De,dM as Oe,dN as ke,eN as Ae,fM as je,fN as Me,gM as Ne,gN as Pe,hM as Fe,hN as Ie,iM as Le,iN as Re,jM as ze,kM as Be,lM as Ve,lN as He,mM as Ue,mN as We,nM as Ge,nN as Ke,oM as qe,oN as Je,pM as Ye,pN as T,qM as Xe,rM as Ze,rN as Qe,sM as $e,sN as et,tM as tt,tN as nt,uM as rt,uN as it,vM as at,vN as ot,wM as st,xM as E,xN as ct,yM as lt,yN as ut,zM as dt}from"./dist-_9JGogtQ.js";import{t as D}from"./check-Wm4Ks3tL.js";import{t as O}from"./x-CfJhGjMr.js";import{t as k}from"./button-Bz9USCnz.js";import{At as A,Dn as ft,Dt as j,En as M,Lt as N,Mt as pt,Nt as mt,Ot as P,P as F,_t as I,dt as ht,ft as L,gt as R,ht as gt,jt as z,kt as B,mt as V,pt as _t,ut as vt}from"./index-DIc5ekpE.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-DKADL750.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-C8QBboJq.js";import{t as kt}from"./TimeRangePicker-Dtw6LWMh.js";import{t as At}from"./FilterBar-DHVMse_G.js";import{t as jt}from"./AdvancedFilter-CAZse6g9.js";var G=c(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(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 It(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 q(e,t,n){return It(e,t,n)>=Mt}function Lt(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 Rt(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 zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(st());if(e.size>zt)throw Error(o());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/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(E());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(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(E());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);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(we());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(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 J(e)}async function J(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(ue())),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 Gt(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__`,Q={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 $({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`?l():e===`dark`?f():fe()}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:d(`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)(D,{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)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=S(w.charts.listMyCharts),r=b(w.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:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:T(),subtitle:Me(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?ke():n.via===`owner`?it():He({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:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:De()}):null]})}function Qt(){let e=b(w.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(a())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(le());return}let o;try{o=JSON.parse(r)}catch{s(a());return}d(!0);try{await e({name:t.trim(),tokens:o}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(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:ne()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:_(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ge()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:me(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),v(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void p(),children:he()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:dt()}):null]})]})}function $t({chart:e}){let t=m(w.charts.setChartLogo),n=b(w.charts.removeChartLogo),[r,a]=(0,K.useState)(!1),[o,s]=(0,K.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 Ut(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 d(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function f(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 h(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 g({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`?ze():i()}),(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)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?oe():Be(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void d(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void h(e),children:p()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:u()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ie()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(g,{mode:`light`}),(0,X.jsx)(g,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function en({chart:e}){let t=S(w.me.getMe,{host:N}),n=b(w.charts.addChartDomain),r=b(w.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(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:lt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Fe()}):u.map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ue({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:i,onChange:e=>a(e.target.value),placeholder:be(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Ne()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=b(w.charts.updateChart),n=b(w.charts.deleteChart),[r,i]=(0,K.useState)(!1),[o,s]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>tn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1);function _(){s(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(a());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(Ve()))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)(k,{variant:`outline`,size:`sm`,onClick:_,children:se()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:ae()})]})})]}),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:Oe()}),(0,X.jsx)(I,{value:o,onChange:e=>s(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:x()}),(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:u,onChange:e=>d(Number(e.target.value)),"aria-label":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:rt()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void v(),children:Ye()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:je()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=S(w.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:re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=b(w.charts.addChartToGroupPool),i=b(w.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await i({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)(R,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?Ae():e.kind===`custom`&&e.scope===`personal`?Se():nt()}),e.isGlobalDefault?(0,X.jsx)(R,{variant:`default`,children:r()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ye()}),(o??[]).map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ve({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(j,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:_e()})}),(0,X.jsx)(P,{children:c.map(e=>(0,X.jsx)(B,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):null]})]})}function on({chart:e}){let t=b(w.charts.promoteChartToCommon),n=b(w.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(Ve()))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)(R,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Le():Se()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Ze()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ge()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(w.admin.setDefaultThemeMode),i=b(w.admin.setDefaultLocale),a=b(w.charts.setDefaultChart),o=S(w.charts.listChartsAdmin),c=S(w.groups.listGroups,{}),l=e??`system`,u=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:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(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:et()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Je()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:T()}),mt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({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:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},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:Qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:$e()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{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:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===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:ct()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]})]})}function cn(){let e=S(w.me.getMe,{host:N}),t=pt(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)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:ot()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(M,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{children:`Default`}),(0,X.jsx)(R,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(R,{variant:`outline`,children:`Outline`}),(0,X.jsx)(R,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(j,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(B,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(F,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{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)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(j,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes directions`}),(0,X.jsx)(B,{value:`inbound`,children:`inbound`}),(0,X.jsx)(B,{value:`outbound`,children:`outbound`}),(0,X.jsx)(B,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(j,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(B,{value:`info`,children:`info`}),(0,X.jsx)(B,{value:`warn`,children:`warn`}),(0,X.jsx)(B,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{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)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(vt,{children:[(0,X.jsx)(gt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(M,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(_t,{children:`Actions`}),(0,X.jsx)(V,{}),(0,X.jsx)(L,{children:`Edit`}),(0,X.jsx)(L,{children:`Duplicate`}),(0,X.jsx)(V,{}),(0,X.jsx)(L,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(F,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(F,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(R,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(M,{})})})]},e.n))})]})}),(0,X.jsx)($,{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{ln as ThemeShowroom};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Fi as r,Ii as i,Li as a,Mi as o,Ni as s,Pi as c,a_ as l,c_ as u,d_ as d,f_ as f,i_ as p,ji as m,l_ as h,m_ as g,n_ as _,o_ as v,p_ as y,r_ as b,s_ as x,u_ as S}from"./dist-_9JGogtQ.js";import{t as C}from"./button-Bz9USCnz.js";import{Bt as w,Ht as T,Ut as E,Vt as D,_t as O,ct as k,kn as A,sn as j}from"./index-DIc5ekpE.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:g(),from:`now-5m`},{label:y(),from:`now-15m`},{label:f(),from:`now-30m`},{label:d(),from:`now-1h`},{label:S(),from:`now-3h`},{label:h(),from:`now-6h`},{label:u(),from:`now-12h`},{label:x(),from:`now-24h`},{label:v(),from:`now-2d`},{label:l(),from:`now-7d`},{label:p(),from:`now-30d`},{label:b(),from:`now-90d`},{label:_(),from:`now-520w`}];function L(e){return k(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(``),f=F(e),[p,h]=(0,M.useState)(()=>z(f.from)),[g,_]=(0,M.useState)(()=>z(f.to));function v(t){if(t){let t=F(e);h(z(t.from)),_(z(t.to)),d(``)}l(t)}function y(e){t({kind:`relative`,from:e,to:`now`}),l(!1)}function b(){let e=B(p),n=B(g);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),l(!1))}let x=(0,M.useMemo)(()=>{let e=u.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[u]),S=B(p)!==null&&B(g)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:v,children:[(0,H.jsx)(E,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(D,{children:(0,H.jsx)(w,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:a()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(O,{type:`datetime-local`,value:p,onChange:e=>h(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,H.jsx)(O,{type:`datetime-local`,value:g,onChange:e=>_(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:b,children:c()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(O,{value:u,onChange:e=>d(e.target.value),placeholder:s(),"aria-label":o()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:m()}):x.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>y(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,$y as i,AD as a,By as o,CD as s,D as c,DD as l,ED as u,Fy as d,GE as f,Gy as p,Hy as m,Iy as h,JE as g,Jy as _,KE as v,Ky as y,LI as b,Ly as x,MD as S,Mr as C,ND as ee,Nr as te,OD as ne,Pr as re,QE as ie,Qy as ae,RI as w,Ry as oe,SD as T,T as E,TD as D,Uy as se,Vy as ce,WE as O,Wy as le,XE as k,Xy as ue,YE as A,Yy as de,ZE as j,Zy as fe,_D as M,_b as pe,ab as me,bD as N,cb as he,dD as ge,db as _e,eD as ve,eb as ye,fD as P,fb as be,gD as F,gb as xe,hD as Se,hb as Ce,iD as we,ib as Te,jD as Ee,kD as De,lD as Oe,lb as ke,mD as Ae,mb as je,nD as Me,nb as Ne,ob as Pe,pD as Fe,pb as Ie,qE as Le,qy as Re,rD as ze,rb as Be,sb as Ve,tD as He,tb as Ue,uD as I,ub as We,vD as Ge,vb as Ke,wD as qe,xD as L,yD as Je,yb as Ye,zy as Xe}from"./dist-_9JGogtQ.js";import{t as Ze}from"./check-Wm4Ks3tL.js";import{t as Qe}from"./x-CfJhGjMr.js";import{i as R,n as z,r as $e,t as et}from"./tabs-DSFq9Jhc.js";import{t as B}from"./button-Bz9USCnz.js";import{At as V,Ct as tt,Dt as H,Fn as nt,J as rt,Lt as it,On as at,Ot as U,Pn as ot,St as st,Tn as ct,a as lt,bt as ut,ct as W,gt as G,i as dt,jt as K,kt as q,lt as ft,o as pt,s as mt,vt as ht,xn as gt,yt as _t}from"./index-DIc5ekpE.js";import{n as vt}from"./TimeRangePicker-Dtw6LWMh.js";import{t as yt}from"./FilterBar-DHVMse_G.js";import{t as bt}from"./AdvancedFilter-CAZse6g9.js";import{t as xt}from"./DataTableShell-NMYUihjL.js";var St=c(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=c(`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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=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`?Ae():n===`agent`?`${Fe()} - ${r}`:e}function Tt(){let e=w(E.me.getMe,{host:it})?.role===`admin`,t=w(E.deliveryTiming.getDeliveryStatus,{}),n=b(E.deliveryTiming.startDeliveryRecord),r=b(E.deliveryTiming.stopDeliveryRecord),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=t?.recording??!1,d=async()=>{c(!0);try{l?await r({}):await n({})}finally{c(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:ee()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:S()})]}),e?(0,Y.jsx)(B,{variant:l?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void d(),children:l?a():Ee()}):null]}),l?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(G,{variant:`secondary`,children:De()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:ne({time:ft(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:i?D():u()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=w(E.deliveryTiming.listDeliverySessions,{}),n=b(E.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[u,d]=(0,J.useState)(null),{from:p,to:m}=vt(c),h=c.to===`now`?1/0:m,g=r.trim()!==``||a!==`all`||c!==X,_=()=>{i(``),o(`all`),l(X)},v=(0,J.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>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,a,p,h]),y=e=>{let t=new Set((v??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:i,searchPlaceholder:s(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(H,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:`all`,children:T()}),(0,Y.jsx)(q,{value:`active`,children:L()}),(0,Y.jsx)(q,{value:`stopped`,children:N()})]})]})}),(0,Y.jsx)(xt,{title:qe(),rows:v,emptyHint:f(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?ge():P(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ct,{size:15,"aria-hidden":!0})})},{header:Je(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:W(e.startedAt)})},{header:Ge(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:W(e.stoppedAt)})},{header:M(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:F(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Se(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(G,{variant:`secondary`,children:L()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:N()})}],rowActions:e?e=>[{label:I(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:I(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=w(E.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:l()});let i=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,O()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(at,{size:13,"aria-hidden":!0}),t?v():Le()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:Me()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:He()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:ve()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(r(),i.bridge),a(ie(),i.A),a(j(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:k()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:re()},{value:`principalType`,label:te()},{value:`direction`,label:`direction`},{value:`roleKey`,label:C()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=nt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,u=e.q??``,d=dt(e.from,e.to),f=(0,J.useMemo)(()=>mt(e.adv),[e.adv]),{from:h,to:g}=vt(d),[v,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),C=e=>void t({search:t=>({...t,limit:e})}),ee=e=>void t({search:t=>({...t,kind:e})}),te=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ne=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),re=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),ie=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,...pt(e)})}),O=e=>void t({search:t=>({...t,adv:lt(e)}),replace:!0}),k=w(E.observability.listEvents,{limit:n}),A=w(E.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:u||void 0,from:h,to:g,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:f.length>0?f:void 0}}),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),N=u!==``||a!==Q||s!==Q||c!==Q||l!==Q||f.length>0||d.kind!==`relative`||d.from!==Pt.from;function ge(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=v?k?.filter(e=>e.correlationId===v):A,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(gt,{size:13,"aria-hidden":!0}),we()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ze()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ye(),(0,Y.jsx)(`strong`,{children:Ke()}),pe(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:xe()})]}),(0,Y.jsxs)(yt,{q:u,onQChange:te,searchPlaceholder:Ce(),timeRange:d,onTimeRangeChange:D,onReset:ge,canReset:N,children:[(0,Y.jsxs)(H,{value:a,onValueChange:ne,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:je()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:Ie()}),jt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:s,onValueChange:re,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:be()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:_e()}),Mt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:c,onValueChange:ie,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:We()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:ke()}),Nt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:l,onValueChange:T,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:he()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:Ve()}),M.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:r,onValueChange:ee,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:Pe()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:At,children:me()}),j.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:String(n),onValueChange:e=>C(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(U,{children:kt.map(e=>(0,Y.jsx)(q,{value:String(e),children:Te({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:f,onChange:O}),v?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:Be(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ne(),(0,Y.jsx)(`code`,{children:$(v)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ue()})]})}):null,(0,Y.jsx)(xt,{title:ye(),rows:ve,emptyHint:v?i():ae(),columns:[{header:fe(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:W(e.at)})},{header:ue(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(G,{variant:`secondary`,children:e.kind})},{header:de(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":_(),children:`✓`})}},{header:Re(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(G,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:y(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:p(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:le(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:m(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:ce(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:o(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Xe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>S(e),children:oe()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:x,onClose:()=>S(null)})]})]})}function Lt(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 Rt(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 zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ht,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(_t,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(tt,{className:`oc-traces__meta-title`,children:[x(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(G,{variant:`outline`,children:h()})]}),(0,Y.jsx)(ut,{children:d()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,$w as i,Bd as a,Bw as o,Fw as s,Gw as c,Hw as l,Iw as u,Jw as d,Kw as f,LI as p,Lw as ee,Nw as te,Pw as ne,Qv as m,Qw as h,RI as g,Rw as re,T as _,Uw as ie,Vd as v,Vw as ae,Ww as oe,Xv as y,Xw as se,Yv as b,Yw as ce,Zv as x,Zw as le,aT as S,ay as C,eT as ue,ey as w,iT as T,iy as E,mw as de,nT as fe,ny as D,oT as O,oy as k,qw as pe,rT as me,ry as A,sT as j,sy as M,tT as he,ty as N,zd as P,zw as ge}from"./dist-_9JGogtQ.js";import{t as F}from"./button-Bz9USCnz.js";import{At as I,Ct as L,Dt as R,Fn as _e,Lt as z,Ot as B,P as V,Pn as ve,Q as ye,St as be,Z as xe,an as H,bt as Se,c as U,dt as Ce,ft as we,gt as W,ht as Te,jt as G,kt as K,l as Ee,on as q,pt as De,qt as J,u as Y,ut as Oe,vt as ke,yt as Ae}from"./index-DIc5ekpE.js";import{t as je}from"./FilterBar-DHVMse_G.js";import{t as Me}from"./DataTableShell-NMYUihjL.js";import{t as Ne}from"./DetailChips-2kEsgn1k.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=g(_.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=g(_.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.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}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Z.jsx)(ke,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Ae,{className:`oc-access`,children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(L,{children:M({user:t})}),(0,Z.jsx)(Se,{children:k()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?C():E()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:A()}):u.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:w()}):[...d.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:i,assigned:a,defaultKey:o}){let s=p(_.agents.assignAgent),c=p(_.agents.removeAgent),l=p(_.agents.setDefaultAgent),u=J();if(!e)return null;async function d(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(D(),e)}}async function f(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(N(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(q,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n})]}),i.map(e=>{let n=`${t}/${e.agentId}`,i=a.has(n),s=o===n,c=e.state===`deleted`,l=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,Z.jsx)(V,{checked:i,disabled:(c||l)&&!i,onCheckedChange:()=>void d(e.agentId,i),"aria-label":r({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:m()}):null,e.outOfPool?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:x()}):null,i?s?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":y(),title:y(),children:(0,Z.jsx)(H,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":b(),title:b(),disabled:l,onClick:()=>void f(e.agentId),children:(0,Z.jsx)(H,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return P();case`user`:return a();case`admin`:return v();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(Y[e])).length;return(0,Z.jsxs)(Oe,{children:[(0,Z.jsx)(Te,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?j():O({count:r})})}),(0,Z.jsxs)(Ce,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(De,{children:S()}),U.map(e=>{let r=Y[e];return(0,Z.jsxs)(we,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(V,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=ve({from:`/settings/users`}),n=e.q??``,r=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),m=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),v=g(_.admin.listUsers,{filter:{q:n||void 0,role:r===Q?void 0:r},withAgents:!0}),y=g(_.me.getMe,{host:z}),b=p(_.admin.setRole),x=p(_.admin.setUserPermissions),S=p(_.admin.startImpersonation),C=p(_.admin.deleteUser),w=p(_.admin.setUserName),E=xe(),D=ye(),O=J(),[k,A]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of v??[])e.add(t.role);return[...e]},[v]),M=n!==``||r!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await b(e)}catch(e){O.error(T(),e)}}async function F(e){try{await x(e)}catch(e){O.error(me(),e)}}async function L(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await E({title:se(),description:ce({user:t}),confirmWord:d(),confirmLabel:pe(),destructive:!0}))try{await C({profileId:e._id}),O.success(c({user:t}))}catch(e){O.error(f(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await D({title:ie(),label:l({user:t}),placeholder:ae(),defaultValue:e.name??``,confirmLabel:de()});if(n!==null)try{await w({profileId:e._id,name:n}),O.success(o())}catch(e){O.error(ge(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:a,searchPlaceholder:fe(),onReset:N,canReset:M,children:(0,Z.jsxs)(R,{value:r,onValueChange:m,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(K,{value:Q,children:he()}),j.map(e=>(0,Z.jsx)(K,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ue(),rows:v,emptyHint:i(),rowActions:e=>{let t=[{label:te(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:oe(),onSelect:()=>void V(e)}];return e.userId!==y?.userId&&t.push({label:h(),onSelect:()=>void S({profileId:e._id})},{label:le(),variant:`destructive`,onSelect:()=>void L(e)}),t},columns:[{header:re(),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,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:ee(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(R,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(K,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(K,{value:`user`,children:$(`user`)}),(0,Z.jsx)(K,{value:`admin`,children:$(`admin`)})]})]})},{header:u(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:s()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:ne(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(q,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{Le as UsersTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,$u as i,An as a,At as o,Bn as s,Ct as ee,Dt as c,FI as l,Fn as u,Ft as d,Gn as f,Hn as p,In as m,It as h,Jn as g,Kn as _,LI as v,Ln as te,Lt as y,Mn as b,Nl as ne,Nn as x,Nt as re,Ot as S,Pn as C,Pt as w,Qn as T,RI as E,Rn as ie,St as ae,T as D,Tt as O,Un as oe,Vn as se,Wn as ce,Wt as le,Xn as ue,Yn as de,Zn as fe,dE as k,jI as pe,jl as me,jn as A,kI as j,kn as M,kt as N,qn as P,ut as F,wt as I,zn as L}from"./dist-_9JGogtQ.js";import{i as R,n as z,r as he,t as ge}from"./tabs-DSFq9Jhc.js";import{t as B}from"./button-Bz9USCnz.js";import{$t as V,At as H,Dt as U,Fn as _e,Jt as ve,Lt as ye,Nn as be,Ot as W,P as G,Pn as xe,Qt as K,Xt as Se,Yt as Ce,Zt as we,en as Te,gn as Ee,gt as q,jt as J,kt as Y,nn as X}from"./index-DIc5ekpE.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>_()],[`fr-FR`,()=>y()],[`en-US`,()=>h()],[`en-GB`,()=>d()],[`de-DE`,()=>w()],[`es-ES`,()=>re()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>oe()],[`1.25`,()=>p()],[`1.5`,()=>se()]],$=0;function ke({instance:e}){let t=v(D.admin.upsertInstanceConfig),n=e.config??{},r={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},[a,o]=(0,Z.useState)(r),[c,u]=(0,Z.useState)(`idle`),[d,p]=(0,Z.useState)(!1),[h,_]=(0,Z.useState)(!1),y=l(D.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({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}),u(`idle`)},[e._id]);let b=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function x(){u(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),u(`idle`)}catch{u(`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)(q,{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:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(U,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(J,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(Y,{value:`browser`,children:I()}),e.kind===`hermes`?null:(0,Q.jsx)(Y,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ae()}):null,a.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)(U,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":P(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(Y,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()}),(0,Q.jsxs)(U,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":f(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(Y,{value:e,children:t()},e))})]})]}),a.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:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:L()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!b||c===`saving`,onClick:()=>void x(),children:c===`saving`?i():ne()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(_(!1),V(),K(),a.engine!==`gateway`){we(m(),{lang:Se(a.lang,pe()),rate:t});return}p(!0),y({instanceName:e.name,text:m()}).then(({mime:e,audioBase64:r})=>{n===$&&Ce(r,e,{rate:t})}).catch(()=>{n===$&&_(!0)}).finally(()=>p(!1))},children:d?i():ie()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),V(),K()},children:te()})]}),c===`error`||h?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:h?F():me()}):null]})}function Ae({stt:e}){let t=E(D.me.getMe,{host:ye}),n=v(D.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:C()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?a():M()}),(0,Q.jsx)(q,{variant:r?`secondary`:`destructive`,children:r?N():S()})]}),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":o()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:x()})]})}function je(){let e=E(D.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Te(),[]),n=(0,Z.useMemo)(()=>ve(),[]),{section:i}=_e({from:`/settings/voice`}),a=xe({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?T():fe()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?ue():de()})]}),(0,Q.jsxs)(ge,{value:i,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),c()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ee,{size:13,"aria-hidden":!0}),C()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),b()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(z,{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:b()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:A()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=v(D.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)(q,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):(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":k()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n,b as r,t as i}from"./dist-CNZ9o3sc.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n,b as r,t as i}from"./dist-_9JGogtQ.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-CNZ9o3sc.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-_9JGogtQ.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-_9JGogtQ.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-_9JGogtQ.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-_9JGogtQ.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 +1 @@
1
- import{Tl as e,_l as t,dr as n,fl as r,gl as i,hl as a,pl as o}from"./dist-CNZ9o3sc.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(e){return e===`supported`?t():e===`beyond`?i():a()}function h(t){return t??e()}function g(e,t){return t&&t!==`openclaw`?n({provider:t}):e===null?r():o({version:e})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
1
+ import{Tl as e,_l as t,dr as n,fl as r,gl as i,hl as a,pl as o}from"./dist-_9JGogtQ.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(e){return e===`supported`?t():e===`beyond`?i():a()}function h(t){return t??e()}function g(e,t){return t&&t!==`openclaw`?n({provider:t}):e===null?r():o({version:e})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
@@ -1 +1 @@
1
- import{$p as e,Ap as t,Bp as n,Dp as r,Ep as i,Fp as a,Gp as o,Hp as s,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Qp as g,Rp as _,Tp as v,Up as y,Vp as b,Wp as x,Xp as S,Yp as C,Zp as w,jp as T,kp as E,qp as D,zp as O}from"./dist-CNZ9o3sc.js";var k={AGENT_NOT_FOUND:()=>({label:e(),hint:g()}),AUTH_TOKEN_MISMATCH:()=>({label:w(),hint:S()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:l()}),SESSION_SCOPE_DENIED:()=>({label:D(),hint:u()}),GATEWAY_TIMEOUT:()=>({label:o(),hint:x()}),GATEWAY_DISCONNECTED:()=>({label:y(),hint:s()}),ATTACHMENT_TOO_LARGE:()=>({label:O(),hint:_()}),ATTACHMENT_REJECTED:()=>({label:d(),hint:c()}),BRIDGE_UNREACHABLE:()=>({label:b(),hint:n()}),INVALID_REQUEST:()=>({label:a(),hint:h()}),NOT_CONFIGURED:()=>({label:p(),hint:f()}),UNROUTED:()=>({label:T(),hint:t()}),UPSTREAM_ERROR:()=>({label:E(),hint:m()}),UNKNOWN:()=>({label:r(),hint:i()})};function A(e){return e?k[e]?.()??{label:e,hint:v()}:k.UNKNOWN()}export{A as t};
1
+ import{$p as e,Ap as t,Bp as n,Dp as r,Ep as i,Fp as a,Gp as o,Hp as s,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Qp as g,Rp as _,Tp as v,Up as y,Vp as b,Wp as x,Xp as S,Yp as C,Zp as w,jp as T,kp as E,qp as D,zp as O}from"./dist-_9JGogtQ.js";var k={AGENT_NOT_FOUND:()=>({label:e(),hint:g()}),AUTH_TOKEN_MISMATCH:()=>({label:w(),hint:S()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:l()}),SESSION_SCOPE_DENIED:()=>({label:D(),hint:u()}),GATEWAY_TIMEOUT:()=>({label:o(),hint:x()}),GATEWAY_DISCONNECTED:()=>({label:y(),hint:s()}),ATTACHMENT_TOO_LARGE:()=>({label:O(),hint:_()}),ATTACHMENT_REJECTED:()=>({label:d(),hint:c()}),BRIDGE_UNREACHABLE:()=>({label:b(),hint:n()}),INVALID_REQUEST:()=>({label:a(),hint:h()}),NOT_CONFIGURED:()=>({label:p(),hint:f()}),UNROUTED:()=>({label:T(),hint:t()}),UPSTREAM_ERROR:()=>({label:E(),hint:m()}),UNKNOWN:()=>({label:r(),hint:i()})};function A(e){return e?k[e]?.()??{label:e,hint:v()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{D as r,m as i,w as a,x as o}from"./dist-_9JGogtQ.js";var s=r(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),c=t(e(),1),l=n();function u(e){let t=e+`CollectionProvider`,[n,r]=i(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=o(f),m=c.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,l.jsx)(p,{ref:a(t,u(f,n).collectionRef),children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=o(h),v=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=a(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...i}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,r]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}export{u as n,s as r,f as t};