omnigateway 0.15.1 → 0.15.3
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 +13 -0
- package/bin/omni.js +126 -126
- package/gateway.js +166 -166
- package/package.json +1 -1
- package/public/assets/{Chip-C3dIFd8s.js → Chip-B2iXmJJC.js} +1 -1
- package/public/assets/CopyValue-CWSTp4v8.js +27 -0
- package/public/assets/{Field-EvdVyEqx.js → Field-CUEEy19T.js} +5 -28
- package/public/assets/{Rack-DMrfn4-H.js → Rack-1lijWt5h.js} +32 -32
- package/public/assets/RequestTable-uRTmuPwB.js +93 -0
- package/public/assets/Select-C0c13SKD.js +141 -0
- package/public/assets/{SummaryDeck-DHsYYpYO.js → SummaryDeck-DnQnRmQ8.js} +1 -1
- package/public/assets/Toggle-BvVa_jla.js +39 -0
- package/public/assets/{TokenBreakdown-Bf0zsKcd.js → TokenBreakdown-B8cSaOOr.js} +2 -2
- package/public/assets/_app.accounts-DmJhe6QV.js +70 -0
- package/public/assets/_app.console-DQlcBpSu.js +24 -0
- package/public/assets/{_app.database-BCwEMrEA.js → _app.database-DoDu8HOG.js} +1 -1
- package/public/assets/{_app.index-DW6wain4.js → _app.index-BEeD4XSS.js} +2 -2
- package/public/assets/_app.keys-MXvgkBUB.js +120 -0
- package/public/assets/{_app.logs-CRC5qDK3.js → _app.logs-CjUjeVHg.js} +3 -3
- package/public/assets/_app.models-mNIL-1oS.js +148 -0
- package/public/assets/{_app.plugins._pluginId-CD9KXknf.js → _app.plugins._pluginId-CsJXQg6X.js} +1 -1
- package/public/assets/_app.settings-CYMwWA8D.js +88 -0
- package/public/assets/{_app.usage-BR6a92zI.js → _app.usage-Dd33vB8x.js} +3 -3
- package/public/assets/chevron-right-ocqzquMZ.js +1 -0
- package/public/assets/client-KUNw8ZtZ.js +48 -0
- package/public/assets/{index-6rZSWe9j.js → index-B9izdV6t.js} +3 -3
- package/public/assets/{login-NuwPF5SS.js → login-DrbTJF6e.js} +1 -1
- package/public/assets/plus-D_lvSfDL.js +1 -0
- package/public/assets/{rotate-ccw-Dionx_MW.js → rotate-ccw-CwTftDdz.js} +1 -1
- package/public/assets/{trash-Bsi60qJc.js → trash-CmuxOGpN.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/CopyValue-DG88CWpN.js +0 -27
- package/public/assets/RequestTable-CtuuMOT2.js +0 -93
- package/public/assets/Toggle-BTie3NY8.js +0 -39
- package/public/assets/_app.accounts-xCJhRd32.js +0 -70
- package/public/assets/_app.console-DS37cfIu.js +0 -24
- package/public/assets/_app.keys-CCU2NB3-.js +0 -120
- package/public/assets/_app.models-B4brzRdK.js +0 -148
- package/public/assets/_app.settings-NJSb_L2B.js +0 -88
- package/public/assets/chevron-down-3tlYNJqZ.js +0 -1
- package/public/assets/chevron-right-kvaJRnfj.js +0 -1
- package/public/assets/client-B9t0CsmA.js +0 -46
- package/public/assets/dist-B8iuo_hI.js +0 -1
- package/public/assets/plus-CVqm87L-.js +0 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{T as e}from"./Rack-1lijWt5h.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
line-height: 1;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{A as e,T as t}from"./Panel-CsovmtxF.js";import{j as n}from"./Rack-1lijWt5h.js";import{l as r}from"./Select-C0c13SKD.js";import{useCallback as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};d.node;var f=n(d);function p(e){if(e===null||typeof getSelection!=`function`)return!1;let t=getSelection();if(t===null)return!1;try{let n=document.createRange();return n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),!0}catch{return!1}}async function m(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=p(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var h=u.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: stretch;
|
|
4
|
+
gap: 0;
|
|
5
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
6
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
7
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
`,g=u.code`
|
|
10
|
+
flex: 1;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
padding: 7px 8px;
|
|
13
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
word-break: break-all;
|
|
16
|
+
user-select: all;
|
|
17
|
+
`,_=u(e)`
|
|
18
|
+
border: 0;
|
|
19
|
+
border-left: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
20
|
+
border-radius: 0;
|
|
21
|
+
height: auto;
|
|
22
|
+
width: 32px;
|
|
23
|
+
flex: none;
|
|
24
|
+
`,v=u.p`
|
|
25
|
+
font-size: 11px;
|
|
26
|
+
color: ${({theme:e})=>e.color.warn};
|
|
27
|
+
`,y={selected:`Your browser would not copy it. The value is selected — copy it with your keyboard.`,failed:`Your browser would not copy it. Select the value and copy it by hand.`};function b({value:e,label:n}){let[u,d]=s(null),p=o(null);a(()=>{if(u!==`copied`)return;let e=setTimeout(()=>d(null),1600);return()=>clearTimeout(e)},[u]);let b=i(()=>{m(e,p.current).then(d)},[e]),x=u===`copied`,S=u===null?void 0:y[u];return l(t,{$gap:1,children:[l(h,{children:[c(g,{ref:p,children:e}),c(_,{type:`button`,$variant:`ghost`,onClick:b,"aria-label":x?`Copied`:n,title:x?`Copied`:n,children:c(x?r:f,{})})]}),S===void 0?null:c(v,{role:`status`,children:S})]})}export{b as t};
|
|
@@ -43,41 +43,18 @@ import{y as e}from"./Panel-CsovmtxF.js";import{useId as t}from"react";import{jsx
|
|
|
43
43
|
&:disabled {
|
|
44
44
|
opacity: 0.5;
|
|
45
45
|
}
|
|
46
|
-
`,c=i.
|
|
47
|
-
${a}
|
|
48
|
-
appearance: none;
|
|
49
|
-
height: 30px;
|
|
50
|
-
padding: 0 26px 0 8px;
|
|
51
|
-
background-color: ${({theme:e})=>e.color.panelSunk};
|
|
52
|
-
background-image:
|
|
53
|
-
linear-gradient(45deg, transparent 50%, ${({theme:e})=>e.color.inkDim} 50%),
|
|
54
|
-
linear-gradient(135deg, ${({theme:e})=>e.color.inkDim} 50%, transparent 50%);
|
|
55
|
-
background-position:
|
|
56
|
-
calc(100% - 15px) 50%,
|
|
57
|
-
calc(100% - 10px) 50%;
|
|
58
|
-
background-size: 5px 5px;
|
|
59
|
-
background-repeat: no-repeat;
|
|
60
|
-
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
61
|
-
color: ${({theme:e})=>e.color.ink};
|
|
62
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
63
|
-
font-size: 12px;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
|
|
66
|
-
&:hover:not(:disabled) {
|
|
67
|
-
border-color: ${({theme:e})=>e.color.accent};
|
|
68
|
-
}
|
|
69
|
-
`,l=i.div`
|
|
46
|
+
`,c=i.div`
|
|
70
47
|
display: flex;
|
|
71
48
|
flex-direction: column;
|
|
72
49
|
gap: 4px;
|
|
73
50
|
min-width: 0;
|
|
74
|
-
`,
|
|
51
|
+
`,l=i.p`
|
|
75
52
|
font-size: 11px;
|
|
76
53
|
color: ${({theme:e})=>e.color.inkDim};
|
|
77
|
-
`,
|
|
54
|
+
`,u=i.p`
|
|
78
55
|
font-size: 11px;
|
|
79
56
|
color: ${({theme:e})=>e.color.down};
|
|
80
|
-
`;function
|
|
57
|
+
`;function d({label:i,hint:a,problem:o,children:s}){let d=t(),f=o===void 0?a===void 0?void 0:`${d}-hint`:`${d}-problem`;return r(c,{children:[n(e,{as:`label`,htmlFor:d,children:i}),s({id:d,"aria-describedby":f}),o===void 0?a===void 0?null:n(l,{id:`${d}-hint`,children:a}):n(u,{id:`${d}-problem`,children:o})]})}var f=i(o).attrs({type:`number`,inputMode:`decimal`})`
|
|
81
58
|
text-align: right;
|
|
82
59
|
padding-right: 6px;
|
|
83
|
-
`;export{s as
|
|
60
|
+
`;export{s as i,o as n,f as r,d as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on as l,sn as u,t as d,x as f,z as p}from"./Lamp-CL0i4yaa.js";import{A as m,D as h,O as g,S as _,T as v,b as y,c as b,k as x,w as S,y as C}from"./Panel-CsovmtxF.js";import*as w from"react";import{createContext as T,createElement as
|
|
1
|
+
import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on as l,sn as u,t as d,x as f,z as p}from"./Lamp-CL0i4yaa.js";import{A as m,D as h,O as g,S as _,T as v,b as y,c as b,k as x,w as S,y as C}from"./Panel-CsovmtxF.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?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function he(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:me(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ge=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),j={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ye(e){return e!=null}function be(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??j.width,a=e.size??e.height??j.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ve(...c):ve(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??j[`stroke-width`])*Number(e.size??e.width??j.width)/Number(t.size??t.width??j.width):t.strokeWidth??j[`stroke-width`];return[`svg`,{...Object.entries(j).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ye(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ye(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ye(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function xe(e,t={}){return be(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Se=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ce=T({}),we=()=>re(Ce),Te=ee(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=we()??{},y=!!c||Se(d),[b,x,S=[]]=xe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ve(v,s),hasA11yProp:y,attributes:d});return E(b,{ref:f,...x},[...S.map(([e,t])=>E(e,t)),...Array.isArray(c)?c:[c]])});function M(e,t=[],n=[]){let r=typeof e==`string`?he(e,t,n):e,i=ee(({className:e,...t},n)=>E(Te,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_e(r.name)),i}var Ee={name:`activity`,size:24,node:[[`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`}]]};Ee.node;var De=M(Ee),Oe={name:`blocks`,size:24,node:[[`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`}]]};Oe.node;var ke=M(Oe),Ae={name:`boxes`,size:24,node:[[`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`}]]};Ae.node;var je=M(Ae),Me={name:`cable`,size:24,node:[[`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`}]]};Me.node;var Ne=M(Me),Pe={name:`database`,size:24,node:[[`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`}]]};Pe.node;var Fe=M(Pe),Ie={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Ie.node;var Le=M(Ie),Re={name:`key-round`,size:24,node:[[`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`}]]};Re.node;var ze=M(Re),Be={name:`log-out`,size:24,node:[[`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`}]]};Be.node;var Ve=M(Be),He={name:`monitor-cog`,size:24,node:[[`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`}]]};He.node;var Ue=M(He),We={name:`moon`,size:24,node:[[`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`}]]};We.node;var Ge=M(We),Ke={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};Ke.node;var qe=M(Ke),Je={name:`rotate-cw`,size:24,node:[[`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`}]]};Je.node;var Ye=M(Je),Xe={name:`scroll-text`,size:24,node:[[`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`}]]};Xe.node;var Ze=M(Xe),Qe={name:`sliders-horizontal`,size:24,node:[[`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`}]]};Qe.node;var $e=M(Qe),et={name:`sun`,size:24,node:[[`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`}]]};et.node;var tt=M(et),nt={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};nt.node;var rt=M(nt),it={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};it.node;var at=M(it);function ot(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
|
|
2
2
|
`)}var st=le`
|
|
3
3
|
:root {
|
|
4
4
|
${({$providers:e})=>ot(e,`light`)}
|
|
@@ -207,7 +207,7 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
207
207
|
letter-spacing: 0.08em;
|
|
208
208
|
`,jt=A.span`
|
|
209
209
|
color: ${({theme:e})=>e.color.inkFaint};
|
|
210
|
-
`,Mt={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`}},Nt=[`system`,`light`,`dark`],Pt={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Ft=6e5;function It({logs:e,logsFailed:t,signOut:n}){let{live:r,toggle:o,connection:c}=fe(),{mode:l,setMode:u}=yt(),h=Date.now(),g=oe(()=>e.filter(e=>h-e.at<=Ft),[e,h]),_=f(g,Ft),v=s(g,{now:h,spanMs:Ft,count:24}),b=Nt[(Nt.indexOf(l)+1)%Nt.length]??`system`,x=l===`light`?tt:l===`dark`?Ge:Ue,w=Mt[r?c.status===`offline`?`offline`:c.status===`push`?`push`:`poll`:`paused`],T=t||_.errorRate>=.25?`down`:_.errorRate>=.05?`warn`:g.length===0?`idle`:`ok`;return k(wt,{children:[k(Tt,{children:[O(d,{state:T,label:t?`request log unreadable`:`error rate ${a(_.errorRate)}`}),`Omnigateway`]}),k(Et,{children:[k(Ot,{children:[O(C,{children:`req`}),O(kt,{children:O(Ct,{values:v.map(e=>e.total),overlay:v.map(e=>e.errors),height:22,label:`${_.requests} requests in the last 10 minutes`})})]}),k(Dt,{children:[O(C,{children:`rate`}),O(y,{children:_.ratePerMin.toFixed(1)}),O(C,{children:`/min`})]}),k(Dt,{children:[O(C,{children:`err`}),O(y,{style:{color:_.errorRate>=.05?`var(--down)`:void 0},children:a(_.errorRate)})]}),k(Dt,{children:[O(C,{children:`ttft p50`}),O(y,{children:i(_.ttftP50)})]}),k(Dt,{children:[O(C,{children:`spend`}),O(y,{children:p(_.costUsd)})]})]}),O(S,{}),k(At,{type:`button`,$size:`sm`,onClick:o,"aria-pressed":r,"aria-label":w.name,title:w.title,children:[O(d,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:k(se,{children:[O(jt,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>u(b),"aria-label":Pt[l],title:`${Pt[l]} — switch to ${Pt[b].toLowerCase()}`,children:O(x,{})}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:n.pending,onClick:n.run,children:O(Ve,{})})]})}function Lt(){let e=u(),{cadence:n}=fe(),r=c(),i=t(200,n(1e4,`res:logs`));return O(It,{logs:i.data??[],logsFailed:i.isError,signOut:{pending:r.isPending,run:()=>{r.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})}}})}function Rt(e){return`/plugins/${e}`}function zt(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:Bt(e)}))}function Bt(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 Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Ut,`setRef`);function Wt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ut(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():Ut(e[t],null)}}}}Ht(Wt,`composeRefs`);function N(...e){return w.useCallback(Wt(...e),e)}Ht(N,`useComposedRefs`);var Gt=Object.defineProperty,P=(e,t)=>Gt(e,`name`,{value:t,configurable:!0});function Kt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];en(r)&&typeof an==`function`&&(r=an(r._payload)),w.Children.forEach(r,e=>{if(Qt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;en(n)&&typeof an==`function`&&(n=an(n._payload)),a=Yt(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?Zt(a):void 0,l=N(n,c);if(!a){if(r||r===0)throw Error(o?rn(e):nn(e));return r}let u=Xt(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}P(Kt,`createSlot`);var qt=Symbol.for(`radix.slottable`);function Jt(e){let t=P(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}P(Jt,`createSlottable`);var Yt=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 Xt(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(Xt,`mergeProps`);function Zt(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(Zt,`getElementRef`);function Qt(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qt}P(Qt,`isSlottable`);var $t=Symbol.for(`react.lazy`);function en(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$t&&`_payload`in e&&tn(e._payload)}P(en,`isLazyComponent`);function tn(e){return typeof e==`object`&&!!e&&`then`in e}P(tn,`isPromiseLike`);var nn=P(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),rn=P(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),an=w.use,on=Object.defineProperty,sn=(e,t)=>on(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=Kt(`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 cn(e,t){e&&pe.flushSync(()=>e.dispatchEvent(t))}sn(cn,`dispatchDiscreteCustomEvent`);var ln=Object.defineProperty,I=(e,t)=>ln(e,`name`,{value:t,configurable:!0});function un(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(un,`createContext`);function dn(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,fn(i,...t)]}I(dn,`createContextScope`);function fn(...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(fn,`composeContextScopes`);var pn=Object.defineProperty,L=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),mn=!!(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 hn(e){if(!mn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}L(hn,`getOwnerWindow`);function gn(e){if(!mn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}L(gn,`getOwnerDocument`);function _n(e,t=!1){let{activeElement:n}=gn(e);if(!n?.nodeName)return null;if(vn(n)&&n.contentDocument)return _n(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=gn(n).getElementById(e);if(t)return t}}return n}L(_n,`getActiveElement`);function vn(e){return e.tagName===`IFRAME`}L(vn,`isFrame`);var z=globalThis?.document?w.useLayoutEffect:()=>{},yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=w.useEffectEvent,Sn=w.useInsertionEffect;function Cn(e){if(typeof xn==`function`)return xn(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Sn==`function`?Sn(()=>{t.current=e}):z(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}bn(Cn,`useEffectEvent`);var wn=Object.defineProperty,B=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),Tn=w.useInsertionEffect||z;function En({prop:e,defaultProp:t,onChange:n=B(()=>{},`onChange`),caller:r}){let[i,a,o]=Dn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=On(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}B(En,`useControllableState`);function Dn({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return Tn(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}B(Dn,`useUncontrolledState`);function On(e){return typeof e==`function`}B(On,`isFunction`);var kn=Symbol(`RADIX:SYNC_STATE`);function An(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Cn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===kn)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:kn,state:i})},[i,d.state,c]),[h,f]}B(An,`useControllableStateReducer`);var jn=Object.defineProperty,V=(e,t)=>jn(e,`name`,{value:t,configurable:!0});function Mn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}V(Mn,`useStateMachine`);var Nn=V(e=>{let{present:t,children:n}=e,r=Pn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=In(r.ref,Ln(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]=Mn(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 Fn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}V(Fn,`setRef`);function In(...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=Fn(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():Fn(n[e],null)}}},[])}V(In,`useStableComposedRefs`);function H(e){return e?.animationName||`none`}V(H,`getAnimationName`);function Ln(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(Ln,`getElementRef`);var Rn=Object.defineProperty,zn=(e,t)=>Rn(e,`name`,{value:t,configurable:!0}),Bn=w.useId||(()=>void 0),Vn=0;function U(e){let[t,n]=w.useState(Bn());return z(()=>{e||n(e=>e??String(Vn++))},[e]),e||(t?`radix-${t}`:``)}zn(U,`useId`);var Hn=Object.defineProperty,Un=(e,t)=>Hn(e,`name`,{value:t,configurable:!0});function W(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Un(W,`useCallbackRef`);var Wn=Object.defineProperty,G=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=`dismissableLayer.update`,Kn=`dismissableLayer.pointerDownOutside`,qn=`dismissableLayer.focusOutside`,Jn,Yn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xn=w.forwardRef(G(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(Yn),[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=$n(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=er(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),ee=d?y===g.length-1:!1,E=W(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,ee,E]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Jn))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,u]),w.useEffect(()=>{let e=G(()=>m({}),`handleUpdate`);return document.addEventListener(Gn,e),()=>document.removeEventListener(Gn,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 Zn(){let e=w.useContext(Yn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}G(Zn,`useDismissableLayerSurface`);var Qn=G(()=>!0,`IS_TRUE`);function $n(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Qn}=t,s=W(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()}G(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}G(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)}G(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}G(p,`handleInteractionBubble`);let m=G(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||nr(Kn,s,p,{discrete:!0})};if(G(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:G(()=>c.current=!0,`onPointerDownCapture`)}}G($n,`usePointerDownOutside`);function er(e,t=globalThis?.document){let n=W(e),r=w.useRef(!1);return w.useEffect(()=>{let e=G(e=>{e.target&&!r.current&&nr(qn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:G(()=>r.current=!0,`onFocusCapture`),onBlurCapture:G(()=>r.current=!1,`onBlurCapture`)}}G(er,`useFocusOutside`);function tr(){let e=new CustomEvent(Gn);document.dispatchEvent(e)}G(tr,`dispatchUpdate`);function nr(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?cn(i,a):i.dispatchEvent(a)}G(nr,`handleAndDispatchCustomEvent`);var rr=Object.defineProperty,K=(e,t)=>rr(e,`name`,{value:t,configurable:!0}),ir=`focusScope.autoFocusOnMount`,ar=`focusScope.autoFocusOnUnmount`,or={bubbles:!1,cancelable:!0},sr=w.forwardRef(K(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=W(i),u=W(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:q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(s)};K(e,`handleFocusIn`),K(t,`handleFocusOut`),K(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){mr.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ir,or);s.addEventListener(ir,l),s.dispatchEvent(t),t.defaultPrevented||(cr(_r(ur(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(ir,l),setTimeout(()=>{let t=new CustomEvent(ar,or);s.addEventListener(ar,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(ar,u),mr.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]=lr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return O(F.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function cr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}K(cr,`focusFirst`);function lr(e){let t=ur(e);return[dr(t,e),dr(t.reverse(),e)]}K(lr,`getTabbableEdges`);function ur(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:K(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}K(ur,`getTabbableCandidates`);function dr(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):fr(r,{upTo:t})))return r}K(dr,`findVisible`);function fr(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}K(fr,`isHidden`);function pr(e){return e instanceof HTMLInputElement&&`select`in e}K(pr,`isSelectableInput`);function q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pr(e)&&t&&e.select()}}K(q,`focus`);var mr=hr();function hr(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=gr(e,t),e.unshift(t)},remove(t){e=gr(e,t),e[0]?.resume()}}}K(hr,`createFocusScopesStack`);function gr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}K(gr,`arrayRemove`);function _r(e){return e.filter(e=>e.tagName!==`A`)}K(_r,`removeLinks`);var vr=Object.defineProperty,yr=w.forwardRef(((e,t)=>vr(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`)),br=Object.defineProperty,xr=(e,t)=>br(e,`name`,{value:t,configurable:!0}),Sr=0,Cr=null;function wr(e){return Tr(),e.children}xr(wr,`FocusGuards`);function Tr(){w.useEffect(()=>{Cr||={start:Er(),end:Er()};let{start:e,end:t}=Cr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Sr++,()=>{Sr===1&&(Cr?.start.remove(),Cr?.end.remove(),Cr=null),Sr=Math.max(0,Sr-1)}},[])}xr(Tr,`useFocusGuards`);function Er(){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}xr(Er,`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 Dr(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 Or(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 kr=`right-scroll-bar-position`,Ar=`width-before-scroll-bar`,jr=`with-scroll-bars-hidden`,Mr=`--removed-body-scroll-bar-size`;function Nr(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 Fr=typeof window<`u`?w.useLayoutEffect:w.useEffect,Ir=new WeakMap;function Lr(e,t){var n=Pr(t||null,function(t){return e.forEach(function(e){return Nr(e,t)})});return Fr(function(){var t=Ir.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Nr(e,null)}),i.forEach(function(e){r.has(e)||Nr(e,a)})}Ir.set(n,e)},[e]),n}function Rr(e){return e}function zr(e,t){t===void 0&&(t=Rr);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 Br(e){e===void 0&&(e={});var t=zr(null);return t.options=J({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Dr(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))};Vr.isSideCarExport=!0;function Hr(e,t){return e.useMedium(t),Vr}var Ur=Br(),Wr=function(){},Gr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),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=Dr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Lr([n,t]),C=J(J({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ur,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))});Gr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gr.classNames={fullWidth:Ar,zeroRight:kr};var Kr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kr();return t&&e.setAttribute(`nonce`,t),e}function Jr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qr())&&(Jr(t,n),Yr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zr=function(){var e=Xr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qr=function(){var e=Zr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$r={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||``,10)||0},ti=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[ei(n),ei(r),ei(i)]},ni=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $r;var t=ti(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])}},ri=Qr(),ii=`data-scroll-locked`,ai=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
210
|
+
`,Mt={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`}},Nt=[`system`,`light`,`dark`],Pt={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Ft=6e5;function It({logs:e,logsFailed:t,signOut:n}){let{live:r,toggle:o,connection:c}=fe(),{mode:l,setMode:u}=yt(),h=Date.now(),g=oe(()=>e.filter(e=>h-e.at<=Ft),[e,h]),_=f(g,Ft),v=s(g,{now:h,spanMs:Ft,count:24}),b=Nt[(Nt.indexOf(l)+1)%Nt.length]??`system`,x=l===`light`?tt:l===`dark`?Ge:Ue,w=Mt[r?c.status===`offline`?`offline`:c.status===`push`?`push`:`poll`:`paused`],T=t||_.errorRate>=.25?`down`:_.errorRate>=.05?`warn`:g.length===0?`idle`:`ok`;return k(wt,{children:[k(Tt,{children:[O(d,{state:T,label:t?`request log unreadable`:`error rate ${a(_.errorRate)}`}),`Omnigateway`]}),k(Et,{children:[k(Ot,{children:[O(C,{children:`req`}),O(kt,{children:O(Ct,{values:v.map(e=>e.total),overlay:v.map(e=>e.errors),height:22,label:`${_.requests} requests in the last 10 minutes`})})]}),k(Dt,{children:[O(C,{children:`rate`}),O(y,{children:_.ratePerMin.toFixed(1)}),O(C,{children:`/min`})]}),k(Dt,{children:[O(C,{children:`err`}),O(y,{style:{color:_.errorRate>=.05?`var(--down)`:void 0},children:a(_.errorRate)})]}),k(Dt,{children:[O(C,{children:`ttft p50`}),O(y,{children:i(_.ttftP50)})]}),k(Dt,{children:[O(C,{children:`spend`}),O(y,{children:p(_.costUsd)})]})]}),O(S,{}),k(At,{type:`button`,$size:`sm`,onClick:o,"aria-pressed":r,"aria-label":w.name,title:w.title,children:[O(d,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:k(se,{children:[O(jt,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>u(b),"aria-label":Pt[l],title:`${Pt[l]} — switch to ${Pt[b].toLowerCase()}`,children:O(x,{})}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:n.pending,onClick:n.run,children:O(Ve,{})})]})}function Lt(){let e=u(),{cadence:n}=fe(),r=c(),i=t(200,n(1e4,`res:logs`));return O(It,{logs:i.data??[],logsFailed:i.isError,signOut:{pending:r.isPending,run:()=>{r.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})}}})}function Rt(e){return`/plugins/${e}`}function zt(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:Bt(e)}))}function Bt(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 Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Ut,`setRef`);function Wt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ut(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():Ut(e[t],null)}}}}Ht(Wt,`composeRefs`);function N(...e){return w.useCallback(Wt(...e),e)}Ht(N,`useComposedRefs`);var Gt=Object.defineProperty,P=(e,t)=>Gt(e,`name`,{value:t,configurable:!0});function Kt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];en(r)&&typeof an==`function`&&(r=an(r._payload)),w.Children.forEach(r,e=>{if(Qt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;en(n)&&typeof an==`function`&&(n=an(n._payload)),a=Yt(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?Zt(a):void 0,l=N(n,c);if(!a){if(r||r===0)throw Error(o?rn(e):nn(e));return r}let u=Xt(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}P(Kt,`createSlot`);var qt=Symbol.for(`radix.slottable`);function Jt(e){let t=P(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}P(Jt,`createSlottable`);var Yt=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 Xt(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(Xt,`mergeProps`);function Zt(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(Zt,`getElementRef`);function Qt(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qt}P(Qt,`isSlottable`);var $t=Symbol.for(`react.lazy`);function en(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$t&&`_payload`in e&&tn(e._payload)}P(en,`isLazyComponent`);function tn(e){return typeof e==`object`&&!!e&&`then`in e}P(tn,`isPromiseLike`);var nn=P(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),rn=P(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),an=w.use,on=Object.defineProperty,sn=(e,t)=>on(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=Kt(`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 cn(e,t){e&&pe.flushSync(()=>e.dispatchEvent(t))}sn(cn,`dispatchDiscreteCustomEvent`);var ln=Object.defineProperty,I=(e,t)=>ln(e,`name`,{value:t,configurable:!0});function un(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(un,`createContext`);function dn(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,fn(i,...t)]}I(dn,`createContextScope`);function fn(...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(fn,`composeContextScopes`);var pn=Object.defineProperty,L=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),mn=!!(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 hn(e){if(!mn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}L(hn,`getOwnerWindow`);function gn(e){if(!mn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}L(gn,`getOwnerDocument`);function _n(e,t=!1){let{activeElement:n}=gn(e);if(!n?.nodeName)return null;if(vn(n)&&n.contentDocument)return _n(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=gn(n).getElementById(e);if(t)return t}}return n}L(_n,`getActiveElement`);function vn(e){return e.tagName===`IFRAME`}L(vn,`isFrame`);var z=globalThis?.document?w.useLayoutEffect:()=>{},yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=w.useEffectEvent,Sn=w.useInsertionEffect;function Cn(e){if(typeof xn==`function`)return xn(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Sn==`function`?Sn(()=>{t.current=e}):z(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}bn(Cn,`useEffectEvent`);var wn=Object.defineProperty,Tn=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),En=w.useInsertionEffect||z;function Dn({prop:e,defaultProp:t,onChange:n=Tn(()=>{},`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=kn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Tn(Dn,`useControllableState`);function On({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return En(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Tn(On,`useUncontrolledState`);function kn(e){return typeof e==`function`}Tn(kn,`isFunction`);var An=Symbol(`RADIX:SYNC_STATE`);function jn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Cn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===An)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:An,state:i})},[i,d.state,c]),[h,f]}Tn(jn,`useControllableStateReducer`);var Mn=Object.defineProperty,B=(e,t)=>Mn(e,`name`,{value:t,configurable:!0});function Nn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}B(Nn,`useStateMachine`);var Pn=B(e=>{let{present:t,children:n}=e,r=Fn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=Ln(r.ref,Rn(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function Fn(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]=Nn(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??V(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=V(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=B(a=>{let o=V(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=B(e=>{e.target===t&&(a.current=V(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=V(t)}else r.current=null;n(e)},[])}}B(Fn,`usePresence`);function In(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}B(In,`setRef`);function Ln(...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=In(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():In(n[e],null)}}},[])}B(Ln,`useStableComposedRefs`);function V(e){return e?.animationName||`none`}B(V,`getAnimationName`);function Rn(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)}B(Rn,`getElementRef`);var zn=Object.defineProperty,Bn=(e,t)=>zn(e,`name`,{value:t,configurable:!0}),Vn=w.useId||(()=>void 0),Hn=0;function H(e){let[t,n]=w.useState(Vn());return z(()=>{e||n(e=>e??String(Hn++))},[e]),e||(t?`radix-${t}`:``)}Bn(H,`useId`);var Un=Object.defineProperty,Wn=(e,t)=>Un(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)),[])}Wn(U,`useCallbackRef`);var Gn=Object.defineProperty,W=(e,t)=>Gn(e,`name`,{value:t,configurable:!0}),Kn=`dismissableLayer.update`,qn=`dismissableLayer.pointerDownOutside`,Jn=`dismissableLayer.focusOutside`,Yn,Xn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zn=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(Xn),[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=er(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=tr(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&&(Yn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),nr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Yn))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),nr())},[d,u]),w.useEffect(()=>{let e=W(()=>m({}),`handleUpdate`);return document.addEventListener(Kn,e),()=>document.removeEventListener(Kn,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 Qn(){let e=w.useContext(Xn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}W(Qn,`useDismissableLayerSurface`);var $n=W(()=>!0,`IS_TRUE`);function er(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$n}=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||rr(qn,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(er,`usePointerDownOutside`);function tr(e,t=globalThis?.document){let n=U(e),r=w.useRef(!1);return w.useEffect(()=>{let e=W(e=>{e.target&&!r.current&&rr(Jn,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(tr,`useFocusOutside`);function nr(){let e=new CustomEvent(Kn);document.dispatchEvent(e)}W(nr,`dispatchUpdate`);function rr(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?cn(i,a):i.dispatchEvent(a)}W(rr,`handleAndDispatchCustomEvent`);var ir=Object.defineProperty,G=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),ar=`focusScope.autoFocusOnMount`,or=`focusScope.autoFocusOnUnmount`,sr={bubbles:!1,cancelable:!0},cr=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){hr.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ar,sr);s.addEventListener(ar,l),s.dispatchEvent(t),t.defaultPrevented||(lr(vr(dr(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(ar,l),setTimeout(()=>{let t=new CustomEvent(or,sr);s.addEventListener(or,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(or,u),hr.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]=ur(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 lr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}G(lr,`focusFirst`);function ur(e){let t=dr(e);return[fr(t,e),fr(t.reverse(),e)]}G(ur,`getTabbableEdges`);function dr(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(dr,`getTabbableCandidates`);function fr(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pr(r,{upTo:t})))return r}G(fr,`findVisible`);function pr(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(pr,`isHidden`);function mr(e){return e instanceof HTMLInputElement&&`select`in e}G(mr,`isSelectableInput`);function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mr(e)&&t&&e.select()}}G(K,`focus`);var hr=gr();function gr(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_r(e,t),e.unshift(t)},remove(t){e=_r(e,t),e[0]?.resume()}}}G(gr,`createFocusScopesStack`);function _r(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}G(_r,`arrayRemove`);function vr(e){return e.filter(e=>e.tagName!==`A`)}G(vr,`removeLinks`);var yr=Object.defineProperty,br=w.forwardRef(((e,t)=>yr(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`)),xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),Cr=0,q=null;function wr(e){return Tr(),e.children}Sr(wr,`FocusGuards`);function Tr(){w.useEffect(()=>{q||={start:Er(),end:Er()};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),Cr++,()=>{Cr===1&&(q?.start.remove(),q?.end.remove(),q=null),Cr=Math.max(0,Cr-1)}},[])}Sr(Tr,`useFocusGuards`);function Er(){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}Sr(Er,`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 Dr(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 Or(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 kr=`right-scroll-bar-position`,Ar=`width-before-scroll-bar`,jr=`with-scroll-bars-hidden`,Mr=`--removed-body-scroll-bar-size`;function Nr(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 Fr=typeof window<`u`?w.useLayoutEffect:w.useEffect,Ir=new WeakMap;function Lr(e,t){var n=Pr(t||null,function(t){return e.forEach(function(e){return Nr(e,t)})});return Fr(function(){var t=Ir.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Nr(e,null)}),i.forEach(function(e){r.has(e)||Nr(e,a)})}Ir.set(n,e)},[e]),n}function Rr(e){return e}function zr(e,t){t===void 0&&(t=Rr);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 Br(e){e===void 0&&(e={});var t=zr(null);return t.options=J({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Dr(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))};Vr.isSideCarExport=!0;function Hr(e,t){return e.useMedium(t),Vr}var Ur=Br(),Wr=function(){},Gr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),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=Dr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Lr([n,t]),C=J(J({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ur,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))});Gr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gr.classNames={fullWidth:Ar,zeroRight:kr};var Kr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kr();return t&&e.setAttribute(`nonce`,t),e}function Jr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qr())&&(Jr(t,n),Yr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zr=function(){var e=Xr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qr=function(){var e=Zr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$r={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||``,10)||0},ti=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[ei(n),ei(r),ei(i)]},ni=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $r;var t=ti(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])}},ri=Qr(),ii=`data-scroll-locked`,ai=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
211
211
|
.${jr} {
|
|
212
212
|
overflow: hidden ${r};
|
|
213
213
|
padding-right: ${s}px ${r};
|
|
@@ -247,13 +247,13 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
247
247
|
`},oi=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},si=function(){w.useEffect(function(){return document.body.setAttribute(ii,(oi()+1).toString()),function(){var e=oi()-1;e<=0?document.body.removeAttribute(ii):document.body.setAttribute(ii,e.toString())}},[])},ci=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;si();var a=w.useMemo(function(){return ni(i)},[i]);return w.createElement(ri,{styles:ai(a,!t,i,n?``:`!important`)})},li=!1;if(typeof window<`u`)try{var ui=Object.defineProperty({},"passive",{get:function(){return li=!0,!0}});window.addEventListener(`test`,ui,ui),window.removeEventListener(`test`,ui,ui)}catch{li=!1}var Y=li?{passive:!1}:!1,di=function(e){return e.tagName===`TEXTAREA`},fi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!di(e)&&n[t]===`visible`)},pi=function(e){return fi(e,`overflowY`)},mi=function(e){return fi(e,`overflowX`)},hi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),vi(e,r)){var i=yi(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gi=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_i=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},vi=function(e,t){return e===`v`?pi(t):mi(t)},yi=function(e,t){return e===`v`?gi(t):_i(t)},bi=function(e,t){return e===`h`&&t===`rtl`?-1:1},xi=function(e,t,n,r,i){var a=bi(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=yi(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&vi(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},Si=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ci=function(e){return[e.deltaX,e.deltaY]},wi=function(e){return e&&`current`in e?e.current:e},Ti=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ei=function(e){return`
|
|
248
248
|
.block-interactivity-${e} {pointer-events: none;}
|
|
249
249
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
250
|
-
`},Di=0,X=[];function Oi(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(Di++)[0],a=w.useState(Qr)[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=Or([e.lockRef.current],(e.shards||[]).map(wi),!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=Si(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=hi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=hi(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 xi(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?Ci(n):Si(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ti(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wi).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:ki(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=Si(e),r.current=void 0},[]),d=w.useCallback(function(t){l(t.type,Ci(t),t.target,s(t,e.lockRef.current))},[]),f=w.useCallback(function(t){l(t.type,Si(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:Ei(i)}):null,p?w.createElement(ci,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ki(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ai=Hr(Ur,Oi),ji=w.forwardRef(function(e,t){return w.createElement(Gr,J({},e,{ref:t,sideCar:Ai}))});ji.classNames=Gr.classNames;var Mi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,Ni=new WeakMap,Pi={},Fi=0,Ii=function(e){return e&&(e.host||Ii(e.parentNode))},Li=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ii(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})},Ri=function(e,t,n,r){var i=Li(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&&Ni.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(),Fi++,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||(Ni.has(e)||e.removeAttribute(r),Ni.delete(e)),i||e.removeAttribute(n)}),Fi--,Fi||(Z=new WeakMap,Z=new WeakMap,Ni=new WeakMap,Pi={})}},zi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Mi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ri(r,i,n,`aria-hidden`)):function(){return null}},Bi=Object.defineProperty,Q=(e,t)=>Bi(e,`name`,{value:t,configurable:!0}),Vi=`Dialog`,[Hi,Ui]=dn(Vi),[Wi,$]=Hi(Vi),Gi=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]=
|
|
250
|
+
`},Di=0,X=[];function Oi(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(Di++)[0],a=w.useState(Qr)[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=Or([e.lockRef.current],(e.shards||[]).map(wi),!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=Si(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=hi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=hi(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 xi(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?Ci(n):Si(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ti(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wi).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:ki(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=Si(e),r.current=void 0},[]),d=w.useCallback(function(t){l(t.type,Ci(t),t.target,s(t,e.lockRef.current))},[]),f=w.useCallback(function(t){l(t.type,Si(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:Ei(i)}):null,p?w.createElement(ci,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ki(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ai=Hr(Ur,Oi),ji=w.forwardRef(function(e,t){return w.createElement(Gr,J({},e,{ref:t,sideCar:Ai}))});ji.classNames=Gr.classNames;var Mi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,Ni=new WeakMap,Pi={},Fi=0,Ii=function(e){return e&&(e.host||Ii(e.parentNode))},Li=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ii(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})},Ri=function(e,t,n,r){var i=Li(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&&Ni.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(),Fi++,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||(Ni.has(e)||e.removeAttribute(r),Ni.delete(e)),i||e.removeAttribute(n)}),Fi--,Fi||(Z=new WeakMap,Z=new WeakMap,Ni=new WeakMap,Pi={})}},zi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Mi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ri(r,i,n,`aria-hidden`)):function(){return null}},Bi=Object.defineProperty,Q=(e,t)=>Bi(e,`name`,{value:t,configurable:!0}),Vi=`Dialog`,[Hi,Ui]=dn(Vi),[Wi,$]=Hi(Vi),Gi=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]=Dn({prop:r,defaultProp:i??!1,onChange:a,caller:Vi}),[d,f]=w.useState(0),[p,m]=w.useState(0);return O(Wi,{scope:t,triggerRef:s,contentRef:c,contentId:H(),titleId:H(),descriptionId:H(),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`),Ki=`DialogPortal`,[qi,Ji]=Hi(Ki,{forceMount:void 0}),Yi=Q(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$(Ki,t);return O(qi,{scope:t,forceMount:n,children:w.Children.map(r,e=>O(Pn,{present:n||a.open,children:O(br,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Xi=`DialogOverlay`,Zi=w.forwardRef(Q(function(e,t){let n=Ji(Xi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$(Xi,e.__scopeDialog);return a.modal?O(Pn,{present:r||a.open,children:O($i,{...i,ref:t})}):null},`DialogOverlay`)),Qi=Kt(`DialogOverlay.RemoveScroll`),$i=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(Xi,n),a=N(t,Qn());return O(ji,{as:Qi,allowPinchZoom:!0,shards:[i.contentRef],children:O(F.div,{"data-state":da(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ea=`DialogContent`,ta=w.forwardRef(Q(function(e,t){let n=Ji(ea,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$(ea,e.__scopeDialog);return O(Pn,{present:r||a.open,children:a.modal?O(na,{...i,ref:t}):O(ra,{...i,ref:t})})},`DialogContent`)),na=w.forwardRef(Q(function(e,t){let n=$(ea,e.__scopeDialog),r=w.useRef(null),i=N(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return zi(e)},[]),O(ia,{...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`)),ra=w.forwardRef(Q(function(e,t){let n=$(ea,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return O(ia,{...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`)),ia=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$(ea,n);return Tr(),O(se,{children:O(cr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:O(Zn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":da(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),aa=`DialogTitle`,oa=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(aa,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`)),sa=`DialogDescription`,ca=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(sa,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`)),la=`DialogClose`,ua=w.forwardRef(Q(function(e,t){let{__scopeDialog:n,...r}=e,i=$(la,n);return O(F.button,{type:`button`,...r,ref:t,onClick:R(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function da(e){return e?`open`:`closed`}Q(da,`getState`);var fa=T(null);function pa(){return re(fa)}var ma=A(Zi)`
|
|
251
251
|
position: fixed;
|
|
252
252
|
inset: 0;
|
|
253
253
|
z-index: ${({theme:e})=>e.z.overlay};
|
|
254
254
|
background: oklch(0 0 0 / 0.5);
|
|
255
255
|
backdrop-filter: blur(2px);
|
|
256
|
-
`,
|
|
256
|
+
`,ha=A(ta)`
|
|
257
257
|
position: fixed;
|
|
258
258
|
z-index: ${({theme:e})=>e.z.dialog};
|
|
259
259
|
top: 50%;
|
|
@@ -267,31 +267,31 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
267
267
|
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
268
268
|
border-radius: ${({theme:e})=>e.radius.panel};
|
|
269
269
|
box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
|
|
270
|
-
`,
|
|
270
|
+
`,ga=A.div`
|
|
271
271
|
display: flex;
|
|
272
272
|
align-items: center;
|
|
273
273
|
gap: ${({theme:e})=>e.space(2)};
|
|
274
274
|
padding: ${({theme:e})=>`${e.space(2)} ${e.space(2)} ${e.space(2)} ${e.space(3)}`};
|
|
275
275
|
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
276
276
|
background: ${({theme:e})=>e.color.panelSunk};
|
|
277
|
-
`,
|
|
277
|
+
`,_a=A.div`
|
|
278
278
|
padding: ${({theme:e})=>e.space(3)};
|
|
279
279
|
overflow-y: auto;
|
|
280
|
-
`,
|
|
280
|
+
`,va=A.div`
|
|
281
281
|
display: flex;
|
|
282
282
|
justify-content: flex-end;
|
|
283
283
|
gap: ${({theme:e})=>e.space(2)};
|
|
284
284
|
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
285
285
|
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
286
286
|
background: ${({theme:e})=>e.color.panelSunk};
|
|
287
|
-
`,
|
|
287
|
+
`,ya=A(ca)`
|
|
288
288
|
margin: 0 0 ${({theme:e})=>e.space(3)};
|
|
289
289
|
font-size: 12px;
|
|
290
290
|
color: ${({theme:e})=>e.color.inkDim};
|
|
291
|
-
`;function
|
|
291
|
+
`;function ba({open:e,onOpenChange:t,title:n,description:r,footer:i,width:a=`560px`,children:o}){let[s,c]=D(null);return O(Gi,{open:e,onOpenChange:t,children:k(Yi,{children:[O(ma,{}),k(ha,{ref:c,$width:a,children:[k(ga,{children:[O(oa,{asChild:!0,children:O(C,{as:`h2`,children:n})}),O(S,{}),O(ua,{asChild:!0,children:O(m,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Close`,children:O(at,{})})})]}),k(_a,{children:[r===void 0?null:O(ya,{children:r}),O(fa.Provider,{value:s,children:o})]}),i===void 0?null:O(va,{children:i})]})]})})}var xa=A.p`
|
|
292
292
|
font-size: 13px;
|
|
293
293
|
color: ${({theme:e})=>e.color.inkDim};
|
|
294
|
-
`;function
|
|
294
|
+
`;function Sa({open:e,onOpenChange:t,title:n,body:r,confirmLabel:i,busy:a,onConfirm:o}){return O(ba,{open:e,onOpenChange:t,title:n,width:`420px`,footer:k(se,{children:[O(x,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),O(x,{type:`button`,$variant:`danger`,disabled:a===!0,onClick:o,children:i})]}),children:O(xa,{children:r})})}var Ca={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.`},wa=A.hr`
|
|
295
295
|
flex: none;
|
|
296
296
|
border: 0;
|
|
297
297
|
margin: 0;
|
|
@@ -305,7 +305,7 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
305
305
|
width: 1px;
|
|
306
306
|
margin-left: ${({theme:e})=>e.space(2)};
|
|
307
307
|
}
|
|
308
|
-
`,
|
|
308
|
+
`,Ta=A.div`
|
|
309
309
|
display: flex;
|
|
310
310
|
flex-direction: column;
|
|
311
311
|
gap: 6px;
|
|
@@ -317,27 +317,27 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
317
317
|
flex-direction: row;
|
|
318
318
|
align-items: center;
|
|
319
319
|
}
|
|
320
|
-
`,
|
|
320
|
+
`,Ea=A(x)`
|
|
321
321
|
justify-content: flex-start;
|
|
322
322
|
width: 100%;
|
|
323
323
|
|
|
324
324
|
@media (max-width: 720px) {
|
|
325
325
|
width: auto;
|
|
326
326
|
}
|
|
327
|
-
`,
|
|
327
|
+
`,Da=A.p`
|
|
328
328
|
font-size: 10.5px;
|
|
329
329
|
line-height: 1.3;
|
|
330
330
|
color: ${({theme:e})=>e.color.warn};
|
|
331
|
-
`,
|
|
331
|
+
`,Oa=A.p`
|
|
332
332
|
font-size: 10.5px;
|
|
333
333
|
line-height: 1.3;
|
|
334
334
|
color: ${({theme:e})=>e.color.down};
|
|
335
|
-
`,
|
|
335
|
+
`,ka=A.p`
|
|
336
336
|
font-size: 10.5px;
|
|
337
337
|
line-height: 1.3;
|
|
338
338
|
color: ${({theme:e})=>e.color.inkDim};
|
|
339
339
|
${h}
|
|
340
|
-
`,
|
|
340
|
+
`,Aa=A.span`
|
|
341
341
|
flex: none;
|
|
342
342
|
font-size: 10.5px;
|
|
343
343
|
line-height: 1.3;
|
|
@@ -347,11 +347,11 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
347
347
|
@media (max-width: 720px) {
|
|
348
348
|
padding: 0 ${({theme:e})=>e.space(2)};
|
|
349
349
|
}
|
|
350
|
-
`,
|
|
350
|
+
`,ja=A.p`
|
|
351
351
|
font-size: 10.5px;
|
|
352
352
|
line-height: 1.3;
|
|
353
353
|
color: ${({theme:e})=>e.color.inkDim};
|
|
354
|
-
`,
|
|
354
|
+
`,Ma=9e4;async function Na(){try{return(await fetch(`/health`,{cache:`no-store`})).ok}catch{return!1}}function Pa({pollMs:t=750}){let i=r(),a=n(),o=e(),[s,c]=D(null),[l,u]=D(!1),[d,f]=D(!1),[p,m]=D(`idle`),h=i.data;ie(()=>{if(!l)return;let e=!1,n,r=!1,i=0,a=Math.max(1,Math.ceil(Ma/t)),o=async()=>{let s=await Na();if(!e){if(!r&&!s)r=!0,m(`returning`);else if(r&&s){window.location.reload();return}if(i+=1,i>=a){m(`lost`),u(!1);return}n=setTimeout(()=>void o(),t)}};return n=setTimeout(()=>void o(),t),()=>{e=!0,n!==void 0&&clearTimeout(n)}},[l,t]);let g=()=>{m(`leaving`),a.mutate(void 0,{onSuccess:()=>u(!0),onError:()=>m(`idle`)})};return d?k(se,{children:[O(S,{}),h===void 0?null:k(Aa,{children:[`omnigateway v`,h.version]}),O(wa,{}),O(Ta,{children:k(v,{$gap:1,children:[O(C,{children:`Gateway stopped`}),k(ja,{children:[`Nothing on this screen will update again, and nothing here can start it: that needs`,` `,h?.supervisor===`container`?`the host that runs this container`:`a shell on the machine it runs on`,`.`]})]})})]}):k(se,{children:[O(S,{}),h===void 0?null:k(Aa,{children:[`omnigateway v`,h.version]}),O(wa,{}),k(Ta,{title:h===void 0?void 0:Ca[h.supervisor],children:[k(Ea,{type:`button`,$size:`sm`,"aria-label":`Restart gateway`,disabled:h===void 0||!h.canRestart||a.isPending||l,onClick:()=>c(`restart`),children:[O(Ye,{}),`Restart`]}),k(Ea,{type:`button`,$size:`sm`,$variant:`danger`,"aria-label":`Shut down gateway`,disabled:h===void 0||!h.canShutdown||o.isPending||l,onClick:()=>c(`shutdown`),children:[O(qe,{}),`Shut down`]}),h?.note===void 0?null:O(Da,{children:h.note}),p===`leaving`?O(ka,{role:`status`,children:`Restarting. Waiting for the gateway to stop answering.`}):p===`returning`?O(ka,{role:`status`,children:`The gateway has stopped answering. Waiting for it to come back, then this page reloads.`}):p===`lost`?O(Oa,{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,a.isError?O(Oa,{role:`alert`,children:b(a.error)}):null,o.isError?O(Oa,{role:`alert`,children:b(o.error)}):null]}),O(Sa,{open:s===`restart`,onOpenChange:e=>{e||c(null)},title:`Restart gateway`,body:`${h===void 0?``:`${Ca[h.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:a.isPending,onConfirm:()=>{c(null),g()}}),O(Sa,{open:s===`shutdown`,onOpenChange:e=>{e||c(null)},title:`Shut down gateway`,body:h?.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:o.isPending,onConfirm:()=>{c(null),o.mutate(void 0,{onSuccess:()=>f(!0)})}})]})}var Fa=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:De},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:Ne},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:je},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:ze},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:Le},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:Ze},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:rt},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:$e},{to:`/database`,label:`Database`,blurb:`Size, snapshots, and retention`,Icon:Fe}],Ia=A.nav`
|
|
355
355
|
grid-area: rail;
|
|
356
356
|
display: flex;
|
|
357
357
|
flex-direction: column;
|
|
@@ -367,7 +367,7 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
367
367
|
border-right: 0;
|
|
368
368
|
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
369
369
|
}
|
|
370
|
-
`,
|
|
370
|
+
`,La=ue`
|
|
371
371
|
display: flex;
|
|
372
372
|
align-items: center;
|
|
373
373
|
line-height: 1;
|
|
@@ -389,8 +389,8 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
389
389
|
flex: none;
|
|
390
390
|
transform: translateY(-1px);
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
393
|
-
${
|
|
392
|
+
`,Ra=A(l)`
|
|
393
|
+
${La}
|
|
394
394
|
|
|
395
395
|
&:hover {
|
|
396
396
|
background: ${({theme:e})=>e.color.panelSunk};
|
|
@@ -402,8 +402,8 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
402
402
|
border-left-color: ${({theme:e})=>e.color.accent};
|
|
403
403
|
color: ${({theme:e})=>e.color.accent};
|
|
404
404
|
}
|
|
405
|
-
`,
|
|
406
|
-
${
|
|
405
|
+
`,za=A.button`
|
|
406
|
+
${La}
|
|
407
407
|
align-items: flex-start;
|
|
408
408
|
width: 100%;
|
|
409
409
|
text-align: left;
|
|
@@ -419,17 +419,17 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
419
419
|
svg {
|
|
420
420
|
margin-top: 2px;
|
|
421
421
|
}
|
|
422
|
-
`,
|
|
422
|
+
`,Ba=A.span`
|
|
423
423
|
display: flex;
|
|
424
424
|
flex-direction: column;
|
|
425
425
|
gap: 2px;
|
|
426
426
|
min-width: 0;
|
|
427
|
-
`,
|
|
427
|
+
`,Va=A.span`
|
|
428
428
|
font-size: 10.5px;
|
|
429
429
|
font-weight: 400;
|
|
430
430
|
line-height: 1.3;
|
|
431
431
|
color: ${({theme:e})=>e.color.warn};
|
|
432
|
-
`;function
|
|
432
|
+
`;function Ha(){let e=o();return k(Ia,{"aria-label":`Console sections`,children:[Fa.map(({to:e,label:t,blurb:n,Icon:r})=>k(Ra,{to:e,title:n,activeOptions:{exact:e===`/`},children:[O(r,{}),t]},e)),zt(e.data??[]).map(({id:e,label:t,disabledReason:n})=>n===null?k(Ra,{to:Rt(e),title:`Provided by the ${e} plugin`,children:[O(ke,{}),t]},e):k(za,{type:`button`,disabled:!0,children:[O(ke,{}),k(Ba,{children:[t,O(Va,{children:n})]})]},e)),O(Pa,{})]})}var Ua=A.div`
|
|
433
433
|
display: grid;
|
|
434
434
|
grid-template-areas:
|
|
435
435
|
"chassis chassis"
|
|
@@ -448,7 +448,7 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
448
448
|
grid-template-columns: minmax(0, 1fr);
|
|
449
449
|
grid-template-rows: auto auto minmax(0, 1fr);
|
|
450
450
|
}
|
|
451
|
-
`,
|
|
451
|
+
`,Wa=A.main`
|
|
452
452
|
grid-area: main;
|
|
453
453
|
padding: ${({theme:e})=>e.space(4)};
|
|
454
454
|
display: flex;
|
|
@@ -461,23 +461,23 @@ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on a
|
|
|
461
461
|
@media (max-width: 720px) {
|
|
462
462
|
padding: ${({theme:e})=>e.space(3)};
|
|
463
463
|
}
|
|
464
|
-
`;function
|
|
464
|
+
`;function Ga({children:e}){return k(Ua,{"data-testid":`rack-shell`,children:[O(Lt,{}),O(Ha,{}),O(Wa,{children:e})]})}var Ka=A.div`
|
|
465
465
|
display: flex;
|
|
466
466
|
align-items: flex-end;
|
|
467
467
|
gap: ${({theme:e})=>e.space(3)};
|
|
468
468
|
flex-wrap: wrap;
|
|
469
|
-
`,
|
|
469
|
+
`,qa=A.h1`
|
|
470
470
|
font-size: 20px;
|
|
471
471
|
font-weight: 600;
|
|
472
472
|
font-stretch: 88%;
|
|
473
473
|
letter-spacing: -0.01em;
|
|
474
|
-
`,
|
|
474
|
+
`,Ja=A.p`
|
|
475
475
|
font-size: 13px;
|
|
476
476
|
color: ${({theme:e})=>e.color.inkDim};
|
|
477
477
|
max-width: 68ch;
|
|
478
|
-
`,
|
|
478
|
+
`,Ya=A.div`
|
|
479
479
|
display: flex;
|
|
480
480
|
flex-direction: column;
|
|
481
481
|
gap: 6px;
|
|
482
482
|
min-width: 0;
|
|
483
|
-
`;function
|
|
483
|
+
`;function Xa({legend:e,title:t,summary:n,actions:r}){return k(Ka,{children:[k(Ya,{children:[O(C,{children:e}),O(qa,{children:t}),O(Ja,{children:n})]}),O(S,{}),r]})}export{Fe as A,Ct as C,de as D,st as E,fe as O,It as S,dt as T,R as _,pa as a,Kt as b,Tr as c,Zn as d,U as f,z as g,Dn as h,ba as i,M as j,$e as k,br as l,Pn as m,Ga as n,zi as o,H as p,Sa as r,ji as s,Xa as t,cr as u,dn as v,bt as w,N as x,F as y};
|