omnigateway 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -608
- package/bin/omni.js +6347 -2002
- package/gateway.js +7642 -2632
- package/package.json +1 -1
- package/public/assets/{Chip-shturdCv.js → Chip-Did4Zhvj.js} +1 -1
- package/public/assets/{CopyValue-BGt9RRTL.js → CopyValue-Cjg9QXrD.js} +1 -1
- package/public/assets/Lamp-C2Q3t5Mn.js +25 -0
- package/public/assets/Rack-D0_N-xsd.js +476 -0
- package/public/assets/{RequestTable-huSAoNZg.js → RequestTable-i9paP_7e.js} +1 -1
- package/public/assets/{SummaryDeck-BPo2bMSC.js → SummaryDeck-g4yLDeXB.js} +1 -1
- package/public/assets/{Toggle-C84xs_YB.js → Toggle-D-NDlneh.js} +1 -1
- package/public/assets/{TokenBreakdown-CmzXuENj.js → TokenBreakdown-D5ZIngM6.js} +1 -1
- package/public/assets/{WindowChart-BZzVrxYk.js → WindowChart-BsonO5Py.js} +1 -1
- package/public/assets/{_app.accounts-DMmtkwnl.js → _app.accounts-DFhyE62a.js} +1 -1
- package/public/assets/{_app.console-BBz3kCPV.js → _app.console-BfHcfQMp.js} +6 -6
- package/public/assets/{_app.database-ZvtMVgsh.js → _app.database-Cgw9z3rK.js} +1 -1
- package/public/assets/{_app.index-DKouD-rz.js → _app.index-Blw3S4-3.js} +1 -1
- package/public/assets/{_app.keys-BG9-zfh6.js → _app.keys-DrdfnfIk.js} +1 -1
- package/public/assets/{_app.logs-DjinYGYS.js → _app.logs-DUOqlJzB.js} +1 -1
- package/public/assets/{_app.models-BCfQVuoT.js → _app.models-Dm83HRaM.js} +1 -1
- package/public/assets/{_app.plugins._pluginId-Dm48f3wz.js → _app.plugins._pluginId-BmJGDYxw.js} +1 -1
- package/public/assets/{_app.settings-C42ylcNP.js → _app.settings-66rm4vHJ.js} +1 -1
- package/public/assets/{_app.usage-DfPM6eQ-.js → _app.usage-BCufy5XR.js} +1 -1
- package/public/assets/{chevron-right-HI_fK6Gw.js → chevron-right-BZ4QmUDM.js} +1 -1
- package/public/assets/{client-TUf0nuim.js → client-De1_cEH5.js} +1 -1
- package/public/assets/index-PP8vsvw3.js +13 -0
- package/public/assets/{login-w-hVstKf.js → login-CkZlwcdd.js} +1 -1
- package/public/assets/plus-D5AwIXj3.js +1 -0
- package/public/assets/preload-helper-BC9bKUg1.js +1 -0
- package/public/assets/shared-C47BfV_u.js +77 -0
- package/public/assets/{trash-2-Bq4GaXzx.js → trash-2-BLc5o7DN.js} +1 -1
- package/public/index.html +4 -7
- package/public/shared/chunks/{react-dom-BTlfKTOo.js → react-dom-BFxyned6.js} +1 -1
- package/public/shared/dashboard-sdk.js +1 -1
- package/public/shared/react-dom-client.js +3 -3
- package/public/shared/react-dom.js +1 -1
- package/public/shared/react-query.js +1 -1
- package/public/shared/styled-components.js +2 -2
- package/public/assets/Lamp-CVGUT2YK.js +0 -25
- package/public/assets/Rack-BbZyyu2u.js +0 -466
- package/public/assets/_app.plugins._pluginId-B9k5eqAt.js +0 -2
- package/public/assets/index-C66Zn0tX.js +0 -13
- package/public/assets/login-DWgivEPK.js +0 -2
- package/public/assets/plus-BCf2TPqz.js +0 -1
- package/public/assets/preload-helper-Unv7FI91.js +0 -1
- package/public/assets/shared-XRnr7At9.js +0 -77
- package/public/assets/stream-3PafhwhZ.js +0 -1
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import{Gt as e,I as t,Kt as n,N as r,Ot as i,P as a,bt as o,i as s,t as c,vt as l,wt as u,x as d,xt as f,zt as p}from"./Lamp-C2Q3t5Mn.js";import{C as m,D as h,E as g,O as _,S as v,T as y,_ as b,b as x,o as S,v as C}from"./Panel-BlNr9j6-.js";import*as w from"react";import{createContext as T,createElement as E,forwardRef as ee,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as se,jsx as O,jsxs as k}from"react/jsx-runtime";import A,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";import*as pe from"react-dom";var me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},be=T({}),xe=()=>re(be),Se=ee(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=xe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return E(`svg`,{ref:c,...ve,width:t??l??ve.width,height:t??l??ve.height,stroke:e??f,strokeWidth:m,className:me(`lucide`,p,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>E(e,t)),...Array.isArray(a)?a:[a]])}),j=(e,t)=>{let n=ee(({className:n,...r},i)=>E(Se,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},Ce=j(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),we=j(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Te=j(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ee=j(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),De=j(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Oe=j(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ke=j(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ae=j(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),je=j(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),Me=j(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ne=j(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Pe=j(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Fe=j(`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`}]]),Ie=j(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Le=j(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Re=j(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ze=j(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Be(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
|
|
2
|
+
`)}var Ve=le`
|
|
3
|
+
:root {
|
|
4
|
+
${({$providers:e})=>Be(e,`light`)}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dark {
|
|
8
|
+
${({$providers:e})=>Be(e,`dark`)}
|
|
9
|
+
}
|
|
10
|
+
`,He=le`
|
|
11
|
+
:root {
|
|
12
|
+
color-scheme: light;
|
|
13
|
+
|
|
14
|
+
--rack: oklch(0.962 0.004 258);
|
|
15
|
+
--panel: oklch(1 0 0);
|
|
16
|
+
--panel-sunk: oklch(0.972 0.004 258);
|
|
17
|
+
--panel-raised: oklch(0.988 0.003 258);
|
|
18
|
+
--rule: oklch(0.9 0.006 258);
|
|
19
|
+
--rule-strong: oklch(0.82 0.008 258);
|
|
20
|
+
|
|
21
|
+
--ink: oklch(0.22 0.017 258);
|
|
22
|
+
--ink-dim: oklch(0.45 0.015 258);
|
|
23
|
+
--ink-faint: oklch(0.62 0.012 258);
|
|
24
|
+
|
|
25
|
+
--accent: oklch(0.52 0.17 262);
|
|
26
|
+
--accent-ink: oklch(0.99 0 0);
|
|
27
|
+
--accent-wash: oklch(0.52 0.17 262 / 0.11);
|
|
28
|
+
|
|
29
|
+
--ok: oklch(0.52 0.13 162);
|
|
30
|
+
--warn: oklch(0.58 0.13 72);
|
|
31
|
+
--down: oklch(0.53 0.2 27);
|
|
32
|
+
--ok-wash: oklch(0.52 0.13 162 / 0.12);
|
|
33
|
+
--warn-wash: oklch(0.58 0.13 72 / 0.14);
|
|
34
|
+
--down-wash: oklch(0.53 0.2 27 / 0.11);
|
|
35
|
+
|
|
36
|
+
--grid-line: oklch(0.22 0.017 258 / 0.055);
|
|
37
|
+
--shadow: 0 1px 2px oklch(0.22 0.017 258 / 0.06);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dark {
|
|
41
|
+
color-scheme: dark;
|
|
42
|
+
|
|
43
|
+
--rack: oklch(0.163 0.013 258);
|
|
44
|
+
--panel: oklch(0.204 0.013 258);
|
|
45
|
+
--panel-sunk: oklch(0.183 0.013 258);
|
|
46
|
+
--panel-raised: oklch(0.246 0.013 258);
|
|
47
|
+
--rule: oklch(0.3 0.012 258);
|
|
48
|
+
--rule-strong: oklch(0.4 0.014 258);
|
|
49
|
+
|
|
50
|
+
--ink: oklch(0.94 0.006 250);
|
|
51
|
+
--ink-dim: oklch(0.72 0.011 253);
|
|
52
|
+
--ink-faint: oklch(0.55 0.012 255);
|
|
53
|
+
|
|
54
|
+
--accent: oklch(0.74 0.13 262);
|
|
55
|
+
--accent-ink: oklch(0.17 0.02 262);
|
|
56
|
+
--accent-wash: oklch(0.74 0.13 262 / 0.18);
|
|
57
|
+
|
|
58
|
+
--ok: oklch(0.75 0.14 162);
|
|
59
|
+
--warn: oklch(0.82 0.14 80);
|
|
60
|
+
--down: oklch(0.68 0.19 25);
|
|
61
|
+
--ok-wash: oklch(0.75 0.14 162 / 0.16);
|
|
62
|
+
--warn-wash: oklch(0.82 0.14 80 / 0.16);
|
|
63
|
+
--down-wash: oklch(0.68 0.19 25 / 0.16);
|
|
64
|
+
|
|
65
|
+
--grid-line: oklch(0.94 0.006 250 / 0.045);
|
|
66
|
+
--shadow: 0 1px 2px oklch(0 0 0 / 0.3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
*,
|
|
70
|
+
*::before,
|
|
71
|
+
*::after {
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
html,
|
|
76
|
+
body,
|
|
77
|
+
#root {
|
|
78
|
+
height: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
html {
|
|
82
|
+
background: ${({theme:e})=>e.color.rack};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
body {
|
|
86
|
+
margin: 0;
|
|
87
|
+
background: ${({theme:e})=>e.color.rack};
|
|
88
|
+
color: ${({theme:e})=>e.color.ink};
|
|
89
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
line-height: 1.45;
|
|
92
|
+
-webkit-font-smoothing: antialiased;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
h1, h2, h3, h4, p, figure, dl, dd {
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
ul, ol {
|
|
100
|
+
margin: 0;
|
|
101
|
+
padding: 0;
|
|
102
|
+
list-style: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
button, input, select, textarea {
|
|
106
|
+
font: inherit;
|
|
107
|
+
color: inherit;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
a {
|
|
111
|
+
color: inherit;
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:focus-visible {
|
|
116
|
+
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
117
|
+
outline-offset: 1px;
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
::selection {
|
|
122
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
::-webkit-scrollbar {
|
|
126
|
+
width: 10px;
|
|
127
|
+
height: 10px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
::-webkit-scrollbar-track {
|
|
131
|
+
background: transparent;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
::-webkit-scrollbar-thumb {
|
|
135
|
+
background: ${({theme:e})=>e.color.ruleStrong};
|
|
136
|
+
border: 3px solid transparent;
|
|
137
|
+
background-clip: padding-box;
|
|
138
|
+
border-radius: 6px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media (prefers-reduced-motion: reduce) {
|
|
142
|
+
*,
|
|
143
|
+
*::before,
|
|
144
|
+
*::after {
|
|
145
|
+
animation-duration: 0.01ms !important;
|
|
146
|
+
animation-iteration-count: 1 !important;
|
|
147
|
+
transition-duration: 0.01ms !important;
|
|
148
|
+
scroll-behavior: auto !important;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,Ue={color:{rack:`var(--rack)`,panel:`var(--panel)`,panelSunk:`var(--panel-sunk)`,panelRaised:`var(--panel-raised)`,rule:`var(--rule)`,ruleStrong:`var(--rule-strong)`,ink:`var(--ink)`,inkDim:`var(--ink-dim)`,inkFaint:`var(--ink-faint)`,accent:`var(--accent)`,accentInk:`var(--accent-ink)`,accentWash:`var(--accent-wash)`,ok:`var(--ok)`,warn:`var(--warn)`,down:`var(--down)`,okWash:`var(--ok-wash)`,warnWash:`var(--warn-wash)`,downWash:`var(--down-wash)`,shadow:`var(--shadow)`},font:{sans:`"Archivo Variable", ui-sans-serif, system-ui, sans-serif`,mono:`"Spline Sans Mono Variable", ui-monospace, "SF Mono", Menlo, monospace`},radius:{panel:`4px`,control:`3px`,chip:`2px`},space:e=>`${e*4}px`,z:{rail:20,chassis:30,overlay:40,dialog:50,toast:60}},We=/^[a-z][a-z0-9-]{0,31}$/;function Ge(e){return We.test(e)?`var(--p-${e}, var(--ink-faint))`:`var(--ink-faint)`}var Ke=`omni-theme`;function qe(e){return e===`light`||e===`dark`||e===`system`}function Je(){try{let e=localStorage.getItem(Ke);return qe(e)?e:`system`}catch{return`system`}}function Ye(){return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function Xe(e){return e===`system`?Ye()?`dark`:`light`:e}function Ze(e){let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}var Qe=T(null);function $e(){let e=te(Qe);if(e===null)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function et({children:e}){let[t,n]=D(Je),[r,i]=D(()=>Xe(Je())),a=ne(e=>{n(e);try{localStorage.setItem(Ke,e)}catch{}},[]);return ie(()=>{let e=Xe(t);i(e),Ze(e)},[t]),ie(()=>{if(t!==`system`||typeof matchMedia!=`function`)return;let e=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=Ye()?`dark`:`light`;i(e),Ze(e)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),O(Qe,{value:{mode:t,resolved:r,setMode:a},children:k(ce,{theme:Ue,children:[O(He,{}),e]})})}var tt=A.svg`
|
|
152
|
+
display: block;
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
overflow: visible;
|
|
156
|
+
`;function nt(e,t,n,r){if(e.length===0)return``;let i=e.length===1?0:t/(e.length-1);return e.map((e,t)=>{let a=t*i,o=n-(r===0?0:e/r*n);return`${t===0?`M`:`L`}${a.toFixed(2)},${o.toFixed(2)}`}).join(` `)}function rt({values:e,overlay:t,height:n=28,color:r,overlayColor:i,scaleTo:a,label:o,className:s}){let c=ae(),l=a===void 0?Math.max(1,...e,...t??[]):Math.max(1,a),u=nt(e,100,n,l),d=u.length===0?``:`${u} L100,${n} L0,${n} Z`;return k(tt,{className:s,viewBox:`0 0 100 ${n}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o,style:{height:n},children:[O(`defs`,{children:k(`linearGradient`,{id:c,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[O(`stop`,{offset:`0%`,stopColor:r??`var(--accent)`,stopOpacity:`0.28`}),O(`stop`,{offset:`100%`,stopColor:r??`var(--accent)`,stopOpacity:`0`})]})}),d.length===0?null:O(`path`,{d,fill:`url(#${c})`}),t===void 0?null:O(`path`,{d:nt(t,100,n,l),fill:`none`,stroke:i??`var(--down)`,strokeWidth:`1.25`,vectorEffect:`non-scaling-stroke`}),O(`path`,{d:u,fill:`none`,stroke:r??`var(--accent)`,strokeWidth:`1.5`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})}var it=A.header`
|
|
157
|
+
grid-area: chassis;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
161
|
+
height: 48px;
|
|
162
|
+
padding: 0 ${({theme:e})=>e.space(3)};
|
|
163
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
164
|
+
background: ${({theme:e})=>e.color.panel};
|
|
165
|
+
${g}
|
|
166
|
+
position: sticky;
|
|
167
|
+
top: 0;
|
|
168
|
+
z-index: ${({theme:e})=>e.z.chassis};
|
|
169
|
+
`,at=A.div`
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: baseline;
|
|
172
|
+
gap: 7px;
|
|
173
|
+
font-stretch: 74%;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
letter-spacing: 0.2em;
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
text-transform: uppercase;
|
|
178
|
+
flex: none;
|
|
179
|
+
`,ot=A(x)`
|
|
180
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
|
|
183
|
+
@media (max-width: 860px) {
|
|
184
|
+
display: none;
|
|
185
|
+
}
|
|
186
|
+
`,M=A.div`
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: baseline;
|
|
189
|
+
gap: 6px;
|
|
190
|
+
padding-left: ${({theme:e})=>e.space(3)};
|
|
191
|
+
border-left: 1px solid ${({theme:e})=>e.color.rule};
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
`,st=A(M)`
|
|
194
|
+
width: 96px;
|
|
195
|
+
align-items: center;
|
|
196
|
+
`,ct=A.div`
|
|
197
|
+
flex: 1;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
`,lt=A(h)`
|
|
200
|
+
gap: 6px;
|
|
201
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
202
|
+
letter-spacing: 0.08em;
|
|
203
|
+
`,ut=A.span`
|
|
204
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
205
|
+
`,dt={push:{name:`live, pushing`,lamp:`live`,head:`LIVE`,tail:`PUSH`,title:`Refreshing on gateway push — pause refreshing`},poll:{name:`live, polling`,lamp:`ok`,head:`LIVE`,tail:`POLL`,title:`Refreshing on a timer — pause refreshing`},paused:{name:`paused`,lamp:`idle`,head:`PAUSED`,tail:null,title:`Resume refreshing`},offline:{name:`offline`,lamp:`down`,head:`OFFLINE`,tail:null,title:`Not refreshing — this session ended, sign in again`}},ft=[`system`,`light`,`dark`],pt={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},mt=6e5;function ht({logs:e,logsFailed:n,signOut:i}){let{live:o,toggle:l,connection:u}=fe(),{mode:f,setMode:p}=$e(),m=Date.now(),h=oe(()=>e.filter(e=>m-e.at<=mt),[e,m]),g=d(h,mt),y=s(h,{now:m,spanMs:mt,count:24}),x=ft[(ft.indexOf(f)+1)%ft.length]??`system`,S=f===`light`?Le:f===`dark`?Me:je,w=dt[o?u.status===`offline`?`offline`:u.status===`push`?`push`:`poll`:`paused`],T=n||g.errorRate>=.25?`down`:g.errorRate>=.05?`warn`:h.length===0?`idle`:`ok`;return k(it,{children:[k(at,{children:[O(c,{state:T,label:n?`request log unreadable`:`error rate ${a(g.errorRate)}`}),`Omnigateway`]}),k(ot,{children:[k(st,{children:[O(b,{children:`req`}),O(ct,{children:O(rt,{values:y.map(e=>e.total),overlay:y.map(e=>e.errors),height:22,label:`${g.requests} requests in the last 10 minutes`})})]}),k(M,{children:[O(b,{children:`rate`}),O(C,{children:g.ratePerMin.toFixed(1)}),O(b,{children:`/min`})]}),k(M,{children:[O(b,{children:`err`}),O(C,{style:{color:g.errorRate>=.05?`var(--down)`:void 0},children:a(g.errorRate)})]}),k(M,{children:[O(b,{children:`ttft p50`}),O(C,{children:r(g.ttftP50)})]}),k(M,{children:[O(b,{children:`spend`}),O(C,{children:t(g.costUsd)})]})]}),O(v,{}),k(lt,{type:`button`,$size:`sm`,onClick:l,"aria-pressed":o,"aria-label":w.name,title:w.title,children:[O(c,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:k(se,{children:[O(ut,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),O(_,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>p(x),"aria-label":pt[f],title:`${pt[f]} — switch to ${pt[x].toLowerCase()}`,children:O(S,{})}),O(_,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:i.pending,onClick:i.run,children:O(Ae,{})})]})}function gt(){let e=n(),{cadence:t}=fe(),r=o(),i=f(200,t(1e4,`res:logs`));return O(ht,{logs:i.data??[],logsFailed:i.isError,signOut:{pending:r.isPending,run:()=>{r.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})}}})}function _t(e){return`/plugins/${e}`}function vt(e){return e.filter(e=>e.nav!==null&&e.ui!==null).sort((e,t)=>e.id.localeCompare(t.id)).map(e=>({id:e.id,label:e.nav?.label??e.name,disabledReason:yt(e)}))}function yt(e){let t=e.ui;return t===null||t.compatible&&t.entry!==null?null:t.reason??`This plugin's interface does not match this gateway.`}var bt=Object.defineProperty,xt=(e,t)=>bt(e,`name`,{value:t,configurable:!0});function St(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}xt(St,`setRef`);function Ct(...e){return t=>{let n=!1,r=e.map(e=>{let r=St(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():St(e[t],null)}}}}xt(Ct,`composeRefs`);function N(...e){return w.useCallback(Ct(...e),e)}xt(N,`useComposedRefs`);var wt=Object.defineProperty,P=(e,t)=>wt(e,`name`,{value:t,configurable:!0});function Tt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Nt(r)&&typeof Lt==`function`&&(r=Lt(r._payload)),w.Children.forEach(r,e=>{if(jt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Nt(n)&&typeof Lt==`function`&&(n=Lt(n._payload)),a=Ot(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?At(a):void 0,l=N(n,c);if(!a){if(r||r===0)throw Error(o?It(e):Ft(e));return r}let u=kt(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}P(Tt,`createSlot`);var Et=Symbol.for(`radix.slottable`);function Dt(e){let t=P(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Et,t}P(Dt,`createSlottable`);var Ot=P((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function kt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}P(kt,`mergeProps`);function At(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}P(At,`getElementRef`);function jt(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Et}P(jt,`isSlottable`);var Mt=Symbol.for(`react.lazy`);function Nt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Mt&&`_payload`in e&&Pt(e._payload)}P(Nt,`isLazyComponent`);function Pt(e){return typeof e==`object`&&!!e&&`then`in e}P(Pt,`isPromiseLike`);var Ft=P(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),It=P(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Lt=w.use,Rt=Object.defineProperty,zt=(e,t)=>Rt(e,`name`,{value:t,configurable:!0}),F=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Tt(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),O(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bt(e,t){e&&pe.flushSync(()=>e.dispatchEvent(t))}zt(Bt,`dispatchDiscreteCustomEvent`);var Vt=Object.defineProperty,I=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ht(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=I(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return O(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return I(i,`useContext`),[r,i]}I(Ht,`createContext`);function Ut(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=I(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return O(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return I(s,`useContext`),[o,s]}I(r,`createContext`);let i=I(()=>{let t=n.map(e=>w.createContext(e));return I(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Wt(i,...t)]}I(Ut,`createContextScope`);function Wt(...e){let t=e[0];if(e.length===1)return t;let n=I(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return I(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}I(Wt,`composeContextScopes`);var Gt=Object.defineProperty,L=(e,t)=>Gt(e,`name`,{value:t,configurable:!0}),Kt=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return L(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}L(R,`composeEventHandlers`);function qt(e){if(!Kt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}L(qt,`getOwnerWindow`);function Jt(e){if(!Kt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}L(Jt,`getOwnerDocument`);function Yt(e,t=!1){let{activeElement:n}=Jt(e);if(!n?.nodeName)return null;if(Xt(n)&&n.contentDocument)return Yt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jt(n).getElementById(e);if(t)return t}}return n}L(Yt,`getActiveElement`);function Xt(e){return e.tagName===`IFRAME`}L(Xt,`isFrame`);var z=globalThis?.document?w.useLayoutEffect:()=>{},Zt=Object.defineProperty,Qt=(e,t)=>Zt(e,`name`,{value:t,configurable:!0}),$t=w.useEffectEvent,en=w.useInsertionEffect;function tn(e){if(typeof $t==`function`)return $t(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof en==`function`?en(()=>{t.current=e}):z(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Qt(tn,`useEffectEvent`);var nn=Object.defineProperty,B=(e,t)=>nn(e,`name`,{value:t,configurable:!0}),rn=w.useInsertionEffect||z;function an({prop:e,defaultProp:t,onChange:n=B(()=>{},`onChange`),caller:r}){let[i,a,o]=on({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=sn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}B(an,`useControllableState`);function on({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return rn(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}B(on,`useUncontrolledState`);function sn(e){return typeof e==`function`}B(sn,`isFunction`);var cn=Symbol(`RADIX:SYNC_STATE`);function ln(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=tn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===cn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:cn,state:i})},[i,d.state,c]),[h,f]}B(ln,`useControllableStateReducer`);var un=Object.defineProperty,V=(e,t)=>un(e,`name`,{value:t,configurable:!0});function dn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}V(dn,`useStateMachine`);var fn=V(e=>{let{present:t,children:n}=e,r=pn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=hn(r.ref,gn(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function pn(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=dn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??H(r.current),o.current=void 0):a.current=`none`},[s]),z(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=H(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),z(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=V(a=>{let o=H(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=V(e=>{e.target===t&&(a.current=H(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=H(t)}else r.current=null;n(e)},[])}}V(pn,`usePresence`);function mn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}V(mn,`setRef`);function hn(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=mn(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():mn(n[e],null)}}},[])}V(hn,`useStableComposedRefs`);function H(e){return e?.animationName||`none`}V(H,`getAnimationName`);function gn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}V(gn,`getElementRef`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=w.useId||(()=>void 0),bn=0;function xn(e){let[t,n]=w.useState(yn());return z(()=>{e||n(e=>e??String(bn++))},[e]),e||(t?`radix-${t}`:``)}vn(xn,`useId`);var Sn=Object.defineProperty,Cn=(e,t)=>Sn(e,`name`,{value:t,configurable:!0});function U(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Cn(U,`useCallbackRef`);var wn=Object.defineProperty,W=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),Tn=`dismissableLayer.update`,En=`dismissableLayer.pointerDownOutside`,Dn=`dismissableLayer.focusOutside`,On,kn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),An=w.forwardRef(W(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(kn),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=N(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=Nn(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=Pn(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,ee=U(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(E)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,E,ee]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(On=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Fn(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=On))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Fn())},[d,u]),w.useEffect(()=>{let e=W(()=>m({}),`handleUpdate`);return document.addEventListener(Tn,e),()=>document.removeEventListener(Tn,e)},[]),O(F.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,T.onFocusCapture),onBlurCapture:R(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function jn(){let e=w.useContext(kn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}W(jn,`useDismissableLayerSurface`);var Mn=W(()=>!0,`IS_TRUE`);function Nn(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Mn}=t,s=U(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}W(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}W(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}W(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}W(p,`handleInteractionBubble`);let m=W(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||In(En,s,p,{discrete:!0})};if(W(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:W(()=>c.current=!0,`onPointerDownCapture`)}}W(Nn,`usePointerDownOutside`);function Pn(e,t=globalThis?.document){let n=U(e),r=w.useRef(!1);return w.useEffect(()=>{let e=W(e=>{e.target&&!r.current&&In(Dn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:W(()=>r.current=!0,`onFocusCapture`),onBlurCapture:W(()=>r.current=!1,`onBlurCapture`)}}W(Pn,`useFocusOutside`);function Fn(){let e=new CustomEvent(Tn);document.dispatchEvent(e)}W(Fn,`dispatchUpdate`);function In(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Bt(i,a):i.dispatchEvent(a)}W(In,`handleAndDispatchCustomEvent`);var Ln=Object.defineProperty,G=(e,t)=>Ln(e,`name`,{value:t,configurable:!0}),Rn=`focusScope.autoFocusOnMount`,zn=`focusScope.autoFocusOnUnmount`,Bn={bubbles:!1,cancelable:!0},Vn=w.forwardRef(G(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=U(i),u=U(a),d=w.useRef(null),f=N(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:K(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||K(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)};G(e,`handleFocusIn`),G(t,`handleFocusOut`),G(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){Jn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Rn,Bn);s.addEventListener(Rn,l),s.dispatchEvent(t),t.defaultPrevented||(Hn(Zn(Wn(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(Rn,l),setTimeout(()=>{let t=new CustomEvent(zn,Bn);s.addEventListener(zn,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(zn,u),Jn.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Un(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&K(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&K(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return O(F.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Hn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}G(Hn,`focusFirst`);function Un(e){let t=Wn(e);return[Gn(t,e),Gn(t.reverse(),e)]}G(Un,`getTabbableEdges`);function Wn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:G(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}G(Wn,`getTabbableCandidates`);function Gn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Kn(r,{upTo:t})))return r}G(Gn,`findVisible`);function Kn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}G(Kn,`isHidden`);function qn(e){return e instanceof HTMLInputElement&&`select`in e}G(qn,`isSelectableInput`);function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qn(e)&&t&&e.select()}}G(K,`focus`);var Jn=Yn();function Yn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xn(e,t),e.unshift(t)},remove(t){e=Xn(e,t),e[0]?.resume()}}}G(Yn,`createFocusScopesStack`);function Xn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}G(Xn,`arrayRemove`);function Zn(e){return e.filter(e=>e.tagName!==`A`)}G(Zn,`removeLinks`);var Qn=Object.defineProperty,$n=w.forwardRef(((e,t)=>Qn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);z(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pe.createPortal(O(F.div,{...r,ref:t}),o):null},`Portal`)),er=Object.defineProperty,tr=(e,t)=>er(e,`name`,{value:t,configurable:!0}),nr=0,q=null;function rr(e){return ir(),e.children}tr(rr,`FocusGuards`);function ir(){w.useEffect(()=>{q||={start:ar(),end:ar()};let{start:e,end:t}=q;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),nr++,()=>{nr===1&&(q?.start.remove(),q?.end.remove(),q=null),nr=Math.max(0,nr-1)}},[])}tr(ir,`useFocusGuards`);function ar(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}tr(ar,`createFocusGuard`);var J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function or(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function sr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var cr=`right-scroll-bar-position`,lr=`width-before-scroll-bar`,ur=`with-scroll-bars-hidden`,dr=`--removed-body-scroll-bar-size`;function fr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function pr(e,t){var n=D(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var mr=typeof window<`u`?w.useLayoutEffect:w.useEffect,hr=new WeakMap;function gr(e,t){var n=pr(t||null,function(t){return e.forEach(function(e){return fr(e,t)})});return mr(function(){var t=hr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||fr(e,null)}),i.forEach(function(e){r.has(e)||fr(e,a)})}hr.set(n,e)},[e]),n}function _r(e){return e}function vr(e,t){t===void 0&&(t=_r);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function yr(e){e===void 0&&(e={});var t=vr(null);return t.options=J({async:!0,ssr:!1},e),t}var br=function(e){var t=e.sideCar,n=or(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,J({},n))};br.isSideCarExport=!0;function xr(e,t){return e.useMedium(t),br}var Sr=yr(),Cr=function(){},wr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Cr,onWheelCapture:Cr,onTouchMoveCapture:Cr}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=or(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=gr([n,t]),C=J(J({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Sr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),J(J({},C),{ref:S})):w.createElement(v,J({},C,{className:c,ref:S}),s))});wr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wr.classNames={fullWidth:lr,zeroRight:cr};var Tr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Er(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Tr();return t&&e.setAttribute(`nonce`,t),e}function Dr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Or(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var kr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Er())&&(Dr(t,n),Or(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ar=function(){var e=kr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jr=function(){var e=Ar();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Mr={left:0,top:0,right:0,gap:0},Nr=function(e){return parseInt(e||``,10)||0},Pr=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Nr(n),Nr(r),Nr(i)]},Fr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Mr;var t=Pr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ir=jr(),Lr=`data-scroll-locked`,Rr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
206
|
+
.${ur} {
|
|
207
|
+
overflow: hidden ${r};
|
|
208
|
+
padding-right: ${s}px ${r};
|
|
209
|
+
}
|
|
210
|
+
body[${Lr}] {
|
|
211
|
+
overflow: hidden ${r};
|
|
212
|
+
overscroll-behavior: contain;
|
|
213
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
214
|
+
padding-left: ${i}px;
|
|
215
|
+
padding-top: ${a}px;
|
|
216
|
+
padding-right: ${o}px;
|
|
217
|
+
margin-left:0;
|
|
218
|
+
margin-top:0;
|
|
219
|
+
margin-right: ${s}px ${r};
|
|
220
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.${cr} {
|
|
224
|
+
right: ${s}px ${r};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.${lr} {
|
|
228
|
+
margin-right: ${s}px ${r};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.${cr} .${cr} {
|
|
232
|
+
right: 0 ${r};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.${lr} .${lr} {
|
|
236
|
+
margin-right: 0 ${r};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
body[${Lr}] {
|
|
240
|
+
${dr}: ${s}px;
|
|
241
|
+
}
|
|
242
|
+
`},zr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Br=function(){w.useEffect(function(){return document.body.setAttribute(Lr,(zr()+1).toString()),function(){var e=zr()-1;e<=0?document.body.removeAttribute(Lr):document.body.setAttribute(Lr,e.toString())}},[])},Vr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Br();var a=w.useMemo(function(){return Fr(i)},[i]);return w.createElement(Ir,{styles:Rr(a,!t,i,n?``:`!important`)})},Hr=!1;if(typeof window<`u`)try{var Ur=Object.defineProperty({},"passive",{get:function(){return Hr=!0,!0}});window.addEventListener(`test`,Ur,Ur),window.removeEventListener(`test`,Ur,Ur)}catch{Hr=!1}var Y=Hr?{passive:!1}:!1,Wr=function(e){return e.tagName===`TEXTAREA`},Gr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Wr(e)&&n[t]===`visible`)},Kr=function(e){return Gr(e,`overflowY`)},qr=function(e){return Gr(e,`overflowX`)},Jr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Zr(e,r)){var i=Qr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Xr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Zr=function(e,t){return e===`v`?Kr(t):qr(t)},Qr=function(e,t){return e===`v`?Yr(t):Xr(t)},$r=function(e,t){return e===`h`&&t===`rtl`?-1:1},ei=function(e,t,n,r,i){var a=$r(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Qr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Zr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ti=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ni=function(e){return[e.deltaX,e.deltaY]},ri=function(e){return e&&`current`in e?e.current:e},ii=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ai=function(e){return`
|
|
243
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
244
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
245
|
+
`},oi=0,X=[];function si(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(oi++)[0],a=w.useState(jr)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=sr([e.lockRef.current],(e.shards||[]).map(ri),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ti(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Jr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Jr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ei(h,t,e,h===`h`?s:c,!0)},[]),c=w.useCallback(function(e){var n=e;if(X.length&&X[X.length-1]===a){var r=`deltaY`in n?ni(n):ti(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ii(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ri).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=w.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ci(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=w.useCallback(function(e){n.current=ti(e),r.current=void 0},[]),d=w.useCallback(function(t){l(t.type,ni(t),t.target,s(t,e.lockRef.current))},[]),f=w.useCallback(function(t){l(t.type,ti(t),t.target,s(t,e.lockRef.current))},[]);w.useEffect(function(){return X.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Y),document.addEventListener(`touchmove`,c,Y),document.addEventListener(`touchstart`,u,Y),function(){X=X.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Y),document.removeEventListener(`touchmove`,c,Y),document.removeEventListener(`touchstart`,u,Y)}},[]);var p=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(a,{styles:ai(i)}):null,p?w.createElement(Vr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ci(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var li=xr(Sr,si),ui=w.forwardRef(function(e,t){return w.createElement(wr,J({},e,{ref:t,sideCar:li}))});ui.classNames=wr.classNames;var di=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,fi=new WeakMap,pi={},mi=0,hi=function(e){return e&&(e.host||hi(e.parentNode))},gi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=hi(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},_i=function(e,t,n,r){var i=gi(t,Array.isArray(e)?e:[e]);pi[n]||(pi[n]=new WeakMap);var a=pi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Z.get(e)||0)+1,l=(a.get(e)||0)+1;Z.set(e,c),a.set(e,l),o.push(e),c===1&&i&&fi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),mi++,function(){o.forEach(function(e){var t=Z.get(e)-1,i=a.get(e)-1;Z.set(e,t),a.set(e,i),t||(fi.has(e)||e.removeAttribute(r),fi.delete(e)),i||e.removeAttribute(n)}),mi--,mi||(Z=new WeakMap,Z=new WeakMap,fi=new WeakMap,pi={})}},vi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||di(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),_i(r,i,n,`aria-hidden`)):function(){return null}},yi=Object.defineProperty,Q=(e,t)=>yi(e,`name`,{value:t,configurable:!0}),bi=`Dialog`,[xi,Si]=Ut(bi),[Ci,$]=xi(bi),wi=Q(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=w.useRef(null),c=w.useRef(null),[l,u]=an({prop:r,defaultProp:i??!1,onChange:a,caller:bi}),[d,f]=w.useState(0),[p,m]=w.useState(0);return O(Ci,{scope:t,triggerRef:s,contentRef:c,contentId:xn(),titleId:xn(),descriptionId:xn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Ti=`DialogPortal`,[Ei,Di]=xi(Ti,{forceMount:void 0}),Oi=Q(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$(Ti,t);return O(Ei,{scope:t,forceMount:n,children:w.Children.map(r,e=>O(fn,{present:n||a.open,children:O($n,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ki=`DialogOverlay`,Ai=w.forwardRef(Q(function(e,t){let n=Di(ki,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$(ki,e.__scopeDialog);return a.modal?O(fn,{present:r||a.open,children:O(Mi,{...i,ref:t})}):null},`DialogOverlay`)),ji=Tt(`DialogOverlay.RemoveScroll`),Mi=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(ki,n),a=N(t,jn());return O(ui,{as:ji,allowPinchZoom:!0,shards:[i.contentRef],children:O(F.div,{"data-state":Wi(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Ni=`DialogContent`,Pi=w.forwardRef(Q(function(e,t){let n=Di(Ni,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$(Ni,e.__scopeDialog);return O(fn,{present:r||a.open,children:a.modal?O(Fi,{...i,ref:t}):O(Ii,{...i,ref:t})})},`DialogContent`)),Fi=w.forwardRef(Q(function(e,t){let n=$(Ni,e.__scopeDialog),r=w.useRef(null),i=N(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return vi(e)},[]),O(Li,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ii=w.forwardRef(Q(function(e,t){let n=$(Ni,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return O(Li,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Li=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$(Ni,n);return ir(),O(se,{children:O(Vn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:O(An,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Wi(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Ri=`DialogTitle`,zi=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(Ri,n),{setTitleCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),O(F.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Bi=`DialogDescription`,Vi=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(Bi,n),{setDescriptionCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),O(F.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Hi=`DialogClose`,Ui=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(Hi,n);return O(F.button,{type:`button`,...r,ref:t,onClick:R(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Wi(e){return e?`open`:`closed`}Q(Wi,`getState`);var Gi=A(Ai)`
|
|
246
|
+
position: fixed;
|
|
247
|
+
inset: 0;
|
|
248
|
+
z-index: ${({theme:e})=>e.z.overlay};
|
|
249
|
+
background: oklch(0 0 0 / 0.5);
|
|
250
|
+
backdrop-filter: blur(2px);
|
|
251
|
+
`,Ki=A(Pi)`
|
|
252
|
+
position: fixed;
|
|
253
|
+
z-index: ${({theme:e})=>e.z.dialog};
|
|
254
|
+
top: 50%;
|
|
255
|
+
left: 50%;
|
|
256
|
+
transform: translate(-50%, -50%);
|
|
257
|
+
width: min(${({$width:e})=>e}, calc(100vw - 32px));
|
|
258
|
+
max-height: calc(100vh - 64px);
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
background: ${({theme:e})=>e.color.panel};
|
|
262
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
263
|
+
border-radius: ${({theme:e})=>e.radius.panel};
|
|
264
|
+
box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
|
|
265
|
+
`,qi=A.div`
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
269
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(2)} ${e.space(2)} ${e.space(3)}`};
|
|
270
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
271
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
272
|
+
`,Ji=A.div`
|
|
273
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
274
|
+
overflow-y: auto;
|
|
275
|
+
`,Yi=A.div`
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: flex-end;
|
|
278
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
279
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
280
|
+
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
281
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
282
|
+
`,Xi=A(Vi)`
|
|
283
|
+
margin: 0 0 ${({theme:e})=>e.space(3)};
|
|
284
|
+
font-size: 12px;
|
|
285
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
286
|
+
`;function Zi({open:e,onOpenChange:t,title:n,description:r,footer:i,width:a=`560px`,children:o}){return O(wi,{open:e,onOpenChange:t,children:k(Oi,{children:[O(Gi,{}),k(Ki,{$width:a,children:[k(qi,{children:[O(zi,{asChild:!0,children:O(b,{as:`h2`,children:n})}),O(v,{}),O(Ui,{asChild:!0,children:O(_,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Close`,children:O(ze,{})})})]}),k(Ji,{children:[r===void 0?null:O(Xi,{children:r}),o]}),i===void 0?null:O(Yi,{children:i})]})]})})}var Qi=A.p`
|
|
287
|
+
font-size: 13px;
|
|
288
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
289
|
+
`;function $i({open:e,onOpenChange:t,title:n,body:r,confirmLabel:i,busy:a,onConfirm:o}){return O(Zi,{open:e,onOpenChange:t,title:n,width:`420px`,footer:k(se,{children:[O(h,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),O(h,{type:`button`,$variant:`danger`,disabled:a===!0,onClick:o,children:i})]}),children:O(Qi,{children:r})})}var ea={systemd:`systemd is capturing this process, so a restart asks the manager to bring the unit back rather than signalling the gateway itself.`,container:`This gateway is running in a container, so a restart is an exit and the container's restart policy decides what happens next.`,none:`Nothing is supervising this process. It was started directly, and whatever stops it leaves it stopped.`},ta=A.hr`
|
|
290
|
+
flex: none;
|
|
291
|
+
border: 0;
|
|
292
|
+
margin: 0;
|
|
293
|
+
height: 1px;
|
|
294
|
+
align-self: stretch;
|
|
295
|
+
background: ${({theme:e})=>e.color.rule};
|
|
296
|
+
|
|
297
|
+
/* The rail turns on its side below 720px, and so does the rule that closes it. */
|
|
298
|
+
@media (max-width: 720px) {
|
|
299
|
+
height: auto;
|
|
300
|
+
width: 1px;
|
|
301
|
+
margin-left: ${({theme:e})=>e.space(2)};
|
|
302
|
+
}
|
|
303
|
+
`,na=A.div`
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
gap: 6px;
|
|
307
|
+
padding-top: ${({theme:e})=>e.space(2)};
|
|
308
|
+
|
|
309
|
+
@media (max-width: 720px) {
|
|
310
|
+
padding-top: 0;
|
|
311
|
+
padding-left: ${({theme:e})=>e.space(2)};
|
|
312
|
+
flex-direction: row;
|
|
313
|
+
align-items: center;
|
|
314
|
+
}
|
|
315
|
+
`,ra=A(h)`
|
|
316
|
+
justify-content: flex-start;
|
|
317
|
+
width: 100%;
|
|
318
|
+
|
|
319
|
+
@media (max-width: 720px) {
|
|
320
|
+
width: auto;
|
|
321
|
+
}
|
|
322
|
+
`,ia=A.p`
|
|
323
|
+
font-size: 10.5px;
|
|
324
|
+
line-height: 1.3;
|
|
325
|
+
color: ${({theme:e})=>e.color.warn};
|
|
326
|
+
`,aa=A.p`
|
|
327
|
+
font-size: 10.5px;
|
|
328
|
+
line-height: 1.3;
|
|
329
|
+
color: ${({theme:e})=>e.color.down};
|
|
330
|
+
`,oa=A.p`
|
|
331
|
+
font-size: 10.5px;
|
|
332
|
+
line-height: 1.3;
|
|
333
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
334
|
+
${y}
|
|
335
|
+
`,sa=A.span`
|
|
336
|
+
flex: none;
|
|
337
|
+
font-size: 10.5px;
|
|
338
|
+
line-height: 1.3;
|
|
339
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
340
|
+
padding: 0 ${({theme:e})=>e.space(2)} 6px;
|
|
341
|
+
|
|
342
|
+
@media (max-width: 720px) {
|
|
343
|
+
padding: 0 ${({theme:e})=>e.space(2)};
|
|
344
|
+
}
|
|
345
|
+
`,ca=A.p`
|
|
346
|
+
font-size: 10.5px;
|
|
347
|
+
line-height: 1.3;
|
|
348
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
349
|
+
`,la=9e4;async function ua(){try{return(await fetch(`/health`,{cache:`no-store`})).ok}catch{return!1}}function da({pollMs:e=750}){let t=l(),n=i(),r=p(),[a,o]=D(null),[s,c]=D(!1),[u,d]=D(!1),[f,h]=D(`idle`),g=t.data;ie(()=>{if(!s)return;let t=!1,n,r=!1,i=0,a=Math.max(1,Math.ceil(la/e)),o=async()=>{let s=await ua();if(!t){if(!r&&!s)r=!0,h(`returning`);else if(r&&s){window.location.reload();return}if(i+=1,i>=a){h(`lost`),c(!1);return}n=setTimeout(()=>void o(),e)}};return n=setTimeout(()=>void o(),e),()=>{t=!0,n!==void 0&&clearTimeout(n)}},[s,e]);let _=()=>{h(`leaving`),n.mutate(void 0,{onSuccess:()=>c(!0),onError:()=>h(`idle`)})};return u?k(se,{children:[O(v,{}),g===void 0?null:k(sa,{children:[`v`,g.version]}),O(ta,{}),O(na,{children:k(m,{$gap:1,children:[O(b,{children:`Gateway stopped`}),k(ca,{children:[`Nothing on this screen will update again, and nothing here can start it: that needs`,` `,g?.supervisor===`container`?`the host that runs this container`:`a shell on the machine it runs on`,`.`]})]})})]}):k(se,{children:[O(v,{}),g===void 0?null:k(sa,{children:[`v`,g.version]}),O(ta,{}),k(na,{title:g===void 0?void 0:ea[g.supervisor],children:[k(ra,{type:`button`,$size:`sm`,"aria-label":`Restart gateway`,disabled:g===void 0||!g.canRestart||n.isPending||s,onClick:()=>o(`restart`),children:[O(Pe,{}),`Restart`]}),k(ra,{type:`button`,$size:`sm`,$variant:`danger`,"aria-label":`Shut down gateway`,disabled:g===void 0||!g.canShutdown||r.isPending||s,onClick:()=>o(`shutdown`),children:[O(Ne,{}),`Shut down`]}),g?.note===void 0?null:O(ia,{children:g.note}),f===`leaving`?O(oa,{role:`status`,children:`Restarting. Waiting for the gateway to stop answering.`}):f===`returning`?O(oa,{role:`status`,children:`The gateway has stopped answering. Waiting for it to come back, then this page reloads.`}):f===`lost`?O(aa,{role:`alert`,children:`The gateway has not come back. Reload this page once it is running again, or check the machine it runs on.`}):null,n.isError?O(aa,{role:`alert`,children:S(n.error)}):null,r.isError?O(aa,{role:`alert`,children:S(r.error)}):null]}),O($i,{open:a===`restart`,onOpenChange:e=>{e||o(null)},title:`Restart gateway`,body:`${g===void 0?``:`${ea[g.supervisor]} `}Requests in flight are dropped when the process goes. This console waits for the gateway to stop answering and to answer again, then reloads itself.`,confirmLabel:`Restart now`,busy:n.isPending,onConfirm:()=>{o(null),_()}}),O($i,{open:a===`shutdown`,onOpenChange:e=>{e||o(null)},title:`Shut down gateway`,body:g?.supervisor===`container`?`Stopping the only process in this container takes this dashboard with it, and the dashboard is what would have restarted the gateway. Unless the container's restart policy brings it back, getting it running again needs access to the host.`:`The gateway stops serving and stays stopped. This console goes with it, so starting the gateway again needs a shell on the machine it runs on.`,confirmLabel:`Shut down now`,busy:r.isPending,onConfirm:()=>{o(null),r.mutate(void 0,{onSuccess:()=>d(!0)})}})]})}var fa=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:Ce},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:Ee},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:Te},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:ke},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:Oe},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:Fe},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:Re},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:Ie},{to:`/database`,label:`Database`,blurb:`Size, snapshots, and retention`,Icon:De}],pa=A.nav`
|
|
350
|
+
grid-area: rail;
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
gap: 2px;
|
|
354
|
+
padding: ${({theme:e})=>e.space(2)};
|
|
355
|
+
border-right: 1px solid ${({theme:e})=>e.color.rule};
|
|
356
|
+
background: ${({theme:e})=>e.color.panel};
|
|
357
|
+
overflow-y: auto;
|
|
358
|
+
|
|
359
|
+
@media (max-width: 720px) {
|
|
360
|
+
flex-direction: row;
|
|
361
|
+
overflow-x: auto;
|
|
362
|
+
border-right: 0;
|
|
363
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
364
|
+
}
|
|
365
|
+
`,ma=ue`
|
|
366
|
+
display: flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
369
|
+
padding: 7px ${({theme:e})=>e.space(2)};
|
|
370
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
371
|
+
border-left: 2px solid transparent;
|
|
372
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
373
|
+
font-size: 12.5px;
|
|
374
|
+
font-weight: 500;
|
|
375
|
+
white-space: nowrap;
|
|
376
|
+
transition:
|
|
377
|
+
background 120ms ease,
|
|
378
|
+
color 120ms ease;
|
|
379
|
+
|
|
380
|
+
svg {
|
|
381
|
+
width: 15px;
|
|
382
|
+
height: 15px;
|
|
383
|
+
flex: none;
|
|
384
|
+
}
|
|
385
|
+
`,ha=A(e)`
|
|
386
|
+
${ma}
|
|
387
|
+
|
|
388
|
+
&:hover {
|
|
389
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
390
|
+
color: ${({theme:e})=>e.color.ink};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&[data-status="active"] {
|
|
394
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
395
|
+
border-left-color: ${({theme:e})=>e.color.accent};
|
|
396
|
+
color: ${({theme:e})=>e.color.accent};
|
|
397
|
+
}
|
|
398
|
+
`,ga=A.button`
|
|
399
|
+
${ma}
|
|
400
|
+
align-items: flex-start;
|
|
401
|
+
width: 100%;
|
|
402
|
+
text-align: left;
|
|
403
|
+
white-space: normal;
|
|
404
|
+
background: none;
|
|
405
|
+
border-top: 0;
|
|
406
|
+
border-right: 0;
|
|
407
|
+
border-bottom: 0;
|
|
408
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
409
|
+
cursor: not-allowed;
|
|
410
|
+
font-family: inherit;
|
|
411
|
+
|
|
412
|
+
svg {
|
|
413
|
+
margin-top: 2px;
|
|
414
|
+
}
|
|
415
|
+
`,_a=A.span`
|
|
416
|
+
display: flex;
|
|
417
|
+
flex-direction: column;
|
|
418
|
+
gap: 2px;
|
|
419
|
+
min-width: 0;
|
|
420
|
+
`,va=A.span`
|
|
421
|
+
font-size: 10.5px;
|
|
422
|
+
font-weight: 400;
|
|
423
|
+
line-height: 1.3;
|
|
424
|
+
color: ${({theme:e})=>e.color.warn};
|
|
425
|
+
`;function ya(){let e=u();return k(pa,{"aria-label":`Console sections`,children:[fa.map(({to:e,label:t,blurb:n,Icon:r})=>k(ha,{to:e,title:n,activeOptions:{exact:e===`/`},children:[O(r,{}),t]},e)),vt(e.data??[]).map(({id:e,label:t,disabledReason:n})=>n===null?k(ha,{to:_t(e),title:`Provided by the ${e} plugin`,children:[O(we,{}),t]},e):k(ga,{type:`button`,disabled:!0,children:[O(we,{}),k(_a,{children:[t,O(va,{children:n})]})]},e)),O(da,{})]})}var ba=A.div`
|
|
426
|
+
display: grid;
|
|
427
|
+
grid-template-areas:
|
|
428
|
+
"chassis chassis"
|
|
429
|
+
"rail main";
|
|
430
|
+
grid-template-columns: 168px minmax(0, 1fr);
|
|
431
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
432
|
+
height: 100vh;
|
|
433
|
+
min-height: 0;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
|
|
436
|
+
@media (max-width: 720px) {
|
|
437
|
+
grid-template-areas:
|
|
438
|
+
"chassis"
|
|
439
|
+
"rail"
|
|
440
|
+
"main";
|
|
441
|
+
grid-template-columns: minmax(0, 1fr);
|
|
442
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
443
|
+
}
|
|
444
|
+
`,xa=A.main`
|
|
445
|
+
grid-area: main;
|
|
446
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
447
|
+
display: flex;
|
|
448
|
+
flex-direction: column;
|
|
449
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
450
|
+
min-width: 0;
|
|
451
|
+
min-height: 0;
|
|
452
|
+
overflow-y: auto;
|
|
453
|
+
|
|
454
|
+
@media (max-width: 720px) {
|
|
455
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
456
|
+
}
|
|
457
|
+
`;function Sa({children:e}){return k(ba,{"data-testid":`rack-shell`,children:[O(gt,{}),O(ya,{}),O(xa,{children:e})]})}var Ca=A.div`
|
|
458
|
+
display: flex;
|
|
459
|
+
align-items: flex-end;
|
|
460
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
461
|
+
flex-wrap: wrap;
|
|
462
|
+
`,wa=A.h1`
|
|
463
|
+
font-size: 20px;
|
|
464
|
+
font-weight: 600;
|
|
465
|
+
font-stretch: 88%;
|
|
466
|
+
letter-spacing: -0.01em;
|
|
467
|
+
`,Ta=A.p`
|
|
468
|
+
font-size: 13px;
|
|
469
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
470
|
+
max-width: 68ch;
|
|
471
|
+
`,Ea=A.div`
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
gap: 6px;
|
|
475
|
+
min-width: 0;
|
|
476
|
+
`;function Da({legend:e,title:t,summary:n,actions:r}){return k(Ca,{children:[k(Ea,{children:[O(b,{children:e}),O(wa,{children:t}),O(Ta,{children:n})]}),O(v,{}),r]})}export{fe as _,an as a,j as b,Ut as c,ht as d,rt as f,de as g,Ve as h,Zi as i,F as l,Ge as m,Sa as n,z as o,et as p,$i as r,R as s,Da as t,N as u,Ie as v,De as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-
|
|
1
|
+
import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-C2Q3t5Mn.js";import{C as f,_ as p,b as m,v as h,w as g}from"./Panel-BlNr9j6-.js";import{n as _,r as v,t as y}from"./TokenBreakdown-D5ZIngM6.js";import{n as b,t as x}from"./Chip-Did4Zhvj.js";import{i as S,n as C,r as w,t as T}from"./Table-CVDZ69Zx.js";import{useEffect as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import j from"styled-components";function M(e){let[t,n]=D(Date.now);return E(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function N(e,t,n){if(t.length===0||e.requestedModel.toLowerCase().includes(t)||(e.resolvedModel??``).toLowerCase().includes(t)||(e.errorCode??``).toLowerCase().includes(t))return!0;if(n===void 0)return!1;let r=e.credentialId==null?``:n.accounts.get(e.credentialId)??``,i=e.apiKeyId==null?``:n.keys.get(e.apiKeyId)??e.apiKeyId;return r.toLowerCase().includes(t)||i.toLowerCase().includes(t)}function P(e,t,n,r){let i=n.trim().toLowerCase();return e.filter(e=>(t!==`failed`||c(e))&&N(e,i,r))}function F({log:e}){return k(C,{$align:`right`,$mono:!0,...d(e)?{"aria-label":`processing`}:{title:v(e)},children:d(e)?k(y,{}):k(_,{tokens:e})})}function I({rows:e,now:c,names:f,onOpen:_}){return A(T,{children:[k(`thead`,{children:A(`tr`,{children:[k(w,{}),k(w,{$align:`right`,children:`Time`}),k(w,{children:`Requested`}),k(w,{children:`Routed to`}),f===void 0?null:A(O,{children:[k(w,{children:`Account`}),k(w,{children:`Key`})]}),k(w,{$align:`right`,children:`Try`}),k(w,{$align:`right`,children:`TTFT`}),k(w,{$align:`right`,children:`Total`}),k(w,{$align:`right`,children:`Tokens`}),k(w,{$align:`right`,children:`Cost`}),k(w,{children:`Outcome`})]})}),k(`tbody`,{children:e.map(e=>A(S,{$selectable:!0,onClick:()=>_(e),children:[k(C,{children:k(u,{state:l(e),label:a(e)})}),k(C,{$align:`right`,$mono:!0,title:o(e.at),children:s(e.at)}),k(C,{$mono:!0,children:k(g,{style:{display:`block`,maxWidth:`20ch`},children:e.requestedModel||`—`})}),k(C,{children:e.resolvedProvider===null?k(p,{children:d(e)?`routing…`:`not routed`}):A(m,{$gap:1,children:[k(b,{provider:e.resolvedProvider}),k(h,{$dim:!0,children:e.resolvedModel??`—`})]})}),f===void 0?null:A(O,{children:[k(C,{children:k(g,{style:{display:`block`,maxWidth:`18ch`},children:e.credentialId==null?`—`:f.accounts.get(e.credentialId)??i(e.credentialId)})}),k(C,{children:k(g,{style:{display:`block`,maxWidth:`16ch`},title:e.apiKeyId??void 0,children:e.apiKeyId==null?`—`:f.keys.get(e.apiKeyId)??i(e.apiKeyId)})})]}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:e.attempts}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:r(e.ttftMs)}),k(C,{$align:`right`,$mono:!0,children:d(e)?n(Math.max(0,c-e.at)):r(e.durationMs)}),k(F,{log:e}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:t(e.costUsd)}),k(C,{children:d(e)?k(x,{$tone:`accent`,children:`live`}):e.errorCode===null?k(x,{$tone:`ok`,children:e.status}):k(x,{$tone:`down`,children:e.errorCode})})]},e.id))})]})}var L=j.dl`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
|
|
4
4
|
gap: 6px ${({theme:e})=>e.space(3)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,p as t,y as n}from"./shared-
|
|
1
|
+
import{b as e,p as t,y as n}from"./shared-C47BfV_u.js";import{A as r,I as i,N as a,P as o}from"./Lamp-C2Q3t5Mn.js";import{D as s,a as c,b as l,i as u,r as d,t as f}from"./Panel-BlNr9j6-.js";import{f as p}from"./Rack-D0_N-xsd.js";import{t as m}from"./Readout-D8Ofl3Gz.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(f,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(c,{rows:4}):s?h(d,{legend:o.legend,message:o.message}):l})}var y=_(s)`
|
|
2
2
|
border-color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.ruleStrong};
|
|
3
3
|
color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.inkDim};
|
|
4
4
|
background: ${({theme:e,$on:t})=>t?e.color.accentWash:e.color.panelRaised};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-
|
|
1
|
+
import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-D0_N-xsd.js";import*as o from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let[t,n]=o.useState(void 0);return r(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}f(p,`useSize`);var m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Switch`,[_,v]=t(g),[y,b]=_(g);function x(t){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:a,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:p=`on`,internal_do_not_use_render:m}=t,[h,_]=e({prop:r,defaultProp:a??!1,onChange:d,caller:g}),[v,b]=o.useState(null),[x,S]=o.useState(null),C=o.useRef(!1),[w,T]=o.useReducer(e=>e+1,0),E={checked:h,setChecked:_,disabled:s,control:v,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:a,isFormControl:!v||!!l||!!v.closest(`form`),bubbleInput:x,setBubbleInput:S};return c(y,{scope:n,...E,children:k(m)?m(E):i})}h(x,`SwitchProvider`);var S=`SwitchTrigger`,C=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,form:u,value:d,disabled:f,checked:p,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=a(s,g),T=o.useRef(p);return o.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[l,u,_]),c(n.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":A(p),"data-disabled":f?``:void 0,disabled:f,value:d,...r,ref:w,onClick:i(t,e=>{y(),_(e=>!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`SwitchTrigger`)),w=o.forwardRef(h(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return c(x,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:u,required:o,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>l(s,{children:[c(C,{...m,ref:t,__scopeSwitch:n}),e&&c(O,{__scopeSwitch:n})]})})},`Switch`)),T=`SwitchThumb`,E=o.forwardRef(h(function(e,t){let{__scopeSwitch:r,...i}=e,a=b(T,r);return c(n.span,{"data-state":A(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})},`SwitchThumb`)),D=`SwitchBubbleInput`,O=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,hasConsumerStoppedPropagationRef:u,userInteractionCount:d,checked:f,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=a(s,S),w=p(l),T=o.useRef(!1),E=o.useRef(f),O=o.useRef(d);o.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=d!==O.current;O.current=d;let i=E.current!==f;E.current=f;let a=!(r&&u.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,f),e.dispatchEvent(t),T.current=!1}},[x,f,u,d]);let k=o.useRef(f);return c(n.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...r,tabIndex:-1,ref:C,onClick:i(t,e=>{T.current&&e.stopPropagation()}),style:{...r.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e?`checked`:`unchecked`}h(A,`getState`);var j=u(w)`
|
|
2
2
|
all: unset;
|
|
3
3
|
width: 30px;
|
|
4
4
|
height: 16px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e}from"./Lamp-
|
|
1
|
+
import{A as e}from"./Lamp-C2Q3t5Mn.js";import{b as t,y as n}from"./Rack-D0_N-xsd.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=t(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),l=new Intl.NumberFormat(`en-US`);function u(e){return`${l.format(e.inputTokens)} input, ${l.format(e.outputTokens)} output, ${l.format(e.cacheReadTokens)} cache read, ${l.format(e.cacheWriteTokens)} cache write tokens`}var d=a.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
flex-wrap: wrap;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,K as t,O as n,S as r,lt as i,o as a,q as o,t as s,w as c,x as l}from"./shared-
|
|
1
|
+
import{C as e,K as t,O as n,S as r,lt as i,o as a,q as o,t as s,w as c,x as l}from"./shared-C47BfV_u.js";import{C as u,L as d,M as f,O as p,S as m,T as h,_ as g,a as _,j as v,m as y,n as b}from"./Lamp-C2Q3t5Mn.js";import{C as x,_ as S,b as C,v as w}from"./Panel-BlNr9j6-.js";import*as T from"react";import{forwardRef as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=[`axis`],M=E((e,t)=>T.createElement(l,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:j,tooltipPayloadSearcher:o,categoricalChartProps:e,ref:t})),N=A(C)`
|
|
2
2
|
gap: ${({theme:e})=>e.space(5)};
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
`,P=A.div`
|