@lacneu/atrium 0.79.0 → 0.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-Bg7AJltl.js +1 -0
- package/dist/assets/{AdvancedFilter-BvCkEFAZ.js → AdvancedFilter-Ddd7TM1I.js} +1 -1
- package/dist/assets/AgentFilesTab-BRmbz8_w.js +3 -0
- package/dist/assets/AnomaliesTab-m5WLIYl2.js +1 -0
- package/dist/assets/AuditTab-1gyBuFew.js +1 -0
- package/dist/assets/BridgeTab-DlU50D2z.js +1 -0
- package/dist/assets/ChatDefaultsTab-CN8cDKMU.js +1 -0
- package/dist/assets/{DataTableShell-BXwJXDDv.js → DataTableShell-D2srrwu0.js} +1 -1
- package/dist/assets/{DetailChips-hviX2Put.js → DetailChips-WUMzjman.js} +1 -1
- package/dist/assets/FeedbacksTab-CcE_6zZR.js +1 -0
- package/dist/assets/{FieldLabel-CsECtSIN.js → FieldLabel-BNwSIo5u.js} +1 -1
- package/dist/assets/FilesTab-CfDSdvOR.js +1 -0
- package/dist/assets/{FilterBar-C2wwMC41.js → FilterBar-BS4HsrlJ.js} +1 -1
- package/dist/assets/GroupsTab-BN8czt3O.js +1 -0
- package/dist/assets/InstancesTab-Mw3vQGZr.js +1 -0
- package/dist/assets/IntegrationsTab-HnFrohTq.js +1 -0
- package/dist/assets/KpiTab-Bt81LKar.js +1 -0
- package/dist/assets/PreferencesTab-DNxJMl_1.js +1 -0
- package/dist/assets/ProjectPage-BNEr-qVc.js +1 -0
- package/dist/assets/PromptInjectionsTab-DaLlUnez.js +4 -0
- package/dist/assets/RolesTab-DjKUmoAu.js +1 -0
- package/dist/assets/ScheduledTab-BTuR5Igi.js +1 -0
- package/dist/assets/ServiceAccountsTab-3PR98Iqq.js +1 -0
- package/dist/assets/SubAgentReportsTab-kiNltjSe.js +1 -0
- package/dist/assets/ThemeShowroom-DGuXtdJT.js +1 -0
- package/dist/assets/{TimeRangePicker-DI6G5EOI.js → TimeRangePicker-Dx50b9Tc.js} +1 -1
- package/dist/assets/{TimezoneCombobox-D3wze8FF.js → TimezoneCombobox-DH_5qFyU.js} +1 -1
- package/dist/assets/TracesTab-zOMYT0Ye.js +1 -0
- package/dist/assets/UsersTab-DVhM7px6.js +1 -0
- package/dist/assets/VoiceTab-l-Tr6bly.js +1 -0
- package/dist/assets/{api-C_wXCqXM.js → api-CyG2Kb2E.js} +5 -5
- package/dist/assets/{button-998QRevY.js → button-SxU4iS5M.js} +1 -1
- package/dist/assets/{card-Dz033eRk.js → card-vJtS-_yl.js} +1 -1
- package/dist/assets/chevrons-up-down-ChvoKzuN.js +1 -0
- package/dist/assets/{compatView-B1iUgVcK.js → compatView-JE5RFigb.js} +1 -1
- package/dist/assets/dispatchErrorInfo-BKhXLGGN.js +1 -0
- package/dist/assets/{dist-DrgGBzL-.js → dist-CPSxRyhy.js} +1 -1
- package/dist/assets/{dist-DmLwIO1L.js → dist-bgyYeQqP.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BFWtYQr6.js → highlighted-body-OFNGDK62-BakvA9z8.js} +1 -1
- package/dist/assets/index-Cv1UBVbk.css +1 -0
- package/dist/assets/index-DWkl2h55.js +324 -0
- package/dist/assets/{list-CHvGbTF2.js → list-JGKvhNdi.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-CgrVl_4r.js +1 -0
- package/dist/assets/{pdf-DwPPPJmz.js → pdf-BkJsigVn.js} +1 -1
- package/dist/assets/roleDescriptions-B9SjwOYY.js +1 -0
- package/dist/assets/{table-uPHY2-YP.js → table-jvClq47d.js} +1 -1
- package/dist/assets/{tabs-Cyif3k8O.js → tabs-D_DuLEpU.js} +1 -1
- package/dist/assets/x-CHe0mcCM.js +1 -0
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/AccessTab-DSCmt7Ip.js +0 -1
- package/dist/assets/AgentFilesTab-7dQdZX29.js +0 -3
- package/dist/assets/AnomaliesTab-BPLGANvs.js +0 -1
- package/dist/assets/AuditTab-ZU79MUgB.js +0 -1
- package/dist/assets/BridgeTab-M7-UtjGl.js +0 -1
- package/dist/assets/ChatDefaultsTab-Bc4D68Q0.js +0 -1
- package/dist/assets/FeedbacksTab-HMOpevVO.js +0 -1
- package/dist/assets/FilesTab-F959A6FE.js +0 -1
- package/dist/assets/GroupsTab-Bpy_p66G.js +0 -1
- package/dist/assets/InstancesTab-D5KStG8o.js +0 -1
- package/dist/assets/IntegrationsTab-BoxKq2le.js +0 -1
- package/dist/assets/KpiTab-GDPz44HL.js +0 -1
- package/dist/assets/PreferencesTab-CXDLshWS.js +0 -1
- package/dist/assets/ProjectPage-BySFxvDE.js +0 -1
- package/dist/assets/PromptInjectionsTab-IBU9kZO1.js +0 -4
- package/dist/assets/RolesTab-r-i-en_a.js +0 -1
- package/dist/assets/ScheduledTab-DISMK0AZ.js +0 -1
- package/dist/assets/ServiceAccountsTab-LgiLgXie.js +0 -1
- package/dist/assets/SubAgentReportsTab-BAhJQyxi.js +0 -1
- package/dist/assets/ThemeShowroom-Drifg0bA.js +0 -1
- package/dist/assets/TracesTab-DX1DB4b1.js +0 -1
- package/dist/assets/UsersTab-B92gFHQx.js +0 -1
- package/dist/assets/VoiceTab-pnfk1eHp.js +0 -1
- package/dist/assets/chevrons-up-down-DhZp1N6H.js +0 -1
- package/dist/assets/dispatchErrorInfo-50WccPSD.js +0 -1
- package/dist/assets/index-BeCBdUIg.css +0 -1
- package/dist/assets/index-DDMBZveR.js +0 -324
- package/dist/assets/mermaid-GHXKKRXX-BCPYwCCi.js +0 -1
- package/dist/assets/roleDescriptions-z3-Vqqal.js +0 -1
- package/dist/assets/x-Dr9YP2a4.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$L as i,AL as a,BI as o,CI as s,CL as c,D as l,DI as u,DL as d,EI as ee,EL as f,Fz as p,GI as m,HI as te,JI as h,KI as ne,ML as re,NL as ie,OI as ae,PL as oe,QI as g,QL as se,Rz as ce,SI as le,SL as ue,TI as de,TL as fe,UI as pe,VI as me,WI as he,XI as _,YI as ge,ZI as v,_I as _e,aL as ve,aR as ye,bI as be,bL as xe,cL as Se,cR as Ce,dL as we,dR as Te,eL as Ee,eR as De,fI as Oe,fL as ke,fR as Ae,gI as je,gL as Me,hI as Ne,iR as Pe,jL as Fe,jz as y,kI as Ie,kL as Le,kz as Re,lL as ze,lR as Be,mI as Ve,mL as He,nR as Ue,oI as We,oL as Ge,oR as Ke,pI as qe,pL as Je,pR as Ye,qI as Xe,rR as Ze,sL as Qe,sR as $e,t as b,tR as et,uL as tt,uR as nt,vI as rt,wI as it,wL as at,xI as ot,xL as st,yI as ct,yL as lt,zI as ut}from"./api-C_wXCqXM.js";import{t as dt}from"./list-CHvGbTF2.js";import{t as x}from"./button-998QRevY.js";import{$ as S,Bn as C,Bt as w,Ct as ft,Dt as pt,En as mt,Et as T,Q as E,Rt as D,St as ht,Tt as gt,X as O,Z as k,_t,at as vt,bn as yt,bt,et as A,gn as xt,gt as St,it as Ct,jt as wt,mn as Tt,nt as Et,on as Dt,ot as Ot,q as kt,rt as At,tt as jt,un as Mt,vt as Nt,wt as Pt,xt as Ft,yn as It,yt as Lt,zn as j,zt as M}from"./index-DDMBZveR.js";import{a as Rt,i as N,n as zt,o as Bt,r as P,t as Vt}from"./table-uPHY2-YP.js";import{t as Ht}from"./FilterBar-C2wwMC41.js";/* empty css */import{a as Ut,c as F,i as I,l as Wt,n as Gt,o as L,r as Kt,s as qt,t as Jt,u as R}from"./TimezoneCombobox-D3wze8FF.js";var Yt=l(`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`}]]),Xt=l(`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`}]]),z=t(e(),1),B=n();function V(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 Zt({value:e,onChange:t}){let n=Wt(e),i=(0,z.useMemo)(()=>new Date,[]),[a,o]=(0,z.useState)(()=>({year:n?.year??i.getFullYear(),month:n?.month??i.getMonth()})),[s,c]=(0,z.useState)(!1),l=(0,z.useMemo)(()=>V(y()),[]),u=(0,z.useMemo)(()=>new Intl.DateTimeFormat(y(),{month:`long`,year:`numeric`}),[]),d=(0,z.useMemo)(()=>new Intl.DateTimeFormat(y(),{dateStyle:`medium`,timeStyle:`short`}),[]),ee=F(a.year,a.month),f=n?.hour??9,p=n?.minute??0,m=(e,n,r,i,a)=>t(R(e,n,r,i,a)),te=(e,t,n)=>{o({year:e,month:t}),m(e,t,n,f,p)},h=e=>{let t=new Date(a.year,a.month+e,1);o({year:t.getFullYear(),month:t.getMonth()})},ne=n===null?r():d.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,B.jsxs)(D,{modal:!0,open:s,onOpenChange:c,children:[(0,B.jsx)(w,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":Ee(),children:[(0,B.jsx)(Yt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,B.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:ne})]})}),(0,B.jsxs)(M,{align:`start`,className:`oc-dtp__pop`,children:[(0,B.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":g(),onClick:()=>h(-1),children:(0,B.jsx)(C,{size:15,"aria-hidden":!0})}),(0,B.jsx)(`span`,{className:`oc-dtp__month`,children:u.format(new Date(a.year,a.month,1))}),(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":v(),onClick:()=>h(1),children:(0,B.jsx)(j,{size:15,"aria-hidden":!0})})]}),(0,B.jsxs)(`div`,{className:`oc-dtp__grid`,children:[l.map((e,t)=>(0,B.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),ee.map((e,t)=>{let r=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(r?` oc-dtp__day--sel`:``)+(a&&!r?` oc-dtp__day--today`:``),onClick:()=>te(e.year,e.month,e.day),children:e.day},t)})]}),(0,B.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,B.jsxs)(O,{value:String(f),onValueChange:e=>m(a.year,a.month,n?.day??i.getDate(),Number(e),p),children:[(0,B.jsx)(S,{size:`sm`,"aria-label":_(),children:(0,B.jsx)(A,{})}),(0,B.jsx)(k,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,B.jsx)(E,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,B.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,B.jsxs)(O,{value:String(p),onValueChange:e=>m(a.year,a.month,n?.day??i.getDate(),f,Number(e)),children:[(0,B.jsx)(S,{size:`sm`,"aria-label":ge(),children:(0,B.jsx)(A,{})}),(0,B.jsx)(k,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,B.jsx)(E,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function H(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Qt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function $t(e){let t=new Map;for(let n of e){let e=H(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function U(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Qt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function en(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 tn(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function nn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var W=3;function rn({events:e,mode:t,cursor:n,onModeChange:r,onCursorChange:i,onEventClick:a,footnote:o}){let s=y(),c=(0,z.useMemo)(()=>$t(e),[e]),l=(0,z.useMemo)(()=>en(s),[s]),u=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`,year:`numeric`}),[s]),d=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`}),[s]),ee=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}),[s]),f=new Date,p=e=>{if(t===`year`){i({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);i({year:r.getFullYear(),month:r.getMonth()})},h=t===`year`?String(n.year):u.format(new Date(n.year,n.month,1));return(0,B.jsxs)(`div`,{className:`oc-cal`,children:[(0,B.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,B.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":te(),onClick:()=>p(-1),children:(0,B.jsx)(C,{})}),(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":me(),onClick:()=>p(1),children:(0,B.jsx)(j,{})}),(0,B.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>i({year:f.getFullYear(),month:f.getMonth()}),children:pe()})]}),(0,B.jsx)(`span`,{className:`oc-cal__title`,children:h}),(0,B.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,B.jsx)(x,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>r(`month`),children:m()}),(0,B.jsx)(x,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>r(`year`),children:he()})]})]}),t===`month`?(0,B.jsx)(an,{cursor:n,byDay:c,weekdays:l,timeFmt:ee,now:f,onEventClick:a}):(0,B.jsx)(on,{year:n.year,byDay:c,monthShortFmt:d,now:f,onOpenMonth:e=>{i({year:n.year,month:e}),r(`month`)}}),o?(0,B.jsx)(`p`,{className:`oc-cal__footnote`,children:o}):null]})}function an({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let s=F(e.year,e.month);return(0,B.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,B.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),s.map((e,n)=>{let s=t.get(Qt(e.year,e.month,e.day))??[],c=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,B.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(c?` oc-cal__day--today`:``),children:[(0,B.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),s.slice(0,W).map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,B.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,B.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),s.length>W?(0,B.jsx)(`span`,{className:`oc-cal__more`,children:o({count:s.length-W})}):null]},n)})]})}function on({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,B.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=U(t,e,o),c=F(e,o);return(0,B.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,B.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,B.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,B.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var sn={h:36e5,min:6e4,s:1e3,ms:1};function cn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*sn[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function G(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function K(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=G(t[0],0,59),r=G(t[1],0,23),i=G(t[2],1,31),a=G(t[3],1,12),o=G(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var ln=new Map;function q(e){let t=ln.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return ln.set(e,n),n}function J(e,t){if(t!==null){let n=q(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function Y(e,t,n,r,i,a){if(a===null||q(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=J(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function X(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=K(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=J(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=Y(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=Y(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Z=`crons`;function un(e,t){return`${e}\u0000${t}`}function dn(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=un(a.instanceName,e.id);i.set(o,a);let s=L(e)!==`active`,c=X(s?null:cn(e.schedule),e.nextRunAtMs,t,n);for(let t of c)r.push({id:`${o}:${t.atMs}`,sourceId:Z,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:s,exact:t.exact})}return{events:r,byItemId:i}}var Q={minutes:6e4,hours:36e5,days:864e5};function $(e){return e?.data?.code??`unknown`}function fn({status:e}){switch(qt(e)){case`ok`:return(0,B.jsx)(T,{variant:`secondary`,children:Je()});case`error`:return(0,B.jsx)(T,{variant:`destructive`,children:we()});case`running`:return(0,B.jsx)(T,{variant:`outline`,children:tt()});case`other`:return(0,B.jsx)(T,{variant:`outline`,children:e});case`none`:return(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function pn(){let e=p(b.scheduled.listMyCrons),t=p(b.scheduled.getCronDetail),n=p(b.scheduled.listCronRuns),r=p(b.scheduled.updateCron),o=p(b.scheduled.removeCron),l=p(b.scheduled.runCronNow),m=pt(),te=ce(b.me.getMe,{host:kt})?.timezone,[g,pe]=(0,z.useState)(null),[me,he]=(0,z.useState)(!1),[_,ge]=(0,z.useState)(!1),[v,Ee]=(0,z.useState)(null),[C,w]=(0,z.useState)(null),[D,j]=(0,z.useState)(null),[M,F]=(0,z.useState)(null),[Wt,qt]=(0,z.useState)(!1),[R,V]=(0,z.useState)(Gt),[H,Qt]=(0,z.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),$t=e=>{localStorage.setItem(`oc.sched.view`,e),Qt(e)},[U,en]=(0,z.useState)(`month`),[W,an]=(0,z.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),on=(0,z.useMemo)(()=>{let e=[];for(let t of g??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Ut(r,R)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[g,R]),sn=(0,z.useMemo)(()=>U===`year`?nn(W.year):tn(W.year,W.month),[U,W]),cn=(0,z.useMemo)(()=>dn(on,sn.startMs,sn.endMs),[on,sn]),G=e=>{let t=cn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||pn(t.instanceName,t.job)},K=(0,z.useCallback)(async()=>{he(!0),ge(!1);try{pe(await e({}))}catch{ge(!0)}finally{he(!1)}},[e]);(0,z.useEffect)(()=>{K()},[K]);let ln=(0,z.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),q=(0,z.useRef)(null);(0,z.useEffect)(()=>{g!==null&&q.current!==null&&q.current.scrollIntoView({block:`center`})},[g]);let J=(0,z.useMemo)(()=>new Intl.DateTimeFormat(y(),{dateStyle:`medium`,timeStyle:`short`}),[]),Y=async(e,t,n)=>{Ee(e);try{await t(),m.success(n),await K()}catch(e){m.toast({variant:`error`,title:d({code:$(e)})})}finally{Ee(null)}},X=(0,z.useRef)(0),Z=(0,z.useRef)(0),un=async(e,t)=>{if(t.id===null)return;let r=++X.current;j({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==X.current)return;j({name:t.name??t.id,entries:i})}catch(e){if(r!==X.current)return;j(null),m.toast({variant:`error`,title:d({code:$(e)})})}},pn=async(e,n)=>{if(n.id===null)return;let r=++Z.current;F({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%Q.days===0?(s=String(e/Q.days),c=`days`):e%Q.hours===0?(s=String(e/Q.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/Q.minutes))),c=`minutes`))}if(r!==Z.current)return;F(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!==Z.current)return;F(null),m.toast({variant:`error`,title:d({code:$(e)})})}},mn=async()=>{if(M===null)return;let e={};if(M.nameDirty&&M.name.trim()===``||M.messageDirty&&M.hasMessage&&M.message.trim()===``){m.toast({variant:`error`,title:Oe()});return}if(M.nameDirty&&M.name.trim()!==``&&(e.name=M.name.trim()),M.scheduleDirty){if(M.scheduleKind===`cron`&&M.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:M.cronExpr.trim(),...M.tz.trim()===``?{}:{tz:M.tz.trim()}};else if(M.scheduleKind===`every`){let t=Number(M.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*Q[M.everyUnit])})}else if(M.scheduleKind===`at`&&M.at!==``){let t=Date.parse(M.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(M.scheduleDirty&&e.schedule===void 0){m.toast({variant:`error`,title:qe()});return}if(M.messageDirty&&M.hasMessage&&M.message.trim()!==``&&(e.message=M.message.trim()),Object.keys(e).length===0){F(null);return}let t=Z.current;qt(!0);try{await r({instanceName:M.instanceName,jobId:M.jobId,patch:e}),m.success(ee()),t===Z.current&&F(null),await K()}catch(e){m.toast({variant:`error`,title:d({code:$(e)})})}finally{qt(!1)}},hn=g?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,B.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Ye()}),(0,B.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":h(),children:[(0,B.jsx)(x,{variant:H===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Xe(),title:Xe(),"aria-pressed":H===`list`,onClick:()=>$t(`list`),children:(0,B.jsx)(dt,{})}),(0,B.jsx)(x,{variant:H===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":ne(),title:ne(),"aria-pressed":H===`calendar`,onClick:()=>$t(`calendar`),children:(0,B.jsx)(Yt,{})})]}),(0,B.jsxs)(x,{variant:`ghost`,size:`sm`,onClick:()=>void K(),disabled:me,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,B.jsx)(Tt,{size:14,"aria-hidden":!0}),Ae()]})]}),g!==null&&hn>0?(0,B.jsxs)(Ht,{q:R.q,onQChange:e=>V(t=>({...t,q:e})),searchPlaceholder:Se(),onReset:()=>V(Gt),canReset:Kt(R),children:[(0,B.jsxs)(O,{value:R.state,onValueChange:e=>V(t=>({...t,state:e})),children:[(0,B.jsx)(S,{size:`sm`,className:`w-40`,children:(0,B.jsx)(A,{})}),(0,B.jsxs)(k,{children:[(0,B.jsx)(E,{value:`all`,children:Qe()}),(0,B.jsx)(E,{value:`active`,children:i()}),(0,B.jsx)(E,{value:`paused`,children:De()}),(0,B.jsx)(E,{value:`auto-disabled`,children:se()})]})]}),(0,B.jsxs)(O,{value:R.result,onValueChange:e=>V(t=>({...t,result:e})),children:[(0,B.jsx)(S,{size:`sm`,className:`w-40`,children:(0,B.jsx)(A,{})}),(0,B.jsxs)(k,{children:[(0,B.jsx)(E,{value:`all`,children:Ge()}),(0,B.jsx)(E,{value:`ok`,children:Je()}),(0,B.jsx)(E,{value:`error`,children:we()}),(0,B.jsx)(E,{value:`running`,children:tt()}),(0,B.jsx)(E,{value:`none`,children:ze()})]})]})]}):null,g===null?(0,B.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":me,children:_?Te():Re()}):H===`calendar`?(0,B.jsxs)(B.Fragment,{children:[_?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}):null,g.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:nt()}):(0,B.jsx)(rn,{events:cn.events,mode:U,cursor:W,onModeChange:en,onCursorChange:an,onEventClick:G,footnote:ut()})]}):(0,B.jsxs)(B.Fragment,{children:[_?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}):null,g.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:nt()}):null,g.map(e=>{let t=e.jobs.filter(e=>Ut(e,R)),n=Kt(R)&&e.jobs.length>0&&t.length===0;return(0,B.jsxs)(`section`,{style:{marginBottom:20},children:[g.length>1||e.error||!e.supported?(0,B.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,B.jsx)(T,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Ce({code:e.error})}):e.jobs.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:$e()}):n?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}):(0,B.jsxs)(Vt,{children:[(0,B.jsx)(Rt,{children:(0,B.jsxs)(Bt,{children:[(0,B.jsx)(N,{children:Ke()}),(0,B.jsx)(N,{children:ye()}),(0,B.jsx)(N,{children:Pe()}),(0,B.jsx)(N,{children:Ze()}),(0,B.jsx)(N,{children:Ue()}),(0,B.jsx)(N,{children:He()}),(0,B.jsx)(N,{children:Ie()})]})}),(0,B.jsx)(zt,{children:t.map((t,n)=>{let o=`${e.instanceName}:${t.id??n}`,s=v===o,c=e.manageSupported,d=e.kind===`openclaw`&&c;return(0,B.jsxs)(Bt,{ref:t.id!==null&&t.id===ln?q:void 0,"data-state":t.id!==null&&t.id===ln?`selected`:void 0,children:[(0,B.jsx)(P,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??et()}),(0,B.jsx)(P,{children:(0,B.jsx)(T,{variant:`secondary`,children:t.agentId})}),(0,B.jsxs)(P,{className:`whitespace-nowrap`,children:[(0,B.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=St(t.schedule),n=e===null?null:_t(e);return n===null?null:(0,B.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,B.jsx)(P,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:J.format(t.nextRunAtMs)}),(0,B.jsx)(P,{children:L(t)===`auto-disabled`?(0,B.jsx)(T,{variant:`destructive`,title:`${t.autoDisabledReason??``}${t.autoDisabledAtMs===null?``:` · ${J.format(t.autoDisabledAtMs)}`}`,children:se()}):L(t)===`active`?(0,B.jsx)(T,{variant:`secondary`,children:i()}):L(t)===`paused`?(0,B.jsx)(T,{variant:`outline`,children:De()}):(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,B.jsxs)(P,{children:[(0,B.jsx)(fn,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,B.jsx)(T,{variant:`destructive`,title:t.lastDeliveryError??oe(),children:ke()}):null]}),(0,B.jsx)(P,{className:`whitespace-nowrap`,children:t.id===null?(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):s?(0,B.jsx)(mt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,B.jsxs)(`span`,{className:`oc-cronactions`,children:[d?(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:re(),"aria-label":re(),disabled:v!==null,onClick:()=>void Y(o,async()=>{let n=await l({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},f()),children:(0,B.jsx)(Dt,{size:14,"aria-hidden":!0})}):null,d&&t.enabled!==null?(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:I(t)===`pause`?Fe():a(),"aria-label":I(t)===`pause`?Fe():a(),disabled:v!==null,onClick:()=>void Y(o,()=>r({instanceName:e.instanceName,jobId:t.id,patch:{enabled:I(t)===`resume`}}),I(t)===`pause`?fe():at()),children:I(t)===`pause`?(0,B.jsx)(yt,{size:14,"aria-hidden":!0}):(0,B.jsx)(xt,{size:14,"aria-hidden":!0})}):null,d?(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:v!==null,onClick:()=>void pn(e.instanceName,t),children:(0,B.jsx)(It,{size:14,"aria-hidden":!0})}):null,d?(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:u(),"aria-label":u(),disabled:v!==null,onClick:()=>void un(e.instanceName,t),children:(0,B.jsx)(Xt,{size:14,"aria-hidden":!0})}):null,c?(0,B.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:Le(),"aria-label":Le(),disabled:v!==null,onClick:()=>w({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,B.jsx)(Mt,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Be()})]},e.instanceName)}),hn>0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:We()}):null]}),(0,B.jsx)(Nt,{open:C!==null,onOpenChange:e=>{e||w(null)},children:(0,B.jsxs)(Ft,{children:[(0,B.jsxs)(Pt,{children:[(0,B.jsx)(gt,{children:ue()}),(0,B.jsx)(ht,{children:st({name:C?.name??``})})]}),(0,B.jsxs)(ft,{children:[(0,B.jsx)(bt,{children:xe()}),(0,B.jsx)(Lt,{onClick:()=>{let e=C;w(null),e!==null&&Y(`${e.instanceName}:${e.jobId}`,()=>o({instanceName:e.instanceName,jobId:e.jobId}),c())},children:lt()})]})]})}),(0,B.jsx)(jt,{open:D!==null,onOpenChange:e=>{e||(X.current++,j(null))},children:(0,B.jsxs)(Et,{style:{maxWidth:640},children:[(0,B.jsx)(vt,{children:(0,B.jsx)(Ot,{children:de({name:D?.name??``})})}),D?.entries===null?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):D!==null&&D.entries.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):D===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:D.entries.map((e,t)=>(0,B.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,B.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,B.jsx)(fn,{status:e.status}),(0,B.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?J.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,B.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,B.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[Me({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,B.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,B.jsx)(jt,{open:M!==null,onOpenChange:e=>{e||(Z.current++,F(null))},children:(0,B.jsxs)(Et,{className:`oc-cronedit`,children:[(0,B.jsxs)(vt,{children:[(0,B.jsx)(Ot,{children:s()}),(0,B.jsx)(At,{children:le()})]}),M===null?null:M.loading?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,B.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ke()}),(0,B.jsx)(wt,{value:M.name,maxLength:200,onChange:e=>F({...M,name:e.target.value,nameDirty:!0})})]}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ot()}),(0,B.jsxs)(O,{value:M.scheduleKind,onValueChange:e=>F({...M,scheduleKind:e,scheduleDirty:!0}),children:[(0,B.jsx)(S,{children:(0,B.jsx)(A,{})}),(0,B.jsxs)(k,{children:[(0,B.jsx)(E,{value:`cron`,children:be()}),(0,B.jsx)(E,{value:`every`,children:ct()}),(0,B.jsx)(E,{value:`at`,children:rt()})]})]}),M.scheduleKind===`cron`?(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,B.jsx)(wt,{value:M.cronExpr,onChange:e=>F({...M,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,B.jsx)(Jt,{value:M.tz,onChange:e=>F({...M,tz:e,scheduleDirty:!0}),fallbackTz:te??void 0})]}):M.scheduleKind===`every`?(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,B.jsx)(wt,{type:`number`,min:1,value:M.everyValue,onChange:e=>F({...M,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,B.jsxs)(O,{value:M.everyUnit,onValueChange:e=>F({...M,everyUnit:e,scheduleDirty:!0}),children:[(0,B.jsx)(S,{style:{maxWidth:160},children:(0,B.jsx)(A,{})}),(0,B.jsxs)(k,{children:[(0,B.jsx)(E,{value:`minutes`,children:_e()}),(0,B.jsx)(E,{value:`hours`,children:je()}),(0,B.jsx)(E,{value:`days`,children:Ne()})]})]})]}):(0,B.jsx)(Zt,{value:M.at,onChange:e=>F({...M,at:e,scheduleDirty:!0})})]}),M.hasMessage?(0,B.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ie()}),(0,B.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:M.message,onChange:e=>F({...M,message:e.target.value,messageDirty:!0})})]}):null]}),(0,B.jsxs)(Ct,{children:[(0,B.jsx)(x,{variant:`ghost`,onClick:()=>F(null),children:xe()}),(0,B.jsxs)(x,{onClick:()=>void mn(),disabled:M===null||M.loading||Wt,children:[Wt?(0,B.jsx)(mt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,Ve()]})]})]})})]})}export{pn as ScheduledTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,AM as i,AN as ee,BM as a,BN as te,CN as ne,DM as o,DN as re,EN as ie,FM as ae,FN as oe,Fz as se,GM as s,GN as ce,HM as c,HN as l,IM as u,IN as le,JM as d,KM as f,KN as ue,LM as p,LN as de,Lz as m,MM as h,MN as fe,NM as g,NN as pe,OM as me,ON as he,PM as _,PN as ge,QM as _e,RM as v,RN as ve,Rz as y,SN as ye,TN as be,UM as b,UN as xe,VM as x,VN as S,WM as C,WN as Se,XM as w,YM as T,ZM as Ce,_N as we,aN as Te,bN as Ee,cN as De,dN as Oe,eN as ke,fN as Ae,gN as je,hN as Me,iN as Ne,jM as E,jN as Pe,kM as D,kN as Fe,lN as Ie,mN as Le,nN as Re,oN as ze,pN as Be,qM as O,qN as Ve,rN as He,sN as Ue,t as k,tN as We,uN as Ge,vN as Ke,wN as qe,xN as Je,yN as Ye,zM as A,zN as Xe}from"./api-C_wXCqXM.js";import{t as j}from"./button-998QRevY.js";import{$ as M,Dt as Ze,Et as N,Fn as P,Gn as Qe,Hn as F,Q as I,U as $e,Vn as et,Wn as tt,X as L,Z as R,_ as nt,at as z,ct as B,et as V,it as H,jt as U,nt as W,ot as G,rt,st as it,tt as K,zn as at}from"./index-DDMBZveR.js";import{t as ot}from"./FilterBar-C2wwMC41.js";import{t as st}from"./DataTableShell-BXwJXDDv.js";import{t as ct}from"./roleDescriptions-z3-Vqqal.js";var q=t(e(),1),J=n(),Y=[{value:`never`,label:()=>g(),days:null},{value:`30`,label:()=>h(),days:30},{value:`90`,label:()=>E(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=Qe({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Z,[a,o]=(0,q.useState)(Z),ae=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),c=y(k.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:i===Z?void 0:i===`disabled`}}),u=y(k.apiKeys.listKeys,{}),d=y(k.apiKeys.listRoles,{}),f=m(k.apiKeys.createServiceAccount),p=m(k.apiKeys.updateServiceAccount),h=m(k.apiKeys.deleteServiceAccount),g=se(k.apiKeys.mintApiKey),me=m(k.apiKeys.revokeApiKey),_=$e(),v=Ze(),b=n!==``||a!==Z||i!==Z;function x(){o(Z),t({search:{},replace:!0})}let[C,w]=(0,q.useState)(!1),[T,E]=(0,q.useState)(Q),[D,O]=(0,q.useState)(null),[A,P]=(0,q.useState)(new Set),[F,z]=(0,q.useState)(null),B=(0,q.useRef)(!1),[H,W]=(0,q.useState)(new Set),[G,rt]=(0,q.useState)({}),[it,K]=(0,q.useState)(null),X=(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 $(e){P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{D?(await p({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),v.success(Oe())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Q),O(null),w(!1)}catch(e){v.error(D?Ae():Be(),e)}}function ft(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function pt(e){if(B.current)return;B.current=!0;let t=G[e._id]??`never`,n=Y.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;z(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){v.error(Ge(),e)}finally{B.current=!1,z(null)}}async function mt(e){if(await _({title:Ie(),description:(0,J.jsxs)(J.Fragment,{children:[De(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ue(),` `,(0,J.jsx)(`strong`,{children:ze()}),` `,Te()]}),confirmWord:e.name,confirmLabel:Ne(),destructive:!0}))try{await h({serviceAccountId:e._id}),v.success(He(),e.name)}catch(e){v.error(Re(),e)}}async function ht(e){if(await _({title:We(),description:(0,J.jsxs)(J.Fragment,{children:[ke(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,r()]}),confirmLabel:_e(),destructive:!0})&&!H.has(e._id)){W(t=>new Set(t).add(e._id));try{await me({keyId:e._id})}catch(e){v.error(Ce(),e)}finally{W(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:Ve()}),(0,J.jsxs)(ot,{q:n,onQChange:ae,searchPlaceholder:ue(),onReset:x,canReset:b,children:[(0,J.jsxs)(L,{value:a,onValueChange:o,children:[(0,J.jsx)(M,{size:`sm`,className:`w-40`,children:(0,J.jsx)(V,{placeholder:ce()})}),(0,J.jsxs)(R,{children:[(0,J.jsx)(I,{value:Z,children:Se()}),(d??[]).map(e=>(0,J.jsx)(I,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(L,{value:i,onValueChange:s,children:[(0,J.jsx)(M,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{})}),(0,J.jsxs)(R,{children:[(0,J.jsx)(I,{value:Z,children:xe()}),(0,J.jsx)(I,{value:`active`,children:l()}),(0,J.jsx)(I,{value:`disabled`,children:S()})]})]})]}),(0,J.jsx)(st,{title:te(),rows:c,addLabel:Xe(),onAdd:()=>{E(Q),O(null),w(!0)},emptyHint:ve(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:H}),rowActions:e=>[...(e.managedBy??null)===null?[{label:ge(),onSelect:()=>ft(e)},{label:de(),onSelect:()=>void pt(e)}]:[],{label:A.has(e._id)?le():oe(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:pe(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?fe():Pe(),onClick:()=>$(e._id),children:A.has(e._id)?(0,J.jsx)(et,{}):(0,J.jsx)(at,{})})},{header:ee(),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:Fe(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(N,{variant:`secondary`,children:e.roleKey})},{header:he(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(N,{variant:`destructive`,children:S()}):(0,J.jsx)(N,{variant:`outline`,children:l()})},{header:re(),cell:e=>(0,J.jsxs)(L,{value:G[e._id]??`never`,onValueChange:t=>rt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(M,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(R,{children:Y.map(e=>(0,J.jsx)(I,{value:e.value,children:e.label()},e.value))})]})},{header:ie(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:F===e._id?be():qe({count:t})})}}]}),(0,J.jsx)(nt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?ne():Ee(),description:D?ye():Ye(),canSubmit:!!(T.name&&T.roleKey),onSubmit:dt,submitLabel:D?Je():Ke(),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:we()}),(0,J.jsx)(U,{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:je()}),(0,J.jsxs)(L,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(M,{className:`w-full`,children:(0,J.jsx)(V,{placeholder:Me()})}),(0,J.jsx)(R,{children:(d??[]).map(e=>(0,J.jsxs)(I,{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:Le()}),(0,J.jsx)(U,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:it,onClose:()=>K(null)})]})}function lt({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:[w(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:d()}),(0,J.jsx)(`th`,{children:O()}),(0,J.jsx)(`th`,{children:f()}),(0,J.jsx)(`th`,{children:s()}),(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:b()}),(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)(N,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:B(t.createdAt)}),(0,J.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:pt(t.expiresAt)}),(0,J.jsx)(`td`,{children:mt(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,J.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?c():x()}):null})]},t._id))})]})]})}function ut({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)(K,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(W,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(G,{children:a()}),(0,J.jsx)(rt,{children:A({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:v()}),(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":p(),children:[n?(0,J.jsx)(F,{}):(0,J.jsx)(P,{}),n?u():ae()]})]}),(0,J.jsx)(H,{children:(0,J.jsx)(j,{onClick:()=>{r(!1),t()},children:_()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?i():B(e)}function pt(e){return e===null?`—`:it(e)}function mt(e){return e.disabled?(0,J.jsx)(N,{variant:`destructive`,children:D()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(N,{variant:`outline`,children:me()}):(0,J.jsx)(N,{variant:`outline`,children:o()})}export{$ as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Ac as i,Cc as a,Dc as o,Ec as s,Js as c,Lz as l,Mc as u,Oc as d,Qs as f,Rz as p,Sc as m,Tc as h,Xs as g,Ys as _,Zs as v,_c as y,ac as b,bc as x,cc as S,dc as C,ec as w,fc as T,gc as E,hc as D,ic as O,jc as k,kc as A,lc as j,mc as M,nc as N,oc as P,pc as F,rc as I,sc as L,t as R,tc as ee,uc as z,vc as B,wc as V,xc as H,yc as U}from"./api-C_wXCqXM.js";import{t as W}from"./button-998QRevY.js";import{U as G,ct as K}from"./index-DDMBZveR.js";import{t as q}from"./DataTableShell-BXwJXDDv.js";var J=t(e(),1),Y=n(),X={hung:()=>D(),wrong_result:()=>M(),error:()=>F(),other:()=>T()},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=l(R.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[o,s]=(0,J.useState)(``),[c,u]=(0,J.useState)(!1);async function d(){let t=o.trim();if(!(!t||c)){u(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{u(!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),` · `,C({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:z()}),(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:j()}),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`?S():L()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:P()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:b(),value:o,maxLength:2e3,rows:3,onChange:e=>s(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 d(),disabled:!o.trim()||c,children:c?I():O()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[N({count:t.children.length}),t.childrenTruncated?` ${ee()}`:``,t.textTruncated?` ${w()}`:``]}),(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?` · ${r()}`:``]}),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:f()}),(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:v()}),(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=p(R.subAgentReports.listForAdmin,{}),t=l(R.subAgentReports.readReport),n=l(R.subAgentReports.deleteReport),r=G(),[f,v]=(0,J.useState)(null),[b,S]=(0,J.useState)({});async function C(e){if(f===e._id){v(null);return}if(!b[e._id]){let n=await t({reportId:e._id});S(t=>({...t,[e._id]:n}))}v(e._id)}async function w(e){await r({title:g(),description:_(),confirmLabel:c(),destructive:!0})&&(await n({reportId:e._id}),f===e._id&&v(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),` `,(0,Y.jsx)(`strong`,{children:A()}),` `,d()]}),(0,Y.jsx)(q,{title:u(),rows:e,emptyHint:k(),isExpanded:e=>f===e._id&&!!b[e._id],renderExpanded:e=>b[e._id]?(0,Y.jsx)($,{data:b[e._id]}):null,columns:[{header:o(),cell:e=>K(e.at),sort:e=>e.at},{header:s(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:h(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:V(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${H({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:a(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:m(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:x()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:U()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:f===e._id?y():B(),onSelect:()=>void C(e)},{label:E(),onSelect:()=>void w(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,$P as i,AF as a,BF as o,BP as s,CF as c,DF as l,Dz as u,EF as d,Ez as f,FF as p,FP as m,Fz as h,GF as g,GP as ee,Gs as te,HF as _,HP as v,IF as ne,IP as re,JF as ie,JP as ae,KF as y,KP as oe,Ks as b,LF as se,LP as ce,Lz as x,MF as le,NF as ue,OF as de,PF as fe,PP as pe,QF as me,QP as he,RF as ge,RP as S,Rz as C,SF as _e,TF as ve,Tz as ye,UF as be,UP as xe,VF as Se,VP as Ce,WF as we,WP as Te,Ws as Ee,XF as De,XP as Oe,YF as ke,YP as Ae,ZF as je,ZP as Me,_F as Ne,aF as Pe,bF as Fe,cF as Ie,dF as Le,eF as w,eI as Re,fF as ze,gF as Be,hF as Ve,iF as He,jF as Ue,kF as We,lF as Ge,mF as Ke,nF as qe,nI as Je,oF as Ye,pF as Xe,qF as Ze,qP as Qe,qs as T,r as $e,rF as et,sF as tt,t as E,tF as nt,tI as rt,uF as it,vF as at,wF as ot,xF as st,yF as D,zF as ct,zP as lt}from"./api-C_wXCqXM.js";import{t as O}from"./x-Dr9YP2a4.js";import{t as k}from"./button-998QRevY.js";import{$ as A,Et as j,Ft as ut,G as dt,Hn as M,It as N,K as ft,Lt as pt,Mt as mt,Nn as P,Nt as ht,Pn as gt,Pt as F,Q as I,X as L,Z as R,cn as z,et as B,jt as V,q as H,ut as U}from"./index-DDMBZveR.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-Dz033eRk.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-uPHY2-YP.js";import{t as Dt}from"./TimeRangePicker-DI6G5EOI.js";import{t as Ot}from"./FilterBar-C2wwMC41.js";import{t as kt}from"./AdvancedFilter-BvCkEFAZ.js";var q=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 J(e,t,n){return Pt(e,t,n)>=At}function Ft(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function It(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(et());if(e.size>Lt)throw Error(qe());let{source:n,width:r,height:a,cleanup:o}=await Ht(e);try{let o=e.type===`image/svg+xml`,s=Math.min(Rt/r,zt/a,o?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(a*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(w());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Nt(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(w());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);J(e.data,f.width,f.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),m.putImageData(e,0,0)}let h=J(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Bt)??await Y(p,`image/png`);if(!g)throw Error(i());return{blob:g,hasAlpha:h}}finally{o()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return Ut(e)}async function Ut(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(nt())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?u():e===`dark`?f():ye()}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:$e(`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)(M,{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":T(),title:T(),children:(0,X.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(E.charts.listMyCharts),r=x(E.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:Ze()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:y(),subtitle:g(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?we():n.via===`owner`?be():_({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Se()}):null]})}function Qt(){let e=x(E.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(null),[s,u]=(0,q.useState)(!1),[f,p]=(0,q.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),u(!1);try{i(await t.text())}catch{o(D())}}}async function h(){if(o(null),u(!1),t.trim()===``){o(Ne());return}let a;try{a=JSON.parse(r)}catch{o(D());return}p(!0);try{await e({name:t.trim(),tokens:a}),u(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{p(!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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),(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:ve()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:ot(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:c()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:_e(),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)(z,{className:`size-4`}),st(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:f,onClick:()=>void h(),children:Fe()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:at()}):null]})]})}function $t({chart:e}){let t=h(E.charts.setChartLogo),n=x(E.charts.removeChartLogo),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(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`?it():Ge()}),(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)(z,{className:`size-4`}),t?tt():Ie(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Pe()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ye()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Le()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(E.me.getMe,{host:H}),n=x(E.charts.addChartDomain),r=x(E.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.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:he()}),(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:ae()}):u.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Qe({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)(V,{value:i,onChange:e=>a(e.target.value),placeholder:Oe(),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:Ae()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Me()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=x(E.charts.updateChart),n=x(E.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,u]=(0,q.useState)(e.tokens.bpm??0),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(!1);function h(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function g(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(D());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function _(){if(e.chartId!==void 0&&window.confirm(v()))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:h,children:Xe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void _(),children:ze()})]})})]}),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:Te()}),(0,X.jsx)(V,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":b()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?te():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ee()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:xe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:p,onClick:()=>void g(),children:oe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ee()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=C(E.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:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=x(E.charts.addChartToGroupPool),r=x(E.charts.removeChartFromGroupPool),i=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 r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ue():e.kind===`custom`&&e.scope===`personal`?S():fe()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:le()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:a()}),(o??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":de({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(L,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:We()})}),(0,X.jsx)(R,{children:c.map(e=>(0,X.jsx)(I,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ue()}):null]})]})}function an({chart:e}){let t=x(E.charts.promoteChartToCommon),n=x(E.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(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ce():S()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:lt({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:re()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:m()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=x(E.admin.setDefaultThemeMode),a=x(E.admin.setDefaultLocale),c=x(E.charts.setDefaultChart),l=C(E.charts.listChartsAdmin),u=C(E.groups.listGroups,{}),d=e??`system`,f=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:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(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:o()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void c({name:null}),children:y()}),ft.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void c({name:e.key}),children:e.name},e.key)),(l??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void c({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:u??[]},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:ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(()=>{let e=(l??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:pe()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Je()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void i({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:Re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(k,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]})]})}function sn(){let e=C(E.me.getMe,{host:H}),t=dt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,d]=(0,q.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:je()}),(0,X.jsxs)(Q,{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)(P,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(L,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(I,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(I,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(U,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(L,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(I,{value:Z,children:`Toutes directions`}),(0,X.jsx)(I,{value:`inbound`,children:`inbound`}),(0,X.jsx)(I,{value:`outbound`,children:`outbound`}),(0,X.jsx)(I,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(L,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(I,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(I,{value:`info`,children:`info`}),(0,X.jsx)(I,{value:`warn`,children:`warn`}),(0,X.jsx)(I,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(pt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(P,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(ut,{children:`Actions`}),(0,X.jsx)(N,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(N,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{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)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(U,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(U,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(M,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(P,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ak as a,Bk as o,CS as s,D as c,DS as l,Di as u,Dk as d,ES as f,Ei as p,Fk as m,Gk as h,Hk as ee,Ik as te,Jk as g,Kk as _,Lk as ne,Lz as v,MS as y,Mk as b,NS as x,Nk as S,OS as re,Oi as C,Ok as w,PS as ie,Pk as ae,Qx as oe,Rk as T,Rz as E,SS as se,Sk as ce,TS as le,Uk as ue,Vk as de,Wk as D,Xk as O,Yk as k,Zk as A,Zx as j,_S as fe,_k as M,aS as pe,bS as me,bk as N,cS as he,ck as ge,dS as _e,dk as ve,eS as ye,fS as be,fk as xe,gS as Se,gk as Ce,hS as we,hk as Te,iS as Ee,jS as De,jk as Oe,kS as ke,kk as Ae,lS as je,lk as Me,mS as Ne,mk as Pe,nS as Fe,oS as Ie,pS as Le,pk as Re,qk as ze,rS as Be,sS as Ve,t as P,tS as He,uS as Ue,uk as We,vS as Ge,vk as Ke,wS as qe,xS as F,xk as Je,yS as Ye,yk as Xe,zk as I}from"./api-C_wXCqXM.js";import{t as Ze}from"./x-Dr9YP2a4.js";import{i as L,n as R,r as Qe,t as $e}from"./tabs-Cyif3k8O.js";import{t as z}from"./button-998QRevY.js";import{$ as B,Dn as et,Et as V,Fn as tt,Gn as nt,H as rt,Hn as it,Mn as at,Q as H,Wn as ot,X as U,Z as W,a as st,at as ct,ct as G,et as K,i as lt,jn as ut,lt as dt,nt as ft,o as pt,ot as mt,q as ht,rt as gt,s as _t,tt as vt}from"./index-DDMBZveR.js";import{n as yt}from"./TimeRangePicker-DI6G5EOI.js";import{t as bt}from"./FilterBar-C2wwMC41.js";import{t as xt}from"./AdvancedFilter-BvCkEFAZ.js";import{t as St}from"./DataTableShell-BXwJXDDv.js";var 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`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?b():n===`agent`?`${Oe()} - ${r}`:e}function Tt(){let e=E(P.me.getMe,{host:ht})?.role===`admin`,t=E(P.deliveryTiming.getDeliveryStatus,{}),n=v(P.deliveryTiming.startDeliveryRecord),r=v(P.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:A()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:O()})]}),e?(0,J.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?g():k()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(V,{variant:`secondary`,children:ze()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:_({time:dt(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?ue():D()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=E(P.deliveryTiming.listDeliverySessions,{}),n=v(P.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[s,c]=(0,q.useState)(`all`),[l,u]=(0,q.useState)(Y),[d,f]=(0,q.useState)(null),{from:p,to:h}=yt(l),g=l.to===`now`?1/0:h,_=r.trim()!==``||s!==`all`||l!==Y,y=()=>{i(``),c(`all`),u(Y)},b=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,r,s,p,g]),x=e=>{let t=new Set((b??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:de(),timeRange:l,onTimeRangeChange:u,onReset:y,canReset:_,children:(0,J.jsxs)(U,{value:s,onValueChange:e=>c(e),children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:`all`,children:o()}),(0,J.jsx)(H,{value:`active`,children:I()}),(0,J.jsx)(H,{value:`stopped`,children:T()})]})]})}),(0,J.jsx)(St,{title:ee(),rows:b,emptyHint:Me(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?Ae():a(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,J.jsx)(at,{size:15,"aria-hidden":!0}):(0,J.jsx)(ut,{size:15,"aria-hidden":!0})})},{header:ne(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:te(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:m(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:ae(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:S(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(V,{variant:`secondary`,children:I()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:T()})}],rowActions:e?e=>[{label:w(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:w(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=E(P.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.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,J.jsx)(`p`,{className:`oc-admin__hint`,children:d()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:h()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ge()]}),(0,J.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(it,{size:13,"aria-hidden":!0}):(0,J.jsx)(tt,{size:13,"aria-hidden":!0}),t?We():ve()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:N()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Xe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ke()})]})}),(0,J.jsxs)(`tbody`,{children:[i(M(),r.bridge),i(Ce(),r.A),i(Te(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:xe()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Re()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:C()},{value:`principalType`,label:u()},{value:`direction`,label:`direction`},{value:`roleKey`,label:p()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=nt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,u=e.roleKey??Q,d=e.q??``,p=e.correlationId,m=lt(e.from,e.to),h=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:ee,to:te}=yt(m),[g,_]=(0,q.useState)(null),[ne,v]=(0,q.useState)(null),b=e=>void t({search:t=>({...t,limit:e})}),S=e=>void t({search:t=>({...t,kind:e})}),C=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),w=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ae=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),oe=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})}),ue=e=>void t({search:t=>({...t,...pt(e)})}),de=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),D=E(P.observability.listEvents,{limit:n}),O=E(P.observability.listEvents,{limit:n,kind:r===Z?void 0:r,...p?{correlationId:p}:{},filter:{q:d||void 0,from:ee,to:te,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:u===Q?void 0:u,advanced:h.length>0?h:void 0}}),k=(0,q.useMemo)(()=>{let e=new Set;for(let t of D??[])e.add(t.kind);return[...e].sort()},[D]),A=(0,q.useMemo)(()=>{let e=new Set;for(let t of D??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[D]),j=d!==``||a!==Q||o!==Q||c!==Q||u!==Q||h.length>0||m.kind!==`relative`||m.from!==Nt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let N=g?D?.filter(e=>e.correlationId===g):O,ge=e.section,ve=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)($e,{value:ge,onValueChange:e=>ve(e),children:[(0,J.jsxs)(Qe,{className:`w-full`,children:[(0,J.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(et,{size:13,"aria-hidden":!0}),ce()]}),(0,J.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Je()]})]}),(0,J.jsx)(R,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[ie(),(0,J.jsx)(`strong`,{children:x()}),y(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:De()})]}),(0,J.jsxs)(bt,{q:d,onQChange:C,searchPlaceholder:i(),timeRange:m,onTimeRangeChange:ue,onReset:M,canReset:j,children:[(0,J.jsxs)(U,{value:a,onValueChange:w,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:ke()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:re()}),At.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:o,onValueChange:ae,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:l()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:f()}),jt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:c,onValueChange:oe,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:le()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:qe()}),Mt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:u,onValueChange:T,children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{placeholder:s()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:se()}),A.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:r===Z?``:r,placeholder:F(),"aria-label":F(),onChange:e=>{let t=e.target.value.trim();S(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:k.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(U,{value:String(n),onValueChange:e=>b(Number(e)),children:[(0,J.jsx)(B,{size:`sm`,className:`w-28`,children:(0,J.jsx)(K,{})}),(0,J.jsx)(W,{children:kt.map(e=>(0,J.jsx)(H,{value:String(e),children:me({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:h,onChange:de}),g?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>_(null),title:Ye(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ge(),(0,J.jsx)(`code`,{children:$(g)})]}),(0,J.jsx)(Ze,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:fe()})]})}):null,(0,J.jsx)(St,{title:Se(),rows:N,emptyHint:g?we():Ne(),columns:[{header:Le(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:be(),sort:e=>e.kind,cell:e=>(0,J.jsx)(V,{variant:`secondary`,children:e.kind})},{header:_e(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Ue(),children:`✓`})}},{header:je(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(V,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:he(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(V,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Ve(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ie(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:pe(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:Ee(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Be(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Fe(),onClick:()=>_(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:He(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>v(e),children:ye()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:ne,onClose:()=>v(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(vt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ft,{className:`max-w-lg`,children:[(0,J.jsxs)(ct,{children:[(0,J.jsxs)(mt,{className:`oc-traces__meta-title`,children:[r(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(V,{variant:`outline`,children:oe()})]}),(0,J.jsx)(gt,{children:j()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,CD as i,Cx as a,Lz as o,ME as s,QE as c,Rz as l,SD as u,Sx as d,TD as f,ZE as p,_D as m,_x as h,aD as ee,bD as te,bx as g,cD as ne,dD as re,dx as _,eD as v,ep as y,fD as ie,fx as b,gD as ae,gx as x,hD as oe,hx as S,iD as C,lD as w,mD as T,mx as E,nD as se,np as D,oD as ce,pD as le,px as O,rD as ue,sD as de,t as k,tD as fe,tp as A,uD as pe,vD as me,vx as j,wD as M,xD as he,xx as N,yD as ge,yx as P}from"./api-C_wXCqXM.js";import{t as F}from"./button-998QRevY.js";import{$ as I,Dt as L,Et as R,Ft as z,Gn as _e,Lt as ve,Mt as ye,Nt as be,Pt as xe,Q as B,U as Se,W as Ce,Wn as we,X as V,Z as H,at as Te,c as U,dn as W,et as G,fn as K,l as Ee,nt as De,ot as Oe,q as ke,rt as Ae,tt as je,u as q,ut as J}from"./index-DDMBZveR.js";import{t as Y}from"./FilterBar-C2wwMC41.js";import{t as Me}from"./DataTableShell-BXwJXDDv.js";import{t as Ne}from"./DetailChips-hviX2Put.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=l(k.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=l(k.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,u=c?`${c.instanceName}/${c.agentId}`:null,f=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!f.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}))],m=new Map;for(let e of p){let t=m.get(e.instanceName)??[];t.push(e),m.set(e.instanceName,t)}return(0,Z.jsx)(je,{open:n,onOpenChange:r,children:(0,Z.jsxs)(De,{className:`oc-access`,children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(Oe,{children:a({user:t})}),(0,Z.jsx)(Ae,{children:d()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?N():g()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:P()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:x()}):[...m.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:u},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let s=o(k.agents.assignAgent),c=o(k.agents.removeAgent),l=o(k.agents.setDefaultAgent),u=L();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(j(),e)}}async function f(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(h(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(K,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(J,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":S({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,s?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:E()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:O()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":b(),title:b(),children:(0,Z.jsx)(W,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":_(),title:_(),disabled:c,onClick:()=>void f(e.agentId),children:(0,Z.jsx)(W,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return y();case`user`:return A();case`admin`:return D();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ve,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?f():M({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(z,{children:i()}),U.map(e=>{let r=q[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(J,{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=we({from:`/settings/users`}),n=e.q??``,i=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=l(k.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),h=l(k.me.getMe,{host:ke}),g=o(k.admin.setRole),_=o(k.admin.setUserPermissions),y=o(k.admin.startImpersonation),b=o(k.admin.deleteUser),x=o(k.admin.setUserName),S=Se(),E=Ce(),D=L(),[O,A]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await g(e)}catch(e){D.error(u(),e)}}async function F(e){try{await _(e)}catch(e){D.error(he(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await S({title:T(),description:le({user:t}),confirmWord:ie(),confirmLabel:re(),destructive:!0}))try{await b({profileId:e._id}),D.success(w({user:t}))}catch(e){D.error(pe(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await E({title:de(),label:ce({user:t}),placeholder:ee(),defaultValue:e.name??``,confirmLabel:s()});if(n!==null)try{await x({profileId:e._id,name:n}),D.success(C())}catch(e){D.error(ue(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:a,searchPlaceholder:te(),onReset:N,canReset:M,children:(0,Z.jsxs)(V,{value:i,onValueChange:d,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:Q,children:ge()}),j.map(e=>(0,Z.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:me(),rows:f,emptyHint:m(),rowActions:e=>{let t=[{label:p(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ne(),onSelect:()=>void z(e)}];return e.userId!==h?.userId&&t.push({label:ae(),onSelect:()=>void y({profileId:e._id})},{label:oe(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:se(),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:fe(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(V,{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)(H,{children:[(0,Z.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(B,{value:`user`,children:$(`user`)}),(0,Z.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:v(),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:r()}):(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:c(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(K,{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:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||A(null)}})]})}export{Le as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{An as r,Ar as i,Br as a,Cn as o,Cr as s,Dn as c,Dr as l,Er as u,Fr as d,Fz as ee,Gr as f,Gu as te,Hr as p,Ir as m,Kr as h,Lr as g,Lz as _,Mr as ne,Nr as v,On as y,Or as b,Pr as x,Rn as re,Rr as ie,Rz as S,Sn as ae,Tr as oe,Ur as se,Uu as ce,Vr as C,Wr as le,_n as ue,gn as de,in as w,jn as T,jr as E,jz as fe,kO as D,kn as pe,kr as O,kz as k,mf as A,qr as me,t as j,vn as M,wn as N,wr as P,xn as F,yn as I,zr as L}from"./api-C_wXCqXM.js";import{i as R,n as z,r as he,t as ge}from"./tabs-Cyif3k8O.js";import{t as B}from"./button-998QRevY.js";import{$ as V,$t as _e,Et as H,Gn as ve,Q as U,Sn as ye,Un as be,Wn as W,X as G,Z as K,an as xe,en as Se,et as q,in as J,nn as Ce,q as we,rn as Y,sn as Te,tn as Ee,ut as X}from"./index-DDMBZveR.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>a()],[`fr-FR`,()=>T()],[`en-US`,()=>r()],[`en-GB`,()=>pe()],[`de-DE`,()=>y()],[`es-ES`,()=>c()]],Oe=[[`0.75`,()=>ie()],[`1`,()=>g()],[`1.25`,()=>m()],[`1.5`,()=>d()]],$=0;function ke({instance:e}){let t=_(j.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),[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(!1),m=ee(j.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}),c(`idle`)},[e._id]);let h=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function g(){c(`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}),c(`idle`)}catch{c(`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)(H,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":p()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:I()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":I(),children:(0,Q.jsx)(q,{})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`browser`,children:M()}),e.kind===`hermes`?null:(0,Q.jsx)(U,{value:`gateway`,children:ue()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:de()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":C(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{children:De.map(([e,t])=>(0,Q.jsx)(U,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:L()}),(0,Q.jsxs)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":L(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{children:Oe.map(([e,t])=>(0,Q.jsx)(U,{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)(X,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":x()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:v()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!h||s===`saving`,onClick:()=>void g(),children:s===`saving`?A():te()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||l,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(f(!1),J(),Y(),a.engine!==`gateway`){Ce(i(),{lang:Ee(a.lang,fe()),rate:t});return}u(!0),m({instanceName:e.name,text:i()}).then(({mime:e,audioBase64:r})=>{n===$&&Se(r,e,{rate:t})}).catch(()=>{n===$&&f(!0)}).finally(()=>u(!1))},children:l?A():ne()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,u(!1),J(),Y()},children:E()})]}),s===`error`||d?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:d?w():ce()}):null]})}function Ae({stt:e}){let t=S(j.me.getMe,{host:we}),n=_(j.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:b()}),(0,Q.jsx)(H,{variant:e?`secondary`:`outline`,children:e?P():s()}),(0,Q.jsx)(H,{variant:r?`secondary`:`destructive`,children:r?o():ae()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":N()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:N()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:l()})]})}function je(){let e=S(j.admin.listInstances,{}),t=(0,Z.useMemo)(()=>xe(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:r}=ve({from:`/settings/voice`}),i=W({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(H,{variant:t?`secondary`:`destructive`,children:t?h():f()}),(0,Q.jsx)(H,{variant:n?`secondary`:`destructive`,children:n?le():se()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void i({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)(Te,{size:13,"aria-hidden":!0}),F()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ye,{size:13,"aria-hidden":!0}),b()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),u()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):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:u()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:oe()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=_(j.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)(H,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]})]})}export{je as VoiceTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-C_wXCqXM.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$m as e,Bm as t,Gm as n,Hm as r,Jm as i,Km as a,Qm as o,Um as s,Vm as c,Wm as l,Xm as u,Ym as d,Zm as f,_h as p,ah as m,bh as h,ch as g,dh as _,eh as v,fh as y,gh as b,hh as x,ih as S,lh as C,mh as w,nh as T,oh as E,ph as D,qm as O,rh as k,sh as A,th as j,uh as M,vh as N,vt as P,yh as F,yt as I}from"./api-C_wXCqXM.js";var L={AGENT_NOT_FOUND:()=>({label:h(),hint:F()}),AUTH_TOKEN_MISMATCH:()=>({label:N(),hint:p()}),DEVICE_SIGNING_FAILED:()=>({label:b(),hint:x()}),SESSION_SCOPE_DENIED:()=>({label:w(),hint:D()}),GATEWAY_TIMEOUT:()=>({label:y(),hint:_()}),GATEWAY_DISCONNECTED:()=>({label:M(),hint:C()}),GATEWAY_RESTARTING:()=>({label:g(),hint:A()}),CONNECTION_SATURATED:()=>({label:E(),hint:m()}),DISPATCH_STALLED:()=>({label:I(),hint:P()}),ATTACHMENT_TOO_LARGE:()=>({label:T(),hint:j()}),ATTACHMENT_REJECTED:()=>({label:v(),hint:e()}),BRIDGE_UNREACHABLE:()=>({label:S(),hint:k()}),INVALID_REQUEST:()=>({label:o(),hint:f()}),chat_request_conflict:()=>({label:u(),hint:d()}),NOT_CONFIGURED:()=>({label:i(),hint:O()}),UNROUTED:()=>({label:a(),hint:n()}),UPSTREAM_ERROR:()=>({label:l(),hint:s()}),UNKNOWN:()=>({label:r(),hint:c()})};function R(e){return e?L[e]?.()??{label:e,hint:t()}:L.UNKNOWN()}export{R as t};
|