@lacneu/atrium 0.30.1 → 0.32.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 (74) hide show
  1. package/README.md +15 -7
  2. package/dist/assets/{AccessTab-CUrhYOD-.js → AccessTab-D4e7sR36.js} +1 -1
  3. package/dist/assets/{AdvancedFilter-BM-NsfWQ.js → AdvancedFilter-BruZmihw.js} +1 -1
  4. package/dist/assets/AgentFilesTab-BkJP6wns.js +3 -0
  5. package/dist/assets/AnomaliesTab-DWscg89L.js +1 -0
  6. package/dist/assets/AuditTab-D0Wedb1v.js +1 -0
  7. package/dist/assets/BridgeTab-C3V0alh4.js +1 -0
  8. package/dist/assets/ChatDefaultsTab-DvXAKUwq.js +1 -0
  9. package/dist/assets/{DataTableShell-DBDIF654.js → DataTableShell-DX6BeIdv.js} +1 -1
  10. package/dist/assets/{DetailChips-eDCHm7fV.js → DetailChips-DEmmi2OP.js} +1 -1
  11. package/dist/assets/FeedbacksTab-D-GXqU4B.js +1 -0
  12. package/dist/assets/FieldLabel-JjysLGoF.js +38 -0
  13. package/dist/assets/FilesTab-DCKOgdaA.js +1 -0
  14. package/dist/assets/{FilterBar-egrudkw6.js → FilterBar-DaPqbYlS.js} +1 -1
  15. package/dist/assets/GroupsTab-D5ES5Ud8.js +1 -0
  16. package/dist/assets/InstancesTab-B0pZvNmW.js +1 -0
  17. package/dist/assets/IntegrationsTab-CqJfXR9z.js +1 -0
  18. package/dist/assets/{KpiTab-BW9nVj-Y.js → KpiTab-Dvvt84nD.js} +1 -1
  19. package/dist/assets/PreferencesTab-BE4ACEs8.js +1 -0
  20. package/dist/assets/PromptInjectionsTab-WJ5pfSFJ.js +4 -0
  21. package/dist/assets/RolesTab-CJJaeVgk.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-B8kVXJ46.js +1 -0
  23. package/dist/assets/SubAgentReportsTab-DMoB3156.js +1 -0
  24. package/dist/assets/ThemeShowroom-YuvACoB7.js +1 -0
  25. package/dist/assets/{TimeRangePicker-CjeAiSdk.js → TimeRangePicker-BGMAlmom.js} +1 -1
  26. package/dist/assets/TracesTab-D2MjU6w8.js +1 -0
  27. package/dist/assets/UsersTab-D2y50PeG.js +1 -0
  28. package/dist/assets/{button-CcNQBW08.js → button-0kksS-se.js} +1 -1
  29. package/dist/assets/{card-B9JuMxhP.js → card-DLmrH_wl.js} +1 -1
  30. package/dist/assets/chevrons-up-down-Cvv3i-sc.js +1 -0
  31. package/dist/assets/{compatView-aBtPNegs.js → compatView-CAGz-_Jd.js} +1 -1
  32. package/dist/assets/curation-CQksaIbm.js +1 -0
  33. package/dist/assets/dispatchErrorInfo-DKlnpjsd.js +1 -0
  34. package/dist/assets/dist-BurVRsW0.js +1 -0
  35. package/dist/assets/{dist-BhnVOFIn.js → dist-C-3gq7wS.js} +1 -1
  36. package/dist/assets/dist-CdSwEQWH.js +44 -0
  37. package/dist/assets/{dist-CNxV6qRL.js → dist-nAUDMYxE.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-CcH-KtiT.js → highlighted-body-OFNGDK62-BA8RVPgm.js} +1 -1
  39. package/dist/assets/{index-BARs9CRG.css → index-CzWyoOI1.css} +1 -1
  40. package/dist/assets/index-H4lBiMmR.js +229 -0
  41. package/dist/assets/mermaid-GHXKKRXX-aX3bC-kI.js +1 -0
  42. package/dist/assets/roleDescriptions-CizW5_c4.js +1 -0
  43. package/dist/assets/{table-DAtXjw2C.js → table-CeOSuZF-.js} +1 -1
  44. package/dist/assets/{tabs-BHYINAjr.js → tabs-Czyis8Bg.js} +1 -1
  45. package/dist/assets/x-D7klnZcV.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AgentFilesTab-Dq4y_9nj.js +0 -3
  49. package/dist/assets/AnomaliesTab-C40acUCU.js +0 -1
  50. package/dist/assets/AuditTab-7UfsE_38.js +0 -1
  51. package/dist/assets/BridgeTab-CjidRXGN.js +0 -1
  52. package/dist/assets/ChatDefaultsTab-Bl4jU1yW.js +0 -1
  53. package/dist/assets/FeedbacksTab-B40TFMxk.js +0 -1
  54. package/dist/assets/FieldLabel-BxCSPKLD.js +0 -15
  55. package/dist/assets/FilesTab-go4v_nAG.js +0 -1
  56. package/dist/assets/GroupsTab-DPMLiMCc.js +0 -1
  57. package/dist/assets/InstancesTab-KzujA3gD.js +0 -1
  58. package/dist/assets/IntegrationsTab-y61Q2VDy.js +0 -1
  59. package/dist/assets/PreferencesTab-CNpy4JQu.js +0 -1
  60. package/dist/assets/PromptInjectionsTab-CWC7LSmE.js +0 -3
  61. package/dist/assets/RolesTab-DyDQiA_c.js +0 -1
  62. package/dist/assets/ServiceAccountsTab-B6F-47Gm.js +0 -1
  63. package/dist/assets/SubAgentReportsTab-NTWhdI69.js +0 -1
  64. package/dist/assets/ThemeShowroom-B7Z2ffNQ.js +0 -1
  65. package/dist/assets/TracesTab-CFkotfAj.js +0 -1
  66. package/dist/assets/UsersTab-BUX8VYmD.js +0 -1
  67. package/dist/assets/chevrons-up-down-ar6Ygzeq.js +0 -1
  68. package/dist/assets/dispatchErrorInfo-MZJyPS1B.js +0 -1
  69. package/dist/assets/dist-BOukL7gG.js +0 -44
  70. package/dist/assets/dist-GFH_mzhb.js +0 -1
  71. package/dist/assets/index-HZd91gw7.js +0 -229
  72. package/dist/assets/mermaid-GHXKKRXX-D7Hy3m87.js +0 -1
  73. package/dist/assets/roleDescriptions-CxEPrkAY.js +0 -1
  74. package/dist/assets/x-C81gK-RB.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,$t as i,AD as a,AE as o,BD as s,BE as c,CD as l,DD as u,DE as d,Dk as f,ED as p,FD as m,FE as h,FO as g,GD as _,GE as v,HD as y,HE as b,ID as ee,IE as te,JD as ne,JE as re,KD as ie,KE as ae,LD as oe,LE as se,MD as ce,ME as le,ND as ue,NE as de,Nk as x,OD as fe,OE as pe,Ok as me,PD as he,PE as ge,PO as _e,Pk as S,QE as ve,QO as ye,Qt as be,RD as xe,RE as Se,SD as Ce,TD as we,UD as Te,UE as Ee,VD as De,VE as Oe,WD as ke,WE as Ae,XE as je,XO as Me,YD as Ne,YE as Pe,ZE as Fe,ZO as Ie,Zt as Le,_D as Re,aD as ze,bD as Be,cD as Ve,dD as He,eD as Ue,en as C,fD as w,gD as We,hD as Ge,iD as Ke,jD as qe,jE as T,jk as Je,kD as Ye,kE as Xe,lD as Ze,mD as Qe,n as $e,nD as et,oD as tt,pD as nt,qD as rt,qE as E,rD as it,sD as at,tD as ot,uD as st,vD as ct,wD as lt,xD as ut,yD as dt,zD as D,zE as ft}from"./dist-CdSwEQWH.js";import{n as O}from"./dist-C-3gq7wS.js";import{t as k}from"./x-D7klnZcV.js";import{t as A}from"./button-0kksS-se.js";import{C as j,Et as pt,G as mt,J as M,K as N,S as P,Tt as F,W as ht,X as I,Y as gt,Z as L,_ as R,at as _t,b as z,it as vt,ot as B,q as yt,x as V,y as H}from"./index-H4lBiMmR.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-DLmrH_wl.js";import{a as Et,i as U,n as Dt,o as W,r as G,t as Ot}from"./table-CeOSuZF-.js";import{t as kt}from"./TimeRangePicker-BGMAlmom.js";import{t as At}from"./FilterBar-DaPqbYlS.js";import{t as jt}from"./AdvancedFilter-BruZmihw.js";var K=me(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),q=t(e(),1),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 J(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(je());if(e.size>zt)throw Error(Pe());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(E());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(E());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);J(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=J(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Gt(f,`image/webp`,Ht)??await Gt(f,`image/png`);if(!h)throw Error(ae());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return Y(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return Y(e)}async function Y(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(re())),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 Gt(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Kt(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__`,qt={kind:`relative`,from:`now-24h`,to:`now`},Jt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Yt(e){return e===`light`?ye():e===`dark`?Ie():Me()}var Xt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Zt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Xt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Qt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:$e(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Zt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function $t({selectedKey:e,resolvedMode:t}){let n=S(f.charts.listMyCharts),r=x(f.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Qt,{selected:e===null,title:D(),subtitle:xe(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?oe():n.via===`owner`?ee():m({group:n.via.group});return(0,X.jsx)(Qt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()}):null]})}function en(){let e=x(f.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.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(w())}}}async function p(){if(o(null),c(!1),t.trim()===``){o(st());return}let a;try{a=JSON.parse(r)}catch{o(w());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:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:dt()})]}),(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:ct()}),(0,X.jsx)(L,{value:t,onChange:e=>n(e.target.value),placeholder:Re(),maxLength:60})]}),(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:r,onChange:e=>i(e.target.value),placeholder:Ge(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),Qe(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:l,onClick:()=>void p(),children:nt()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:He()}):null]})]})}function tn({chart:e}){let t=Je(f.charts.setChartLogo),n=x(f.charts.removeChartLogo),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Ut(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function p(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function m({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?it():et()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),t?Ue():ot(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void p(e),children:ve()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void d(e),children:r()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ke()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(m,{mode:`light`}),(0,X.jsx)(m,{mode:`dark`})]}),i?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Fe()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function nn({chart:e}){let t=S(f.me.getMe,{host:B}),n=x(f.charts.addChartDomain),r=x(f.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function p(){let t=i.trim();if(t!==``){s(null),u(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(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:v()}),(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:Oe()}):d.map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":c({domain:e}),onClick:()=>void m(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{value:i,onChange:e=>a(e.target.value),placeholder:Ee(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:b()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ae()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=x(f.charts.updateChart),n=x(f.charts.deleteChart),[r,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(e.name),[c,l]=(0,q.useState)(()=>$(e.tokens)),[u,d]=(0,q.useState)(e.tokens.bpm??0),[p,m]=(0,q.useState)(null),[g,_]=(0,q.useState)(!1);function v(){s(e.name),l($(e.tokens)),d(e.tokens.bpm??0),m(null),a(!0)}async function y(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(w());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}_(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{_(!1)}}async function b(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:v,children:tt()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:ze()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:se()}),(0,X.jsx)(L,{value:o,onChange:e=>s(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:i()}),(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:u,onChange:e=>d(Number(e.target.value)),"aria-label":i()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?be():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:te()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(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)(A,{size:`sm`,disabled:g,onClick:()=>void y(),children:ft()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:Se()})]})]}):null,(0,X.jsx)(tn,{chart:e}),(0,X.jsx)(nn,{chart:e})]})}function an(){let e=S(f.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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=x(f.charts.addChartToGroupPool),r=x(f.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 d(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)(I,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?p():e.kind===`custom`&&e.scope===`personal`?T():u()}),e.isGlobalDefault?(0,X.jsx)(I,{variant:`default`,children:we()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:l()}),(a??[]).map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ut({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(H,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(P,{size:`sm`,className:`w-56`,children:(0,X.jsx)(j,{placeholder:Ce()})}),(0,X.jsx)(z,{children:s.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:lt()}):null]})]})}function sn({chart:e}){let t=x(f.charts.promoteChartToCommon),n=x(f.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(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(I,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?o():T()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:le({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Xe()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:pe()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(f.admin.setDefaultThemeMode),i=x(f.admin.setDefaultLocale),o=x(f.charts.setDefaultChart),s=S(f.charts.listChartsAdmin),c=S(f.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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:D()}),_t.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({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:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:a()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(on,{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:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(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)(nn,{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:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(sn,{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:ne()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Yt(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:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ie()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,X.jsx)(A,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?g():_e()},e))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_()})]})]})}function ln(){let e=S(f.me.getMe,{host:B}),t=vt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)($t,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(en,{}),(0,X.jsx)(an,{}),e?.role===`admin`?(0,X.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){let[e,t]=(0,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,d]=(0,q.useState)(qt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(qt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(ln,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:ke()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(F,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{children:`Default`}),(0,X.jsx)(I,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(I,{variant:`outline`,children:`Outline`}),(0,X.jsx)(I,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(L,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(H,{value:n,onValueChange:r,children:[(0,X.jsx)(P,{className:`w-56`,children:(0,X.jsx)(j,{placeholder:`Select…`})}),(0,X.jsxs)(z,{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)(R,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(H,{value:o,onValueChange:s,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(j,{})}),(0,X.jsxs)(z,{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)(H,{value:c,onValueChange:l,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(j,{})}),(0,X.jsxs)(z,{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:Jt,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)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(gt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(F,{})})}),(0,X.jsxs)(mt,{align:`start`,children:[(0,X.jsx)(yt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(N,{children:`Edit`}),(0,X.jsx)(N,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(N,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{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)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(R,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(R,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(I,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(F,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{un as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Bu as r,Fu as i,Hu as a,Iu as o,Lu as s,Mu as c,Nu as l,Pu as u,Ru as d,Uu as f,Vu as p,Wu as m,zu as h}from"./dist-BOukL7gG.js";import{t as g}from"./button-CcNQBW08.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-HZd91gw7.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:m(),from:`now-5m`},{label:f(),from:`now-15m`},{label:a(),from:`now-30m`},{label:p(),from:`now-1h`},{label:r(),from:`now-3h`},{label:h(),from:`now-6h`},{label:d(),from:`now-12h`},{label:s(),from:`now-24h`},{label:o(),from:`now-2d`},{label:i(),from:`now-7d`},{label:u(),from:`now-30d`},{label:l(),from:`now-90d`},{label:c(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ad as r,Dd as i,Ed as a,Fd as o,Id as s,Ld as c,Md as l,Nd as u,Od as d,Pd as f,Rd as p,jd as m,kd as h}from"./dist-CdSwEQWH.js";import{t as g}from"./button-0kksS-se.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-H4lBiMmR.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:p(),from:`now-5m`},{label:c(),from:`now-15m`},{label:s(),from:`now-30m`},{label:o(),from:`now-1h`},{label:f(),from:`now-3h`},{label:u(),from:`now-6h`},{label:l(),from:`now-12h`},{label:m(),from:`now-24h`},{label:r(),from:`now-2d`},{label:h(),from:`now-7d`},{label:d(),from:`now-30d`},{label:i(),from:`now-90d`},{label:a(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Am as r,Bm as i,Bx as a,CS as o,Cm as s,Dk as c,Dm as l,ES as u,Em as d,Fm as f,Gx as p,Hx as m,Im as ee,Jx as h,Kx as g,Lm as _,Lx as v,Mm as te,Nk as y,Nm as ne,Ok as b,Om as re,Pk as x,Pm as ie,Rm as ae,Rx as S,SS as C,Sm as oe,TS as se,Tm as ce,Ux as w,Vx as T,Wx as E,Xx as le,Yx as D,Zx as ue,_S as O,_m as de,aS as k,am as fe,bS as A,bm as pe,cS as me,cm as he,dS as ge,dm as _e,fS as ve,fm as ye,gS as j,gm as be,hS as xe,hm as Se,iS as Ce,im as we,jm as Te,km as Ee,lS as De,lm as Oe,mS as M,mm as ke,nS as N,nm as P,oS as F,om as Ae,pS as I,pm as je,qx as Me,rS as L,rm as Ne,sS as Pe,sm as Fe,uS as Ie,um as Le,vS as Re,vm as ze,wS as Be,wm as Ve,xS as He,xm as Ue,yS as We,ym as Ge,zm as Ke,zx as qe}from"./dist-CdSwEQWH.js";import{n as Je}from"./dist-C-3gq7wS.js";import{t as Ye}from"./x-D7klnZcV.js";import{i as R,n as z,r as Xe,t as Ze}from"./tabs-Czyis8Bg.js";import{t as B}from"./button-0kksS-se.js";import{$ as Qe,C as V,Ct as $e,Dt as et,Mt as tt,Q as nt,S as H,X as U,a as rt,b as W,et as it,i as at,jt as ot,k as st,nt as ct,o as lt,ot as ut,r as dt,rt as ft,wt as pt,x as G,y as K}from"./index-H4lBiMmR.js";import{n as mt}from"./TimeRangePicker-BGMAlmom.js";import{t as ht}from"./FilterBar-DaPqbYlS.js";import{t as gt}from"./AdvancedFilter-BruZmihw.js";import{t as _t}from"./DataTableShell-DX6BeIdv.js";var vt=b(`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`}]]),yt=b(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function bt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?Pe():n===`agent`?`${F()} - ${r}`:e}function xt(){let e=x(c.me.getMe,{host:ut})?.role===`admin`,t=x(c.deliveryTiming.getDeliveryStatus,{}),n=y(c.deliveryTiming.startDeliveryRecord),r=y(c.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[s,l]=(0,q.useState)(!1),d=t?.recording??!1,f=async()=>{l(!0);try{d?await r({}):await n({})}finally{l(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:u()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:se()})]}),e?(0,J.jsx)(B,{variant:d?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void f(),children:d?o():Be()}):null]}),d?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(U,{variant:`secondary`,children:C()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:He({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Re():We()})}),i?(0,J.jsx)(St,{isAdmin:e}):null]})}function St({isAdmin:e}){let t=x(c.deliveryTiming.listDeliverySessions,{}),n=y(c.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[s,l]=(0,q.useState)(Y),[u,d]=(0,q.useState)(null),{from:f,to:p}=mt(s),m=s.to===`now`?1/0:p,ee=r.trim()!==``||a!==`all`||s!==Y,h=()=>{i(``),o(`all`),l(Y)},g=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=f&&t.startedAt<=m).map(e=>({...e,_id:e.sessionId}))},[t,r,a,f,m]),_=e=>{let t=new Set((g??[]).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,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(ht,{q:r,onQChange:i,searchPlaceholder:j(),timeRange:s,onTimeRangeChange:l,onReset:h,canReset:ee,children:(0,J.jsxs)(K,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:`all`,children:xe()}),(0,J.jsx)(G,{value:`active`,children:M()}),(0,J.jsx)(G,{value:`stopped`,children:I()})]})]})}),(0,J.jsx)(_t,{title:O(),rows:g,emptyHint:S(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?Ce():k(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,J.jsx)(vt,{size:15,"aria-hidden":!0}):(0,J.jsx)(pt,{size:15,"aria-hidden":!0})})},{header:ve(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:ge(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.stoppedAt).toLocaleString()})},{header:Ie(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:De(),sort:e=>e.startedBy,cell:e=>bt(e.startedBy)},{header:me(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(U,{variant:`secondary`,children:M()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:I()})}],rowActions:e?e=>[{label:L(),variant:`destructive`,onSelect:()=>_([e.sessionId])}]:void 0,bulkActions:e?[{label:L(),variant:`destructive`,onSelect:e=>_(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,J.jsx)(Ct,{sessionId:e.sessionId})})]})}function Ct({sessionId:e}){let t=x(c.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(wt,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(st(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function wt({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:N()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:A()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,v()]}),(0,J.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(Je,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?qe():a()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:D()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:h()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Me()})]})}),(0,J.jsxs)(`tbody`,{children:[i(g(),r.bridge),i(p(),r.A),i(E(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:w()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:m()})]})}var Tt=[50,100,200,500],Z=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=tt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,a=e.kind,o=e.statusClass??Q,u=e.principalType??Q,p=e.direction??Q,m=e.roleKey??Q,h=e.q??``,g=dt(e.from,e.to),v=(0,q.useMemo)(()=>lt(e.adv),[e.adv]),{from:y,to:b}=mt(g),[S,C]=(0,q.useState)(null),[se,w]=(0,q.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})}),A=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),me=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ge=e=>void t({search:t=>({...t,...rt(e)})}),ve=e=>void t({search:t=>({...t,adv:at(e)}),replace:!0}),j=x(c.observability.listEvents,{limit:n}),xe=x(c.observability.listEvents,{limit:n,kind:a===Z?void 0:a,filter:{q:h||void 0,from:y,to:b,statusClass:o===Q?void 0:o,principalType:u===Q?void 0:u,direction:p===Q?void 0:p,roleKey:m===Q?void 0:m,advanced:v.length>0?v:void 0}}),Ce=(0,q.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),we=(0,q.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),De=h!==``||o!==Q||u!==Q||p!==Q||m!==Q||v.length>0||g.kind!==`relative`||g.from!==kt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let N=S?j?.filter(e=>e.correlationId===S):xe,[P,F]=(0,q.useState)(`events`);return(0,J.jsxs)(Ze,{value:P,onValueChange:e=>F(e),children:[(0,J.jsxs)(Xe,{className:`w-full`,children:[(0,J.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)($e,{size:13,"aria-hidden":!0}),ue()]}),(0,J.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(yt,{size:13,"aria-hidden":!0}),le()]})]}),(0,J.jsx)(z,{value:`latency`,children:(0,J.jsx)(xt,{})}),(0,J.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),(0,J.jsx)(`strong`,{children:Ke()}),ae(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:_()})]}),(0,J.jsxs)(ht,{q:h,onQChange:D,searchPlaceholder:ee(),timeRange:g,onTimeRangeChange:ge,onReset:M,canReset:De,children:[(0,J.jsxs)(K,{value:o,onValueChange:O,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:f()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:ie()}),Et.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:u,onValueChange:k,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:ne()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:te()}),Dt.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:p,onValueChange:A,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:Te()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:r()}),Ot.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:m,onValueChange:me,children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{placeholder:Ee()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:re()}),we.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:a,onValueChange:E,children:[(0,J.jsx)(H,{size:`sm`,className:`w-44`,children:(0,J.jsx)(V,{placeholder:l()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Z,children:d()}),Ce.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,J.jsx)(H,{size:`sm`,className:`w-28`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(W,{children:Tt.map(e=>(0,J.jsx)(G,{value:String(e),children:ce({count:e})},e))})]})]}),(0,J.jsx)(gt,{fields:At,seed:v,onChange:ve}),S?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:Ve(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[s(),(0,J.jsx)(`code`,{children:$(S)})]}),(0,J.jsx)(Ye,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:oe()})]})}):null,(0,J.jsx)(_t,{title:Ue(),rows:N,emptyHint:S?pe():Ge(),columns:[{header:ze(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:de(),sort:e=>e.kind,cell:e=>(0,J.jsx)(U,{variant:`secondary`,children:e.kind})},{header:be(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Se(),children:`✓`})}},{header:ke(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(U,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(U,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:ye(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(U,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:_e(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Le(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${Mt(e.status)}`,children:e.status})},{header:Oe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:he(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Fe(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ae(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:fe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Pt,{row:se,onClose:()=>w(null)})]})]})}function Mt(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 Nt(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 Pt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(nt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(Qe,{className:`max-w-lg`,children:[(0,J.jsxs)(ct,{children:[(0,J.jsxs)(ft,{className:`oc-traces__meta-title`,children:[we(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(U,{variant:`outline`,children:Ne()})]}),(0,J.jsx)(it,{children:P()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Cp as i,Dk as a,Dp as o,Ep as s,Jv as c,Nk as l,Op as u,Ov as d,Pk as f,Qv as p,Sp as m,Tp as h,Xv as g,Yv as _,Zv as ee,_p as v,_y as te,ay as ne,bp as y,by as b,cy as re,dy as ie,ey as ae,fy as oe,gp as x,gy as se,hy as ce,iy as le,ly as ue,my as de,ny as fe,oy as pe,py as me,qv as S,ry as C,sy as w,ty as T,uy as he,vp as E,vy as ge,wp as D,xp as O,xy as k,yp as A,yy as j}from"./dist-CdSwEQWH.js";import{t as M}from"./button-0kksS-se.js";import{$ as N,A as P,C as F,G as I,K as L,M as _e,Mt as ve,Q as R,S as z,W as B,X as V,Y as ye,_ as H,_t as U,b as W,d as G,et as be,f as xe,gt as K,j as Se,jt as Ce,nt as we,ot as Te,p as q,q as Ee,rt as De,x as J,y as Y}from"./index-H4lBiMmR.js";import{t as X}from"./FilterBar-DaPqbYlS.js";import{t as Oe}from"./DataTableShell-DX6BeIdv.js";import{t as ke}from"./DetailChips-DEmmi2OP.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=f(a.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),c=f(a.agents.listUserAgents,n&&e?{profileId:e}:`skip`),l=new Set((c??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=(c??[]).find(e=>e.isDefault)??null,p=d?`${d.instanceName}/${d.agentId}`:null,m=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),g=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(c??[]).filter(e=>!m.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],_=new Map;for(let e of g){let t=_.get(e.instanceName)??[];t.push(e),_.set(e.instanceName,t)}return(0,Q.jsx)(R,{open:n,onOpenChange:r,children:(0,Q.jsxs)(N,{className:`oc-access`,children:[(0,Q.jsxs)(we,{children:[(0,Q.jsx)(De,{children:u({user:t})}),(0,Q.jsx)(be,{children:o()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?s():h()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:D()}):g.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:O()}):[..._.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:l,defaultKey:p},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:o,defaultKey:s}){let c=l(a.agents.assignAgent),u=l(a.agents.removeAgent),d=l(a.agents.setDefaultAgent),f=P();if(!e)return null;async function p(n,r){try{r?await u({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(i(),e)}}async function h(n){try{await d({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(m(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(U,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(V,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=o.has(n),i=s===n,a=e.state===`deleted`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(H,{checked:r,disabled:a&&!r,onCheckedChange:()=>void p(e.agentId,r),"aria-label":y({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,a?(0,Q.jsx)(V,{variant:`outline`,className:`oc-access__gone`,children:A()}):null,e.outOfPool?(0,Q.jsx)(V,{variant:`outline`,className:`oc-access__gone`,children:E()}):null,r?i?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":v(),title:v(),children:(0,Q.jsx)(K,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":x(),title:x(),onClick:()=>void h(e.agentId),children:(0,Q.jsx)(K,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=G.filter(e=>n.has(q[e])).length;return(0,Q.jsxs)(B,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?k():b({count:r})})}),(0,Q.jsxs)(I,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Ee,{children:j()}),G.map(e=>{let r=q[e];return(0,Q.jsxs)(L,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(H,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:xe[e]??e})]},e)})]})]})}function Ne(){let e=ve({from:`/settings/users`}),t=Ce({from:`/settings/users`}),n=e.q??``,i=e.role??$,o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),u=f(a.admin.listUsers,{filter:{q:n||void 0,role:i===$?void 0:i},withAgents:!0}),m=f(a.me.getMe,{host:Te}),h=l(a.admin.setRole),v=l(a.admin.setUserPermissions),y=l(a.admin.startImpersonation),b=l(a.admin.deleteUser),x=l(a.admin.setUserName),E=Se(),D=_e(),O=P(),[k,A]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of u??[])e.add(t.role);return[...e]},[u]),M=n!==``||i!==$;function N(){t({search:{},replace:!0})}async function I(e){try{await h(e)}catch(e){O.error(ge(),e)}}async function L(e){try{await v(e)}catch(e){O.error(te(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await E({title:he(),description:ue({user:t}),confirmWord:re(),confirmLabel:w(),destructive:!0}))try{await b({profileId:e._id}),O.success(ne({user:t}))}catch(e){O.error(pe(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await D({title:C(),label:fe({user:t}),placeholder:T(),defaultValue:e.name??``,confirmLabel:d()});if(n!==null)try{await x({profileId:e._id,name:n}),O.success(ae())}catch(e){O.error(r(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{q:n,onQChange:o,searchPlaceholder:se(),onReset:N,canReset:M,children:(0,Q.jsxs)(Y,{value:i,onValueChange:s,children:[(0,Q.jsx)(z,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(J,{value:$,children:ce()}),j.map(e=>(0,Q.jsx)(J,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:de(),rows:u,emptyHint:me(),rowActions:e=>{let t=[{label:S(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:le(),onSelect:()=>void B(e)}];return e.userId!==m?.userId&&t.push({label:oe(),onSelect:()=>void y({profileId:e._id})},{label:ie(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:p(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:ee(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(Y,{value:e.role,onValueChange:t=>void I({profileId:e._id,role:t}),children:[(0,Q.jsx)(z,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(J,{value:`pending`,children:`pending`}),(0,Q.jsx)(J,{value:`user`,children:`user`}),(0,Q.jsx)(J,{value:`admin`,children:`admin`})]})]})},{header:g(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:_()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),L({profileId:e._id,permissions:[...n]})}})},{header:c(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{Ne as UsersTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{OO as n,n as r,t as i}from"./dist-BOukL7gG.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?n:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:r(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{Sk as n,n as r,t as i}from"./dist-CdSwEQWH.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?n:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:r(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BOukL7gG.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-CdSwEQWH.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{Ok as e}from"./dist-CdSwEQWH.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 +1 @@
1
- import{Fr as e,Jr as t,Lr as n,Pr as r,Rr as i,zr as a}from"./dist-BOukL7gG.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(e){return e===`supported`?a():e===`beyond`?i():n()}function p(e){return e??t()}function m(t){return t===null?r():e({version:t})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
1
+ import{Ai as e,Di as t,Mi as n,Oi as r,Vi as i,ji as a}from"./dist-CdSwEQWH.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(t){return t===`supported`?n():t===`beyond`?a():e()}function p(e){return e??i()}function m(e){return e===null?t():r({version:e})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
@@ -0,0 +1 @@
1
+ var e=[`MEMORY.md`,`AGENTS.md`,`SOUL.md`,`IDENTITY.md`,`TOOLS.md`,`USER.md`];function t(e,t){return t<=0||e<=0?!1:e/t*100>=90}export{t as n,e as t};
@@ -0,0 +1 @@
1
+ import{$c as e,Gc as t,Jc as n,Kc as r,Qc as i,Uc as a,Wc as o,Xc as s,Yc as c,Zc as l,_l as u,al as d,cl as f,dl as p,el as m,fl as h,gl as g,hl as _,il as v,ll as y,ml as b,nl as x,ol as S,pl as C,qc as w,rl as T,sl as E,tl as D,ul as O}from"./dist-CdSwEQWH.js";var k={AGENT_NOT_FOUND:()=>({label:u(),hint:g()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:b()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:h()}),SESSION_SCOPE_DENIED:()=>({label:p(),hint:O()}),GATEWAY_TIMEOUT:()=>({label:y(),hint:f()}),GATEWAY_DISCONNECTED:()=>({label:E(),hint:S()}),ATTACHMENT_TOO_LARGE:()=>({label:T(),hint:x()}),ATTACHMENT_REJECTED:()=>({label:D(),hint:m()}),BRIDGE_UNREACHABLE:()=>({label:d(),hint:v()}),INVALID_REQUEST:()=>({label:e(),hint:i()}),NOT_CONFIGURED:()=>({label:l(),hint:s()}),UNROUTED:()=>({label:c(),hint:n()}),UPSTREAM_ERROR:()=>({label:w(),hint:r()}),UNKNOWN:()=>({label:t(),hint:o()})};function A(e){return e?k[e]?.()??{label:e,hint:a()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ck as r,Ek as i,Ok as a,gk as o}from"./dist-CdSwEQWH.js";var s=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),c=a(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),l=t(e(),1),u=n();function d(e){let t=e+`CollectionProvider`,[n,a]=o(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=l.useRef(null),i=l.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=r(f),m=l.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(p,{ref:i(t,c(f,n).collectionRef),children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=r(h),v=l.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=l.useRef(null),s=i(t,o),d=c(h,n);return l.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,u.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=c(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,a]}var f=l.createContext(void 0);function p(e){let t=l.useContext(f);return e||t||`ltr`}export{s as i,d as n,c as r,p as t};
@@ -1 +1 @@
1
- import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{PO as n}from"./dist-BOukL7gG.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};
1
+ import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{Ok as n}from"./dist-CdSwEQWH.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};