omnigateway 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +334 -8
  2. package/bin/omni.js +1929 -147
  3. package/gateway.js +3129 -555
  4. package/package.json +1 -1
  5. package/public/assets/{Chip-DJwp7gBu.js → Chip-DbKk1ExR.js} +1 -1
  6. package/public/assets/Confirm-C5DYoI93.js +4 -0
  7. package/public/assets/CopyValue-CXjietiZ.js +27 -0
  8. package/public/assets/{Field-BDtp692L.js → Field-B7GOsJf8.js} +1 -1
  9. package/public/assets/Lamp-QRSv-SqM.js +25 -0
  10. package/public/assets/{Meter-BREBUFGX.js → Meter-Dngwbpjo.js} +1 -1
  11. package/public/assets/Modal-DfltaSCz.js +82 -0
  12. package/public/assets/Rack-D1zBw9SW.js +151 -0
  13. package/public/assets/{Readout-CEAoN5hu.js → Readout--CQnPjoO.js} +2 -2
  14. package/public/assets/{States-BEKLros0.js → States-CQFkw1UZ.js} +3 -3
  15. package/public/assets/{Table-BBypbVWj.js → Table-Ba58Wg4-.js} +1 -1
  16. package/public/assets/Toggle-DWrWc9-9.js +39 -0
  17. package/public/assets/TokenBreakdown-CyHJv0O5.js +31 -0
  18. package/public/assets/_app-CTDgfstQ.js +1 -0
  19. package/public/assets/_app.accounts-DP6T8z7I.js +64 -0
  20. package/public/assets/{_app.console-DKyGL9xx.js → _app.console-DYr7TCAl.js} +10 -10
  21. package/public/assets/_app.database-BzO1S_VR.js +39 -0
  22. package/public/assets/_app.index-CBt6b-lA.js +62 -0
  23. package/public/assets/_app.keys-B8HGsPPS.js +76 -0
  24. package/public/assets/_app.logs-DKsxa2Su.js +68 -0
  25. package/public/assets/{_app.models-CDqVrAeF.js → _app.models-CZD2UpM-.js} +28 -28
  26. package/public/assets/_app.settings-B2C1LQIF.js +46 -0
  27. package/public/assets/_app.usage-CDWUXtZy.js +83 -0
  28. package/public/assets/dist-IkJ0qg-4.js +1 -0
  29. package/public/assets/index-ClU3Xqui.js +186 -0
  30. package/public/assets/login-E3gh2_Cl.js +36 -0
  31. package/public/assets/plus-DkO4vG-T.js +1 -0
  32. package/public/assets/queries-BJHk_wso.js +144 -0
  33. package/public/assets/reasons-Cb8yF4Oy.js +1 -0
  34. package/public/assets/{shared-CIhZ6FCO.js → shared-Bp35cgFf.js} +7 -7
  35. package/public/assets/{trash-2-CLYNAAJA.js → trash-2-DTWWI3vA.js} +1 -1
  36. package/public/index.html +2 -2
  37. package/public/assets/Confirm-CVLz9F7a.js +0 -4
  38. package/public/assets/CopyValue-CNZbWS59.js +0 -27
  39. package/public/assets/Lamp-B65uWKbW.js +0 -25
  40. package/public/assets/Modal-DbydSAlp.js +0 -82
  41. package/public/assets/Rack-Bbo4JfEX.js +0 -151
  42. package/public/assets/Toggle-BUr71O4J.js +0 -39
  43. package/public/assets/TokenBreakdown-C1ziK9d1.js +0 -31
  44. package/public/assets/_app-ByQ1bPbe.js +0 -1
  45. package/public/assets/_app.accounts-BTug_Xfo.js +0 -64
  46. package/public/assets/_app.index-CSw9gmMf.js +0 -62
  47. package/public/assets/_app.keys-07Kbw4RS.js +0 -39
  48. package/public/assets/_app.logs-C9QiV39p.js +0 -32
  49. package/public/assets/_app.settings-DmUEeTaP.js +0 -38
  50. package/public/assets/_app.usage-B1WuMGRr.js +0 -83
  51. package/public/assets/dist-Bka7ErcH.js +0 -1
  52. package/public/assets/index-DJfb1i4P.js +0 -186
  53. package/public/assets/login-DKZYqRh0.js +0 -33
  54. package/public/assets/queries-D8LJNQpL.js +0 -144
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnigateway",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Self-hosted AI gateway with Anthropic- and OpenAI-compatible APIs, an admin console, and a CLI",
5
5
  "license": "MIT",
6
6
  "author": "Harismawan <mail@harismawan.com>",
@@ -1,4 +1,4 @@
1
- import{Pt as e,q as t}from"./queries-D8LJNQpL.js";var n=e(),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=t.span`
1
+ import{Qt as e,ut as t}from"./queries-BJHk_wso.js";var n=e(),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=t.span`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  gap: 4px;
@@ -0,0 +1,4 @@
1
+ import{Qt as e,at as t,ut as n}from"./queries-BJHk_wso.js";import{t as r}from"./Modal-DfltaSCz.js";var i=e(),a=n.p`
2
+ font-size: 13px;
3
+ color: ${({theme:e})=>e.color.inkDim};
4
+ `;function o({open:e,onOpenChange:n,title:o,body:s,confirmLabel:c,busy:l,onConfirm:u}){return(0,i.jsx)(r,{open:e,onOpenChange:n,title:o,width:`420px`,footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{type:`button`,onClick:()=>n(!1),children:`Cancel`}),(0,i.jsx)(t,{type:`button`,$variant:`danger`,disabled:l===!0,onClick:u,children:c})]}),children:(0,i.jsx)(a,{children:s})})}export{o as t};
@@ -0,0 +1,27 @@
1
+ import{$t as e,Qt as t,_n as n,ot as r,tt as i,ut as a}from"./queries-BJHk_wso.js";import{c as o}from"./Rack-D1zBw9SW.js";var s=o(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),c=o(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),l=o(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),u=o(`copy`,[[`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=n(e(),1);function f(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 p(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=f(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var m=t(),h=a.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=a.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
+ `,_=a(r)`
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=a.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:t}){let[n,r]=(0,d.useState)(null),a=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(n!==`copied`)return;let e=setTimeout(()=>r(null),1600);return()=>clearTimeout(e)},[n]);let o=(0,d.useCallback)(()=>{p(e,a.current).then(r)},[e]),c=n===`copied`,l=n===null?void 0:y[n];return(0,m.jsxs)(i,{$gap:1,children:[(0,m.jsxs)(h,{children:[(0,m.jsx)(g,{ref:a,children:e}),(0,m.jsx)(_,{type:`button`,$variant:`ghost`,onClick:o,"aria-label":c?`Copied`:t,title:c?`Copied`:t,children:c?(0,m.jsx)(s,{}):(0,m.jsx)(u,{})})]}),l===void 0?null:(0,m.jsx)(v,{role:`status`,children:l})]})}export{l as n,c as r,b as t};
@@ -1,4 +1,4 @@
1
- import{$t as e,Ft as t,N as n,Pt as r,q as i}from"./queries-D8LJNQpL.js";var a=e(t(),1),o=r(),s=`
1
+ import{$t as e,Qt as t,Y as n,_n as r,ut as i}from"./queries-BJHk_wso.js";var a=r(e(),1),o=t(),s=`
2
2
  width: 100%;
3
3
  border-radius: 3px;
4
4
  transition: border-color 120ms ease;
@@ -0,0 +1,25 @@
1
+ import{Qt as e,lt as t,st as n,ut as r}from"./queries-BJHk_wso.js";var i=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),a=new Intl.NumberFormat(`en-US`);function o(e){return Number.isFinite(e)?e<1e4?a.format(Math.round(e)):i.format(e).toLowerCase():`—`}function s(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${i.format(e).toLowerCase()}`:`—`}function c(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/6e4)}m`}function l(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var u=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function d(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=u.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function f(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${d(n)} ago`:`in ${d(n)}`}function p(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}function m(e){return e==null||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}var h=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function g(e){if(e==null||!Number.isFinite(e))return`—`;if(Math.abs(e)<1024)return`${Math.round(e)} B`;let t=e,n=0;for(;Math.abs(t)>=1024&&n<h.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${h[n]}`}function _(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var v={fiveHour:18e6,daily:864e5,weekly:6048e5};function y(e,t){return t!==null&&t>0?t:v[e]}var b=6e4;function x(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=b}function S(e,t){return t===void 0?`unknown`:e.observedAt>0&&t.stale?`stale`:t.ratePerHour===null||e.limit===null?`unknown`:t.survives===!1&&t.exhaustsAt!==null?`empty`:t.survives===!0?`ok`:`unknown`}function C(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>e-t);return n[Math.min(n.length-1,Math.max(0,Math.ceil(t*n.length)-1))]??null}function w(e){return e.state===`pending`}function T(e){return e.filter(e=>!w(e))}function E(e){return w(e)?!1:e.status>=400||e.errorCode!==null}var D={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function O(e){return w(e)?`live`:E(e)?`down`:`ok`}function k(e){return w(e)?`in flight`:E(e)?`failed with ${e.status}`:`succeeded`}function A(e,t){let n=T(e),r=[],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of n)E(e)&&(i+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&r.push(e.ttftMs),a+=e.costUsd,o+=e.inputTokens,s+=e.outputTokens,c+=e.cacheReadTokens,l+=e.cacheWriteTokens;let u=t/6e4;return{requests:n.length,errors:i,errorRate:n.length===0?0:i/n.length,ratePerMin:u<=0?0:n.length/u,ttftP50:C(r,.5),ttftP95:C(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function j(e,t){let n=T(e),{now:r,spanMs:i,count:a}=t,o=i/a,s=r-i,c=Array.from({length:a},(e,t)=>({at:s+t*o,total:0,errors:0,costUsd:0,tokens:0,ttftMs:null})),l=Array.from({length:a},()=>[]);for(let e of n){if(e.at<s||e.at>r)continue;let t=Math.min(a-1,Math.floor((e.at-s)/o)),n=c[t];n!==void 0&&(n.total+=1,n.costUsd+=e.costUsd,n.tokens+=e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens,E(e)&&(n.errors+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&l[t]?.push(e.ttftMs))}for(let[e,t]of c.entries())t.ttftMs=C(l[e]??[],.5);return c}var M={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function N(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?M[r]:`disabled`,ttftMs:null,lastUsedAt:null,consecutiveFailures:0}}if(e.length===0)return{state:`idle`,note:`unused`,ttftMs:null,lastUsedAt:null,consecutiveFailures:0};let i=`ok`,a=``,o=null,s=null,c=0;for(let n of e){if(n.ewmaTtftMs!==null&&(o=o===null?n.ewmaTtftMs:Math.max(o,n.ewmaTtftMs)),n.lastUsedAt!==null&&(s=s===null?n.lastUsedAt:Math.max(s,n.lastUsedAt)),c=Math.max(c,n.consecutiveFailures),n.breakerState===`open`){i=`down`,a=`breaker open`;continue}if(n.rateLimitedUntil!==null&&n.rateLimitedUntil>t&&i!==`down`){i=`warn`,a=`rate limited`;continue}n.breakerState===`halfOpen`&&i===`ok`&&(i=`warn`,a=`probing`)}return{state:i,note:a,ttftMs:o,lastUsedAt:s,consecutiveFailures:c}}var P={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function F(e){return Math.max(e,6e4)*3}function I(e,t,n){return e.observedAt<=0||t-e.observedAt>F(n)}function L(e,t){return e.find(e=>e.windowType===t)}function R(e,t,n,r,i){let a=P[e.windowType];if(e.observedAt<=0)return`${a} · never observed`;if(I(e,t,n))return`${a} · stale, read ${r(e.observedAt,t)}`;if(e.resetsAt===null)return a;let o=`resets ${r(e.resetsAt,t)}`;return i===void 0||i.stale||i.survives!==!1||i.exhaustsAt===null?`${a} · ${o}`:`${a} · ${i.exhaustsAt<=t?`empty now`:`empty ~${d(i.exhaustsAt-t)}`} · ${o}`}function z(e){let t=e.filter(e=>e.limit!==null&&e.limit>0).sort((e,t)=>e.observedAt-t.observedAt),n=[],r;for(let e of t){let t={at:e.observedAt,percent:Math.min(100,e.used/e.limit*100)},i={resetsAt:e.resetsAt,startsAt:e.resetsAt===null?null:e.resetsAt-y(e.windowType,e.windowMs)},a=n[n.length-1];a===void 0||r===void 0||!x(e.resetsAt,r.resetsAt)?n.push({key:`window-${n.length}`,points:[t],...i}):(a.points.push(t),a.resetsAt=i.resetsAt,a.startsAt=i.startsAt),r=e}return n}function B(e,t){let{limit:n,used:r,observedAt:i}=t;if(n===null||n<=0)return[...e];let a=e.findLastIndex(e=>x(e.resetsAt,t.resetsAt)),o=e[a];if(o===void 0)return[...e];let s=o.points[o.points.length-1];if(s===void 0||s.at>=i)return[...e];let c={at:i,percent:Math.min(100,r/n*100)};return e.map((e,t)=>t===a?{...e,points:[...e.points,c]}:e)}function V(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var H=36e5;function U(e,t){let{limit:n,resetsAt:r,observedAt:i,used:a}=e,o=t.ratePerHour;if(n===null||n<=0||r===null||o===null||o<=0)return null;let s=a/n*100,c=o/n*100;return{from:{at:i,percent:s},to:{at:r,percent:s+c*((r-i)/H)}}}var W={fiveHour:0,daily:1,weekly:2};function G(e){return e.filter(e=>e.limit!==null&&e.limit>0).map(e=>({window:e,fraction:Math.min(1,e.used/e.limit)})).sort((e,t)=>W[e.window.windowType]-W[t.window.windowType])}function K(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}var q=e(),J=n`
2
+ 0%, 100% { opacity: 1; }
3
+ 50% { opacity: 0.28; }
4
+ `,Y=t`
5
+ color: ${({theme:e})=>e.color.ok};
6
+ animation: ${J} 1.2s ease-in-out infinite;
7
+
8
+ @media (prefers-reduced-motion: reduce) {
9
+ animation: none;
10
+ }
11
+ `,X={ok:t`
12
+ color: ${({theme:e})=>e.color.ok};
13
+ `,warn:t`
14
+ color: ${({theme:e})=>e.color.warn};
15
+ `,down:t`
16
+ color: ${({theme:e})=>e.color.down};
17
+ `,idle:t`
18
+ color: ${({theme:e})=>e.color.inkFaint};
19
+ `,live:Y},Z=r.span`
20
+ font-family: ${({theme:e})=>e.font.mono};
21
+ font-size: 12px;
22
+ line-height: 1;
23
+ flex: none;
24
+ ${({$state:e})=>X[e]}
25
+ `;function Q({state:e,label:t,className:n}){return(0,q.jsx)(Z,{$state:e,className:n,role:`img`,"aria-label":t,title:t,children:D[e]})}export{m as C,f as D,l as E,s as O,o as S,c as T,A as _,L as a,g as b,E as c,k as d,O as f,G as g,z as h,V as i,_ as k,w as l,R as m,P as n,N as o,U as p,j as r,K as s,Q as t,I as u,B as v,d as w,p as x,S as y};
@@ -1,4 +1,4 @@
1
- import{Pt as e,q as t}from"./queries-D8LJNQpL.js";var n=e(),r=t.div`
1
+ import{Qt as e,ut as t}from"./queries-BJHk_wso.js";var n=e(),r=t.div`
2
2
  position: relative;
3
3
  width: 100%;
4
4
  height: ${({$height:e})=>e}px;
@@ -0,0 +1,82 @@
1
+ import{$t as e,Qt as t,Y as n,_n as r,et as i,ot as a,pt as o,ut as s}from"./queries-BJHk_wso.js";import{c}from"./Rack-D1zBw9SW.js";import{a as l,c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./dist-IkJ0qg-4.js";var _=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),v=t(),ee=r(o(),1),y=r(e(),1),b=Object.defineProperty,x=(e,t)=>b(e,`name`,{value:t,configurable:!0});function S(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}x(S,`useStateMachine`);var C=x(e=>{let{present:t,children:n}=e,r=te(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=T(r.ref,D(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null},`Presence`);function te(e){let[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef(`none`),o=y.useRef(void 0),[s,c]=S(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{s===`mounted`?(a.current=o.current??E(r.current),o.current=void 0):a.current=`none`},[s]),f(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=E(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]),f(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=x(a=>{let o=E(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=x(e=>{e.target===t&&(a.current=E(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:y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=E(t)}else r.current=null;n(e)},[])}}x(te,`usePresence`);function w(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}x(w,`setRef`);function T(...e){let t=y.useRef(e);return t.current=e,y.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=w(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():w(n[e],null)}}},[])}x(T,`useStableComposedRefs`);function E(e){return e?.animationName||`none`}x(E,`getAnimationName`);function D(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)}x(D,`getElementRef`);var ne=Object.defineProperty,O=(e,t)=>ne(e,`name`,{value:t,configurable:!0}),re=y.useId||(()=>void 0),ie=0;function k(e){let[t,n]=y.useState(re());return f(()=>{e||n(e=>e??String(ie++))},[e]),e||(t?`radix-${t}`:``)}O(k,`useId`);var ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0});function A(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...e)=>t.current?.(...e)),[])}oe(A,`useCallbackRef`);var se=Object.defineProperty,j=(e,t)=>se(e,`name`,{value:t,configurable:!0}),ce=`dismissableLayer.update`,le=`dismissableLayer.pointerDownOutside`,ue=`dismissableLayer.focusOutside`,de,fe=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pe=y.forwardRef(j(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...d}=e,f=y.useContext(fe),[p,h]=y.useState(null),g=p?.ownerDocument??globalThis?.document,[,_]=y.useState({}),ee=u(t,h),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x?b.indexOf(x):-1,C=p?b.indexOf(p):-1,te=f.layersWithOutsidePointerEventsDisabled.size>0,w=C>=S,T=y.useRef(!1),E=ge(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return w&&!t},[f.branches,w])}),D=_e(e=>{if(r&&T.current)return;let t=e.target;[...f.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},g),ne=p?C===b.length-1:!1,O=A(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return y.useEffect(()=>{if(ne)return g.addEventListener(`keydown`,O,{capture:!0}),()=>g.removeEventListener(`keydown`,O,{capture:!0})},[g,ne,O]),y.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(de=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),ve(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=de))}},[p,g,n,f]),y.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),ve())},[p,f]),y.useEffect(()=>{let e=j(()=>_({}),`handleUpdate`);return document.addEventListener(ce,e),()=>document.removeEventListener(ce,e)},[]),(0,v.jsx)(l.div,{...d,ref:ee,style:{pointerEvents:te?w?`auto`:`none`:void 0,...e.style},onFocusCapture:m(e.onFocusCapture,D.onFocusCapture),onBlurCapture:m(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:m(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function me(){let e=y.useContext(fe),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}j(me,`useDismissableLayerSurface`);var he=j(()=>!0,`IS_TRUE`);function ge(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=he}=t,s=A(e),c=y.useRef(!1),l=y.useRef(!1),u=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}j(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}j(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)}j(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}j(p,`handleInteractionBubble`);let m=j(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ye(le,s,p,{discrete:!0})};if(j(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:j(()=>c.current=!0,`onPointerDownCapture`)}}j(ge,`usePointerDownOutside`);function _e(e,t=globalThis?.document){let n=A(e),r=y.useRef(!1);return y.useEffect(()=>{let e=j(e=>{e.target&&!r.current&&ye(ue,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:j(()=>r.current=!0,`onFocusCapture`),onBlurCapture:j(()=>r.current=!1,`onBlurCapture`)}}j(_e,`useFocusOutside`);function ve(){let e=new CustomEvent(ce);document.dispatchEvent(e)}j(ve,`dispatchUpdate`);function ye(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?p(i,a):i.dispatchEvent(a)}j(ye,`handleAndDispatchCustomEvent`);var be=Object.defineProperty,M=(e,t)=>be(e,`name`,{value:t,configurable:!0}),xe=`focusScope.autoFocusOnMount`,Se=`focusScope.autoFocusOnUnmount`,Ce={bubbles:!1,cancelable:!0},we=y.forwardRef(M(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=y.useState(null),d=A(i),f=A(a),p=y.useRef(null),m=u(t,c),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(h.paused||!s)return;let t=e.target;s.contains(t)?p.current=t:N(p.current,{select:!0})},t=function(e){if(h.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||N(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(s)};M(e,`handleFocusIn`),M(t,`handleFocusOut`),M(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,h.paused]),y.useEffect(()=>{if(s){je.add(h);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(xe,Ce);s.addEventListener(xe,d),s.dispatchEvent(t),t.defaultPrevented||(Te(Ne(De(s)),{select:!0}),document.activeElement===e&&N(s))}return()=>{s.removeEventListener(xe,d),setTimeout(()=>{let t=new CustomEvent(Se,Ce);s.addEventListener(Se,f),s.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),s.removeEventListener(Se,f),je.remove(h)},0)}}},[s,d,f,h]);let g=y.useCallback(e=>{if(!n&&!r||h.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]=Ee(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,v.jsx)(l.div,{tabIndex:-1,...o,ref:m,onKeyDown:g})},`FocusScope`));function Te(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}M(Te,`focusFirst`);function Ee(e){let t=De(e);return[Oe(t,e),Oe(t.reverse(),e)]}M(Ee,`getTabbableEdges`);function De(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:M(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}M(De,`getTabbableCandidates`);function Oe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ke(r,{upTo:t})))return r}M(Oe,`findVisible`);function ke(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}M(ke,`isHidden`);function Ae(e){return e instanceof HTMLInputElement&&`select`in e}M(Ae,`isSelectableInput`);function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ae(e)&&t&&e.select()}}M(N,`focus`);var je=Me();function Me(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=P(e,t),e.unshift(t)},remove(t){e=P(e,t),e[0]?.resume()}}}M(Me,`createFocusScopesStack`);function P(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}M(P,`arrayRemove`);function Ne(e){return e.filter(e=>e.tagName!==`A`)}M(Ne,`removeLinks`);var Pe=Object.defineProperty,Fe=y.forwardRef(((e,t)=>Pe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=y.useState(!1);f(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ee.createPortal((0,v.jsx)(l.div,{...r,ref:t}),o):null},`Portal`)),Ie=Object.defineProperty,Le=(e,t)=>Ie(e,`name`,{value:t,configurable:!0}),F=0,I=null;function Re(e){return ze(),e.children}Le(Re,`FocusGuards`);function ze(){y.useEffect(()=>{I||={start:Be(),end:Be()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}Le(ze,`useFocusGuards`);function Be(){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}Le(Be,`createFocusGuard`);var L=function(){return L=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},L.apply(this,arguments)};function Ve(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 He(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 R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Ue=`with-scroll-bars-hidden`,We=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ge(e,t){var n=(0,y.useState)(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 Ke=typeof window<`u`?y.useLayoutEffect:y.useEffect,qe=new WeakMap;function Je(e,t){var n=Ge(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Ke(function(){var t=qe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}qe.set(n,e)},[e]),n}function Ye(e){return e}function Xe(e,t){t===void 0&&(t=Ye);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 Ze(e){e===void 0&&(e={});var t=Xe(null);return t.options=L({async:!0,ssr:!1},e),t}var Qe=function(e){var t=e.sideCar,n=Ve(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 y.createElement(r,L({},n))};Qe.isSideCarExport=!0;function $e(e,t){return e.useMedium(t),Qe}var et=Ze(),tt=function(){},V=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:tt,onWheelCapture:tt,onTouchMoveCapture:tt}),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`:_,ee=e.gapMode,b=Ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Je([n,t]),C=L(L({},b),i);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:et,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:ee}),o?y.cloneElement(y.Children.only(s),L(L({},C),{ref:S})):y.createElement(v,L({},C,{className:c,ref:S}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:z,zeroRight:R};var nt,rt=function(){if(nt)return nt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function it(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=rt();return t&&e.setAttribute(`nonce`,t),e}function at(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ot(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var st=function(){var e=0,t=null;return{add:function(n){e==0&&(t=it())&&(at(t,n),ot(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ct=function(){var e=st();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lt=function(){var e=ct();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ut={left:0,top:0,right:0,gap:0},dt=function(e){return parseInt(e||``,10)||0},ft=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[dt(n),dt(r),dt(i)]},pt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ut;var t=ft(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])}},mt=lt(),H=`data-scroll-locked`,ht=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Ue} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${H}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${R} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${z} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${R} .${R} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${z} .${z} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${H}] {
36
+ ${We}: ${s}px;
37
+ }
38
+ `},gt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},_t=function(){y.useEffect(function(){return document.body.setAttribute(H,(gt()+1).toString()),function(){var e=gt()-1;e<=0?document.body.removeAttribute(H):document.body.setAttribute(H,e.toString())}},[])},vt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;_t();var a=y.useMemo(function(){return pt(i)},[i]);return y.createElement(mt,{styles:ht(a,!t,i,n?``:`!important`)})},yt=!1;if(typeof window<`u`)try{var U=Object.defineProperty({},"passive",{get:function(){return yt=!0,!0}});window.addEventListener(`test`,U,U),window.removeEventListener(`test`,U,U)}catch{yt=!1}var W=yt?{passive:!1}:!1,bt=function(e){return e.tagName===`TEXTAREA`},xt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!bt(e)&&n[t]===`visible`)},St=function(e){return xt(e,`overflowY`)},Ct=function(e){return xt(e,`overflowX`)},wt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Dt(e,r)){var i=Ot(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Tt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Et=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Dt=function(e,t){return e===`v`?St(t):Ct(t)},Ot=function(e,t){return e===`v`?Tt(t):Et(t)},kt=function(e,t){return e===`h`&&t===`rtl`?-1:1},At=function(e,t,n,r,i){var a=kt(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=Ot(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Dt(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},G=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jt=function(e){return[e.deltaX,e.deltaY]},Mt=function(e){return e&&`current`in e?e.current:e},Nt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pt=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},Ft=0,K=[];function It(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Ft++)[0],a=y.useState(lt)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=He([e.lockRef.current],(e.shards||[]).map(Mt),!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=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=G(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=wt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=wt(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 At(h,t,e,h===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!K.length||K[K.length-1]!==a)){var r=`deltaY`in n?jt(n):G(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Nt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Mt).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=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Lt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=G(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,jt(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,G(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return K.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,W),document.addEventListener(`touchmove`,c,W),document.addEventListener(`touchstart`,u,W),function(){K=K.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,W),document.removeEventListener(`touchmove`,c,W),document.removeEventListener(`touchstart`,u,W)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:Pt(i)}):null,p?y.createElement(vt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Lt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Rt=$e(et,It),zt=y.forwardRef(function(e,t){return y.createElement(V,L({},e,{ref:t,sideCar:Rt}))});zt.classNames=V.classNames;var Bt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},q=new WeakMap,J=new WeakMap,Y={},Vt=0,Ht=function(e){return e&&(e.host||Ht(e.parentNode))},Ut=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ht(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})},Wt=function(e,t,n,r){var i=Ut(t,Array.isArray(e)?e:[e]);Y[n]||(Y[n]=new WeakMap);var a=Y[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=(q.get(e)||0)+1,l=(a.get(e)||0)+1;q.set(e,c),a.set(e,l),o.push(e),c===1&&i&&J.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(),Vt++,function(){o.forEach(function(e){var t=q.get(e)-1,i=a.get(e)-1;q.set(e,t),a.set(e,i),t||(J.has(e)||e.removeAttribute(r),J.delete(e)),i||e.removeAttribute(n)}),Vt--,Vt||(q=new WeakMap,q=new WeakMap,J=new WeakMap,Y={})}},Gt=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Bt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Wt(r,i,n,`aria-hidden`)):function(){return null}},Kt=Object.defineProperty,X=(e,t)=>Kt(e,`name`,{value:t,configurable:!0}),qt=`Dialog`,[Jt,Yt]=d(qt),[Xt,Z]=Jt(qt),Zt=X(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l,u]=g({prop:r,defaultProp:i??!1,onChange:a,caller:qt}),[d,f]=y.useState(0),[p,m]=y.useState(0);return(0,v.jsx)(Xt,{scope:t,triggerRef:s,contentRef:c,contentId:k(),titleId:k(),descriptionId:k(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Qt=`DialogPortal`,[$t,en]=Jt(Qt,{forceMount:void 0}),tn=X(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z(Qt,t);return(0,v.jsx)($t,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,v.jsx)(C,{present:n||a.open,children:(0,v.jsx)(Fe,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),nn=`DialogOverlay`,rn=y.forwardRef(X(function(e,t){let n=en(nn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(nn,e.__scopeDialog);return a.modal?(0,v.jsx)(C,{present:r||a.open,children:(0,v.jsx)(on,{...i,ref:t})}):null},`DialogOverlay`)),an=h(`DialogOverlay.RemoveScroll`),on=y.forwardRef(X(function(e,t){let{__scopeDialog:n,...r}=e,i=Z(nn,n),a=me(),o=u(t,a);return(0,v.jsx)(zt,{as:an,allowPinchZoom:!0,shards:[i.contentRef],children:(0,v.jsx)(l.div,{"data-state":$(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Q=`DialogContent`,sn=y.forwardRef(X(function(e,t){let n=en(Q,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeDialog);return(0,v.jsx)(C,{present:r||a.open,children:a.modal?(0,v.jsx)(cn,{...i,ref:t}):(0,v.jsx)(ln,{...i,ref:t})})},`DialogContent`)),cn=y.forwardRef(X(function(e,t){let n=Z(Q,e.__scopeDialog),r=y.useRef(null),i=u(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return Gt(e)},[]),(0,v.jsx)(un,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ln=y.forwardRef(X(function(e,t){let n=Z(Q,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,v.jsx)(un,{...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`)),un=y.forwardRef(X(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z(Q,n);return ze(),(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(we,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,v.jsx)(pe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":$(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),dn=`DialogTitle`,fn=y.forwardRef(X(function(e,t){let{__scopeDialog:n,...r}=e,i=Z(dn,n),{setTitleCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,v.jsx)(l.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),pn=`DialogDescription`,mn=y.forwardRef(X(function(e,t){let{__scopeDialog:n,...r}=e,i=Z(pn,n),{setDescriptionCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,v.jsx)(l.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),hn=`DialogClose`,gn=y.forwardRef(X(function(e,t){let{__scopeDialog:n,...r}=e,i=Z(hn,n);return(0,v.jsx)(l.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function $(e){return e?`open`:`closed`}X($,`getState`);var _n=s(rn)`
42
+ position: fixed;
43
+ inset: 0;
44
+ z-index: ${({theme:e})=>e.z.overlay};
45
+ background: oklch(0 0 0 / 0.5);
46
+ backdrop-filter: blur(2px);
47
+ `,vn=s(sn)`
48
+ position: fixed;
49
+ z-index: ${({theme:e})=>e.z.dialog};
50
+ top: 50%;
51
+ left: 50%;
52
+ transform: translate(-50%, -50%);
53
+ width: min(${({$width:e})=>e}, calc(100vw - 32px));
54
+ max-height: calc(100vh - 64px);
55
+ display: flex;
56
+ flex-direction: column;
57
+ background: ${({theme:e})=>e.color.panel};
58
+ border: 1px solid ${({theme:e})=>e.color.ruleStrong};
59
+ border-radius: ${({theme:e})=>e.radius.panel};
60
+ box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
61
+ `,yn=s.div`
62
+ display: flex;
63
+ align-items: center;
64
+ gap: ${({theme:e})=>e.space(2)};
65
+ padding: ${({theme:e})=>`${e.space(2)} ${e.space(2)} ${e.space(2)} ${e.space(3)}`};
66
+ border-bottom: 1px solid ${({theme:e})=>e.color.rule};
67
+ background: ${({theme:e})=>e.color.panelSunk};
68
+ `,bn=s.div`
69
+ padding: ${({theme:e})=>e.space(3)};
70
+ overflow-y: auto;
71
+ `,xn=s.div`
72
+ display: flex;
73
+ justify-content: flex-end;
74
+ gap: ${({theme:e})=>e.space(2)};
75
+ padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
76
+ border-top: 1px solid ${({theme:e})=>e.color.rule};
77
+ background: ${({theme:e})=>e.color.panelSunk};
78
+ `,Sn=s(mn)`
79
+ margin: 0 0 ${({theme:e})=>e.space(3)};
80
+ font-size: 12px;
81
+ color: ${({theme:e})=>e.color.inkDim};
82
+ `;function Cn({open:e,onOpenChange:t,title:r,description:o,footer:s,width:c=`560px`,children:l}){return(0,v.jsx)(Zt,{open:e,onOpenChange:t,children:(0,v.jsxs)(tn,{children:[(0,v.jsx)(_n,{}),(0,v.jsxs)(vn,{$width:c,children:[(0,v.jsxs)(yn,{children:[(0,v.jsx)(fn,{asChild:!0,children:(0,v.jsx)(n,{as:`h2`,children:r})}),(0,v.jsx)(i,{}),(0,v.jsx)(gn,{asChild:!0,children:(0,v.jsx)(a,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Close`,children:(0,v.jsx)(_,{})})})]}),(0,v.jsxs)(bn,{children:[o===void 0?null:(0,v.jsx)(Sn,{children:o}),l]}),s===void 0?null:(0,v.jsx)(xn,{children:s})]})]})})}export{Cn as t};
@@ -0,0 +1,151 @@
1
+ import{$t as e,D as t,E as n,Q as r,Qt as i,X as a,Y as o,_n as s,at as c,et as l,ft as u,it as d,mt as f,ot as p,ut as m}from"./queries-BJHk_wso.js";import{t as ee}from"./index-ClU3Xqui.js";import{E as h,O as te,T as ne,_ as re,r as g,t as _}from"./Lamp-QRSv-SqM.js";var v=s(e(),1),y=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),b=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),x=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),S=e=>{let t=x(e);return t.charAt(0).toUpperCase()+t.slice(1)},C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},w=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},T=(0,v.createContext)({}),E=()=>(0,v.useContext)(T),D=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=E()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...C,width:t??l??C.width,height:t??l??C.height,stroke:e??f,strokeWidth:m,className:y(`lucide`,p,i),...!a&&!w(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),O=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(D,{ref:i,iconNode:t,className:y(`lucide-${b(S(e))}`,`lucide-${e}`,n),...r}));return n.displayName=S(e),n},k=O(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),A=O(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),j=O(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),M=O(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),ie=O(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),N=O(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),P=O(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),F=O(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),I=O(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),L=O(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),R=O(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),z=O(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),B=O(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),V=i(),H=(0,v.createContext)(null);function U({children:e}){let[t,n]=(0,v.useState)(!0),r=(0,v.useCallback)(()=>n(e=>!e),[]),i=(0,v.useMemo)(()=>({live:t,toggle:r,cadence:e=>t?e:!1}),[t,r]);return(0,V.jsx)(H,{value:i,children:e})}function W(){return(0,v.use)(H)??{live:!1,toggle:()=>{},cadence:()=>!1}}var G=m.svg`
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow: visible;
6
+ `;function K(e,t,n,r){if(e.length===0)return``;let i=e.length===1?0:t/(e.length-1);return e.map((e,t)=>{let a=t*i,o=n-(r===0?0:e/r*n);return`${t===0?`M`:`L`}${a.toFixed(2)},${o.toFixed(2)}`}).join(` `)}function q({values:e,overlay:t,height:n=28,color:r,overlayColor:i,scaleTo:a,label:o,className:s}){let c=(0,v.useId)(),l=a===void 0?Math.max(1,...e,...t??[]):Math.max(1,a),u=K(e,100,n,l),d=u.length===0?``:`${u} L100,${n} L0,${n} Z`;return(0,V.jsxs)(G,{className:s,viewBox:`0 0 100 ${n}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o,style:{height:n},children:[(0,V.jsx)(`defs`,{children:(0,V.jsxs)(`linearGradient`,{id:c,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0%`,stopColor:r??`var(--accent)`,stopOpacity:`0.28`}),(0,V.jsx)(`stop`,{offset:`100%`,stopColor:r??`var(--accent)`,stopOpacity:`0`})]})}),d.length===0?null:(0,V.jsx)(`path`,{d,fill:`url(#${c})`}),t===void 0?null:(0,V.jsx)(`path`,{d:K(t,100,n,l),fill:`none`,stroke:i??`var(--down)`,strokeWidth:`1.25`,vectorEffect:`non-scaling-stroke`}),(0,V.jsx)(`path`,{d:u,fill:`none`,stroke:r??`var(--accent)`,strokeWidth:`1.5`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})}var J=m.header`
7
+ grid-area: chassis;
8
+ display: flex;
9
+ align-items: center;
10
+ gap: ${({theme:e})=>e.space(3)};
11
+ height: 48px;
12
+ padding: 0 ${({theme:e})=>e.space(3)};
13
+ border-bottom: 1px solid ${({theme:e})=>e.color.rule};
14
+ background: ${({theme:e})=>e.color.panel};
15
+ ${d}
16
+ position: sticky;
17
+ top: 0;
18
+ z-index: ${({theme:e})=>e.z.chassis};
19
+ `,ae=m.div`
20
+ display: flex;
21
+ align-items: baseline;
22
+ gap: 7px;
23
+ font-stretch: 74%;
24
+ font-weight: 700;
25
+ letter-spacing: 0.2em;
26
+ font-size: 12px;
27
+ text-transform: uppercase;
28
+ flex: none;
29
+ `,oe=m(r)`
30
+ gap: ${({theme:e})=>e.space(3)};
31
+ overflow: hidden;
32
+
33
+ @media (max-width: 860px) {
34
+ display: none;
35
+ }
36
+ `,Y=m.div`
37
+ display: flex;
38
+ align-items: baseline;
39
+ gap: 6px;
40
+ padding-left: ${({theme:e})=>e.space(3)};
41
+ border-left: 1px solid ${({theme:e})=>e.color.rule};
42
+ white-space: nowrap;
43
+ `,se=m(Y)`
44
+ width: 96px;
45
+ align-items: center;
46
+ `,ce=m.div`
47
+ flex: 1;
48
+ min-width: 0;
49
+ `,le=m(c)`
50
+ gap: 6px;
51
+ font-family: ${({theme:e})=>e.font.mono};
52
+ letter-spacing: 0.08em;
53
+ `,X=[`system`,`light`,`dark`],Z={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Q=6e5;function ue(){let e=f(),{live:r,toggle:i,cadence:s}=W(),{mode:c,setMode:u}=ee(),d=n(),m=t(200,s(1e4)),y=Date.now(),b=(0,v.useMemo)(()=>(m.data??[]).filter(e=>y-e.at<=Q),[m.data,y]),x=re(b,Q),S=g(b,{now:y,spanMs:Q,count:24}),C=X[(X.indexOf(c)+1)%X.length]??`system`,w=c===`light`?z:c===`dark`?I:F,T=m.isError||x.errorRate>=.25?`down`:x.errorRate>=.05?`warn`:b.length===0?`idle`:`ok`;return(0,V.jsxs)(J,{children:[(0,V.jsxs)(ae,{children:[(0,V.jsx)(_,{state:T,label:m.isError?`gateway unreachable`:`error rate ${h(x.errorRate)}`}),`Omnigateway`]}),(0,V.jsxs)(oe,{children:[(0,V.jsxs)(se,{children:[(0,V.jsx)(o,{children:`req`}),(0,V.jsx)(ce,{children:(0,V.jsx)(q,{values:S.map(e=>e.total),overlay:S.map(e=>e.errors),height:22,label:`${x.requests} requests in the last 10 minutes`})})]}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(o,{children:`rate`}),(0,V.jsx)(a,{children:x.ratePerMin.toFixed(1)}),(0,V.jsx)(o,{children:`/min`})]}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(o,{children:`err`}),(0,V.jsx)(a,{style:{color:x.errorRate>=.05?`var(--down)`:void 0},children:h(x.errorRate)})]}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(o,{children:`ttft p50`}),(0,V.jsx)(a,{children:ne(x.ttftP50)})]}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(o,{children:`spend`}),(0,V.jsx)(a,{children:te(x.costUsd)})]})]}),(0,V.jsx)(l,{}),(0,V.jsxs)(le,{type:`button`,$size:`sm`,onClick:i,"aria-pressed":r,title:r?`Pause polling`:`Resume polling`,children:[(0,V.jsx)(_,{state:r?`ok`:`idle`,label:r?`polling`:`paused`}),r?`LIVE`:`PAUSED`]}),(0,V.jsx)(p,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>u(C),"aria-label":Z[c],title:`${Z[c]} — switch to ${Z[C].toLowerCase()}`,children:(0,V.jsx)(w,{})}),(0,V.jsx)(p,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:d.isPending,onClick:()=>{d.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})},children:(0,V.jsx)(P,{})})]})}var de=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:k},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:j},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:A},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:N},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:ie},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:L},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:B},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:R},{to:`/database`,label:`Database`,blurb:`Size, snapshots, restart and shutdown`,Icon:M}],fe=m.nav`
54
+ grid-area: rail;
55
+ display: flex;
56
+ flex-direction: column;
57
+ gap: 2px;
58
+ padding: ${({theme:e})=>e.space(2)};
59
+ border-right: 1px solid ${({theme:e})=>e.color.rule};
60
+ background: ${({theme:e})=>e.color.panel};
61
+ overflow-y: auto;
62
+
63
+ @media (max-width: 720px) {
64
+ flex-direction: row;
65
+ overflow-x: auto;
66
+ border-right: 0;
67
+ border-bottom: 1px solid ${({theme:e})=>e.color.rule};
68
+ }
69
+ `,pe=m(u)`
70
+ display: flex;
71
+ align-items: center;
72
+ gap: ${({theme:e})=>e.space(2)};
73
+ padding: 7px ${({theme:e})=>e.space(2)};
74
+ border-radius: ${({theme:e})=>e.radius.control};
75
+ border-left: 2px solid transparent;
76
+ color: ${({theme:e})=>e.color.inkDim};
77
+ font-size: 12.5px;
78
+ font-weight: 500;
79
+ white-space: nowrap;
80
+ transition:
81
+ background 120ms ease,
82
+ color 120ms ease;
83
+
84
+ svg {
85
+ width: 15px;
86
+ height: 15px;
87
+ flex: none;
88
+ }
89
+
90
+ &:hover {
91
+ background: ${({theme:e})=>e.color.panelSunk};
92
+ color: ${({theme:e})=>e.color.ink};
93
+ }
94
+
95
+ &[data-status="active"] {
96
+ background: ${({theme:e})=>e.color.accentWash};
97
+ border-left-color: ${({theme:e})=>e.color.accent};
98
+ color: ${({theme:e})=>e.color.accent};
99
+ }
100
+ `;function me(){return(0,V.jsx)(fe,{"aria-label":`Console sections`,children:de.map(({to:e,label:t,blurb:n,Icon:r})=>(0,V.jsxs)(pe,{to:e,title:n,activeOptions:{exact:e===`/`},children:[(0,V.jsx)(r,{}),t]},e))})}var he=m.div`
101
+ display: grid;
102
+ grid-template-areas:
103
+ "chassis chassis"
104
+ "rail main";
105
+ grid-template-columns: 168px minmax(0, 1fr);
106
+ grid-template-rows: auto minmax(0, 1fr);
107
+ height: 100vh;
108
+ min-height: 0;
109
+ overflow: hidden;
110
+
111
+ @media (max-width: 720px) {
112
+ grid-template-areas:
113
+ "chassis"
114
+ "rail"
115
+ "main";
116
+ grid-template-columns: minmax(0, 1fr);
117
+ grid-template-rows: auto auto minmax(0, 1fr);
118
+ }
119
+ `,$=m.main`
120
+ grid-area: main;
121
+ padding: ${({theme:e})=>e.space(4)};
122
+ display: flex;
123
+ flex-direction: column;
124
+ gap: ${({theme:e})=>e.space(4)};
125
+ min-width: 0;
126
+ min-height: 0;
127
+ overflow-y: auto;
128
+
129
+ @media (max-width: 720px) {
130
+ padding: ${({theme:e})=>e.space(3)};
131
+ }
132
+ `;function ge({children:e}){return(0,V.jsxs)(he,{"data-testid":`rack-shell`,children:[(0,V.jsx)(ue,{}),(0,V.jsx)(me,{}),(0,V.jsx)($,{children:e})]})}var _e=m.div`
133
+ display: flex;
134
+ align-items: flex-end;
135
+ gap: ${({theme:e})=>e.space(3)};
136
+ flex-wrap: wrap;
137
+ `,ve=m.h1`
138
+ font-size: 20px;
139
+ font-weight: 600;
140
+ font-stretch: 88%;
141
+ letter-spacing: -0.01em;
142
+ `,ye=m.p`
143
+ font-size: 13px;
144
+ color: ${({theme:e})=>e.color.inkDim};
145
+ max-width: 68ch;
146
+ `,be=m.div`
147
+ display: flex;
148
+ flex-direction: column;
149
+ gap: 6px;
150
+ min-width: 0;
151
+ `;function xe({legend:e,title:t,summary:n,actions:r}){return(0,V.jsxs)(_e,{children:[(0,V.jsxs)(be,{children:[(0,V.jsx)(o,{children:e}),(0,V.jsx)(ve,{children:t}),(0,V.jsx)(ye,{children:n})]}),(0,V.jsx)(l,{}),r]})}export{W as a,O as c,U as i,ge as n,R as o,q as r,M as s,xe as t};
@@ -1,4 +1,4 @@
1
- import{N as e,Pt as t,q as n}from"./queries-D8LJNQpL.js";var r=t(),i=n.div`
1
+ import{Qt as e,Y as t,ut as n}from"./queries-BJHk_wso.js";var r=e(),i=n.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 6px;
@@ -28,4 +28,4 @@ import{N as e,Pt as t,q as n}from"./queries-D8LJNQpL.js";var r=t(),i=n.div`
28
28
  color: ${({theme:e})=>e.color.inkFaint};
29
29
  `,s=n.div`
30
30
  margin-top: 2px;
31
- `;function c({legend:t,value:n,unit:c,tone:l,trace:u,className:d}){return(0,r.jsxs)(i,{className:d,children:[(0,r.jsx)(e,{children:t}),(0,r.jsxs)(a,{...l===void 0?{}:{$tone:l},children:[(0,r.jsx)(`span`,{children:n}),c===void 0?null:(0,r.jsx)(o,{children:c})]}),u===void 0?null:(0,r.jsx)(s,{children:u})]})}export{c as t};
31
+ `;function c({legend:e,value:n,unit:c,tone:l,trace:u,className:d}){return(0,r.jsxs)(i,{className:d,children:[(0,r.jsx)(t,{children:e}),(0,r.jsxs)(a,{...l===void 0?{}:{$tone:l},children:[(0,r.jsx)(`span`,{children:n}),c===void 0?null:(0,r.jsx)(o,{children:c})]}),u===void 0?null:(0,r.jsx)(s,{children:u})]})}export{c as t};
@@ -1,4 +1,4 @@
1
- import{A as e,H as t,I as n,N as r,Pt as i,R as a,W as o,q as s}from"./queries-D8LJNQpL.js";var c=i(),l=s.section`
1
+ import{K as e,Q as t,Qt as n,Y as r,at as i,et as a,st as o,ut as s}from"./queries-BJHk_wso.js";var c=n(),l=s.section`
2
2
  background: ${({theme:e})=>e.color.panel};
3
3
  border: 1px solid ${({theme:e})=>e.color.rule};
4
4
  border-radius: ${({theme:e})=>e.radius.panel};
@@ -22,7 +22,7 @@ import{A as e,H as t,I as n,N as r,Pt as i,R as a,W as o,q as s}from"./queries-D
22
22
  padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
23
23
  border-top: 1px solid ${({theme:e})=>e.color.rule};
24
24
  background: ${({theme:e})=>e.color.panelSunk};
25
- `;function p({legend:e,meta:t,actions:i,footer:o,flush:s,className:p,children:m}){return(0,c.jsxs)(l,{className:p,children:[(0,c.jsxs)(u,{children:[(0,c.jsx)(r,{children:e}),t===void 0?null:(0,c.jsx)(r,{as:`span`,children:t}),(0,c.jsx)(a,{}),i===void 0?null:(0,c.jsx)(n,{$gap:1,children:i})]}),(0,c.jsx)(d,{...s===!0?{$flush:!0}:{},children:m}),o===void 0?null:(0,c.jsx)(f,{children:o})]})}var m=s.div`
25
+ `;function p({legend:e,meta:n,actions:i,footer:o,flush:s,className:p,children:m}){return(0,c.jsxs)(l,{className:p,children:[(0,c.jsxs)(u,{children:[(0,c.jsx)(r,{children:e}),n===void 0?null:(0,c.jsx)(r,{as:`span`,children:n}),(0,c.jsx)(a,{}),i===void 0?null:(0,c.jsx)(t,{$gap:1,children:i})]}),(0,c.jsx)(d,{...s===!0?{$flush:!0}:{},children:m}),o===void 0?null:(0,c.jsx)(f,{children:o})]})}var m=s.div`
26
26
  display: flex;
27
27
  flex-direction: column;
28
28
  align-items: center;
@@ -36,7 +36,7 @@ import{A as e,H as t,I as n,N as r,Pt as i,R as a,W as o,q as s}from"./queries-D
36
36
  color: ${({theme:e})=>e.color.inkDim};
37
37
  `;function g({legend:e,message:t,action:n}){return(0,c.jsxs)(m,{children:[(0,c.jsx)(r,{children:e}),(0,c.jsx)(h,{children:t}),n]})}var _=s(h)`
38
38
  color: ${({theme:e})=>e.color.down};
39
- `;function v(t){return t instanceof e||t instanceof Error?t.message:`The gateway did not answer.`}function y({legend:e=`Request failed`,error:n,onRetry:i}){return(0,c.jsxs)(m,{children:[(0,c.jsx)(r,{children:e}),(0,c.jsx)(_,{children:v(n)}),i===void 0?null:(0,c.jsx)(t,{type:`button`,$size:`sm`,onClick:i,children:`Try again`})]})}var b=o`
39
+ `;function v(t){return t instanceof e||t instanceof Error?t.message:`The gateway did not answer.`}function y({legend:e=`Request failed`,error:t,onRetry:n}){return(0,c.jsxs)(m,{children:[(0,c.jsx)(r,{children:e}),(0,c.jsx)(_,{children:v(t)}),n===void 0?null:(0,c.jsx)(i,{type:`button`,$size:`sm`,onClick:n,children:`Try again`})]})}var b=o`
40
40
  0% { opacity: 0.35; }
41
41
  50% { opacity: 0.7; }
42
42
  100% { opacity: 0.35; }
@@ -1,4 +1,4 @@
1
- import{q as e}from"./queries-D8LJNQpL.js";var t=e.table`
1
+ import{ut as e}from"./queries-BJHk_wso.js";var t=e.table`
2
2
  width: 100%;
3
3
  border-collapse: collapse;
4
4
  font-size: 12.5px;
@@ -0,0 +1,39 @@
1
+ import{$t as e,Qt as t,_n as n,ut as r}from"./queries-BJHk_wso.js";import{a as i,c as a,i as o,n as s,r as c,t as l}from"./dist-IkJ0qg-4.js";var u=n(e(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let[t,n]=u.useState(void 0);return s(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}f(p,`useSize`);var m=t(),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0}),_=`Switch`,[v,y]=o(_),[b,x]=v(_);function S(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[h,g]=l({prop:n,defaultProp:i??!1,onChange:c,caller:_}),[v,y]=u.useState(null),[x,S]=u.useState(null),C=u.useRef(!1),[w,T]=u.useReducer(e=>e+1,0),E={checked:h,setChecked:g,disabled:a,control:v,setControl:y,name:s,form:o,value:f,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:d,defaultChecked:i,isFormControl:!v||!!o||!!v.closest(`form`),bubbleInput:x,setBubbleInput:S};return(0,m.jsx)(b,{scope:t,...E,children:A(p)?p(E):r})}g(S,`SwitchProvider`);var C=`SwitchTrigger`,w=u.forwardRef(g(function({__scopeSwitch:e,onClick:t,...n},r){let{control:o,form:s,value:l,disabled:d,checked:f,required:p,setControl:h,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:b,bubbleInput:S}=x(C,e),w=a(r,h),T=u.useRef(f);return u.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=g(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,_]),(0,m.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":f,"aria-required":p,"data-state":j(f),"data-disabled":d?``:void 0,disabled:d,value:l,...n,ref:w,onClick:c(t,e=>{y(),_(e=>!e),S&&b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`SwitchTrigger`)),T=u.forwardRef(g(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,m.jsx)(S,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(w,{...d,ref:t,__scopeSwitch:n}),e&&(0,m.jsx)(k,{__scopeSwitch:n})]})})},`Switch`)),E=`SwitchThumb`,D=u.forwardRef(g(function(e,t){let{__scopeSwitch:n,...r}=e,a=x(E,n);return(0,m.jsx)(i.span,{"data-state":j(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),O=`SwitchBubbleInput`,k=u.forwardRef(g(function({__scopeSwitch:e,onClick:t,...n},r){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:l,checked:d,defaultChecked:f,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:b,setBubbleInput:S}=x(O,e),C=a(r,S),w=p(o),T=u.useRef(!1),E=u.useRef(d),D=u.useRef(l);u.useEffect(()=>{let e=b;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=l!==D.current;D.current=l;let i=E.current!==d;E.current=d;let a=!(r&&s.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,d),e.dispatchEvent(t),T.current=!1}},[b,d,s,l]);let k=u.useRef(d);return(0,m.jsx)(i.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:f??k.current,required:h,disabled:g,name:_,value:v,form:y,...n,tabIndex:-1,ref:C,onClick:c(t,e=>{T.current&&e.stopPropagation()}),style:{...n.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function A(e){return typeof e==`function`}g(A,`isFunction`);function j(e){return e?`checked`:`unchecked`}g(j,`getState`);var M=r(T)`
2
+ all: unset;
3
+ width: 30px;
4
+ height: 16px;
5
+ padding: 2px;
6
+ border-radius: 9px;
7
+ background: ${({theme:e})=>e.color.ruleStrong};
8
+ border: 1px solid ${({theme:e})=>e.color.rule};
9
+ cursor: pointer;
10
+ transition: background 140ms ease;
11
+ flex: none;
12
+
13
+ &[data-state="checked"] {
14
+ background: ${({theme:e})=>e.color.ok};
15
+ }
16
+
17
+ &:disabled {
18
+ opacity: 0.5;
19
+ cursor: not-allowed;
20
+ }
21
+
22
+ &:focus-visible {
23
+ outline: 2px solid ${({theme:e})=>e.color.accent};
24
+ outline-offset: 2px;
25
+ }
26
+ `,N=r(D)`
27
+ display: block;
28
+ width: 12px;
29
+ height: 12px;
30
+ border-radius: 50%;
31
+ background: ${({theme:e})=>e.color.panel};
32
+ transition: transform 140ms ease;
33
+ transform: translateX(0);
34
+ will-change: transform;
35
+
36
+ &[data-state="checked"] {
37
+ transform: translateX(14px);
38
+ }
39
+ `;function P({checked:e,onCheckedChange:t,label:n,disabled:r,id:i}){return(0,m.jsx)(M,{checked:e,onCheckedChange:t,"aria-label":n,...r===void 0?{}:{disabled:r},...i===void 0?{}:{id:i},children:(0,m.jsx)(N,{})})}export{P as t};
@@ -0,0 +1,31 @@
1
+ import{Qt as e,st as t,ut as n}from"./queries-BJHk_wso.js";import{c as r,s as i}from"./Rack-D1zBw9SW.js";import{S as a}from"./Lamp-QRSv-SqM.js";var o=r(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),s=r(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),c=e(),l=new Intl.NumberFormat(`en-US`);function u(e){return`${l.format(e.inputTokens)} input, ${l.format(e.outputTokens)} output, ${l.format(e.cacheReadTokens)} cache read, ${l.format(e.cacheWriteTokens)} cache write tokens`}var d=n.span`
2
+ display: inline-flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+ gap: 6px;
6
+ /* Wrapping happens between the four classes, never inside one: a count
7
+ broken across lines from its own arrow reads as a different number. */
8
+ white-space: nowrap;
9
+ `,f=n.span`
10
+ display: inline-flex;
11
+ align-items: center;
12
+ gap: 2px;
13
+
14
+ svg {
15
+ width: 12px;
16
+ height: 12px;
17
+ stroke-width: 1.75;
18
+ }
19
+ `,p=t`
20
+ from { clip-path: inset(0 2ch 0 0); }
21
+ to { clip-path: inset(0 0 0 0); }
22
+ `,m=n.span`
23
+ display: inline-block;
24
+ width: 3ch;
25
+ vertical-align: bottom;
26
+ animation: ${p} 1.5s steps(2, end) infinite;
27
+
28
+ @media (prefers-reduced-motion: reduce) {
29
+ animation: none;
30
+ }
31
+ `;function h(){return(0,c.jsxs)(`span`,{"aria-hidden":`true`,children:[`processing`,(0,c.jsx)(m,{children:`...`})]})}function g({tokens:e}){let t=u(e);return(0,c.jsxs)(d,{role:`img`,"aria-label":t,title:t,children:[(0,c.jsxs)(f,{"aria-hidden":`true`,children:[(0,c.jsx)(o,{}),a(e.inputTokens)]}),(0,c.jsxs)(f,{"aria-hidden":`true`,children:[(0,c.jsx)(s,{}),a(e.outputTokens)]}),(0,c.jsxs)(f,{"aria-hidden":`true`,children:[(0,c.jsx)(i,{}),(0,c.jsx)(o,{}),a(e.cacheReadTokens)]}),(0,c.jsxs)(f,{"aria-hidden":`true`,children:[(0,c.jsx)(i,{}),(0,c.jsx)(s,{}),a(e.cacheWriteTokens)]})]})}export{g as n,u as r,h as t};
@@ -0,0 +1 @@
1
+ import{Qt as e}from"./queries-BJHk_wso.js";import{o as t}from"./index-ClU3Xqui.js";import{i as n,n as r}from"./Rack-D1zBw9SW.js";var i=e(),a=()=>(0,i.jsx)(n,{children:(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as component};