@lacneu/atrium 0.68.1 → 0.68.2

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 (38) hide show
  1. package/dist/assets/{AccessTab-BFZrGfSt.js → AccessTab-CoRmmFpP.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-D3IHsSgI.js → AdvancedFilter-DqWG63qF.js} +1 -1
  3. package/dist/assets/{AgentFilesTab-CHMpYoZN.js → AgentFilesTab-BnwVjBen.js} +1 -1
  4. package/dist/assets/{AnomaliesTab-Bna7O7DK.js → AnomaliesTab-D0_DaVUT.js} +1 -1
  5. package/dist/assets/{AuditTab-BQO2KxIW.js → AuditTab-CiMRA2UB.js} +1 -1
  6. package/dist/assets/{BridgeTab-DCHBE54n.js → BridgeTab-BhAxJtIU.js} +1 -1
  7. package/dist/assets/{ChatDefaultsTab-B49bnKco.js → ChatDefaultsTab-BRGSYbx2.js} +1 -1
  8. package/dist/assets/{DataTableShell-BYhMdaSl.js → DataTableShell-D5Nb8D27.js} +1 -1
  9. package/dist/assets/{DetailChips-BT8QU7Op.js → DetailChips-BpplTXuL.js} +1 -1
  10. package/dist/assets/{FeedbacksTab-B3aYpOIP.js → FeedbacksTab-6b-IOyv1.js} +1 -1
  11. package/dist/assets/{FieldLabel-2xG6-0gZ.js → FieldLabel-D_--lTMz.js} +1 -1
  12. package/dist/assets/{FilesTab-_09UVEP4.js → FilesTab-D5X6EpvN.js} +1 -1
  13. package/dist/assets/{FilterBar-Bxpfu6Cp.js → FilterBar-3xmqkmtO.js} +1 -1
  14. package/dist/assets/{GroupsTab-lX4rp_r8.js → GroupsTab-VRfFxe4t.js} +1 -1
  15. package/dist/assets/{InstancesTab-Bg4DV0Mg.js → InstancesTab-6WQvX86-.js} +1 -1
  16. package/dist/assets/{IntegrationsTab-eVcH8e5g.js → IntegrationsTab-cja9iSZK.js} +1 -1
  17. package/dist/assets/{KpiTab-BxeRQXix.js → KpiTab-DyotMcdO.js} +1 -1
  18. package/dist/assets/{PreferencesTab-DZSU4xP1.js → PreferencesTab-xvCftb-6.js} +1 -1
  19. package/dist/assets/{ProjectPage-vg8X5OT3.js → ProjectPage-B4CPwcaH.js} +1 -1
  20. package/dist/assets/{PromptInjectionsTab-88NlW26U.js → PromptInjectionsTab-DEzP8Oti.js} +1 -1
  21. package/dist/assets/{RolesTab-BZFTJhyf.js → RolesTab-CZfNwFFx.js} +1 -1
  22. package/dist/assets/{ScheduledTab-DGRbUQ47.js → ScheduledTab-D6x6Mo89.js} +1 -1
  23. package/dist/assets/{ServiceAccountsTab-pE8F7p-2.js → ServiceAccountsTab-S3OIL2wM.js} +1 -1
  24. package/dist/assets/{SubAgentReportsTab-BTQehyRQ.js → SubAgentReportsTab-r5dkHWGD.js} +1 -1
  25. package/dist/assets/{ThemeShowroom-HrqPxKuI.js → ThemeShowroom-ClnOnpAv.js} +1 -1
  26. package/dist/assets/{TimeRangePicker-DBPA3ISK.js → TimeRangePicker-B3yMy8oz.js} +1 -1
  27. package/dist/assets/{TimezoneCombobox-Cf0dO1lp.js → TimezoneCombobox-DjUiyEWp.js} +1 -1
  28. package/dist/assets/{TracesTab-DpeDrf2G.js → TracesTab-CyUsgwvb.js} +1 -1
  29. package/dist/assets/{UsersTab-txTMEiI9.js → UsersTab-DlotCuaa.js} +1 -1
  30. package/dist/assets/{VoiceTab-CnjBb1Ea.js → VoiceTab-BaqvZlgH.js} +1 -1
  31. package/dist/assets/{highlighted-body-OFNGDK62-D8RSF8so.js → highlighted-body-OFNGDK62-B8wQuJm_.js} +1 -1
  32. package/dist/assets/{index-CsdodIca.js → index-DdOFgMFG.js} +76 -76
  33. package/dist/assets/mermaid-GHXKKRXX-CE8gBGLh.js +1 -0
  34. package/dist/assets/{pdf-D65rOI23.js → pdf-BNLKKdqq.js} +1 -1
  35. package/dist/assets/{tabs-lFf0wQh0.js → tabs-D8fO33rb.js} +1 -1
  36. package/dist/index.html +1 -1
  37. package/package.json +1 -1
  38. package/dist/assets/mermaid-GHXKKRXX-CHdRR4I9.js +0 -1
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,$N as i,AN as a,BM as o,BN as s,CN as c,D as l,DL as u,DN as d,EL as f,EN as p,FN as m,GM as h,GN as g,Go as ee,HM as _,HN as te,IL as ne,IN as re,JM as v,JN as ie,KM as ae,KN as oe,Ko as y,LN as se,MN as ce,NN as le,OL as ue,ON as de,PN as fe,QM as pe,QN as b,RL as x,RN as me,SN as he,TN as S,UM as ge,UN as _e,VM as ve,VN as ye,WM as C,WN as be,Wo as xe,XM as Se,XN as Ce,YM as we,YN as Te,ZM as Ee,ZN as De,_N as Oe,aN as ke,aP as Ae,bN as je,cN as Me,cP as Ne,dN as Pe,eN as Fe,eP as Ie,fN as Le,gN as Re,hN as ze,iN as Be,iP as Ve,jN as He,kN as Ue,lN as We,mN as Ge,nN as Ke,nP as qe,oN as w,oP as Je,pN as Ye,qM as Xe,qN as Ze,qo as T,r as Qe,rN as $e,rP as et,sN as tt,sP as nt,t as E,tN as rt,tP as it,uN as at,vN as ot,wN as st,xN as ct,yN as lt,zL as D,zN as ut}from"./api-EsnGI4EC.js";import{t as O}from"./check-LaI7fqW2.js";import{t as dt}from"./x-DOcdk27K.js";import{t as k}from"./button-CZ9WPf0m.js";import{Ct as ft,Dn as pt,En as A,Ft as mt,It as j,Lt as ht,Mt as gt,Nt as _t,P as M,Pt as N,St as vt,_t as P,bt as F,jt as I,ut as L,vt as R,wt as z,xt as B,yt as V}from"./index-CsdodIca.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-CZABX7Qs.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-B--HXOj1.js";import{t as kt}from"./TimeRangePicker-DBPA3ISK.js";import{t as At}from"./FilterBar-Bxpfu6Cp.js";import{t as jt}from"./AdvancedFilter-D3IHsSgI.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(We());if(e.size>zt)throw Error(Me());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(w());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(w());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(ke());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(tt())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?ue():e===`dark`?u():f()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Qe(`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)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=D(E.charts.listMyCharts),r=x(E.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:b(),subtitle:De(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ce():n.via===`owner`?Te():ie({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(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:Ze()}):null]})}function Qt(){let e=x(E.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[f,m]=(0,K.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),u(!1);try{i(await t.text())}catch{s(S())}}}async function g(){if(s(null),u(!1),t.trim()===``){s(c());return}let a;try{a=JSON.parse(r)}catch{s(S());return}m(!0);try{await e({name:t.trim(),tokens:a}),u(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!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:le()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]}),(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:He()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:a(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ue()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:de(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),d(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:f,onClick:()=>void g(),children:p()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:st()}):null]})]})}function $t({chart:e}){let t=ne(E.charts.setChartLogo),n=x(E.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Re():ze()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?Ye():Ge(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Pe()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Le()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Oe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=D(E.me.getMe,{host:z}),n=x(E.charts.addChartDomain),i=x(E.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await i({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Be()}),(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:Fe()}):d.map(e=>(0,X.jsxs)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":r({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(dt,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),placeholder:Ke(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:rt()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=x(E.charts.updateChart),n=x(E.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>tn(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1);function h(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function g(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(S());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function _(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:h,children:lt()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void _(),children:ot()})]})})]}),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:Se()}),(0,X.jsx)(I,{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:y()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":y()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?ee():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:xe()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:we()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:p,onClick:()=>void g(),children:pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Ee()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=D(E.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:je()}):(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=x(E.charts.addChartToGroupPool),r=x(E.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!o.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(L,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ut():e.kind===`custom`&&e.scope===`personal`?C():s()}),e.isGlobalDefault?(0,X.jsx)(L,{variant:`default`,children:me()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:re()}),(a??[]).map(e=>(0,X.jsxs)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":fe({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(dt,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(P,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(F,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:m()})}),(0,X.jsx)(R,{children:c.map(e=>(0,X.jsx)(V,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:se()}):null]})]})}function on({chart:e}){let t=x(E.charts.promoteChartToCommon),n=x(E.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(L,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ge():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:h({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:_()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ve()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(E.admin.setDefaultThemeMode),i=x(E.admin.setDefaultLocale),a=x(E.charts.setDefaultChart),s=D(E.charts.listChartsAdmin),c=D(E.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()})]}),(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:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:b()}),ft.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:o()}):(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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Je()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]})]})}function cn(){let e=D(E.me.getMe,{host:z}),t=vt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:et()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(A,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{children:`Default`}),(0,X.jsx)(L,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(L,{variant:`outline`,children:`Outline`}),(0,X.jsx)(L,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(P,{value:n,onValueChange:r,children:[(0,X.jsx)(F,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(V,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(M,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(P,{value:o,onValueChange:s,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:Z,children:`Toutes directions`}),(0,X.jsx)(V,{value:`inbound`,children:`inbound`}),(0,X.jsx)(V,{value:`outbound`,children:`outbound`}),(0,X.jsx)(V,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(P,{value:c,onValueChange:l,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(V,{value:`info`,children:`info`}),(0,X.jsx)(V,{value:`warn`,children:`warn`}),(0,X.jsx)(V,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(ht,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(A,{})})}),(0,X.jsxs)(_t,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{children:`Edit`}),(0,X.jsx)(N,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(M,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(M,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(L,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(A,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,$N as i,AN as a,BM as o,BN as s,CN as c,D as l,DL as u,DN as d,EL as f,EN as p,FN as m,GM as h,GN as g,Go as ee,HM as _,HN as te,IL as ne,IN as re,JM as v,JN as ie,KM as ae,KN as oe,Ko as y,LN as se,MN as ce,NN as le,OL as ue,ON as de,PN as fe,QM as pe,QN as b,RL as x,RN as me,SN as he,TN as S,UM as ge,UN as _e,VM as ve,VN as ye,WM as C,WN as be,Wo as xe,XM as Se,XN as Ce,YM as we,YN as Te,ZM as Ee,ZN as De,_N as Oe,aN as ke,aP as Ae,bN as je,cN as Me,cP as Ne,dN as Pe,eN as Fe,eP as Ie,fN as Le,gN as Re,hN as ze,iN as Be,iP as Ve,jN as He,kN as Ue,lN as We,mN as Ge,nN as Ke,nP as qe,oN as w,oP as Je,pN as Ye,qM as Xe,qN as Ze,qo as T,r as Qe,rN as $e,rP as et,sN as tt,sP as nt,t as E,tN as rt,tP as it,uN as at,vN as ot,wN as st,xN as ct,yN as lt,zL as D,zN as ut}from"./api-EsnGI4EC.js";import{t as O}from"./check-LaI7fqW2.js";import{t as dt}from"./x-DOcdk27K.js";import{t as k}from"./button-CZ9WPf0m.js";import{Ct as ft,Dn as pt,En as A,Ft as mt,It as j,Lt as ht,Mt as gt,Nt as _t,P as M,Pt as N,St as vt,_t as P,bt as F,jt as I,ut as L,vt as R,wt as z,xt as B,yt as V}from"./index-DdOFgMFG.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-CZABX7Qs.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-B--HXOj1.js";import{t as kt}from"./TimeRangePicker-B3yMy8oz.js";import{t as At}from"./FilterBar-3xmqkmtO.js";import{t as jt}from"./AdvancedFilter-DqWG63qF.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(We());if(e.size>zt)throw Error(Me());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(w());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(w());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(ke());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(tt())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?ue():e===`dark`?u():f()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Qe(`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)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=D(E.charts.listMyCharts),r=x(E.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:b(),subtitle:De(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ce():n.via===`owner`?Te():ie({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(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:Ze()}):null]})}function Qt(){let e=x(E.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[f,m]=(0,K.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),u(!1);try{i(await t.text())}catch{s(S())}}}async function g(){if(s(null),u(!1),t.trim()===``){s(c());return}let a;try{a=JSON.parse(r)}catch{s(S());return}m(!0);try{await e({name:t.trim(),tokens:a}),u(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!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:le()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]}),(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:He()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:a(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ue()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:de(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),d(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:f,onClick:()=>void g(),children:p()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:st()}):null]})]})}function $t({chart:e}){let t=ne(E.charts.setChartLogo),n=x(E.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Re():ze()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?Ye():Ge(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Pe()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Le()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Oe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=D(E.me.getMe,{host:z}),n=x(E.charts.addChartDomain),i=x(E.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await i({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Be()}),(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:Fe()}):d.map(e=>(0,X.jsxs)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":r({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(dt,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),placeholder:Ke(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:rt()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=x(E.charts.updateChart),n=x(E.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>tn(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1);function h(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function g(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(S());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function _(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:h,children:lt()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void _(),children:ot()})]})})]}),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:Se()}),(0,X.jsx)(I,{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:y()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":y()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?ee():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:xe()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:we()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:p,onClick:()=>void g(),children:pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Ee()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=D(E.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:je()}):(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=x(E.charts.addChartToGroupPool),r=x(E.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!o.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(L,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ut():e.kind===`custom`&&e.scope===`personal`?C():s()}),e.isGlobalDefault?(0,X.jsx)(L,{variant:`default`,children:me()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:re()}),(a??[]).map(e=>(0,X.jsxs)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":fe({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(dt,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(P,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(F,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:m()})}),(0,X.jsx)(R,{children:c.map(e=>(0,X.jsx)(V,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:se()}):null]})]})}function on({chart:e}){let t=x(E.charts.promoteChartToCommon),n=x(E.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(L,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ge():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:h({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:_()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ve()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(E.admin.setDefaultThemeMode),i=x(E.admin.setDefaultLocale),a=x(E.charts.setDefaultChart),s=D(E.charts.listChartsAdmin),c=D(E.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()})]}),(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:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:b()}),ft.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:o()}):(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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Je()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]})]})}function cn(){let e=D(E.me.getMe,{host:z}),t=vt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:et()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(A,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{children:`Default`}),(0,X.jsx)(L,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(L,{variant:`outline`,children:`Outline`}),(0,X.jsx)(L,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(P,{value:n,onValueChange:r,children:[(0,X.jsx)(F,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(V,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(M,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(P,{value:o,onValueChange:s,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:Z,children:`Toutes directions`}),(0,X.jsx)(V,{value:`inbound`,children:`inbound`}),(0,X.jsx)(V,{value:`outbound`,children:`outbound`}),(0,X.jsx)(V,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(P,{value:c,onValueChange:l,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(V,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(V,{value:`info`,children:`info`}),(0,X.jsx)(V,{value:`warn`,children:`warn`}),(0,X.jsx)(V,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(ht,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(A,{})})}),(0,X.jsxs)(_t,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{children:`Edit`}),(0,X.jsx)(N,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(M,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(M,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(L,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(A,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,Fi as i,G_ as a,H_ as o,Ii as s,J_ as c,K_ as l,Li as u,Mi as d,Ni as f,Pi as p,Q_ as m,U_ as h,V_ as g,W_ as _,X_ as v,Y_ as y,Z_ as b,ji as x,q_ as S}from"./api-EsnGI4EC.js";import{t as C}from"./button-CZ9WPf0m.js";import{Ht as w,Ut as T,Vt as E,Wt as D,ct as O,jt as k,kn as A,sn as j}from"./index-CsdodIca.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:r(),from:`now-5m`},{label:m(),from:`now-15m`},{label:b(),from:`now-30m`},{label:v(),from:`now-1h`},{label:y(),from:`now-3h`},{label:c(),from:`now-6h`},{label:S(),from:`now-12h`},{label:l(),from:`now-24h`},{label:a(),from:`now-2d`},{label:_(),from:`now-7d`},{label:h(),from:`now-30d`},{label:o(),from:`now-90d`},{label:g(),from:`now-520w`}];function L(e){return O(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),c=F(e),[l,m]=(0,M.useState)(()=>z(c.from)),[h,g]=(0,M.useState)(()=>z(c.to));function _(t){if(t){let t=F(e);m(z(t.from)),g(z(t.to)),o(``)}r(t)}function v(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function y(){let e=B(l),n=B(h);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let b=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),S=B(l)!==null&&B(h)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:_,children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(E,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:u()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:s()}),(0,H.jsx)(k,{type:`datetime-local`,value:l,onChange:e=>m(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(k,{type:`datetime-local`,value:h,onChange:e=>g(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:y,children:p()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(k,{value:a,onChange:e=>o(e.target.value),placeholder:f(),"aria-label":d()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:b.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:x()}):b.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>v(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,Fi as i,G_ as a,H_ as o,Ii as s,J_ as c,K_ as l,Li as u,Mi as d,Ni as f,Pi as p,Q_ as m,U_ as h,V_ as g,W_ as _,X_ as v,Y_ as y,Z_ as b,ji as x,q_ as S}from"./api-EsnGI4EC.js";import{t as C}from"./button-CZ9WPf0m.js";import{Ht as w,Ut as T,Vt as E,Wt as D,ct as O,jt as k,kn as A,sn as j}from"./index-DdOFgMFG.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:r(),from:`now-5m`},{label:m(),from:`now-15m`},{label:b(),from:`now-30m`},{label:v(),from:`now-1h`},{label:y(),from:`now-3h`},{label:c(),from:`now-6h`},{label:S(),from:`now-12h`},{label:l(),from:`now-24h`},{label:a(),from:`now-2d`},{label:_(),from:`now-7d`},{label:h(),from:`now-30d`},{label:o(),from:`now-90d`},{label:g(),from:`now-520w`}];function L(e){return O(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),c=F(e),[l,m]=(0,M.useState)(()=>z(c.from)),[h,g]=(0,M.useState)(()=>z(c.to));function _(t){if(t){let t=F(e);m(z(t.from)),g(z(t.to)),o(``)}r(t)}function v(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function y(){let e=B(l),n=B(h);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let b=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),S=B(l)!==null&&B(h)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:_,children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(E,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:u()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:s()}),(0,H.jsx)(k,{type:`datetime-local`,value:l,onChange:e=>m(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(k,{type:`datetime-local`,value:h,onChange:e=>g(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:y,children:p()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(k,{value:a,onChange:e=>o(e.target.value),placeholder:f(),"aria-label":d()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:b.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:x()}):b.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>v(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{cF as r,lF as i,sF as a,uF as o}from"./api-EsnGI4EC.js";import{t as s}from"./check-LaI7fqW2.js";import{t as c}from"./chevrons-up-down-BQ8-VyUH.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-CsdodIca.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||a():e;return(0,T.jsxs)(u,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":o(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:i(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:r()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{cF as r,lF as i,sF as a,uF as o}from"./api-EsnGI4EC.js";import{t as s}from"./check-LaI7fqW2.js";import{t as c}from"./chevrons-up-down-BQ8-VyUH.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-DdOFgMFG.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||a():e;return(0,T.jsxs)(u,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":o(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:i(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:r()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$b as i,AD as a,Ab as o,BD as s,Bb as c,Cb as l,D as u,Db as d,Eb as f,FD as p,Fb as m,Gb as ee,HD as te,Hb as h,ID as g,Ib as ne,JD as _,Jb as re,Kb as ie,LD as v,Lb as ae,MD as y,Mb as oe,Mr as b,ND as x,Nb as se,Nr as S,Ob as ce,PD as C,Pb as le,Pr as w,QD as T,Qb as ue,RD as E,RL as D,Rb as de,Sb as O,Tb as fe,UD as pe,Ub as me,VD as k,Vb as he,Wb as ge,XD as _e,Xb as ve,YD as A,Yb as ye,ZD as be,Zb as xe,_O as Se,aO as j,bb as Ce,cO as we,dO as Te,eO as Ee,ex as De,fO as Oe,gO as ke,hO as M,iO as N,ix as Ae,jD as je,jb as Me,kD as Ne,kb as Pe,lO as Fe,mO as Ie,nO as Le,nx as Re,oO as P,pO as ze,qb as Be,rO as Ve,rx as He,sO as Ue,t as F,tO as We,tx as Ge,uO as Ke,vO as qe,wb as Je,xb as Ye,zD as Xe,zL as I,zb as Ze}from"./api-EsnGI4EC.js";import{t as Qe}from"./check-LaI7fqW2.js";import{t as $e}from"./x-DOcdk27K.js";import{i as L,n as R,r as et,t as tt}from"./tabs-lFf0wQh0.js";import{t as z}from"./button-CZ9WPf0m.js";import{Fn as nt,J as rt,On as it,Pn as at,Tn as ot,_t as B,a as st,bt as V,ct as H,dt as ct,ft as lt,gt as ut,ht as dt,i as ft,lt as pt,o as mt,pt as ht,s as gt,ut as U,vt as W,wt as _t,xn as vt,xt as G,yt as K}from"./index-CsdodIca.js";import{n as yt}from"./TimeRangePicker-DBPA3ISK.js";import{t as bt}from"./FilterBar-Bxpfu6Cp.js";import{t as xt}from"./AdvancedFilter-D3IHsSgI.js";import{t as q}from"./DataTableShell-BYhMdaSl.js";var St=u(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),i=e.slice(t+1);return n===`admin`?r():n===`agent`?`${T()} - ${i}`:e}function Tt(){let e=I(F.me.getMe,{host:_t})?.role===`admin`,t=I(F.deliveryTiming.getDeliveryStatus,{}),n=D(F.deliveryTiming.startDeliveryRecord),r=D(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:qe()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Se()})]}),e?(0,Y.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?M():ke()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(U,{variant:`secondary`,children:Ie()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:ze({time:pt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Ke():Te()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=I(F.deliveryTiming.listDeliverySessions,{}),n=D(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[u,d]=(0,J.useState)(null),{from:f,to:p}=yt(c),m=c.to===`now`?1/0:p,ee=r.trim()!==``||o!==`all`||c!==X,te=()=>{i(``),s(`all`),l(X)},h=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=f&&t.startedAt<=m).map(e=>({...e,_id:e.sessionId}))},[t,r,o,f,m]),g=e=>{let t=new Set((h??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:we(),timeRange:c,onTimeRangeChange:l,onReset:te,canReset:ee,children:(0,Y.jsxs)(B,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(G,{})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:`all`,children:Ue()}),(0,Y.jsx)(K,{value:`active`,children:P()}),(0,Y.jsx)(K,{value:`stopped`,children:j()})]})]})}),(0,Y.jsx)(q,{title:Fe(),rows:h,emptyHint:a(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?_e():be(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ot,{size:15,"aria-hidden":!0})})},{header:N(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:H(e.startedAt)})},{header:Ve(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:H(e.stoppedAt)})},{header:Le(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:We(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Ee(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(U,{variant:`secondary`,children:P()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:j()})}],rowActions:e?e=>[{label:A(),variant:`destructive`,onSelect:()=>g([e.sessionId])}]:void 0,bulkActions:e?[{label:A(),variant:`destructive`,onSelect:e=>g(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=I(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Ne()]}),(0,Y.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)(it,{size:13,"aria-hidden":!0}),t?je():y()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:k()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:s()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Xe()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(E(),r.bridge),i(v(),r.A),i(g(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:p()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:C()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:w()},{value:`principalType`,label:S()},{value:`direction`,label:`direction`},{value:`roleKey`,label:b()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=nt({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,u=e.direction??Q,p=e.roleKey??Q,g=e.q??``,_=ft(e.from,e.to),v=(0,J.useMemo)(()=>gt(e.adv),[e.adv]),{from:y,to:b}=yt(_),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),T=e=>void t({search:t=>({...t,limit:e})}),E=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),O=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),_e=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),be=e=>void t({search:t=>({...t,...mt(e)})}),Se=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),j=I(F.observability.listEvents,{limit:n}),Ce=I(F.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:g||void 0,from:y,to:b,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:u===Q?void 0:u,roleKey:p===Q?void 0:p,advanced:v.length>0?v:void 0}}),we=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),Te=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),Ee=g!==``||a!==Q||s!==Q||u!==Q||p!==Q||v.length>0||_.kind!==`relative`||_.from!==Pt.from;function Oe(){t({search:{limit:100,kind:`all`},replace:!0})}let ke=x?j?.filter(e=>e.correlationId===x):Ce,M=e.section,N=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(tt,{value:M,onValueChange:e=>N(e),children:[(0,Y.jsxs)(et,{className:`w-full`,children:[(0,Y.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),pe()]}),(0,Y.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),te()]})]}),(0,Y.jsx)(R,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ae(),(0,Y.jsx)(`strong`,{children:He()}),Re(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Ge()})]}),(0,Y.jsxs)(bt,{q:g,onQChange:D,searchPlaceholder:De(),timeRange:_,onTimeRangeChange:be,onReset:Oe,canReset:Ee,children:[(0,Y.jsxs)(B,{value:a,onValueChange:O,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:i()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ue()}),jt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:s,onValueChange:k,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:xe()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ve()}),Mt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:u,onValueChange:_e,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:ye()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:p,onValueChange:A,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(G,{placeholder:Be()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ie()}),Te.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:r,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(G,{placeholder:ee()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:At,children:ge()}),we.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(G,{})}),(0,Y.jsx)(W,{children:kt.map(e=>(0,Y.jsx)(K,{value:String(e),children:me({count:e})},e))})]})]}),(0,Y.jsx)(xt,{fields:Ft,seed:v,onChange:Se}),x?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:h(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[he(),(0,Y.jsx)(`code`,{children:$(x)})]}),(0,Y.jsx)($e,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:c()})]})}):null,(0,Y.jsx)(q,{title:Ze(),rows:ke,emptyHint:x?de():ae(),columns:[{header:ne(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:H(e.at)})},{header:m(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(U,{variant:`secondary`,children:e.kind})},{header:le(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":se(),children:`✓`})}},{header:oe(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(U,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Me(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(U,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:o(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(U,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Pe(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ce(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:d(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:f(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:fe(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Je(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:l()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:C,onClose:()=>w(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ct,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(lt,{className:`max-w-lg`,children:[(0,Y.jsxs)(dt,{children:[(0,Y.jsxs)(ut,{className:`oc-traces__meta-title`,children:[O(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(U,{variant:`outline`,children:Ye()})]}),(0,Y.jsx)(ht,{children:Ce()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$b as i,AD as a,Ab as o,BD as s,Bb as c,Cb as l,D as u,Db as d,Eb as f,FD as p,Fb as m,Gb as ee,HD as te,Hb as h,ID as g,Ib as ne,JD as _,Jb as re,Kb as ie,LD as v,Lb as ae,MD as y,Mb as oe,Mr as b,ND as x,Nb as se,Nr as S,Ob as ce,PD as C,Pb as le,Pr as w,QD as T,Qb as ue,RD as E,RL as D,Rb as de,Sb as O,Tb as fe,UD as pe,Ub as me,VD as k,Vb as he,Wb as ge,XD as _e,Xb as ve,YD as A,Yb as ye,ZD as be,Zb as xe,_O as Se,aO as j,bb as Ce,cO as we,dO as Te,eO as Ee,ex as De,fO as Oe,gO as ke,hO as M,iO as N,ix as Ae,jD as je,jb as Me,kD as Ne,kb as Pe,lO as Fe,mO as Ie,nO as Le,nx as Re,oO as P,pO as ze,qb as Be,rO as Ve,rx as He,sO as Ue,t as F,tO as We,tx as Ge,uO as Ke,vO as qe,wb as Je,xb as Ye,zD as Xe,zL as I,zb as Ze}from"./api-EsnGI4EC.js";import{t as Qe}from"./check-LaI7fqW2.js";import{t as $e}from"./x-DOcdk27K.js";import{i as L,n as R,r as et,t as tt}from"./tabs-D8fO33rb.js";import{t as z}from"./button-CZ9WPf0m.js";import{Fn as nt,J as rt,On as it,Pn as at,Tn as ot,_t as B,a as st,bt as V,ct as H,dt as ct,ft as lt,gt as ut,ht as dt,i as ft,lt as pt,o as mt,pt as ht,s as gt,ut as U,vt as W,wt as _t,xn as vt,xt as G,yt as K}from"./index-DdOFgMFG.js";import{n as yt}from"./TimeRangePicker-B3yMy8oz.js";import{t as bt}from"./FilterBar-3xmqkmtO.js";import{t as xt}from"./AdvancedFilter-DqWG63qF.js";import{t as q}from"./DataTableShell-D5Nb8D27.js";var St=u(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),i=e.slice(t+1);return n===`admin`?r():n===`agent`?`${T()} - ${i}`:e}function Tt(){let e=I(F.me.getMe,{host:_t})?.role===`admin`,t=I(F.deliveryTiming.getDeliveryStatus,{}),n=D(F.deliveryTiming.startDeliveryRecord),r=D(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:qe()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Se()})]}),e?(0,Y.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?M():ke()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(U,{variant:`secondary`,children:Ie()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:ze({time:pt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Ke():Te()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=I(F.deliveryTiming.listDeliverySessions,{}),n=D(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[u,d]=(0,J.useState)(null),{from:f,to:p}=yt(c),m=c.to===`now`?1/0:p,ee=r.trim()!==``||o!==`all`||c!==X,te=()=>{i(``),s(`all`),l(X)},h=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=f&&t.startedAt<=m).map(e=>({...e,_id:e.sessionId}))},[t,r,o,f,m]),g=e=>{let t=new Set((h??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:we(),timeRange:c,onTimeRangeChange:l,onReset:te,canReset:ee,children:(0,Y.jsxs)(B,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(G,{})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:`all`,children:Ue()}),(0,Y.jsx)(K,{value:`active`,children:P()}),(0,Y.jsx)(K,{value:`stopped`,children:j()})]})]})}),(0,Y.jsx)(q,{title:Fe(),rows:h,emptyHint:a(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?_e():be(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ot,{size:15,"aria-hidden":!0})})},{header:N(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:H(e.startedAt)})},{header:Ve(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:H(e.stoppedAt)})},{header:Le(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:We(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Ee(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(U,{variant:`secondary`,children:P()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:j()})}],rowActions:e?e=>[{label:A(),variant:`destructive`,onSelect:()=>g([e.sessionId])}]:void 0,bulkActions:e?[{label:A(),variant:`destructive`,onSelect:e=>g(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=I(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Ne()]}),(0,Y.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)(it,{size:13,"aria-hidden":!0}),t?je():y()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:k()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:s()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Xe()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(E(),r.bridge),i(v(),r.A),i(g(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:p()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:C()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:w()},{value:`principalType`,label:S()},{value:`direction`,label:`direction`},{value:`roleKey`,label:b()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=nt({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,u=e.direction??Q,p=e.roleKey??Q,g=e.q??``,_=ft(e.from,e.to),v=(0,J.useMemo)(()=>gt(e.adv),[e.adv]),{from:y,to:b}=yt(_),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),T=e=>void t({search:t=>({...t,limit:e})}),E=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),O=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),_e=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),be=e=>void t({search:t=>({...t,...mt(e)})}),Se=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),j=I(F.observability.listEvents,{limit:n}),Ce=I(F.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:g||void 0,from:y,to:b,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:u===Q?void 0:u,roleKey:p===Q?void 0:p,advanced:v.length>0?v:void 0}}),we=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),Te=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),Ee=g!==``||a!==Q||s!==Q||u!==Q||p!==Q||v.length>0||_.kind!==`relative`||_.from!==Pt.from;function Oe(){t({search:{limit:100,kind:`all`},replace:!0})}let ke=x?j?.filter(e=>e.correlationId===x):Ce,M=e.section,N=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(tt,{value:M,onValueChange:e=>N(e),children:[(0,Y.jsxs)(et,{className:`w-full`,children:[(0,Y.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),pe()]}),(0,Y.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),te()]})]}),(0,Y.jsx)(R,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ae(),(0,Y.jsx)(`strong`,{children:He()}),Re(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Ge()})]}),(0,Y.jsxs)(bt,{q:g,onQChange:D,searchPlaceholder:De(),timeRange:_,onTimeRangeChange:be,onReset:Oe,canReset:Ee,children:[(0,Y.jsxs)(B,{value:a,onValueChange:O,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:i()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ue()}),jt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:s,onValueChange:k,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:xe()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ve()}),Mt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:u,onValueChange:_e,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(G,{placeholder:ye()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:p,onValueChange:A,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(G,{placeholder:Be()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ie()}),Te.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:r,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(G,{placeholder:ee()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:At,children:ge()}),we.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(B,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(G,{})}),(0,Y.jsx)(W,{children:kt.map(e=>(0,Y.jsx)(K,{value:String(e),children:me({count:e})},e))})]})]}),(0,Y.jsx)(xt,{fields:Ft,seed:v,onChange:Se}),x?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:h(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[he(),(0,Y.jsx)(`code`,{children:$(x)})]}),(0,Y.jsx)($e,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:c()})]})}):null,(0,Y.jsx)(q,{title:Ze(),rows:ke,emptyHint:x?de():ae(),columns:[{header:ne(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:H(e.at)})},{header:m(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(U,{variant:`secondary`,children:e.kind})},{header:le(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":se(),children:`✓`})}},{header:oe(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(U,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Me(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(U,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:o(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(U,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Pe(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ce(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:d(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:f(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:fe(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Je(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:l()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:C,onClose:()=>w(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ct,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(lt,{className:`max-w-lg`,children:[(0,Y.jsxs)(dt,{children:[(0,Y.jsxs)(ut,{className:`oc-traces__meta-title`,children:[O(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(U,{variant:`outline`,children:Ye()})]}),(0,Y.jsx)(ht,{children:Ce()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AT as i,BT as a,By as o,CT as s,DT as c,ET as l,FT as u,Fy as d,GT as f,Gy as p,HT as ee,Hy as m,IT as h,Iy as g,KT as _,Ky as v,LT as te,Ly as y,MT as ne,NT as re,OT as ie,PT as ae,Py as b,Qd as x,RL as S,RT as oe,Ry as C,ST as se,TT as ce,UT as le,Uy as w,VT as ue,Vy as T,WT as E,Wy as D,Xd as O,Zd as k,bT as de,jT as fe,kT as pe,t as A,vT as me,wT as he,xT as ge,yT as _e,zL as j,zT as ve,zy as M}from"./api-EsnGI4EC.js";import{t as N}from"./button-CZ9WPf0m.js";import{Dt as P,Fn as F,Ft as I,Lt as L,Mt as ye,Nt as be,P as R,Pn as xe,Pt as Se,Q as Ce,Z as we,_t as z,an as B,bt as V,c as H,dt as Te,ft as Ee,gt as De,ht as Oe,l as ke,on as U,pt as Ae,u as W,ut as G,vt as K,wt as je,xt as q,yt as J}from"./index-CsdodIca.js";import{t as Me}from"./FilterBar-Bxpfu6Cp.js";import{t as Ne}from"./DataTableShell-BYhMdaSl.js";import{t as Pe}from"./DetailChips-BT8QU7Op.js";var Y=t(e(),1),X=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=j(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=j(A.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,X.jsx)(Te,{open:n,onOpenChange:r,children:(0,X.jsxs)(Ee,{className:`oc-access`,children:[(0,X.jsxs)(Oe,{children:[(0,X.jsx)(De,{children:v({user:t})}),(0,X.jsx)(Ae,{children:p()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?D():w()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:m()}):u.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:M()}):[...d.entries()].map(([t,n])=>(0,X.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let s=S(A.agents.assignAgent),c=S(A.agents.removeAgent),l=S(A.agents.setDefaultAgent),u=P();if(!e)return null;async function f(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(T(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(o(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(U,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,X.jsx)(R,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":C({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,e.outOfPool?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:g()}):null,r?o?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":d(),title:d(),children:(0,X.jsx)(B,{size:14,fill:`currentColor`})}):(0,X.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":b(),title:b(),disabled:c,onClick:()=>void p(e.agentId),children:(0,X.jsx)(B,{size:14})}):null]},e.agentId)})]})}var Z=`__all__`;function Q(e){switch(e){case`pending`:return O();case`user`:return k();case`admin`:return x();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=H.filter(e=>n.has(W[e])).length;return(0,X.jsxs)(ye,{children:[(0,X.jsx)(L,{asChild:!0,children:(0,X.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?_():f({count:r})})}),(0,X.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,X.jsx)(I,{children:E()}),H.map(e=>{let r=W[e];return(0,X.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:ke[e]()})]},e)})]})]})}function $(){let e=F({from:`/settings/users`}),t=xe({from:`/settings/users`}),n=e.q??``,o=e.role??Z,d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,role:e===Z?void 0:e})}),p=j(A.admin.listUsers,{filter:{q:n||void 0,role:o===Z?void 0:o},withAgents:!0}),m=j(A.me.getMe,{host:je}),g=S(A.admin.setRole),_=S(A.admin.setUserPermissions),v=S(A.admin.startImpersonation),y=S(A.admin.deleteUser),b=S(A.admin.setUserName),x=we(),C=Ce(),w=P(),[T,E]=(0,Y.useState)(null),D=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of p??[])e.add(t.role);return[...e]},[p]),O=n!==``||o!==Z;function k(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){w.error(le(),e)}}async function N(e){try{await _(e)}catch(e){w.error(ee(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:u(),description:ae({user:t}),confirmWord:re(),confirmLabel:ne(),destructive:!0}))try{await y({profileId:e._id}),w.success(i({user:t}))}catch(e){w.error(fe(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await C({title:ie(),label:c({user:t}),placeholder:l(),defaultValue:e.name??``,confirmLabel:r()});if(n!==null)try{await b({profileId:e._id,name:n}),w.success(ce())}catch(e){w.error(he(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{q:n,onQChange:d,searchPlaceholder:ue(),onReset:k,canReset:O,children:(0,X.jsxs)(z,{value:o,onValueChange:f,children:[(0,X.jsx)(V,{size:`sm`,className:`w-36`,children:(0,X.jsx)(q,{})}),(0,X.jsxs)(K,{children:[(0,X.jsx)(J,{value:Z,children:a()}),D.map(e=>(0,X.jsx)(J,{value:e,children:Q(e)},e))]})]})}),(0,X.jsx)(Ne,{title:ve(),rows:p,emptyHint:oe(),rowActions:e=>{let t=[{label:me(),onSelect:()=>E({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:pe(),onSelect:()=>void L(e)}];return e.userId!==m?.userId&&t.push({label:te(),onSelect:()=>void v({profileId:e._id})},{label:h(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:s(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:se(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(z,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,X.jsx)(V,{size:`sm`,className:`w-28`,children:(0,X.jsx)(q,{})}),(0,X.jsxs)(K,{children:[(0,X.jsx)(J,{value:`pending`,children:Q(`pending`)}),(0,X.jsx)(J,{value:`user`,children:Q(`user`)}),(0,X.jsx)(J,{value:`admin`,children:Q(`admin`)})]})]})},{header:ge(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:de()}):(0,X.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:_e(),cell:e=>(0,X.jsx)(Pe,{icon:(0,X.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Fe,{profileId:T?.profileId??null,userLabel:T?.label??``,open:T!==null,onOpenChange:e=>{e||E(null)}})]})}export{$ as UsersTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AT as i,BT as a,By as o,CT as s,DT as c,ET as l,FT as u,Fy as d,GT as f,Gy as p,HT as ee,Hy as m,IT as h,Iy as g,KT as _,Ky as v,LT as te,Ly as y,MT as ne,NT as re,OT as ie,PT as ae,Py as b,Qd as x,RL as S,RT as oe,Ry as C,ST as se,TT as ce,UT as le,Uy as w,VT as ue,Vy as T,WT as E,Wy as D,Xd as O,Zd as k,bT as de,jT as fe,kT as pe,t as A,vT as me,wT as he,xT as ge,yT as _e,zL as j,zT as ve,zy as M}from"./api-EsnGI4EC.js";import{t as N}from"./button-CZ9WPf0m.js";import{Dt as P,Fn as F,Ft as I,Lt as L,Mt as ye,Nt as be,P as R,Pn as xe,Pt as Se,Q as Ce,Z as we,_t as z,an as B,bt as V,c as H,dt as Te,ft as Ee,gt as De,ht as Oe,l as ke,on as U,pt as Ae,u as W,ut as G,vt as K,wt as je,xt as q,yt as J}from"./index-DdOFgMFG.js";import{t as Me}from"./FilterBar-3xmqkmtO.js";import{t as Ne}from"./DataTableShell-D5Nb8D27.js";import{t as Pe}from"./DetailChips-BpplTXuL.js";var Y=t(e(),1),X=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=j(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=j(A.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,X.jsx)(Te,{open:n,onOpenChange:r,children:(0,X.jsxs)(Ee,{className:`oc-access`,children:[(0,X.jsxs)(Oe,{children:[(0,X.jsx)(De,{children:v({user:t})}),(0,X.jsx)(Ae,{children:p()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?D():w()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:m()}):u.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:M()}):[...d.entries()].map(([t,n])=>(0,X.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let s=S(A.agents.assignAgent),c=S(A.agents.removeAgent),l=S(A.agents.setDefaultAgent),u=P();if(!e)return null;async function f(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(T(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(o(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(U,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,X.jsx)(R,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":C({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,e.outOfPool?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:g()}):null,r?o?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":d(),title:d(),children:(0,X.jsx)(B,{size:14,fill:`currentColor`})}):(0,X.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":b(),title:b(),disabled:c,onClick:()=>void p(e.agentId),children:(0,X.jsx)(B,{size:14})}):null]},e.agentId)})]})}var Z=`__all__`;function Q(e){switch(e){case`pending`:return O();case`user`:return k();case`admin`:return x();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=H.filter(e=>n.has(W[e])).length;return(0,X.jsxs)(ye,{children:[(0,X.jsx)(L,{asChild:!0,children:(0,X.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?_():f({count:r})})}),(0,X.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,X.jsx)(I,{children:E()}),H.map(e=>{let r=W[e];return(0,X.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:ke[e]()})]},e)})]})]})}function $(){let e=F({from:`/settings/users`}),t=xe({from:`/settings/users`}),n=e.q??``,o=e.role??Z,d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,role:e===Z?void 0:e})}),p=j(A.admin.listUsers,{filter:{q:n||void 0,role:o===Z?void 0:o},withAgents:!0}),m=j(A.me.getMe,{host:je}),g=S(A.admin.setRole),_=S(A.admin.setUserPermissions),v=S(A.admin.startImpersonation),y=S(A.admin.deleteUser),b=S(A.admin.setUserName),x=we(),C=Ce(),w=P(),[T,E]=(0,Y.useState)(null),D=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of p??[])e.add(t.role);return[...e]},[p]),O=n!==``||o!==Z;function k(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){w.error(le(),e)}}async function N(e){try{await _(e)}catch(e){w.error(ee(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:u(),description:ae({user:t}),confirmWord:re(),confirmLabel:ne(),destructive:!0}))try{await y({profileId:e._id}),w.success(i({user:t}))}catch(e){w.error(fe(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await C({title:ie(),label:c({user:t}),placeholder:l(),defaultValue:e.name??``,confirmLabel:r()});if(n!==null)try{await b({profileId:e._id,name:n}),w.success(ce())}catch(e){w.error(he(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{q:n,onQChange:d,searchPlaceholder:ue(),onReset:k,canReset:O,children:(0,X.jsxs)(z,{value:o,onValueChange:f,children:[(0,X.jsx)(V,{size:`sm`,className:`w-36`,children:(0,X.jsx)(q,{})}),(0,X.jsxs)(K,{children:[(0,X.jsx)(J,{value:Z,children:a()}),D.map(e=>(0,X.jsx)(J,{value:e,children:Q(e)},e))]})]})}),(0,X.jsx)(Ne,{title:ve(),rows:p,emptyHint:oe(),rowActions:e=>{let t=[{label:me(),onSelect:()=>E({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:pe(),onSelect:()=>void L(e)}];return e.userId!==m?.userId&&t.push({label:te(),onSelect:()=>void v({profileId:e._id})},{label:h(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:s(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:se(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(z,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,X.jsx)(V,{size:`sm`,className:`w-28`,children:(0,X.jsx)(q,{})}),(0,X.jsxs)(K,{children:[(0,X.jsx)(J,{value:`pending`,children:Q(`pending`)}),(0,X.jsx)(J,{value:`user`,children:Q(`user`)}),(0,X.jsx)(J,{value:`admin`,children:Q(`admin`)})]})]})},{header:ge(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:de()}):(0,X.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:_e(),cell:e=>(0,X.jsx)(Pe,{icon:(0,X.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Fe,{profileId:T?.profileId??null,userLabel:T?.label??``,open:T!==null,onOpenChange:e=>{e||E(null)}})]})}export{$ as UsersTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,AL as i,An as a,At as o,Bn as s,Ct as c,Dt as l,Fn as u,Ft as d,Gn as f,Hl as ee,Hn as p,IL as m,In as h,It as g,Jn as _,Kn as v,Ln as y,Lt as b,ML as x,Mn as S,Nn as te,Nt as ne,Ot as C,Pn as w,Pt as T,Qn as E,RL as D,Rn as re,St as ie,Tt as O,Un as ae,Vn as oe,Wl as se,Wn as ce,Wt as le,XE as k,Xn as ue,Yn as de,Zn as fe,jn as pe,kn as A,kt as j,qn as M,t as N,ud as P,ut as F,wt as I,zL as L,zn as R}from"./api-EsnGI4EC.js";import{i as z,n as B,r as me,t as he}from"./tabs-lFf0wQh0.js";import{t as V}from"./button-CZ9WPf0m.js";import{$t as H,Fn as ge,Jt as _e,Nn as ve,P as U,Pn as ye,Qt as W,Xt as be,Yt as xe,Zt as Se,_t as G,bt as K,en as Ce,gn as we,nn as Te,ut as q,vt as J,wt as Ee,xt as Y,yt as X}from"./index-CsdodIca.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>v()],[`fr-FR`,()=>b()],[`en-US`,()=>g()],[`en-GB`,()=>d()],[`de-DE`,()=>T()],[`es-ES`,()=>ne()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>ae()],[`1.25`,()=>p()],[`1.5`,()=>oe()]],$=0;function ke({instance:e}){let t=D(N.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[i,a]=(0,Z.useState)(r),[o,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),v=m(N.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{a({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let b=i.enabled!==r.enabled||i.engine!==r.engine||i.lang!==r.lang||i.rate!==r.rate||i.autoRead!==r.autoRead;async function S(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=i.enabled,i.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,i.lang===`auto`?delete n.voiceLang:n.voiceLang=i.lang;let r=Number.parseFloat(i.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,i.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:i.enabled,onCheckedChange:e=>a({...i,enabled:e===!0}),"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(G,{value:i.engine,onValueChange:e=>a({...i,engine:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(X,{value:`browser`,children:I()}),e.kind===`hermes`?null:(0,Q.jsx)(X,{value:`gateway`,children:c()})]})]})]}),i.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()}):null,i.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:M()}),(0,Q.jsxs)(G,{value:i.lang,onValueChange:e=>a({...i,lang:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":M(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()}),(0,Q.jsxs)(G,{value:i.rate,onValueChange:e=>a({...i,rate:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":f(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),i.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:i.autoRead,onCheckedChange:e=>a({...i,autoRead:e===!0}),disabled:!i.enabled,"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:R()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!b||o===`saving`,onClick:()=>void S(),children:o===`saving`?P():se()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!i.enabled||u,onClick:()=>{let t=Number.parseFloat(i.rate)||1,n=++$;if(g(!1),H(),W(),i.engine!==`gateway`){Se(h(),{lang:be(i.lang,x()),rate:t});return}d(!0),v({instanceName:e.name,text:h()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>d(!1))},children:u?P():re()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,d(!1),H(),W()},children:y()})]}),o===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?F():ee()}):null]})}function Ae({stt:e}){let t=L(N.me.getMe,{host:Ee}),n=D(N.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:w()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?a():A()}),(0,Q.jsx)(q,{variant:r?`secondary`:`destructive`,children:r?j():C()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":o()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:te()})]})}function je(){let e=L(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:a}=ge({from:`/settings/voice`}),o=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?E():fe()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?ue():de()})]}),(0,Q.jsxs)(he,{value:a,onValueChange:e=>void o({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(me,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),l()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),w()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),S()]})]}),(0,Q.jsx)(B,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(B,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(B,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:S()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:pe()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=D(N.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":k()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()})]})]})}export{je as VoiceTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,AL as i,An as a,At as o,Bn as s,Ct as c,Dt as l,Fn as u,Ft as d,Gn as f,Hl as ee,Hn as p,IL as m,In as h,It as g,Jn as _,Kn as v,Ln as y,Lt as b,ML as x,Mn as S,Nn as te,Nt as ne,Ot as C,Pn as w,Pt as T,Qn as E,RL as D,Rn as re,St as ie,Tt as O,Un as ae,Vn as oe,Wl as se,Wn as ce,Wt as le,XE as k,Xn as ue,Yn as de,Zn as fe,jn as pe,kn as A,kt as j,qn as M,t as N,ud as P,ut as F,wt as I,zL as L,zn as R}from"./api-EsnGI4EC.js";import{i as z,n as B,r as me,t as he}from"./tabs-D8fO33rb.js";import{t as V}from"./button-CZ9WPf0m.js";import{$t as H,Fn as ge,Jt as _e,Nn as ve,P as U,Pn as ye,Qt as W,Xt as be,Yt as xe,Zt as Se,_t as G,bt as K,en as Ce,gn as we,nn as Te,ut as q,vt as J,wt as Ee,xt as Y,yt as X}from"./index-DdOFgMFG.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>v()],[`fr-FR`,()=>b()],[`en-US`,()=>g()],[`en-GB`,()=>d()],[`de-DE`,()=>T()],[`es-ES`,()=>ne()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>ae()],[`1.25`,()=>p()],[`1.5`,()=>oe()]],$=0;function ke({instance:e}){let t=D(N.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[i,a]=(0,Z.useState)(r),[o,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),v=m(N.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{a({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let b=i.enabled!==r.enabled||i.engine!==r.engine||i.lang!==r.lang||i.rate!==r.rate||i.autoRead!==r.autoRead;async function S(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=i.enabled,i.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,i.lang===`auto`?delete n.voiceLang:n.voiceLang=i.lang;let r=Number.parseFloat(i.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,i.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:i.enabled,onCheckedChange:e=>a({...i,enabled:e===!0}),"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(G,{value:i.engine,onValueChange:e=>a({...i,engine:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(X,{value:`browser`,children:I()}),e.kind===`hermes`?null:(0,Q.jsx)(X,{value:`gateway`,children:c()})]})]})]}),i.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()}):null,i.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:M()}),(0,Q.jsxs)(G,{value:i.lang,onValueChange:e=>a({...i,lang:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":M(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()}),(0,Q.jsxs)(G,{value:i.rate,onValueChange:e=>a({...i,rate:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":f(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),i.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:i.autoRead,onCheckedChange:e=>a({...i,autoRead:e===!0}),disabled:!i.enabled,"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:R()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!b||o===`saving`,onClick:()=>void S(),children:o===`saving`?P():se()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!i.enabled||u,onClick:()=>{let t=Number.parseFloat(i.rate)||1,n=++$;if(g(!1),H(),W(),i.engine!==`gateway`){Se(h(),{lang:be(i.lang,x()),rate:t});return}d(!0),v({instanceName:e.name,text:h()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>d(!1))},children:u?P():re()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,d(!1),H(),W()},children:y()})]}),o===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?F():ee()}):null]})}function Ae({stt:e}){let t=L(N.me.getMe,{host:Ee}),n=D(N.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:w()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?a():A()}),(0,Q.jsx)(q,{variant:r?`secondary`:`destructive`,children:r?j():C()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":o()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:te()})]})}function je(){let e=L(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:a}=ge({from:`/settings/voice`}),o=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?E():fe()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?ue():de()})]}),(0,Q.jsxs)(he,{value:a,onValueChange:e=>void o({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(me,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),l()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),w()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),S()]})]}),(0,Q.jsx)(B,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(B,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(B,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:S()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:pe()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=D(N.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":k()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{H as r,U as i,W as a}from"./index-CsdodIca.js";var o=t(e(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{H as r,U as i,W as a}from"./index-DdOFgMFG.js";var o=t(e(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};