@lacneu/atrium 0.62.2 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/assets/AccessTab-CBVHd2Iu.js +1 -0
  2. package/dist/assets/AdvancedFilter-Bt1eVvHP.js +1 -0
  3. package/dist/assets/AgentFilesTab-BohV-adj.js +3 -0
  4. package/dist/assets/AnomaliesTab-EQ_VT5g5.js +1 -0
  5. package/dist/assets/AuditTab-BNbnYz56.js +1 -0
  6. package/dist/assets/BridgeTab-BvWUat6m.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-e5KaQK3Y.js +1 -0
  8. package/dist/assets/DataTableShell-C8TvrDnS.js +1 -0
  9. package/dist/assets/DetailChips-KZ6IBAE_.js +1 -0
  10. package/dist/assets/FeedbacksTab-CNE_EiBr.js +1 -0
  11. package/dist/assets/{FieldLabel-z7bxzKHq.js → FieldLabel-DSkWwP2e.js} +2 -2
  12. package/dist/assets/FilesTab-BVwtwtbk.js +1 -0
  13. package/dist/assets/FilterBar-D1X-NYiQ.js +1 -0
  14. package/dist/assets/GroupsTab-CCbkJsjt.js +1 -0
  15. package/dist/assets/InstancesTab-mcPK_zLE.js +1 -0
  16. package/dist/assets/IntegrationsTab-CelkZ3qy.js +1 -0
  17. package/dist/assets/KpiTab-Bci6HkZZ.js +1 -0
  18. package/dist/assets/PreferencesTab-C_G9wJMM.js +1 -0
  19. package/dist/assets/ProjectPage-Bzczemnc.js +1 -0
  20. package/dist/assets/ProjectPage-LzMKBi2V.css +1 -0
  21. package/dist/assets/PromptInjectionsTab-DB-9icKP.js +4 -0
  22. package/dist/assets/RolesTab-6KibifRX.js +1 -0
  23. package/dist/assets/ScheduledTab-D4HfwMsR.js +1 -0
  24. package/dist/assets/ServiceAccountsTab-BP5M1qoc.js +1 -0
  25. package/dist/assets/SubAgentReportsTab-clUXZIsv.js +1 -0
  26. package/dist/assets/ThemeShowroom-DObwBmje.js +1 -0
  27. package/dist/assets/TimeRangePicker-Cc-m21ii.js +1 -0
  28. package/dist/assets/TimezoneCombobox-bRTawtDX.js +1 -0
  29. package/dist/assets/TracesTab-BCArDQYw.js +1 -0
  30. package/dist/assets/UsersTab-htPZvQ3W.js +1 -0
  31. package/dist/assets/VoiceTab-DrlhpckV.js +1 -0
  32. package/dist/assets/{button-BtQwDeC7.js → button-9CDM33ms.js} +1 -1
  33. package/dist/assets/{card-BbBjwTkQ.js → card-cbtxUmVi.js} +1 -1
  34. package/dist/assets/check-DP-dt0kl.js +1 -0
  35. package/dist/assets/chevron-up-Zim_BdlH.js +1 -0
  36. package/dist/assets/chevrons-up-down-Dynznz1g.js +1 -0
  37. package/dist/assets/{compatView-BvZyYwOM.js → compatView-zajsEi96.js} +1 -1
  38. package/dist/assets/confTabs-CCBW5ofF.css +1 -0
  39. package/dist/assets/{dispatchErrorInfo-CjAxcZ1X.js → dispatchErrorInfo-BwVeZJIC.js} +1 -1
  40. package/dist/assets/dist-BOEXkJhX.js +1 -0
  41. package/dist/assets/dist-CKeB-cox.js +44 -0
  42. package/dist/assets/{dist-CHUv7VZU.js → dist-CVc9CU_a.js} +1 -1
  43. package/dist/assets/dist-_mTpkDcR.js +1 -0
  44. package/dist/assets/{highlighted-body-OFNGDK62-D3YWtB-x.js → highlighted-body-OFNGDK62-CB68xClL.js} +1 -1
  45. package/dist/assets/index-Bjld8kqu.js +238 -0
  46. package/dist/assets/index-CjUx3yzx.css +1 -0
  47. package/dist/assets/list-AW1nQPBF.js +1 -0
  48. package/dist/assets/mermaid-GHXKKRXX-ms4fjIoL.js +1 -0
  49. package/dist/assets/{pdf-BAfFGrd0.js → pdf-TGis77gc.js} +1 -1
  50. package/dist/assets/roleDescriptions-BIxax60M.js +1 -0
  51. package/dist/assets/{table-C9PafBK9.js → table-QZEG8lub.js} +1 -1
  52. package/dist/assets/{tabs-CQ2rDwF5.js → tabs-XFZCx7lK.js} +1 -1
  53. package/dist/assets/x-DJVrcLrv.js +1 -0
  54. package/dist/index.html +11 -9
  55. package/package.json +1 -1
  56. package/dist/assets/AccessTab-C0DMrq_T.js +0 -1
  57. package/dist/assets/AdvancedFilter-CjfYhQlT.js +0 -1
  58. package/dist/assets/AgentFilesTab-Vt7ogGL4.js +0 -3
  59. package/dist/assets/AnomaliesTab-Bl8B8nuQ.js +0 -1
  60. package/dist/assets/AuditTab-Jv3VbFgH.js +0 -1
  61. package/dist/assets/BridgeTab-BURazhGl.js +0 -1
  62. package/dist/assets/ChatDefaultsTab-A2iJG8ZL.js +0 -1
  63. package/dist/assets/DataTableShell-zzaGmfMk.js +0 -1
  64. package/dist/assets/DetailChips-DNNrvZqq.js +0 -1
  65. package/dist/assets/FeedbacksTab-ChZeDaM6.js +0 -1
  66. package/dist/assets/FilesTab-jc4m4WW7.js +0 -1
  67. package/dist/assets/FilterBar-DRRfKRTQ.js +0 -1
  68. package/dist/assets/GroupsTab-HTPhJMAF.js +0 -1
  69. package/dist/assets/InstancesTab-DUwMvn_C.js +0 -1
  70. package/dist/assets/IntegrationsTab-2PvwRR8s.js +0 -1
  71. package/dist/assets/KpiTab-D4aTV56S.js +0 -1
  72. package/dist/assets/PreferencesTab-LYojtSoz.js +0 -1
  73. package/dist/assets/PromptInjectionsTab-DN8RscNv.js +0 -4
  74. package/dist/assets/RolesTab-BexLEI7q.js +0 -1
  75. package/dist/assets/ScheduledTab-Cm1PSyqy.js +0 -1
  76. package/dist/assets/ServiceAccountsTab-Krm3IzaJ.js +0 -1
  77. package/dist/assets/SubAgentReportsTab-DJNmIHbP.js +0 -1
  78. package/dist/assets/ThemeShowroom-CN7-gPFJ.js +0 -1
  79. package/dist/assets/TimeRangePicker-BPVkrNZN.js +0 -1
  80. package/dist/assets/TracesTab-BTN0YBPo.js +0 -1
  81. package/dist/assets/UsersTab-CclKbkrB.js +0 -1
  82. package/dist/assets/VoiceTab-DS6LrGiz.js +0 -1
  83. package/dist/assets/chevrons-up-down-ImFHIr_N.js +0 -1
  84. package/dist/assets/confTabs-hdeEtaLm.css +0 -1
  85. package/dist/assets/dist-BCNlHm__.js +0 -1
  86. package/dist/assets/dist-CNZ9o3sc.js +0 -44
  87. package/dist/assets/dist-VGy3W8j2.js +0 -1
  88. package/dist/assets/index-9R1hg_pA.js +0 -238
  89. package/dist/assets/index-jScX6cAP.css +0 -2
  90. package/dist/assets/mermaid-GHXKKRXX-DM0jE2ZW.js +0 -1
  91. package/dist/assets/roleDescriptions-DGSYA21e.js +0 -1
  92. package/dist/assets/x-BR1chqO3.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AP as r,BN as i,BP as a,CF as o,D as s,DF as c,DN as l,DP as u,EF as d,EP as f,FN as p,GI as m,GN as ee,GP as te,HN as ne,HP as re,IN as ie,JN as ae,JP as oe,KN as se,KP as h,LN as ce,MP as le,NN as ue,NP as de,OF as fe,OP as pe,PN as me,PP as he,QP as ge,RN as _e,RP as ve,SF as ye,T as g,TF as be,UN as xe,UP as Se,VN as Ce,VP as we,WN as Te,WP as Ee,XN as De,XP as Oe,YN as ke,YP as Ae,ZI as _,ZP as je,_F as Me,_P as Ne,bF as Pe,bP as Fe,cP as v,dP as Ie,eL as Le,fP as y,gF as Re,gP as ze,hF as Be,hP as Ve,jP as He,kF as Ue,kP as We,lP as Ge,mP as Ke,oP as qe,pP as Je,qI as b,qN as Ye,sP as Xe,uP as x,vF as Ze,vP as Qe,wF as $e,xF as et,xP as S,yF as tt,yP as nt,zN as rt,zP as it}from"./dist-CKeB-cox.js";import{t as at}from"./list-AW1nQPBF.js";import{t as C}from"./button-9CDM33ms.js";import{$ as ot,At as w,Ct as st,Dt as T,Et as E,Lt as ct,Mn as D,Ot as O,St as lt,Tt as k,X as ut,Y as dt,_t as ft,at as pt,bn as mt,bt as ht,cn as gt,et as _t,gt as A,in as vt,it as yt,jn as j,jt as M,kt as N,mn as bt,nt as xt,ot as St,pn as Ct,qt as wt,rt as Tt,tn as Et,tt as Dt,un as Ot,vt as kt,wt as P,xt as At,yt as jt}from"./index-Bjld8kqu.js";import{a as Mt,i as F,n as Nt,o as Pt,r as I,t as Ft}from"./table-QZEG8lub.js";import{t as It}from"./FilterBar-D1X-NYiQ.js";/* empty css */import{a as L,c as Lt,i as Rt,l as zt,n as Bt,o as Vt,r as Ht,s as R,t as Ut}from"./TimezoneCombobox-bRTawtDX.js";var Wt=s(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Gt=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),z=t(e(),1),B=n();function V(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Kt({value:e,onChange:t}){let n=Lt(e),r=(0,z.useMemo)(()=>new Date,[]),[i,a]=(0,z.useState)(()=>({year:n?.year??r.getFullYear(),month:n?.month??r.getMonth()})),[o,s]=(0,z.useState)(!1),c=(0,z.useMemo)(()=>V(b()),[]),l=(0,z.useMemo)(()=>new Intl.DateTimeFormat(b(),{month:`long`,year:`numeric`}),[]),u=(0,z.useMemo)(()=>new Intl.DateTimeFormat(b(),{dateStyle:`medium`,timeStyle:`short`}),[]),d=R(i.year,i.month),f=n?.hour??9,p=n?.minute??0,m=(e,n,r,i,a)=>t(zt(e,n,r,i,a)),ee=(e,t,n)=>{a({year:e,month:t}),m(e,t,n,f,p)},te=e=>{let t=new Date(i.year,i.month+e,1);a({year:t.getFullYear(),month:t.getMonth()})},ne=n===null?Fe():u.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,B.jsxs)(P,{modal:!0,open:o,onOpenChange:s,children:[(0,B.jsx)(E,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":S(),children:[(0,B.jsx)(Wt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,B.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:ne})]})}),(0,B.jsxs)(k,{align:`start`,className:`oc-dtp__pop`,children:[(0,B.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":nt(),onClick:()=>te(-1),children:(0,B.jsx)(D,{size:15,"aria-hidden":!0})}),(0,B.jsx)(`span`,{className:`oc-dtp__month`,children:l.format(new Date(i.year,i.month,1))}),(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":Qe(),onClick:()=>te(1),children:(0,B.jsx)(j,{size:15,"aria-hidden":!0})})]}),(0,B.jsxs)(`div`,{className:`oc-dtp__grid`,children:[c.map((e,t)=>(0,B.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),d.map((e,t)=>{let i=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,B.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(i?` oc-dtp__day--sel`:``)+(a&&!i?` oc-dtp__day--today`:``),onClick:()=>ee(e.year,e.month,e.day),children:e.day},t)})]}),(0,B.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,B.jsxs)(T,{value:String(f),onValueChange:e=>m(i.year,i.month,n?.day??r.getDate(),Number(e),p),children:[(0,B.jsx)(w,{size:`sm`,"aria-label":Ne(),children:(0,B.jsx)(M,{})}),(0,B.jsx)(O,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,B.jsx)(N,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,B.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,B.jsxs)(T,{value:String(p),onValueChange:e=>m(i.year,i.month,n?.day??r.getDate(),f,Number(e)),children:[(0,B.jsx)(w,{size:`sm`,"aria-label":ze(),children:(0,B.jsx)(M,{})}),(0,B.jsx)(O,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,B.jsx)(N,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function H(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function qt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function Jt(e){let t=new Map;for(let n of e){let e=H(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function U(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(qt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function Yt(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Xt(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function Zt(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var W=3;function Qt({events:e,mode:t,cursor:n,onModeChange:r,onCursorChange:i,onEventClick:a,footnote:o}){let s=b(),c=(0,z.useMemo)(()=>Jt(e),[e]),l=(0,z.useMemo)(()=>Yt(s),[s]),u=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`,year:`numeric`}),[s]),d=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`}),[s]),f=(0,z.useMemo)(()=>new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}),[s]),p=new Date,m=e=>{if(t===`year`){i({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);i({year:r.getFullYear(),month:r.getMonth()})},ee=t===`year`?String(n.year):u.format(new Date(n.year,n.month,1));return(0,B.jsxs)(`div`,{className:`oc-cal`,children:[(0,B.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,B.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":Ge(),onClick:()=>m(-1),children:(0,B.jsx)(D,{})}),(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":v(),onClick:()=>m(1),children:(0,B.jsx)(j,{})}),(0,B.jsx)(C,{variant:`ghost`,size:`sm`,onClick:()=>i({year:p.getFullYear(),month:p.getMonth()}),children:x()})]}),(0,B.jsx)(`span`,{className:`oc-cal__title`,children:ee}),(0,B.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,B.jsx)(C,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>r(`month`),children:y()}),(0,B.jsx)(C,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>r(`year`),children:Ie()})]})]}),t===`month`?(0,B.jsx)($t,{cursor:n,byDay:c,weekdays:l,timeFmt:f,now:p,onEventClick:a}):(0,B.jsx)(en,{year:n.year,byDay:c,monthShortFmt:d,now:p,onOpenMonth:e=>{i({year:n.year,month:e}),r(`month`)}}),o?(0,B.jsx)(`p`,{className:`oc-cal__footnote`,children:o}):null]})}function $t({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=R(e.year,e.month);return(0,B.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,B.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(qt(e.year,e.month,e.day))??[],s=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,B.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(s?` oc-cal__day--today`:``),children:[(0,B.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,W).map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,B.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,B.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>W?(0,B.jsx)(`span`,{className:`oc-cal__more`,children:Xe({count:o.length-W})}):null]},n)})]})}function en({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,B.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=U(t,e,o),c=R(e,o);return(0,B.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,B.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,B.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,B.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var G={h:36e5,min:6e4,s:1e3,ms:1};function tn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*G[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function K(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function q(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=K(t[0],0,59),r=K(t[1],0,23),i=K(t[2],1,31),a=K(t[3],1,12),o=K(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var J=new Map;function Y(e){let t=J.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return J.set(e,n),n}function nn(e,t){if(t!==null){let n=Y(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function X(e,t,n,r,i,a){if(a===null||Y(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=nn(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function Z(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=q(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=nn(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=X(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=X(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Q=`crons`;function rn(e,t){return`${e}${t}`}function an(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=rn(a.instanceName,e.id);i.set(o,a);let s=Z(e.enabled===!1?null:tn(e.schedule),e.nextRunAtMs,t,n);for(let t of s)r.push({id:`${o}:${t.atMs}`,sourceId:Q,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:e.enabled===!1,exact:t.exact})}return{events:r,byItemId:i}}var $={minutes:6e4,hours:36e5,days:864e5};function on(e){return e?.data?.code??`unknown`}function sn({status:e}){switch(L(e)){case`ok`:return(0,B.jsx)(A,{variant:`secondary`,children:de()});case`error`:return(0,B.jsx)(A,{variant:`destructive`,children:le()});case`running`:return(0,B.jsx)(A,{variant:`outline`,children:He()});case`other`:return(0,B.jsx)(A,{variant:`outline`,children:e});case`none`:return(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function cn(){let e=_(g.scheduled.listMyCrons),t=_(g.scheduled.getCronDetail),n=_(g.scheduled.listCronRuns),s=_(g.scheduled.updateCron),Ne=_(g.scheduled.removeCron),Fe=_(g.scheduled.runCronNow),v=wt(),Ie=Le(g.me.getMe,{host:ct})?.timezone,[y,ze]=(0,z.useState)(null),[Ge,Xe]=(0,z.useState)(!1),[x,Qe]=(0,z.useState)(!1),[S,nt]=(0,z.useState)(null),[E,D]=(0,z.useState)(null),[k,j]=(0,z.useState)(null),[P,L]=(0,z.useState)(null),[Lt,zt]=(0,z.useState)(!1),[R,V]=(0,z.useState)(Bt),[H,qt]=(0,z.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),Jt=e=>{localStorage.setItem(`oc.sched.view`,e),qt(e)},[U,Yt]=(0,z.useState)(`month`),[W,$t]=(0,z.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),en=(0,z.useMemo)(()=>{let e=[];for(let t of y??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Rt(r,R)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[y,R]),G=(0,z.useMemo)(()=>U===`year`?Zt(W.year):Xt(W.year,W.month),[U,W]),tn=(0,z.useMemo)(()=>an(en,G.startMs,G.endMs),[en,G]),K=e=>{let t=tn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||cn(t.instanceName,t.job)},q=(0,z.useCallback)(async()=>{Xe(!0),Qe(!1);try{ze(await e({}))}catch{Qe(!0)}finally{Xe(!1)}},[e]);(0,z.useEffect)(()=>{q()},[q]);let J=(0,z.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),Y=(0,z.useRef)(null);(0,z.useEffect)(()=>{y!==null&&Y.current!==null&&Y.current.scrollIntoView({block:`center`})},[y]);let nn=(0,z.useMemo)(()=>new Intl.DateTimeFormat(b(),{dateStyle:`medium`,timeStyle:`short`}),[]),X=async(e,t,n)=>{nt(e);try{await t(),v.success(n),await q()}catch(e){v.toast({variant:`error`,title:h({code:on(e)})})}finally{nt(null)}},Z=(0,z.useRef)(0),Q=(0,z.useRef)(0),rn=async(e,t)=>{if(t.id===null)return;let r=++Z.current;j({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Z.current)return;j({name:t.name??t.id,entries:i})}catch(e){if(r!==Z.current)return;j(null),v.toast({variant:`error`,title:h({code:on(e)})})}},cn=async(e,n)=>{if(n.id===null)return;let r=++Q.current;L({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%$.days===0?(s=String(e/$.days),c=`days`):e%$.hours===0?(s=String(e/$.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/$.minutes))),c=`minutes`))}if(r!==Q.current)return;L(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==Q.current)return;L(null),v.toast({variant:`error`,title:h({code:on(e)})})}},ln=async()=>{if(P===null)return;let e={};if(P.nameDirty&&P.name.trim()===``||P.messageDirty&&P.hasMessage&&P.message.trim()===``){v.toast({variant:`error`,title:ue()});return}if(P.nameDirty&&P.name.trim()!==``&&(e.name=P.name.trim()),P.scheduleDirty){if(P.scheduleKind===`cron`&&P.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:P.cronExpr.trim(),...P.tz.trim()===``?{}:{tz:P.tz.trim()}};else if(P.scheduleKind===`every`){let t=Number(P.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*$[P.everyUnit])})}else if(P.scheduleKind===`at`&&P.at!==``){let t=Date.parse(P.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(P.scheduleDirty&&e.schedule===void 0){v.toast({variant:`error`,title:me()});return}if(P.messageDirty&&P.hasMessage&&P.message.trim()!==``&&(e.message=P.message.trim()),Object.keys(e).length===0){L(null);return}let t=Q.current;zt(!0);try{await s({instanceName:P.instanceName,jobId:P.jobId,patch:e}),v.success(Ye()),t===Q.current&&L(null),await q()}catch(e){v.toast({variant:`error`,title:h({code:on(e)})})}finally{zt(!1)}},un=y?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,B.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Ue()}),(0,B.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":Ve(),children:[(0,B.jsx)(C,{variant:H===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Ke(),title:Ke(),"aria-pressed":H===`list`,onClick:()=>Jt(`list`),children:(0,B.jsx)(at,{})}),(0,B.jsx)(C,{variant:H===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Je(),title:Je(),"aria-pressed":H===`calendar`,onClick:()=>Jt(`calendar`),children:(0,B.jsx)(Wt,{})})]}),(0,B.jsxs)(C,{variant:`ghost`,size:`sm`,onClick:()=>void q(),disabled:Ge,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,B.jsx)(gt,{size:14,"aria-hidden":!0}),fe()]})]}),y!==null&&un>0?(0,B.jsxs)(It,{q:R.q,onQChange:e=>V(t=>({...t,q:e})),searchPlaceholder:We(),onReset:()=>V(Bt),canReset:Ht(R),children:[(0,B.jsxs)(T,{value:R.state,onValueChange:e=>V(t=>({...t,state:e})),children:[(0,B.jsx)(w,{size:`sm`,className:`w-40`,children:(0,B.jsx)(M,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(N,{value:`all`,children:pe()}),(0,B.jsx)(N,{value:`active`,children:Be()}),(0,B.jsx)(N,{value:`paused`,children:Re()})]})]}),(0,B.jsxs)(T,{value:R.result,onValueChange:e=>V(t=>({...t,result:e})),children:[(0,B.jsx)(w,{size:`sm`,className:`w-40`,children:(0,B.jsx)(M,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(N,{value:`all`,children:u()}),(0,B.jsx)(N,{value:`ok`,children:de()}),(0,B.jsx)(N,{value:`error`,children:le()}),(0,B.jsx)(N,{value:`running`,children:He()}),(0,B.jsx)(N,{value:`none`,children:r()})]})]})]}):null,y===null?(0,B.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":Ge,children:x?c():m()}):H===`calendar`?(0,B.jsxs)(B.Fragment,{children:[x?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):null,y.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,B.jsx)(Qt,{events:tn.events,mode:U,cursor:W,onModeChange:Yt,onCursorChange:$t,onEventClick:K,footnote:qe()})]}):(0,B.jsxs)(B.Fragment,{children:[x?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):null,y.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,y.map(e=>{let t=e.jobs.filter(e=>Rt(e,R)),n=Ht(R)&&e.jobs.length>0&&t.length===0;return(0,B.jsxs)(`section`,{style:{marginBottom:20},children:[y.length>1||e.error||!e.supported?(0,B.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,B.jsx)(A,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:$e({code:e.error})}):e.jobs.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):n?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,B.jsxs)(Ft,{children:[(0,B.jsx)(Mt,{children:(0,B.jsxs)(Pt,{children:[(0,B.jsx)(F,{children:ye()}),(0,B.jsx)(F,{children:et()}),(0,B.jsx)(F,{children:Pe()}),(0,B.jsx)(F,{children:tt()}),(0,B.jsx)(F,{children:Ze()}),(0,B.jsx)(F,{children:he()}),(0,B.jsx)(F,{children:De()})]})}),(0,B.jsx)(Nt,{children:t.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,i=S===r,a=e.manageSupported,o=e.kind===`openclaw`&&a;return(0,B.jsxs)(Pt,{ref:t.id!==null&&t.id===J?Y:void 0,"data-state":t.id!==null&&t.id===J?`selected`:void 0,children:[(0,B.jsx)(I,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Me()}),(0,B.jsx)(I,{children:(0,B.jsx)(A,{variant:`secondary`,children:t.agentId})}),(0,B.jsxs)(I,{className:`whitespace-nowrap`,children:[(0,B.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=dt(t.schedule),n=e===null?null:ut(e);return n===null?null:(0,B.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,B.jsx)(I,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:nn.format(t.nextRunAtMs)}),(0,B.jsx)(I,{children:Vt(t.enabled)===`active`?(0,B.jsx)(A,{variant:`secondary`,children:Be()}):Vt(t.enabled)===`paused`?(0,B.jsx)(A,{variant:`outline`,children:Re()}):(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,B.jsx)(I,{children:(0,B.jsx)(sn,{status:t.lastRunStatus})}),(0,B.jsx)(I,{className:`whitespace-nowrap`,children:t.id===null?(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):i?(0,B.jsx)(mt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,B.jsxs)(`span`,{className:`oc-cronactions`,children:[o?(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:je(),"aria-label":je(),disabled:S!==null,onClick:()=>void X(r,async()=>{let n=await Fe({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},te()),children:(0,B.jsx)(Et,{size:14,"aria-hidden":!0})}):null,o&&t.enabled!==null?(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:t.enabled?Oe():Ae(),"aria-label":t.enabled?Oe():Ae(),disabled:S!==null,onClick:()=>void X(r,()=>s({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?Ee():Se()),children:t.enabled?(0,B.jsx)(bt,{size:14,"aria-hidden":!0}):(0,B.jsx)(Ot,{size:14,"aria-hidden":!0})}):null,o?(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:ke(),"aria-label":ke(),disabled:S!==null,onClick:()=>void cn(e.instanceName,t),children:(0,B.jsx)(Ct,{size:14,"aria-hidden":!0})}):null,o?(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:S!==null,onClick:()=>void rn(e.instanceName,t),children:(0,B.jsx)(Gt,{size:14,"aria-hidden":!0})}):null,a?(0,B.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:oe(),"aria-label":oe(),disabled:S!==null,onClick:()=>D({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,B.jsx)(vt,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:be()})]},e.instanceName)}),un>0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:l()}):null]}),(0,B.jsx)(ot,{open:E!==null,onOpenChange:e=>{e||D(null)},children:(0,B.jsxs)(xt,{children:[(0,B.jsxs)(pt,{children:[(0,B.jsx)(St,{children:we()}),(0,B.jsx)(Tt,{children:a({name:E?.name??``})})]}),(0,B.jsxs)(yt,{children:[(0,B.jsx)(Dt,{children:it()}),(0,B.jsx)(_t,{onClick:()=>{let e=E;D(null),e!==null&&X(`${e.instanceName}:${e.jobId}`,()=>Ne({instanceName:e.instanceName,jobId:e.jobId}),re())},children:ve()})]})]})}),(0,B.jsx)(kt,{open:k!==null,onOpenChange:e=>{e||(Z.current++,j(null))},children:(0,B.jsxs)(jt,{style:{maxWidth:640},children:[(0,B.jsx)(lt,{children:(0,B.jsx)(st,{children:se({name:k?.name??``})})}),k?.entries===null?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):k!==null&&k.entries.length===0?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):k===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:k.entries.map((e,t)=>(0,B.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,B.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,B.jsx)(sn,{status:e.status}),(0,B.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?nn.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,B.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,B.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,B.jsx)(kt,{open:P!==null,onOpenChange:e=>{e||(Q.current++,L(null))},children:(0,B.jsxs)(jt,{className:`oc-cronedit`,children:[(0,B.jsxs)(lt,{children:[(0,B.jsx)(st,{children:Te()}),(0,B.jsx)(ht,{children:xe()})]}),P===null?null:P.loading?(0,B.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,B.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ye()}),(0,B.jsx)(ft,{value:P.name,maxLength:200,onChange:e=>L({...P,name:e.target.value,nameDirty:!0})})]}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ne()}),(0,B.jsxs)(T,{value:P.scheduleKind,onValueChange:e=>L({...P,scheduleKind:e,scheduleDirty:!0}),children:[(0,B.jsx)(w,{children:(0,B.jsx)(M,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(N,{value:`cron`,children:Ce()}),(0,B.jsx)(N,{value:`every`,children:i()}),(0,B.jsx)(N,{value:`at`,children:rt()})]})]}),P.scheduleKind===`cron`?(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,B.jsx)(ft,{value:P.cronExpr,onChange:e=>L({...P,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,B.jsx)(Ut,{value:P.tz,onChange:e=>L({...P,tz:e,scheduleDirty:!0}),fallbackTz:Ie??void 0})]}):P.scheduleKind===`every`?(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,B.jsx)(ft,{type:`number`,min:1,value:P.everyValue,onChange:e=>L({...P,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,B.jsxs)(T,{value:P.everyUnit,onValueChange:e=>L({...P,everyUnit:e,scheduleDirty:!0}),children:[(0,B.jsx)(w,{style:{maxWidth:160},children:(0,B.jsx)(M,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(N,{value:`minutes`,children:_e()}),(0,B.jsx)(N,{value:`hours`,children:ce()}),(0,B.jsx)(N,{value:`days`,children:ie()})]})]})]}):(0,B.jsx)(Kt,{value:P.at,onChange:e=>L({...P,at:e,scheduleDirty:!0})})]}),P.hasMessage?(0,B.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,B.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ge()}),(0,B.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:P.message,onChange:e=>L({...P,message:e.target.value,messageDirty:!0})})]}):null]}),(0,B.jsxs)(At,{children:[(0,B.jsx)(C,{variant:`ghost`,onClick:()=>L(null),children:it()}),(0,B.jsxs)(C,{onClick:()=>void ln(),disabled:P===null||P.loading||Lt,children:[Lt?(0,B.jsx)(mt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,p()]})]})]})})]})}export{cn as ScheduledTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$I as i,$k as a,AA as ee,BA as te,CA as ne,DA as re,EA as ie,FA as ae,GA as oe,HA as se,IA as ce,JA as le,Jk as o,KA as ue,LA as de,MA as fe,NA as pe,OA as me,PA as he,QA as ge,Qk as s,RA as _e,SA as ve,T as c,TA as ye,UA as be,VA as xe,WA as Se,XA as Ce,Xk as we,YA as Te,Yk as Ee,ZA as De,ZI as Oe,Zk as ke,_A as l,aA as u,aj as Ae,bA as je,cA as d,cj as f,dA as p,dj as Me,eA as m,eL as h,ej as Ne,fA as g,fj as Pe,gA as _,hA as v,iA as y,ij as Fe,jA as Ie,kA as Le,lA as b,lj as x,mA as S,mj as Re,nA as C,nj as ze,oA as w,oj as Be,pA as T,pj as Ve,qA as He,rA as E,rj as Ue,sA as D,sj as We,tA as O,tj as Ge,uA as k,uj as Ke,vA as qe,wA as Je,xA as Ye,yA as Xe,zA as Ze}from"./dist-CKeB-cox.js";import{t as A}from"./check-DP-dt0kl.js";import{r as Qe}from"./dist-_mTpkDcR.js";import{t as j}from"./button-9CDM33ms.js";import{At as M,Ct as N,Dt as P,Fn as $e,On as F,Ot as I,Pn as et,St as L,Z as tt,_ as nt,_t as R,bt as z,ct as B,gt as V,jn as rt,jt as H,kt as U,qt as it,st as W,vt as at,xt as G,yt as K}from"./index-Bjld8kqu.js";import{t as ot}from"./FilterBar-D1X-NYiQ.js";import{t as st}from"./DataTableShell-C8TvrDnS.js";import{t as ct}from"./roleDescriptions-BIxax60M.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>m(),days:null},{value:`30`,label:()=>a(),days:30},{value:`90`,label:()=>s(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=$e({from:`/settings/serviceAccounts`}),t=et({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,s]=(0,q.useState)(X),we=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Ee=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),ke=h(c.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),l=h(c.apiKeys.listKeys,{}),u=h(c.apiKeys.listRoles,{}),d=i(c.apiKeys.createServiceAccount),p=i(c.apiKeys.updateServiceAccount),m=i(c.apiKeys.deleteServiceAccount),g=Oe(c.apiKeys.mintApiKey),_=i(c.apiKeys.revokeApiKey),v=tt(),y=it(),b=n!==``||o!==X||a!==X;function S(){s(X),t({search:{},replace:!0})}let[C,w]=(0,q.useState)(!1),[T,E]=(0,q.useState)(Z),[D,O]=(0,q.useState)(null),[k,A]=(0,q.useState)(new Set),[N,F]=(0,q.useState)(null),L=(0,q.useRef)(!1),[z,B]=(0,q.useState)(new Set),[W,at]=(0,q.useState)({}),[G,K]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);function Q(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await p({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(fe())):await d({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),O(null),w(!1)}catch(e){y.error(D?pe():he(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function mt(e){if(L.current)return;L.current=!0;let t=W[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await g({serviceAccountId:e._id,expiresAt:r});K({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Ie(),e)}finally{L.current=!1,F(null)}}async function $(e){if(await v({title:ee(),description:(0,J.jsxs)(J.Fragment,{children:[Le(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,me(),` `,(0,J.jsx)(`strong`,{children:re()}),` `,ie()]}),confirmWord:e.name,confirmLabel:ye(),destructive:!0}))try{await m({serviceAccountId:e._id}),y.success(Je(),e.name)}catch(e){y.error(ne(),e)}}async function ht(e){if(await v({title:ve(),description:(0,J.jsxs)(J.Fragment,{children:[Ye(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,je()]}),confirmLabel:Xe(),destructive:!0})&&!z.has(e._id)){B(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(qe(),e)}finally{B(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}),(0,J.jsxs)(ot,{q:n,onQChange:we,searchPlaceholder:Ve(),onReset:S,canReset:b,children:[(0,J.jsxs)(P,{value:o,onValueChange:s,children:[(0,J.jsx)(M,{size:`sm`,className:`w-40`,children:(0,J.jsx)(H,{placeholder:Pe()})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(U,{value:X,children:Me()}),(u??[]).map(e=>(0,J.jsx)(U,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(P,{value:a,onValueChange:Ee,children:[(0,J.jsx)(M,{size:`sm`,className:`w-36`,children:(0,J.jsx)(H,{})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(U,{value:X,children:Ke()}),(0,J.jsx)(U,{value:`active`,children:x()}),(0,J.jsx)(U,{value:`disabled`,children:f()})]})]})]}),(0,J.jsx)(st,{title:We(),rows:ke,addLabel:Be(),onAdd:()=>{E(Z),O(null),w(!0)},emptyHint:Ae(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:z}),rowActions:e=>[{label:Ge(),onSelect:()=>pt(e)},{label:Fe(),onSelect:()=>void mt(e)},{label:k.has(e._id)?Ue():ze(),onSelect:()=>Q(e._id)},{label:Ne(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?r():ge(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,J.jsx)(Qe,{}):(0,J.jsx)(rt,{})})},{header:De(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ce(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey})},{header:Te(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(V,{variant:`destructive`,children:f()}):(0,J.jsx)(V,{variant:`outline`,children:x()})},{header:le(),cell:e=>(0,J.jsxs)(P,{value:W[e._id]??`never`,onValueChange:t=>at(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(M,{size:`sm`,className:`w-32`,children:(0,J.jsx)(H,{})}),(0,J.jsx)(I,{children:lt.map(e=>(0,J.jsx)(U,{value:e.value,children:e.label()},e.value))})]})},{header:He(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?ue():oe({count:t})})}}]}),(0,J.jsx)(nt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?Se():xe(),description:D?be():te(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?se():Ze(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:_e()}),(0,J.jsx)(R,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:de()}),(0,J.jsxs)(P,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(M,{className:`w-full`,children:(0,J.jsx)(H,{placeholder:ce()})}),(0,J.jsx)(I,{children:(u??[]).map(e=>(0,J.jsxs)(U,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===T.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ae()}),(0,J.jsx)(R,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:G,onClose:()=>K(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[l(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:v()}),(0,J.jsx)(`th`,{children:S()}),(0,J.jsx)(`th`,{children:T()}),(0,J.jsx)(`th`,{children:g()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:B(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?b():d()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(at,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(K,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(L,{children:[(0,J.jsx)(N,{children:D()}),(0,J.jsx)(z,{children:w({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:u()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":y(),children:[n?(0,J.jsx)(A,{}):(0,J.jsx)(F,{}),n?E():C()]})]}),(0,J.jsx)(G,{children:(0,J.jsx)(j,{onClick:()=>{r(!1),t()},children:O()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?ke():B(e)}function mt(e){return e===null?`—`:W(e)}function $(e){return e.disabled?(0,J.jsx)(V,{variant:`destructive`,children:we()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(V,{variant:`outline`,children:Ee()}):(0,J.jsx)(V,{variant:`outline`,children:o()})}export{Q as ServiceAccountsTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$o as i,Bo as a,Cs as o,Go as s,Ho as c,Jo as l,Ko as u,Qo as d,Ss as f,T as p,Uo as m,Vo as h,Wo as g,Xo as _,Yo as v,Zo as y,_s as b,as as x,bs as S,cs as C,ds as w,eL as T,es as E,fs as D,gs as O,hs as k,is as A,ls as j,ms as M,ns as N,os as P,ps as F,qo as I,rs as L,ss as R,ts as ee,us as z,vs as B,xs as V,ys as H,zo as U}from"./dist-CKeB-cox.js";import{t as W}from"./button-9CDM33ms.js";import{Z as G,ct as K}from"./index-Bjld8kqu.js";import{t as q}from"./DataTableShell-C8TvrDnS.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>x(),error:()=>A(),other:()=>L()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=r(p.subAgentReports.respondToReport),[a,o]=(0,J.useState)(e.thread),[f,h]=(0,J.useState)(``),[b,x]=(0,J.useState)(!1);async function S(){let t=f.trim();if(!(!t||b)){x(!0);try{await n({reportId:e._id,text:t}),o(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),h(``)}finally{x(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,N({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ee()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:E()}),a.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:a.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?i():d()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:y()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:_(),value:f,maxLength:2e3,rows:3,onChange:e=>h(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void S(),disabled:!f.trim()||b,children:b?l():v()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${u()}`:``,t.textTruncated?` ${s()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${g()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:m()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:c()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=T(p.subAgentReports.listForAdmin,{}),t=r(p.subAgentReports.readReport),n=r(p.subAgentReports.deleteReport),i=G(),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)({});async function d(e){if(s===e._id){c(null);return}if(!l[e._id]){let n=await t({reportId:e._id});u(t=>({...t,[e._id]:n}))}c(e._id)}async function m(e){await i({title:h(),description:a(),confirmLabel:U(),destructive:!0})&&(await n({reportId:e._id}),s===e._id&&c(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Y.jsx)(`strong`,{children:S()}),` `,H()]}),(0,Y.jsx)(q,{title:o(),rows:e,emptyHint:f(),isExpanded:e=>s===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Y.jsx)($,{data:l[e._id]}):null,columns:[{header:B(),cell:e=>K(e.at),sort:e=>e.at},{header:b(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:O(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:k(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${D({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:M(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:F(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:w()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:z()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:s===e._id?C():j(),onSelect:()=>void d(e)},{label:R(),onSelect:()=>void m(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$M as i,AM as a,BM as o,CM as s,CN as c,D as l,DM as u,E as d,EM as f,FM as p,Fo as m,GM as h,HI as g,HM as _,IM as v,Io as ee,JM as te,KM as y,LM as ne,Lo as b,MM as re,NM as ie,OM as ae,PM as oe,QM as se,RM as ce,Ro as x,SM as le,SN as ue,T as S,TM as de,UI as fe,UM as pe,VI as me,VM as he,WM as ge,XM as _e,YM as ve,ZI as ye,ZM as be,_M as xe,_N as Se,aM as C,aN as Ce,bM as we,bN as Te,cM as Ee,cN as De,dM as Oe,dN as ke,eL as w,eN as Ae,fM as je,fN as Me,gM as Ne,gN as Pe,hM as Fe,hN as Ie,iM as Le,iN as Re,jM as ze,kM as Be,lM as Ve,lN as He,mM as Ue,mN as We,nM as Ge,nN as Ke,oM as qe,oN as Je,pM as Ye,pN as T,qM as Xe,rM as Ze,rN as Qe,sM as $e,sN as et,tM as tt,tN as nt,uM as rt,uN as it,vM as at,vN as ot,wM as st,xM as E,xN as ct,yM as lt,yN as ut,zM as dt}from"./dist-CKeB-cox.js";import{t as D}from"./check-DP-dt0kl.js";import{t as O}from"./x-DJVrcLrv.js";import{t as k}from"./button-9CDM33ms.js";import{At as A,Dn as ft,Dt as j,En as M,Lt as N,Mt as pt,Nt as mt,Ot as P,P as F,_t as I,dt as ht,ft as L,gt as R,ht as gt,jt as z,kt as B,mt as V,pt as _t,ut as vt}from"./index-Bjld8kqu.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-cbtxUmVi.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-QZEG8lub.js";import{t as kt}from"./TimeRangePicker-Cc-m21ii.js";import{t as At}from"./FilterBar-D1X-NYiQ.js";import{t as jt}from"./AdvancedFilter-Bt1eVvHP.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(st());if(e.size>zt)throw Error(s());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(E());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(E());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(we());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(le())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?fe():e===`dark`?g():me()}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:d(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":x(),title:x(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=w(S.charts.listMyCharts),i=r(S.charts.setMyChart);async function a(e){try{await i({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:T(),subtitle:Me(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?ke():n.via===`owner`?it():He({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:De()}):null]})}function Qt(){let e=r(S.charts.importChart),[t,n]=(0,K.useState)(``),[i,a]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(!1);async function p(e){let t=e.target.files?.[0];if(e.target.value=``,t){c(null),u(!1);try{a(await t.text())}catch{c(o())}}}async function m(){if(c(null),u(!1),t.trim()===``){c(ce());return}let r;try{r=JSON.parse(i)}catch{c(o());return}f(!0);try{await e({name:t.trim(),tokens:r}),u(!0),n(``),a(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(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:y()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:h(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ge()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:pe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),_(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void p(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:d,onClick:()=>void m(),children:he()})]}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:dt()}):null]})]})}function $t({chart:e}){let t=ye(S.charts.setChartLogo),n=r(S.charts.removeChartLogo),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function d(n,r,i){if(e.chartId!==void 0){c(null),o(!0);try{let{blob:a,hasAlpha:o}=await Ut(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}async function p(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await d(e,n)}async function m(t){if(e.chartId!==void 0){c(null),o(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}async function h(e){let t=l(e===`light`?`dark`:`light`);if(t){c(null),o(!0);try{await d(e,await(await fetch(t)).blob(),e)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}function g({mode:e}){let t=l(e),n=l(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`?ze():a()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?ae():Be(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void p(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void h(e),children:f()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void m(e),children:u()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:re()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(g,{mode:`light`}),(0,X.jsx)(g,{mode:`dark`})]}),i?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:de()}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})}function en({chart:e}){let t=w(S.me.getMe,{host:N}),n=r(S.charts.addChartDomain),i=r(S.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await i({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:lt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Fe()}):d.map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ue({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),placeholder:xe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:Ne()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=r(S.charts.updateChart),n=r(S.charts.deleteChart),[i,a]=(0,K.useState)(!1),[s,c]=(0,K.useState)(e.name),[l,u]=(0,K.useState)(()=>tn(e.tokens)),[d,f]=(0,K.useState)(e.tokens.bpm??0),[p,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1);function v(){c(e.name),u(tn(e.tokens)),f(e.tokens.bpm??0),h(null),a(!0)}async function te(){if(e.chartId===void 0)return;h(null);let n;try{n=JSON.parse(l)}catch{h(o());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;d>0?e.bpm=d:delete e.bpm}_(!0);try{await t({chartId:e.chartId,name:s.trim(),tokens:n}),a(!1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(Ve()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:v,children:oe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:ie()})]})})]}),i?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Oe()}),(0,X.jsx)(I,{value:s,onChange:e=>c(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:d,onChange:e=>f(Number(e.target.value)),"aria-label":b()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:d===0?ee():`${d} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:m()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:rt()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:l,onChange:e=>u(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:g,onClick:()=>void te(),children:Ye()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:je()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=w(S.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:ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),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)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=r(S.charts.addChartToGroupPool),a=r(S.charts.removeChartFromGroupPool),o=e.restrictedToGroups,s=e.poolGroups,c=new Set((s??[]).map(e=>e.groupId)),l=t.filter(e=>!c.has(e._id));async function u(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(t){try{await a({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)(R,{variant:o?`secondary`:`outline`,className:`oc-chart-avail__state`,children:o?Ae():e.kind===`custom`&&e.scope===`personal`?C():nt()}),e.isGlobalDefault?(0,X.jsx)(R,{variant:`default`,children:i()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:be()}),(s??[]).map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ve({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),l.length>0?(0,X.jsxs)(j,{value:``,onValueChange:e=>void u(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:_e()})}),(0,X.jsx)(P,{children:l.map(e=>(0,X.jsx)(B,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:se()}):null]})]})}function on({chart:e}){let t=r(S.charts.promoteChartToCommon),n=r(S.charts.deleteChart);async function i(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function a(){if(e.chartId!==void 0&&window.confirm(Ve()))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)(R,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Le():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe({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 i(),children:Ze()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:Ge()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=r(S.admin.setDefaultThemeMode),a=r(S.admin.setDefaultLocale),o=r(S.charts.setDefaultChart),s=w(S.charts.listChartsAdmin),l=w(S.groups.listGroups,{}),u=e??`system`,d=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(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:et()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Je()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:T()}),mt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:$e()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:c()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({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:ct()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]})]})}function cn(){let e=w(S.me.getMe,{host:N}),t=pt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:ot()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(M,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{children:`Default`}),(0,X.jsx)(R,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(R,{variant:`outline`,children:`Outline`}),(0,X.jsx)(R,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(j,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(B,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(F,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(j,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes directions`}),(0,X.jsx)(B,{value:`inbound`,children:`inbound`}),(0,X.jsx)(B,{value:`outbound`,children:`outbound`}),(0,X.jsx)(B,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(j,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(P,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(B,{value:`info`,children:`info`}),(0,X.jsx)(B,{value:`warn`,children:`warn`}),(0,X.jsx)(B,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(vt,{children:[(0,X.jsx)(gt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(M,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(_t,{children:`Actions`}),(0,X.jsx)(V,{}),(0,X.jsx)(L,{children:`Edit`}),(0,X.jsx)(L,{children:`Duplicate`}),(0,X.jsx)(V,{}),(0,X.jsx)(L,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(F,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(F,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(R,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(M,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Fi as r,Ii as i,Li as a,Mi as o,Ni as s,Pi as c,a_ as l,c_ as u,d_ as d,f_ as f,i_ as p,ji as m,l_ as h,m_ as g,n_ as _,o_ as v,p_ as y,r_ as b,s_ as x,u_ as S}from"./dist-CKeB-cox.js";import{t as C}from"./button-9CDM33ms.js";import{Bt as w,Ht as T,Ut as E,Vt as D,_t as O,ct as k,kn as A,sn as j}from"./index-Bjld8kqu.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:g(),from:`now-5m`},{label:y(),from:`now-15m`},{label:f(),from:`now-30m`},{label:d(),from:`now-1h`},{label:S(),from:`now-3h`},{label:h(),from:`now-6h`},{label:u(),from:`now-12h`},{label:x(),from:`now-24h`},{label:v(),from:`now-2d`},{label:l(),from:`now-7d`},{label:p(),from:`now-30d`},{label:b(),from:`now-90d`},{label:_(),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,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(``),f=F(e),[p,h]=(0,M.useState)(()=>z(f.from)),[g,_]=(0,M.useState)(()=>z(f.to));function v(t){if(t){let t=F(e);h(z(t.from)),_(z(t.to)),d(``)}l(t)}function y(e){t({kind:`relative`,from:e,to:`now`}),l(!1)}function b(){let e=B(p),n=B(g);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),l(!1))}let x=(0,M.useMemo)(()=>{let e=u.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[u]),S=B(p)!==null&&B(g)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:v,children:[(0,H.jsx)(E,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(D,{children:(0,H.jsx)(w,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:a()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(O,{type:`datetime-local`,value:p,onChange:e=>h(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,H.jsx)(O,{type:`datetime-local`,value:g,onChange:e=>_(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:b,children:c()})]}),(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)(O,{value:u,onChange:e=>d(e.target.value),placeholder:s(),"aria-label":o()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:m()}):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:()=>y(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CP as r,SP as i,TP as a,wP as o}from"./dist-CKeB-cox.js";import{t as s}from"./check-DP-dt0kl.js";import{t as c}from"./chevrons-up-down-Dynznz1g.js";import{Et as l,Tt as u,_t as d,wt as f}from"./index-Bjld8kqu.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||i():e;return(0,T.jsxs)(f,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":a(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(u,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:o(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:r()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,$I as i,$y as a,AD as o,By as s,CD as c,D as l,DD as u,ED as d,Fy as f,GE as p,Gy as m,Hy as h,Iy as g,JE as _,Jy as v,KE as y,Ky as b,Ly as ee,MD as x,Mr as te,ND as S,Nr as C,OD as w,Pr as ne,QE as T,Qy as re,Ry as ie,SD as E,T as D,TD as O,Uy as ae,Vy as oe,WE as k,Wy as se,XE as A,Xy as ce,YE as j,Yy as le,ZE as ue,Zy as de,_D as fe,_b as pe,ab as me,bD as M,cb as he,dD as ge,db as _e,eD as ve,eL as N,eb as ye,fD as P,fb as be,gD as F,gb as xe,hD as Se,hb as Ce,iD as we,ib as Te,jD as Ee,kD as De,lD as Oe,lb as ke,mD as Ae,mb as je,nD as Me,nb as Ne,ob as Pe,pD as Fe,pb as Ie,qE as Le,qy as Re,rD as ze,rb as Be,sb as Ve,tD as He,tb as Ue,uD as I,ub as We,vD as Ge,vb as Ke,wD as qe,xD as L,yD as Je,yb as Ye,zy as Xe}from"./dist-CKeB-cox.js";import{t as Ze}from"./check-DP-dt0kl.js";import{t as Qe}from"./x-DJVrcLrv.js";import{i as R,n as z,r as $e,t as et}from"./tabs-XFZCx7lK.js";import{t as B}from"./button-9CDM33ms.js";import{At as V,Ct as tt,Dt as H,Fn as nt,J as rt,Lt as it,On as at,Ot as U,Pn as ot,St as st,Tn as ct,a as lt,bt as ut,ct as W,gt as G,i as dt,jt as K,kt as q,lt as ft,o as pt,s as mt,vt as ht,xn as gt,yt as _t}from"./index-Bjld8kqu.js";import{n as vt}from"./TimeRangePicker-Cc-m21ii.js";import{t as yt}from"./FilterBar-D1X-NYiQ.js";import{t as bt}from"./AdvancedFilter-Bt1eVvHP.js";import{t as xt}from"./DataTableShell-C8TvrDnS.js";var St=l(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=l(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?Ae():n===`agent`?`${Fe()} - ${r}`:e}function Tt(){let e=N(D.me.getMe,{host:it})?.role===`admin`,t=N(D.deliveryTiming.getDeliveryStatus,{}),n=i(D.deliveryTiming.startDeliveryRecord),r=i(D.deliveryTiming.stopDeliveryRecord),[a,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),u=t?.recording??!1,f=async()=>{l(!0);try{u?await r({}):await n({})}finally{l(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:S()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:x()})]}),e?(0,Y.jsx)(B,{variant:u?`destructive`:`default`,size:`sm`,disabled:c||t===void 0,onClick:()=>void f(),children:u?o():Ee()}):null]}),u?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(G,{variant:`secondary`,children:De()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:w({time:ft(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>s(e=>!e),children:a?O():d()})}),a?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(D.deliveryTiming.listDeliverySessions,{}),n=i(D.deliveryTiming.deleteDeliverySessions),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:m,to:h}=vt(l),g=l.to===`now`?1/0:h,_=r.trim()!==``||o!==`all`||l!==X,v=()=>{a(``),s(`all`),u(X)},y=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,r,o,m,g]),b=e=>{let t=new Set((y??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:a,searchPlaceholder:c(),timeRange:l,onTimeRangeChange:u,onReset:v,canReset:_,children:(0,Y.jsxs)(H,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:`all`,children:E()}),(0,Y.jsx)(q,{value:`active`,children:L()}),(0,Y.jsx)(q,{value:`stopped`,children:M()})]})]})}),(0,Y.jsx)(xt,{title:qe(),rows:y,emptyHint:p(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?ge():P(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ct,{size:15,"aria-hidden":!0})})},{header:Je(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:W(e.startedAt)})},{header:Ge(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:W(e.stoppedAt)})},{header:fe(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:F(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Se(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(G,{variant:`secondary`,children:L()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:M()})}],rowActions:e?e=>[{label:I(),variant:`destructive`,onSelect:()=>b([e.sessionId])}]:void 0,bulkActions:e?[{label:I(),variant:`destructive`,onSelect:e=>b(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(D.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:u()});let i=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,k()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(at,{size:13,"aria-hidden":!0}),t?y():Le()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:Me()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:He()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:ve()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(r(),i.bridge),a(T(),i.A),a(ue(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:j()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:ne()},{value:`principalType`,label:C()},{value:`direction`,label:`direction`},{value:`roleKey`,label:te()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=nt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,u=e.q??``,d=dt(e.from,e.to),f=(0,J.useMemo)(()=>mt(e.adv),[e.adv]),{from:p,to:g}=vt(d),[_,y]=(0,J.useState)(null),[ee,x]=(0,J.useState)(null),te=e=>void t({search:t=>({...t,limit:e})}),S=e=>void t({search:t=>({...t,kind:e})}),C=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),w=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ne=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,...pt(e)})}),k=e=>void t({search:t=>({...t,adv:lt(e)}),replace:!0}),A=N(D.observability.listEvents,{limit:n}),j=N(D.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:u||void 0,from:p,to:g,statusClass:i===Q?void 0:i,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:f.length>0?f:void 0}}),ue=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),fe=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),M=u!==``||i!==Q||o!==Q||c!==Q||l!==Q||f.length>0||d.kind!==`relative`||d.from!==Pt.from;function ge(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=_?A?.filter(e=>e.correlationId===_):j,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(gt,{size:13,"aria-hidden":!0}),we()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ze()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ye(),(0,Y.jsx)(`strong`,{children:Ke()}),pe(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:xe()})]}),(0,Y.jsxs)(yt,{q:u,onQChange:C,searchPlaceholder:Ce(),timeRange:d,onTimeRangeChange:O,onReset:ge,canReset:M,children:[(0,Y.jsxs)(H,{value:i,onValueChange:w,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:je()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:Ie()}),jt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:o,onValueChange:ne,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:be()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:_e()}),Mt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:c,onValueChange:T,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:We()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:ke()}),Nt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:l,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:he()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:Q,children:Ve()}),fe.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:r,onValueChange:S,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:Pe()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(q,{value:At,children:me()}),ue.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(H,{value:String(n),onValueChange:e=>te(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(U,{children:kt.map(e=>(0,Y.jsx)(q,{value:String(e),children:Te({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:f,onChange:k}),_?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>y(null),title:Be(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ne(),(0,Y.jsx)(`code`,{children:$(_)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ue()})]})}):null,(0,Y.jsx)(xt,{title:ye(),rows:ve,emptyHint:_?a():re(),columns:[{header:de(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:W(e.at)})},{header:ce(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(G,{variant:`secondary`,children:e.kind})},{header:le(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":v(),children:`✓`})}},{header:Re(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(G,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:b(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:m(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ae(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:h(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:oe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:s(),onClick:()=>y(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Xe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>x(e),children:ie()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:ee,onClose:()=>x(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ht,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(_t,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(tt,{className:`oc-traces__meta-title`,children:[ee(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(G,{variant:`outline`,children:g()})]}),(0,Y.jsx)(ut,{children:f()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$v as i,$w as a,Bd as o,Bw as s,Fw as c,Gw as l,Hw as u,Iw as d,Jw as f,Kw as p,Lw as ee,Nw as te,Pw as ne,Qv as m,Qw as h,Rw as re,T as g,Uw as ie,Vd as _,Vw as ae,Ww as oe,Xv as v,Xw as se,Yv as y,Yw as ce,Zv as b,Zw as x,aT as S,ay as C,eL as w,eT as le,ey as T,iT as ue,iy as E,mw as de,nT as fe,ny as D,oT as O,oy as k,qw as pe,rT as me,ry as A,sT as j,sy as M,tT as he,ty as N,zd as P,zw as ge}from"./dist-CKeB-cox.js";import{t as F}from"./button-9CDM33ms.js";import{At as I,Ct as L,Dt as R,Fn as _e,Lt as ve,Ot as z,P as B,Pn as ye,Q as be,St as xe,Z as Se,an as V,bt as Ce,c as H,dt as we,ft as Te,gt as U,ht as Ee,jt as W,kt as G,l as De,on as K,pt as Oe,qt as q,u as J,ut as ke,vt as Ae,yt as je}from"./index-Bjld8kqu.js";import{t as Me}from"./FilterBar-D1X-NYiQ.js";import{t as Ne}from"./DataTableShell-C8TvrDnS.js";import{t as Pe}from"./DetailChips-KZ6IBAE_.js";var Y=t(e(),1),X=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=w(g.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=w(g.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,X.jsx)(Ae,{open:n,onOpenChange:r,children:(0,X.jsxs)(je,{className:`oc-access`,children:[(0,X.jsxs)(xe,{children:[(0,X.jsx)(L,{children:M({user:t})}),(0,X.jsx)(Ce,{children:k()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?C():E()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:A()}):u.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:T()}):[...d.entries()].map(([t,n])=>(0,X.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:a,assigned:o,defaultKey:s}){let c=r(g.agents.assignAgent),l=r(g.agents.removeAgent),u=r(g.agents.setDefaultAgent),d=q();if(!e)return null;async function f(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(D(),e)}}async function p(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(N(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(K,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(U,{variant:`outline`,className:`oc-access__kind`,children:n})]}),a.map(e=>{let n=`${t}/${e.agentId}`,r=o.has(n),a=s===n,c=e.state===`deleted`,l=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,X.jsx)(B,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":i({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,X.jsx)(U,{variant:`outline`,className:`oc-access__gone`,children:m()}):null,e.outOfPool?(0,X.jsx)(U,{variant:`outline`,className:`oc-access__gone`,children:b()}):null,r?a?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":v(),title:v(),children:(0,X.jsx)(V,{size:14,fill:`currentColor`})}):(0,X.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":y(),title:y(),disabled:l,onClick:()=>void p(e.agentId),children:(0,X.jsx)(V,{size:14})}):null]},e.agentId)})]})}var Z=`__all__`;function Q(e){switch(e){case`pending`:return P();case`user`:return o();case`admin`:return _();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=H.filter(e=>n.has(J[e])).length;return(0,X.jsxs)(ke,{children:[(0,X.jsx)(Ee,{asChild:!0,children:(0,X.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?j():O({count:r})})}),(0,X.jsxs)(we,{align:`start`,className:`w-52`,children:[(0,X.jsx)(Oe,{children:S()}),H.map(e=>{let r=J[e];return(0,X.jsxs)(Te,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(B,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:De[e]()})]},e)})]})]})}function $(){let e=_e({from:`/settings/users`}),t=ye({from:`/settings/users`}),n=e.q??``,i=e.role??Z,o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),m=e=>void t({search:t=>({...t,role:e===Z?void 0:e})}),_=w(g.admin.listUsers,{filter:{q:n||void 0,role:i===Z?void 0:i},withAgents:!0}),v=w(g.me.getMe,{host:ve}),y=r(g.admin.setRole),b=r(g.admin.setUserPermissions),S=r(g.admin.startImpersonation),C=r(g.admin.deleteUser),T=r(g.admin.setUserName),E=Se(),D=be(),O=q(),[k,A]=(0,Y.useState)(null),j=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of _??[])e.add(t.role);return[...e]},[_]),M=n!==``||i!==Z;function N(){t({search:{},replace:!0})}async function P(e){try{await y(e)}catch(e){O.error(ue(),e)}}async function F(e){try{await b(e)}catch(e){O.error(me(),e)}}async function L(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await E({title:se(),description:ce({user:t}),confirmWord:f(),confirmLabel:pe(),destructive:!0}))try{await C({profileId:e._id}),O.success(l({user:t}))}catch(e){O.error(p(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await D({title:ie(),label:u({user:t}),placeholder:ae(),defaultValue:e.name??``,confirmLabel:de()});if(n!==null)try{await T({profileId:e._id,name:n}),O.success(s())}catch(e){O.error(ge(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{q:n,onQChange:o,searchPlaceholder:fe(),onReset:N,canReset:M,children:(0,X.jsxs)(R,{value:i,onValueChange:m,children:[(0,X.jsx)(I,{size:`sm`,className:`w-36`,children:(0,X.jsx)(W,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(G,{value:Z,children:he()}),j.map(e=>(0,X.jsx)(G,{value:e,children:Q(e)},e))]})]})}),(0,X.jsx)(Ne,{title:le(),rows:_,emptyHint:a(),rowActions:e=>{let t=[{label:te(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:oe(),onSelect:()=>void B(e)}];return e.userId!==v?.userId&&t.push({label:h(),onSelect:()=>void S({profileId:e._id})},{label:x(),variant:`destructive`,onSelect:()=>void L(e)}),t},columns:[{header:re(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:ee(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(R,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,X.jsx)(I,{size:`sm`,className:`w-28`,children:(0,X.jsx)(W,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(G,{value:`pending`,children:Q(`pending`)}),(0,X.jsx)(G,{value:`user`,children:Q(`user`)}),(0,X.jsx)(G,{value:`admin`,children:Q(`admin`)})]})]})},{header:d(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:c()}):(0,X.jsx)(Le,{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:ne(),cell:e=>(0,X.jsx)(Pe,{icon:(0,X.jsx)(K,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Fe,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{$ as UsersTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$n as i,$u as a,An as o,At as s,Bn as c,Ct as l,Dt as u,Fn as d,Ft as f,GI as p,Gn as m,Hn as h,In as g,It as _,Jn as v,Kn as y,Ln as ee,Lt as b,Mn as x,Nl as te,Nn as ne,Nt as re,Ot as S,Pn as C,Pt as w,Qn as ie,Rn as ae,St as oe,T,Tt as E,Un as se,Vn as ce,Wn as le,Wt as ue,Xn as de,Yn as fe,ZI as pe,Zn as me,dE as D,eL as O,jl as k,jn as A,kn as j,kt as M,qI as N,qn as P,ut as F,wt as I,zn as L}from"./dist-CKeB-cox.js";import{i as R,n as z,r as he,t as ge}from"./tabs-XFZCx7lK.js";import{t as B}from"./button-9CDM33ms.js";import{$t as V,At as H,Dt as U,Fn as _e,Jt as ve,Lt as ye,Nn as be,Ot as W,P as G,Pn as xe,Qt as K,Xt as Se,Yt as Ce,Zt as we,en as Te,gn as Ee,gt as q,jt as J,kt as Y,nn as X}from"./index-Bjld8kqu.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>y()],[`fr-FR`,()=>b()],[`en-US`,()=>_()],[`en-GB`,()=>f()],[`de-DE`,()=>w()],[`es-ES`,()=>re()]],Oe=[[`0.75`,()=>le()],[`1`,()=>se()],[`1.25`,()=>h()],[`1.5`,()=>ce()]],$=0;function ke({instance:e}){let t=r(T.admin.upsertInstanceConfig),n=e.config??{},i={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},[o,s]=(0,Z.useState)(i),[u,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(!1),[h,_]=(0,Z.useState)(!1),y=pe(T.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{s({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}),d(`idle`)},[e._id]);let b=o.enabled!==i.enabled||o.engine!==i.engine||o.lang!==i.lang||o.rate!==i.rate||o.autoRead!==i.autoRead;async function x(){d(`saving`);try{let n={...e.config??{}};n.voiceEnabled=o.enabled,o.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,o.lang===`auto`?delete n.voiceLang:n.voiceLang=o.lang;let r=Number.parseFloat(o.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,o.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),d(`idle`)}catch{d(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:o.enabled,onCheckedChange:e=>s({...o,enabled:e===!0}),"aria-label":v()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,Q.jsxs)(U,{value:o.engine,onValueChange:e=>s({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(J,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(Y,{value:`browser`,children:I()}),e.kind===`hermes`?null:(0,Q.jsx)(Y,{value:`gateway`,children:l()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:oe()}):null,o.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:P()}),(0,Q.jsxs)(U,{value:o.lang,onValueChange:e=>s({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":P(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(Y,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,Q.jsxs)(U,{value:o.rate,onValueChange:e=>s({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":m(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(Y,{value:e,children:t()},e))})]})]}),o.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:o.autoRead,onCheckedChange:e=>s({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":c()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:L()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!b||u===`saving`,onClick:()=>void x(),children:u===`saving`?a():te()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!o.enabled||f,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(_(!1),V(),K(),o.engine!==`gateway`){we(g(),{lang:Se(o.lang,N()),rate:t});return}p(!0),y({instanceName:e.name,text:g()}).then(({mime:e,audioBase64:r})=>{n===$&&Ce(r,e,{rate:t})}).catch(()=>{n===$&&_(!0)}).finally(()=>p(!1))},children:f?a():ae()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),V(),K()},children:ee()})]}),u===`error`||h?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:h?F():k()}):null]})}function Ae({stt:e}){let t=O(T.me.getMe,{host:ye}),n=r(T.admin.setFeatureEnabled),i=t?.ui?.featuresEnabled?.voiceInput===!0,a=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:C()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?o():j()}),(0,Q.jsx)(q,{variant:i?`secondary`:`destructive`,children:i?M():S()})]}),a?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(G,{checked:i,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()})]})}function je(){let e=O(T.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Te(),[]),n=(0,Z.useMemo)(()=>ve(),[]),{section:r}=_e({from:`/settings/voice`}),a=xe({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?ie():me()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?de():fe()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),u()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ee,{size:13,"aria-hidden":!0}),C()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),x()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(z,{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:x()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:A()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=r(T.admin.upsertInstanceConfig),n=e.config??{},i=n.talkEnabled===!0,a=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:a?`Hermes`:`OpenClaw`})]}),a?(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)(G,{checked:i,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n,b as r,t as i}from"./dist-CNZ9o3sc.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n,b as r,t as i}from"./dist-CKeB-cox.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-CNZ9o3sc.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-CKeB-cox.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-CKeB-cox.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-CKeB-cox.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-CKeB-cox.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +1 @@
1
- import{Tl as e,_l as t,dr as n,fl as r,gl as i,hl as a,pl as o}from"./dist-CNZ9o3sc.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(e){return e===`supported`?t():e===`beyond`?i():a()}function h(t){return t??e()}function g(e,t){return t&&t!==`openclaw`?n({provider:t}):e===null?r():o({version:e})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
1
+ import{Tl as e,_l as t,dr as n,fl as r,gl as i,hl as a,pl as o}from"./dist-CKeB-cox.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(e){return e===`supported`?t():e===`beyond`?i():a()}function h(t){return t??e()}function g(e,t){return t&&t!==`openclaw`?n({provider:t}):e===null?r():o({version:e})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
@@ -0,0 +1 @@
1
+ .oc-afiles{flex-direction:column;gap:.75rem;display:flex}.oc-afiles__picker{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.oc-afiles__list{border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;display:flex;overflow:hidden}.oc-afiles__row{border-bottom:1px solid var(--border);align-items:center;gap:.75rem;padding:.5rem .75rem;font-size:.85rem;display:flex}.oc-afiles__row:last-child{border-bottom:none}.oc-afiles__name{text-overflow:ellipsis;white-space:nowrap;flex:0 0 10rem;font-weight:500;overflow:hidden}.oc-afiles__size{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 4.5rem}.oc-afiles__gauge{background:var(--muted);border-radius:999px;flex:6rem;height:.375rem;overflow:hidden}.oc-afiles__gauge-fill{border-radius:inherit;background:var(--primary);height:100%;display:block}.oc-afiles__gauge.is-warn .oc-afiles__gauge-fill{background:var(--destructive)}.oc-afiles__pct{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 3rem}.oc-afiles__warn{color:var(--destructive);flex:none}.oc-afiles__warn-slot{flex:none;width:14px}.oc-afiles__open{margin-left:auto}.oc-afiles__budget{color:var(--muted-foreground);font-size:.8rem}.oc-afiles__error,.oc-cdefaults__error{color:var(--destructive);align-items:center;gap:.5rem;font-size:.85rem;display:flex}[data-slot=dialog-content].oc-afiles__editor{flex-direction:column;width:calc(100vw - 2rem);max-width:72rem;height:calc(100vh - 2rem);max-height:none;display:flex}.oc-afiles__source{resize:none;min-height:0;font-family:var(--font-mono,ui-monospace, monospace);border:1px solid var(--border);border-radius:var(--radius);background:var(--background);color:var(--foreground);flex:auto;padding:.75rem;font-size:.8rem;line-height:1.5}.oc-afiles__source:focus-visible{outline:2px solid var(--ring);outline-offset:-1px}.oc-afiles__hint{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__editor-foot{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.oc-afiles__count{color:var(--muted-foreground);font-variant-numeric:tabular-nums;font-size:.8rem}.oc-afiles__count.is-over{color:var(--destructive);font-weight:600}.oc-afiles__diff{flex-direction:column;gap:.5rem;max-height:14rem;display:flex;overflow-y:auto}.oc-afiles__diff-counts{font-size:.85rem;font-weight:500}.oc-afiles__diff-block{flex-direction:column;gap:.125rem;display:flex}.oc-afiles__diff-label{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__diff-line{border-radius:calc(var(--radius) / 2);white-space:pre-wrap;word-break:break-word;padding:.125rem .375rem;font-size:.75rem}.oc-afiles__diff-line.is-add{background:color-mix(in oklab, var(--primary) 12%, transparent)}.oc-afiles__diff-line.is-del{background:color-mix(in oklab, var(--destructive) 12%, transparent);text-decoration:line-through}.oc-cdefaults{flex-direction:column;gap:.75rem;max-width:36rem;display:flex}.oc-cdefaults__row{border-bottom:1px solid var(--border);flex-direction:column;gap:.375rem;padding:.625rem 0;display:flex}.oc-cdefaults__label{font-size:.85rem;font-weight:500}.oc-cdefaults__help,.oc-cdefaults__note{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cdefaults__actions{justify-content:flex-end;display:flex}.oc-voice__support{flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;display:flex}.oc-voice__card{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);flex-direction:column;gap:.6rem;margin-bottom:.9rem;padding:.9rem 1rem;display:flex}.oc-voice__cardhead{align-items:center;gap:.6rem;display:flex}.oc-voice__instance{font-weight:600}.oc-voice__row{align-items:center;gap:.75rem;display:flex}.oc-voice__row .oc-cdefaults__label{min-width:10rem}.oc-cronactions{gap:2px;display:inline-flex}.oc-cronactions button{color:var(--muted-foreground);transition:background .14s,color .14s}.oc-cronactions button:hover:not(:disabled){background:color-mix(in srgb, var(--voice) 16%, transparent);color:color-mix(in srgb, var(--voice) 55%, var(--foreground))}.oc-cronactions button:last-child:hover:not(:disabled){background:color-mix(in srgb, var(--destructive) 14%, transparent);color:var(--destructive)}@media (prefers-reduced-motion:reduce){.oc-cronactions button{transition:none}}.oc-cronedit .oc-cronedit__textarea,.oc-cronedit input,.oc-cronedit [data-slot=select-trigger],.oc-tzcombo__trigger,.oc-dtp__trigger{border-color:color-mix(in srgb, var(--voice) 22%, var(--border))}.oc-cronedit input:focus-visible,.oc-cronedit .oc-cronedit__textarea:focus-visible,.oc-tzcombo__search:focus-visible{border-color:color-mix(in srgb, var(--voice) 55%, var(--border));box-shadow:0 0 0 3px color-mix(in srgb, var(--voice) 22%, transparent);outline:none}.oc-tzcombo__trigger{border:1px solid var(--border);background:var(--background);min-width:140px;height:2.25rem;color:var(--foreground);cursor:pointer;border-radius:.6rem;flex:0 200px;justify-content:space-between;align-items:center;gap:.4rem;padding:0 .6rem;font-size:.85rem;display:inline-flex}.oc-tzcombo__value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.oc-tzcombo__chev{color:var(--muted-foreground);flex:none}.oc-tzcombo__pop{width:min(300px, var(--radix-popover-content-available-width,300px));max-height:min(340px, var(--radix-popover-content-available-height,340px));flex-direction:column;display:flex}.oc-tzcombo__search{flex:none;width:calc(100% - .8rem);margin:.4rem}.oc-tzcombo__list{flex:auto;min-height:0;padding:0 .25rem .35rem;overflow-y:auto}.oc-tzcombo__opt{width:100%;color:var(--foreground);text-align:left;cursor:pointer;background:0 0;border:none;border-radius:.45rem;align-items:center;gap:.4rem;padding:.35rem .45rem;font-size:.82rem;display:flex}.oc-tzcombo__opt:hover,.oc-tzcombo__opt[aria-selected=true]{background:color-mix(in srgb, var(--voice) 14%, transparent)}.oc-tzcombo__check{color:var(--voice);flex:none}.oc-tzcombo__empty{color:var(--muted-foreground);padding:.5rem;font-size:.82rem}.oc-dtp__trigger{border:1px solid var(--border);background:var(--background);width:100%;height:2.25rem;color:var(--foreground);cursor:pointer;border-radius:.6rem;align-items:center;gap:.45rem;padding:0 .7rem;font-size:.85rem;display:inline-flex}.oc-dtp__icon,.oc-dtp__placeholder{color:var(--muted-foreground)}.oc-dtp__pop{width:300px}.oc-dtp__head{justify-content:space-between;align-items:center;margin-bottom:.5rem;display:flex}.oc-dtp__month{text-transform:capitalize;font-size:.85rem;font-weight:600}.oc-dtp__nav{width:26px;height:26px;color:var(--muted-foreground);cursor:pointer;background:0 0;border:none;border-radius:.45rem;justify-content:center;align-items:center;display:inline-flex}.oc-dtp__nav:hover{background:color-mix(in srgb, var(--voice) 14%, transparent);color:var(--foreground)}.oc-dtp__grid{grid-template-columns:repeat(7,1fr);gap:2px;display:grid}.oc-dtp__wd{text-align:center;color:var(--muted-foreground);padding-bottom:.2rem;font-size:.68rem;font-weight:600}.oc-dtp__day{height:2rem;color:var(--foreground);cursor:pointer;background:0 0;border:none;border-radius:.45rem;font-size:.8rem}.oc-dtp__day:hover{background:color-mix(in srgb, var(--voice) 14%, transparent)}.oc-dtp__day--out{color:var(--muted-foreground);opacity:.5}.oc-dtp__day--today{box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--voice) 45%, var(--border))}.oc-dtp__day--sel{background:var(--voice);color:var(--voice-foreground,white);font-weight:600}.oc-dtp__day--sel:hover{background:color-mix(in srgb, var(--voice) 85%, black)}.oc-dtp__time{border-top:1px solid var(--border);align-items:center;gap:.35rem;margin-top:.6rem;padding-top:.6rem;display:flex}.oc-dtp__time [data-slot=select-trigger]{width:4.5rem}.oc-dtp__colon{color:var(--muted-foreground);font-weight:700}.oc-dtp__timeopts{max-height:220px}.oc-sched__viewtoggle{border:1px solid var(--border);border-radius:calc(var(--radius) - 2px);flex:none;gap:2px;padding:2px;display:inline-flex}.oc-cal{flex-direction:column;gap:10px;display:flex}.oc-cal__head{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.oc-cal__nav{align-items:center;gap:2px;display:inline-flex}.oc-cal__title{text-align:center;text-transform:capitalize;flex:1;min-width:0;font-size:.95rem;font-weight:600}.oc-cal__modes{border:1px solid var(--border);border-radius:calc(var(--radius) - 2px);gap:2px;padding:2px;display:inline-flex}.oc-cal__footnote{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cal__month{border:1px solid var(--border);border-radius:var(--radius);background:var(--border);grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;display:grid;overflow:hidden}.oc-cal__wd{background:var(--card);text-transform:uppercase;color:var(--muted-foreground);text-align:center;padding:4px 6px;font-size:.68rem;font-weight:600}.oc-cal__day{background:var(--background);flex-direction:column;gap:2px;min-width:0;min-height:84px;padding:4px;display:flex}.oc-cal__day--out{opacity:.45}.oc-cal__day--today .oc-cal__daynum{background:color-mix(in srgb, var(--voice) 80%, var(--foreground));color:var(--background)}.oc-cal__daynum{color:var(--muted-foreground);border-radius:999px;justify-content:center;align-self:flex-start;align-items:center;min-width:18px;height:18px;padding:0 4px;font-size:.72rem;font-weight:600;display:inline-flex}.oc-cal__event{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 12%, transparent);width:100%;min-width:0;color:var(--foreground);cursor:pointer;text-align:left;border:none;border-radius:5px;align-items:center;gap:4px;padding:1px 4px;font-size:.7rem;display:flex}.oc-cal__event:hover{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 22%, transparent)}.oc-cal__event--muted{opacity:.55}.oc-cal__evdot{border:1.5px solid color-mix(in srgb, var(--cal-ev,var(--voice)) 80%, var(--foreground));background:0 0;border-radius:999px;flex:none;width:6px;height:6px}.oc-cal__event--exact .oc-cal__evdot{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 80%, var(--foreground))}.oc-cal__evtime{font-variant-numeric:tabular-nums;color:var(--muted-foreground);flex:none}.oc-cal__evtitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.oc-cal__more{color:var(--muted-foreground);padding-left:4px;font-size:.68rem}.oc-cal__year{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;display:grid}.oc-cal__mini{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);cursor:pointer;text-align:left;flex-direction:column;gap:6px;padding:8px;transition:border-color .14s,background .14s;display:flex}.oc-cal__mini:hover{border-color:color-mix(in srgb, var(--voice) 35%, var(--border));background:color-mix(in srgb, var(--voice) 6%, var(--card))}@media (prefers-reduced-motion:reduce){.oc-cal__mini{transition:none}}.oc-cal__mininame{text-transform:capitalize;color:var(--foreground);font-size:.78rem;font-weight:600}.oc-cal__minigrid{grid-template-columns:repeat(7,1fr);gap:3px;display:grid}.oc-cal__minidot{background:color-mix(in srgb, var(--muted-foreground) 18%, transparent);border-radius:999px;justify-self:center;width:7px;height:7px}.oc-cal__minidot.is-out{background:0 0}.oc-cal__minidot.has-one{background:color-mix(in srgb, var(--voice) 55%, transparent)}.oc-cal__minidot.has-many{background:color-mix(in srgb, var(--voice) 90%, var(--foreground))}.oc-cal__minidot.is-today{outline:1.5px solid color-mix(in srgb, var(--voice) 80%, var(--foreground));outline-offset:1px}
@@ -1 +1 @@
1
- import{$p as e,Ap as t,Bp as n,Dp as r,Ep as i,Fp as a,Gp as o,Hp as s,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Qp as g,Rp as _,Tp as v,Up as y,Vp as b,Wp as x,Xp as S,Yp as C,Zp as w,jp as T,kp as E,qp as D,zp as O}from"./dist-CNZ9o3sc.js";var k={AGENT_NOT_FOUND:()=>({label:e(),hint:g()}),AUTH_TOKEN_MISMATCH:()=>({label:w(),hint:S()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:l()}),SESSION_SCOPE_DENIED:()=>({label:D(),hint:u()}),GATEWAY_TIMEOUT:()=>({label:o(),hint:x()}),GATEWAY_DISCONNECTED:()=>({label:y(),hint:s()}),ATTACHMENT_TOO_LARGE:()=>({label:O(),hint:_()}),ATTACHMENT_REJECTED:()=>({label:d(),hint:c()}),BRIDGE_UNREACHABLE:()=>({label:b(),hint:n()}),INVALID_REQUEST:()=>({label:a(),hint:h()}),NOT_CONFIGURED:()=>({label:p(),hint:f()}),UNROUTED:()=>({label:T(),hint:t()}),UPSTREAM_ERROR:()=>({label:E(),hint:m()}),UNKNOWN:()=>({label:r(),hint:i()})};function A(e){return e?k[e]?.()??{label:e,hint:v()}:k.UNKNOWN()}export{A as t};
1
+ import{$p as e,Ap as t,Bp as n,Dp as r,Ep as i,Fp as a,Gp as o,Hp as s,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Qp as g,Rp as _,Tp as v,Up as y,Vp as b,Wp as x,Xp as S,Yp as C,Zp as w,jp as T,kp as E,qp as D,zp as O}from"./dist-CKeB-cox.js";var k={AGENT_NOT_FOUND:()=>({label:e(),hint:g()}),AUTH_TOKEN_MISMATCH:()=>({label:w(),hint:S()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:l()}),SESSION_SCOPE_DENIED:()=>({label:D(),hint:u()}),GATEWAY_TIMEOUT:()=>({label:o(),hint:x()}),GATEWAY_DISCONNECTED:()=>({label:y(),hint:s()}),ATTACHMENT_TOO_LARGE:()=>({label:O(),hint:_()}),ATTACHMENT_REJECTED:()=>({label:d(),hint:c()}),BRIDGE_UNREACHABLE:()=>({label:b(),hint:n()}),INVALID_REQUEST:()=>({label:a(),hint:h()}),NOT_CONFIGURED:()=>({label:p(),hint:f()}),UNROUTED:()=>({label:T(),hint:t()}),UPSTREAM_ERROR:()=>({label:E(),hint:m()}),UNKNOWN:()=>({label:r(),hint:i()})};function A(e){return e?k[e]?.()??{label:e,hint:v()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,l as n,r}from"./bundle-mjs-C73ZY4La.js";import{f as i,g as a,m as o,n as s,v as c,w as l}from"./dist-CKeB-cox.js";var u=n(e(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:0,right:0,bottom:0,left:0,...e}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function L(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function R(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(x(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function z(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=L(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:z},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=R(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=R(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=ee(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=M,F=k-g[h]-N,I=k/2-g[h]/2+A,L=v(P,I,F),R=!c.arrow&&x(i)!=null&&I!==L&&a.reference[h]/2-(I<P?M:N)-g[h]/2<0,z=R?I<P?I-P:I-F:0;return{[m]:p[m]+z,data:{[m]:L,centerOffset:I-L-z,...R&&{alignmentOffset:z}},reset:R}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(!(u===`alignment`&&_!==w(t))||A.every(e=>w(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return d.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(b(i)),p=S(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=v(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=v(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=y(e,t),u=await o.detectOverflow(t,l),d=b(i),m=x(i),h=w(i)===`y`,{width:g,height:_}=a.floating,v,S;d===`top`||d===`bottom`?(v=d,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(S=d,v=m===`end`?`top`:`bottom`);let C=_-u.top-u.bottom,T=g-u.left-u.right,E=f(_-u[v],C),D=f(g-u[S],T),O=!t.middlewareData.shift,k=E,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=C),O&&!m){let e=p(u.left,0),t=p(u.right,0),n=p(u.top,0),r=p(u.bottom,0);h?A=g-2*(e!==0||t!==0?e+t:p(u.left,u.right)):k=_-2*(n!==0||r!==0?n+r:p(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return g!==j.width||_!==j.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function B(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return me()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return me()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function G(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _e(e){return/^(table|td|th)$/.test(B(e))}function ve(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ye=/transform|translate|scale|rotate|perspective|filter/,be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,xe;function Se(e){let t=U(e)?J(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!we()&&(K(t.backdropFilter)||K(t.filter))||ye.test(t.willChange||``)||be.test(t.contain||``)}function Ce(e){let t=Y(e);for(;W(t)&&!q(t);){if(Se(t))return t;if(ve(t))return null;t=Y(t)}return null}function we(){return xe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xe}function q(e){return/^(html|body|#document)$/.test(B(e))}function J(e){return V(e).getComputedStyle(e)}function Te(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||H(e);return ge(t)?t.host:t}function Ee(e){let t=Y(e);return q(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&G(t)?t:Ee(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=De(a);return t.concat(a,a.visualViewport||[],G(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function De(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oe(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ke(e){return U(e)?e:e.contextElement}function Z(e){let t=ke(e);if(!W(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Oe(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ae=g(0);function je(e){let t=V(e);return!we()||!t.visualViewport?Ae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Me(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ke(e),o=g(1);t&&(r?U(r)&&(o=Z(r)):o=Z(e));let s=Me(a,n,r)?je(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=V(a),t=r&&U(r)?V(r):r,n=e,i=De(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=De(n)}}return L({width:u,height:d,x:c,y:l})}function Ne(e,t){let n=Te(e).scrollLeft;return t?t.left+n:Q(H(e)).left+n}function Pe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ne(e,n),y:n.top+t.scrollTop}}function Fe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ve(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=W(r);if((d||!d&&!a)&&((B(r)!==`body`||G(o))&&(c=Te(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ie(e){return Array.from(e.getClientRects())}function Le(e){let t=H(e),n=Te(e),r=e.ownerDocument.body,i=p(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=p(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ne(e),s=-n.scrollTop;return J(r).direction===`rtl`&&(o+=p(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Re=25;function ze(e,t){let n=V(e),r=H(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=we();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ne(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Re&&(a-=o)}else l<=Re&&(a+=l);return{width:a,height:o,x:s,y:c}}function Be(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=W(e)?Z(e):g(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ve(e,t,n){let r;if(t===`viewport`)r=ze(e,n);else if(t===`document`)r=Le(H(e));else if(U(t))r=Be(t,n);else{let n=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return L(r)}function He(e,t){let n=Y(e);return n===t||!U(n)||q(n)?!1:J(n).position===`fixed`||He(n,t)}function Ue(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;U(o)&&!q(o);){let t=J(o),n=Se(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||G(o)&&!n&&He(e,o))?r=r.filter(e=>e!==o):i=t,o=Y(o)}return t.set(e,r),r}function We(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ve(t)?[]:Ue(t,this._c):[].concat(n),r],o=Ve(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ve(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ge(e){let{width:t,height:n}=Oe(e);return{width:t,height:n}}function Ke(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);function l(){c.x=Ne(i)}if(r||!r&&!a)if((B(t)!==`body`||G(i))&&(s=Te(t)),r){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Pe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function qe(e){return J(e).position===`static`}function Je(e,t){if(!W(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Ye(e,t){let n=V(e);if(ve(e))return n;if(!W(e)){let t=Y(e);for(;t&&!q(t);){if(U(t)&&!qe(t))return t;t=Y(t)}return n}let r=Je(e,t);for(;r&&_e(r)&&qe(r);)r=Je(r,t);return r&&q(r)&&qe(r)&&!Se(r)?n:r||Ce(e)||n}var Xe=async function(e){let t=this.getOffsetParent||Ye,n=this.getDimensions,r=await n(e.floating);return{reference:Ke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ze(e){return J(e).direction===`rtl`}var Qe={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:H,getClippingRect:We,getOffsetParent:Ye,getElementRects:Xe,getClientRects:Ie,getDimensions:Ge,getScale:Z,isElement:U,isRTL:Ze};function $e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function et(e,t){let n=null,r,i=H(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(s||t(),!m||!g)return;let _=h(d),v=h(i.clientWidth-(u+m)),y=h(i.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!$e(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function tt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ke(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?et(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!$e(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var nt=ue,rt=de,it=ie,at=pe,ot=se,st=re,ct=fe,lt=(e,t,n)=>{let r=new Map,i={platform:Qe,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},ut=n(t(),1),dt=typeof document<`u`?u.useLayoutEffect:function(){};function ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ft(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(e,t){let n=pt(e);return Math.round(t*n)/n}function ht(e){let t=u.useRef(e);return dt(()=>{t.current=e}),t}function gt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);ft(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=ht(c),O=ht(i),k=ht(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),lt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ft(T.current,t)&&(T.current=t,ut.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);dt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);dt(()=>(j.current=!0,()=>{j.current=!1}),[]),dt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=mt(N.floating,d.x),r=mt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...pt(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var _t=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:st({element:r.current,padding:i}).fn(n):r?st({element:r,padding:i}).fn(n):{}}}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},bt=(e,t)=>({fn:ct(e).fn,options:[e,t]}),xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},wt=(e,t)=>{let n=_t(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),Tt=`Arrow`,Et=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Et.displayName=Tt;var Dt=Et,Ot=`Popper`,[kt,At]=o(Ot),[jt,Mt]=kt(Ot),Nt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,$.jsx)(jt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Nt.displayName=Ot;var Pt=`PopperAnchor`,Ft=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Mt(Pt,n),o=u.useRef(null),s=a.onAnchorChange,d=l(t,u.useCallback(e=>{o.current=e,e&&s(e)},[s])),f=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&s(f.current)});let p=a.placementState&&Gt(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(c.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:d})});Ft.displayName=Pt;var It=`PopperContent`,[Lt,Rt]=kt(It),zt=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:d=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h,collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=Mt(It,n),[C,w]=u.useState(null),T=l(t,e=>w(e)),[E,D]=u.useState(null),O=s(E),k=O?.width??0,A=O?.height??0,j=r+(d===`center`?``:`-`+d),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=h?Array.isArray(h)?h:[h]:void 0,P=N!==void 0&&N.length>0,F={padding:M,boundary:N?.filter(Ut),altBoundary:P},{refs:I,floatingStyles:ee,placement:L,isPositioned:R,middlewareData:z}=gt({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>tt(...e,{animationFrame:y===`always`}),elements:{reference:S.anchor},middleware:[vt({mainAxis:o+A,alignmentAxis:f}),m&&yt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?bt():void 0,...F}),m&&xt({...F}),St({...F,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&wt({element:E,padding:p}),Wt({arrowWidth:k,arrowHeight:A}),v&&Ct({strategy:`referenceHidden`,...F})]}),te=S.setPlacementState;i(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Gt(L),ie=a(b);i(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=u.useState();return i(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,$.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:R?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Lt,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,$.jsx)(c.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?void 0:`none`}})})})});zt.displayName=It;var Bt=`PopperArrow`,Vt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ht=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Rt(Bt,n),a=Vt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Dt,{...r,ref:t,style:{...r.style,display:`block`}})})});Ht.displayName=Bt;function Ut(e){return e!==null}var Wt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Gt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Gt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Kt=Nt,qt=Ft,Jt=zt,Yt=Ht;export{At as a,Kt as i,Yt as n,Jt as r,qt as t};