@lacneu/atrium 0.81.0 → 0.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccessTab-BgWLWjSu.js → AccessTab-OP6MT853.js} +1 -1
- package/dist/assets/{AdvancedFilter-CDngwUem.js → AdvancedFilter-CYKmk_LK.js} +1 -1
- package/dist/assets/{AgentFilesTab-CL0cJrKE.js → AgentFilesTab-Bzj4n4RS.js} +1 -1
- package/dist/assets/{AnomaliesTab-CKSRbds6.js → AnomaliesTab-DIOsMkIt.js} +1 -1
- package/dist/assets/{AuditTab-BnDFtbaS.js → AuditTab-B-v9HjgO.js} +1 -1
- package/dist/assets/{BridgeTab-QW9px1z5.js → BridgeTab-D7jnblPV.js} +1 -1
- package/dist/assets/{ChatDefaultsTab-XNB8jInh.js → ChatDefaultsTab-DE7qape9.js} +1 -1
- package/dist/assets/{DataTableShell-BWoSBli_.js → DataTableShell-CR2Pxo32.js} +1 -1
- package/dist/assets/{DetailChips-CUfCyLvN.js → DetailChips-BttzOfap.js} +1 -1
- package/dist/assets/{FeedbacksTab-Ba-zMA-p.js → FeedbacksTab-BPxuXa49.js} +1 -1
- package/dist/assets/{FieldLabel-8vj4ipPC.js → FieldLabel-DvlvfpGK.js} +1 -1
- package/dist/assets/{FilesTab-Dht0_RDj.js → FilesTab-Da5f-Q53.js} +1 -1
- package/dist/assets/{FilterBar-BJ1mhU3e.js → FilterBar-D8d3TG3L.js} +1 -1
- package/dist/assets/{GroupsTab-Bz7Mvvwj.js → GroupsTab-02Klvfu1.js} +1 -1
- package/dist/assets/InstancesTab-CvcFYqzZ.js +1 -0
- package/dist/assets/{IntegrationsTab-D3y4_fhI.js → IntegrationsTab-C3v_UYdO.js} +1 -1
- package/dist/assets/{KpiTab-D9ujtelb.js → KpiTab-NBnWW7mn.js} +1 -1
- package/dist/assets/{PreferencesTab-CHqxxQ3R.js → PreferencesTab-Dtc4NXr7.js} +1 -1
- package/dist/assets/{ProjectPage-Dom5dB_v.js → ProjectPage-3M9H_seP.js} +1 -1
- package/dist/assets/{PromptInjectionsTab-D-7L-yZy.js → PromptInjectionsTab-ydfl3LIa.js} +1 -1
- package/dist/assets/{RolesTab-2nGoIoBg.js → RolesTab-rtjEoRka.js} +1 -1
- package/dist/assets/{ScheduledTab-_v_HWkIY.js → ScheduledTab-1Z--saSr.js} +1 -1
- package/dist/assets/{ServiceAccountsTab-foQObSmk.js → ServiceAccountsTab-BDQcZy4S.js} +1 -1
- package/dist/assets/{SubAgentReportsTab-DIzBgBj5.js → SubAgentReportsTab-BlttiEor.js} +1 -1
- package/dist/assets/{ThemeShowroom-Gqbq2MWW.js → ThemeShowroom-D1Av-z7w.js} +1 -1
- package/dist/assets/{TimeRangePicker-qNMV_Gj-.js → TimeRangePicker-CdzW5P7l.js} +1 -1
- package/dist/assets/{TimezoneCombobox-D2e6UjGY.js → TimezoneCombobox-Byz56evB.js} +1 -1
- package/dist/assets/{TracesTab-D_Z__oYy.js → TracesTab-DuT8lvo4.js} +1 -1
- package/dist/assets/{UsersTab-1HZ5mAYl.js → UsersTab-6m5HSxal.js} +1 -1
- package/dist/assets/{VoiceTab-DGQk5yGt.js → VoiceTab-DFVKbQpO.js} +1 -1
- package/dist/assets/{api-CCk5U5gB.js → api-Borb_oKz.js} +1 -1
- package/dist/assets/{button-CbUSFbZL.js → button-Bcf40mKN.js} +1 -1
- package/dist/assets/{card-PW6qFB8Z.js → card-BVQ_SWDd.js} +1 -1
- package/dist/assets/chevrons-up-down-DQp99IbP.js +1 -0
- package/dist/assets/{compatView-DgV9jG5C.js → compatView-CowuHUom.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-CW9VFOfh.js → dispatchErrorInfo-DwvABR74.js} +1 -1
- package/dist/assets/{dist-CeBeEhXM.js → dist-BCOYDeQS.js} +1 -1
- package/dist/assets/{dist-BF1pXGOi.js → dist-Bq0h0jBi.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-B0i3QCx_.js → highlighted-body-OFNGDK62-DSC5jaxG.js} +1 -1
- package/dist/assets/index-DEMhzN6j.css +1 -0
- package/dist/assets/{index-DY7zoioz.js → index-lMzb_P_p.js} +7 -7
- package/dist/assets/{list-wMpxVo2w.js → list-DfIPa6Dk.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-BoodyZnM.js +1 -0
- package/dist/assets/{pdf-BFBPmq_U.js → pdf-CO5wvqSF.js} +1 -1
- package/dist/assets/roleDescriptions-xzqDDCcp.js +1 -0
- package/dist/assets/{table-BhYNJKZu.js → table-B5YoMU9b.js} +1 -1
- package/dist/assets/{tabs-BwhZusQZ.js → tabs-D7icC_cj.js} +1 -1
- package/dist/assets/x-XSJ8VGVc.js +1 -0
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/InstancesTab-BTESpzxw.js +0 -1
- package/dist/assets/chevrons-up-down-DAdQ-ohu.js +0 -1
- package/dist/assets/index-vuXE_6pY.css +0 -1
- package/dist/assets/mermaid-GHXKKRXX-CWDFvVZH.js +0 -1
- package/dist/assets/roleDescriptions-Du6v2lbA.js +0 -1
- package/dist/assets/x-BvfQ_1AZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,AF as i,BF as a,CF as o,CI as s,DF as c,EF as l,FF as u,GF as d,HF as f,IF as p,JF as m,Jz as h,KF as g,LF as _,MF as ee,NF as te,OF as ne,PF as re,QF as ie,RF as ae,SF as v,SI as oe,TF as se,UF as ce,VF as y,WF as le,XF as ue,YF as de,Yz as fe,ZF as pe,_F as me,_I as he,aB as b,aF as ge,aI as _e,bF as ve,bI as ye,cF as be,cI as xe,dF as Se,dI as Ce,eI as we,fF as Te,fI as Ee,fc as De,gF as Oe,gI as ke,hF as Ae,hI as je,hc as x,iF as Me,iI as Ne,jF as Pe,kF as Fe,lF as Ie,lI as Le,mF as Re,mI as S,mc as C,nF as ze,nI as Be,oB as w,oF as T,oI as Ve,pF as He,pI as Ue,pc as We,qF as Ge,qz as Ke,r as qe,rB as Je,rF as Ye,rI as Xe,sF as Ze,sI as Qe,t as E,tI as $e,uF as D,uI as et,vF as tt,vI as nt,wF as rt,wI as it,xF as at,xI as ot,yF as st,yI as ct,zF as lt}from"./api-CCk5U5gB.js";import{t as O}from"./x-BvfQ_1AZ.js";import{t as k}from"./button-CbUSFbZL.js";import{$ as A,Et as j,Fn as ut,Ft as dt,G as ft,It as M,K as pt,Lt as mt,Mt as ht,Nt as gt,Pn as N,Pt as P,Q as F,Un as I,X as L,Z as R,et as z,jt as B,ln as V,q as H,ut as U}from"./index-DY7zoioz.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-PW6qFB8Z.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-BhYNJKZu.js";import{t as Dt}from"./TimeRangePicker-qNMV_Gj-.js";import{t as Ot}from"./FilterBar-BJ1mhU3e.js";import{t as kt}from"./AdvancedFilter-CDngwUem.js";var q=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 Pt(e,t,n)>=At}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(se());if(e.size>Lt)throw Error(rt());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(v());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(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(v());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)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(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 Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(at());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(o())),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 Wt(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__`,Gt={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 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 qt(e){return e===`light`?fe():e===`dark`?h():Ke()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(I,{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":x(),title:x(),children:(0,X.jsx)(ut,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=w(E.charts.listMyCharts),r=b(E.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:ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:je()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:S(),subtitle:Ue(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ee():n.via===`owner`?Ce():et({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 i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()}):null]})}function Qt(){let e=b(E.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),[u,p]=(0,q.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(y())}}}async function _(){if(s(null),l(!1),t.trim()===``){s(lt());return}let a;try{a=JSON.parse(r)}catch{s(y());return}p(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:de()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(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:Ge()}),(0,X.jsx)(B,{value:t,onChange:e=>n(e.target.value),placeholder:g(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:d()}),(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)(V,{className:`size-4`}),ce(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void _(),children:f()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:a()}):null]})]})}function $t({chart:e}){let t=Je(E.charts.setChartLogo),n=b(E.charts.removeChartLogo),[r,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),u=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function d(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Vt(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function f(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await d(e,n)}async function p(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function m(e){let t=u(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await d(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function h({mode:e}){let t=u(e),n=u(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ee():Pe()}),(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)(V,{className:`size-4`}),t?Fe():i(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void f(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:c()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:ne()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:te()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(h,{mode:`light`}),(0,X.jsx)(h,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:l()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function en({chart:e}){let t=w(E.me.getMe,{host:H}),n=b(E.charts.addChartDomain),r=b(E.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let 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:ve()}),(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:Oe()}):u.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ae({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)(B,{value:i,onChange:e=>a(e.target.value),placeholder:tt(),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:me()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:st()}),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 tn({chart:e}){let t=b(E.charts.updateChart),n=b(E.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,d]=(0,q.useState)(e.tokens.bpm??0),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(!1);function g(){o(e.name),c($(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function _(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(y());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function ee(){if(e.chartId!==void 0&&window.confirm(D()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:g,children:u()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void ee(),children:re()})]})})]}),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:Te()}),(0,X.jsx)(B,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:C()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>d(Number(e.target.value)),"aria-label":C()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?We():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:De()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Se()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void _(),children:Re()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:He()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=w(E.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=b(E.charts.addChartToGroupPool),i=b(E.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await i({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?$e():e.kind===`custom`&&e.scope===`personal`?T():Be()}),e.isGlobalDefault?(0,X.jsx)(j,{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:ie()}),(o??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ue({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(L,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:pe()})}),(0,X.jsx)(R,{children:c.map(e=>(0,X.jsx)(F,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:r()}):null]})]})}function an({chart:e}){let t=b(E.charts.promoteChartToCommon),n=b(E.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(D()))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)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ge():T()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ze({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:Me()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ye()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(E.admin.setDefaultThemeMode),i=b(E.admin.setDefaultLocale),a=b(E.charts.setDefaultChart),o=w(E.charts.listChartsAdmin),c=w(E.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:nt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),(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:S()}),pt.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)),(o??[]).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:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(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:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{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:it()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(k,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]})]})}function sn(){let e=w(E.me.getMe,{host:H}),t=ft(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)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){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)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:ct()}),(0,X.jsxs)(Q,{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)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{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)(B,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(L,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(F,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(U,{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)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(L,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes directions`}),(0,X.jsx)(F,{value:`inbound`,children:`inbound`}),(0,X.jsx)(F,{value:`outbound`,children:`outbound`}),(0,X.jsx)(F,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(L,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(F,{value:`info`,children:`info`}),(0,X.jsx)(F,{value:`warn`,children:`warn`}),(0,X.jsx)(F,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{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)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(U,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(U,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(I,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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{cn as ThemeShowroom};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,AF as i,BF as a,CF as o,CI as s,DF as c,EF as l,FF as u,GF as d,HF as f,IF as p,JF as m,Jz as h,KF as g,LF as _,MF as ee,NF as te,OF as ne,PF as re,QF as ie,RF as ae,SF as v,SI as oe,TF as se,UF as ce,VF as y,WF as le,XF as ue,YF as de,Yz as fe,ZF as pe,_F as me,_I as he,aB as b,aF as ge,aI as _e,bF as ve,bI as ye,cF as be,cI as xe,dF as Se,dI as Ce,eI as we,fF as Te,fI as Ee,fc as De,gF as Oe,gI as ke,hF as Ae,hI as je,hc as x,iF as Me,iI as Ne,jF as Pe,kF as Fe,lF as Ie,lI as Le,mF as Re,mI as S,mc as C,nF as ze,nI as Be,oB as w,oF as T,oI as Ve,pF as He,pI as Ue,pc as We,qF as Ge,qz as Ke,r as qe,rB as Je,rF as Ye,rI as Xe,sF as Ze,sI as Qe,t as E,tI as $e,uF as D,uI as et,vF as tt,vI as nt,wF as rt,wI as it,xF as at,xI as ot,yF as st,yI as ct,zF as lt}from"./api-Borb_oKz.js";import{t as O}from"./x-XSJ8VGVc.js";import{t as k}from"./button-Bcf40mKN.js";import{$ as A,Et as j,Fn as ut,Ft as dt,G as ft,It as M,K as pt,Lt as mt,Mt as ht,Nt as gt,Pn as N,Pt as P,Q as F,Un as I,X as L,Z as R,et as z,jt as B,ln as V,q as H,ut as U}from"./index-lMzb_P_p.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-BVQ_SWDd.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-B5YoMU9b.js";import{t as Dt}from"./TimeRangePicker-CdzW5P7l.js";import{t as Ot}from"./FilterBar-D8d3TG3L.js";import{t as kt}from"./AdvancedFilter-CYKmk_LK.js";var q=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 Pt(e,t,n)>=At}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(se());if(e.size>Lt)throw Error(rt());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(v());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(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(v());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)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(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 Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(at());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(o())),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 Wt(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__`,Gt={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 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 qt(e){return e===`light`?fe():e===`dark`?h():Ke()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(I,{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":x(),title:x(),children:(0,X.jsx)(ut,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=w(E.charts.listMyCharts),r=b(E.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:ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:je()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:S(),subtitle:Ue(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ee():n.via===`owner`?Ce():et({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 i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()}):null]})}function Qt(){let e=b(E.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),[u,p]=(0,q.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(y())}}}async function _(){if(s(null),l(!1),t.trim()===``){s(lt());return}let a;try{a=JSON.parse(r)}catch{s(y());return}p(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:de()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(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:Ge()}),(0,X.jsx)(B,{value:t,onChange:e=>n(e.target.value),placeholder:g(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:d()}),(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)(V,{className:`size-4`}),ce(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void _(),children:f()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:a()}):null]})]})}function $t({chart:e}){let t=Je(E.charts.setChartLogo),n=b(E.charts.removeChartLogo),[r,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),u=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function d(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Vt(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function f(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await d(e,n)}async function p(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function m(e){let t=u(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await d(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function h({mode:e}){let t=u(e),n=u(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ee():Pe()}),(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)(V,{className:`size-4`}),t?Fe():i(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void f(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:c()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:ne()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:te()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(h,{mode:`light`}),(0,X.jsx)(h,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:l()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function en({chart:e}){let t=w(E.me.getMe,{host:H}),n=b(E.charts.addChartDomain),r=b(E.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let 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:ve()}),(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:Oe()}):u.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ae({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)(B,{value:i,onChange:e=>a(e.target.value),placeholder:tt(),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:me()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:st()}),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 tn({chart:e}){let t=b(E.charts.updateChart),n=b(E.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,d]=(0,q.useState)(e.tokens.bpm??0),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(!1);function g(){o(e.name),c($(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function _(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(y());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function ee(){if(e.chartId!==void 0&&window.confirm(D()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:g,children:u()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void ee(),children:re()})]})})]}),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:Te()}),(0,X.jsx)(B,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:C()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>d(Number(e.target.value)),"aria-label":C()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?We():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:De()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Se()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void _(),children:Re()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:He()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=w(E.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=b(E.charts.addChartToGroupPool),i=b(E.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await i({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?$e():e.kind===`custom`&&e.scope===`personal`?T():Be()}),e.isGlobalDefault?(0,X.jsx)(j,{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:ie()}),(o??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ue({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(L,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:pe()})}),(0,X.jsx)(R,{children:c.map(e=>(0,X.jsx)(F,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:r()}):null]})]})}function an({chart:e}){let t=b(E.charts.promoteChartToCommon),n=b(E.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(D()))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)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ge():T()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ze({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:Me()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ye()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(E.admin.setDefaultThemeMode),i=b(E.admin.setDefaultLocale),a=b(E.charts.setDefaultChart),o=w(E.charts.listChartsAdmin),c=w(E.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:nt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),(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:S()}),pt.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)),(o??[]).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:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(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:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{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:it()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(k,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]})]})}function sn(){let e=w(E.me.getMe,{host:H}),t=ft(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)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){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)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:ct()}),(0,X.jsxs)(Q,{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)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{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)(B,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(L,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(F,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(U,{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)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(L,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes directions`}),(0,X.jsx)(F,{value:`inbound`,children:`inbound`}),(0,X.jsx)(F,{value:`outbound`,children:`outbound`}),(0,X.jsx)(F,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(L,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(F,{value:`info`,children:`info`}),(0,X.jsx)(F,{value:`warn`,children:`warn`}),(0,X.jsx)(F,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{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)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(U,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(U,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(I,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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{cn as ThemeShowroom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,By as i,Gy as a,Hy as o,Ja as s,Jy as c,Ky as l,Qa as u,Uy as d,Vy as f,Wy as p,Xa as m,Xy as h,Ya as g,Yy as _,Za as v,Zy as y,qa as b,qy as x,zy as S}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,By as i,Gy as a,Hy as o,Ja as s,Jy as c,Ky as l,Qa as u,Uy as d,Vy as f,Wy as p,Xa as m,Xy as h,Ya as g,Yy as _,Za as v,Zy as y,qa as b,qy as x,zy as S}from"./api-Borb_oKz.js";import{t as C}from"./button-Bcf40mKN.js";import{Ht as w,Ln as T,Ut as E,Vt as D,Wt as O,ct as k,jt as A,mn as j}from"./index-lMzb_P_p.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:y(),from:`now-5m`},{label:h(),from:`now-15m`},{label:_(),from:`now-30m`},{label:c(),from:`now-1h`},{label:x(),from:`now-3h`},{label:l(),from:`now-6h`},{label:a(),from:`now-12h`},{label:p(),from:`now-24h`},{label:d(),from:`now-2d`},{label:o(),from:`now-7d`},{label:f(),from:`now-30d`},{label:i(),from:`now-90d`},{label:S(),from:`now-520w`}];function L(e){return k(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,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),c=F(e),[l,d]=(0,M.useState)(()=>z(c.from)),[f,p]=(0,M.useState)(()=>z(c.to));function h(t){if(t){let t=F(e);d(z(t.from)),p(z(t.to)),o(``)}i(t)}function _(e){t({kind:`relative`,from:e,to:`now`}),i(!1)}function y(){let e=B(l),n=B(f);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),i(!1))}let x=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),S=B(l)!==null&&B(f)!==null;return(0,H.jsxs)(E,{open:n,onOpenChange:h,children:[(0,H.jsx)(O,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(T,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(D,{align:`end`,sideOffset:6,className:`oc-timerange__panel oc-overlay-layer 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:r()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:u()}),(0,H.jsx)(A,{type:`datetime-local`,value:l,onChange:e=>d(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:v()}),(0,H.jsx)(A,{type:`datetime-local`,value:f,onChange:e=>p(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:y,children:m()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:g(),"aria-label":s()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:b()}):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:()=>_(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CL as r,EL as i,TL as a,wL as o}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CL as r,EL as i,TL as a,wL as o}from"./api-Borb_oKz.js";import{t as s}from"./chevrons-up-down-DQp99IbP.js";import{Bt as c,Rt as l,Un as u,jt as d,zt as f}from"./index-lMzb_P_p.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}function g(e){return typeof e.autoDisabledReason==`string`&&e.autoDisabledReason!==``?`auto-disabled`:h(e.enabled)}function _(e){return g(e)===`active`?`pause`:`resume`}var v={q:``,state:`all`,result:`all`};function y(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function b(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&g(e)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function x(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function S(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function C(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function w(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function T(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function E(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var D=n();function O({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>x(),[]),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(``);if(h.length===0)return(0,D.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||S()||`America/Toronto`,className:n});let b=C(h,v,h.length,e||void 0),w=e===``?m||S()||r():e;return(0,D.jsxs)(l,{modal:!0,open:g,onOpenChange:e=>{_(e),e||y(``)},children:[(0,D.jsx)(c,{asChild:!0,children:(0,D.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":i(),children:[(0,D.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,D.jsx)(s,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,D.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,D.jsx)(d,{autoFocus:!0,value:v,onChange:e=>y(e.target.value),placeholder:a(),className:`oc-tzcombo__search`}),(0,D.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:b.length===0?(0,D.jsx)(`p`,{className:`oc-tzcombo__empty`,children:o()}):b.map(n=>(0,D.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),y(``)},children:[(0,D.jsx)(u,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,D.jsx)(`span`,{children:n})]},n))})]})]})}export{b as a,w as c,_ as i,E as l,v as n,g as o,y as r,m as s,O as t,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,$k as i,AS as a,Ak as o,BS as s,Bk as c,CS as l,D as u,DS as d,ES as f,FS as p,Fk as m,GS as ee,HS as h,Hk as g,IS as te,Ik as _,JS as ne,Ji as v,KS as re,LS as ie,Lk as y,MS as ae,Mk as b,NS as oe,Nk as x,OS as se,PS as ce,Pk as S,QS as le,Qk as C,RS as ue,Rk as de,SS as fe,TS as pe,US as me,Uk as he,VS as ge,Vk as w,WS as _e,Wk as ve,XS as ye,Xi as T,Xk as E,YS as be,Yi as D,Yk as xe,ZS as Se,Zk as Ce,_A as we,aA as Te,aB as O,bS as Ee,cA as k,dA as De,eA as Oe,eC as ke,fA as Ae,gA as je,hA as Me,iA as Ne,jS as Pe,jk as A,kS as Fe,lA as j,mA as Ie,nA as Le,nC as Re,oA as M,oB as N,pA as ze,qS as Be,rA as Ve,sA as P,t as F,tA as He,tC as Ue,uA as We,vA as Ge,wS as Ke,xS as qe,yA as Je,yS as Ye,zS as Xe,zk as Ze}from"./api-CCk5U5gB.js";import{t as Qe}from"./x-BvfQ_1AZ.js";import{i as I,n as L,r as $e,t as et}from"./tabs-BwhZusQZ.js";import{t as R}from"./button-CbUSFbZL.js";import{$ as z,Et as B,Gn as tt,H as nt,In as rt,Kn as it,Mn as at,Nn as ot,On as st,Q as V,Un as ct,X as H,Z as U,a as lt,at as ut,ct as W,et as G,i as dt,lt as ft,nt as pt,o as mt,ot as ht,q as gt,rt as _t,s as vt,tt as yt}from"./index-DY7zoioz.js";import{n as bt}from"./TimeRangePicker-qNMV_Gj-.js";import{t as K}from"./FilterBar-BJ1mhU3e.js";import{t as xt}from"./AdvancedFilter-CDngwUem.js";import{t as St}from"./DataTableShell-BWoSBli_.js";var Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=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`?Oe():n===`agent`?`${i()} - ${r}`:e}function Tt(){let e=N(F.me.getMe,{host:gt})?.role===`admin`,t=N(F.deliveryTiming.getDeliveryStatus,{}),n=O(F.deliveryTiming.startDeliveryRecord),r=O(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!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:Je()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()})]}),e?(0,J.jsx)(R,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?je():we()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(B,{variant:`secondary`,children:Me()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:Ie({time:ft(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?De():Ae()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(F.deliveryTiming.listDeliverySessions,{}),n=O(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[s,c]=(0,q.useState)(Y),[l,u]=(0,q.useState)(null),{from:d,to:f}=bt(s),p=s.to===`now`?1/0:f,m=r.trim()!==``||a!==`all`||s!==Y,ee=()=>{i(``),o(`all`),c(Y)},h=(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>=d&&t.startedAt<=p).map(e=>({...e,_id:e.sessionId}))},[t,r,a,d,p]),g=e=>{let t=new Set((h??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),l!==null&&r.includes(l)&&u(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(K,{q:r,onQChange:i,searchPlaceholder:j(),timeRange:s,onTimeRangeChange:c,onReset:ee,canReset:m,children:(0,J.jsxs)(H,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(z,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:`all`,children:k()}),(0,J.jsx)(V,{value:`active`,children:P()}),(0,J.jsx)(V,{value:`stopped`,children:M()})]})]})}),(0,J.jsx)(St,{title:We(),rows:h,emptyHint:A(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":l===e.sessionId?Ce():C(),onClick:()=>u(t=>t===e.sessionId?null:e.sessionId),children:l===e.sessionId?(0,J.jsx)(ot,{size:15,"aria-hidden":!0}):(0,J.jsx)(at,{size:15,"aria-hidden":!0})})},{header:Te(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:W(e.startedAt)})},{header:Ne(),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:W(e.stoppedAt)})},{header:Ve(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:Le(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:He(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(B,{variant:`secondary`,children:P()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:M()})}],rowActions:e?e=>[{label:E(),variant:`destructive`,onSelect:()=>g([e.sessionId])}]:void 0,bulkActions:e?[{label:E(),variant:`destructive`,onSelect:e=>g(e)}]:void 0,isExpanded:e=>e.sessionId===l,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.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,J.jsx)(`p`,{className:`oc-admin__hint`,children:xe()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ze()});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,` `,o()]}),(0,J.jsxs)(R,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(ct,{size:13,"aria-hidden":!0}):(0,J.jsx)(rt,{size:13,"aria-hidden":!0}),t?b():x()]})]}),(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:g()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:w()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:c()})]})}),(0,J.jsxs)(`tbody`,{children:[i(Ze(),r.bridge),i(de(),r.A),i(y(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:m()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:T()},{value:`principalType`,label:D()},{value:`direction`,label:`direction`},{value:`roleKey`,label:v()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=it({from:`/settings/traces`}),t=tt({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,m=e.roleKey??Q,g=e.q??``,_=e.correlationId,v=dt(e.from,e.to),y=(0,q.useMemo)(()=>vt(e.adv),[e.adv]),{from:b,to:x}=bt(v),[S,C]=(0,q.useState)(null),[de,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}),xe=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),Ce=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),we=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),Te=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,...mt(e)})}),Ee=e=>void t({search:t=>({...t,adv:lt(e)}),replace:!0}),k=N(F.observability.listEvents,{limit:n}),De=N(F.observability.listEvents,{limit:n,kind:i===Z?void 0:i,..._?{correlationId:_}:{},filter:{q:g||void 0,from:b,to:x,statusClass:o===Q?void 0:o,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:m===Q?void 0:m,advanced:y.length>0?y:void 0}}),Oe=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),Ae=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),je=g!==``||o!==Q||c!==Q||u!==Q||m!==Q||y.length>0||v.kind!==`relative`||v.from!==Nt.from;function Me(){t({search:{limit:100,kind:`all`},replace:!0})}let Ne=S?k?.filter(e=>e.correlationId===S):De,A=e.section,j=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(et,{value:A,onValueChange:e=>j(e),children:[(0,J.jsxs)($e,{className:`w-full`,children:[(0,J.jsxs)(I,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(st,{size:13,"aria-hidden":!0}),ve()]}),(0,J.jsxs)(I,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),he()]})]}),(0,J.jsx)(L,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(L,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Re(),(0,J.jsx)(`strong`,{children:Ue()}),ke(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:r()})]}),(0,J.jsxs)(K,{q:g,onQChange:D,searchPlaceholder:le(),timeRange:v,onTimeRangeChange:O,onReset:Me,canReset:je,children:[(0,J.jsxs)(H,{value:o,onValueChange:xe,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:Se()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:ye()}),At.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:c,onValueChange:Ce,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:be()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:ne()}),jt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:u,onValueChange:we,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:Be()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:re()}),Mt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:m,onValueChange:Te,children:[(0,J.jsx)(z,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{placeholder:ee()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:_e()}),Ae.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:i===Z?``:i,placeholder:me(),"aria-label":me(),onChange:e=>{let t=e.target.value.trim();E(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:Oe.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(H,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,J.jsx)(z,{size:`sm`,className:`w-28`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(U,{children:kt.map(e=>(0,J.jsx)(V,{value:String(e),children:h({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:y,onChange:Ee}),S?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:ge(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[s(),(0,J.jsx)(`code`,{children:$(S)})]}),(0,J.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Xe()})]})}):null,(0,J.jsx)(St,{title:ue(),rows:Ne,emptyHint:S?ie():te(),columns:[{header:p(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:W(e.at)})},{header:ce(),sort:e=>e.kind,cell:e=>(0,J.jsx)(B,{variant:`secondary`,children:e.kind})},{header:oe(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(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":ae(),children:`✓`})}},{header:Pe(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(B,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:a(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(B,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Fe(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(B,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),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:d(),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 ${It(e.status)}`,children:e.status})},{header:f(),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:pe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Ke(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:l(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:fe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:de,onClose:()=>w(null)})]})]})}function It(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 Lt(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 Rt({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)(yt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(pt,{className:`max-w-lg`,children:[(0,J.jsxs)(ut,{children:[(0,J.jsxs)(ht,{className:`oc-traces__meta-title`,children:[qe(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(B,{variant:`outline`,children:Ee()})]}),(0,J.jsx)(_t,{children:Ye()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,$k as i,AS as a,Ak as o,BS as s,Bk as c,CS as l,D as u,DS as d,ES as f,FS as p,Fk as m,GS as ee,HS as h,Hk as g,IS as te,Ik as _,JS as ne,Ji as v,KS as re,LS as ie,Lk as y,MS as ae,Mk as b,NS as oe,Nk as x,OS as se,PS as ce,Pk as S,QS as le,Qk as C,RS as ue,Rk as de,SS as fe,TS as pe,US as me,Uk as he,VS as ge,Vk as w,WS as _e,Wk as ve,XS as ye,Xi as T,Xk as E,YS as be,Yi as D,Yk as xe,ZS as Se,Zk as Ce,_A as we,aA as Te,aB as O,bS as Ee,cA as k,dA as De,eA as Oe,eC as ke,fA as Ae,gA as je,hA as Me,iA as Ne,jS as Pe,jk as A,kS as Fe,lA as j,mA as Ie,nA as Le,nC as Re,oA as M,oB as N,pA as ze,qS as Be,rA as Ve,sA as P,t as F,tA as He,tC as Ue,uA as We,vA as Ge,wS as Ke,xS as qe,yA as Je,yS as Ye,zS as Xe,zk as Ze}from"./api-Borb_oKz.js";import{t as Qe}from"./x-XSJ8VGVc.js";import{i as I,n as L,r as $e,t as et}from"./tabs-D7icC_cj.js";import{t as R}from"./button-Bcf40mKN.js";import{$ as z,Et as B,Gn as tt,H as nt,In as rt,Kn as it,Mn as at,Nn as ot,On as st,Q as V,Un as ct,X as H,Z as U,a as lt,at as ut,ct as W,et as G,i as dt,lt as ft,nt as pt,o as mt,ot as ht,q as gt,rt as _t,s as vt,tt as yt}from"./index-lMzb_P_p.js";import{n as bt}from"./TimeRangePicker-CdzW5P7l.js";import{t as K}from"./FilterBar-D8d3TG3L.js";import{t as xt}from"./AdvancedFilter-CYKmk_LK.js";import{t as St}from"./DataTableShell-CR2Pxo32.js";var Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=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`?Oe():n===`agent`?`${i()} - ${r}`:e}function Tt(){let e=N(F.me.getMe,{host:gt})?.role===`admin`,t=N(F.deliveryTiming.getDeliveryStatus,{}),n=O(F.deliveryTiming.startDeliveryRecord),r=O(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!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:Je()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()})]}),e?(0,J.jsx)(R,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?je():we()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(B,{variant:`secondary`,children:Me()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:Ie({time:ft(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?De():Ae()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(F.deliveryTiming.listDeliverySessions,{}),n=O(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[s,c]=(0,q.useState)(Y),[l,u]=(0,q.useState)(null),{from:d,to:f}=bt(s),p=s.to===`now`?1/0:f,m=r.trim()!==``||a!==`all`||s!==Y,ee=()=>{i(``),o(`all`),c(Y)},h=(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>=d&&t.startedAt<=p).map(e=>({...e,_id:e.sessionId}))},[t,r,a,d,p]),g=e=>{let t=new Set((h??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),l!==null&&r.includes(l)&&u(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(K,{q:r,onQChange:i,searchPlaceholder:j(),timeRange:s,onTimeRangeChange:c,onReset:ee,canReset:m,children:(0,J.jsxs)(H,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(z,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:`all`,children:k()}),(0,J.jsx)(V,{value:`active`,children:P()}),(0,J.jsx)(V,{value:`stopped`,children:M()})]})]})}),(0,J.jsx)(St,{title:We(),rows:h,emptyHint:A(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":l===e.sessionId?Ce():C(),onClick:()=>u(t=>t===e.sessionId?null:e.sessionId),children:l===e.sessionId?(0,J.jsx)(ot,{size:15,"aria-hidden":!0}):(0,J.jsx)(at,{size:15,"aria-hidden":!0})})},{header:Te(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:W(e.startedAt)})},{header:Ne(),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:W(e.stoppedAt)})},{header:Ve(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:Le(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:He(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(B,{variant:`secondary`,children:P()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:M()})}],rowActions:e?e=>[{label:E(),variant:`destructive`,onSelect:()=>g([e.sessionId])}]:void 0,bulkActions:e?[{label:E(),variant:`destructive`,onSelect:e=>g(e)}]:void 0,isExpanded:e=>e.sessionId===l,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.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,J.jsx)(`p`,{className:`oc-admin__hint`,children:xe()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ze()});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,` `,o()]}),(0,J.jsxs)(R,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(ct,{size:13,"aria-hidden":!0}):(0,J.jsx)(rt,{size:13,"aria-hidden":!0}),t?b():x()]})]}),(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:g()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:w()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:c()})]})}),(0,J.jsxs)(`tbody`,{children:[i(Ze(),r.bridge),i(de(),r.A),i(y(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:m()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:T()},{value:`principalType`,label:D()},{value:`direction`,label:`direction`},{value:`roleKey`,label:v()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=it({from:`/settings/traces`}),t=tt({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,m=e.roleKey??Q,g=e.q??``,_=e.correlationId,v=dt(e.from,e.to),y=(0,q.useMemo)(()=>vt(e.adv),[e.adv]),{from:b,to:x}=bt(v),[S,C]=(0,q.useState)(null),[de,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}),xe=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),Ce=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),we=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),Te=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,...mt(e)})}),Ee=e=>void t({search:t=>({...t,adv:lt(e)}),replace:!0}),k=N(F.observability.listEvents,{limit:n}),De=N(F.observability.listEvents,{limit:n,kind:i===Z?void 0:i,..._?{correlationId:_}:{},filter:{q:g||void 0,from:b,to:x,statusClass:o===Q?void 0:o,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:m===Q?void 0:m,advanced:y.length>0?y:void 0}}),Oe=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),Ae=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),je=g!==``||o!==Q||c!==Q||u!==Q||m!==Q||y.length>0||v.kind!==`relative`||v.from!==Nt.from;function Me(){t({search:{limit:100,kind:`all`},replace:!0})}let Ne=S?k?.filter(e=>e.correlationId===S):De,A=e.section,j=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(et,{value:A,onValueChange:e=>j(e),children:[(0,J.jsxs)($e,{className:`w-full`,children:[(0,J.jsxs)(I,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(st,{size:13,"aria-hidden":!0}),ve()]}),(0,J.jsxs)(I,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),he()]})]}),(0,J.jsx)(L,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(L,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Re(),(0,J.jsx)(`strong`,{children:Ue()}),ke(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:r()})]}),(0,J.jsxs)(K,{q:g,onQChange:D,searchPlaceholder:le(),timeRange:v,onTimeRangeChange:O,onReset:Me,canReset:je,children:[(0,J.jsxs)(H,{value:o,onValueChange:xe,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:Se()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:ye()}),At.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:c,onValueChange:Ce,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:be()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:ne()}),jt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:u,onValueChange:we,children:[(0,J.jsx)(z,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{placeholder:Be()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:re()}),Mt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(H,{value:m,onValueChange:Te,children:[(0,J.jsx)(z,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{placeholder:ee()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{value:Q,children:_e()}),Ae.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:i===Z?``:i,placeholder:me(),"aria-label":me(),onChange:e=>{let t=e.target.value.trim();E(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:Oe.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(H,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,J.jsx)(z,{size:`sm`,className:`w-28`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(U,{children:kt.map(e=>(0,J.jsx)(V,{value:String(e),children:h({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:y,onChange:Ee}),S?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:ge(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[s(),(0,J.jsx)(`code`,{children:$(S)})]}),(0,J.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Xe()})]})}):null,(0,J.jsx)(St,{title:ue(),rows:Ne,emptyHint:S?ie():te(),columns:[{header:p(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:W(e.at)})},{header:ce(),sort:e=>e.kind,cell:e=>(0,J.jsx)(B,{variant:`secondary`,children:e.kind})},{header:oe(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(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":ae(),children:`✓`})}},{header:Pe(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(B,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:a(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(B,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Fe(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(B,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),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:d(),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 ${It(e.status)}`,children:e.status})},{header:f(),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:pe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Ke(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:l(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:fe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:de,onClose:()=>w(null)})]})]})}function It(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 Lt(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 Rt({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)(yt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(pt,{className:`max-w-lg`,children:[(0,J.jsxs)(ut,{children:[(0,J.jsxs)(ht,{className:`oc-traces__meta-title`,children:[qe(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(B,{variant:`outline`,children:Ee()})]}),(0,J.jsx)(_t,{children:Ye()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AD as r,BD as i,Bx as a,CD as o,Cp as s,DD as c,ED as l,FD as u,Fx as d,GD as f,Gx as p,HD as m,Hx as h,ID as ee,Ix as g,KD as _,LD as v,Lx as y,MD as te,ND as ne,Nx as b,OD as re,PD as ie,Px as x,RD as ae,Rx as S,SD as oe,Sp as C,TD as w,UD as se,Ux as T,VD as ce,Vx as E,WD as D,Wx as O,aB as k,bD as le,eD as ue,jD as de,kD as fe,oB as A,qD as j,t as M,wD as pe,wp as N,xD as me,yD as he,zD as ge,zx as P}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AD as r,BD as i,Bx as a,CD as o,Cp as s,DD as c,ED as l,FD as u,Fx as d,GD as f,Gx as p,HD as m,Hx as h,ID as ee,Ix as g,KD as _,LD as v,Lx as y,MD as te,ND as ne,Nx as b,OD as re,PD as ie,Px as x,RD as ae,Rx as S,SD as oe,Sp as C,TD as w,UD as se,Ux as T,VD as ce,Vx as E,WD as D,Wx as O,aB as k,bD as le,eD as ue,jD as de,kD as fe,oB as A,qD as j,t as M,wD as pe,wp as N,xD as me,yD as he,zD as ge,zx as P}from"./api-Borb_oKz.js";import{t as F}from"./button-Bcf40mKN.js";import{$ as I,Dt as L,Et as R,Ft as z,Gn as B,Kn as _e,Lt as ve,Mt as ye,Nt as be,Pt as xe,Q as V,U as Se,W as Ce,X as H,Z as U,at as we,c as W,et as G,fn as K,l as Te,nt as Ee,ot as De,pn as q,q as Oe,rt as ke,tt as Ae,u as J,ut as Y}from"./index-lMzb_P_p.js";import{t as je}from"./FilterBar-D8d3TG3L.js";import{t as Me}from"./DataTableShell-CR2Pxo32.js";import{t as Ne}from"./DetailChips-BttzOfap.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=A(M.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=A(M.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Z.jsx)(Ae,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Ee,{className:`oc-access`,children:[(0,Z.jsxs)(we,{children:[(0,Z.jsx)(De,{children:p({user:t})}),(0,Z.jsx)(ke,{children:O()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?T():h()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:E()}):u.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:S()}):[...d.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:o}){let s=k(M.agents.assignAgent),c=k(M.agents.removeAgent),l=k(M.agents.setDefaultAgent),u=L();if(!e)return null;async function f(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(a(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(P(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(q,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),a=o===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(Y,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":y({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)(R,{variant:`outline`,className:`oc-access__gone`,children:g()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:d()}):null,r?a?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":x(),title:x(),children:(0,Z.jsx)(K,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":b(),title:b(),disabled:c,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(K,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return C();case`user`:return s();case`admin`:return N();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(J[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ve,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?j():_({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(z,{children:f()}),W.map(e=>{let r=J[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(Y,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Te[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=B({from:`/settings/users`}),n=e.q??``,a=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=A(M.admin.listUsers,{filter:{q:n||void 0,role:a===Q?void 0:a},withAgents:!0}),p=A(M.me.getMe,{host:Oe}),h=k(M.admin.setRole),g=k(M.admin.setUserPermissions),_=k(M.admin.startImpersonation),y=k(M.admin.deleteUser),b=k(M.admin.setUserName),x=Se(),S=Ce(),C=L(),[T,E]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),j=n!==``||a!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){C.error(D(),e)}}async function F(e){try{await g(e)}catch(e){C.error(se(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ee(),description:u({user:t}),confirmWord:ie(),confirmLabel:ne(),destructive:!0}))try{await y({profileId:e._id}),C.success(de({user:t}))}catch(e){C.error(te(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:fe(),label:re({user:t}),placeholder:c(),defaultValue:e.name??``,confirmLabel:ue()});if(n!==null)try{await b({profileId:e._id,name:n}),C.success(l())}catch(e){C.error(w(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:s,searchPlaceholder:m(),onReset:N,canReset:j,children:(0,Z.jsxs)(H,{value:a,onValueChange:d,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{value:Q,children:ce()}),O.map(e=>(0,Z.jsx)(V,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:i(),rows:f,emptyHint:ge(),rowActions:e=>{let t=[{label:he(),onSelect:()=>E({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:r(),onSelect:()=>void z(e)}];return e.userId!==p?.userId&&t.push({label:ae(),onSelect:()=>void _({profileId:e._id})},{label:v(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:pe(),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:o(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(H,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(U,{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:oe(),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:me()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:le(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(q,{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:T?.profileId??null,userLabel:T?.label??``,open:T!==null,onOpenChange:e=>{e||E(null)}})]})}export{Le as UsersTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,$r as i,$z as ee,Bn as te,En as ne,Gn as a,Gr as o,If as s,Jr as c,Kn as l,Kr as u,Qn as d,Qr as f,Rn as re,Un as p,Vn as m,Wn as h,Xn as g,Xr as _,Yn as v,Yr as y,ZO as b,Zn as x,Zr as S,Zz as C,aB as w,ai as ie,ci as ae,dd as oe,di as T,ei as se,fi as ce,hi as E,ii as D,li as O,mi as k,ni as A,oB as j,oi as le,or as ue,pd as de,pi as fe,qr as pe,rB as M,ri as N,si as P,t as F,ti as I,ui as L,zn as R}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,$r as i,$z as ee,Bn as te,En as ne,Gn as a,Gr as o,If as s,Jr as c,Kn as l,Kr as u,Qn as d,Qr as f,Rn as re,Un as p,Vn as m,Wn as h,Xn as g,Xr as _,Yn as v,Yr as y,ZO as b,Zn as x,Zr as S,Zz as C,aB as w,ai as ie,ci as ae,dd as oe,di as T,ei as se,fi as ce,hi as E,ii as D,li as O,mi as k,ni as A,oB as j,oi as le,or as ue,pd as de,pi as fe,qr as pe,rB as M,ri as N,si as P,t as F,ti as I,ui as L,zn as R}from"./api-Borb_oKz.js";import{i as z,n as B,r as me,t as he}from"./tabs-D7icC_cj.js";import{t as V}from"./button-Bcf40mKN.js";import{$ as H,$t as ge,Cn as _e,Et as U,Gn as ve,Kn as ye,Q as W,Wn as be,X as G,Z as K,an as xe,en as Se,et as q,in as J,nn as Ce,q as we,rn as Y,sn as Te,tn as Ee,ut as X}from"./index-lMzb_P_p.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>ae()],[`fr-FR`,()=>r()],[`en-US`,()=>d()],[`en-GB`,()=>x()],[`de-DE`,()=>g()],[`es-ES`,()=>v()]],Oe=[[`0.75`,()=>le()],[`1`,()=>ie()],[`1.25`,()=>D()],[`1.5`,()=>N()]],$=0;function ke({instance:e}){let t=w(F.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),[c,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(!1),[p,h]=(0,Z.useState)(!1),g=M(F.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 _=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function v(){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)(X,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":L()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:L()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":m(),children:(0,Q.jsx)(q,{})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(W,{value:`browser`,children:te()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:R()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{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)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":P(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{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)(X,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":A()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!_||c===`saving`,onClick:()=>void v(),children:c===`saving`?s():de()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!a.enabled||u,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(h(!1),J(),Y(),a.engine!==`gateway`){Ce(f(),{lang:Ee(a.lang,ee()),rate:t});return}d(!0),g({instanceName:e.name,text:f()}).then(({mime:e,audioBase64:r})=>{n===$&&Se(r,e,{rate:t})}).catch(()=>{n===$&&h(!0)}).finally(()=>d(!1))},children:u?s():se()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,d(!1),J(),Y()},children:i()})]}),c===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?ne():oe()}):null]})}function Ae({stt:e}){let t=j(F.me.getMe,{host:we}),n=w(F.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:_()}),(0,Q.jsx)(U,{variant:e?`secondary`:`outline`,children:e?u():o()}),(0,Q.jsx)(U,{variant:r?`secondary`:`destructive`,children:r?a():h()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":l()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]})}function je(){let e=j(F.admin.listInstances,{}),t=(0,Z.useMemo)(()=>xe(),[]),n=(0,Z.useMemo)(()=>ge(),[]),{section:r}=ye({from:`/settings/voice`}),i=ve({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(U,{variant:t?`secondary`:`destructive`,children:t?k():fe()}),(0,Q.jsx)(U,{variant:n?`secondary`:`destructive`,children:n?ce():T()})]}),(0,Q.jsxs)(he,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(me,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),p()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(_e,{size:13,"aria-hidden":!0}),_()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),c()]})]}),(0,Q.jsx)(B,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):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:c()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:pe()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=w(F.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:ue()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":b()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()})]})]})}export{je as VoiceTab};
|