@lacneu/atrium 0.62.1 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/assets/AccessTab-CAsqZ6Oe.js +1 -0
  2. package/dist/assets/AdvancedFilter-CAZse6g9.js +1 -0
  3. package/dist/assets/{AgentFilesTab-C5GaYQ_Y.js → AgentFilesTab-BRgTx-O-.js} +2 -2
  4. package/dist/assets/AnomaliesTab-QOz38Dl8.js +1 -0
  5. package/dist/assets/AuditTab-a5iD6OvB.js +1 -0
  6. package/dist/assets/BridgeTab-De8R_lT4.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-BOt-jkMY.js +1 -0
  8. package/dist/assets/DataTableShell-NMYUihjL.js +1 -0
  9. package/dist/assets/DetailChips-2kEsgn1k.js +1 -0
  10. package/dist/assets/FeedbacksTab-CdqQtSm1.js +1 -0
  11. package/dist/assets/{FieldLabel-B4QPoUJd.js → FieldLabel-C647EVei.js} +2 -2
  12. package/dist/assets/FilesTab-DKocgIqP.js +1 -0
  13. package/dist/assets/FilterBar-DHVMse_G.js +1 -0
  14. package/dist/assets/GroupsTab-CBVya3O8.js +1 -0
  15. package/dist/assets/InstancesTab-DaFyjZeq.js +1 -0
  16. package/dist/assets/IntegrationsTab-s2Ug2twA.js +1 -0
  17. package/dist/assets/KpiTab-Bxe5EM3h.js +1 -0
  18. package/dist/assets/PreferencesTab-D150a7hV.js +1 -0
  19. package/dist/assets/ProjectPage-BvCAGro7.js +1 -0
  20. package/dist/assets/ProjectPage-LzMKBi2V.css +1 -0
  21. package/dist/assets/PromptInjectionsTab-DcP-BjeV.js +4 -0
  22. package/dist/assets/RolesTab-DgNPzDM1.js +1 -0
  23. package/dist/assets/ScheduledTab-xwd7u-vS.js +1 -0
  24. package/dist/assets/ServiceAccountsTab-BPH6depc.js +1 -0
  25. package/dist/assets/SubAgentReportsTab-BPYm-SSC.js +1 -0
  26. package/dist/assets/ThemeShowroom-DfNiNZX7.js +1 -0
  27. package/dist/assets/TimeRangePicker-Dtw6LWMh.js +1 -0
  28. package/dist/assets/TracesTab-yLnuqGC_.js +1 -0
  29. package/dist/assets/UsersTab-CopN-6p5.js +1 -0
  30. package/dist/assets/VoiceTab-C0oik6ML.js +1 -0
  31. package/dist/assets/{button-Ew8nYfum.js → button-Bz9USCnz.js} +1 -1
  32. package/dist/assets/{card-DsVS4SLV.js → card-DKADL750.js} +1 -1
  33. package/dist/assets/check-Wm4Ks3tL.js +1 -0
  34. package/dist/assets/chevron-up-BFinjgRw.js +1 -0
  35. package/dist/assets/chevrons-up-down-DKu9IjDi.js +1 -0
  36. package/dist/assets/{compatView-DIxFDrmB.js → compatView-BHdx-XYA.js} +1 -1
  37. package/dist/assets/confTabs-hdeEtaLm.css +1 -0
  38. package/dist/assets/{dispatchErrorInfo-Bk3nl1aq.js → dispatchErrorInfo-oI5p4wEL.js} +1 -1
  39. package/dist/assets/dist-DiGkpPjG.js +1 -0
  40. package/dist/assets/dist-_9JGogtQ.js +44 -0
  41. package/dist/assets/{dist-ByfMfLx3.js → dist-xYoBFyN7.js} +1 -1
  42. package/dist/assets/{highlighted-body-OFNGDK62-CmRSAAz2.js → highlighted-body-OFNGDK62-DSCsm23K.js} +1 -1
  43. package/dist/assets/index-CjUx3yzx.css +1 -0
  44. package/dist/assets/index-DIc5ekpE.js +238 -0
  45. package/dist/assets/mermaid-GHXKKRXX-BsmnBvV3.js +1 -0
  46. package/dist/assets/{pdf-D5NQzcmE.js → pdf-D0Fddibm.js} +1 -1
  47. package/dist/assets/roleDescriptions-5AP7N2O_.js +1 -0
  48. package/dist/assets/{table-C4Hh9u_l.js → table-C8QBboJq.js} +1 -1
  49. package/dist/assets/{tabs-0D2gasCk.js → tabs-DSFq9Jhc.js} +1 -1
  50. package/dist/assets/x-CfJhGjMr.js +1 -0
  51. package/dist/index.html +9 -8
  52. package/package.json +1 -1
  53. package/dist/assets/AccessTab--VqMu03T.js +0 -1
  54. package/dist/assets/AdvancedFilter-D6zd0L5Q.js +0 -1
  55. package/dist/assets/AnomaliesTab-CEpTxqcV.js +0 -1
  56. package/dist/assets/AuditTab-DgKezBIz.js +0 -1
  57. package/dist/assets/BridgeTab-Db3Fo_mk.js +0 -1
  58. package/dist/assets/ChatDefaultsTab-Du2XiR61.js +0 -1
  59. package/dist/assets/DataTableShell-DMFVXfOQ.js +0 -1
  60. package/dist/assets/DetailChips-Cv722Djz.js +0 -1
  61. package/dist/assets/FeedbacksTab-CDhunzCw.js +0 -1
  62. package/dist/assets/FilesTab-Bdn4Tvqv.js +0 -1
  63. package/dist/assets/FilterBar-BaqVZ-JQ.js +0 -1
  64. package/dist/assets/GroupsTab-CCESqSzH.js +0 -1
  65. package/dist/assets/InstancesTab-CWOk0g4N.js +0 -1
  66. package/dist/assets/IntegrationsTab-4LOj-Ni_.js +0 -1
  67. package/dist/assets/KpiTab-DsgCrpnk.js +0 -1
  68. package/dist/assets/PreferencesTab-D8vFStwH.js +0 -1
  69. package/dist/assets/PromptInjectionsTab-BfKhvZll.js +0 -4
  70. package/dist/assets/RolesTab-CiFKtKmf.js +0 -1
  71. package/dist/assets/ScheduledTab-Zw2o6w8y.js +0 -1
  72. package/dist/assets/ServiceAccountsTab-hb25MXEz.js +0 -1
  73. package/dist/assets/SubAgentReportsTab-Cwu-39cc.js +0 -1
  74. package/dist/assets/ThemeShowroom-BWdIRzrU.js +0 -1
  75. package/dist/assets/TimeRangePicker-Bv-U6Bo1.js +0 -1
  76. package/dist/assets/TracesTab-B00Q2CXy.js +0 -1
  77. package/dist/assets/UsersTab-4qigDhcD.js +0 -1
  78. package/dist/assets/VoiceTab-CliAEaTM.js +0 -1
  79. package/dist/assets/chevrons-up-down-jkl77XwS.js +0 -1
  80. package/dist/assets/confTabs-C35Io1ep.css +0 -1
  81. package/dist/assets/dist-Bk4bPGS8.js +0 -1
  82. package/dist/assets/dist-Bkkp8jtC.js +0 -44
  83. package/dist/assets/dist-CqLvr3pk.js +0 -1
  84. package/dist/assets/index-gP_wjUtq.js +0 -238
  85. package/dist/assets/index-jScX6cAP.css +0 -2
  86. package/dist/assets/mermaid-GHXKKRXX-eLH6oHko.js +0 -1
  87. package/dist/assets/roleDescriptions-CSbRqH5d.js +0 -1
  88. package/dist/assets/x-BqwVyymF.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$j as r,AM as i,Aj as a,BM as o,Bj as s,CM as c,Cj as l,D as u,DF as d,DM as f,Dj as p,E as m,EF as h,EM as g,Ej as ee,FF as _,FM as v,Fj as te,Fo as ne,Gj as re,HM as ie,Hj as ae,IM as oe,Ij as se,Io as ce,Jj as le,Kj as ue,LF as y,LM as de,Lj as fe,Lo as b,MM as x,Mj as pe,NM as me,Nj as he,OM as ge,Oj as S,PM as _e,Pj as ve,Qj as ye,RF as C,RM as be,Rj as xe,Ro as w,SM as Se,Sj as Ce,T,TF as we,TM as Te,Tj as Ee,Uj as De,VM as Oe,Vj as ke,Wj as Ae,Xj as je,Yj as Me,Zj as Ne,_M as Pe,aM as E,bM as Fe,bj as Ie,cM as Le,dM as Re,eM as ze,fM as Be,gM as Ve,hM as He,iM as Ue,jM as We,jj as Ge,kM as Ke,kj as qe,lM as Je,mM as Ye,nM as Xe,oM as Ze,pM as Qe,qj as $e,rM as et,sM as tt,tM as nt,uM as rt,vM as it,wM as at,wj as ot,xM as st,xj as ct,yM as lt,zM as ut,zj as dt}from"./dist-Bkkp8jtC.js";import{n as D}from"./dist-Bk4bPGS8.js";import{t as O}from"./x-BqwVyymF.js";import{t as k}from"./button-Ew8nYfum.js";import{G as A,J as ft,K as pt,U as mt,W as ht,X as j,Xt as gt,Y as M,Yt as N,ct as P,dt as _t,ft as vt,gt as F,lt as I,m as L,ot as R,q as z,st as B,ut as V}from"./index-gP_wjUtq.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-DsVS4SLV.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-C4Hh9u_l.js";import{t as kt}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as At}from"./FilterBar-BaqVZ-JQ.js";import{t as jt}from"./AdvancedFilter-D6zd0L5Q.js";var G=u(`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(De());if(e.size>zt)throw Error(ae());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),c=Math.max(1,Math.round(r*o)),l=Math.max(1,Math.round(i*o)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(s());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Ft(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(s());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);q(e.data,f.width,f.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),m.putImageData(e,0,0)}let h=q(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Ht)??await Y(p,`image/png`);if(!g)throw Error(dt());return{blob:g,hasAlpha:h}}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(ke())),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`?d():e===`dark`?h():we()}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:m(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,X.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(T.charts.listMyCharts),r=y(T.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:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:x(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?i():n.via===`owner`?Ke():ge({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:f()}):null]})}function Qt(){let e=y(T.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(E())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(et());return}let a;try{a=JSON.parse(r)}catch{o(E());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!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:Qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(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:Re()}),(0,X.jsx)(j,{value:t,onChange:e=>n(e.target.value),placeholder:rt(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Le(),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`}),tt(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:l,onClick:()=>void f(),children:Ze()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ue()}):null]})]})}function $t({chart:e}){let t=_(T.charts.setChartLogo),n=y(T.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`?je():Me()}),(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?$e():le(),(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:re()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:ue()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ne()}),(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:Ae()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(T.me.getMe,{host:F}),n=y(T.charts.addChartDomain),r=y(T.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:xe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ve()}):u.map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":he({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{value:i,onChange:e=>a(e.target.value),placeholder:se(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:te()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:fe()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=y(T.charts.updateChart),n=y(T.charts.deleteChart),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(e.name),[l,u]=(0,K.useState)(()=>tn(e.tokens)),[d,f]=(0,K.useState)(e.tokens.bpm??0),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1);function ee(){c(e.name),u(tn(e.tokens)),f(e.tokens.bpm??0),m(null),o(!0)}async function _(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(l)}catch{m(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;d>0?e.bpm=d:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:s.trim(),tokens:n}),o(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(S()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:ee,children:r()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ye()})]})})]}),i?(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:a()}),(0,X.jsx)(j,{value:s,onChange:e=>c(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:d,onChange:e=>f(Number(e.target.value)),"aria-label":b()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:d===0?ce():`${d} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:l,onChange:e=>u(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:h,onClick:()=>void _(),children:pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>o(!1),children:Ge()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=C(T.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:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()}):(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=y(T.charts.addChartToGroupPool),r=y(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(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)(M,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?lt():e.kind===`custom`&&e.scope===`personal`?ot():Fe()}),e.isGlobalDefault?(0,X.jsx)(M,{variant:`default`,children:it()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ve()}),(a??[]).map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ye({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(V,{placeholder:He()})}),(0,X.jsx)(B,{children:s.map(e=>(0,X.jsx)(P,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Pe()}):null]})]})}function on({chart:e}){let t=y(T.charts.promoteChartToCommon),n=y(T.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(S()))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)(M,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?l():ot()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ee({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:Ce()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ct()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=y(T.admin.setDefaultThemeMode),i=y(T.admin.setDefaultLocale),a=y(T.charts.setDefaultChart),s=C(T.charts.listChartsAdmin),l=C(T.groups.listGroups,{}),u=e??`system`,d=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(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:g()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(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:x()}),vt.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:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(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:l??[]},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:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(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:p()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()}):(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:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:u===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:o()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()})]})]})}function cn(){let e=C(T.me.getMe,{host:F}),t=_t(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:de()}),(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)(N,{})}),(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)(M,{children:`Default`}),(0,X.jsx)(M,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(M,{variant:`outline`,children:`Outline`}),(0,X.jsx)(M,{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)(j,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(V,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(P,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(L,{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)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:Z,children:`Toutes directions`}),(0,X.jsx)(P,{value:`inbound`,children:`inbound`}),(0,X.jsx)(P,{value:`outbound`,children:`outbound`}),(0,X.jsx)(P,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(P,{value:`info`,children:`info`}),(0,X.jsx)(P,{value:`warn`,children:`warn`}),(0,X.jsx)(P,{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)(mt,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(z,{}),(0,X.jsx)(A,{children:`Edit`}),(0,X.jsx)(A,{children:`Duplicate`}),(0,X.jsx)(z,{}),(0,X.jsx)(A,{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)(L,{"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)(L,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(M,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ag as r,Cg as i,Dg as a,Eg as o,Fi as s,Ii as c,Li as l,Mg as u,Mi as d,Ng as f,Ni as p,Og as m,Pi as h,Sg as g,Tg as _,jg as v,ji as y,kg as b,wg as x,xg as S}from"./dist-Bkkp8jtC.js";import{t as C}from"./button-Ew8nYfum.js";import{Qt as w,Rt as T,V as E,X as D,_t as O,bt as k,vt as A,yt as j}from"./index-gP_wjUtq.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:f(),from:`now-5m`},{label:u(),from:`now-15m`},{label:v(),from:`now-30m`},{label:r(),from:`now-1h`},{label:b(),from:`now-3h`},{label:m(),from:`now-6h`},{label:a(),from:`now-12h`},{label:o(),from:`now-24h`},{label:_(),from:`now-2d`},{label:x(),from:`now-7d`},{label:i(),from:`now-30d`},{label:g(),from:`now-90d`},{label:S(),from:`now-520w`}];function L(e){return E(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),[i,a]=(0,M.useState)(``),o=F(e),[u,f]=(0,M.useState)(()=>z(o.from)),[m,g]=(0,M.useState)(()=>z(o.to));function _(t){if(t){let t=F(e);f(z(t.from)),g(z(t.to)),a(``)}r(t)}function v(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function b(){let e=B(u),n=B(m);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let x=(0,M.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),S=B(u)!==null&&B(m)!==null;return(0,H.jsxs)(j,{open:n,onOpenChange:_,children:[(0,H.jsx)(k,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(w,{}),R(e)]})}),(0,H.jsx)(A,{children:(0,H.jsx)(O,{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:l()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,H.jsx)(D,{type:`datetime-local`,value:u,onChange:e=>f(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:s()}),(0,H.jsx)(D,{type:`datetime-local`,value:m,onChange:e=>g(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:b,children:h()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(T,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(D,{value:i,onChange:e=>a(e.target.value),placeholder:p(),"aria-label":d()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:y()}):x.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>v(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AE as r,Ay as i,BE as a,CE as o,Cy as s,D as c,Dy as l,Ey as u,FE as d,Fy as f,GE as p,HE as m,IE as h,Iy as g,JE as _,KE as v,LE as ee,LF as y,Ly as te,ME as b,Mr as x,My as S,NE as C,Nr as w,Ny as ne,OE as T,Oy as re,PE as E,Pr as ie,Py as ae,QE as oe,RE as se,RF as D,Ry as ce,SE as le,Sy as ue,T as O,Ty as de,UE as k,VE as fe,WE as pe,XE as A,YE as j,ZE as M,_E as me,_y as he,ay as ge,bE as _e,by as ve,cy as ye,dE as be,dy as xe,ey as N,fE as P,fy as Se,gE as F,gy as Ce,hE as we,hy as Te,iy as Ee,jE as De,jy as Oe,kE as I,ky as ke,lE as Ae,ly as je,mE as Me,my as Ne,ny as Pe,oy as Fe,pE as Ie,py as Le,qE as Re,ry as ze,sy as Be,ty as Ve,uE as He,uy as Ue,vE as We,vy as Ge,wy as Ke,xE as qe,xy as Je,yE as Ye,yy as Xe,zE as L}from"./dist-Bkkp8jtC.js";import{n as Ze}from"./dist-Bk4bPGS8.js";import{t as Qe}from"./x-BqwVyymF.js";import{i as R,n as z,r as $e,t as et}from"./tabs-0D2gasCk.js";import{t as B}from"./button-Ew8nYfum.js";import{$ as tt,D as nt,H as rt,Jt as it,Q as at,V,Y as H,Z as ot,Zt as st,a as ct,ct as U,gt as lt,i as ut,in as dt,lt as W,nt as ft,o as pt,ot as G,qt as mt,rn as ht,s as gt,st as K,tt as _t,ut as q}from"./index-gP_wjUtq.js";import{n as vt}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as yt}from"./FilterBar-BaqVZ-JQ.js";import{t as bt}from"./AdvancedFilter-D6zd0L5Q.js";import{t as xt}from"./DataTableShell-DMFVXfOQ.js";var St=c(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?C():n===`agent`?`${b()} - ${r}`:e}function Tt(){let e=D(O.me.getMe,{host:lt})?.role===`admin`,t=D(O.deliveryTiming.getDeliveryStatus,{}),n=y(O.deliveryTiming.startDeliveryRecord),r=y(O.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:oe()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?j():A()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(H,{variant:`secondary`,children:_()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Re({time:rt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?pe():p()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=D(O.deliveryTiming.listDeliverySessions,{}),n=y(O.deliveryTiming.deleteDeliverySessions),[i,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[f,p]=(0,J.useState)(null),{from:g,to:_}=vt(l),v=l.to===`now`?1/0:_,te=i.trim()!==``||s!==`all`||l!==X,b=()=>{o(``),c(`all`),u(X)},x=(0,J.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=g&&t.startedAt<=v).map(e=>({...e,_id:e.sessionId}))},[t,i,s,g,v]),S=e=>{let t=new Set((x??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&p(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:i,onQChange:o,searchPlaceholder:m(),timeRange:l,onTimeRangeChange:u,onReset:b,canReset:te,children:(0,Y.jsxs)(G,{value:s,onValueChange:e=>c(e),children:[(0,Y.jsx)(W,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:`all`,children:fe()}),(0,Y.jsx)(U,{value:`active`,children:a()}),(0,Y.jsx)(U,{value:`stopped`,children:L()})]})]})}),(0,Y.jsx)(xt,{title:k(),rows:x,emptyHint:He(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?r():De(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(it,{size:15,"aria-hidden":!0})})},{header:se(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:V(e.startedAt)})},{header:ee(),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:V(e.stoppedAt)})},{header:h(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:d(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:E(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:a()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:L()})}],rowActions:e?e=>[{label:I(),variant:`destructive`,onSelect:()=>S([e.sessionId])}]:void 0,bulkActions:e?[{label:I(),variant:`destructive`,onSelect:e=>S(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=D(O.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(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:T()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:v()});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,` `,Ae()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(st,{size:13,"aria-hidden":!0}),t?be():P()]})]}),(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:qe()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:_e()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ye()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(We(),r.bridge),i(me(),r.A),i(F(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:we()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Me()})]})}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:ie()},{value:`principalType`,label:w()},{value:`direction`,label:`direction`},{value:`roleKey`,label:x()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=dt({from:`/settings/traces`}),t=ht({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,c=e.principalType??Q,d=e.direction??Q,p=e.roleKey??Q,m=e.q??``,h=ut(e.from,e.to),_=(0,J.useMemo)(()=>gt(e.adv),[e.adv]),{from:v,to:ee}=vt(h),[y,b]=(0,J.useState)(null),[x,C]=(0,J.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),T=e=>void t({search:t=>({...t,kind:e})}),E=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),se=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,...pt(e)})}),pe=e=>void t({search:t=>({...t,adv:ct(e)}),replace:!0}),A=D(O.observability.listEvents,{limit:n}),j=D(O.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:m||void 0,from:v,to:ee,statusClass:a===Q?void 0:a,principalType:c===Q?void 0:c,direction:d===Q?void 0:d,roleKey:p===Q?void 0:p,advanced:_.length>0?_:void 0}}),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),me=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),_e=m!==``||a!==Q||c!==Q||d!==Q||p!==Q||_.length>0||h.kind!==`relative`||h.from!==Pt.from;function be(){t({search:{limit:100,kind:`all`},replace:!0})}let N=y?A?.filter(e=>e.correlationId===y):j,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(mt,{size:13,"aria-hidden":!0}),o()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),le()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ce(),(0,Y.jsx)(`strong`,{children:te()}),g(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:f()})]}),(0,Y.jsxs)(yt,{q:m,onQChange:E,searchPlaceholder:ae(),timeRange:h,onTimeRangeChange:fe,onReset:be,canReset:_e,children:[(0,Y.jsxs)(G,{value:a,onValueChange:ie,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ne()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:S()}),jt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:c,onValueChange:oe,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:Oe()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:i()}),Mt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:d,onValueChange:se,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ke()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:p,onValueChange:k,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{placeholder:l()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:u()}),me.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:r,onValueChange:T,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(q,{placeholder:de()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:At,children:Ke()}),M.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,Y.jsx)(W,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(q,{})}),(0,Y.jsx)(K,{children:kt.map(e=>(0,Y.jsx)(U,{value:String(e),children:s({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:_,onChange:pe}),y?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:ue(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Je(),(0,Y.jsx)(`code`,{children:$(y)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:ve()})]})}):null,(0,Y.jsx)(xt,{title:Xe(),rows:N,emptyHint:y?Ge():he(),columns:[{header:Ce(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:V(e.at)})},{header:Te(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{variant:`secondary`,children:e.kind})},{header:Ne(),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":Le(),children:`✓`})}},{header:Se(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:xe(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(H,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Ue(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(H,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),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:ye(),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:Be(),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:Fe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ge(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ee(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ze()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:x,onClose:()=>C(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)(ot,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(at,{className:`max-w-lg`,children:[(0,Y.jsxs)(_t,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:Ve()})]}),(0,Y.jsx)(tt,{children:N()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,Bd as i,Cv as a,Cw as o,Ev as s,Ew as c,LF as l,NC as u,QC as d,RF as f,Sv as p,Sw as m,T as h,Tv as g,Tw as _,Vd as v,_v as y,_w as b,aw as ee,bv as x,bw as te,cw as ne,dw as re,ew as ie,fw as ae,gv as S,gw as C,hv as w,hw as T,iw as oe,lw as se,mv as E,mw as ce,nw as le,ow as ue,pw as de,rw as fe,sw as pe,tw as me,uw as he,vv as D,vw as ge,wv as O,ww as k,xv as A,xw as _e,yv as j,yw as ve,zd as M}from"./dist-Bkkp8jtC.js";import{t as N}from"./button-Ew8nYfum.js";import{$ as P,A as F,G as I,It as L,J as ye,K as be,Lt as R,Q as xe,U as Se,W as Ce,Y as z,Z as we,c as B,ct as V,gt as Te,in as Ee,j as De,l as Oe,lt as H,m as U,nt as ke,ot as W,rn as Ae,st as G,tt as je,u as K,ut as q,wt as J}from"./index-gP_wjUtq.js";import{t as Y}from"./FilterBar-BaqVZ-JQ.js";import{t as Me}from"./DataTableShell-DMFVXfOQ.js";import{t as Ne}from"./DetailChips-Cv722Djz.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=f(h.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=f(h.agents.listUserAgents,n&&e?{profileId:e}:`skip`),c=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),l=(o??[]).find(e=>e.isDefault)??null,u=l?`${l.instanceName}/${l.agentId}`:null,d=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),m=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!d.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}))],_=new Map;for(let e of m){let t=_.get(e.instanceName)??[];t.push(e),_.set(e.instanceName,t)}return(0,Z.jsx)(we,{open:n,onOpenChange:r,children:(0,Z.jsxs)(xe,{className:`oc-access`,children:[(0,Z.jsxs)(je,{children:[(0,Z.jsx)(ke,{children:s({user:t})}),(0,Z.jsx)(P,{children:g()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?O():a()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:p()}):m.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:j()}):[..._.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:c,defaultKey:u},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=l(h.agents.assignAgent),s=l(h.agents.removeAgent),c=l(h.agents.setDefaultAgent),u=J();if(!e)return null;async function d(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(A(),e)}}async function f(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(x(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(R,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(U,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":D({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,e.outOfPool?(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":w(),title:w(),children:(0,Z.jsx)(L,{size:14,fill:`currentColor`})}):(0,Z.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":E(),title:E(),disabled:c,onClick:()=>void f(e.agentId),children:(0,Z.jsx)(L,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return M();case`user`:return i();case`admin`:return v();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=B.filter(e=>n.has(K[e])).length;return(0,Z.jsxs)(Se,{children:[(0,Z.jsx)(ye,{asChild:!0,children:(0,Z.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?c():_({count:r})})}),(0,Z.jsxs)(Ce,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(be,{children:k()}),B.map(e=>{let r=K[e];return(0,Z.jsxs)(I,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(U,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Oe[e]()})]},e)})]})]})}function Le(){let e=Ee({from:`/settings/users`}),t=Ae({from:`/settings/users`}),n=e.q??``,i=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),c=f(h.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),p=f(h.me.getMe,{host:Te}),g=l(h.admin.setRole),_=l(h.admin.setUserPermissions),v=l(h.admin.startImpersonation),y=l(h.admin.deleteUser),x=l(h.admin.setUserName),S=F(),w=De(),E=J(),[D,O]=(0,X.useState)(null),k=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of c??[])e.add(t.role);return[...e]},[c]),A=n!==``||i!==Q;function j(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){E.error(o(),e)}}async function N(e){try{await _(e)}catch(e){E.error(m(),e)}}async function P(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await S({title:T(),description:ce({user:t}),confirmWord:de(),confirmLabel:ae(),destructive:!0}))try{await y({profileId:e._id}),E.success(he({user:t}))}catch(e){E.error(re(),e)}}async function I(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:ne(),label:pe({user:t}),placeholder:ue(),defaultValue:e.name??``,confirmLabel:u()});if(n!==null)try{await x({profileId:e._id,name:n}),E.success(ee())}catch(e){E.error(oe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:a,searchPlaceholder:_e(),onReset:j,canReset:A,children:(0,Z.jsxs)(W,{value:i,onValueChange:s,children:[(0,Z.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(V,{value:Q,children:te()}),k.map(e=>(0,Z.jsx)(V,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ve(),rows:c,emptyHint:ge(),rowActions:e=>{let t=[{label:d(),onSelect:()=>O({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:se(),onSelect:()=>void I(e)}];return e.userId!==p?.userId&&t.push({label:b(),onSelect:()=>void v({profileId:e._id})},{label:C(),variant:`destructive`,onSelect:()=>void P(e)}),t},columns:[{header:fe(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:le(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(W,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(V,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(V,{value:`user`,children:$(`user`)}),(0,Z.jsx)(V,{value:`admin`,children:$(`admin`)})]})]})},{header:me(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ie()}):(0,Z.jsx)(Ie,{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:r(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(R,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:D?.profileId??null,userLabel:D?.label??``,open:D!==null,onOpenChange:e=>{e||O(null)}})]})}export{Le as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,$u as i,AT as a,An as o,At as s,Bn as c,Ct as ee,Dt as l,FF as u,Fn as d,Ft as f,Gn as p,Hn as m,In as h,It as g,Jn as _,Kn as v,LF as y,Ln as b,Lt as x,Mn as S,Nl as te,Nn as ne,Nt as re,Ot as ie,Pn as C,Pt as w,Qn as ae,RF as T,Rn as E,St as D,T as O,Tt as k,Un as oe,Vn as se,Wn as ce,Wt as le,Xn as ue,Yn as de,Zn as fe,jF as pe,jl as A,jn as j,kF as M,kn as N,kt as P,qn as F,ut as I,wt as L,zn as R}from"./dist-Bkkp8jtC.js";import{i as z,n as B,r as me,t as he}from"./tabs-0D2gasCk.js";import{t as V}from"./button-Ew8nYfum.js";import{At as H,Dt as ge,Et as _e,Nt as ve,Ot as ye,Tt as be,Wt as xe,Y as U,ct as W,gt as Se,in as Ce,jt as we,kt as G,lt as K,m as q,nn as Te,ot as J,rn as Ee,st as Y,ut as X}from"./index-gP_wjUtq.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>v()],[`fr-FR`,()=>x()],[`en-US`,()=>g()],[`en-GB`,()=>f()],[`de-DE`,()=>w()],[`es-ES`,()=>re()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>oe()],[`1.25`,()=>m()],[`1.5`,()=>se()]],$=0;function ke({instance:e}){let t=y(O.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(r),[s,l]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(!1),v=u(O.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let x=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function S(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),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)(U,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,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:k()}),(0,Q.jsxs)(J,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":k(),children:(0,Q.jsx)(X,{})}),(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(W,{value:`browser`,children:L()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:F()}),(0,Q.jsxs)(J,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":F(),children:(0,Q.jsx)(X,{})}),(0,Q.jsx)(Y,{children:De.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()}),(0,Q.jsxs)(J,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":p(),children:(0,Q.jsx)(X,{})}),(0,Q.jsx)(Y,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":c()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]}),(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:!x||s===`saving`,onClick:()=>void S(),children:s===`saving`?i():te()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(g(!1),H(),G(),a.engine!==`gateway`){ye(h(),{lang:ge(a.lang,pe()),rate:t});return}f(!0),v({instanceName:e.name,text:h()}).then(({mime:e,audioBase64:r})=>{n===$&&_e(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>f(!1))},children:d?i():E()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),H(),G()},children:b()})]}),s===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?I():A()}):null]})}function Ae({stt:e}){let t=T(O.me.getMe,{host:Se}),n=y(O.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:C()}),(0,Q.jsx)(U,{variant:e?`secondary`:`outline`,children:e?o():N()}),(0,Q.jsx)(U,{variant:r?`secondary`:`destructive`,children:r?P():ie()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()})]})}function je(){let e=T(O.admin.listInstances,{}),t=(0,Z.useMemo)(()=>we(),[]),n=(0,Z.useMemo)(()=>be(),[]),{section:i}=Ce({from:`/settings/voice`}),a=Ee({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)(U,{variant:t?`secondary`:`destructive`,children:t?ae():fe()}),(0,Q.jsx)(U,{variant:n?`secondary`:`destructive`,children:n?ue():de()})]}),(0,Q.jsxs)(he,{value:i,onValueChange:e=>void a({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)(ve,{size:13,"aria-hidden":!0}),l()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(xe,{size:13,"aria-hidden":!0}),C()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{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:M()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):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:j()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=y(O.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)(U,{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)(q,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":a()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./dist-Bkkp8jtC.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +0,0 @@
1
- .oc-afiles{flex-direction:column;gap:.75rem;display:flex}.oc-afiles__picker{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.oc-afiles__list{border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;display:flex;overflow:hidden}.oc-afiles__row{border-bottom:1px solid var(--border);align-items:center;gap:.75rem;padding:.5rem .75rem;font-size:.85rem;display:flex}.oc-afiles__row:last-child{border-bottom:none}.oc-afiles__name{text-overflow:ellipsis;white-space:nowrap;flex:0 0 10rem;font-weight:500;overflow:hidden}.oc-afiles__size{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 4.5rem}.oc-afiles__gauge{background:var(--muted);border-radius:999px;flex:6rem;height:.375rem;overflow:hidden}.oc-afiles__gauge-fill{border-radius:inherit;background:var(--primary);height:100%;display:block}.oc-afiles__gauge.is-warn .oc-afiles__gauge-fill{background:var(--destructive)}.oc-afiles__pct{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 3rem}.oc-afiles__warn{color:var(--destructive);flex:none}.oc-afiles__warn-slot{flex:none;width:14px}.oc-afiles__open{margin-left:auto}.oc-afiles__budget{color:var(--muted-foreground);font-size:.8rem}.oc-afiles__error,.oc-cdefaults__error{color:var(--destructive);align-items:center;gap:.5rem;font-size:.85rem;display:flex}[data-slot=dialog-content].oc-afiles__editor{flex-direction:column;width:calc(100vw - 2rem);max-width:72rem;height:calc(100vh - 2rem);max-height:none;display:flex}.oc-afiles__source{resize:none;min-height:0;font-family:var(--font-mono,ui-monospace, monospace);border:1px solid var(--border);border-radius:var(--radius);background:var(--background);color:var(--foreground);flex:auto;padding:.75rem;font-size:.8rem;line-height:1.5}.oc-afiles__source:focus-visible{outline:2px solid var(--ring);outline-offset:-1px}.oc-afiles__hint{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__editor-foot{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.oc-afiles__count{color:var(--muted-foreground);font-variant-numeric:tabular-nums;font-size:.8rem}.oc-afiles__count.is-over{color:var(--destructive);font-weight:600}.oc-afiles__diff{flex-direction:column;gap:.5rem;max-height:14rem;display:flex;overflow-y:auto}.oc-afiles__diff-counts{font-size:.85rem;font-weight:500}.oc-afiles__diff-block{flex-direction:column;gap:.125rem;display:flex}.oc-afiles__diff-label{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__diff-line{border-radius:calc(var(--radius) / 2);white-space:pre-wrap;word-break:break-word;padding:.125rem .375rem;font-size:.75rem}.oc-afiles__diff-line.is-add{background:color-mix(in oklab, var(--primary) 12%, transparent)}.oc-afiles__diff-line.is-del{background:color-mix(in oklab, var(--destructive) 12%, transparent);text-decoration:line-through}.oc-cdefaults{flex-direction:column;gap:.75rem;max-width:36rem;display:flex}.oc-cdefaults__row{border-bottom:1px solid var(--border);flex-direction:column;gap:.375rem;padding:.625rem 0;display:flex}.oc-cdefaults__label{font-size:.85rem;font-weight:500}.oc-cdefaults__help,.oc-cdefaults__note{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cdefaults__actions{justify-content:flex-end;display:flex}.oc-voice__support{flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;display:flex}.oc-voice__card{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);flex-direction:column;gap:.6rem;margin-bottom:.9rem;padding:.9rem 1rem;display:flex}.oc-voice__cardhead{align-items:center;gap:.6rem;display:flex}.oc-voice__instance{font-weight:600}.oc-voice__row{align-items:center;gap:.75rem;display:flex}.oc-voice__row .oc-cdefaults__label{min-width:10rem}
@@ -1 +0,0 @@
1
- import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{D as n}from"./dist-Bkkp8jtC.js";var r=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=t(e(),1);function a(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as n,a as t};