@lacneu/atrium 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/assets/AccessTab-BrIt1Shn.js +1 -0
  2. package/dist/assets/{AdvancedFilter-S-HO9nIN.js → AdvancedFilter-WSiPBy4U.js} +1 -1
  3. package/dist/assets/AgentFilesTab-DJXF0Aoh.js +3 -0
  4. package/dist/assets/AnomaliesTab-CaxPbpG8.js +1 -0
  5. package/dist/assets/AuditTab-DJEltNBg.js +1 -0
  6. package/dist/assets/BridgeTab-DAbaJWeM.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-DK6PN4Ox.js +1 -0
  8. package/dist/assets/{DataTableShell-0Ttkz82b.js → DataTableShell-MMI0rbUm.js} +1 -1
  9. package/dist/assets/{DetailChips-DCOUgVDY.js → DetailChips-DYJCRnFu.js} +1 -1
  10. package/dist/assets/FeedbacksTab-Dk2qxzuw.js +1 -0
  11. package/dist/assets/{FieldLabel-BY0GU-yp.js → FieldLabel-Bq4HjU7s.js} +1 -1
  12. package/dist/assets/FilesTab-BxVYvqVK.js +1 -0
  13. package/dist/assets/{FilterBar-CkxsjoMo.js → FilterBar-Cj_JY0E6.js} +1 -1
  14. package/dist/assets/GroupsTab-CwVFISYr.js +1 -0
  15. package/dist/assets/InstancesTab-CPod41s7.js +1 -0
  16. package/dist/assets/IntegrationsTab-BPGkLpkW.js +1 -0
  17. package/dist/assets/KpiTab-D-oaIx6N.js +1 -0
  18. package/dist/assets/PreferencesTab-6OFkb2y9.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-D3qWQEjs.js +4 -0
  20. package/dist/assets/RolesTab-ZpqXyMkI.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-BTb0CHpP.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-C2z44X1u.js +1 -0
  23. package/dist/assets/ThemeShowroom-BVz6uM7X.js +1 -0
  24. package/dist/assets/{TimeRangePicker-Dtnfk3jk.js → TimeRangePicker-CiPB_fhH.js} +1 -1
  25. package/dist/assets/TracesTab-BlMOULWz.js +1 -0
  26. package/dist/assets/UsersTab-CDm22cMX.js +1 -0
  27. package/dist/assets/{button-Bv-PK2-Y.js → button-NWqGTLKg.js} +1 -1
  28. package/dist/assets/{card-B1IlPRv3.js → card-Og1f_0lq.js} +1 -1
  29. package/dist/assets/chevrons-up-down-BwvukG4v.js +1 -0
  30. package/dist/assets/{compatView-dNW7KqXq.js → compatView-dGQzCWqS.js} +1 -1
  31. package/dist/assets/dispatchErrorInfo-DWqpuG4e.js +1 -0
  32. package/dist/assets/{dist-Cjlv3ZK-.js → dist-C6Mg6d5Y.js} +5 -5
  33. package/dist/assets/{dist-LRVQ8Aeg.js → dist-DAR1w68Y.js} +1 -1
  34. package/dist/assets/{dist-DIuY2jzI.js → dist-DJ0yfLRs.js} +1 -1
  35. package/dist/assets/{dist-DqF6O0L8.js → dist-G-3s1IYq.js} +1 -1
  36. package/dist/assets/{highlighted-body-OFNGDK62-M3coudTw.js → highlighted-body-OFNGDK62-AIq9irts.js} +1 -1
  37. package/dist/assets/{index-BJ8KUScf.css → index-CgYI5cZd.css} +1 -1
  38. package/dist/assets/index-DkxYxN0F.js +229 -0
  39. package/dist/assets/mermaid-GHXKKRXX-CoyKxXhe.js +1 -0
  40. package/dist/assets/roleDescriptions-BHmXwdXm.js +1 -0
  41. package/dist/assets/{table-Dv9jX9eF.js → table-D0CDjuoL.js} +1 -1
  42. package/dist/assets/{tabs-BSiIDxTa.js → tabs-CvkXeE_E.js} +1 -1
  43. package/dist/assets/x-Citg8_PC.js +1 -0
  44. package/dist/index.html +8 -8
  45. package/package.json +1 -1
  46. package/dist/assets/AccessTab-Cr3ztAfe.js +0 -1
  47. package/dist/assets/AgentFilesTab-vFxwzq66.js +0 -3
  48. package/dist/assets/AnomaliesTab-r5VxDkWH.js +0 -1
  49. package/dist/assets/AuditTab-BGhAhpvt.js +0 -1
  50. package/dist/assets/BridgeTab-RozR95O-.js +0 -1
  51. package/dist/assets/ChatDefaultsTab-hRkzEosi.js +0 -1
  52. package/dist/assets/FeedbacksTab-3VcXRruH.js +0 -1
  53. package/dist/assets/FilesTab-mOXihu5T.js +0 -1
  54. package/dist/assets/GroupsTab-Cpe1zCFE.js +0 -1
  55. package/dist/assets/InstancesTab-BxcnITXD.js +0 -1
  56. package/dist/assets/IntegrationsTab-DO__uVCz.js +0 -1
  57. package/dist/assets/KpiTab-DK6kxWKf.js +0 -1
  58. package/dist/assets/PreferencesTab-CuphjTEb.js +0 -1
  59. package/dist/assets/PromptInjectionsTab-Cfo4Mq-9.js +0 -4
  60. package/dist/assets/RolesTab-CDQcpiM5.js +0 -1
  61. package/dist/assets/ServiceAccountsTab-Bx5Kbxar.js +0 -1
  62. package/dist/assets/SubAgentReportsTab-CQuFTC8k.js +0 -1
  63. package/dist/assets/ThemeShowroom-Bb62MCzH.js +0 -1
  64. package/dist/assets/TracesTab-DKRy25rR.js +0 -1
  65. package/dist/assets/UsersTab-BLi7LEyO.js +0 -1
  66. package/dist/assets/chevrons-up-down-Drx4hbha.js +0 -1
  67. package/dist/assets/dispatchErrorInfo-BF7yQgVh.js +0 -1
  68. package/dist/assets/index-BWV7nAxJ.js +0 -229
  69. package/dist/assets/mermaid-GHXKKRXX-CHLSnVjI.js +0 -1
  70. package/dist/assets/roleDescriptions-Br5xnRg9.js +0 -1
  71. package/dist/assets/x-3dY-o4JV.js +0 -1
@@ -0,0 +1 @@
1
+ import{O as e}from"./index-DkxYxN0F.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{B_ as e,H_ as t,U_ as n,V_ as r,W_ as i}from"./dist-C6Mg6d5Y.js";var a={pending:i,user:n,admin:t,observer:r,agent:e};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-Cjlv3ZK-.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};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-C6Mg6d5Y.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};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-Cjlv3ZK-.js";import{t as d}from"./dist-DIuY2jzI.js";import{_t as f,gt as p,ht as m}from"./index-BWV7nAxJ.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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 R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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 B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-C6Mg6d5Y.js";import{t as d}from"./dist-DJ0yfLRs.js";import{_t as f,gt as p,ht as m}from"./index-DkxYxN0F.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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 R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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 B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-C6Mg6d5Y.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
@@ -42,15 +42,15 @@
42
42
  document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
43
43
  })();
44
44
  </script>
45
- <script type="module" crossorigin src="/assets/index-BWV7nAxJ.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-DkxYxN0F.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dist-Cjlv3ZK-.js">
48
- <link rel="modulepreload" crossorigin href="/assets/dist-DIuY2jzI.js">
49
- <link rel="modulepreload" crossorigin href="/assets/dist-DqF6O0L8.js">
50
- <link rel="modulepreload" crossorigin href="/assets/dist-LRVQ8Aeg.js">
51
- <link rel="modulepreload" crossorigin href="/assets/x-3dY-o4JV.js">
52
- <link rel="modulepreload" crossorigin href="/assets/button-Bv-PK2-Y.js">
53
- <link rel="stylesheet" crossorigin href="/assets/index-BJ8KUScf.css">
47
+ <link rel="modulepreload" crossorigin href="/assets/dist-C6Mg6d5Y.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/dist-DJ0yfLRs.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/dist-G-3s1IYq.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/dist-DAR1w68Y.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/x-Citg8_PC.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/button-NWqGTLKg.js">
53
+ <link rel="stylesheet" crossorigin href="/assets/index-CgYI5cZd.css">
54
54
  </head>
55
55
  <body>
56
56
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
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{E as r,LA as i,OA as a,_l as o,al as s,cl as c,dl as l,fl as u,gl as d,hl as f,ll as p,ml as m,ol as h,pl as g,sl as _,ul as v,vl as y,yl as b}from"./dist-Cjlv3ZK-.js";import{C as x,S,b as C,et as w,w as T,x as E}from"./index-BWV7nAxJ.js";var D=t(e(),1);function O(e){return e===`user`?p():e===`all`?c():_({group:e.group})}function k(e){return e===`common`?h():e===`owner`?s():_({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=i(r.admin.listUsers,{}),[t,n]=(0,D.useState)(``),s=i(r.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}),(0,A.jsxs)(C,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":y(),children:(0,A.jsx)(T,{placeholder:y()})}),(0,A.jsx)(E,{children:(e??[]).map(e=>(0,A.jsx)(S,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):s===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:d()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:s.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:s.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:f()}),s.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:s.groups.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:m()}),s.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:s.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(w,{variant:`default`,children:v()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:g()}),s.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:s.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(w,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:u()}),s.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:s.permissions.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,$t as i,AA as a,Ao as o,Bo as s,Bt as c,Ct as l,Do as u,Dt as d,E as f,Eo as p,Et as m,Fo as h,Fs as g,Ft as _,Go as v,Gt as y,Ho as b,Ht as x,IA as S,Io as C,It as w,Jo as T,Jt as E,Ko as D,Kt as O,LA as k,Lo as A,Ls as j,Lt as M,Mo as ee,No as te,OA as N,Oo as ne,PA as P,Po as F,Pt as I,Qo as L,Qt as R,Ro as z,Rt as re,St as B,To as V,Tt as H,Uo as U,Ut as W,Vo as ie,Vt as ae,Wo as oe,Wt as se,Xo as ce,Xt as le,Yo as ue,Yt as G,Zo as de,Zt as fe,en as pe,es as me,gT as he,jo as ge,ko as _e,qo as ve,qt as ye,wt as be,xt as xe,zo as Se,zt as Ce}from"./dist-Cjlv3ZK-.js";import{t as K}from"./button-Bv-PK2-Y.js";import{B as we,C as Te,H as Ee,L as De,P as q,R as Oe,S as ke,U as Ae,V as je,W as Me,b as Ne,et as Pe,it as Fe,nt as Ie,ot as Le,rt as Re,st as ze,ut as Be,vt as J,w as Ve,x as He,y as Ue,z as We}from"./index-BWV7nAxJ.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-dNW7KqXq.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(e,t){let n=new Map;for(let t of e.split(`
2
- `))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
3
- `))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=k(f.me.getMe,{host:Be}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=k(f.admin.listInstances,e!==void 0&&t?{}:`skip`),[o,s]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!i||i.length===0||(!o||!i.some(e=>e.name===o))&&s(i[0].name)},[t,i,o]);let c=k(f.agents.listAgentsForInstance,t&&o?{instanceName:o}:`skip`),l=k(f.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),u=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return o===null||c===void 0?i!==void 0&&i.length===0?[]:void 0:c.agents.map(e=>({instanceName:o,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(l!==void 0)return l.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,o,c,i,l]),[d,p]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!u||u.length===0||(!d||!u.some(e=>$(e)===d))&&p($(u[0]))},[u,d]);let m=u?.find(e=>$(e)===d)??null,h=P(f.agentFiles.listAgentFiles),[_,y]=(0,Y.useState)({status:`idle`}),x=m?.instanceName??null,S=m?.agentId??null,C=k(f.compat.forInstance,n&&x!==null?{instanceName:x}:`skip`),w=n&&x!==null?Ue(C,`agentFiles`):null,E=w===null?!1:w===`loading`?null:w.blocked,O=(0,Y.useCallback)(async()=>{if(!(x===null||S===null)){y({status:`loading`});try{y({status:`done`,files:(await h({instanceName:x,agentId:S})).files})}catch{y({status:`error`})}}},[h,x,S]);(0,Y.useEffect)(()=>{E===!1&&O()},[O,E]);let[A,j]=(0,Y.useState)(null),M=k(f.agentFileCuration.listCurations,t&&x!==null&&S!==null?{instanceName:x,agentId:S}:`skip`),ee=k(f.agentFileCuration.curationSettings,t&&x!==null?{instanceName:x}:`skip`),te=P(f.agentFileCuration.requestCuration),[ne,F]=(0,Y.useState)(null),[I,R]=(0,Y.useState)(null),{toast:z}=q(),re=(0,Y.useMemo)(()=>{let e=new Map;for(let t of M??[])e.has(t.name)||e.set(t.name,t);return e},[M]),B=(0,Y.useCallback)(async e=>{if(!(x===null||S===null)){F(e);try{let t=await te({instanceName:x,agentId:S,name:e,trigger:`manual`});t.ok?z({title:fe(),variant:`success`}):z({title:le({reason:t.reason??`unknown`}),variant:`error`})}catch{z({title:G(),variant:`error`})}finally{F(null)}}},[te,x,S,z]),V=a(),H=(0,Y.useMemo)(()=>new Intl.NumberFormat(V,{maximumFractionDigits:0}),[V]);return e===void 0||u===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(Ne,{value:o??``,onValueChange:e=>s(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:(i??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,u.length>0?(0,Q.jsxs)(Ne,{value:d??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":L(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:u.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:de()})]}),m===null?null:w===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):w!==null&&w.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(w.gatewayVersion)]}):_.status===`loading`||_.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):_.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ue(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void O(),children:g()})]}):_.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ce()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:_.files.map(e=>{let n=Ye(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(Pe,{variant:`outline`,children:T()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:ve({size:Z(e.size,V)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:D({pct:H.format(n)})}),r?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":v()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>j(e),children:t?U():b()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:ee?.budgetChars??null,enabled:ee?.enabled??!1,curation:re.get(e.name)??null,inFlight:ne===e.name,onCurate:()=>void B(e.name),onReview:e=>R(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:oe({used:Z(Ze(_.files),V),total:Z(Je,V),pct:H.format(Xe(Ze(_.files)))})})]}),A&&m?(0,Q.jsx)(rt,{instanceName:m.instanceName,agentId:m.agentId,name:A.name,isAdmin:t,onClose:()=>j(null),onSaved:()=>void O()}):null,I?(0,Q.jsx)(it,{curationId:I,onClose:()=>R(null),onApplied:()=>{R(null),O()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:a,inFlight:o,onCurate:s,onReview:c}){return a?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>c(a._id),children:i()}):o||a?.status===`dispatched`||a?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:R()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:s,children:pe()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:c}){let l=P(f.agentFiles.getAgentFile),d=P(f.agentFiles.setAgentFile),m=q(),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(!1),[E,D]=(0,Y.useState)(!1),[O,k]=(0,Y.useState)(!1),[M,I]=(0,Y.useState)(!1),L=(0,Y.useCallback)(async r=>{b(!1);try{let i=await l({instanceName:e,agentId:t,name:n});v({content:i.content,updatedAtMs:i.updatedAtMs}),r||S(i.content),k(!1)}catch{b(!0)}},[l,e,t,n]);(0,Y.useEffect)(()=>{L(!1)},[L]);async function R(){if(_!==null){D(!0),I(!1);try{await d({instanceName:e,agentId:t,name:n,content:x,baseUpdatedAtMs:_.updatedAtMs??void 0}),m.success(h({name:n})),c(),await L(!1)}catch(e){et(e)?k(!0):I(!0)}finally{D(!1)}}}let re=_!==null&&x!==_.content,B=(0,Y.useMemo)(()=>_===null?null:$e(_.content,x),[_,x]),H=x.length>X,U=a(),W=(0,Y.useMemo)(()=>new Intl.NumberFormat(U),[U]);return(0,Q.jsx)(Ie,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(ze,{children:ie({name:n})}),(0,Q.jsxs)(Fe,{children:[s({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,Se()]})]})]}),y?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[te(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void L(!1),children:g()})]}):_===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:x,readOnly:!r,spellCheck:!1,onChange:e=>S(e.target.value),"aria-label":ie({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:z()}),O?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ee(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void L(!0),children:ge()})]}):null,M?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:F()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${H?` is-over`:``}`,children:A({count:W.format(x.length),max:W.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!re||E||O,onClick:()=>T(!0),children:E?j():C()}):null]})]}),(0,Q.jsx)(De,{open:w,onOpenChange:T,children:(0,Q.jsxs)(we,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Me,{children:o({name:n})}),(0,Q.jsx)(je,{children:_e({agent:t})})]}),B?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:ne({added:B.added,removed:B.removed})}),B.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:u()}),B.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,B.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:p()}),B.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(We,{children:he()}),(0,Q.jsx)(Oe,{onClick:()=>void R(),children:V()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=k(f.agentFileCuration.getProposal,{curationId:e}),i=P(f.agentFileCuration.approveCuration),o=S(f.agentFileCuration.rejectCuration),{toast:s}=q(),[u,p]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),[v,b]=(0,Y.useState)(``),C=a(),T=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function D(){p(`approve`);try{let t=await i({curationId:e});t.ok?(s({title:E(),variant:`success`}),n()):s({title:t.reason===`conflict`?O():y({reason:t.reason??`unknown`}),variant:`error`})}catch{s({title:G(),variant:`error`})}finally{p(null)}}async function A(n){p(`reject`);try{let r=v.trim();(await o({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?s({title:n?B():ye(),variant:`success`}):s({title:x(),variant:`error`}),t()}catch{s({title:G(),variant:`error`})}finally{p(null)}}return(0,Q.jsx)(Ie,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(ze,{children:r?se({name:r.name}):N()}),(0,Q.jsx)(Fe,{children:W()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[ae({before:Z(r.beforeSize,C),after:Z(r.proposedSize,C)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,c()]}):null]}),T?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:Ce({added:T.added,removed:T.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:xe({feedback:r.feedback})}):null,T&&T.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:I()}),(0,Q.jsx)(`ul`,{children:T.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:_()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:re()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),h?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:d()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:m(),value:v,onChange:e=>b(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>g(!1),disabled:u!==null,children:H()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void A(!1),disabled:u!==null,children:u===`reject`?j():be()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void A(!0),disabled:u!==null,children:u===`reject`?j():l()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>g(!0),disabled:u!==null||r==null,children:M()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void D(),disabled:u!==null||r==null,children:u===`approve`?j():w()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$g as r,Bg as i,C_ as ee,D_ as a,E as o,E_ as s,Gg as c,Hg as l,IA as u,Jg as d,Kg as te,LA as f,Qg as ne,S_ as re,T_ as p,Ug as ie,Vg as m,Wg as ae,Xg as oe,Yg as se,Zg as ce,__ as le,a_ as ue,b_ as h,c_ as g,d_ as de,e_ as _,f_ as fe,g_ as pe,h_ as me,i_ as v,l_ as he,m_ as ge,n_ as y,o_ as b,p_ as x,qg as S,r_ as C,s_ as w,t_ as T,u_ as E,v_ as D,w_ as O,x_ as k,y_ as A,zg as j}from"./dist-Cjlv3ZK-.js";import{A as M,C as N,F as P,Ft as F,It as I,P as L,S as R,a as _e,b as z,et as B,r as ve,ut as ye,w as V,x as H}from"./index-BWV7nAxJ.js";import{n as be}from"./TimeRangePicker-Dtnfk3jk.js";import{t as xe}from"./FilterBar-CkxsjoMo.js";import{t as Se}from"./DataTableShell-0Ttkz82b.js";import{t as U}from"./dispatchErrorInfo-BF7yQgVh.js";var W=t(e(),1),G=n(),K=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?a():e===`acknowledged`?s():p()}var Te=[`info`,`warn`,`critical`],Ee=[`detector`,`agent`,`user`],De={kind:`relative`,from:`now-30d`,to:`now`},Oe=200,q=`all`;function J(){let e=I({from:`/settings/anomalies`}),t=F({from:`/settings/anomalies`}),n=e.q??``,i=e.status===q?K:e.status,a=e.severity??K,s=e.kind??K,[l,p]=(0,W.useState)(K),m=ve(e.from,e.to),{from:j,to:U}=be(m),J=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Y=e=>void t({search:t=>({...t,status:e===K?q:e})}),X=e=>void t({search:t=>({...t,severity:e===K?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===K?void 0:e})}),Pe=e=>void t({search:t=>({...t,..._e(e)})}),Fe=P(),Z=L(),Q=u(o.anomalies.resolveAnomaly),Ie=(f(o.me.getMe,{host:ye})?.permissions??[]).includes(`admin.manage`),$=f(o.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:j,to:U,anomalyStatus:i===K?void 0:i,severity:a===K?void 0:a,source:l===K?void 0:l,kind:s===K?void 0:s}}),Le=(0,W.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Re=n!==``||i!==`open`||a!==K||l!==K||s!==K||m.kind!==`relative`||m.from!==De.from;function ze(){p(K),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Fe({title:O(),description:(0,G.jsxs)(G.Fragment,{children:[ee(),` `,(0,G.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,re(),` `,(0,G.jsx)(`strong`,{children:k()}),`.`,` `,h()]}),confirmLabel:A()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(D(),e.kind)}catch(e){Z.error(le(),e)}}async function Ve(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(pe(),e.kind)}catch(e){Z.error(me(),e)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`oc-admin__hint`,children:[ge(),` `,(0,G.jsx)(`strong`,{children:x()}),` `,fe(),` `,(0,G.jsx)(`strong`,{children:de()}),` `,E(),` `,(0,G.jsx)(`strong`,{children:he()}),` `,g(),` `,(0,G.jsx)(`span`,{className:`oc-filter__window`,children:w()})]}),(0,G.jsxs)(xe,{q:n,onQChange:J,searchPlaceholder:b(),timeRange:m,onTimeRangeChange:Pe,onReset:ze,canReset:Re,children:[(0,G.jsxs)(z,{value:i,onValueChange:Y,children:[(0,G.jsx)(N,{size:`sm`,className:`w-36`,children:(0,G.jsx)(V,{})}),(0,G.jsxs)(H,{children:[(0,G.jsx)(R,{value:K,children:ue()}),Ce.map(e=>(0,G.jsx)(R,{value:e.value,children:we(e.value)},e.value))]})]}),(0,G.jsxs)(z,{value:a,onValueChange:X,children:[(0,G.jsx)(N,{size:`sm`,className:`w-36`,children:(0,G.jsx)(V,{placeholder:v()})}),(0,G.jsxs)(H,{children:[(0,G.jsx)(R,{value:K,children:C()}),Te.map(e=>(0,G.jsx)(R,{value:e,children:e},e))]})]}),(0,G.jsxs)(z,{value:l,onValueChange:p,children:[(0,G.jsx)(N,{size:`sm`,className:`w-32`,children:(0,G.jsx)(V,{placeholder:y()})}),(0,G.jsxs)(H,{children:[(0,G.jsx)(R,{value:K,children:T()}),Ee.map(e=>(0,G.jsx)(R,{value:e,children:e},e))]})]}),(0,G.jsxs)(z,{value:s,onValueChange:Ne,children:[(0,G.jsx)(N,{size:`sm`,className:`w-36`,children:(0,G.jsx)(V,{placeholder:_()})}),(0,G.jsxs)(H,{children:[(0,G.jsx)(R,{value:K,children:r()}),Le.map(e=>(0,G.jsx)(R,{value:e,children:e},e))]})]})]}),(0,G.jsx)(Se,{title:ne(),rows:$,emptyHint:i===`open`?ce():oe(),rowActions:e=>Ie&&e.status===`open`?[{label:se(),onSelect:()=>void Be(e)},{label:d(),onSelect:()=>void Ve(e)}]:[],columns:[{header:S(),cell:e=>(0,G.jsx)(`span`,{className:`oc-traces__time`,children:M(e.at)}),sort:e=>e.at},{header:_(),cell:e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:v(),cell:e=>(0,G.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:te(),cell:e=>(0,G.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:y(),cell:e=>(0,G.jsx)(B,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:c(),cell:e=>(0,G.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:ae(),cell:e=>(0,G.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:ie(),cell:e=>e.correlationId?(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:Me(e.correlationId)}):(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Y(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function X(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function ke({row:e}){let t=F();if(e.kind===`subagent.failure`){let n=X(e);return(0,G.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,G.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,G.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,l()]}):null]})}let n=Y(e);if(!n.dominantCode)return(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=U(n.dominantCode),i=n.sampleCorrelationId;return(0,G.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,G.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,G.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,G.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,G.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,l()]}):null]})}function Ae({severity:e}){return(0,G.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function je({status:e}){return e===`open`?(0,G.jsx)(B,{variant:`destructive`,children:m()}):e===`acknowledged`?(0,G.jsx)(B,{variant:`secondary`,children:i()}):(0,G.jsx)(B,{variant:`outline`,children:j()})}function Me(e){return e.length>8?e.slice(0,8):e}export{J as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,Av as i,Cv as a,Dv as o,E as s,Ev as c,J as l,LA as u,Mv as d,Ov as f,Q as p,Sv as m,Tv as h,X as g,Y as _,Z as v,bv as y,jv as b,kv as x,vv as S,wv as C,xv as w,yv as T}from"./dist-Cjlv3ZK-.js";import{A as E,C as D,Ft as O,It as k,S as A,a as j,b as M,i as N,o as P,r as F,t as I,w as L,x as R}from"./index-BWV7nAxJ.js";import{n as ee}from"./TimeRangePicker-Dtnfk3jk.js";import{t as z}from"./FilterBar-CkxsjoMo.js";import{t as B}from"./AdvancedFilter-S-HO9nIN.js";import{t as V}from"./DataTableShell-0Ttkz82b.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:r()},{value:`realLabel`,label:p()},{value:`targetLabel`,label:v()},{value:`impersonated`,label:g()},{value:`resource`,label:_()},{value:`resourceId`,label:l()}];function q(){let e=k({from:`/settings/audit`}),t=O({from:`/settings/audit`}),n=e.q??``,r=e.action??G,l=e.impersonated??G,p=e.resource??G,g=F(e.from,e.to),_=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:v,to:I}=ee(g),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...j(e)})}),Q=e=>void t({search:t=>({...t,adv:N(e)}),replace:!0}),$=u(s.admin.listAudit,{filter:{q:n||void 0,from:v,to:I,action:r===G?void 0:r,resource:p===G?void 0:p,impersonated:l===G?void 0:l===`yes`,advanced:_.length>0?_:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||r!==G||l!==G||p!==G||_.length>0||g.kind!==`relative`||g.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[d(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:b()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:i(),timeRange:g,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(M,{value:r,onValueChange:J,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:x()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:f()}),te.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]}),(0,U.jsxs)(M,{value:l,onValueChange:Y,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:o()}),(0,U.jsx)(A,{value:`yes`,children:c()}),(0,U.jsx)(A,{value:`no`,children:h()})]})]}),(0,U.jsxs)(M,{value:p,onValueChange:X,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:C()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:a()}),ne.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:_,onChange:Q}),(0,U.jsx)(V,{title:m(),rows:$,emptyHint:w(),columns:[{header:y(),cell:e=>E(e.at),sort:e=>e.at},{header:x(),cell:e=>e.action,sort:e=>e.action},{header:T(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:S(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:C(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,$p as i,Am as a,Ap as o,Bm as s,Bp as c,Cp as l,D as u,Dm as d,Dp as f,E as p,Em as m,Ep as h,Fm as ee,Fp as g,Gp as te,Hp as _,IA as ne,Im as re,Ip as v,Jp as y,Kp as ie,LA as b,Lm as ae,Lp as x,Mm as oe,Mp as S,Nm as se,Np as C,Op as ce,PA as le,Pm as ue,Pp as de,Qa as fe,Qp as pe,Rp as me,Sp as he,Tp as ge,Up as _e,Vp as ve,Wp as ye,Xp as be,Yp as xe,Za as Se,Zp as Ce,_p as we,ao as Te,bp as Ee,co as De,dp as w,em as Oe,eo as ke,fp as Ae,gp as je,hp as Me,im as Ne,io as Pe,jm as Fe,jp as Ie,kp as Le,lo as Re,lp as T,mp as ze,nm as Be,no as Ve,oo as He,pp as Ue,qa as We,qp as Ge,rm as Ke,ro as qe,so as Je,tm as Ye,to as Xe,uo as Ze,up as E,vp as Qe,wp as $e,xp as et,yp as tt,zm as nt,zp as rt}from"./dist-Cjlv3ZK-.js";import{i as D,r as it}from"./dist-DIuY2jzI.js";import{t as at}from"./chevrons-up-down-Drx4hbha.js";import{i as ot,n as O,o as st,r as ct,s as lt}from"./FieldLabel-BY0GU-yp.js";import{t as ut}from"./button-Bv-PK2-Y.js";import{A as dt,C as k,Et as ft,Ft as pt,G as mt,K as ht,Nt as A,P as gt,Pt as j,S as M,b as N,et as P,it as _t,j as F,m as vt,nt as yt,ot as bt,p as xt,q as St,rt as Ct,st as wt,tt as I,ut as Tt,vt as L,w as R,x as z,xt as Et}from"./index-BWV7nAxJ.js";import{r as Dt}from"./locales-CPjguROj.js";import{a as Ot,i as B,n as kt,o as V,r as H,t as At}from"./table-Dv9jX9eF.js";import{t as jt}from"./FilterBar-CkxsjoMo.js";import{a as U,n as Mt,o as W,r as G,s as Nt,t as Pt}from"./compatView-dNW7KqXq.js";import{t as K}from"./dispatchErrorInfo-BF7yQgVh.js";var Ft=u(`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`}]]),It=u(`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 Lt(e){return e.filter(e=>e.state===`error`)}function Rt(e){return e.reachable&&Lt(e.targets).length===0}function zt(e){return e.state===`error`&&e.lastErrorCode!==null}function Bt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function Vt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ht(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 Vt(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 Ut(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Wt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Gt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Kt(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 qt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Jt(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 Yt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=qt(t.key,e),a=qt(t.key,r);return i&&a?0:i?1:a?-1:n*Jt(t.key,e,r)})}function Xt(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 Zt(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 Qt(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 $t({connections:e,displayByInstance:t}){let[n,r]=(0,q.useState)(Wt),[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)(()=>Xt(o),[o]),c=(0,q.useMemo)(()=>Zt(o),[o]),u=(0,q.useMemo)(()=>Qt(o),[o]),d=(0,q.useMemo)(()=>Yt(Kt(o,n),i),[o,n,i]);function p(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:f()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(jt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:$e(),onReset:()=>r(Wt),canReset:Gt(n),children:[(0,Q.jsxs)(N,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(R,{placeholder:he()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:l()}),s.map(e=>(0,Q.jsx)(M,{value:e,children:tn(e)},e))]})]}),(0,Q.jsxs)(N,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(R,{placeholder:et()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:l()}),c.map(e=>(0,Q.jsx)(M,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(N,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(R,{placeholder:Ee()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:l()}),u.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))]})]})]}),d.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:tt()}):(0,Q.jsxs)(At,{className:`oc-conn__table`,children:[(0,Q.jsx)(Ot,{children:(0,Q.jsxs)(V,{children:[(0,Q.jsx)($,{label:Qe(),sortKey:`target`,sort:i,onSort:p}),(0,Q.jsx)($,{label:we(),sortKey:`state`,sort:i,onSort:p}),(0,Q.jsx)($,{label:je(),sortKey:`instance`,sort:i,onSort:p}),(0,Q.jsx)($,{label:Me(),sortKey:`host`,sort:i,onSort:p}),(0,Q.jsx)($,{label:ze(),sortKey:`version`,sort:i,onSort:p}),(0,Q.jsx)(B,{children:Ue()}),(0,Q.jsx)($,{label:Ae(),sortKey:`lastOk`,sort:i,onSort:p})]})}),(0,Q.jsx)(kt,{children:d.map(e=>(0,Q.jsx)(en,{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)(it,{size:13,"aria-hidden":!0}):(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(at,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function en({r:e}){let t=zt(e)?K(e.lastErrorCode):null,n=Bt(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)(nn,{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:h({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:F(e.lastOkAt)}):(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?` · ${F(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[ge({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${F(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function tn(e){return e===`connected`?w():e===`error`?E():T()}function nn({state:e}){return e===`connected`?(0,Q.jsx)(P,{variant:`secondary`,children:w()}):e===`error`?(0,Q.jsx)(P,{variant:`destructive`,children:E()}):(0,Q.jsx)(P,{variant:`outline`,children:T()})}function rn(){return b(p.bridgeHealth.getBridgeHealth,{})}function an(){let e=rn(),t=b(p.compat.getBridgeCompat,{}),n=b(p.me.getMe,{host:Tt})?.role===`admin`,r=b(p.admin.listInstances,n?{}:`skip`),i=b(p.agents.usageForInstances,n?{}:`skip`),a=pt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=Ht(e?e.targets:[],t?t.targets:[],r??[]),c=t?.compat??null,l=t===void 0?`loading`:t===null?`nodata`:`ready`,u=c!==null&&Mt(c,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(on,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:ye()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:_e()}),i.map(e=>{let t=vt(e.usage,Date.now());return t?(0,Q.jsxs)(`div`,{className:`oc-bridge__usage-row`,children:[(0,Q.jsx)(`span`,{className:`oc-bridge__usage-instance`,children:e.instanceName}),(0,Q.jsx)(`span`,{className:`oc-bridge__usage-windows`,children:t.windows.map(e=>(0,Q.jsx)(`span`,{className:`oc-meter ${e.percentLeft<=10?`is-critical`:e.percentLeft<=25?`is-warn`:`is-ok`}`,children:(0,Q.jsxs)(`span`,{className:`oc-meter__label`,children:[e.provider,` `,e.label,`: `,e.percentLeft,`%`,e.resetText?` ⏱${e.resetText}`:``]})},`${e.provider}:${e.label}`))})]},e.instanceName):null})]}):null,s.map(e=>(0,Q.jsx)(sn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:c,compatStatus:l,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null},e.key)),u?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):null]})}function on({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=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)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:De(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,Je({build:t.buildVersion??`?`})]}):null,` · `,He(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?Te():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:g()});let s=Lt(e.targets),c=!e.reachable,l=Rt(e),u=l?`ok`:`error`,d=dt(e.checkedAt),f=e.startedAt==null?null:dt(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:l?(0,Q.jsx)(A,{size:22}):c?(0,Q.jsx)(It,{size:22}):(0,Q.jsx)(L,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:l?de():c?C():S({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Ft,{size:12,"aria-hidden":!0}),` `,Ie({time:d})]}),f?(0,Q.jsx)(`span`,{children:o({time:f})}):null,a]}),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:Le()})]})}function sn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Nt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Pt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,q.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(Et,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Ut(e)}),f?(0,Q.jsx)(P,{variant:f===`beyond`?`destructive`:`secondary`,children:G(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ze()}),(0,Q.jsx)(ln,{support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Q.jsx)(cn,{protocol:o}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(j,{size:13,"aria-hidden":!0}),ce({count:t.length})]}),p?(0,Q.jsx)($t,{connections:t,displayByInstance:c}):null]})}function cn({protocol:e}){let[t,n]=(0,q.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[_(),i.length>0?(0,Q.jsx)(P,{variant:`destructive`,children:c({count:i.length})}):(0,Q.jsx)(P,{variant:`secondary`,children:ve()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[rt({version:e.vendoredVersion}),r?` · `+me({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(j,{size:13,"aria-hidden":!0}),x({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function ln({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Ve()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Xe({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:Te()}),e?(0,Q.jsx)(pn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Se()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.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)(P,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:G(e.state)})]},e.instanceName))})]})}function un({instance:e,onClose:t}){return(0,Q.jsx)(yt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(Ct,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(bt,{children:[(0,Q.jsx)(wt,{children:s({instance:e.displayName??e.name})}),(0,Q.jsx)(_t,{children:nt()})]}),(0,Q.jsx)(fn,{instance:e,onClose:t})]})})}function dn({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)(A,{"aria-hidden":!0}):(0,Q.jsx)(L,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?y():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,Ge()]}):null}function fn({instance:e,onClose:t}){let n=ne(p.admin.upsertInstanceConfig),r=le(p.bridge.validateMediaPaths),o=gt(),s=Dt(e.config?.contentLocale,void 0),[c,l]=(0,q.useState)(()=>ot(e.config??{},s)),[u,f]=(0,q.useState)(!1),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(null),y=c.inboundMediaMode===`shared-fs`,b=c.mediaMode===`shared-fs`,x=y||b;async function S(){g(!0),v(null);try{v(await r({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){o.error(pe(),e)}finally{g(!1)}}async function C(){f(!0);try{let r=e.config??{};await n({instanceId:e._id,config:ct(c,r,s)}),t()}catch(e){o.error(oe(),e)}finally{f(!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)(O,{label:ae(),help:Fe()}),(0,Q.jsxs)(N,{value:c.mediaMode,onValueChange:e=>l({...c,mediaMode:e}),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(R,{})}),(0,Q.jsx)(z,{children:lt.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:re(),help:a()}),(0,Q.jsxs)(N,{value:c.inboundMediaMode,onValueChange:e=>l({...c,inboundMediaMode:e}),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(R,{})}),(0,Q.jsx)(z,{children:st.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:ee(),help:d()}),(0,Q.jsx)(I,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>l({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),x&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[y&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:Ne(),help:Ke()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>l({...c,inboundAgentMount:e.target.value})})]}),b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:Be(),help:Ye()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>l({...c,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(xt,{checked:c.rehydration,onCheckedChange:e=>l({...c,rehydration:e===!0})}),(0,Q.jsx)(O,{label:ue(),help:m()})]}),x&&_!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:_.reachable?!_.inbound&&!_.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),te({reason:_.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(dn,{label:be(),result:_.inbound}),(0,Q.jsx)(dn,{label:xe(),result:_.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),ie()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[x&&(0,Q.jsxs)(ut,{variant:`outline`,size:`sm`,onClick:()=>void S(),disabled:h,children:[h?(0,Q.jsx)(ft,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,h?i():Oe()]}),(0,Q.jsx)(ut,{size:`sm`,onClick:()=>void C(),disabled:u,children:se()})]})]})})}function pn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(mt,{children:[(0,Q.jsx)(St,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?ke():r({count:e.length}),(0,Q.jsx)(D,{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:fe()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(P,{variant:`secondary`,children:e},e))})]})]})}export{an as BridgeTab,un as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,As as i,Bn as a,Co as o,E as s,Fs as c,Gn as l,Hn as u,IA as d,LA as f,Ls as p,OA as m,PA as h,Rm as g,So as _,Un as v,Vn as y,Wn as b,_o as x,bo as S,do as ee,fo as te,gT as ne,go as C,ho as w,js as T,mo as re,po as E,vo as ie,xo as D,yo as O,zn as k}from"./dist-Cjlv3ZK-.js";import{t as A}from"./button-Bv-PK2-Y.js";import{B as ae,C as oe,H as se,L as ce,P as le,R as ue,S as de,U as fe,V as j,W as M,b as N,d as P,f as F,p as I,tt as L,vt as R,w as z,x as B,y as V,z as pe}from"./index-BWV7nAxJ.js";import{i as me}from"./compatView-dNW7KqXq.js";/* empty css */var H=t(e(),1),he=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function ge(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 U=n();function _e({instance:e}){let t=d(s.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,r=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[i,o]=(0,H.useState)(n),[c,l]=(0,H.useState)(r===null?``:String(r)),[f,m]=(0,H.useState)(`idle`);(0,H.useEffect)(()=>{o(n),l(r===null?``:String(r)),m(`idle`)},[e._id,n,r]);let h=c.trim(),g=h===``?null:/^\d+$/.test(h)?Number.parseInt(h,10):NaN,_=!i||g===null||Number.isInteger(g)&&g>=4e3&&g<=6e4,b=i!==n||(g??null)!==r;async function S(){m(`saving`);try{let n={...e.config??{}};n.curationEnabled=i,!i||g===null||Number.isNaN(g)?delete n.curationBudgetChars:n.curationBudgetChars=g,await t({instanceId:e._id,config:n}),m(`done`)}catch{m(`error`)}}return(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,U.jsx)(I,{checked:i,onCheckedChange:e=>o(e===!0),"aria-label":v()}),(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,U.jsx)(L,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:c,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!_,"aria-label":u(),disabled:!i}),(0,U.jsx)(A,{size:`sm`,disabled:!b||!_||f===`saving`,onClick:()=>void S(),children:f===`saving`?p():x()})]}),_?null:(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:y()}),f===`done`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:C()}):null,f===`error`?(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:w()}):null,(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:a()})]})}function ve({instance:e}){let t=d(s.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,H.useState)(n===null?``:String(n)),[a,o]=(0,H.useState)(`idle`);(0,H.useEffect)(()=>{i(n===null?``:String(n)),o(`idle`)},[e._id,n]);let c=r.trim(),u=c===``?null:/^\d+$/.test(c)?Number.parseInt(c,10):NaN,f=u===null||Number.isInteger(u)&&u>=1e3&&u<=2e5,m=(u??null)!==n;async function h(){o(`saving`);try{let n={...e.config??{}};u===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=u,await t({instanceId:e._id,config:n}),o(`done`)}catch{o(`error`)}}return(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,U.jsx)(L,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!f}),(0,U.jsx)(A,{size:`sm`,disabled:!m||!f||a===`saving`,onClick:()=>void h(),children:a===`saving`?p():x()})]}),f?null:(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:k()}),a===`done`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:C()}):null,a===`error`?(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:w()}):null,(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:b()})]})}function W(){let e=h(s.agentFiles.getChatDefaults),t=h(s.agentFiles.setChatDefaults),n=le(),[a,l]=(0,H.useState)({status:`loading`}),[u,d]=(0,H.useState)({thinkingDefault:null,fastModeDefault:null}),[v,y]=(0,H.useState)(!1),[b,k]=(0,H.useState)(!1),I=f(s.admin.listInstances,{}),[L,W]=(0,H.useState)(null);(0,H.useEffect)(()=>{!I||I.length===0||(!L||!I.some(e=>e.name===L))&&W(I[0].name)},[I,L]);let G=(I?.length??0)>1,ye=I!==void 0&&I.length===0,be=f(s.compat.forInstance,L?{instanceName:L}:`skip`),K=L?V(be,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,H.useMemo)(()=>G&&L?{instanceName:L}:{},[G,L]),Y=(0,H.useRef)(0),X=(0,H.useCallback)(async()=>{let t=++Y.current;l({status:`loading`});try{let n=ge(await e(J));if(Y.current!==t)return;l({status:`done`,current:n}),d(n)}catch{if(Y.current!==t)return;l({status:`error`})}},[e,J]);(0,H.useEffect)(()=>{q===!1&&(G&&!L||X())},[X,q,G,L]);let Z=a.status===`done`?a.current:null,Q=Z!==null&&u.thinkingDefault!==null&&u.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&u.fastModeDefault!==null&&u.fastModeDefault!==Z.fastModeDefault,xe=Q||$;async function Se(){k(!0);try{await t({...J,...Q?{thinkingDefault:u.thinkingDefault}:{},...$?{fastModeDefault:u.fastModeDefault}:{}}),n.success(C()),await X()}catch(e){n.error(w(),e)}finally{k(!1)}}let Ce=(0,H.useMemo)(()=>he.map(e=>({id:e,label:F(e)})),[]),we=(0,H.useMemo)(()=>[{id:`fast`,label:T()},{id:`standard`,label:i()}],[]);return(0,U.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),G&&L?(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,U.jsxs)(N,{value:L,onValueChange:e=>W(e),disabled:b,children:[(0,U.jsx)(oe,{size:`sm`,"aria-label":r(),children:(0,U.jsx)(z,{})}),(0,U.jsx)(B,{children:(I??[]).map(e=>(0,U.jsx)(de,{value:e.name,children:e.name},e.name))})]})]}):null,ye?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:g()}):K===`loading`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):K.blocked?(0,U.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,U.jsx)(R,{size:14,"aria-hidden":!0}),` `,me(K.gatewayVersion)]}):a.status===`loading`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):a.status===`error`?(0,U.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[ie(),` `,(0,U.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:c()})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()}),(0,U.jsx)(P,{options:Ce,value:u.thinkingDefault,onChange:e=>d({...u,thinkingDefault:e}),disabled:b}),(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()})]}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:S()}),(0,U.jsx)(P,{options:we,value:u.fastModeDefault===null?null:u.fastModeDefault?`fast`:`standard`,onChange:e=>d({...u,fastModeDefault:e===`fast`}),disabled:b}),(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:O()})]}),(0,U.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,U.jsx)(A,{size:`sm`,disabled:!xe||b,onClick:()=>y(!0),children:b?p():x()})}),(0,U.jsx)(`p`,{className:`oc-cdefaults__note`,children:re()})]}),(()=>{let e=I?.find(e=>e.name===(L??I[0]?.name));return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ve,{instance:e}),(0,U.jsx)(_e,{instance:e})]}):null})(),(0,U.jsx)(ce,{open:v,onOpenChange:y,children:(0,U.jsxs)(ae,{children:[(0,U.jsxs)(fe,{children:[(0,U.jsx)(M,{children:E()}),(0,U.jsx)(j,{children:te()})]}),(0,U.jsxs)(se,{children:[(0,U.jsx)(pe,{children:ne()}),(0,U.jsx)(ue,{onClick:()=>void Se(),children:ee()})]})]})})]})}export{W as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,Ax as i,Bx as a,Cx as o,Dx as s,E as c,Ex as l,Fx as u,Gx as d,Hx as f,IA as p,Ix as ee,Jb as m,Jx as h,Kx as g,LA as _,Lx as te,Mx as v,Nx as ne,Ox as y,Px as re,Qb as b,Rx as ie,Sx as x,Tx as S,Ux as C,Vx as w,Wx as T,Xb as E,Yb as D,Zb as O,_x as k,ax as A,bx as j,cx as M,dx as N,ex as P,fx as F,gx as I,hx as L,in as R,ix as z,jx as B,kx as V,lx as H,mx as U,nx as W,on as ae,ox as G,px as K,qb as q,qx as J,rx as oe,sx as se,tx as ce,ux as le,vx as ue,wx as de,xx as fe,yx as pe,zx as me}from"./dist-Cjlv3ZK-.js";import{t as he}from"./button-Bv-PK2-Y.js";import{A as ge,F as _e}from"./index-BWV7nAxJ.js";import{t as Y}from"./DataTableShell-0Ttkz82b.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>h(),incorrect:()=>J(),incoherence:()=>g(),formatting:()=>d(),latency:()=>T(),api_error:()=>C(),other:()=>f()},Q=e=>ve[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:a()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:me()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:w()})}function ye({data:e,closeReason:t}){let n=e.snapshot,a=p(c.feedback.respondToFeedback),[d,f]=(0,X.useState)(e.thread),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1);async function b(){let t=m.trim();if(!(!t||g)){_(!0);try{await a({feedbackId:e._id,text:t}),f(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),h(``)}finally{_(!1)}}}let C=[];try{C=n.contextJson?JSON.parse(n.contextJson):[]}catch{C=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${ie()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:te()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ee()}),d.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:d.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?u():e.authorRole===`agent`?e.authorLabel??ae():re()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:ne()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:m,maxLength:2e3,rows:3,onChange:e=>h(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(he,{size:`sm`,onClick:()=>void b(),disabled:!m.trim()||g,children:g?B():i()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:V()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||y()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:s()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||y()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:l()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,C.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S({count:n.contextCount??C.length,truncated:n.contextTruncated?de():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:C.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fe()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?j({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[pe(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,ue()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=_(c.feedback.listForAdmin,{}),t=p(c.feedback.readSnapshot),n=p(c.feedback.deleteFeedback),r=_e(),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)({});async function l(e){if(i===e._id){a(null);return}if(!o[e._id]){let n=await t({feedbackId:e._id});s(t=>({...t,[e._id]:n}))}a(e._id)}async function u(e){await r({title:D(),description:m(),confirmLabel:q(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[k(),` `,(0,Z.jsx)(`strong`,{children:I()}),` `,L()]}),(0,Z.jsx)(Y,{title:U(),rows:e,emptyHint:K(),isExpanded:e=>i===e._id&&!!o[e._id],renderExpanded:e=>o[e._id]?(0,Z.jsx)(ye,{data:o[e._id],closeReason:e.userCloseReason}):null,columns:[{header:F(),cell:e=>ge(e.at),sort:e=>e.at},{header:N(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:le(),cell:e=>e.messageRole===`user`?H():M(),sort:e=>e.messageRole},{header:se(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${G({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:A(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:z(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:oe(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:W()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ce()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:R()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:P()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:i===e._id?b():O(),onSelect:()=>void l(e)},{label:E(),onSelect:()=>void u(e),variant:`destructive`}]})]})}export{be as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as ee,AA as te,Ak as ne,Bk as r,Dk as i,E as a,Fk as o,Gk as s,Hk as re,IA as ie,Ik as c,Jk as l,Kk as u,LA as d,Lk as f,Mk as p,Nk as ae,OA as oe,Ok as se,Pk as ce,Qk as le,Rk as ue,Uk as de,Vk as fe,Wk as pe,Xk as m,Yk as h,Zk as g,aA as _,cA as me,eA as he,gT as ge,iA as v,jk as _e,kk as ve,ln as ye,nA as be,oA as y,qk as b,rA as x,sA as S,tA as C,un as w,zk as T}from"./dist-Cjlv3ZK-.js";import{t as E}from"./button-Bv-PK2-Y.js";import{$ as D,At as O,B as k,C as A,Ct as j,H as M,J as N,L as xe,P as Se,R as Ce,S as P,U as we,V as Te,W as Ee,X as F,Y as De,b as I,et as L,kt as Oe,p as ke,w as R,x as z,yt as Ae,z as je}from"./index-BWV7nAxJ.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-Dv9jX9eF.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return g();case`audio`:return m();case`video`:return h();case`pdf`:return l();case`document`:return b();case`archive`:return u();default:return s()}}function q(){let[e,t]=(0,U.useState)(G),[n,s]=(0,U.useState)(G),[l,u]=(0,U.useState)(G),[m,h]=(0,U.useState)(G),[g,b]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=ie(a.files.softDelete),Y=Se();function Ie(){t(G),s(G),u(G),h(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(ce())}catch(e){Y.error(ae(),e)}}let X=d(a.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:l===G?void 0:l,category:m===G?void 0:m,includeAutoGenerated:g||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(te(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:oe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||l!==G||m!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(I,{value:e,onValueChange:t,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":S(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:y()}),(0,W.jsx)(P,{value:`inbound`,children:_()}),(0,W.jsx)(P,{value:`outbound`,children:v()})]})]}),(0,W.jsxs)(I,{value:n,onValueChange:s,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":x(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:be()}),Q.chats.map(e=>(0,W.jsx)(P,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(I,{value:l,onValueChange:u,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":C(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:he()}),Q.instances.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(I,{value:m,onValueChange:h,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":ee(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:le()}),Q.categories.map(e=>(0,W.jsx)(P,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(ke,{checked:g,onCheckedChange:e=>b(e===!0),"aria-label":w()}),(0,W.jsx)(`span`,{children:w()})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(j,{size:14,"aria-hidden":!0}),f()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?se():ve()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:pe()}),(0,W.jsx)(B,{children:de()}),(0,W.jsx)(B,{children:re()}),(0,W.jsx)(B,{children:fe()}),(0,W.jsx)(B,{children:r()}),(0,W.jsx)(B,{className:`text-right`,children:T()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(L,{variant:`outline`,style:{marginLeft:6},children:ye()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(L,{variant:`secondary`,children:e.direction===`inbound`?_():v()})}),(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:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(N,{children:[(0,W.jsx)(D,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":c(),children:(0,W.jsx)(Oe,{size:16})})}),(0,W.jsxs)(De,{align:`end`,children:[e.url?(0,W.jsx)(F,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(O,{size:14}),ue()]})}):(0,W.jsxs)(F,{disabled:!0,children:[(0,W.jsx)(O,{size:14}),ne()]}),(0,W.jsxs)(F,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Ae,{size:14}),o()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:i({cap:Be})}):null]}),(0,W.jsx)(xe,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(k,{children:[(0,W.jsxs)(we,{children:[(0,W.jsx)(Ee,{children:p()}),(0,W.jsx)(Te,{children:_e()})]}),(0,W.jsxs)(M,{children:[(0,W.jsx)(je,{children:ge()}),(0,W.jsx)(Ce,{onClick:()=>void Le(),children:o()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$c as r,$s as i,Ac as a,Bc as o,Cc as s,D as c,Dc as l,E as u,Ec as d,Fc as f,Gc as p,Hc as m,IA as h,Ic as g,Jc as _,Kc as v,LA as y,Lc as b,Mc as x,Nc as S,Oc as C,Pc as w,Qc as ee,Qs as T,Rc as te,Sc as E,Tc as D,Uc as O,Vc as ne,Wc as k,Xc as A,Xs as j,Yc as re,Ys as M,Zc as N,Zs as P,_c as ie,ac as F,bc as I,cc as ae,dc as oe,ec as se,el as L,fc as R,gc as z,hc as ce,ic as le,il as ue,jc as de,kc as B,lc as fe,mc as pe,nc as me,nl as he,oc as ge,pc as _e,qc as ve,rc as ye,rl as be,sc as xe,tc as Se,tl as Ce,uc as we,vc as Te,wc as Ee,xc as De,yc as Oe,zc as ke}from"./dist-Cjlv3ZK-.js";import{t as Ae}from"./x-3dY-o4JV.js";import{i as V,n as H,r as je,t as Me}from"./tabs-BSiIDxTa.js";import{t as U}from"./button-Bv-PK2-Y.js";import{C as Ne,F as Pe,P as W,Pt as Fe,S as Ie,b as Le,bt as G,et as K,it as Re,nt as ze,ot as Be,p as q,rt as Ve,st as He,tt as J,u as Ue,ut as We,w as Ge,x as Ke,xt as Y}from"./index-BWV7nAxJ.js";import{t as qe}from"./FilterBar-CkxsjoMo.js";import{t as Je}from"./DataTableShell-0Ttkz82b.js";import{t as X}from"./DetailChips-DCOUgVDY.js";var Ye=c(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xe=c(`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`}]]),Z=c(`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`}]]),Ze=c(`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);function Qe(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 $e(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 et(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 tt(e){switch(e){case`admin`:return D();case`user`:return Ee();case`pending`:return s();default:return e}}function nt(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 rt(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}}var $=n(),it={name:``,description:``};function at(){let e=y(u.groups.listGroups,{}),t=y(u.me.getMe,{host:We})?.role===`admin`,n=h(u.groups.createGroup),i=h(u.groups.updateGroup),a=h(u.groups.deleteGroup),s=Pe(),c=W(),[l,d]=(0,Q.useState)(!1),[f,g]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(it),[C,w]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(``),j=(0,Q.useMemo)(()=>{if(!e)return e;let t=E.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,E]);function M(){g(null),S(it),d(!0)}function ie(e){g(e),S({name:e.name,description:e.description??``}),d(!0)}async function F(){try{f?await i({groupId:f._id,name:x.name,description:x.description}):await n({name:x.name,description:x.description||void 0}),S(it),g(null),d(!1)}catch(e){c.error(T(),e)}}async function I(e){if(await s({title:ke({name:e.name}),description:te(),confirmWord:e.name,confirmLabel:b(),cancelLabel:p(),destructive:!0}))try{await a({groupId:e._id})}catch(e){c.error(P(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:be()}),(0,$.jsx)(qe,{q:E,onQChange:D,onReset:()=>D(``),canReset:E!==``,searchPlaceholder:A()}),(0,$.jsx)(Je,{title:ue(),rows:j,addLabel:he(),onAdd:t?M:void 0,emptyHint:Ce(),columns:[{header:L(),cell:e=>e.name,sort:e=>e.name},{header:r(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Z,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:ee(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Y,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:N(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Xe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(G,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:re(),onSelect:()=>w({groupId:e._id,name:e.name})},...t?[{label:_(),onSelect:()=>ie(e)},{label:ve(),variant:`destructive`,onSelect:()=>void I(e)}]:[]]}),(0,$.jsx)(Ue,{open:l,onOpenChange:d,title:f?O():k(),description:m(),canSubmit:!!x.name.trim(),onSubmit:F,submitLabel:v(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:ne()}),(0,$.jsx)(J,{value:x.name,onChange:e=>S({...x,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:o()}),(0,$.jsx)(J,{value:x.description,onChange:e=>S({...x,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:C?.groupId??null,groupName:C?.name??``,open:C!==null,onOpenChange:e=>{e||w(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Ye,{size:14,"aria-hidden":!0}),C()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":d({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[l(),(0,$.jsx)(Fe,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=y(u.groups.getGroup,n&&e?{groupId:e}:`skip`),o=y(u.groups.listAssignableInstances,n?{}:`skip`),s=y(u.groups.listAssignableUsers,n?{}:`skip`),c=h(u.groups.addMember),l=h(u.groups.removeMember),d=h(u.groups.bulkSetMembers),p=h(u.groups.setGroupManager),m=W(),[_,v]=(0,Q.useState)(``),[b,C]=(0,Q.useState)(``),[ee,T]=(0,Q.useState)(`members`),[te,D]=(0,Q.useState)(1),[O,ne]=(0,Q.useState)(new Set),k=(0,Q.useRef)(null),A=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),re=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),M=i?.viewerIsAdmin===!0,N=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{v(``),C(``),T(`members`),D(1),k.current=null},[n,e]),(0,Q.useEffect)(()=>{D(1)},[_]),(0,Q.useEffect)(()=>{n&&i&&e&&k.current!==e&&(k.current=e,ne(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let P=(0,Q.useMemo)(()=>s?Qe(s,_,O):[],[s,_,O]);async function F(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){m.error(j(),e)}}async function ae(t,n){if(e)try{await p({groupId:e,userId:t,manager:!n})}catch(e){m.error(se(),e)}}let L=nt(P,e=>A.has(e.userId)),R=P.filter(e=>A.has(e.userId)).length,z=rt(P,te,ot);async function ce(){if(!e||P.length===0)return;let t=P.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:L!==`all`})}catch(e){m.error(j(),e)}}return(0,$.jsx)(ze,{open:n,onOpenChange:r,children:(0,$.jsxs)(Ve,{className:`oc-access`,children:[(0,$.jsxs)(Be,{children:[(0,$.jsx)(He,{children:g({name:t})}),(0,$.jsx)(Re,{children:f()})]}),(0,$.jsxs)(Me,{value:ee,onValueChange:T,className:`oc-access__tabs`,children:[(0,$.jsxs)(je,{className:`w-full`,children:[(0,$.jsxs)(V,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),w(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:A.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Y,{size:13,"aria-hidden":!0}),x(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:N.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),oe(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:s===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()}):s.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Te()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{value:_,onChange:e=>v(e.target.value),placeholder:S(),className:`oc-access__search`}),P.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:a()}):(0,$.jsxs)($.Fragment,{children:[P.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:L===`all`?!0:L===`some`?`indeterminate`:!1,onCheckedChange:()=>void ce(),"aria-label":B()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:B()}),(0,$.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[R,` / `,P.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:z.pageItems.map(e=>{let t=A.has(e.userId),n=et(e),r=re.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:t,onCheckedChange:()=>void F(e.userId,t),"aria-label":E({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,$.jsx)(K,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&M?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?Se():me(),title:r?Se():me(),onClick:()=>void ae(e.userId,r),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":ye(),title:ye(),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:z.page,pageCount:z.pageCount,onPage:D})]})]})}),(0,$.jsx)(H,{value:`agents`,children:o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ie()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{value:b,onChange:e=>C(e.target.value),placeholder:de(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:o.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:N,query:b},`${e}-${t._id}`))})]})}),(0,$.jsx)(H,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=y(u.groups.listAssignableAgents,{instanceName:t}),o=h(u.groups.assignAgentToGroup),s=h(u.groups.removeAgentFromGroup),c=h(u.groups.bulkSetGroupAgents),l=W(),[d,f]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{f(1)},[i]),!e)return null;let p=$e(a?.agents??[],i),m=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&p.length===0)return null;let g=p.filter(e=>e.presentInLastOk!==!1),_=nt(g,e=>r.has(`${t}/${e.agentId}`)),v=rt(p,d,ot);async function b(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(M(),e)}}async function x(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:_!==`all`})}catch(e){l.error(M(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(Y,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),m?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:pe()}):null]}),a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Oe()}):p.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:m?ce():z()}):(0,$.jsxs)($.Fragment,{children:[g.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:_===`all`?!0:_===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":B()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:B()})]}):null,v.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:i,disabled:a&&!i,onCheckedChange:()=>void b(e.agentId,i),"aria-label":De({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":R(),title:R(),children:(0,$.jsx)(G,{size:14,fill:`currentColor`})}):null,a?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:_e()}):null]},e.agentId)}),(0,$.jsx)(st,{page:v.page,pageCount:v.pageCount,onPage:f})]})]})}function ut({groupId:e}){let t=y(u.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=h(u.charts.assignChartToGroup),r=h(u.charts.removeChartFromGroup),a=h(u.charts.setGroupDefaultChart),o=h(u.charts.addChartToGroupPool),s=h(u.charts.removeChartFromGroupPool),c=W();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()});let{pool:l,addable:d,canManagePool:f}=t;if(l.length===0&&!f)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:we()});async function p(t,a){try{a?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function m(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function g(t){try{await o({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function _(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:l.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:e.selected,onCheckedChange:()=>void p(e.chartKey,e.selected),"aria-label":ge({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":F(),title:F(),children:(0,$.jsx)(G,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void m(e.chartKey),children:le()}):null,f?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":xe({name:e.name}),title:xe({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,$.jsxs)(Le,{value:``,onValueChange:e=>void g(e),children:[(0,$.jsx)(Ne,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Ge,{placeholder:ae()})}),(0,$.jsx)(Ke,{children:d.map(e=>(0,$.jsx)(Ie,{value:e.chartKey,children:e.name},e.chartKey))})]}):l.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):null:null]})}export{at as GroupsTab};
@@ -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 a,Bv as o,By as s,Cy as c,Dy as l,E as u,Ey as d,Fv as f,Fy as p,Gv as m,Gy as h,Hv as g,Hy as _,IA as v,Iv as y,Iy as b,Jv as x,Jy as S,Kv as C,Ky as w,LA as T,Lv as E,Ly as ee,My as te,Nv as D,Ny as ne,Om as O,Oy as re,PA as k,Pv as A,Py as ie,Qv as ae,Qy as oe,Rv as se,Ry as ce,Sy as le,Ty as ue,Uv as de,Uy as fe,Vv as pe,Vy as me,Wv as he,Wy as ge,Xv as _e,Xy as ve,Yv as ye,Yy as be,Zv as xe,Zy as Se,_b as Ce,_y as we,ab as Te,ay as Ee,by as De,cE as j,cb as Oe,cr as ke,cy as Ae,db as je,dy as Me,eb as Ne,ey as M,fb as Pe,fy as Fe,gb as Ie,gy as Le,hb as Re,hy as ze,ib as Be,iy as Ve,jy as He,km as Ue,ky as N,lE as P,lb as We,lr as Ge,ly as Ke,mb as qe,my as Je,nb as Ye,ny as Xe,ob as Ze,or as Qe,oy as $e,pb as et,py as tt,qv as nt,qy as rt,rb as it,ry as F,sb as at,sr as ot,sy as st,tb as ct,ty as lt,ub as ut,uy as dt,vb as ft,vy as pt,wy as mt,xy as ht,yb as gt,yy as _t,zv as vt,zy as yt}from"./dist-Cjlv3ZK-.js";import{a as bt,c as xt}from"./FieldLabel-BY0GU-yp.js";import{t as I}from"./button-Bv-PK2-Y.js";import{C as L,F as St,G as Ct,K as wt,P as R,S as z,b as B,et as V,it as H,nt as U,ot as W,p as G,q as Tt,rt as K,st as q,tt as J,u as Et,w as Dt,x as Ot}from"./index-BWV7nAxJ.js";import{t as kt}from"./DataTableShell-0Ttkz82b.js";import{InstanceConfigDialog as At}from"./BridgeTab-RozR95O-.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],jt=new Set(X),Mt=`conversational`;function Nt(e){let t=new Set((e??[]).filter(e=>jt.has(e)));return t.size===0?[Mt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:bt},Pt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Ft(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function It(){let e=T(u.admin.listInstances,{}),t=T(u.agents.listAllInstanceAgents,{}),n=v(u.admin.upsertInstance),r=v(u.admin.deleteInstance),a=R(),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(Q),[d,f]=(0,Y.useState)(null),[p,m]=(0,Y.useState)(null),[g,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(null);async function C(){try{await n({instanceId:b??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),l(Q),x(null),s(!1)}catch(e){a.error(Ce(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ie(),(0,Z.jsx)(`strong`,{children:Re()}),qe()]}),(0,Z.jsx)(kt,{title:et(),rows:e,addLabel:Pe(),onAdd:()=>{x(null),l(Q),s(!0)},emptyHint:je(),columns:[{header:ut(),cell:e=>e.name,sort:e=>e.name},{header:We(),cell:e=>(0,Z.jsx)(V,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:Oe(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:at(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:gt(),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)(V,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?A():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:it(),onSelect:()=>{x(e._id),l(Ft(e)),s(!0)}},{label:ft(),onSelect:()=>f(e.name)},{label:_(),onSelect:()=>y(e)},{label:Ze(),onSelect:()=>m(e)},{label:Te(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:Te(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(Et,{open:o,onOpenChange:s,title:b?Ye():Be(),description:Ne(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:C,submitLabel:i(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:oe(),children:[(0,Z.jsx)(J,{value:c.name,disabled:b!==null,onChange:e=>l({...c,name:e.target.value})}),b?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ct()}):null]}),(0,Z.jsx)($,{label:Se(),children:(0,Z.jsxs)(B,{value:c.kind,onValueChange:e=>l({...c,kind:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(Dt,{})}),(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(z,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(z,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:ve(),children:(0,Z.jsx)(J,{value:c.gatewayUrl,onChange:e=>l({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:be(),children:(0,Z.jsx)(J,{value:c.bridgeUrl,placeholder:S(),onChange:e=>l({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:rt(),children:(0,Z.jsx)(J,{value:c.displayName,onChange:e=>l({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:Ue(),children:[(0,Z.jsxs)(B,{value:c.streamTransport,onValueChange:e=>l({...c,streamTransport:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(Dt,{})}),(0,Z.jsx)(Ot,{children:xt.map(e=>(0,Z.jsx)(z,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:O()})]}),(0,Z.jsx)($,{label:w(),children:(0,Z.jsx)(J,{value:c.gatewayVersion,placeholder:h(),onChange:e=>l({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:ge(),children:(0,Z.jsx)(J,{value:c.gatewayHttpUrl,placeholder:fe(),onChange:e=>l({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Kt,{instanceName:d,open:d!==null,onOpenChange:e=>{e||f(null)}}),p?(0,Z.jsx)(At,{instance:p,onClose:()=>m(null)},p._id):null,g?(0,Z.jsx)(Lt,{instance:g,onClose:()=>y(null)},g._id):null]})}function Lt({instance:e,onClose:t}){let n=T(u.instanceSecrets.listInstanceSecretStatus,{}),r=Pt[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)(U,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(K,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(W,{children:[(0,Z.jsx)(q,{children:me({instance:e.displayName??e.name})}),(0,Z.jsx)(H,{children:s()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Bt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(zt,{instance:e})}),(0,Z.jsx)(Rt,{instance:e})]})})}function Rt({instance:e}){let t=k(u.instanceSync.forceInstanceSync),n=R(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(De());break;case`no_agents`:n.success(pt());break;case`no_bridge_url`:n.error(we());break;case`deploy_misconfigured`:n.error(Le());break;case`unauthorized`:n.error(Je());break;case`not_served`:n.error(tt());break;default:n.error(ze());break}}catch(e){n.error(_t(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?ht():le()})})]})}function zt({instance:e}){let t=T(u.bridgeAuth.listBridgeAuthStatus,{}),n=k(u.bridgeAuth.mintBridgeSecret),r=v(u.bridgeAuth.revokeBridgeSecret),i=R(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),m=f!==void 0;async function h(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(Ee(),e)}finally{o(!1)}}}async function g(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success($e())}catch(e){i.error(Ee(),e)}finally{o(!1)}}}async function _(){if(s)try{await navigator.clipboard.writeText(s),d(!0)}catch{}}return(0,Z.jsxs)($,{label:Me(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:dt()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:m?`outline`:`secondary`,children:m?`${b()} · ${f.prefix}…${f.lastFour}`:p()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void h(),disabled:a,children:m?Ae():Ke()}),m?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void g(),disabled:a,children:st()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:Ve()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void _(),children:l?P():j()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),d(!1)},children:F()})]}):null]})}function Bt({instanceId:e,field:t,updatedAt:n}){let r=k(u.instanceSecrets.setInstanceSecret),i=v(u.instanceSecrets.clearInstanceSecret),o=k(u.deviceIdentity.generateDeviceIdentity),s=R(),[f,m]=(0,Y.useState)(``),[h,g]=(0,Y.useState)(!1),[_,y]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(!1),C=n!==null,w=t===`deviceIdentity`,T=t===`token`?yt():t===`deviceIdentity`?ce():ee();async function E(){if(!(!f.trim()||h)){g(!0);try{await r({instanceId:e,field:t,plaintext:f}),m(``),y(null),S(!1),s.success(a())}catch(e){s.error(N(),e)}finally{g(!1)}}}async function D(){if(!h){g(!0);try{await i({instanceId:e,field:t}),y(null),S(!1),s.success(re())}catch(e){s.error(N(),e)}finally{g(!1)}}}async function O(){if(!h){g(!0);try{y(await o({instanceId:e})),S(!1),s.success(ue())}catch(e){s.error(c(),e)}finally{g(!1)}}}let A=_?`openclaw devices approve ${_.id}`:``;async function ae(){if(A)try{await navigator.clipboard.writeText(A),S(!0)}catch{}}return(0,Z.jsxs)($,{label:T,children:[w?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:C?`outline`:`secondary`,children:C?b():p()}),(0,Z.jsx)(J,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:f,placeholder:C?ne():ie(),onChange:e=>m(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void E(),disabled:h||f.trim().length===0,children:te()}),w?(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void O(),disabled:h,children:l()}):null,C?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void D(),disabled:h,children:He()}):null]})]}),_?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:ue()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:mt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:A}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void ae(),children:x?P():j()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{y(null),S(!1)},children:F()})]}):null]})}var Vt={conversational:ye,documentary:nt,summarizer:Ge,curator:ot},Ht={conversational:x,documentary:C,summarizer:ke,curator:Qe},Ut=e=>(Vt[e]??(()=>e))(),Wt=e=>(Ht[e]??(()=>``))();function Gt({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:r()}),t.map(e=>(0,Z.jsx)(V,{variant:`secondary`,className:`oc-agenttype__chip`,title:Wt(e),children:Ut(e)},e)),(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(Tt,{asChild:!0,children:(0,Z.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ae()})}),(0,Z.jsxs)(wt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:xe()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:_e()}),(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)(G,{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:Ut(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Wt(r)})]})]},r)})})]})]})]})}function Kt({instanceName:e,open:t,onOpenChange:n}){let r=T(u.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=v(u.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(u.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(u.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=v(u.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(u.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(u.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=v(u.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(u.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Nt(r);e.setQuery(u.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=v(u.agents.removeInstanceAgent),l=St(),d=R();async function p(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){d.error(M(),e)}}async function h(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){d.error(M(),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){d.error(M(),e)}}async function b(t,n){if(e&&await l({title:de({name:n}),description:g(),confirmLabel:pe(),destructive:!0}))try{await c({instanceName:e,agentId:t}),d.success(o())}catch(e){d.error(M(),e)}}return(0,Z.jsx)(U,{open:t,onOpenChange:n,children:(0,Z.jsxs)(K,{className:`oc-access`,children:[(0,Z.jsxs)(W,{children:[(0,Z.jsx)(q,{children:Xe({name:e??``})}),(0,Z.jsx)(H,{children:lt()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:vt()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?se():r.discovery.lastPollOk?E():y({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:f()}):(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,a=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)(G,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void p(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)(V,{variant:`outline`,className:`oc-access__gone`,children:D()}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void b(e.agentId,i),children:he()})]}):n?(0,Z.jsx)(V,{variant:`default`,children:A()}):(0,Z.jsx)(I,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void h(e.agentId),children:m()})]}),e.enabled?(0,Z.jsx)(Gt,{agentId:e.agentId,types:a,onToggle:t=>void _(e.agentId,t,a)}):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{It as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ai as a,BS as o,CS as s,Ci as c,DS as l,Di as u,E as d,ES as f,Ei as p,FS as m,IA as h,IS as g,LA as ee,LS as _,MS as te,NS as v,OS as ne,Oi as y,PA as b,PS as x,Qx as re,RS as ie,SS as ae,Si as oe,TS as se,Ti as ce,VS as le,Xx as S,Yx as C,Zx as w,_S as T,aS as E,bS as D,cS as O,dS as k,eS as A,fS as j,gS as M,hS as N,iS as P,jS as F,kS as I,ki as L,lS as R,mS as z,nS as B,oS as V,pS as H,rS as U,sS as W,tS as ue,uS as de,vS as fe,wS as pe,wi as me,xS as he,yS as ge,zS as _e}from"./dist-Cjlv3ZK-.js";import{t as G}from"./button-Bv-PK2-Y.js";import{A as ve,C as ye,S as be,b as xe,et as K,p as Se,tt as q,w as Ce,x as we}from"./index-BWV7nAxJ.js";import{t as Te}from"./DataTableShell-0Ttkz82b.js";var J=t(e(),1),Y=n();function Ee(){let e=ee(d.integrations.status.status,{}),t=h(d.admin.setIntegrationConfig),[n,c]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&c(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:le()});let u=n,p=(e,t,n)=>c({...u,[e]:{...u[e],[t]:n}}),b=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[o(),` `,(0,Y.jsx)(`strong`,{children:_e()}),` `,ie()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:_()}):(0,Y.jsx)(K,{variant:`outline`,children:g()}):(0,Y.jsx)(K,{variant:`outline`,children:m()}),note:v(),children:[(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(q,{value:u.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>p(`langfuse`,`host`,e.target.value),onBlur:()=>b(`langfuse`,{host:u.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:l(),checked:u.langfuse.enabled??!0,onChange:e=>{p(`langfuse`,`enabled`,e),b(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:_()}):(0,Y.jsx)(K,{variant:`outline`,children:g()}):(0,Y.jsx)(K,{variant:`outline`,children:m()}),note:te(),children:[(0,Y.jsx)(Z,{label:i(),children:(0,Y.jsx)(q,{value:u.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>p(`opik`,`baseUrl`,e.target.value),onBlur:()=>b(`opik`,{baseUrl:u.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:I(),children:(0,Y.jsx)(q,{value:u.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||ne(),onChange:e=>p(`opik`,`workspace`,e.target.value),onBlur:()=>b(`opik`,{workspace:u.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:l(),checked:u.opik.enabled??!0,onChange:e=>{p(`opik`,`enabled`,e),b(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:_()}):(0,Y.jsx)(K,{variant:`outline`,children:g()}):(0,Y.jsx)(K,{variant:`outline`,children:a()}),note:L(),children:[(0,Y.jsx)(Z,{label:y(),children:(0,Y.jsx)(q,{value:u.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>p(`otlp`,`endpoint`,e.target.value),onBlur:()=>b(`otlp`,{endpoint:u.otlp.endpoint??``})})}),(0,Y.jsx)(De,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:l(),checked:u.otlp.enabled??!0,onChange:e=>{p(`otlp`,`enabled`,e),b(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:f(),status:(0,Y.jsx)(K,{variant:`outline`,children:x()}),note:se(),children:[(0,Y.jsx)(Z,{label:pe(),children:(0,Y.jsx)($,{value:u.tts.auto??`off`,options:[[`off`,s()],[`always`,ae()],[`inbound`,he()],[`tagged`,D()]],onChange:e=>{p(`tts`,`auto`,e),b(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:ge(),children:(0,Y.jsx)($,{value:u.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,fe()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{p(`tts`,`provider`,e),b(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:T(),children:(0,Y.jsx)(q,{value:u.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>p(`tts`,`model`,e.target.value),onBlur:()=>b(`tts`,{model:u.tts.model??``})})}),(0,Y.jsx)(Z,{label:M(),children:(0,Y.jsx)(q,{value:u.tts.voice??``,placeholder:N(),onChange:e=>p(`tts`,`voice`,e.target.value),onBlur:()=>b(`tts`,{voice:u.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:z(),status:(0,Y.jsx)(K,{variant:`outline`,children:x()}),note:e.secrets.openai?H():j(),children:[(0,Y.jsx)(Q,{label:k(),checked:u.talk.enabled??!1,onChange:e=>{p(`talk`,`enabled`,e),b(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:de(),children:(0,Y.jsx)($,{value:u.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{p(`talk`,`realtimeProvider`,e),b(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:R(),children:(0,Y.jsx)(q,{value:u.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>p(`talk`,`realtimeModel`,e.target.value),onBlur:()=>b(`talk`,{realtimeModel:u.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:M(),children:(0,Y.jsx)(q,{value:u.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>p(`talk`,`voice`,e.target.value),onBlur:()=>b(`talk`,{voice:u.talk.voice??``})})}),(0,Y.jsx)(Z,{label:O(),children:(0,Y.jsx)($,{value:u.talk.transport??`webrtc`,options:[[`webrtc`,W()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{p(`talk`,`transport`,e),b(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:V(),children:(0,Y.jsx)(q,{value:u.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>p(`talk`,`speechLocale`,e.target.value),onBlur:()=>b(`talk`,{speechLocale:u.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:E(),checked:u.talk.interruptOnSpeech??!0,onChange:e=>{p(`talk`,`interruptOnSpeech`,e),b(`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:P()}),(0,Y.jsx)(K,{variant:`outline`,children:U()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[B(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(Te,{title:ue(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:A(),columns:[{header:r(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:re(),cell:e=>e.lastAt>0?ve(e.lastAt):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:w(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:S(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:C(),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)(Se,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(xe,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(Ce,{})}),(0,Y.jsx)(we,{children:t.map(([e,t])=>(0,Y.jsx)(be,{value:e,children:t},e))})]})}function De({headersSet:e}){let t=b(d.integrations.otlpSecret.setOtlpHeaders),n=h(d.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,l]=(0,J.useState)(!1),f=async()=>{l(!0),o(null);try{await t({headersJson:r}),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,Y.jsxs)(Z,{label:u(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?p():ce(),onChange:e=>i(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:s||r.trim().length===0,onClick:()=>void f(),children:me()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:s,onClick:()=>void n({}),children:c()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:oe()})]})}export{Ee as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Bf as r,CC as i,E as a,EC as o,Gf as s,Hf as c,If as l,Jf as u,Kf as d,LA as f,Lf as p,Rf as m,TC as h,Uf as g,Vf as _,Wf as v,Yf as y,ZC as b,gC as x,hC as S,qf as C,wC as w,zf as T}from"./dist-Cjlv3ZK-.js";import{Ft as E,It as D,a as ee,n as te,r as ne,ut as re}from"./index-BWV7nAxJ.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-B1IlPRv3.js";import{n as N,t as P}from"./TimeRangePicker-Dtnfk3jk.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=f(a.me.getMe,{host:re})?.permissions?.includes(`traces.read`)??!1,t=f(a.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:b()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:o()}),(0,I.jsx)(j,{children:w()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),r=Math.max(1,...t,...n),i=t=>6+t*468/(e.length-1),a=e=>74-e*68/r,s=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${a(e).toFixed(1)}`).join(` `),c=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[S(),` p50 `,R(c.cP50),` `,h()]}),(0,I.jsxs)(`span`,{children:[x(),` p50 `,R(c.aP50),` `,h()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":o(),children:[(0,I.jsx)(`path`,{d:s(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:s(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:y(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:u(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:C(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:d(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:s(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:v(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=D({from:`/settings/kpi`}),t=E({from:`/settings/kpi`}),n=ne(e.from,e.to,te,`now`),i=e=>void t({search:t=>({...t,...ee(e)})}),{from:o,to:s}=N(n),{rowLimit:l,buckets:u}=K(o,s),d=f(a.kpi.listKpis,{limit:l,filter:{from:o,to:s}}),p=(0,F.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>u&&e.set(t,n.slice(n.length-u));return e},[d,u]),m=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:c()})]}),(0,I.jsx)(J,{value:n,onChange:i})]});return d===void 0?(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:_()})]}):d.length===0?(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:r()})]}):(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(p.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:p.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:T({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:m()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:p({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":l({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{q as KpiTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$y as i,AD as a,BD as o,CA as s,CD as c,DD as l,E as u,ED as d,FD as f,GD as p,HD as ee,IA as m,ID as te,JD as ne,KD as re,LA as h,LD as ie,MD as ae,ND as oe,OA as se,OD as g,PD as ce,QD as le,RD as ue,SD as de,TD as fe,UD as _,VD as v,WD as y,XD as b,YD as x,ZD as S,_A as C,bA as w,dA as T,eO as E,fA as D,gA as O,hA as k,jD as A,kD as j,mA as M,nO as N,pA as P,qD as F,tO as I,uA as L,vA as R,wD as z,xD as B,yA as V,zD as pe}from"./dist-Cjlv3ZK-.js";import{t as H}from"./button-Bv-PK2-Y.js";import{C as me,M as he,P as ge,S as U,b as _e,p as W,tt as G,ut as K,w as ve,x as ye}from"./index-BWV7nAxJ.js";import{t as be}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=[{id:`messages`,label:()=>N()},{id:`composer`,label:()=>I()},{id:`sidebar`,label:()=>E()},{id:`other`,label:()=>r()}],Y={showSource:{category:`messages`,label:()=>le(),help:()=>S()},showReport:{category:`messages`,label:()=>b(),help:()=>x()},copyAssistant:{category:`messages`,label:()=>ne()},copyUser:{category:`messages`,label:()=>F()},showDelete:{category:`messages`,label:()=>re()},showTools:{category:`messages`,label:()=>p(),help:()=>y()},voiceInput:{category:`composer`,label:()=>_(),help:()=>ee()},showUsage:{category:`composer`,label:()=>v(),help:()=>o()},showChatAge:{category:`sidebar`,label:()=>pe(),help:()=>ue()},showChatProvider:{category:`sidebar`,label:()=>ie(),help:()=>te()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function xe(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 Se=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`,`showUsage`],Ce={voiceInput:`voiceInput`};function we(e){return Se.includes(e)}function Z(e){return e===`admin`}function Q(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Te(e){return e===`on`?!0:e===`off`?!1:null}function Ee(e){return we(e)?Ce[e]:void 0}var $=n(),De={voiceInput:()=>fe()};function Oe({prefKey:e,ui:t}){let n=m(u.admin.setUiPrefDefault),r=m(u.admin.setFeatureEnabled),i=Ee(e),a=i?De[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:j()}),(0,$.jsxs)(_e,{value:Q(t.defaults[e]),onValueChange:t=>void n({key:e,value:Te(t)}),children:[(0,$.jsx)(me,{size:`sm`,className:`w-36`,children:(0,$.jsx)(ve,{})}),(0,$.jsxs)(ye,{children:[(0,$.jsx)(U,{value:`on`,children:c()}),(0,$.jsx)(U,{value:`off`,children:de()}),(0,$.jsx)(U,{value:`inherit`,children:B()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":g()}),g()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function ke(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=h(u.me.getMe,{host:K}),o=i?.ui,s=Z(i?.role)&&n,c=m(u.me.setUiPref).withOptimisticUpdate(he),p=(0,q.useMemo)(()=>o?xe(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":a()}),a()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:l()}),(0,$.jsx)(`p`,{children:d()}),(0,$.jsx)(`p`,{children:z()})]}):null,(0,$.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:f(),"aria-label":f(),className:`mb-2`}),p.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:ce()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:p.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=o.locked[e],a=o.effective[e],l=o.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:oe()}):l?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:ae()})]}),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 c({key:e,value:null}),children:A()}):null,(0,$.jsx)(W,{checked:a,disabled:i,onCheckedChange:t=>void c({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(Oe,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:se()})}function Ae(){let e=h(u.me.getMe,{host:K}),t=m(u.me.setLocale),n=m(u.me.setMyName),r=ge(),a=e?.locale??`default`,o=e?.name??``,[c,l]=(0,q.useState)(null),d=c??o,f=d.trim()!==o.trim();async function p(){try{await n({name:d}),l(null),r.success(O())}catch(e){r.error(k(),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:w()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:V()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(G,{className:`max-w-xs`,value:d,maxLength:120,placeholder:R(),onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),p())}}),(0,$.jsx)(H,{size:`sm`,disabled:!f,onClick:()=>void p(),children:i()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:C()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:M()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[be().map(e=>(0,$.jsx)(H,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,$.jsx)(H,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:s()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:D()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:T()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:L()})]}),(0,$.jsx)(ke,{})]})]})}export{Ae as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{A as r,At as i,Cm as a,E as o,IA as s,LA as c,Mm as l,Mt as u,Nm as d,Nt as f,O as p,Ot as m,Sm as h,Tm as g,_m as _,bm as v,cm as y,dm as b,dr as x,fm as S,fr as C,gm as w,hm as T,jt as E,k as D,kt as O,lm as k,mm as ee,mr as te,om as ne,pm as re,pr as ie,sm as ae,um as A,ur as j,vm as M,wm as N,xm as P,ym as F}from"./dist-Cjlv3ZK-.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as U}from"./FieldLabel-BY0GU-yp.js";import{t as W}from"./button-Bv-PK2-Y.js";import{C as G,P as oe,S as K,b as q,p as se,ut as ce,w as J,x as Y}from"./index-BWV7nAxJ.js";import{r as X,t as Z}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:v,help:F},documentary_fetch:{label:M,help:_},inbound_files:{label:w,help:T},history_summary:{label:te,help:ie},file_curation:{label:f,help:u}},de={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
3
- Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
4
- - [Fait 1](fait-1.md) - note du projet`},fe={outboundDir:y,references:ae,files:ne,previous_summary:C,new_messages:x,max_chars:j,file_name:E,budget_chars:i,feedback:O,content:m};function pe(){let e=c(o.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:re()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(B,{label:g(),help:N()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:ee()}),(0,$.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(J,{})}),(0,$.jsx)(Y,{children:e.map(e=>(0,$.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=s(o.admin.upsertInstanceConfig),n=oe(),i=c(o.me.getMe,{host:ce}),a=e.config??{},u=X(e.config?.contentLocale,i?.defaultLocale??void 0),[f,m]=(0,Q.useState)(()=>R(a,u));(0,Q.useEffect)(()=>{m(R(a,u))},[u,e._id]);let[h,g]=(0,Q.useState)(!1),_=f.promptInjections,v=(e,t)=>m({...f,promptInjections:{..._,[e]:{..._[e],...t}}});async function y(){g(!0);try{await t({instanceId:e._id,config:V(f,a,u)})}catch(e){n.error(l(),e)}finally{g(!1)}}async function b(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(l(),e)}}let x=e.config?.contentLocale??`default`,S=Z[X(void 0,i?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:r()}),(0,$.jsxs)(q,{value:x,onValueChange:e=>void b(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(J,{})}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(K,{value:`default`,children:p({locale:S})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:D()})]}),U.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:_[e]??{enabled:!0,template:z[e].defaultTemplate[u]},contentLocale:u,onChange:t=>v(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(W,{size:`sm`,onClick:()=>void y(),disabled:h,children:d()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:o}){let[s,c]=(0,Q.useState)(!1),l=r.template.trim()!==t.defaultTemplate[i],u=t.togglable&&!r.enabled,d=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),f=I(e,r,i),p=f?L(f,d):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(se,{checked:r.enabled,onCheckedChange:e=>o({enabled:e===!0})}),(0,$.jsx)(B,{label:n.label(),help:n.help()})]}):(0,$.jsx)(B,{label:n.label(),help:n.help()}),l&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:h()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:u,rows:8,spellCheck:!1,onChange:e=>o({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:P()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(H,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:s?b():S()}),l&&(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate[i]}),children:a()})]})]}),s&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:p}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:A()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:k()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,A_ as ee,E as i,F_ as te,G_ as ne,H_ as re,IA as a,I_ as o,J_ as s,K_ as c,LA as l,M_ as u,N_ as d,O_ as f,P_ as p,Q_ as m,U_ as ie,W_ as h,X_ as g,Y_ as _,Z_ as v,_v as y,av as b,cv as x,dv as S,ev as ae,fv as C,gv as w,hv as T,iv as E,j_ as D,k_ as O,lv as k,mv as A,nv as j,ov as M,pv as N,q_ as P,rn as F,rv as I,sv as L,tv as R,uv as z}from"./dist-Cjlv3ZK-.js";import{t as B}from"./button-Bv-PK2-Y.js";import{F as V,P as H,Tt as U,et as W,p as G,tt as K,u as q}from"./index-BWV7nAxJ.js";import{t as J}from"./roleDescriptions-Br5xnRg9.js";var Y=t(e(),1),X=n(),Z=[{group:()=>y(),keys:[{key:`traces.read`,label:()=>C()},{key:`traces.read.content`,label:()=>S(),phi:!0},{key:`traces.write`,label:()=>z()}]},{group:()=>w(),keys:[{key:`kpi.read`,label:()=>C()},{key:`kpi.write`,label:()=>z()}]},{group:()=>T(),keys:[{key:`openclaw.query`,label:()=>k()},{key:`anomalies.read`,label:()=>x()},{key:`anomalies.report`,label:()=>L()}]},{group:()=>A(),keys:[{key:`chats.read`,label:()=>C()},{key:`selfheal`,label:()=>b()},{key:`feedback.respond`,label:()=>F()}]},{group:()=>N(),keys:[{key:`admin.manage`,label:()=>M()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=l(i.apiKeys.listRoles,{}),t=a(i.apiKeys.createRole),n=a(i.apiKeys.ensureRolesSeeded),y=a(i.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(i.apiKeys.listRoles,{});r&&e.setQuery(i.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),b=V(),x=H(),[S,C]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)($),[k,A]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{x.error(I(),e)})},[n,x]);let M=e??[];async function N(e,t){if(Q(e.permissions)||k.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await b({title:j({name:e.name}),description:R(),confirmLabel:ae()}))){A(t=>new Set(t).add(e._id));try{await y({roleId:e._id,permissions:n})}catch(e){x.error(r(),e)}finally{A(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function F(){try{await t({key:w.key,name:w.name,description:w.description||void 0,permissions:[]}),T($),C(!1)}catch(e){x.error(m(),e)}}let L=e===void 0,z=!L&&M.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[v(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,g(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,_()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:s()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{T($),C(!0)},children:P()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ne()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:h()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?E({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:M.map(e=>{let t=Q(e.permissions),n=k.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(W,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(U,{}),` `,ie()]}):(0,X.jsx)(W,{variant:`secondary`,children:re()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),oe.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(G,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?o():n?te():r,onCheckedChange:()=>void N(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:S,onOpenChange:C,title:p(),description:d(),canSubmit:!!(w.key&&w.name),onSubmit:F,submitLabel:u(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:D()}),(0,X.jsx)(K,{value:w.key,placeholder:ee(),onChange:e=>T({...w,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:O()}),(0,X.jsx)(K,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:f()}),(0,X.jsx)(K,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})})]})}export{se as RolesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,AE as i,BE as ee,CE as a,DE as te,E as o,EE as ne,FE as re,GE as ie,HE as ae,IA as s,IE as oe,JE as se,KE as ce,LA as c,LE as le,ME as ue,NE as de,OE as fe,PA as pe,PE as me,QE as he,RE as ge,SE as l,TE as _e,UE as ve,VE as ye,WE as be,XE as xe,YE as Se,ZE as Ce,_D as we,_E as u,aD as Te,aE as Ee,bD as De,bE as Oe,cD as ke,cE as d,dD as Ae,dE as f,eD as je,eE as p,fD as Me,fE as m,gD as Ne,gE as h,hD as g,hE as _,iD as Pe,iE as v,jE as Fe,kE as Ie,lD as Le,lE as y,mD as b,mE as x,nD as Re,nE as S,oD as ze,oE as C,pD as Be,pE as w,qE as Ve,rD as He,rE as T,sD as Ue,sE as E,tD as We,tE as D,uD as Ge,uE as O,vD as Ke,vE as k,wE as qe,xE as A,yD as Je,yE as j,zE as Ye}from"./dist-Cjlv3ZK-.js";import{n as M}from"./dist-LRVQ8Aeg.js";import{i as Xe}from"./dist-DIuY2jzI.js";import{t as N}from"./button-Bv-PK2-Y.js";import{A as P,C as F,F as Ze,Ft as Qe,It as $e,P as et,Pt as tt,S as I,at as L,b as R,et as z,it as B,jt as V,k as H,nt as U,ot as nt,rt,st as W,tt as it,u as at,w as G,x as K}from"./index-BWV7nAxJ.js";import{t as ot}from"./FilterBar-CkxsjoMo.js";import{t as st}from"./DataTableShell-0Ttkz82b.js";import{t as ct}from"./roleDescriptions-Br5xnRg9.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>C(),days:null},{value:`30`,label:()=>Ee(),days:30},{value:`90`,label:()=>v(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=$e({from:`/settings/serviceAccounts`}),t=Qe({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[l,u]=(0,q.useState)(X),Ee=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Oe=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),d=c(o.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:l===X?void 0:l,disabled:a===X?void 0:a===`disabled`}}),f=c(o.apiKeys.listKeys,{}),p=c(o.apiKeys.listRoles,{}),m=s(o.apiKeys.createServiceAccount),h=s(o.apiKeys.updateServiceAccount),_=s(o.apiKeys.deleteServiceAccount),v=pe(o.apiKeys.mintApiKey),y=s(o.apiKeys.revokeApiKey),x=Ze(),S=et(),C=n!==``||l!==X||a!==X;function w(){u(X),t({search:{},replace:!0})}let[T,E]=(0,q.useState)(!1),[D,O]=(0,q.useState)(Z),[k,A]=(0,q.useState)(null),[j,M]=(0,q.useState)(new Set),[P,L]=(0,q.useState)(null),B=(0,q.useRef)(!1),[V,H]=(0,q.useState)(new Set),[U,nt]=(0,q.useState)({}),[rt,W]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function Q(e){M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{k?(await h({serviceAccountId:k,name:D.name,roleKey:D.roleKey,description:D.description}),S.success(ge())):await m({name:D.name,roleKey:D.roleKey,description:D.description||void 0}),O(Z),A(null),E(!1)}catch(e){S.error(k?Ye():ee(),e)}}function pt(e){O({name:e.name,roleKey:e.roleKey,description:e.description??``}),A(e._id),E(!0)}async function mt(e){if(B.current)return;B.current=!0;let t=U[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;L(e._id);try{let t=await v({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){S.error(le(),e)}finally{B.current=!1,L(null)}}async function $(e){if(await x({title:oe(),description:(0,J.jsxs)(J.Fragment,{children:[re(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,me(),` `,(0,J.jsx)(`strong`,{children:de()}),` `,ue()]}),confirmWord:e.name,confirmLabel:Fe(),destructive:!0}))try{await _({serviceAccountId:e._id}),S.success(i(),e.name)}catch(e){S.error(Ie(),e)}}async function ht(e){if(await x({title:fe(),description:(0,J.jsxs)(J.Fragment,{children:[te(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,ne()]}),confirmLabel:_e(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await y({keyId:e._id})}catch(e){S.error(qe(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),(0,J.jsxs)(ot,{q:n,onQChange:Ee,searchPlaceholder:Je(),onReset:w,canReset:C,children:[(0,J.jsxs)(R,{value:l,onValueChange:u,children:[(0,J.jsx)(F,{size:`sm`,className:`w-40`,children:(0,J.jsx)(G,{placeholder:Ke()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(I,{value:X,children:we()}),(p??[]).map(e=>(0,J.jsx)(I,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(R,{value:a,onValueChange:Oe,children:[(0,J.jsx)(F,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(I,{value:X,children:Ne()}),(0,J.jsx)(I,{value:`active`,children:g()}),(0,J.jsx)(I,{value:`disabled`,children:b()})]})]})]}),(0,J.jsx)(st,{title:Be(),rows:d,addLabel:Me(),onAdd:()=>{O(Z),A(null),E(!0)},emptyHint:Ae(),isExpanded:e=>j.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:Ue(),onSelect:()=>pt(e)},{label:Ge(),onSelect:()=>void mt(e)},{label:j.has(e._id)?Le():ke(),onSelect:()=>Q(e._id)},{label:ze(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":j.has(e._id)?Te():Pe(),onClick:()=>Q(e._id),children:j.has(e._id)?(0,J.jsx)(Xe,{}):(0,J.jsx)(tt,{})})},{header:He(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Re(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(z,{variant:`secondary`,children:e.roleKey})},{header:We(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(z,{variant:`destructive`,children:b()}):(0,J.jsx)(z,{variant:`outline`,children:g()})},{header:je(),cell:e=>(0,J.jsxs)(R,{value:U[e._id]??`never`,onValueChange:t=>nt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(F,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(K,{children:lt.map(e=>(0,J.jsx)(I,{value:e.value,children:e.label()},e.value))})]})},{header:r(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:P===e._id?he():Ce({count:t})})}}]}),(0,J.jsx)(at,{open:T,onOpenChange:e=>{E(e),e||A(null)},title:k?xe():Ve(),description:k?Se():ce(),canSubmit:!!(D.name&&D.roleKey),onSubmit:ft,submitLabel:k?se():ie(),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:be()}),(0,J.jsx)(it,{value:D.name,onChange:e=>O({...D,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ve()}),(0,J.jsxs)(R,{value:D.roleKey||void 0,onValueChange:e=>O({...D,roleKey:e}),children:[(0,J.jsx)(F,{className:`w-full`,children:(0,J.jsx)(G,{placeholder:ae()})}),(0,J.jsx)(K,{children:(p??[]).map(e=>(0,J.jsxs)(I,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===D.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ye()}),(0,J.jsx)(it,{value:D.description,onChange:e=>O({...D,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:rt,onClose:()=>W(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[a(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:A()}),(0,J.jsx)(`th`,{children:Oe()}),(0,J.jsx)(`th`,{children:j()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{children:u()}),(0,J.jsx)(`th`,{children:h()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(z,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:P(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(N,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?_():x()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(U,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(rt,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(nt,{children:[(0,J.jsx)(W,{children:w()}),(0,J.jsx)(B,{children:m({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:f()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":O(),children:[n?(0,J.jsx)(M,{}):(0,J.jsx)(V,{}),n?y():d()]})]}),(0,J.jsx)(L,{children:(0,J.jsx)(N,{onClick:()=>{r(!1),t()},children:E()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?T():P(e)}function mt(e){return e===null?`—`:H(e)}function $(e){return e.disabled?(0,J.jsx)(z,{variant:`destructive`,children:S()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(z,{variant:`outline`,children:D()}):(0,J.jsx)(z,{variant:`outline`,children:p()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$r as r,Ar as i,Br as a,Cr as o,Dr as s,E as c,Er as l,Fr as u,Gr as d,Hr as f,IA as p,Ir as m,Jr as h,Kr as g,LA as _,Lr as v,Mr as y,Nr as b,Or as x,Pr as S,Qr as C,Rr as w,Sr as T,Tr as E,Ur as D,Vr as O,Wr as k,Xr as A,Yr as j,Zr as M,br as N,ei as P,jr as F,kr as I,ni as L,qr as ee,ri as R,ti as z,wr as B,xr as V,yr as H,zr as U}from"./dist-Cjlv3ZK-.js";import{t as W}from"./button-Bv-PK2-Y.js";import{A as G,F as K}from"./index-BWV7nAxJ.js";import{t as q}from"./DataTableShell-0Ttkz82b.js";var J=t(e(),1),Y=n(),X={hung:()=>a(),wrong_result:()=>U(),error:()=>w(),other:()=>v()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=p(c.subAgentReports.respondToReport),[r,a]=(0,J.useState)(e.thread),[d,f]=(0,J.useState)(``),[h,g]=(0,J.useState)(!1);async function _(){let t=d.trim();if(!(!t||h)){g(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{g(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,m({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:u()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?b():y()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:F()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:i(),value:d,maxLength:2e3,rows:3,onChange:e=>f(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void _(),disabled:!d.trim()||h,children:h?x():I()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[s({count:t.children.length}),t.childrenTruncated?` ${l()}`:``,t.textTruncated?` ${E()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${B()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:T()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=_(c.subAgentReports.listForAdmin,{}),t=p(c.subAgentReports.readReport),n=p(c.subAgentReports.deleteReport),i=K(),[a,o]=(0,J.useState)(null),[s,l]=(0,J.useState)({});async function u(e){if(a===e._id){o(null);return}if(!s[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}o(e._id)}async function m(e){await i({title:V(),description:N(),confirmLabel:H(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&o(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[z(),` `,(0,Y.jsx)(`strong`,{children:P()}),` `,r()]}),(0,Y.jsx)(q,{title:R(),rows:e,emptyHint:L(),isExpanded:e=>a===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,Y.jsx)($,{data:s[e._id]}):null,columns:[{header:C(),cell:e=>G(e.at),sort:e=>e.at},{header:M(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:A(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:j(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${g({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:h(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:ee(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:d()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:k()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?f():D(),onSelect:()=>void u(e)},{label:O(),onSelect:()=>void m(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,AO as i,BO as a,CO as o,Ck as s,D as c,DO as l,E as u,EA as d,EO as f,FO as p,GO as m,HO as h,IA as g,IO as _,JO as v,KO as y,LA as b,LO as x,MO as S,NO as ee,OO as te,PA as ne,PO as re,QO as ie,RO as ae,SO as oe,Sk as se,TA as ce,TO as le,Tk as ue,UO as de,VO as fe,WO as pe,XO as me,YO as he,ZO as ge,_O as _e,_k as ve,_r as C,aO as ye,ak as be,bO as xe,bk as Se,cO as Ce,ck as we,dO as w,dk as Te,ek as Ee,fO as De,fk as Oe,gO as ke,gk as Ae,gr as je,hO as Me,hk as T,hr as Ne,iO as Pe,ik as Fe,jO as Ie,kO as Le,lO as Re,lk as ze,mO as Be,mk as Ve,n as He,nk as Ue,oO as We,ok as Ge,pO as Ke,pk as qe,qO as Je,rO as Ye,rk as Xe,sO as E,sk as Ze,tk as Qe,uO as $e,uk as et,vO as tt,vk as nt,vr as D,wA as rt,wO as it,wk as at,xO as ot,xk as st,yO as ct,yk as lt,zO as ut}from"./dist-Cjlv3ZK-.js";import{n as O}from"./dist-LRVQ8Aeg.js";import{t as k}from"./x-3dY-o4JV.js";import{t as A}from"./button-Bv-PK2-Y.js";import{$ as dt,At as ft,C as j,J as pt,Q as M,S as N,X as P,Y as mt,Z as ht,b as F,ct as gt,et as I,kt as L,lt as _t,p as R,tt as z,ut as B,w as V,x as H}from"./index-BWV7nAxJ.js";import{t as vt}from"./localePickerView-C2RmOS86.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-B1IlPRv3.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-Dv9jX9eF.js";import{t as Ot}from"./TimeRangePicker-Dtnfk3jk.js";import{t as kt}from"./FilterBar-CkxsjoMo.js";import{t as At}from"./AdvancedFilter-S-HO9nIN.js";var K=c(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),q=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 J(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(f());if(e.size>Rt)throw Error(le());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,s=Math.min(zt/r,Bt/i,a?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(i*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(o());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Pt(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(o());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);J(e.data,f.width,f.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),m.putImageData(e,0,0)}let h=J(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Wt(p,`image/webp`,Vt)??await Wt(p,`image/png`);if(!g)throw Error(oe());return{blob:g,hasAlpha:h}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return Y(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 Y(e)}async function Y(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(it())),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 Wt(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Kt={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?d():e===`dark`?ce():rt()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:He(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":D(),title:D(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=b(u.charts.listMyCharts),r=g(u.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:T(),subtitle:Ve(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?qe():n.via===`owner`?Oe():Te({group:n.via.group});return(0,X.jsx)(Zt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()}):null]})}function $t(){let e=g(u.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),[d,f]=(0,q.useState)(!1);async function p(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(h())}}}async function _(){if(s(null),l(!1),t.trim()===``){s(a());return}let o;try{o=JSON.parse(r)}catch{s(h());return}f(!0);try{await e({name:t.trim(),tokens:o}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:v()}),(0,X.jsx)(z,{value:t,onChange:e=>n(e.target.value),placeholder:Je(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:y()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:m(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),pe(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void p(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:d,onClick:()=>void _(),children:de()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:fe()}):null]})]})}function en({chart:e}){let t=ne(u.charts.setChartLogo),n=g(u.charts.removeChartLogo),[r,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function d(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Ht(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function f(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await d(e,n)}async function p(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function m(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await d(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function h({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ee():S()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),t?i():Ie(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void f(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:te()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:Le()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:re()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(h,{mode:`light`}),(0,X.jsx)(h,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:l()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function tn({chart:e}){let t=b(u.me.getMe,{host:B}),n=g(u.charts.addChartDomain),r=g(u.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function p(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ot()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:_e()}):d.map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ke({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{value:i,onChange:e=>a(e.target.value),placeholder:ct(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(),children:tt()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:xe()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=g(u.charts.updateChart),n=g(u.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,d]=(0,q.useState)(e.tokens.bpm??0),[f,m]=(0,q.useState)(null),[v,y]=(0,q.useState)(!1);function b(){o(e.name),c($(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function x(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(s)}catch{m(h());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}y(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{y(!1)}}async function S(){if(e.chartId!==void 0&&window.confirm(w()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:b,children:_()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void S(),children:p()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ke()}),(0,X.jsx)(z,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:C()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>d(Number(e.target.value)),"aria-label":C()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?je():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:De()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:v,onClick:()=>void x(),children:Me()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Be()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=b(u.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ut()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:x()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=g(u.charts.addChartToGroupPool),i=g(u.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(t){try{await i({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(I,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?Ue():e.kind===`custom`&&e.scope===`personal`?E():Xe()}),e.isGlobalDefault?(0,X.jsx)(I,{variant:`default`,children:Qe()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:r()}),(o??[]).map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ge({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(F,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(j,{size:`sm`,className:`w-56`,children:(0,X.jsx)(V,{placeholder:ie()})}),(0,X.jsx)(H,{children:c.map(e=>(0,X.jsx)(N,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ee()}):null]})]})}function on({chart:e}){let t=g(u.charts.promoteChartToCommon),n=g(u.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(w()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(I,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?We():E()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ye()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Pe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=g(u.admin.setDefaultThemeMode),i=g(u.admin.setDefaultLocale),a=g(u.charts.setDefaultChart),o=b(u.charts.listChartsAdmin),c=b(u.groups.listGroups,{}),l=e??`system`,d=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:lt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:we()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:T()}),_t.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ge()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Fe()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(tn,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:$e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ye()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(A,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]})]})}function cn(){let e=b(u.me.getMe,{host:B}),t=gt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,d]=(0,q.useState)(Kt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Kt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Se()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(L,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{children:`Default`}),(0,X.jsx)(I,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(I,{variant:`outline`,children:`Outline`}),(0,X.jsx)(I,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(z,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(F,{value:n,onValueChange:r,children:[(0,X.jsx)(j,{className:`w-56`,children:(0,X.jsx)(V,{placeholder:`Select…`})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(N,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(N,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(R,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(F,{value:o,onValueChange:s,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(N,{value:Z,children:`Toutes directions`}),(0,X.jsx)(N,{value:`inbound`,children:`inbound`}),(0,X.jsx)(N,{value:`outbound`,children:`outbound`}),(0,X.jsx)(N,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(F,{value:c,onValueChange:l,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(N,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(N,{value:`info`,children:`info`}),(0,X.jsx)(N,{value:`warn`,children:`warn`}),(0,X.jsx)(N,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:qt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Ot,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(pt,{children:[(0,X.jsx)(dt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(L,{})})}),(0,X.jsxs)(mt,{align:`start`,children:[(0,X.jsx)(ht,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(R,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(R,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(I,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(L,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};