@lacneu/atrium 0.10.12 → 0.10.13
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-ByOF_9U7.js → AccessTab-CEi2jEXZ.js} +1 -1
- package/dist/assets/{AdvancedFilter-I8EFwacj.js → AdvancedFilter-EPxqO-eA.js} +1 -1
- package/dist/assets/{AgentFilesTab-BbOThmoA.js → AgentFilesTab-lYSv6XmB.js} +2 -2
- package/dist/assets/{AnomaliesTab-CZXAth8X.js → AnomaliesTab-BOKqiWd2.js} +1 -1
- package/dist/assets/{AuditTab-NDOuL0Lj.js → AuditTab-DnBhTYMJ.js} +1 -1
- package/dist/assets/BridgeTab-BiMrYTrr.js +1 -0
- package/dist/assets/ChatDefaultsTab-lJmDn_58.js +1 -0
- package/dist/assets/{DataTableShell-DB_nXosI.js → DataTableShell-BpD7pA0i.js} +1 -1
- package/dist/assets/{DetailChips-D5ajSYYG.js → DetailChips-BA1mq7Wm.js} +1 -1
- package/dist/assets/{FeedbacksTab-zXU6kI7V.js → FeedbacksTab-Dt92LCDU.js} +1 -1
- package/dist/assets/{FieldLabel-BeAnlLfA.js → FieldLabel-CFckKZrw.js} +1 -1
- package/dist/assets/FilesTab-CABwvKIR.js +1 -0
- package/dist/assets/{FilterBar-BJDv7ENT.js → FilterBar-DB-b7WAm.js} +1 -1
- package/dist/assets/GroupsTab-01UtVbu_.js +1 -0
- package/dist/assets/InstancesTab-CRA7-G_l.js +1 -0
- package/dist/assets/IntegrationsTab-Dtf3L_gX.js +1 -0
- package/dist/assets/{KpiTab-n3i5WDnQ.js → KpiTab-CYRAZPuB.js} +1 -1
- package/dist/assets/PreferencesTab-CjVBIxqe.js +1 -0
- package/dist/assets/{PromptInjectionsTab-BrI6Q-c7.js → PromptInjectionsTab-O-RMzIb1.js} +2 -2
- package/dist/assets/{RolesTab-DE5lmr5N.js → RolesTab-68zkT6ks.js} +1 -1
- package/dist/assets/ServiceAccountsTab-CvguS5Iy.js +1 -0
- package/dist/assets/ThemeShowroom-DhKQpNPj.js +1 -0
- package/dist/assets/{TimeRangePicker-DsW1QCH4.js → TimeRangePicker--wX3a-5x.js} +1 -1
- package/dist/assets/{TracesTab-BOrqSSNT.js → TracesTab-DO0c_Ypn.js} +1 -1
- package/dist/assets/UsersTab-BMM1oQPU.js +1 -0
- package/dist/assets/{button-DgXvFpn-.js → button-x4eiKyNo.js} +1 -1
- package/dist/assets/{card-Dbpx1kqO.js → card-BpwyvJ1X.js} +1 -1
- package/dist/assets/chevrons-up-down-Dn5VCqqo.js +1 -0
- package/dist/assets/{compatView-DsYryBsX.js → compatView-D1fAiei9.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-BUw7_r6A.js → dispatchErrorInfo-CIQ2MRwS.js} +1 -1
- package/dist/assets/{dist-LmEWWbCO.js → dist-BhemspoL.js} +1 -1
- package/dist/assets/{dist-B1WV6sgR.js → dist-BiCy_qcc.js} +1 -1
- package/dist/assets/{dist-Cad_J654.js → dist-VD7Y9bPB.js} +1 -1
- package/dist/assets/{dist-Ce__brvM.js → dist-uStCogeE.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-mni8GXYM.js → highlighted-body-OFNGDK62-CdPsDE0f.js} +1 -1
- package/dist/assets/index-BlZ8oKFa.js +220 -0
- package/dist/assets/mermaid-GHXKKRXX-DgFC5iC-.js +1 -0
- package/dist/assets/roleDescriptions-DJHA0ezr.js +1 -0
- package/dist/assets/{table-SUDKYeE8.js → table-BQp_EgUj.js} +1 -1
- package/dist/assets/x-C9JKw9Pc.js +1 -0
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/BridgeTab-CL3W0gfM.js +0 -1
- package/dist/assets/ChatDefaultsTab-BjDJ8Q4m.js +0 -1
- package/dist/assets/FilesTab-CCmsh1xd.js +0 -1
- package/dist/assets/GroupsTab-Cu2bUJnJ.js +0 -1
- package/dist/assets/InstancesTab-BLoVAiLO.js +0 -1
- package/dist/assets/IntegrationsTab-BsYuZfmL.js +0 -1
- package/dist/assets/PreferencesTab-DDOOdCN6.js +0 -1
- package/dist/assets/ServiceAccountsTab-C9EtvgMh.js +0 -1
- package/dist/assets/ThemeShowroom-BKg8rdmA.js +0 -1
- package/dist/assets/UsersTab-DkwZ1S_U.js +0 -1
- package/dist/assets/chevrons-up-down-CTaYCZ4D.js +0 -1
- package/dist/assets/index-B0OTsC0S.js +0 -220
- package/dist/assets/mermaid-GHXKKRXX-htap4Ez7.js +0 -1
- package/dist/assets/roleDescriptions-ASM2ogBV.js +0 -1
- package/dist/assets/x-CmMNOdcT.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./index-BlZ8oKFa.js";export{e as Mermaid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cd as e,Ed as t,Sd as n,Td as r,wd as i}from"./dist-BhemspoL.js";var a={pending:t,user:r,admin:i,observer:e,agent:n};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-
|
|
1
|
+
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BhemspoL.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RC as e}from"./dist-BhemspoL.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/dist/index.html
CHANGED
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-BlZ8oKFa.js"></script>
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
|
|
43
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
44
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
45
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
46
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BhemspoL.js">
|
|
44
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BiCy_qcc.js">
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-VD7Y9bPB.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-uStCogeE.js">
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/x-C9JKw9Pc.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/button-x4eiKyNo.js">
|
|
49
49
|
<link rel="stylesheet" crossorigin href="/assets/index-D2yjtZhd.css">
|
|
50
50
|
</head>
|
|
51
51
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacneu/atrium",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.13",
|
|
4
4
|
"description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{As as r,BC as i,Bs as a,Cs as o,Ds as s,Ec as c,Es as l,Fs as u,Gs as d,HC as f,Hs as p,IC as m,Is as h,LC as g,Ls as ee,Ms as te,Ns as ne,Os as _,Ps as v,Rs as re,Sc as ie,Ss as y,Tc as b,Ts as x,UC as S,Us as ae,Vs as oe,Ws as se,_ as C,_c as ce,_s as w,a as le,as as T,b as ue,bc as de,bs as fe,cs as pe,d as me,ds as he,f as ge,fs as _e,g as ve,gc as ye,gs as be,h as xe,hc as Se,hs as Ce,is as E,js as we,ks as Te,l as Ee,ls as De,m as Oe,mc as ke,ms as Ae,os as je,p as Me,pc as Ne,ps as Pe,rs as D,ss as Fe,u as Ie,us as Le,v as Re,vc as ze,vs as Be,wc as Ve,ws as He,xc as Ue,xs as We,y as Ge,yc as Ke,ys as qe,zs as Je}from"./dist-LmEWWbCO.js";import{i as O,r as Ye}from"./dist-B1WV6sgR.js";import{t as Xe}from"./chevrons-up-down-CTaYCZ4D.js";import{a as Ze,i as Qe,n as k,o as $e,r as et}from"./FieldLabel-BeAnlLfA.js";import{t as A}from"./button-DgXvFpn-.js";import{$ as tt,A as nt,C as j,Dt as rt,Et as it,F as at,J as ot,L as st,N as ct,O as lt,P as ut,Q as dt,R as ft,S as M,St as pt,Tt as N,X as mt,Y as ht,Z as gt,at as _t,b as P,gt as vt,m as F,nt as yt,pt as I,q as L,x as R,xt as bt,y as z}from"./index-B0OTsC0S.js";import{a as xt,i as B,n as St,o as V,r as H,t as Ct}from"./table-SUDKYeE8.js";import{t as wt}from"./FilterBar-BJDv7ENT.js";import{a as U,n as Tt,o as W,r as G,s as Et,t as Dt}from"./compatView-DsYryBsX.js";import{t as K}from"./dispatchErrorInfo-BUw7_r6A.js";var Ot=g(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),kt=g(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),q=t(e(),1);function At(e){return e.filter(e=>e.state===`error`)}function jt(e){return e.reachable&&At(e.targets).length===0}function Mt(e){return e.state===`error`&&e.lastErrorCode!==null}function Nt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function Pt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ft(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,J(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(J(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Pt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>J(e)===r)}))}function It(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Lt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Rt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function zt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Bt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Vt(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return W(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function Ht(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Bt(t.key,e),a=Bt(t.key,r);return i&&a?0:i?1:a?-1:n*Vt(t.key,e,r)})}function Ut(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function Wt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function Gt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>W(e,t)??Z(e,t))}var Q=n();function Kt({connections:e,displayByInstance:t}){let[n,r]=(0,q.useState)(Lt),[i,a]=(0,q.useState)(null),o=(0,q.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,q.useMemo)(()=>Ut(o),[o]),c=(0,q.useMemo)(()=>Wt(o),[o]),l=(0,q.useMemo)(()=>Gt(o),[o]),u=(0,q.useMemo)(()=>Ht(zt(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(wt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Be(),onReset:()=>r(Lt),canReset:Rt(n),children:[(0,Q.jsxs)(z,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(M,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:be()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(R,{value:Y,children:w()}),s.map(e=>(0,Q.jsx)(R,{value:e,children:Jt(e)},e))]})]}),(0,Q.jsxs)(z,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(M,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(j,{placeholder:Ce()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(R,{value:Y,children:w()}),c.map(e=>(0,Q.jsx)(R,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(z,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(M,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:Ae()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(R,{value:Y,children:w()}),l.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))]})]})]}),u.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}):(0,Q.jsxs)(Ct,{className:`oc-conn__table`,children:[(0,Q.jsx)(xt,{children:(0,Q.jsxs)(V,{children:[(0,Q.jsx)($,{label:_e(),sortKey:`target`,sort:i,onSort:d}),(0,Q.jsx)($,{label:he(),sortKey:`state`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Le(),sortKey:`instance`,sort:i,onSort:d}),(0,Q.jsx)($,{label:De(),sortKey:`host`,sort:i,onSort:d}),(0,Q.jsx)($,{label:pe(),sortKey:`version`,sort:i,onSort:d}),(0,Q.jsx)(B,{children:Fe()}),(0,Q.jsx)($,{label:je(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Q.jsx)(St,{children:u.map(e=>(0,Q.jsx)(qt,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(B,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(Ye,{size:13,"aria-hidden":!0}):(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Xe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function qt({r:e}){let t=Mt(e)?K(e.lastErrorCode):null,n=Nt(e)?K(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(q.Fragment,{children:[(0,Q.jsxs)(V,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(H,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(Yt,{state:e.state})}),(0,Q.jsx)(H,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(H,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:fe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(H,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(V,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(H,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[qe({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Jt(e){return e===`connected`?T():e===`error`?E():D()}function Yt({state:e}){return e===`connected`?(0,Q.jsx)(F,{variant:`secondary`,children:T()}):e===`error`?(0,Q.jsx)(F,{variant:`destructive`,children:E()}):(0,Q.jsx)(F,{variant:`outline`,children:D()})}function Xt(){return S(m.bridgeHealth.getBridgeHealth,{})}function Zt(){let e=Xt(),t=S(m.compat.getBridgeCompat,{}),n=S(m.me.getMe,{host:_t})?.role===`admin`,r=S(m.admin.listInstances,n?{}:`skip`),i=rt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Ft(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&Tt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(Qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:we()}),o.map(e=>(0,Q.jsx)($t,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:le()}):null]})}function Qt({health:e,compat:t,onSeeAnomalies:n}){let i=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(t.bridgeVersion)}),` · `,Re(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?C():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Te()});let a=At(e.targets),c=!e.reachable,u=jt(e),d=u?`ok`:`error`,f=new Date(e.checkedAt).toLocaleString(`fr-FR`),p=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${d}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Q.jsx)(N,{size:22}):c?(0,Q.jsx)(kt,{size:22}):(0,Q.jsx)(I,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?_():c?s():l({count:a.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Ot,{size:12,"aria-hidden":!0}),` `,x({time:f})]}),p?(0,Q.jsx)(`span`,{children:He({time:p})}):null,i]}),c?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:K(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:o()})]})}function $t({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Et(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:Dt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),g=m===null?null:n.find(e=>e.name===m)??null,ee=new Set(n.map(e=>e.name));return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(vt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:It(e)}),d?(0,Q.jsx)(F,{variant:d===`beyond`?`destructive`:`secondary`,children:G(d)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:ue()}),(0,Q.jsx)(en,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c,canConfigure:e=>ee.has(e),onConfigure:h}),(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(it,{size:13,"aria-hidden":!0}),y({count:t.length})]}),f?(0,Q.jsx)(Kt,{connections:t,displayByInstance:s}):null,g?(0,Q.jsx)(tn,{instance:g,onClose:()=>h(null)},g._id):null]})}function en({support:e,compatStatus:t,compatReachable:n,manifest:i,instanceRows:a,canConfigure:o,onConfigure:s}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}),i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:xe()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Oe()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Me({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:C()}),e?(0,Q.jsx)(an,{versions:e.validatedVersions}):null]}),a.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:a.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(e.version)}),(0,Q.jsx)(F,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:G(e.state)}),o(e.instanceName)?(0,Q.jsxs)(gt,{children:[(0,Q.jsx)(yt,{asChild:!0,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon`,className:`oc-compat__target-menu`,"aria-label":b(),children:(0,Q.jsx)(pt,{size:16,"aria-hidden":!0})})}),(0,Q.jsx)(dt,{align:`end`,children:(0,Q.jsx)(tt,{onSelect:()=>s(e.instanceName),children:b()})})]}):null]},e.instanceName))})]})}function tn({instance:e,onClose:t}){return(0,Q.jsx)(ct,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(ut,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(st,{children:[(0,Q.jsx)(ft,{children:c({instance:e.displayName??e.name})}),(0,Q.jsx)(at,{children:Ve()})]}),(0,Q.jsx)(rn,{instance:e,onClose:t})]})})}function nn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(N,{"aria-hidden":!0}):(0,Q.jsx)(I,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?u():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,v()]}):null}function rn({instance:e,onClose:t}){let n=f(m.admin.upsertInstanceConfig),r=i(m.bridge.validateMediaPaths),o=nt(),[s,c]=(0,q.useState)(()=>Qe(e.config??{})),[l,u]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(null),b=s.inboundMediaMode===`shared-fs`,x=s.mediaMode===`shared-fs`,S=b||x;async function C(){_(!0),y(null);try{y(await r({instanceName:e.name,inboundMediaMode:s.inboundMediaMode,mediaMode:s.mediaMode}))}catch(e){o.error(Je(),e)}finally{_(!1)}}async function w(){u(!0);try{let r=e.config??{};await n({instanceId:e._id,config:et(s,r)}),t()}catch(e){o.error(ce(),e)}finally{u(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:ie(),help:ye()}),(0,Q.jsxs)(z,{value:s.mediaMode,onValueChange:e=>c({...s,mediaMode:e}),children:[(0,Q.jsx)(M,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(P,{children:$e.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Ue(),help:Se()}),(0,Q.jsxs)(z,{value:s.inboundMediaMode,onValueChange:e=>c({...s,inboundMediaMode:e}),children:[(0,Q.jsx)(M,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(P,{children:Ze.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:de(),help:ke()}),(0,Q.jsx)(L,{type:`number`,min:1,max:4096,className:`w-full`,value:s.mediaMaxMb,onChange:e=>c({...s,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),S&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:d(),help:se()}),(0,Q.jsx)(L,{className:`w-full`,spellCheck:!1,value:s.inboundAgentMount,onChange:e=>c({...s,inboundAgentMount:e.target.value})})]}),x&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:ae(),help:p()}),(0,Q.jsx)(L,{className:`w-full`,spellCheck:!1,value:s.outboundAgentMount,onChange:e=>c({...s,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(lt,{checked:s.rehydration,onCheckedChange:e=>c({...s,rehydration:e===!0})}),(0,Q.jsx)(k,{label:Ke(),help:Ne()})]}),S&&v!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),te({reason:v.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(nn,{label:ee(),result:v.inbound}),(0,Q.jsx)(nn,{label:h(),result:v.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:re()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),ne()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void C(),disabled:g,children:[g?(0,Q.jsx)(bt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?a():oe()]}),(0,Q.jsx)(A,{size:`sm`,onClick:()=>void w(),disabled:l,children:ze()})]})]})})}function an({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(mt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?ge():me({count:e.length}),(0,Q.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(ht,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Ie()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(F,{variant:`secondary`,children:e},e))})]})]})}export{Zt as BridgeTab,tn as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{A as r,BC as i,C as a,Cc as o,D as s,E as ee,Gt as te,IC as c,M as ne,N as re,O as ie,Rt as ae,S as oe,T as se,UC as l,Ut as u,j as d,k as f,lC as p,lt as m,nv as h,w as ce,x as g,zt as le}from"./dist-LmEWWbCO.js";import{t as _}from"./button-DgXvFpn-.js";import{A as ue,B as de,C as fe,G as pe,H as me,K as he,S as v,U as y,V as b,W as x,_ as S,b as C,g as w,pt as T,v as E,x as D,y as O,z as k}from"./index-B0OTsC0S.js";import{i as A}from"./compatView-DsYryBsX.js";/* empty css */var j=t(e(),1),M=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function N(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}var P=n();function F(){let e=i(c.agentFiles.getChatDefaults),t=i(c.agentFiles.setChatDefaults),n=ue(),[F,I]=(0,j.useState)({status:`loading`}),[L,R]=(0,j.useState)({thinkingDefault:null,fastModeDefault:null}),[ge,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),H=l(c.admin.listInstances,{}),[U,W]=(0,j.useState)(null);(0,j.useEffect)(()=>{!H||H.length===0||(!U||!H.some(e=>e.name===U))&&W(H[0].name)},[H,U]);let G=(H?.length??0)>1,_e=H!==void 0&&H.length===0,ve=l(c.compat.forInstance,U?{instanceName:U}:`skip`),K=U?S(ve,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,j.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,j.useRef)(0),X=(0,j.useCallback)(async()=>{let t=++Y.current;I({status:`loading`});try{let n=N(await e(J));if(Y.current!==t)return;I({status:`done`,current:n}),R(n)}catch{if(Y.current!==t)return;I({status:`error`})}},[e,J]);(0,j.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=F.status===`done`?F.current:null,Q=Z!==null&&L.thinkingDefault!==null&&L.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&L.fastModeDefault!==null&&L.fastModeDefault!==Z.fastModeDefault,ye=Q||$;async function be(){V(!0);try{await t({...J,...Q?{thinkingDefault:L.thinkingDefault}:{},...$?{fastModeDefault:L.fastModeDefault}:{}}),n.success(ee()),await X()}catch(e){n.error(se(),e)}finally{V(!1)}}let xe=(0,j.useMemo)(()=>M.map(e=>({id:e,label:E(e)})),[]),Se=(0,j.useMemo)(()=>[{id:`fast`,label:le()},{id:`standard`,label:ae()}],[]);return(0,P.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:re()}),G&&U?(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,P.jsxs)(O,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,P.jsx)(v,{size:`sm`,"aria-label":m(),children:(0,P.jsx)(fe,{})}),(0,P.jsx)(C,{children:(H??[]).map(e=>(0,P.jsx)(D,{value:e.name,children:e.name},e.name))})]})]}):null,_e?(0,P.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:o()}):K===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):K.blocked?(0,P.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,P.jsx)(T,{size:14,"aria-hidden":!0}),` `,A(K.gatewayVersion)]}):F.status===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):F.status===`error`?(0,P.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[ie(),` `,(0,P.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:u()})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:ne()}),(0,P.jsx)(w,{options:xe,value:L.thinkingDefault,onChange:e=>R({...L,thinkingDefault:e}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:d()})]}),(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,P.jsx)(w,{options:Se,value:L.fastModeDefault===null?null:L.fastModeDefault?`fast`:`standard`,onChange:e=>R({...L,fastModeDefault:e===`fast`}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]}),(0,P.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,P.jsx)(_,{size:`sm`,disabled:!ye||B,onClick:()=>z(!0),children:B?te():s()})}),(0,P.jsx)(`p`,{className:`oc-cdefaults__note`,children:ce()})]}),(0,P.jsx)(k,{open:ge,onOpenChange:z,children:(0,P.jsxs)(me,{children:[(0,P.jsxs)(pe,{children:[(0,P.jsx)(he,{children:a()}),(0,P.jsx)(y,{children:oe()})]}),(0,P.jsxs)(x,{children:[(0,P.jsx)(b,{children:h()}),(0,P.jsx)(de,{onClick:()=>void be(),children:g()})]})]})})]})}export{F as ChatDefaultsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AS as r,BS as ee,CS as te,DS as i,ES as a,FS as o,HC as s,IC as c,IS as ne,LS as l,MS as u,NS as d,OS as f,PS as p,RS as m,SS as re,TS as h,UC as ie,VS as ae,_S as oe,bS as se,cS as ce,dC as le,dS as ue,fS as de,gS as fe,hS as pe,jS as me,kS as g,lC as he,lS as ge,mS as _,nv as _e,oS as ve,pS as v,sS as y,uS as b,vS as x,wS as S,xS as C,yS as w,zS as T}from"./dist-LmEWWbCO.js";import{t as E}from"./button-DgXvFpn-.js";import{$ as D,A as O,B as k,C as A,Ct as j,G as M,H as N,K as P,Q as F,S as I,St as ye,U as be,V as xe,W as Se,Z as Ce,b as L,m as we,mt as Te,nt as Ee,vt as De,x as R,y as z,z as Oe}from"./index-B0OTsC0S.js";import{a as ke,i as B,n as Ae,o as V,r as H,t as je}from"./table-SUDKYeE8.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return r();case`audio`:return g();case`video`:return f();case`pdf`:return i();case`document`:return a();case`archive`:return h();default:return S()}}function q(){let[e,t]=(0,U.useState)(G),[n,r]=(0,U.useState)(G),[i,a]=(0,U.useState)(G),[f,h]=(0,U.useState)(G),[g,S]=(0,U.useState)(null),q=s(c.files.softDelete),J=O();function Me(){t(G),r(G),a(G),h(G)}async function Ne(){let e=g;if(S(null),e)try{await q({fileId:e.id}),J.success(v())}catch(e){J.error(de(),e)}}let Y=ie(c.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:i===G?void 0:i,category:f===G?void 0:f}),X=(0,U.useMemo)(()=>new Intl.DateTimeFormat(le(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(Y===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:he()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=Y,$=e!==G||n!==G||i!==G||f!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(z,{value:e,onValueChange:t,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":ee(),children:(0,W.jsx)(A,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:T()}),(0,W.jsx)(R,{value:`inbound`,children:m()}),(0,W.jsx)(R,{value:`outbound`,children:l()})]})]}),(0,W.jsxs)(z,{value:n,onValueChange:r,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":ne(),children:(0,W.jsx)(A,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:o()}),Q.chats.map(e=>(0,W.jsx)(R,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(z,{value:i,onValueChange:a,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":p(),children:(0,W.jsx)(A,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:d()}),Q.instances.map(e=>(0,W.jsx)(R,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(z,{value:f,onValueChange:h,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":u(),children:(0,W.jsx)(A,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:me()}),Q.categories.map(e=>(0,W.jsx)(R,{value:e,children:K(e)},e))]})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Me,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(De,{size:14,"aria-hidden":!0}),fe()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?y():ce()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(je,{children:[(0,W.jsx)(ke,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:te()}),(0,W.jsx)(B,{children:re()}),(0,W.jsx)(B,{children:C()}),(0,W.jsx)(B,{children:se()}),(0,W.jsx)(B,{children:w()}),(0,W.jsx)(B,{className:`text-right`,children:x()})]})}),(0,W.jsx)(Ae,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsx)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(we,{variant:`secondary`,children:e.direction===`inbound`?m():l()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:X.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Ce,{children:[(0,W.jsx)(Ee,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":pe(),children:(0,W.jsx)(ye,{size:16})})}),(0,W.jsxs)(F,{align:`end`,children:[e.url?(0,W.jsx)(D,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(j,{size:14}),oe()]})}):(0,W.jsxs)(D,{disabled:!0,children:[(0,W.jsx)(j,{size:14}),ge()]}),(0,W.jsxs)(D,{variant:`destructive`,onSelect:()=>S({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Te,{size:14}),_()]})]})]})})]},e._id))})]}),Pe?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:ve({cap:Fe})}):null]}),(0,W.jsx)(Oe,{open:g!==null,onOpenChange:e=>!e&&S(null),children:(0,W.jsxs)(N,{children:[(0,W.jsxs)(M,{children:[(0,W.jsx)(P,{children:ue()}),(0,W.jsx)(be,{children:b()})]}),(0,W.jsxs)(Se,{children:[(0,W.jsx)(xe,{children:_e()}),(0,W.jsx)(k,{onClick:()=>void Ne(),children:_()})]})]})})]})}export{q as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,An as i,Bn as a,Cn as o,Dn as s,En as c,Fn as l,Gn as u,HC as d,Hn as f,IC as p,In as m,Jn as h,Kn as g,LC as _,Ln as v,Mn as y,Nn as b,OC as x,On as S,Pn as C,Qn as ee,Rn as te,SC as w,Sn as T,TC as E,Tn as ne,UC as D,Un as re,Vn as ie,Wn as ae,Xn as O,Yn as oe,Zn as k,_n as A,an as se,ar as ce,bC as j,bn as M,cn as le,cr as ue,dn as de,dr as fe,er as N,fn as pe,fr as P,gn as me,hn as he,in as ge,ir as _e,jn as ve,kC as F,kn as ye,ln as be,lr as xe,mn as Se,n as I,nr as Ce,on as we,or as Te,pn as Ee,qn as De,rn as Oe,rr as ke,sn as L,sr as Ae,t as je,tr as Me,un as Ne,ur as Pe,vn as Fe,wn as Ie,xC as Le,xn as Re,yn as ze,zn as Be}from"./dist-LmEWWbCO.js";import{t as Ve}from"./dist-B1WV6sgR.js";import{t as He}from"./x-CmMNOdcT.js";import{t as R}from"./button-DgXvFpn-.js";import{A as z,C as Ue,Et as We,F as Ge,L as Ke,N as qe,O as B,P as Je,R as Ye,S as Xe,at as Ze,b as Qe,dt as $e,ft as et,gt as V,h as tt,ht as H,j as nt,m as U,q as W,ut as rt,x as it,y as at}from"./index-B0OTsC0S.js";import{t as ot}from"./FilterBar-BJDv7ENT.js";import{t as st}from"./DataTableShell-DB_nXosI.js";import{t as G}from"./DetailChips-D5ajSYYG.js";var ct=_(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),lt=_(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),K=_(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ut=_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),q=t(e(),1),J=n(),Y=`Tabs`,[dt,ft]=E(Y,[et]),pt=et(),[mt,X]=dt(Y),ht=q.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Ve(s),[d,f]=w({prop:r,onChange:i,defaultProp:a??``,caller:Y});return(0,J.jsx)(mt,{scope:n,baseId:j(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,J.jsx)(F.div,{dir:u,"data-orientation":o,...l,ref:t})})});ht.displayName=Y;var gt=`TabsList`,_t=q.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=X(gt,n),o=pt(n);return(0,J.jsx)($e,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,J.jsx)(F.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});_t.displayName=gt;var vt=`TabsTrigger`,yt=q.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=X(vt,n),s=pt(n),c=St(o.baseId,r),l=Ct(o.baseId,r),u=r===o.value;return(0,J.jsx)(rt,{asChild:!0,...s,focusable:!i,active:u,children:(0,J.jsx)(F.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:x(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:x(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:x(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});yt.displayName=vt;var bt=`TabsContent`,xt=q.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=X(bt,n),c=St(s.baseId,r),l=Ct(s.baseId,r),u=r===s.value,d=q.useRef(u);return q.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,J.jsx)(Le,{present:i||u,children:({present:n})=>(0,J.jsx)(F.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});xt.displayName=bt;function St(e,t){return`${e}-trigger-${t}`}function Ct(e,t){return`${e}-content-${t}`}var wt=ht,Tt=_t,Et=yt,Dt=xt;function Ot(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function kt(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function At(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function jt(e){switch(e){case`admin`:return b();case`user`:return y();case`pending`:return ve();default:return e}}function Mt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function Nt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}function Pt({className:e,orientation:t=`horizontal`,...n}){return(0,J.jsx)(wt,{"data-slot":`tabs`,"data-orientation":t,className:I(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Ft=je(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function It({className:e,variant:t=`default`,...n}){return(0,J.jsx)(Tt,{"data-slot":`tabs-list`,"data-variant":t,className:I(Ft({variant:t}),e),...n})}function Z({className:e,...t}){return(0,J.jsx)(Et,{"data-slot":`tabs-trigger`,className:I(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Q({className:e,...t}){return(0,J.jsx)(Dt,{"data-slot":`tabs-content`,className:I(`flex-1 text-sm outline-none`,e),...t})}var $={name:``,description:``};function Lt(){let e=D(p.groups.listGroups,{}),t=D(p.me.getMe,{host:Ze})?.role===`admin`,n=d(p.groups.createGroup),i=d(p.groups.updateGroup),a=d(p.groups.deleteGroup),o=nt(),s=z(),[c,l]=(0,q.useState)(!1),[f,m]=(0,q.useState)(null),[_,v]=(0,q.useState)($),[y,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(``),C=(0,q.useMemo)(()=>{if(!e)return e;let t=x.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,x]);function te(){m(null),v($),l(!0)}function w(e){m(e),v({name:e.name,description:e.description??``}),l(!0)}async function T(){try{f?await i({groupId:f._id,name:_.name,description:_.description}):await n({name:_.name,description:_.description||void 0}),v($),m(null),l(!1)}catch(e){s.error(we(),e)}}async function E(e){if(await o({title:De({name:e.name}),description:g(),confirmWord:e.name,confirmLabel:u(),cancelLabel:r(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(se(),e)}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),(0,J.jsx)(ot,{q:x,onQChange:S,onReset:()=>S(``),canReset:x!==``,searchPlaceholder:_e()}),(0,J.jsx)(st,{title:P(),rows:C,addLabel:Pe(),onAdd:t?te:void 0,emptyHint:xe(),columns:[{header:ue(),cell:e=>e.name,sort:e=>e.name},{header:Ae(),cell:e=>(0,J.jsx)(G,{icon:(0,J.jsx)(ut,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,J.jsx)(K,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Te(),cell:e=>(0,J.jsx)(G,{icon:(0,J.jsx)(V,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ce(),cell:e=>(0,J.jsx)(G,{icon:(0,J.jsx)(lt,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,J.jsx)(H,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:ke(),onSelect:()=>b({groupId:e._id,name:e.name})},...t?[{label:Ce(),onSelect:()=>w(e)},{label:Me(),variant:`destructive`,onSelect:()=>void E(e)}]:[]]}),(0,J.jsx)(tt,{open:c,onOpenChange:l,title:f?k():ee(),description:O(),canSubmit:!!_.name.trim(),onSubmit:T,submitLabel:N(),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:oe()}),(0,J.jsx)(W,{value:_.name,onChange:e=>v({..._,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:h()}),(0,J.jsx)(W,{value:_.description,onChange:e=>v({..._,description:e.target.value})})]})]})}),(0,J.jsx)(Bt,{groupId:y?.groupId??null,groupName:y?.name??``,open:y!==null,onOpenChange:e=>{e||b(null)}})]})}var Rt=8;function zt({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,J.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,J.jsxs)(R,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,J.jsx)(ct,{size:14,"aria-hidden":!0}),m()]}),(0,J.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":C({page:e,pages:t}),children:[e,` / `,t]}),(0,J.jsxs)(R,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[l(),(0,J.jsx)(We,{size:14,"aria-hidden":!0})]})]})}function Bt({groupId:e,groupName:t,open:n,onOpenChange:r}){let o=D(p.groups.getGroup,n&&e?{groupId:e}:`skip`),s=D(p.groups.listAssignableInstances,n?{}:`skip`),l=D(p.groups.listAssignableUsers,n?{}:`skip`),u=d(p.groups.addMember),m=d(p.groups.removeMember),h=d(p.groups.bulkSetMembers),g=d(p.groups.setGroupManager),_=z(),[y,b]=(0,q.useState)(``),[x,C]=(0,q.useState)(``),[ee,w]=(0,q.useState)(`members`),[T,E]=(0,q.useState)(1),[O,oe]=(0,q.useState)(new Set),k=(0,q.useRef)(null),A=(0,q.useMemo)(()=>new Set((o?.members??[]).map(e=>e.userId)),[o]),se=(0,q.useMemo)(()=>new Set((o?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[o]),ce=o?.viewerIsAdmin===!0,j=(0,q.useMemo)(()=>new Set((o?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[o]);(0,q.useEffect)(()=>{b(``),C(``),w(`members`),E(1),k.current=null},[n,e]),(0,q.useEffect)(()=>{E(1)},[y]),(0,q.useEffect)(()=>{n&&o&&e&&k.current!==e&&(k.current=e,oe(new Set((o.members??[]).map(e=>e.userId))))},[n,o,e]);let M=(0,q.useMemo)(()=>l?Ot(l,y,O):[],[l,y,O]);async function ue(t,n){if(e)try{n?await m({groupId:e,userId:t}):await u({groupId:e,userId:t})}catch(e){_.error(ge(),e)}}async function fe(t,n){if(e)try{await g({groupId:e,userId:t,manager:!n})}catch(e){_.error(le(),e)}}let N=Mt(M,e=>A.has(e.userId)),pe=M.filter(e=>A.has(e.userId)).length,P=Nt(M,T,Rt);async function me(){if(!e||M.length===0)return;let t=M.map(e=>e.userId);try{await h({groupId:e,userIds:t,member:N!==`all`})}catch(e){_.error(ge(),e)}}return(0,J.jsx)(qe,{open:n,onOpenChange:r,children:(0,J.jsxs)(Je,{className:`oc-access`,children:[(0,J.jsxs)(Ke,{children:[(0,J.jsx)(Ye,{children:ae({name:t})}),(0,J.jsx)(Ge,{children:re()})]}),(0,J.jsxs)(Pt,{value:ee,onValueChange:w,className:`oc-access__tabs`,children:[(0,J.jsxs)(It,{className:`w-full`,children:[(0,J.jsxs)(Z,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(ut,{size:13,"aria-hidden":!0}),f(),o?(0,J.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:A.size}):null]}),(0,J.jsxs)(Z,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(V,{size:13,"aria-hidden":!0}),a(),o?(0,J.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:j.size}):null]}),(0,J.jsxs)(Z,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(lt,{size:13,"aria-hidden":!0}),ze(),o?(0,J.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:o.chartCount}):null]})]}),(0,J.jsx)(Q,{value:`members`,children:l===void 0||o===void 0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:S()}):l.length===0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:c()}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W,{value:y,onChange:e=>b(e.target.value),placeholder:ie(),className:`oc-access__search`}),M.length===0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:te()}):(0,J.jsxs)(J.Fragment,{children:[M.length>1?(0,J.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,J.jsx)(B,{checked:N===`all`?!0:N===`some`?`indeterminate`:!1,onCheckedChange:()=>void me(),"aria-label":v()}),(0,J.jsx)(`span`,{className:`oc-access__label`,children:v()}),(0,J.jsxs)(U,{variant:`outline`,className:`oc-access__count`,children:[pe,` / `,M.length]})]}):null,(0,J.jsx)(`div`,{className:`oc-access__list`,children:P.pageItems.map(e=>{let t=A.has(e.userId),n=At(e),r=se.has(e.userId);return(0,J.jsxs)(`div`,{className:`oc-access__row`,children:[(0,J.jsx)(B,{checked:t,onCheckedChange:()=>void ue(e.userId,t),"aria-label":i({user:n.primary})}),(0,J.jsxs)(`span`,{className:`oc-access__who`,children:[(0,J.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,J.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,J.jsx)(U,{variant:`outline`,className:`oc-access__role`,children:jt(e.role)}),(0,J.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&ce?(0,J.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?be():Ne(),title:r?be():Ne(),onClick:()=>void fe(e.userId,r),children:(0,J.jsx)(K,{size:15,"aria-hidden":!0})}):t&&r?(0,J.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":de(),title:de(),children:(0,J.jsx)(K,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,J.jsx)(zt,{page:P.page,pageCount:P.pageCount,onPage:E})]})]})}),(0,J.jsx)(Q,{value:`agents`,children:s===void 0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:S()}):s.length===0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:ne()}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W,{value:x,onChange:e=>C(e.target.value),placeholder:Be(),className:`oc-access__search`}),(0,J.jsx)(`div`,{className:`oc-access__list`,children:s.map(t=>(0,J.jsx)(Vt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:j,query:x},`${e}-${t._id}`))})]})}),(0,J.jsx)(Q,{value:`charts`,children:(0,J.jsx)(Ht,{groupId:e})})]})]})})}function Vt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=D(p.groups.listAssignableAgents,{instanceName:t}),c=d(p.groups.assignAgentToGroup),l=d(p.groups.removeAgentFromGroup),u=d(p.groups.bulkSetGroupAgents),f=z(),[m,h]=(0,q.useState)(1);if((0,q.useEffect)(()=>{h(1)},[i]),!e)return null;let g=kt(a?.agents??[],i),_=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&g.length===0)return null;let y=g.filter(e=>e.presentInLastOk!==!1),b=Mt(y,e=>r.has(`${t}/${e.agentId}`)),x=Nt(g,m,Rt);async function S(n,r){try{r?await l({groupId:e,instanceName:t,agentId:n}):await c({groupId:e,instanceName:t,agentId:n})}catch(e){f.error(Oe(),e)}}async function C(){if(y.length===0)return;let n=y.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:b!==`all`})}catch(e){f.error(Oe(),e)}}return(0,J.jsxs)(`div`,{className:`oc-access__group`,children:[(0,J.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,J.jsx)(V,{size:13,"aria-hidden":!0}),(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(U,{variant:`outline`,className:`oc-access__kind`,children:n}),_?(0,J.jsx)(U,{variant:`outline`,className:`oc-access__stale`,children:T()}):null]}),a===void 0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:s()}):g.length===0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:_?o():Ie()}):(0,J.jsxs)(J.Fragment,{children:[y.length>1?(0,J.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,J.jsx)(B,{checked:b===`all`?!0:b===`some`?`indeterminate`:!1,onCheckedChange:()=>void C(),"aria-label":v()}),(0,J.jsx)(`span`,{className:`oc-access__label`,children:v()})]}):null,x.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,J.jsxs)(`div`,{className:`oc-access__row`,children:[(0,J.jsx)(B,{checked:i,disabled:a&&!i,onCheckedChange:()=>void S(e.agentId,i),"aria-label":ye({name:e.displayName??e.agentId})}),(0,J.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,J.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,J.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":M(),title:M(),children:(0,J.jsx)(H,{size:14,fill:`currentColor`})}):null,a?(0,J.jsx)(U,{variant:`outline`,className:`oc-access__gone`,children:Re()}):null]},e.agentId)}),(0,J.jsx)(zt,{page:x.page,pageCount:x.pageCount,onPage:h})]})]})}function Ht({groupId:e}){let t=D(p.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=d(p.charts.assignChartToGroup),r=d(p.charts.removeChartFromGroup),i=d(p.charts.setGroupDefaultChart),a=d(p.charts.addChartToGroupPool),o=d(p.charts.removeChartFromGroupPool),s=z();if(!e)return null;if(t===void 0)return(0,J.jsx)(`p`,{className:`oc-access__hint`,children:S()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,J.jsx)(`p`,{className:`oc-access__hint`,children:Fe()});async function f(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function m(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function h(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function g(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,J.jsxs)(`div`,{className:`oc-access__row`,children:[(0,J.jsx)(B,{checked:e.selected,onCheckedChange:()=>void f(e.chartKey,e.selected),"aria-label":Se({name:e.name})}),(0,J.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,J.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":Ee(),title:Ee(),children:(0,J.jsx)(H,{size:14,fill:`currentColor`})}):(0,J.jsx)(R,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void m(e.chartKey),children:pe()}):null,u?(0,J.jsx)(R,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":he({name:e.name}),title:he({name:e.name}),onClick:()=>void g(e.chartKey),children:(0,J.jsx)(He,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,J.jsxs)(at,{value:``,onValueChange:e=>void h(e),children:[(0,J.jsx)(Xe,{size:`sm`,className:`oc-access__search`,children:(0,J.jsx)(Ue,{placeholder:me()})}),(0,J.jsx)(Qe,{children:l.map(e=>(0,J.jsx)(it,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,J.jsx)(`p`,{className:`oc-access__hint`,children:A()}):null:null]})}export{Lt as GroupsTab};
|
|
@@ -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,Ap as o,BC as s,Bf as c,Bp as l,Cf as u,Cp as d,Df as f,Dp as p,Ef as m,Ep as h,Ff as g,Fp as _,Gf as v,Gp as ee,HC as y,Hf as b,Hp as x,IC as S,If as C,Ip as w,Jf as T,Jp as E,Kf as D,Kp as te,Lf as ne,Lp as re,Mf as ie,Mp as ae,Nf as oe,Np as se,Of as ce,Op as le,Pf as ue,Pp as de,Qf as fe,Qp as pe,Rf as me,Rp as he,Sf as ge,Sp as _e,Tf as ve,Tp as ye,UC as O,Uf as be,Up as xe,Uv as Se,Vf as Ce,Vp as we,Wf as k,Wp as A,Wv as j,Xf as Te,Xp as Ee,Yf as De,Yp as Oe,Zf as ke,Zp as Ae,_p as je,ap as Me,bf as Ne,bp as M,cp as Pe,dp as Fe,em as Ie,ep as Le,fp as Re,gp as ze,hp as Be,im as Ve,ip as He,jf as Ue,jp as We,kf as Ge,kp as Ke,lp as qe,mp as N,nm as Je,np as Ye,op as Xe,pp as Ze,qf as Qe,qp as $e,rm as et,rp as tt,sp as nt,tm as rt,tp as it,up as P,vf as at,vp as ot,wf as st,wp as ct,xf as lt,xp as F,yf as I,yp as ut,zf as L,zp as dt}from"./dist-LmEWWbCO.js";import{t as R}from"./button-DgXvFpn-.js";import{A as z,C as ft,F as B,J as pt,L as V,N as H,O as U,P as W,R as G,S as mt,X as ht,Y as gt,b as _t,h as vt,j as yt,m as K,q,x as J,y as bt}from"./index-B0OTsC0S.js";import{t as xt}from"./DataTableShell-DB_nXosI.js";import{InstanceConfigDialog as St}from"./BridgeTab-CL3W0gfM.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Ct=new Set(X),wt=`conversational`;function Tt(e){let t=new Set((e??[]).filter(e=>Ct.has(e)));return t.size===0?[wt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``},Et={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Dt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``}}function Ot(){let e=O(S.admin.listInstances,{}),t=O(S.agents.listAllInstanceAgents,{}),n=y(S.admin.upsertInstance),r=y(S.admin.deleteInstance),a=z(),[s,c]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(Q),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[v,b]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null);async function D(){try{await n({instanceId:C??void 0,name:u.name,gatewayUrl:u.gatewayUrl,bridgeUrl:u.bridgeUrl||void 0,displayName:u.displayName||void 0,kind:u.kind,gatewayVersion:u.gatewayVersion||void 0,gatewayHttpUrl:u.gatewayHttpUrl||void 0}),d(Q),T(null),c(!1)}catch(e){a.error(Je(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[rt(),(0,Z.jsx)(`strong`,{children:Ie()}),i()]}),(0,Z.jsx)(xt,{title:pe(),rows:e,addLabel:Ae(),onAdd:()=>{T(null),d(Q),c(!0)},emptyHint:Ee(),columns:[{header:Oe(),cell:e=>e.name,sort:e=>e.name},{header:E(),cell:e=>(0,Z.jsx)(K,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:$e(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:te(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:Ve(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(K,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?I():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:x(),onSelect:()=>{T(e._id),d(Dt(e)),c(!0)}},{label:et(),onSelect:()=>m(e.name)},{label:p(),onSelect:()=>b(e)},{label:ee(),onSelect:()=>g(e)},{label:A(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:A(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(vt,{open:s,onOpenChange:c,title:C?we():xe(),description:dt(),canSubmit:!!(u.name&&u.gatewayUrl),onSubmit:D,submitLabel:he(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:re(),children:[(0,Z.jsx)(q,{value:u.name,disabled:C!==null,onChange:e=>d({...u,name:e.target.value})}),C?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:l()}):null]}),(0,Z.jsx)($,{label:w(),children:(0,Z.jsxs)(bt,{value:u.kind,onValueChange:e=>d({...u,kind:e}),children:[(0,Z.jsx)(mt,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(ft,{})}),(0,Z.jsxs)(_t,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:_(),children:(0,Z.jsx)(q,{value:u.gatewayUrl,onChange:e=>d({...u,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:de(),children:(0,Z.jsx)(q,{value:u.bridgeUrl,placeholder:se(),onChange:e=>d({...u,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:ae(),children:(0,Z.jsx)(q,{value:u.displayName,onChange:e=>d({...u,displayName:e.target.value})})}),(0,Z.jsx)($,{label:We(),children:(0,Z.jsx)(q,{value:u.gatewayVersion,placeholder:o(),onChange:e=>d({...u,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:Ke(),children:(0,Z.jsx)(q,{value:u.gatewayHttpUrl,placeholder:le(),onChange:e=>d({...u,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Rt,{instanceName:f,open:f!==null,onOpenChange:e=>{e||m(null)}}),h?(0,Z.jsx)(St,{instance:h,onClose:()=>g(null)},h._id):null,v?(0,Z.jsx)(kt,{instance:v,onClose:()=>b(null)},v._id):null]})}function kt({instance:e,onClose:t}){let n=O(S.instanceSecrets.listInstanceSecretStatus,{}),r=Et[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(H,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(W,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(G,{children:h({instance:e.displayName??e.name})}),(0,Z.jsx)(B,{children:ye()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Mt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(jt,{instance:e})}),(0,Z.jsx)(At,{instance:e})]})})}function At({instance:e}){let t=s(S.instanceSync.forceInstanceSync),n=z(),[i,a]=(0,Y.useState)(!1);async function o(){if(!i){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Me());break;case`no_agents`:n.success(tt());break;case`no_bridge_url`:n.error(Ye());break;case`deploy_misconfigured`:n.error(it());break;case`unauthorized`:n.error(r());break;case`not_served`:n.error(fe());break;default:n.error(Le());break}}catch(e){n.error(He(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:i,children:i?Xe():nt()})})]})}function jt({instance:e}){let t=O(S.bridgeAuth.listBridgeAuthStatus,{}),n=s(S.bridgeAuth.mintBridgeSecret),r=y(S.bridgeAuth.revokeBridgeSecret),i=z(),[a,o]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),p=f!==void 0;async function m(){if(!a){o(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(k(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),l(null),i.success(v())}catch(e){i.error(k(),e)}finally{o(!1)}}}async function g(){if(c)try{await navigator.clipboard.writeText(c),d(!0)}catch{}}return(0,Z.jsxs)($,{label:Te(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:p?`outline`:`secondary`,children:p?`${F()} · ${f.prefix}…${f.lastFour}`:M()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?Qe():T()}),p?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:D()}):null]})]}),c?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:be()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:c}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:u?j():Se()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:b()})]}):null]})}function Mt({instanceId:e,field:t,updatedAt:n}){let r=s(S.instanceSecrets.setInstanceSecret),i=y(S.instanceSecrets.clearInstanceSecret),a=s(S.deviceIdentity.generateDeviceIdentity),o=z(),[c,l]=(0,Y.useState)(``),[u,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),_=n!==null,v=t===`deviceIdentity`,ee=t===`token`?ct():t===`deviceIdentity`?d():_e();async function x(){if(!(!c.trim()||u)){f(!0);try{await r({instanceId:e,field:t,plaintext:c}),l(``),m(null),g(!1),o.success(Be())}catch(e){o.error(N(),e)}finally{f(!1)}}}async function C(){if(!u){f(!0);try{await i({instanceId:e,field:t}),m(null),g(!1),o.success(Ze())}catch(e){o.error(N(),e)}finally{f(!1)}}}async function w(){if(!u){f(!0);try{m(await a({instanceId:e})),g(!1),o.success(P())}catch(e){o.error(Pe(),e)}finally{f(!1)}}}let T=p?`openclaw devices approve ${p.id}`:``;async function E(){if(T)try{await navigator.clipboard.writeText(T),g(!0)}catch{}}return(0,Z.jsxs)($,{label:ee,children:[v?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:_?`outline`:`secondary`,children:_?F():M()}),(0,Z.jsx)(q,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:_?ot():ut(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void x(),disabled:u||c.trim().length===0,children:je()}),v?(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void w(),disabled:u,children:Re()}):null,_?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void C(),disabled:u,children:ze()}):null]})]}),p?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:P()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:T}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void E(),children:h?j():Se()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{m(null),g(!1)},children:b()})]}):null]})}var Nt={conversational:ue,documentary:ie},Pt={conversational:oe,documentary:Ue},Ft=e=>(Nt[e]??(()=>e))(),It=e=>(Pt[e]??(()=>``))();function Lt({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:me()}),t.map(e=>(0,Z.jsx)(K,{variant:`secondary`,className:`oc-agenttype__chip`,title:It(e),children:Ft(e)},e)),(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(ht,{asChild:!0,children:(0,Z.jsx)(R,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ne()})}),(0,Z.jsxs)(gt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:C()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:g()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(U,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Ft(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:It(r)})]})]},r)})})]})]})]})}function Rt({instanceName:e,open:t,onOpenChange:n}){let r=O(S.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=y(S.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(S.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(S.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=y(S.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(S.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(S.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=y(S.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(S.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Tt(r);e.setQuery(S.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),l=y(S.agents.removeInstanceAgent),d=yt(),p=z();async function h(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){p.error(L(),e)}}async function g(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){p.error(L(),e)}}async function _(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){p.error(L(),e)}}async function v(t,n){if(e&&await d({title:ce({name:n}),description:f(),confirmLabel:m(),destructive:!0}))try{await l({instanceName:e,agentId:t}),p.success(ve())}catch(e){p.error(L(),e)}}return(0,Z.jsx)(H,{open:t,onOpenChange:n,children:(0,Z.jsxs)(W,{className:`oc-access`,children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(G,{children:Ce({name:e??``})}),(0,Z.jsx)(B,{children:c()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:st()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?u():r.discovery.lastPollOk?ge():lt({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ne()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,o=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(U,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void h(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:at()}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void v(e.agentId,i),children:Ge()})]}):n?(0,Z.jsx)(K,{variant:`default`,children:I()}):(0,Z.jsx)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void g(e.agentId),children:a()})]}),e.enabled?(0,Z.jsx)(Lt,{agentId:e.agentId,types:o,onToggle:t=>void _(e.agentId,t,o)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Ot as InstancesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Bh as i,Cg as ee,Eg as a,Fh as o,Gh as s,HC as c,Hh as l,IC as u,Ih as d,Jh as f,Kh as te,Lh as ne,Ph as re,Qh as ie,Rh as ae,Sg as p,Tg as oe,UC as se,Uh as ce,Vh as le,Wh as m,Xh as h,Yh as g,Zh as _,_g as v,ag as y,bg as b,cg as x,dg as S,eg as C,fg as w,gg as T,hg as E,ig as D,lg as O,mg as k,ng as A,og as j,pg as M,qh as N,rg as ue,sg as P,tg as F,ug as I,vg as L,wg as R,xg as z,yg as B,zh as V}from"./dist-LmEWWbCO.js";import{C as H,O as U,S as W,b as G,m as K,q,x as de,y as fe}from"./index-B0OTsC0S.js";import{t as pe}from"./DataTableShell-DB_nXosI.js";var J=t(e(),1),Y=n();function me(){let e=se(u.integrations.status.status,{}),t=c(u.admin.setIntegrationConfig),[n,H]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&H(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:a()});let U=n,W=(e,t,n)=>H({...U,[e]:{...U[e],[t]:n}}),G=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[oe(),` `,(0,Y.jsx)(`strong`,{children:R()}),` `,ee()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:p()}):(0,Y.jsx)(K,{variant:`outline`,children:z()}):(0,Y.jsx)(K,{variant:`outline`,children:b()}),note:L(),children:[(0,Y.jsx)(Z,{label:T(),children:(0,Y.jsx)(q,{value:U.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>W(`langfuse`,`host`,e.target.value),onBlur:()=>G(`langfuse`,{host:U.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:w(),checked:U.langfuse.enabled??!0,onChange:e=>{W(`langfuse`,`enabled`,e),G(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:p()}):(0,Y.jsx)(K,{variant:`outline`,children:z()}):(0,Y.jsx)(K,{variant:`outline`,children:b()}),note:v(),children:[(0,Y.jsx)(Z,{label:E(),children:(0,Y.jsx)(q,{value:U.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>W(`opik`,`baseUrl`,e.target.value),onBlur:()=>G(`opik`,{baseUrl:U.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:k(),children:(0,Y.jsx)(q,{value:U.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||M(),onChange:e=>W(`opik`,`workspace`,e.target.value),onBlur:()=>G(`opik`,{workspace:U.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:w(),checked:U.opik.enabled??!0,onChange:e=>{W(`opik`,`enabled`,e),G(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:S(),status:(0,Y.jsx)(K,{variant:`outline`,children:B()}),note:I(),children:[(0,Y.jsx)(Z,{label:O(),children:(0,Y.jsx)($,{value:U.tts.auto??`off`,options:[[`off`,x()],[`always`,P()],[`inbound`,j()],[`tagged`,y()]],onChange:e=>{W(`tts`,`auto`,e),G(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:D(),children:(0,Y.jsx)($,{value:U.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,ue()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{W(`tts`,`provider`,e),G(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:A(),children:(0,Y.jsx)(q,{value:U.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>W(`tts`,`model`,e.target.value),onBlur:()=>G(`tts`,{model:U.tts.model??``})})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(q,{value:U.tts.voice??``,placeholder:C(),onChange:e=>W(`tts`,`voice`,e.target.value),onBlur:()=>G(`tts`,{voice:U.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:r(),status:(0,Y.jsx)(K,{variant:`outline`,children:B()}),note:e.secrets.openai?ie():_(),children:[(0,Y.jsx)(Q,{label:h(),checked:U.talk.enabled??!1,onChange:e=>{W(`talk`,`enabled`,e),G(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:g(),children:(0,Y.jsx)($,{value:U.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{W(`talk`,`realtimeProvider`,e),G(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:f(),children:(0,Y.jsx)(q,{value:U.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>W(`talk`,`realtimeModel`,e.target.value),onBlur:()=>G(`talk`,{realtimeModel:U.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(q,{value:U.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>W(`talk`,`voice`,e.target.value),onBlur:()=>G(`talk`,{voice:U.talk.voice??``})})}),(0,Y.jsx)(Z,{label:N(),children:(0,Y.jsx)($,{value:U.talk.transport??`webrtc`,options:[[`webrtc`,te()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{W(`talk`,`transport`,e),G(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:s(),children:(0,Y.jsx)(q,{value:U.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>W(`talk`,`speechLocale`,e.target.value),onBlur:()=>G(`talk`,{speechLocale:U.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:m(),checked:U.talk.interruptOnSpeech??!0,onChange:e=>{W(`talk`,`interruptOnSpeech`,e),G(`talk`,{interruptOnSpeech:e})}})]}),(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:ce()}),(0,Y.jsx)(K,{variant:`outline`,children:l()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[le(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(pe,{title:i(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:V(),columns:[{header:ae(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:ne(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:d(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:o(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:re(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(U,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(fe,{value:e,onValueChange:n,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:t.map(([e,t])=>(0,Y.jsx)(de,{value:e,children:t},e))})]})}export{me as IntegrationsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,Ab as i,Cb as a,Db as o,Eb as s,Fb as c,GS as l,HC as u,IC as d,JS as f,KS as ee,Mb as p,Nb as m,Ob as h,Pb as g,QS as _,Rp as te,Sb as ne,Tb as re,UC as v,US as ie,WS as ae,XS as oe,YS as se,ZS as ce,_b as le,ab as ue,bb as de,cb as fe,db as y,eC as b,fb as x,gb as S,hb as C,iC as w,ib as T,jb as E,kb as D,lC as O,lb as k,mb as A,nb as j,ob as M,pb as N,qS as P,rb as F,sb as I,tC as L,ub as R,vb as z,wb as B,xb as V,yb as pe}from"./dist-LmEWWbCO.js";import{t as H}from"./button-DgXvFpn-.js";import{A as me,C as he,O as U,S as ge,at as W,b as _e,k as ve,q as G,x as K,y as ye}from"./index-B0OTsC0S.js";var q=t(e(),1),J=[{id:`messages`,label:()=>c()},{id:`composer`,label:()=>g()},{id:`sidebar`,label:()=>m()},{id:`other`,label:()=>p()}],Y={showSource:{category:`messages`,label:()=>E(),help:()=>i()},showReport:{category:`messages`,label:()=>D(),help:()=>h()},copyAssistant:{category:`messages`,label:()=>o()},copyUser:{category:`messages`,label:()=>s()},showDelete:{category:`messages`,label:()=>re()},showTools:{category:`messages`,label:()=>B(),help:()=>a()},voiceInput:{category:`composer`,label:()=>ne(),help:()=>V()},showChatAge:{category:`sidebar`,label:()=>de(),help:()=>pe()},showChatProvider:{category:`sidebar`,label:()=>z(),help:()=>le()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>M()};function De({prefKey:e,ui:t}){let n=u(d.admin.setUiPrefDefault),r=u(d.admin.setFeatureEnabled),i=Te(e),a=i?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:R()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(ge,{size:`sm`,className:`w-36`,children:(0,$.jsx)(he,{})}),(0,$.jsxs)(_e,{children:[(0,$.jsx)(K,{value:`on`,children:T()}),(0,$.jsx)(K,{value:`off`,children:F()}),(0,$.jsx)(K,{value:`inherit`,children:j()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(U,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":k()}),k()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=v(d.me.getMe,{host:W}),a=i?.ui,o=Z(i?.role)&&n,s=u(d.me.setUiPref).withOptimisticUpdate(ve),c=(0,q.useMemo)(()=>a?be(Object.keys(a.effective),e):[],[a,e]);return a?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(U,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":y()}),y()]}):null,o?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:fe()}),(0,$.jsx)(`p`,{children:I()}),(0,$.jsx)(`p`,{children:ue()})]}):null,(0,$.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:S(),"aria-label":S(),className:`mb-2`}),c.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:C()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:A()}):l?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:N()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:x()}):null,(0,$.jsx)(U,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t===!0}),"aria-label":n})]}),o?(0,$.jsx)(De,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:O()})}function ke(){let e=v(d.me.getMe,{host:W}),t=u(d.me.setLocale),n=u(d.me.setMyName),i=me(),a=e?.locale??`default`,o=e?.name??``,[s,c]=(0,q.useState)(null),p=s??o,m=p.trim()!==o.trim();async function h(){try{await n({name:p}),c(null),i.success(ce())}catch(e){i.error(oe(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:L()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:b()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(G,{className:`max-w-xs`,value:p,maxLength:120,placeholder:r(),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),h())}}),(0,$.jsx)(H,{size:`sm`,disabled:!m,onClick:()=>void h(),children:te()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:_()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:se()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:f()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:a===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?ae():e===`en`?ie():w()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:ee()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:l()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,$y as i,Ay as ee,BC as te,Bv as a,By as ne,Cy as re,Dy as ie,Ey as ae,Fv as o,Fy as oe,Gv as s,Gy as se,HC as c,Hv as ce,Hy as le,IC as l,Iv as u,Iy as ue,Jv as d,Jy as de,Kv as f,Ky as fe,Lv as p,Ly as pe,My as me,Ny as he,Oy as ge,Py as _e,Qv as m,Qy as ve,Rv as ye,Ry as be,Sy as xe,Ty as Se,UC as h,Uv as g,Uy as Ce,Vv as _,Vy as we,Wv as v,Wy as Te,Xv as y,Xy as Ee,Yv as De,Yy as b,Zv as x,Zy as Oe,_y as ke,ay as Ae,by as je,cy as Me,dy as Ne,eb as Pe,ey as S,fy as Fe,gy as Ie,hy as Le,iy as C,jy as Re,ky as ze,ly as Be,my as Ve,ny as w,oy as He,py as Ue,qv as T,qy as We,ry as E,sy as Ge,tb as Ke,ty as D,uy as qe,vy as Je,wy as Ye,xy as Xe,yy as Ze,zv as O,zy as Qe}from"./dist-LmEWWbCO.js";import{n as k}from"./dist-Ce__brvM.js";import{i as $e}from"./dist-B1WV6sgR.js";import{t as A}from"./button-DgXvFpn-.js";import{A as et,C as j,Dt as tt,Et as nt,F as M,I as N,L as P,N as F,Ot as rt,P as I,R as L,S as R,b as z,h as it,j as at,m as B,q as V,wt as H,x as U,y as W}from"./index-B0OTsC0S.js";import{t as ot}from"./FilterBar-BJDv7ENT.js";import{t as st}from"./DataTableShell-DB_nXosI.js";import{t as ct}from"./roleDescriptions-ASM2ogBV.js";var G=t(e(),1),K=n(),q=[{value:`never`,label:()=>_(),days:null},{value:`30`,label:()=>a(),days:30},{value:`90`,label:()=>O(),days:90}],J=720*60*60*1e3,Y=`__all__`,X={name:``,roleKey:``,description:``};function Z(){let e=rt({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??Y,[a,o]=(0,G.useState)(Y),s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ce=e=>void t({search:t=>({...t,status:e===Y?void 0:e})}),u=h(l.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Y?void 0:a,disabled:r===Y?void 0:r===`disabled`}}),d=h(l.apiKeys.listKeys,{}),f=h(l.apiKeys.listRoles,{}),p=c(l.apiKeys.createServiceAccount),m=c(l.apiKeys.updateServiceAccount),ye=c(l.apiKeys.deleteServiceAccount),g=te(l.apiKeys.mintApiKey),_=c(l.apiKeys.revokeApiKey),v=at(),y=et(),De=n!==``||a!==Y||r!==Y;function x(){o(Y),t({search:{},replace:!0})}let[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(X),[E,D]=(0,G.useState)(null),[O,k]=(0,G.useState)(new Set),[M,N]=(0,G.useState)(null),P=(0,G.useRef)(!1),[F,I]=(0,G.useState)(new Set),[L,H]=(0,G.useState)({}),[J,Z]=(0,G.useState)(null),Q=(0,G.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function $(e){k(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{E?(await m({serviceAccountId:E,name:w.name,roleKey:w.roleKey,description:w.description}),y.success(Ze())):await p({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(X),D(null),C(!1)}catch(e){y.error(E?je():Xe(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),D(e._id),C(!0)}async function pt(e){if(P.current)return;P.current=!0;let t=L[e._id]??`never`,n=q.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;N(e._id);try{let t=await g({serviceAccountId:e._id,expiresAt:r});Z({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Je(),e)}finally{P.current=!1,N(null)}}async function mt(e){if(await v({title:ke(),description:(0,K.jsxs)(K.Fragment,{children:[Ie(),` `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Le(),` `,(0,K.jsx)(`strong`,{children:Ve()}),` `,Ue()]}),confirmWord:e.name,confirmLabel:Fe(),destructive:!0}))try{await ye({serviceAccountId:e._id}),y.success(Ne(),e.name)}catch(e){y.error(qe(),e)}}async function ht(e){if(await v({title:Be(),description:(0,K.jsxs)(K.Fragment,{children:[Me(),` `,(0,K.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Ge()]}),confirmLabel:He(),destructive:!0})&&!F.has(e._id)){I(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(Ae(),e)}finally{I(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`oc-admin__hint`,children:Ke()}),(0,K.jsxs)(ot,{q:n,onQChange:s,searchPlaceholder:Pe(),onReset:x,canReset:De,children:[(0,K.jsxs)(W,{value:a,onValueChange:o,children:[(0,K.jsx)(R,{size:`sm`,className:`w-40`,children:(0,K.jsx)(j,{placeholder:i()})}),(0,K.jsxs)(z,{children:[(0,K.jsx)(U,{value:Y,children:ve()}),(f??[]).map(e=>(0,K.jsx)(U,{value:e.key,children:e.key},e._id))]})]}),(0,K.jsxs)(W,{value:r,onValueChange:ce,children:[(0,K.jsx)(R,{size:`sm`,className:`w-36`,children:(0,K.jsx)(j,{})}),(0,K.jsxs)(z,{children:[(0,K.jsx)(U,{value:Y,children:Oe()}),(0,K.jsx)(U,{value:`active`,children:Ee()}),(0,K.jsx)(U,{value:`disabled`,children:b()})]})]})]}),(0,K.jsx)(st,{title:de(),rows:u,addLabel:We(),onAdd:()=>{T(X),D(null),C(!0)},emptyHint:fe(),isExpanded:e=>O.has(e._id),renderExpanded:e=>(0,K.jsx)(lt,{account:e,keys:Q.get(e._id)??[],onRevoke:ht,revoking:F}),rowActions:e=>[{label:le(),onSelect:()=>ft(e)},{label:se(),onSelect:()=>void pt(e)},{label:O.has(e._id)?Te():Ce(),onSelect:()=>$(e._id)},{label:we(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,K.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":O.has(e._id)?ne():Qe(),onClick:()=>$(e._id),children:O.has(e._id)?(0,K.jsx)($e,{}):(0,K.jsx)(nt,{})})},{header:be(),sort:e=>e.name,cell:e=>(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{children:e.name}),e.description?(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:pe(),sort:e=>e.roleKey,cell:e=>(0,K.jsx)(B,{variant:`secondary`,children:e.roleKey})},{header:ue(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,K.jsx)(B,{variant:`destructive`,children:b()}):(0,K.jsx)(B,{variant:`outline`,children:Ee()})},{header:oe(),cell:e=>(0,K.jsxs)(W,{value:L[e._id]??`never`,onValueChange:t=>H(n=>({...n,[e._id]:t})),children:[(0,K.jsx)(R,{size:`sm`,className:`w-32`,children:(0,K.jsx)(j,{})}),(0,K.jsx)(z,{children:q.map(e=>(0,K.jsx)(U,{value:e.value,children:e.label()},e.value))})]})},{header:_e(),sort:e=>(Q.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Q.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,K.jsx)(`span`,{className:`oc-sa__keycount`,children:M===e._id?he():me({count:t})})}}]}),(0,K.jsx)(it,{open:S,onOpenChange:e=>{C(e),e||D(null)},title:E?Re():ge(),description:E?ee():ie(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:E?ze():ae(),children:(0,K.jsxs)(`div`,{className:`oc-form`,children:[(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:Se()}),(0,K.jsx)(V,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:Ye()}),(0,K.jsxs)(W,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,K.jsx)(R,{className:`w-full`,children:(0,K.jsx)(j,{placeholder:re()})}),(0,K.jsx)(z,{children:(f??[]).map(e=>(0,K.jsxs)(U,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===w.roleKey),t=e?ct(e):null;return t?(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:xe()}),(0,K.jsx)(V,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,K.jsx)(ut,{minted:J,onClose:()=>Z(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:i}){return(0,K.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,K.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[C(),` `,(0,K.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,K.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):(0,K.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:w()}),(0,K.jsx)(`th`,{children:D()}),(0,K.jsx)(`th`,{children:S()}),(0,K.jsx)(`th`,{children:r()}),(0,K.jsx)(`th`,{children:m()}),(0,K.jsx)(`th`,{children:x()}),(0,K.jsx)(`th`,{})]})}),(0,K.jsx)(`tbody`,{children:t.map(t=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{children:(0,K.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(B,{variant:`secondary`,children:e.roleKey})}),(0,K.jsx)(`td`,{children:Q(t.createdAt)}),(0,K.jsx)(`td`,{className:$(t.lastUsedAt)?`oc-sa__stale`:``,children:dt(t.lastUsedAt)}),(0,K.jsx)(`td`,{children:ft(t.expiresAt)}),(0,K.jsx)(`td`,{children:pt(t)}),(0,K.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,K.jsx)(A,{variant:`destructive`,size:`sm`,disabled:i.has(t._id),onClick:()=>n(t),children:i.has(t._id)?y():De()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,G.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,K.jsx)(F,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,K.jsxs)(I,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,K.jsxs)(P,{children:[(0,K.jsx)(L,{children:d()}),(0,K.jsx)(M,{children:T({name:e.accountName})})]}),(0,K.jsx)(`div`,{className:`oc-sa__minted-warning`,children:f()}),(0,K.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,K.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,K.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":s(),children:[n?(0,K.jsx)(k,{}):(0,K.jsx)(H,{}),n?v():g()]})]}),(0,K.jsx)(N,{children:(0,K.jsx)(A,{onClick:()=>{r(!1),t()},children:ce()})})]}):null})}function Q(e){return new Date(e).toLocaleString(`fr-FR`)}function $(e){return e===null?!1:Date.now()-e>J}function dt(e){return e===null?ye():new Date(e).toLocaleString(`fr-FR`)}function ft(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function pt(e){return e.disabled?(0,K.jsx)(B,{variant:`destructive`,children:p()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,K.jsx)(B,{variant:`outline`,children:u()}):(0,K.jsx)(B,{variant:`outline`,children:o()})}export{Z as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$x as i,Ax as a,BC as o,Bb as s,Bx as c,Cx as l,Dx as u,Ex as d,Fx as f,Gb as p,Gx as m,HC as h,Hb as g,Hx as _,IC as v,Ib as ee,Ix as te,Jb as ne,Jx as y,Kb as re,Kx as ie,LC as ae,Lb as oe,Lx as se,Mx as ce,Nx as le,Ox as ue,Px as de,Qb as fe,Qx as pe,Rb as me,Rx as he,Sx as ge,Tx as _e,UC as b,US as ve,Ub as ye,Ux as be,Vb as xe,Vx as Se,WS as Ce,Wb as x,Wx as we,Xb as Te,Xx as Ee,Yb as De,Yx as Oe,Zb as ke,Zx as Ae,_x as je,aC as Me,ax as Ne,bx as Pe,cx as Fe,dx as Ie,eS as Le,ex as Re,fx as ze,gx as Be,hx as Ve,iS as He,ix as Ue,jx as We,kx as Ge,lx as Ke,mx as qe,n as Je,nS as Ye,nx as S,oC as Xe,ox as Ze,px as Qe,qb as $e,qx as et,rS as tt,rx as nt,sC as rt,sx as it,tS as at,tx as ot,ux as st,vx as ct,wx as lt,xx as C,yx as ut,zb as dt,zx as ft}from"./dist-LmEWWbCO.js";import{n as w}from"./dist-Ce__brvM.js";import{t as pt}from"./TimeRangePicker-DsW1QCH4.js";import{t as T}from"./x-CmMNOdcT.js";import{t as E}from"./button-DgXvFpn-.js";import{$ as D,C as O,O as k,Q as mt,S as A,St as j,Z as ht,at as M,b as N,et as gt,it as _t,m as P,nt as vt,q as F,rt as yt,tt as I,x as L,y as R}from"./index-B0OTsC0S.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-Dbpx1kqO.js";import{a as Et,i as z,n as Dt,o as B,r as V,t as Ot}from"./table-SUDKYeE8.js";import{t as kt}from"./FilterBar-BJDv7ENT.js";import{t as At}from"./AdvancedFilter-I8EFwacj.js";var H=ae(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),U=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(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 Ft(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 W(e,t,n){return Ft(e,t,n)>=jt}function It(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 Lt(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 Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Ne());if(e.size>Rt)throw Error(Ue());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,o=Math.min(zt/r,Bt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(S());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Pt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(S());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);W(e.data,d.width,d.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),p.putImageData(e,0,0)}let m=W(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await K(f,`image/webp`,Vt)??await K(f,`image/png`);if(!h)throw Error(ot());return{blob:h,hasAlpha:m}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return G(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 G(e)}async function G(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 K(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var q=n(),J=`__all__`,Y={kind:`relative`,from:`now-24h`,to:`now`},X=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Z({title:e,description:t,children:n}){return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,q.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Wt(e){return e===`light`?rt():e===`dark`?Xe():Me()}var Gt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Kt({tokens:e,mode:t}){let n=e.colors[t];return(0,q.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Gt.map(e=>{let t=n[e];return(0,q.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Q({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,q.jsxs)(`button`,{type:`button`,className:Je(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,q.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,q.jsx)(w,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,q.jsx)(Kt,{tokens:r,mode:i}):(0,q.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,q.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,q.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function qt({selectedKey:e,resolvedMode:t}){let n=b(v.charts.listMyCharts),r=h(v.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:Ee()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,q.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,q.jsx)(Q,{selected:e===null,title:y(),subtitle:et(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?ie():n.via===`owner`?m():we({group:n.via.group});return(0,q.jsx)(Q,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key)},n.key)})]}),n!==void 0&&n.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:be()}):null]})}function Jt(){let e=h(v.charts.importChart),[t,n]=(0,U.useState)(``),[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(C())}}}async function g(){if(o(null),c(!1),t.trim()===``){o(ut());return}let a;try{a=JSON.parse(r)}catch{o(C());return}p(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{p(!1)}}return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:Ge()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,q.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:u()}),(0,q.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:d(),maxLength:60})]}),(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:_e()}),(0,q.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:lt(),rows:8,spellCheck:!1})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,q.jsx)(H,{className:`size-4`}),l(),(0,q.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,q.jsx)(E,{size:`sm`,disabled:f,onClick:()=>void g(),children:ge()})]}),a?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,q.jsx)(`p`,{className:`oc-chart-import__ok`,children:Pe()}):null]})]})}function Yt({chart:e}){let t=o(v.charts.setChartLogo),n=h(v.charts.removeChartLogo),[r,i]=(0,U.useState)(!1),[a,s]=(0,U.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,q.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ze():Ie()}),(0,q.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,q.jsx)(`img`,{src:t,alt:``}):null}),(0,q.jsx)(E,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,q.jsx)(H,{className:`size-4`}),t?Ke():st(),(0,q.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,q.jsx)(E,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:it()}):null,t?(0,q.jsx)(E,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Fe()}):null]})}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Qe()}),(0,q.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,q.jsx)(p,{mode:`light`}),(0,q.jsx)(p,{mode:`dark`})]}),r?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:Ze()}):null,a?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function $({chart:e}){let t=b(v.me.getMe,{host:M}),n=h(v.charts.addChartDomain),i=h(v.charts.removeChartDomain),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await i({chartKey:e.key,domain:t})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Re()}),(0,q.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,q.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:Te()}):d.map(e=>(0,q.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,q.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":De({domain:e}),onClick:()=>void p(e),children:(0,q.jsx)(T,{className:`size-3`})})]},e))}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(F,{value:a,onChange:e=>o(e.target.value),placeholder:fe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,q.jsx)(E,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:ke()})]}),(0,q.jsx)(`span`,{className:`oc-show__desc`,children:r()}),s?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function Xt({chart:e}){let t=h(v.charts.updateChart),n=h(v.charts.deleteChart),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(e.name),[s,c]=(0,U.useState)(()=>JSON.stringify(e.tokens,null,2)),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)(!1);function m(){o(e.name),c(JSON.stringify(e.tokens,null,2)),u(null),i(!0)}async function g(){if(e.chartId===void 0)return;u(null);let n;try{n=JSON.parse(s)}catch{u(C());return}f(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}}async function _(){if(e.chartId!==void 0&&window.confirm(x()))try{await n({chartId:e.chartId})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(E,{variant:`outline`,size:`sm`,onClick:m,children:Ve()}),(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>void _(),children:qe()})]})})]}),r?(0,q.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:re()}),(0,q.jsx)(F,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:p()}),(0,q.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),l?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:l}):null,(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{size:`sm`,disabled:d,onClick:()=>void g(),children:ne()}),(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:$e()})]})]}):null,(0,q.jsx)(Yt,{chart:e}),(0,q.jsx)($,{chart:e})]})}function Zt(){let e=b(v.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:ct()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:je()})]}),e!==void 0&&t.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Be()}):(0,q.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,q.jsx)(Xt,{chart:e},e.key))})]})}function Qt({chart:e,groups:t}){let n=h(v.charts.addChartToGroupPool),r=h(v.charts.removeChartFromGroupPool),i=e.restrictedToGroups,o=e.poolGroups,c=new Set((o??[]).map(e=>e.groupId)),l=t.filter(e=>!c.has(e._id));async function u(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,q.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?f():e.kind===`custom`&&e.scope===`personal`?s():te()}),e.isGlobalDefault?(0,q.jsx)(P,{variant:`default`,children:de()}):null]}),(0,q.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ce()}),(o??[]).map(e=>(0,q.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,q.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":a({group:e.name}),onClick:()=>void d(e.groupId),children:(0,q.jsx)(T,{className:`size-3`})})]},e.groupId)),l.length>0?(0,q.jsxs)(R,{value:``,onValueChange:e=>void u(e),children:[(0,q.jsx)(A,{size:`sm`,className:`w-56`,children:(0,q.jsx)(O,{placeholder:We()})}),(0,q.jsx)(N,{children:l.map(e=>(0,q.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:le()}):null]})]})}function $t({chart:e}){let t=h(v.charts.promoteChartToCommon),n=h(v.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(x()))try{await n({chartId:e.chartId})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,q.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?dt():s()}),e.ownerLabel?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:xe({owner:e.ownerLabel})}):null]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,q.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:me()}):null,(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:oe()})]})]})}function en({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=h(v.admin.setDefaultThemeMode),i=h(v.admin.setDefaultLocale),a=h(v.charts.setDefaultChart),o=b(v.charts.listChartsAdmin),s=b(v.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,q.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:pe()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:_()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Se()})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:y()}),_t.map(e=>(0,q.jsx)(E,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,q.jsx)(E,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:c()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ft()})]}),(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,q.jsx)(Qt,{chart:e,groups:s??[]},e.key))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:he()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,q.jsx)($,{chart:e})]},e.key))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:ye()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ee()}):(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,q.jsx)($t,{chart:e},e.key))})})()]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:He()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:tt()})]}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,q.jsx)(E,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Wt(e)},e))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:Ye()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,q.jsx)(E,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?Ce():ve()},e))}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]})]})}function tn(){let e=b(v.me.getMe,{host:M}),t=yt(e?.resolvedThemeMode);return(0,q.jsxs)(`div`,{className:`oc-appearance`,children:[(0,q.jsx)(qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,q.jsx)(Jt,{}),(0,q.jsx)(Zt,{}),e?.role===`admin`?(0,q.jsx)(en,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function nn(){let[e,t]=(0,U.useState)(!0),[n,r]=(0,U.useState)(`per-user`),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(J),[l,u]=(0,U.useState)(J),[d,f]=(0,U.useState)(Y),p=a!==``||s!==J||l!==J;function m(){o(``),c(J),u(J),f(Y)}return(0,q.jsxs)(`div`,{className:`oc-show`,children:[(0,q.jsx)(tn,{}),(0,q.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,q.jsx)(`summary`,{className:`oc-show__title`,children:i()}),(0,q.jsxs)(Z,{title:`Buttons`,description:`Variants`,children:[(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{children:`Default`}),(0,q.jsx)(E,{variant:`secondary`,children:`Secondary`}),(0,q.jsx)(E,{variant:`outline`,children:`Outline`}),(0,q.jsx)(E,{variant:`ghost`,children:`Ghost`}),(0,q.jsx)(E,{variant:`destructive`,children:`Destructive`}),(0,q.jsx)(E,{variant:`link`,children:`Link`})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{size:`sm`,children:`Small`}),(0,q.jsx)(E,{children:`Default`}),(0,q.jsx)(E,{size:`lg`,children:`Large`}),(0,q.jsx)(E,{size:`icon`,"aria-label":`more`,children:(0,q.jsx)(j,{})}),(0,q.jsx)(E,{disabled:!0,children:`Disabled`})]})]}),(0,q.jsx)(Z,{title:`Badges`,children:(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(P,{children:`Default`}),(0,q.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,q.jsx)(P,{variant:`outline`,children:`Outline`}),(0,q.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,q.jsx)(Z,{title:`Inputs & selection`,children:(0,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsx)(F,{placeholder:`Text input…`}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsxs)(R,{value:n,onValueChange:r,children:[(0,q.jsx)(A,{className:`w-56`,children:(0,q.jsx)(O,{placeholder:`Select…`})}),(0,q.jsxs)(N,{children:[(0,q.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,q.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,q.jsxs)(`label`,{className:`oc-show__check`,children:[(0,q.jsx)(k,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,q.jsx)(Z,{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,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsxs)(kt,{q:a,onQChange:o,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:d,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,q.jsxs)(R,{value:s,onValueChange:c,children:[(0,q.jsx)(A,{size:`sm`,children:(0,q.jsx)(O,{})}),(0,q.jsxs)(N,{children:[(0,q.jsx)(L,{value:J,children:`Toutes directions`}),(0,q.jsx)(L,{value:`inbound`,children:`inbound`}),(0,q.jsx)(L,{value:`outbound`,children:`outbound`}),(0,q.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,q.jsxs)(R,{value:l,onValueChange:u,children:[(0,q.jsx)(A,{size:`sm`,children:(0,q.jsx)(O,{})}),(0,q.jsxs)(N,{children:[(0,q.jsx)(L,{value:J,children:`Toutes sévérités`}),(0,q.jsx)(L,{value:`info`,children:`info`}),(0,q.jsx)(L,{value:`warn`,children:`warn`}),(0,q.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,q.jsx)(At,{fields:X,onChange:()=>{}}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,q.jsx)(pt,{value:d,onChange:f})]})]})}),(0,q.jsx)(Z,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,q.jsxs)(ht,{children:[(0,q.jsx)(vt,{asChild:!0,children:(0,q.jsx)(E,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,q.jsx)(j,{})})}),(0,q.jsxs)(mt,{align:`start`,children:[(0,q.jsx)(gt,{children:`Actions`}),(0,q.jsx)(I,{}),(0,q.jsx)(D,{children:`Edit`}),(0,q.jsx)(D,{children:`Duplicate`}),(0,q.jsx)(I,{}),(0,q.jsx)(D,{variant:`destructive`,children:`Delete`})]})]})}),(0,q.jsx)(Z,{title:`Card`,children:(0,q.jsxs)(Tt,{className:`w-80`,children:[(0,q.jsxs)(bt,{children:[(0,q.jsx)(Ct,{children:`Instance`}),(0,q.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,q.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,q.jsxs)(xt,{className:`gap-2`,children:[(0,q.jsx)(E,{size:`sm`,children:`Save`}),(0,q.jsx)(E,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,q.jsx)(Z,{title:`Table`,children:(0,q.jsxs)(Ot,{children:[(0,q.jsx)(Et,{children:(0,q.jsxs)(B,{children:[(0,q.jsx)(z,{className:`w-8`,children:(0,q.jsx)(k,{"aria-label":`select all`})}),(0,q.jsx)(z,{children:`Name`}),(0,q.jsx)(z,{children:`Mode`}),(0,q.jsx)(z,{className:`text-right`,children:`Status`}),(0,q.jsx)(z,{className:`w-8`})]})}),(0,q.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,q.jsxs)(B,{children:[(0,q.jsx)(V,{children:(0,q.jsx)(k,{"aria-label":`select ${e.n}`})}),(0,q.jsx)(V,{className:`font-medium`,children:e.n}),(0,q.jsx)(V,{children:(0,q.jsx)(P,{variant:`secondary`,children:e.m})}),(0,q.jsx)(V,{className:`text-right`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,q.jsx)(w,{className:`size-3.5`}),` `,e.s]})}),(0,q.jsx)(V,{children:(0,q.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,q.jsx)(j,{})})})]},e.n))})]})}),(0,q.jsx)(Z,{title:`App fragments`,description:`Chat-specific components`,children:(0,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,q.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,q.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,q.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,q.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,q.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,q.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,q.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,q.jsx)(`span`,{className:`oc-run-status__dot`}),(0,q.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{nn as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,Am as i,Cm as a,Dc as o,Dm as s,Em as c,Fc as l,HC as u,IC as d,Ic as f,Lc as p,Mc as m,Nc as h,Oc as g,Om as _,Pc as v,Rc as y,Rp as b,Sm as x,Tm as ee,UC as S,_m as te,am as ne,bm as re,cm as ie,dm as ae,fm as oe,gm as C,hm as w,im as T,jc as E,jm as D,kc as O,km as k,lm as A,mm as se,om as ce,pm as le,rm as ue,sm as de,um as fe,vm as pe,wm as me,xm as he,ym as ge,zc as j}from"./dist-LmEWWbCO.js";import{t as M}from"./button-DgXvFpn-.js";import{$ as N,A as P,C as F,Dt as I,F as L,L as R,M as z,N as B,O as V,Ot as _e,P as ve,Q as ye,R as be,S as H,Z as xe,at as Se,b as U,d as W,et as Ce,f as we,gt as G,ht as K,j as Te,m as q,nt as Ee,p as J,x as Y,y as X}from"./index-B0OTsC0S.js";import{t as De}from"./FilterBar-BJDv7ENT.js";import{t as Oe}from"./DataTableShell-DB_nXosI.js";import{t as ke}from"./DetailChips-D5ajSYYG.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=S(d.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=S(d.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),h=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!u.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],g=new Map;for(let e of h){let t=g.get(e.instanceName)??[];t.push(e),g.set(e.instanceName,t)}return(0,Q.jsx)(B,{open:n,onOpenChange:r,children:(0,Q.jsxs)(ve,{className:`oc-access`,children:[(0,Q.jsxs)(R,{children:[(0,Q.jsx)(be,{children:j({user:t})}),(0,Q.jsx)(L,{children:y()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?p():f()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:l()}):h.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:m()}):[...g.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:i,assigned:a,defaultKey:s}){let c=u(d.agents.assignAgent),l=u(d.agents.removeAgent),f=u(d.agents.setDefaultAgent),p=P();if(!e)return null;async function m(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){p.error(v(),e)}}async function _(n){try{await f({profileId:e,instanceName:t,agentId:n})}catch(e){p.error(h(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(G,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__kind`,children:n})]}),i.map(e=>{let n=`${t}/${e.agentId}`,i=a.has(n),c=s===n,l=e.state===`deleted`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(V,{checked:i,disabled:l&&!i,onCheckedChange:()=>void m(e.agentId,i),"aria-label":E({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,l?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:r()}):null,e.outOfPool?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:O()}):null,i?c?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":g(),title:g(),children:(0,Q.jsx)(K,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":o(),title:o(),onClick:()=>void _(e.agentId),children:(0,Q.jsx)(K,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(xe,{children:[(0,Q.jsx)(Ee,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?D():i({count:r})})}),(0,Q.jsxs)(ye,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Ce,{children:k()}),W.map(e=>{let r=J[e];return(0,Q.jsxs)(N,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(V,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:we[e]??e})]},e)})]})]})}function Ne(){let e=_e({from:`/settings/users`}),t=I({from:`/settings/users`}),n=e.q??``,r=e.role??$,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),o=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),l=S(d.admin.listUsers,{filter:{q:n||void 0,role:r===$?void 0:r},withAgents:!0}),f=S(d.me.getMe,{host:Se}),p=u(d.admin.setRole),m=u(d.admin.setUserPermissions),h=u(d.admin.startImpersonation),g=u(d.admin.deleteUser),v=u(d.admin.setUserName),y=Te(),E=z(),D=P(),[O,k]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of l??[])e.add(t.role);return[...e]},[l]),M=n!==``||r!==$;function N(){t({search:{},replace:!0})}async function L(e){try{await p(e)}catch(e){D.error(_(),e)}}async function R(e){try{await m(e)}catch(e){D.error(s(),e)}}async function B(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await y({title:re(),description:ge({user:t}),confirmWord:pe(),confirmLabel:te(),destructive:!0}))try{await g({profileId:e._id}),D.success(w({user:t}))}catch(e){D.error(C(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await E({title:le(),label:oe({user:t}),placeholder:ae(),defaultValue:e.name??``,confirmLabel:b()});if(n!==null)try{await v({profileId:e._id,name:n}),D.success(fe())}catch(e){D.error(A(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:i,searchPlaceholder:c(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:r,onValueChange:o,children:[(0,Q.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Y,{value:$,children:ee()}),j.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:me(),rows:l,emptyHint:a(),rowActions:e=>{let t=[{label:ue(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:se(),onSelect:()=>void V(e)}];return e.userId!==f?.userId&&t.push({label:x(),onSelect:()=>void h({profileId:e._id})},{label:he(),variant:`destructive`,onSelect:()=>void B(e)}),t},columns:[{header:ie(),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,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:de(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void L({profileId:e._id,role:t}),children:[(0,Q.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Y,{value:`pending`,children:`pending`}),(0,Q.jsx)(Y,{value:`user`,children:`user`}),(0,Q.jsx)(Y,{value:`admin`,children:`admin`})]})]})},{header:ce(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ne()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),R({profileId:e._id,permissions:[...n]})}})},{header:T(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(G,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Ne as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{LC as e}from"./dist-LmEWWbCO.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};
|