omnigateway 0.15.2 → 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.
Files changed (43) hide show
  1. package/bin/omni.js +1 -1
  2. package/gateway.js +1 -1
  3. package/package.json +1 -1
  4. package/public/assets/{Chip-C3dIFd8s.js → Chip-B2iXmJJC.js} +1 -1
  5. package/public/assets/CopyValue-CWSTp4v8.js +27 -0
  6. package/public/assets/{Field-EvdVyEqx.js → Field-CUEEy19T.js} +5 -28
  7. package/public/assets/{Rack-DMrfn4-H.js → Rack-1lijWt5h.js} +32 -32
  8. package/public/assets/RequestTable-uRTmuPwB.js +93 -0
  9. package/public/assets/Select-C0c13SKD.js +141 -0
  10. package/public/assets/{SummaryDeck-DHsYYpYO.js → SummaryDeck-DnQnRmQ8.js} +1 -1
  11. package/public/assets/Toggle-BvVa_jla.js +39 -0
  12. package/public/assets/{TokenBreakdown-Bf0zsKcd.js → TokenBreakdown-B8cSaOOr.js} +2 -2
  13. package/public/assets/_app.accounts-DmJhe6QV.js +70 -0
  14. package/public/assets/_app.console-DQlcBpSu.js +24 -0
  15. package/public/assets/{_app.database-BCwEMrEA.js → _app.database-DoDu8HOG.js} +1 -1
  16. package/public/assets/{_app.index-DW6wain4.js → _app.index-BEeD4XSS.js} +2 -2
  17. package/public/assets/_app.keys-MXvgkBUB.js +120 -0
  18. package/public/assets/{_app.logs-CRC5qDK3.js → _app.logs-CjUjeVHg.js} +3 -3
  19. package/public/assets/_app.models-mNIL-1oS.js +148 -0
  20. package/public/assets/{_app.plugins._pluginId-CD9KXknf.js → _app.plugins._pluginId-CsJXQg6X.js} +1 -1
  21. package/public/assets/_app.settings-CYMwWA8D.js +88 -0
  22. package/public/assets/{_app.usage-BR6a92zI.js → _app.usage-Dd33vB8x.js} +3 -3
  23. package/public/assets/chevron-right-ocqzquMZ.js +1 -0
  24. package/public/assets/client-KUNw8ZtZ.js +48 -0
  25. package/public/assets/{index-6rZSWe9j.js → index-B9izdV6t.js} +3 -3
  26. package/public/assets/{login-NuwPF5SS.js → login-DrbTJF6e.js} +1 -1
  27. package/public/assets/plus-D_lvSfDL.js +1 -0
  28. package/public/assets/{rotate-ccw-Dionx_MW.js → rotate-ccw-CwTftDdz.js} +1 -1
  29. package/public/assets/{trash-Bsi60qJc.js → trash-CmuxOGpN.js} +1 -1
  30. package/public/index.html +2 -2
  31. package/public/assets/CopyValue-DG88CWpN.js +0 -27
  32. package/public/assets/RequestTable-CtuuMOT2.js +0 -93
  33. package/public/assets/Toggle-BTie3NY8.js +0 -39
  34. package/public/assets/_app.accounts-xCJhRd32.js +0 -70
  35. package/public/assets/_app.console-DS37cfIu.js +0 -24
  36. package/public/assets/_app.keys-CCU2NB3-.js +0 -120
  37. package/public/assets/_app.models-B4brzRdK.js +0 -148
  38. package/public/assets/_app.settings-NJSb_L2B.js +0 -88
  39. package/public/assets/chevron-down-3tlYNJqZ.js +0 -1
  40. package/public/assets/chevron-right-kvaJRnfj.js +0 -1
  41. package/public/assets/client-B9t0CsmA.js +0 -46
  42. package/public/assets/dist-B8iuo_hI.js +0 -1
  43. package/public/assets/plus-CVqm87L-.js +0 -1
@@ -0,0 +1,141 @@
1
+ import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,o as d,p as f,s as p,u as m,v as h,x as g,y as _}from"./Rack-1lijWt5h.js";import{n as v}from"./Field-CUEEy19T.js";import*as y from"react";import{useEffect as b,useId as x,useLayoutEffect as S,useRef as C,useState as w}from"react";import{jsx as T,jsxs as E}from"react/jsx-runtime";import D from"styled-components";import*as O from"react-dom";var k={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};k.node;var A=c(k),j={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};j.node;var M=c(j),N={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};N.node;var P=c(N),F=Object.defineProperty,ee=(e,t)=>F(e,`name`,{value:t,configurable:!0});function te(e){let[t,n]=y.useState(void 0);return o(()=>{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}ee(te,`useSize`);var I=[`top`,`right`,`bottom`,`left`],L=Math.min,R=Math.max,z=Math.round,B=Math.floor,V=e=>({x:e,y:e}),ne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function re(e,t,n){return R(e,L(t,n))}function H(e,t){return typeof e==`function`?e(t):e}function U(e){return e.split(`-`)[0]}function W(e){return e.split(`-`)[1]}function ie(e){return e===`x`?`y`:`x`}function ae(e){return e===`y`?`height`:`width`}function G(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function oe(e){return ie(G(e))}function se(e,t,n){n===void 0&&(n=!1);let r=W(e),i=oe(e),a=ae(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ge(o)),[o,ge(o)]}function ce(e){let t=ge(e);return[le(e),t,le(t)]}function le(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ue=[`left`,`right`],de=[`right`,`left`],fe=[`top`,`bottom`],pe=[`bottom`,`top`];function me(e,t,n){switch(e){case`top`:case`bottom`:return n?t?de:ue:t?ue:de;case`left`:case`right`:return t?fe:pe;default:return[]}}function he(e,t,n,r){let i=W(e),a=me(U(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(le)))),a}function ge(e){let t=U(e);return ne[t]+e.slice(t.length)}function _e(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ve(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_e(e)}function ye(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function be(e,t,n){let{reference:r,floating:i}=e,a=G(t),o=oe(t),s=ae(o),c=U(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=W(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=H(t,e),p=ve(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ye(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ye(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Se=50,Ce=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=be(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Se&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=be(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},we=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=H(e,t)||{};if(l==null)return{};let d=ve(u),f={x:n,y:r},p=oe(i),m=ae(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=L(d[_],T),D=L(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=re(E,k,O),j=!c.arrow&&W(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Te=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=H(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=U(r),_=G(o),v=U(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ge(o)]:ce(o)),x=p!==`none`;!d&&x&&b.push(...he(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=se(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===G(t)||T.every(e=>G(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=G(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ee(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function De(e){return I.some(t=>e[t]>=0)}var Oe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=H(e,t);switch(i){case`referenceHidden`:{let e=Ee(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:De(e)}}}case`escaped`:{let e=Ee(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:De(e)}}}default:return{}}}}},ke=new Set([`left`,`top`]);async function Ae(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=U(n),s=W(n),c=G(n)===`y`,l=ke.has(o)?-1:1,u=a&&c?-1:1,d=H(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var je=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ae(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Me=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=H(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=G(i),p=ie(f),m=u[p],h=u[f],g=(e,t)=>re(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ne=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=H(e,t),u={x:n,y:r},d=G(i),f=ie(d),p=u[f],m=u[d],h=H(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ke.has(U(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=H(e,t),c=await i.detectOverflow(t,s),l=U(n),u=W(n),d=G(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=L(p-c[m],g),y=L(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*R(c.left,c.right):S=p-2*R(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Fe(){return typeof window<`u`}function Ie(e){return Le(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((Le(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Le(e){return Fe()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return Fe()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return Fe()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Re(e){return!Fe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function ze(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Be(e){return/^(table|td|th)$/.test(Ie(e))}function Ve(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var He=/transform|translate|scale|rotate|perspective|filter/,Ue=/paint|layout|strict|content/,X=e=>!!e&&e!==`none`,We;function Ge(e){let t=J(e)?Z(e):e;return X(t.transform)||X(t.translate)||X(t.scale)||X(t.rotate)||X(t.perspective)||!qe()&&(X(t.backdropFilter)||X(t.filter))||He.test(t.willChange||``)||Ue.test(t.contain||``)}function Ke(e){let t=Xe(e);for(;Y(t)&&!Je(t);){if(Ge(t))return t;if(Ve(t))return null;t=Xe(t)}return null}function qe(){return We??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),We}function Je(e){return/^(html|body|#document)$/.test(Ie(e))}function Z(e){return K(e).getComputedStyle(e)}function Ye(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xe(e){if(Ie(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Re(e)&&e.host||q(e);return Re(t)?t.host:t}function Ze(e){let t=Xe(e);return Je(t)?(e.ownerDocument||e).body:Y(t)&&ze(t)?t:Ze(t)}function Qe(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ze(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=$e(a);return t.concat(a,a.visualViewport||[],ze(r)?r:[],e&&n?Qe(e):[])}return t.concat(r,Qe(r,[],n))}function $e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function et(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=z(n)!==a||z(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function tt(e){return J(e)?e:e.contextElement}function nt(e){let t=tt(e);if(!Y(t))return V(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=et(t),o=(a?z(n.width):n.width)/r,s=(a?z(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rt=V(0);function it(e){let t=K(e);return!qe()||!t.visualViewport?rt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function at(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function ot(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=tt(e),o=V(1);t&&(r?J(r)&&(o=nt(r)):o=nt(e));let s=at(a,n,r)?it(a):V(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=K(a),t=J(r)?K(r):r,n=e,i=$e(n);for(;i&&t!==n;){let e=nt(i),t=i.getBoundingClientRect(),r=Z(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=$e(n)}}return ye({width:u,height:d,x:c,y:l})}function st(e,t){let n=Ye(e).scrollLeft;return t?t.left+n:ot(q(e)).left+n}function ct(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-st(e,n),y:n.top+t.scrollTop}}function lt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?Ve(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=V(1),u=V(0),d=Y(r);if((d||!a)&&((Ie(r)!==`body`||ze(o))&&(c=Ye(r)),d)){let e=ot(r);l=nt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ct(o,c):V(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ut(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dt(e){let t=Ye(e),n=e.ownerDocument.body,r=R(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=R(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+st(e),o=-t.scrollTop;return Z(n).direction===`rtl`&&(a+=R(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ft=25;function pt(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=K(e),a=q(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qe()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(st(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ft&&(s-=o)}return{width:s,height:c,x:l,y:u}}function mt(e,t){let n=ot(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=nt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ht(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=pt(e,n,t);else if(t===`document`)r=dt(q(e));else if(J(t))r=mt(t,n);else{let n=it(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ye(r)}function gt(e,t){let n=t.get(e);if(n)return n;let r=Qe(e,[],!1).filter(e=>J(e)&&Ie(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?Xe(e):e;for(;J(o)&&!Je(o);){let e=Z(o),t=Ge(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Xe(o)}return t.set(e,r),r}function _t(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ve(t)?[]:gt(t,this._c):[].concat(n),r],o=ht(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ht(t,a[e],i);s=R(n.top,s),c=L(n.right,c),l=L(n.bottom,l),u=R(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vt(e){let{width:t,height:n}=et(e);return{width:t,height:n}}function yt(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=ot(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=V(0);if((r||!a)&&((Ie(t)!==`body`||ze(i))&&(s=Ye(t)),r)){let e=ot(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=st(i));let l=i&&!r&&!a?ct(i,s):V(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function bt(e){return Z(e).position===`static`}function xt(e,t){if(!Y(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function St(e,t){let n=K(e);if(Ve(e))return n;if(!Y(e)){let t=Xe(e);for(;t&&!Je(t);){if(J(t)&&!bt(t))return t;t=Xe(t)}return n}let r=xt(e,t);for(;r&&Be(r)&&bt(r);)r=xt(r,t);return r&&Je(r)&&bt(r)&&!Ge(r)?n:r||Ke(e)||n}var Ct=async function(e){let t=this.getOffsetParent||St,n=this.getDimensions,r=await n(e.floating);return{reference:yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wt(e){return Z(e).direction===`rtl`}var Tt={convertOffsetParentRelativeRectToViewportRelativeRect:lt,getDocumentElement:q,getClippingRect:_t,getOffsetParent:St,getElementRects:Ct,getClientRects:ut,getDimensions:vt,getScale:nt,isElement:J,isRTL:wt};function Et(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dt(e,t,n){let r=null,i,a=q(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=B(d),h=B(a.clientWidth-(u+f)),g=B(a.clientHeight-(d+p)),_=B(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:R(0,L(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Et(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=K(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ot(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=tt(e),u=i||a?[...l?Qe(l):[],...t?Qe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Dt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ot(e):null;c&&g();function g(){let t=ot(e);h&&!Et(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var kt=je,At=Me,jt=Te,Mt=Pe,Nt=Oe,Pt=we,Ft=Ne,It=(e,t,n)=>{let r=new Map,i=n??{},a={...Tt,...i.platform,_c:r};return Ce(e,t,{...i,platform:a})},Lt=typeof document<`u`?S:function(){};function Rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Rt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){let n=zt(e);return Math.round(t*n)/n}function Vt(e){let t=y.useRef(e);return Lt(()=>{t.current=e}),t}function Ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);Rt(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,D=Vt(c),k=Vt(i),A=Vt(l),j=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),It(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Rt(T.current,t)&&(T.current=t,O.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Lt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=y.useRef(!1);Lt(()=>(M.current=!0,()=>{M.current=!1}),[]),Lt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,j);j()}},[x,S,j,D,E]);let N=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),P=y.useMemo(()=>({reference:x,floating:S}),[x,S]),F=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Bt(P.floating,u.x),r=Bt(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Ut=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Pt({element:r.current,padding:i}).fn(n):r?Pt({element:r,padding:i}).fn(n):{}}}},Wt=(e,t)=>{let n=kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=At(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>({fn:Ft(e).fn,options:[e,t]}),qt=(e,t)=>{let n=jt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=(e,t)=>{let n=Mt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yt=(e,t)=>{let n=Nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xt=(e,t)=>{let n=Ut(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zt=Object.defineProperty,Q=(e,t)=>Zt(e,`name`,{value:t,configurable:!0}),Qt=`Popper`,[$t,en]=h(Qt),[tn,nn]=$t(Qt),rn=Q(e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null),[a,o]=y.useState(void 0);return T(tn,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),an=`PopperAnchor`,on=y.forwardRef(Q(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=nn(an,n),o=y.useRef(null),s=a.onAnchorChange,c=y.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=g(t,c),u=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&pn(a.placementState),f=d?.[0],p=d?.[1];return r?null:T(_.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),sn=`PopperContent`,[cn,ln]=$t(sn),un=y.forwardRef(Q(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:v,...b}=e,x=nn(sn,n),[S,C]=y.useState(null),w=g(t,C),[E,D]=y.useState(null),O=te(E),k=O?.width??0,A=O?.height??0,j=r+(s===`center`?``:`-`+s),M=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(d)?d:[d],P=N.length>0,F={padding:M,boundary:N.filter(dn),altBoundary:P},{refs:ee,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=Ht({strategy:`fixed`,placement:j,whileElementsMounted:Q((...e)=>Ot(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:x.anchor},middleware:[Wt({mainAxis:i+A,alignmentAxis:c}),u&&Gt({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Kt():void 0,...F}),u&&qt({...F}),Jt({...F,apply:Q(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),E&&Xt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:A}),m&&Yt({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),B=x.setPlacementState;o(()=>(B(L),()=>{B(void 0)}),[L,B]);let[V,ne]=pn(L),re=a(v);o(()=>{R&&re?.()},[R,re]);let H=z.arrow?.x,U=z.arrow?.y,W=z.arrow?.centerOffset!==0,[ie,ae]=y.useState();return o(()=>{S&&ae(window.getComputedStyle(S).zIndex)},[S]),T(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:T(cn,{scope:n,placedSide:V,placedAlign:ne,onArrowChange:D,arrowX:H,arrowY:U,shouldHideArrow:W,children:T(_.div,{"data-side":V,"data-align":ne,...b,ref:w,style:{...b.style,animation:R?b.style?.animation:`none`}})})})},`PopperContent`));function dn(e){return e!==null}Q(dn,`isNotNull`);var fn=Q(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Q(pn,`getSideAndAlignFromPlacement`);var mn=rn,hn=on,gn=un,_n=Object.defineProperty,$=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),vn=`Popover`,[yn,bn]=h(vn,[en]),xn=en(),[Sn,Cn]=yn(vn),wn=$(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,c=xn(t),l=y.useRef(null),[u,d]=y.useState(!1),[p,m]=s({prop:r,defaultProp:i??!1,onChange:a,caller:vn});return T(mn,{...c,children:T(Sn,{scope:t,contentId:f(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:y.useCallback(()=>d(!1),[]),modal:o,children:n})})},`Popover`),Tn=`PopoverAnchor`,En=y.forwardRef($(function(e,t){let{__scopePopover:n,...r}=e,i=Cn(Tn,n),a=xn(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return y.useEffect(()=>(o(),()=>s()),[o,s]),T(hn,{...a,...r,ref:t})},`PopoverAnchor`)),Dn=`PopoverTrigger`,On=y.forwardRef($(function(t,n){let{__scopePopover:r,...i}=t,a=Cn(Dn,r),o=xn(r),s=g(n,a.triggerRef),c=T(_.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":zn(a.open),...i,ref:s,onClick:e(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:T(hn,{asChild:!0,...o,children:c})},`PopoverTrigger`)),kn=`PopoverPortal`,[An,jn]=yn(kn,{forceMount:void 0}),Mn=$(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cn(kn,t);return T(An,{scope:t,forceMount:n,children:T(u,{present:n||a.open,children:T(l,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Nn=`PopoverContent`,Pn=y.forwardRef($(function(e,t){let n=jn(Nn,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cn(Nn,e.__scopePopover);return T(u,{present:r||a.open,children:a.modal?T(In,{...i,ref:t}):T(Ln,{...i,ref:t})})},`PopoverContent`)),Fn=n(`PopoverContent.RemoveScroll`),In=y.forwardRef($(function(t,n){let r=Cn(Nn,t.__scopePopover),i=y.useRef(null),a=g(n,i),o=y.useRef(!1);return y.useEffect(()=>{let e=i.current;if(e)return d(e)},[]),T(p,{as:Fn,allowPinchZoom:!0,children:T(Rn,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:e(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:e(t.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:e(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Ln=y.forwardRef($(function(e,t){let n=Cn(Nn,e.__scopePopover),r=y.useRef(!1),i=y.useRef(!1);return T(Rn,{...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()}})},`PopoverContentNonModal`)),Rn=y.forwardRef($(function(e,t){let{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...p}=e,h=Cn(Nn,n),g=xn(n);return r(),T(m,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:T(i,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:T(gn,{"data-state":zn(h.open),role:`dialog`,id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function zn(e){return e?`open`:`closed`}$(zn,`getState`);var Bn=wn,Vn=En,Hn=On,Un=Mn,Wn=Pn;function Gn(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.label.toLowerCase().includes(n)||e.value.toLowerCase().includes(n)||(e.detail?.toLowerCase().includes(n)??!1))}var Kn=8,qn=D(Hn)`
2
+ display: flex;
3
+ align-items: center;
4
+ gap: ${({theme:e})=>e.space(2)};
5
+ width: 100%;
6
+ min-width: 0;
7
+ height: 30px;
8
+ padding: 0 8px;
9
+ border-radius: ${({theme:e})=>e.radius.control};
10
+ background: ${({theme:e})=>e.color.panelSunk};
11
+ border: 1px solid ${({theme:e})=>e.color.ruleStrong};
12
+ color: ${({theme:e})=>e.color.ink};
13
+ font-family: ${({theme:e})=>e.font.mono};
14
+ font-size: 12px;
15
+ text-align: left;
16
+ cursor: pointer;
17
+ transition: border-color 120ms ease;
18
+
19
+ &:hover:not(:disabled),
20
+ &[data-state="open"] {
21
+ border-color: ${({theme:e})=>e.color.accent};
22
+ }
23
+
24
+ &:disabled {
25
+ opacity: 0.5;
26
+ cursor: default;
27
+ }
28
+
29
+ svg {
30
+ width: 13px;
31
+ height: 13px;
32
+ margin-left: auto;
33
+ color: ${({theme:e})=>e.color.inkDim};
34
+ transition: transform 120ms ease;
35
+ }
36
+
37
+ &[data-state="open"] svg {
38
+ transform: rotate(180deg);
39
+ }
40
+ `,Jn=D.span`
41
+ min-width: 0;
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
44
+ white-space: nowrap;
45
+ color: ${({theme:e,$placeholder:t})=>t?e.color.inkFaint:`inherit`};
46
+ `,Yn=D(Wn)`
47
+ z-index: ${({theme:e})=>e.z.dialog};
48
+ display: flex;
49
+ flex-direction: column;
50
+ min-width: var(--radix-popover-trigger-width);
51
+ max-width: min(480px, calc(100vw - 16px));
52
+ max-height: min(320px, var(--radix-popover-content-available-height));
53
+ background: ${({theme:e})=>e.color.panel};
54
+ border: 1px solid ${({theme:e})=>e.color.ruleStrong};
55
+ border-radius: ${({theme:e})=>e.radius.panel};
56
+ box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
57
+ overflow: hidden;
58
+ `,Xn=D.div`
59
+ display: flex;
60
+ align-items: center;
61
+ gap: ${({theme:e})=>e.space(2)};
62
+ padding: 0 8px;
63
+ border-bottom: 1px solid ${({theme:e})=>e.color.rule};
64
+ background: ${({theme:e})=>e.color.panelSunk};
65
+
66
+ svg {
67
+ width: 12px;
68
+ height: 12px;
69
+ flex: none;
70
+ color: ${({theme:e})=>e.color.inkFaint};
71
+ }
72
+
73
+ input {
74
+ flex: 1;
75
+ min-width: 0;
76
+ height: 30px;
77
+ border: 0;
78
+ outline: none;
79
+ background: transparent;
80
+ color: ${({theme:e})=>e.color.ink};
81
+ font-family: ${({theme:e})=>e.font.mono};
82
+ font-size: 12px;
83
+
84
+ &::placeholder {
85
+ color: ${({theme:e})=>e.color.inkFaint};
86
+ font-family: ${({theme:e})=>e.font.sans};
87
+ }
88
+ }
89
+ `,Zn=D.div`
90
+ display: flex;
91
+ flex-direction: column;
92
+ gap: 1px;
93
+ padding: ${({theme:e})=>e.space(1)};
94
+ overflow-y: auto;
95
+ outline: none;
96
+ `,Qn=D.div`
97
+ display: flex;
98
+ align-items: center;
99
+ gap: ${({theme:e})=>e.space(2)};
100
+ min-height: 26px;
101
+ padding: 4px 8px;
102
+ border-radius: ${({theme:e})=>e.radius.chip};
103
+ font-family: ${({theme:e})=>e.font.mono};
104
+ font-size: 12px;
105
+ color: ${({theme:e})=>e.color.ink};
106
+ cursor: pointer;
107
+ user-select: none;
108
+
109
+ &[data-active="true"] {
110
+ background: ${({theme:e})=>e.color.panelRaised};
111
+ }
112
+
113
+ &[aria-selected="true"] {
114
+ color: ${({theme:e})=>e.color.accent};
115
+ }
116
+
117
+ > span:first-child {
118
+ min-width: 0;
119
+ overflow: hidden;
120
+ text-overflow: ellipsis;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ svg {
125
+ width: 12px;
126
+ height: 12px;
127
+ flex: none;
128
+ margin-left: auto;
129
+ }
130
+ `,$n=D.span`
131
+ margin-left: auto;
132
+ padding-left: ${({theme:e})=>e.space(3)};
133
+ font-family: ${({theme:e})=>e.font.sans};
134
+ font-size: 11px;
135
+ color: ${({theme:e})=>e.color.inkFaint};
136
+ white-space: nowrap;
137
+ `,er=D.p`
138
+ padding: 6px 8px;
139
+ font-size: 11px;
140
+ color: ${({theme:e})=>e.color.inkFaint};
141
+ `;function tr(e,t,n){let r=n-1;switch(e){case`ArrowDown`:return Math.min(t+1,r);case`ArrowUp`:return Math.max(t-1,0);case`Home`:return 0;case`End`:return r;case`PageDown`:return Math.min(t+8,r);case`PageUp`:return Math.max(t-8,0);default:return null}}var nr=`a[href], button, input, select, textarea, [tabindex]`;function rr(e,t,n,r,i){let a=[...t.querySelectorAll(nr)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [type='hidden']`)&&t.closest(`[hidden], [inert]`)===null&&!(n?.contains(t)??!1)&&(t.checkVisibility?.()??!0)),o=a.indexOf(e);if(o<0)return null;let s=r?o-1:o+1;if(!i)return a[s]??null;let c=a[(s+a.length)%a.length];return c===e?null:c??null}function ir(e,t,n){b(()=>{n&&e!==null&&e.querySelector(`[data-index="${t}"]`)?.scrollIntoView?.({block:`nearest`})},[e,t,n])}function ar({id:e,options:t,active:n,selected:r,onHover:i,onPick:a,empty:o}){return t.length===0?T(er,{children:o}):t.map((t,o)=>E(Qn,{id:`${e}-${o}`,role:`option`,"data-value":t.value,"data-index":o,"data-active":o===n,"aria-selected":t.value===r,onPointerMove:()=>i(o),onMouseDown:e=>e.preventDefault(),onClick:()=>a(t),children:[T(`span`,{children:t.label}),t.detail===void 0?null:T($n,{children:t.detail}),t.value===r?T(A,{"aria-hidden":!0}):null]},t.value))}function or({value:e,options:n,onValueChange:r,id:i,className:a,disabled:o,placeholder:s,"aria-label":c,"aria-describedby":l}){let u=x(),d=x(),f=i??d,p=t(),m=String(e),h=n.find(e=>e.value===m),g=n.length>=Kn,[_,v]=w(!1),[y,S]=w(``),[D,O]=w(0),[k,A]=w(null),j=C(null),N=C(null),F=C(null),ee=C({text:``,at:0}),te=C(!1),I=g?Gn(n,y):n,L=Math.min(D,I.length-1);ir(k,L,_),b(()=>{if(!_)return;let e=g?j.current:k;e!==null&&document.activeElement!==e&&e.focus()},[_,g,k]);let R=e=>Math.max(n.findIndex(t=>t.value===e),0),z=e=>{S(e),O(e===``?R(m):0),v(!0)},B=e=>{v(!1),e.value!==m&&r(e.value)},V=(e,t)=>{let r=Date.now(),i=r-ee.current.at>=600?e:ee.current.text+e;ee.current={text:i,at:r};let a=i.toLowerCase(),o=[...a].every(e=>e===a[0]),s=o?a[0]:a;if(s===void 0)return null;let c=o?t+1:t,l=e=>e.label.toLowerCase().startsWith(s),u=n.findIndex((e,t)=>t>=c&&l(e)),d=u>=0?u:n.findIndex(l);return d>=0?d:null},ne=e=>{let t=N.current,n=t===null?null:rr(t,p??document,F.current,e,p!==null);v(!1),n!==null&&(te.current=!0,n.focus())},re=e=>{let t=tr(e.key,L,I.length);if(t!==null){e.preventDefault(),O(t);return}if(e.key===`Enter`||e.key===` `&&!g){e.preventDefault();let t=I[L];t!==void 0&&B(t);return}if(e.key===`Tab`){e.preventDefault(),ne(e.shiftKey);return}if(!g&&e.key.length===1&&!e.ctrlKey&&!e.metaKey){let t=V(e.key,L);t!==null&&O(t)}};return E(Bn,{open:_,onOpenChange:e=>{e?z(``):v(!1)},children:[E(qn,{ref:N,type:`button`,role:`combobox`,id:f,value:m,className:a,disabled:o,"aria-label":c,"aria-describedby":l,"aria-haspopup":`listbox`,"aria-expanded":_,"aria-controls":_?u:void 0,onKeyDown:e=>{if(!_){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),z(``);return}if(e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey){if(e.preventDefault(),g){z(e.key);return}z(``);let t=V(e.key,R(m));t!==null&&O(t)}}},children:[T(Jn,{$placeholder:h===void 0&&m===``,children:h?.label??(m===``?s??``:m)}),T(M,{"aria-hidden":!0})]}),T(Un,{container:p??void 0,children:E(Yn,{ref:F,role:`presentation`,align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),(g?j.current:k)?.focus()},onCloseAutoFocus:e=>{te.current&&(te.current=!1,e.preventDefault())},children:[g?E(Xn,{children:[T(P,{"aria-hidden":!0}),T(`input`,{ref:j,type:`text`,value:y,placeholder:`Filter…`,role:`combobox`,"aria-label":`Filter options`,"aria-expanded":!0,"aria-autocomplete":`list`,"aria-controls":u,"aria-activedescendant":L>=0?`${u}-${L}`:void 0,autoComplete:`off`,spellCheck:!1,onChange:e=>{S(e.target.value),O(0)},onKeyDown:re})]}):null,T(Zn,{ref:A,id:u,role:`listbox`,tabIndex:g?void 0:-1,"aria-labelledby":f,"aria-activedescendant":!g&&L>=0?`${u}-${L}`:void 0,onKeyDown:g?void 0:re,children:T(ar,{id:u,options:I,active:L,selected:m,onHover:O,onPick:B,empty:n.length===0?`Nothing to choose from.`:`No match.`})})]})})]})}function sr({value:e,onValueChange:n,suggestions:r,id:i,placeholder:a,disabled:o,"aria-label":s,"aria-describedby":c}){let l=x(),u=x(),d=i??u,f=t(),p=C(null),[m,h]=w(!1),[g,_]=w(!1),[y,b]=w(-1),[S,D]=w(null),O=g?Gn(r,e):r,k=m&&!o&&O.length>0,A=y<O.length?y:-1;ir(S,A,k);let j=()=>{_(!1),b(-1),h(!0)},M=t=>{h(!1),_(!1),t.value!==e&&n(t.value)};return E(Bn,{open:k,onOpenChange:e=>{e||h(!1)},children:[T(Vn,{asChild:!0,children:T(v,{ref:p,id:d,type:`text`,role:`combobox`,value:e,placeholder:a,disabled:o,autoComplete:`off`,spellCheck:!1,"aria-label":s,"aria-describedby":c,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":k?l:void 0,"aria-activedescendant":k&&A>=0?`${l}-${A}`:void 0,onClick:()=>{m||j()},onChange:e=>{n(e.target.value),_(!0),b(-1),h(!0)},onBlur:()=>h(!1),onKeyDown:e=>{if(!k){e.key===`ArrowDown`&&(e.preventDefault(),j());return}let t=tr(e.key,A,O.length);if(t!==null&&e.key!==`Home`&&e.key!==`End`){e.preventDefault(),b(t);return}if(e.key===`Enter`&&A>=0){e.preventDefault();let t=O[A];t!==void 0&&M(t);return}e.key===`Tab`&&h(!1)}})}),T(Un,{container:f??void 0,children:T(Yn,{role:`presentation`,align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target===p.current&&e.preventDefault()},children:T(Zn,{ref:D,id:l,role:`listbox`,"aria-labelledby":d,children:T(ar,{id:l,options:O,active:A,selected:e,onHover:b,onPick:M,empty:null})})})})]})}export{Bn as a,M as c,Un as i,A as l,or as n,Hn as o,Wn as r,te as s,sr as t};
@@ -1,4 +1,4 @@
1
- import{S as e,h as t,x as n}from"./shared-HVgLEGgl.js";import{I as r,L as i,N as a,z as o}from"./Lamp-CL0i4yaa.js";import{S as s,a as c,k as l,o as u,r as d,s as f}from"./Panel-CsovmtxF.js";import{S as p}from"./Rack-DMrfn4-H.js";import{t as m}from"./Readout-DlT5oxGO.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(d,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(f,{rows:4}):s?h(c,{legend:o.legend,message:o.message}):l})}var y=_(l)`
1
+ import{S as e,h as t,x as n}from"./shared-HVgLEGgl.js";import{I as r,L as i,N as a,z as o}from"./Lamp-CL0i4yaa.js";import{S as s,a as c,k as l,o as u,r as d,s as f}from"./Panel-CsovmtxF.js";import{C as p}from"./Rack-1lijWt5h.js";import{t as m}from"./Readout-DlT5oxGO.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(d,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(f,{rows:4}):s?h(c,{legend:o.legend,message:o.message}):l})}var y=_(l)`
2
2
  border-color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.ruleStrong};
3
3
  color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.inkDim};
4
4
  background: ${({theme:e,$on:t})=>t?e.color.accentWash:e.color.panelRaised};
@@ -0,0 +1,39 @@
1
+ import{_ as e,h as t,v as n,x as r,y as i}from"./Rack-1lijWt5h.js";import{s as a}from"./Select-C0c13SKD.js";import*as o from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0}),p=`Switch`,[m,h]=n(p),[g,_]=m(p);function v(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:a,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:m=`on`,internal_do_not_use_render:h}=e,[_,v]=t({prop:r,defaultProp:a??!1,onChange:d,caller:p}),[y,b]=o.useState(null),[x,S]=o.useState(null),C=o.useRef(!1),[w,T]=o.useReducer(e=>e+1,0),D={checked:_,setChecked:v,disabled:s,control:y,setControl:b,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:a,isFormControl:!y||!!l||!!y.closest(`form`),bubbleInput:x,setBubbleInput:S};return c(g,{scope:n,...D,children:E(h)?h(D):i})}f(v,`SwitchProvider`);var y=`SwitchTrigger`,b=o.forwardRef(f(function({__scopeSwitch:t,onClick:n,...a},s){let{control:l,form:u,value:d,disabled:p,checked:m,required:h,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,onUserInteraction:x,isFormControl:S,bubbleInput:C}=_(y,t),w=r(s,g),T=o.useRef(m);return o.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=f(()=>v(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[l,u,v]),c(i.button,{type:`button`,role:`switch`,"aria-checked":m,"aria-required":h,"data-state":D(m),"data-disabled":p?``:void 0,disabled:p,value:d,...a,ref:w,onClick:e(n,e=>{x(),v(e=>!e),C&&S&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})},`SwitchTrigger`)),x=o.forwardRef(f(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return c(v,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:u,required:o,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>l(s,{children:[c(b,{...m,ref:t,__scopeSwitch:n}),e&&c(T,{__scopeSwitch:n})]})})},`Switch`)),S=`SwitchThumb`,C=o.forwardRef(f(function(e,t){let{__scopeSwitch:n,...r}=e,a=_(S,n);return c(i.span,{"data-state":D(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),w=`SwitchBubbleInput`,T=o.forwardRef(f(function({__scopeSwitch:t,onClick:n,...s},l){let{control:u,hasConsumerStoppedPropagationRef:d,userInteractionCount:f,checked:p,defaultChecked:m,required:h,disabled:g,name:v,value:y,form:b,bubbleInput:x,setBubbleInput:S}=_(w,t),C=r(l,S),T=a(u),E=o.useRef(!1),D=o.useRef(p),O=o.useRef(f);o.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=f!==O.current;O.current=f;let i=D.current!==p;D.current=p;let a=!(r&&d.current);if(i&&n){E.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,p),e.dispatchEvent(t),E.current=!1}},[x,p,d,f]);let k=o.useRef(p);return c(i.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:v,value:y,form:b,...s,tabIndex:-1,ref:C,onClick:e(n,e=>{E.current&&e.stopPropagation()}),style:{...s.style,...T,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function E(e){return typeof e==`function`}f(E,`isFunction`);function D(e){return e?`checked`:`unchecked`}f(D,`getState`);var O=u(x)`
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
+ `,k=u(C)`
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 A({checked:e,onCheckedChange:t,label:n,disabled:r,id:i}){return c(O,{checked:e,onCheckedChange:t,"aria-label":n,...r===void 0?{}:{disabled:r},...i===void 0?{}:{id:i},children:c(k,{})})}export{A as t};
@@ -1,4 +1,4 @@
1
- import{N as e}from"./Lamp-CL0i4yaa.js";import{A as t,k as n}from"./Rack-DMrfn4-H.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};s.node;var c=t(s),l={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};l.node;var u=t(l),d=new Intl.NumberFormat(`en-US`);function f(e){return`${d.format(e.inputTokens)} input, ${d.format(e.outputTokens)} output, ${d.format(e.cacheReadTokens)} cache read, ${d.format(e.cacheWriteTokens)} cache write tokens`}var p=a.span`
1
+ import{N as e}from"./Lamp-CL0i4yaa.js";import{A as t,j as n}from"./Rack-1lijWt5h.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};s.node;var c=n(s),l={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};l.node;var u=n(l),d=new Intl.NumberFormat(`en-US`);function f(e){return`${d.format(e.inputTokens)} input, ${d.format(e.outputTokens)} output, ${d.format(e.cacheReadTokens)} cache read, ${d.format(e.cacheWriteTokens)} cache write tokens`}var p=a.span`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  flex-wrap: wrap;
@@ -29,4 +29,4 @@ import{N as e}from"./Lamp-CL0i4yaa.js";import{A as t,k as n}from"./Rack-DMrfn4-H
29
29
  @media (prefers-reduced-motion: reduce) {
30
30
  animation: none;
31
31
  }
32
- `;function _(){return i(`span`,{"aria-hidden":`true`,children:[`processing`,r(g,{children:`...`})]})}function v({tokens:t}){let a=f(t);return i(p,{role:`img`,"aria-label":a,title:a,children:[i(m,{"aria-hidden":`true`,children:[r(c,{}),e(t.inputTokens)]}),i(m,{"aria-hidden":`true`,children:[r(u,{}),e(t.outputTokens)]}),i(m,{"aria-hidden":`true`,children:[r(n,{}),r(c,{}),e(t.cacheReadTokens)]}),i(m,{"aria-hidden":`true`,children:[r(n,{}),r(u,{}),e(t.cacheWriteTokens)]})]})}export{v as n,f as r,_ as t};
32
+ `;function _(){return i(`span`,{"aria-hidden":`true`,children:[`processing`,r(g,{children:`...`})]})}function v({tokens:n}){let a=f(n);return i(p,{role:`img`,"aria-label":a,title:a,children:[i(m,{"aria-hidden":`true`,children:[r(c,{}),e(n.inputTokens)]}),i(m,{"aria-hidden":`true`,children:[r(u,{}),e(n.outputTokens)]}),i(m,{"aria-hidden":`true`,children:[r(t,{}),r(c,{}),e(n.cacheReadTokens)]}),i(m,{"aria-hidden":`true`,children:[r(t,{}),r(u,{}),e(n.cacheWriteTokens)]})]})}export{v as n,f as r,_ as t};
@@ -0,0 +1,70 @@
1
+ import{D as e,Ft as t,G as n,It as r,L as i,Lt as a,N as o,Pt as s,R as c,Zt as l,b as u,c as d,d as f,ft as p,gt as m,h,ht as g,jt as _,lt as ee,n as te,o as v,q as ne,rn as y,s as re,t as b,ut as ie,v as x,wt as ae,y as S,yt as C,zt as w}from"./Lamp-CL0i4yaa.js";import{A as T,C as E,S as D,T as O,a as oe,b as k,c as A,k as j,o as M,r as N,s as P,y as F}from"./Panel-CsovmtxF.js";import{O as I,T as L,i as se,j as R,r as z,t as ce}from"./Rack-1lijWt5h.js";import{c as le,n as B}from"./Select-C0c13SKD.js";import{t as ue}from"./chevron-right-ocqzquMZ.js";import{t as de}from"./CopyValue-CWSTp4v8.js";import{t as fe}from"./plus-D_lvSfDL.js";import{t as pe}from"./rotate-ccw-CwTftDdz.js";import{t as me}from"./trash-CmuxOGpN.js";import{t as he}from"./Toggle-BvVa_jla.js";import{t as ge}from"./Chip-B2iXmJJC.js";import{n as V,r as _e,t as H}from"./Field-CUEEy19T.js";import{t as ve}from"./Meter-stpt3vQu.js";import{i as ye,n as U,r as W,t as be}from"./Table-CVDZ69Zx.js";import{n as xe,r as Se,t as Ce}from"./WindowChart-CaPUJ4GJ.js";import{Fragment as we,useCallback as G,useEffect as K,useState as q}from"react";import{Fragment as Te,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var Ee={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Ee.node;var De=R(Ee),Z={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Z.node;var Oe=R(Z),Q={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Q.node;var ke=R(Q);function Ae(e){return e?.authTypes??[]}function je(e){return Ae(e).includes(`oauth`)?`oauth`:`apiKey`}function Me(e){return e[0]?.id??`anthropic`}var $={oauth:`Authorize in the browser`,apiKey:`Paste an API key`};function Ne(e){let t=e?.callback;return t===void 0?`code#state`:`${t.uri}?code=…`}var Pe=X.ol`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: ${({theme:e})=>e.space(3)};
5
+ `,Fe=X.div`
6
+ font-family: ${({theme:e})=>e.font.mono};
7
+ font-size: 26px;
8
+ letter-spacing: 0.22em;
9
+ text-align: center;
10
+ padding: ${({theme:e})=>e.space(3)};
11
+ background: ${({theme:e})=>e.color.panelSunk};
12
+ border: 1px solid ${({theme:e})=>e.color.ruleStrong};
13
+ border-radius: ${({theme:e})=>e.radius.control};
14
+ `,Ie=X.p`
15
+ font-size: 12px;
16
+ color: ${({theme:e})=>e.color.down};
17
+ `,Le=X.p`
18
+ font-size: 12px;
19
+ color: ${({theme:e})=>e.color.inkDim};
20
+ `;function Re({open:e,credentials:t,credential:r,onOpenChange:i,onConnected:a}){let o=s().data??[],[c,l]=q(()=>r?.provider??Me(o)),u=n(o,c),[d,f]=q(()=>r?.authType??je(n(o,r?.provider??Me(o)))),[m,h]=q(()=>r?.label??``);K(()=>{r&&(l(r.provider),f(r.authType),h(r.label))},[r]);let g=u?.label??c,[_,te]=q(null),[v,y]=q(``),[re,b]=q(``),x=(t??[]).filter((e,t,n)=>e.provider===`custom`&&n.findIndex(t=>t.provider===`custom`&&t.providerData.endpointId===e.providerData.endpointId)===t),[ae,S]=q(``),[C,w]=q(``),[T,E]=q(`chat_completions`),[oe,k]=q(``),[M,N]=q(null),P=ie(),I=ee(),L=p(),R=G(()=>{te(null),y(``),b(``),S(``),w(``),E(`chat_completions`),k(``),N(null),h(``),P.reset(),I.reset(),L.reset()},[P,I,L]),z=G(e=>{e||R(),i(e)},[i,R]);return K(()=>{if(_===null||_.kind!==`device`)return;let e=!1,t=async()=>{try{let t=await ne(_.flowId);if(e)return;if(t.status===`complete`){R(),i(!1),a();return}}catch(t){if(e)return;N(A(t)),te(null);return}e||(n=setTimeout(()=>void t(),_.pollIntervalMs))},n=setTimeout(()=>void t(),_.pollIntervalMs);return()=>{e=!0,clearTimeout(n)}},[_,a,i,R]),J(se,{open:e,onOpenChange:z,title:r?`Reconnect ${r.label}`:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:_===null?Y(Te,{children:[J(j,{type:`button`,onClick:()=>z(!1),children:`Cancel`}),J(j,{type:`button`,$variant:`primary`,disabled:P.isPending||L.isPending,onClick:()=>{if(N(null),d===`apiKey`){L.mutate({provider:c,apiKey:oe,label:m.trim()||void 0,...c===`custom`?{endpointId:re,endpointLabel:ae,origin:C,protocol:T}:{}},{onSuccess:()=>{R(),i(!1),a()},onError:e=>N(A(e))});return}P.mutate({provider:c,label:m.trim().length===0?g:m.trim(),...r?{credentialId:r.id}:{}},{onSuccess:e=>te(e),onError:e=>N(A(e))})},children:d===`apiKey`?L.isPending?`Adding…`:`Add API key`:P.isPending?`Starting…`:`Start authorization`})]}):_.kind===`device`?J(j,{type:`button`,onClick:()=>z(!1),children:`Cancel`}):Y(Te,{children:[J(j,{type:`button`,onClick:()=>z(!1),children:`Cancel`}),J(j,{type:`button`,$variant:`primary`,disabled:I.isPending||v.trim().length===0,onClick:()=>{_!==null&&(N(null),I.mutate({flowId:_.flowId,code:v.trim()},{onSuccess:()=>{R(),i(!1),a()},onError:e=>N(A(e))}))},children:I.isPending?`Finishing…`:`Finish connecting`})]}),children:Y(Pe,{children:[_===null?Y(O,{$gap:3,children:[r?null:J(H,{label:`Provider`,children:e=>J(B,{...e,value:c,options:o.map(e=>({value:e.id,label:e.label})),onValueChange:e=>{let t=e;l(t),f(je(n(o,t)))}})}),r?null:Ae(u).length>1?J(H,{label:`How to connect`,children:e=>J(B,{...e,value:d,options:Ae(u).map(e=>({value:e,label:$[e]})),onValueChange:e=>f(e)})}):null,c===`custom`?Y(Te,{children:[x.length===0?null:J(H,{label:`Existing endpoint`,children:e=>J(B,{...e,value:re,options:[{value:``,label:`Create new endpoint`},...x.map(e=>({value:String(e.providerData.endpointId),label:String(e.providerData.endpointLabel)}))],onValueChange:e=>{let t=x.find(t=>t.providerData.endpointId===e);if(t===void 0){b(``),S(``),w(``),E(`chat_completions`);return}b(String(t.providerData.endpointId)),S(String(t.providerData.endpointLabel)),w(String(t.providerData.origin)+String(t.providerData.basePath??``)),E(t.providerData.protocol===`responses`?`responses`:`chat_completions`)}})}),J(H,{label:`Endpoint ID`,children:e=>J(V,{...e,value:re,onChange:e=>b(e.target.value)})}),J(H,{label:`Endpoint label`,children:e=>J(V,{...e,value:ae,onChange:e=>S(e.target.value)})}),J(H,{label:`Server URL`,children:e=>J(V,{...e,value:C,placeholder:`https://server.example/api`,onChange:e=>w(e.target.value)})}),C.trim().toLowerCase().startsWith(`http://`)?J(Ie,{children:`Plaintext transport sends prompts and API keys without TLS.`}):null,J(H,{label:`Protocol`,children:e=>J(B,{...e,value:T,options:[{value:`chat_completions`,label:`Chat Completions (/v1/chat/completions)`},{value:`responses`,label:`Responses (/v1/responses)`}],onValueChange:e=>E(e)})})]}):null,d===`apiKey`?J(H,{label:`API key`,children:e=>J(V,{...e,type:`password`,value:oe,autoComplete:`off`,onChange:e=>k(e.target.value)})}):null,J(H,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>J(V,{...e,value:m,placeholder:g,onChange:e=>h(e.target.value)})})]}):Y(O,{$gap:3,children:[Y(O,{$gap:1,children:[J(F,{children:`Step 1 — authorize`}),J(D,{$gap:2,children:Y(j,{as:`a`,href:_.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[J(De,{}),`Open `,g]})}),J(de,{value:_.authorizeUrl,label:`Copy authorization link`})]}),_.userCode===null?null:Y(O,{$gap:1,children:[J(F,{children:`Step 2 — enter this code`}),J(Fe,{children:_.userCode})]}),_.kind===`device`?Y(Le,{children:[u?.pasteHint??``,` Waiting for authorization…`]}):J(H,{label:`Authorization code`,hint:u?.pasteHint??``,...M===null?{}:{problem:M},children:e=>J(V,{...e,value:v,autoFocus:!0,placeholder:Ne(u),onChange:e=>y(e.target.value)})})]}),M===null||_?.kind===`pkce`?null:J(Ie,{children:M})]})})}function ze({credentialId:e,windows:n,burn:r,pollIntervalMs:i,now:a}){let o=n.map(e=>({window:e,estimate:v(r,e.windowType),since:Se(u(e))})),s=o.map(e=>e.since).filter(e=>e!==null),c=s.length===0?0:Math.min(...s),l=t({credentialId:e,since:c},s.length>0),d=l.data?.samples??[],f=l.data?.gatewayRates??[],p=l.data?.truncated===!0;return J(O,{$gap:4,children:o.map(e=>J(Be,{window:e.window,estimate:e.estimate,since:e.since,samples:d.filter(t=>t.windowType===e.window.windowType&&t.observedAt>=(e.since??0)),gatewayRate:f.find(t=>t.windowType===e.window.windowType),truncated:p,pollIntervalMs:i,now:a},e.window.windowType))})}function Be({window:t,estimate:n,since:r,samples:i,gatewayRate:a,truncated:s,pollIntervalMs:c,now:l}){let d=t.limit===null?`${o(t.used)} used`:`${o(t.used)} of ${o(t.limit)} used`,p=e(t,l),m=n===void 0||f(t,l,c)||n.stale&&!p;return J(xe,{live:u(t),samples:i.map(u),since:r,now:l,truncated:s&&r!==null&&i.length>0&&(i[0]?.observedAt??0)>r,ratePerHourRatio:S(t,n),exhaustsAt:n?.exhaustsAt??null,survives:n?.survives??null,stale:m,rolledOver:p,spent:d,rateText:n?.ratePerHour===void 0||n.ratePerHour===null?`unknown`:`${o(n.ratePerHour)}/h`,extraFact:J(Ce,{legend:`This gateway accounts for`,value:a?.gatewayRatePerHour===void 0||a.gatewayRatePerHour===null?`unknown`:`${o(a.gatewayRatePerHour)} tokens/h`})})}function Ve({credential:e,busy:t,onOpenChange:n,onConfirm:r}){let i=w(e?.id??null),a=Date.now(),o=(i.data?.credits??[]).filter(e=>e.status===`available`).sort((e,t)=>(e.expiresAt??1/0)-(t.expiresAt??1/0))[0],s=i.isError||i.isFetching?0:i.data?.available??0,l=e===null?``:i.isFetching?`Reading the reset credits this account holds…`:i.isError?`Could not read reset credits for "${e.label}".`:s===0?`"${e.label}" has no reset credits available.`:`Spend one of ${s} reset ${s===1?`credit`:`credits`} on "${e.label}"? Its usage windows go back to zero at the provider, and the credit cannot be returned.`+(o?.expiresAt==null?``:` The credit spent is the one expiring soonest (${c(o.expiresAt,a)}).`);return J(z,{open:e!==null,onOpenChange:n,title:`Reset quota`,body:l,confirmLabel:`Spend reset`,busy:t||o===void 0||s===0,onConfirm:()=>{e!==null&&o!==void 0&&s>0&&r(e,o.id)}})}var He=X(N)`
21
+ border-left: 3px solid ${({$provider:e})=>L(e)};
22
+ `,Ue=X(V)`
23
+ width: 100%;
24
+ min-width: 140px;
25
+ height: 26px;
26
+ font-family: ${({theme:e})=>e.font.sans};
27
+ font-size: 12.5px;
28
+ background: transparent;
29
+ border-color: transparent;
30
+
31
+ &:hover:not(:disabled),
32
+ &:focus {
33
+ background: ${({theme:e})=>e.color.panelSunk};
34
+ border-color: ${({theme:e})=>e.color.ruleStrong};
35
+ }
36
+ `,We=X(_e)`
37
+ width: 62px;
38
+ height: 26px;
39
+ `,Ge=X.span`
40
+ display: block;
41
+ padding-left: 9px;
42
+ font-size: 11px;
43
+ color: ${({theme:e})=>e.color.inkDim};
44
+ `,Ke=X.div`
45
+ margin: 0 0 10px;
46
+ min-height: 16px;
47
+ font-size: 12px;
48
+ color: ${({theme:e})=>e.color.inkDim};
49
+ `,qe=X.p`
50
+ margin: 0;
51
+ `,Je=X.ul`
52
+ margin: 4px 0 0;
53
+ padding-left: 16px;
54
+ list-style: disc;
55
+ `,Ye=X.div`
56
+ display: grid;
57
+ /* Bar, figure, legend. The figure has a column of its own so the legends stay
58
+ aligned down the stack whether a window reads 4% or 100%. */
59
+ grid-template-columns: 96px 34px 1fr;
60
+ align-items: center;
61
+ min-width: 208px;
62
+ gap: 6px;
63
+ `,Xe=X(k)`
64
+ font-size: 11px;
65
+ text-align: right;
66
+ `,Ze=X.div`
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 4px;
70
+ `;function Qe(){let e=y();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function $e(e,t){if(t===void 0)return` The list of models could not be read, so whether any target is pinned to this account is unknown.`;let n=t.filter(t=>t.targets.some(t=>t.credentialId===e.id)).map(e=>e.id);return n.length===0?``:` ${n.length===1?`The model`:`The models`} ${n.join(`, `)} ${n.length===1?`pins a target`:`pin targets`} to this account. Those targets will fail rather than fall back to another account.`}function et(){let{cadence:e}=I(),t=m(),o=g(e(1e4,`res:credentials`)),u=l(),f=_(),p=s(),ee=C(),ne=a(),y=r(),[ie,S]=q(null),w=ae(),{commit:k}=Qe(),[A,L]=q(!1),[se,R]=q(null),[B,de]=q([]),[V,_e]=q(new Set),[H,xe]=q(!1),[Se,Ce]=q(null),[G,K]=q(null),[X,Ee]=q(new Set),De=e=>Ee(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),Z=t.data??[],Q=e=>Z.find(t=>t.id===e)?.label??e,Ae=e=>{let t=e[0];if(e.length===1&&t!==void 0){let e=Q(t.credentialId);return t.kind===`refreshed`||t.kind===`coalesced`?`Quota refreshed for ${e}.`:t.kind===`noData`?`No quota data reported for ${e}.`:t.kind===`cooldown`?`Quota refresh is cooling down for ${e}.`:t.kind===`unsupported`?`${e} does not report quota.`:t.kind===`disabled`?`${e} is disabled, so it was not probed.`:`Quota refresh failed for ${e}.`}let n=e.filter(e=>e.kind===`refreshed`||e.kind===`coalesced`).length,r=e.filter(e=>e.kind===`failed`).length,i=e.filter(e=>e.kind===`cooldown`).length,a=e.length-n-r-i;return[`Refreshed ${n} ${n===1?`account`:`accounts`}`,r===0?null:`${r} failed`,i===0?null:`${i} cooling down`,a===0?null:`${a} skipped`].filter(e=>e!==null).join(`; `).concat(`.`)},je=e=>e.filter(e=>e.kind===`failed`||e.kind===`cooldown`||e.kind===`noData`).map(e=>`${Q(e.credentialId)}: ${e.kind===`failed`?`failed`:e.kind===`cooldown`?`cooling down`:`no data reported`}`),Me=async e=>{R(null),de([]),e.kind===`all`?xe(!0):_e(t=>{let n=new Set(t);return n.add(e.credentialId),n});try{let t=await ne.mutateAsync(e);R(Ae(t.outcomes)),de(t.outcomes.length>1?je(t.outcomes):[])}catch{R(e.kind===`all`?`Quota refresh could not be started.`:`Quota refresh could not be started for ${Q(e.credentialId)}.`)}finally{xe(!1),e.kind===`one`&&_e(t=>{let n=new Set(t);return n.delete(e.credentialId),n})}},$=Date.now(),Ne=p.data??[],Pe=e=>n(Ne,e)?.order??1/0,Fe=[...new Set(Z.map(e=>e.provider))].sort((e,t)=>Pe(e)-Pe(t)),Ie=e=>n(Ne,e)?.label??e,Le=d(o.data?.health??[],e=>e.credentialId),Be=d(o.data?.quota??[],e=>e.credentialId),et=d(o.data?.burn??[],e=>e.credentialId),tt=u.data?.quotaPollIntervalMs??3e5,nt=Z.filter(e=>e.enabled).length,rt=t.isLoading?`Reading connected accounts…`:Z.length===0?`No provider credentials are connected, so every request fails at the router.`:`${nt} of ${Z.length} accounts are enabled and eligible for routing.`;return Y(Te,{children:[J(ce,{legend:`Accounts`,title:`Provider accounts`,summary:rt,actions:Y(D,{$gap:1,children:[w?Y(j,{type:`button`,$variant:`ghost`,disabled:H||V.size>0,onClick:()=>void Me({kind:`all`}),children:[J(ke,{}),H?`Refreshing quota…`:`Refresh all quota`]}):null,Y(j,{type:`button`,$variant:`primary`,onClick:()=>L(!0),children:[J(fe,{}),`Connect an account`]})]})}),Y(Ke,{children:[J(qe,{role:`status`,"aria-live":`polite`,children:se??``}),B.length===0?null:J(Je,{children:B.map(e=>J(`li`,{children:e},e))})]}),t.isError?J(N,{legend:`Accounts`,children:J(M,{error:t.error,onRetry:()=>void t.refetch()})}):t.isLoading?J(N,{legend:`Accounts`,children:J(P,{rows:5})}):Z.length===0?J(N,{legend:`Accounts`,children:J(oe,{legend:`Nothing connected`,message:`Connect a provider account to give the router something to dispatch to. Tokens are encrypted at rest and never shown again.`,action:J(j,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>L(!0),children:`Connect an account`})})}):J(O,{$gap:4,children:Fe.map(e=>{let t=Z.filter(t=>t.provider===e);return J(He,{$provider:e,legend:Ie(e),meta:`${t.length} account${t.length===1?``:`s`}`,flush:!0,children:J(E,{children:Y(be,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{$width:`24%`,children:`Account`}),J(W,{$width:`20%`,children:`Sign-in`}),J(W,{$align:`right`,$width:`86px`,children:`Tier`}),J(W,{$align:`right`,$width:`94px`,children:`Weight`}),J(W,{$align:`center`,$width:`86px`,children:`Enabled`}),J(W,{$width:`240px`,children:`Quota`}),J(W,{$align:`right`,$width:`130px`,children:`Token expires`}),J(W,{$width:`144px`})]})}),J(`tbody`,{children:t.map(e=>{let t=re(Le.get(e.id)??[],$,e.enabled,e.disabledReason),r=Be.get(e.id)??[],a=et.get(e.id)??[],o=x(r),s=X.has(e.id);return Y(we,{children:[Y(ye,{children:[Y(U,{children:[Y(D,{$gap:2,children:[J(b,{state:t.state,label:t.note===``?`healthy`:t.note}),J(Ue,{defaultValue:e.label,"aria-label":`Label for ${e.label}`,onBlur:t=>{let n=t.target.value.trim();if(n.length===0||n===e.label){t.target.value=e.label;return}k(e.id,{label:n})}})]}),t.note===``?null:J(Ge,{children:t.note})]}),J(U,{children:Y(D,{$gap:1,children:[J(ge,{children:e.authType===`oauth`?`oauth`:`api key`}),e.accountEmail===null?null:J(F,{children:e.accountEmail})]})}),J(U,{$align:`right`,children:J(We,{min:1,step:1,defaultValue:e.tier,"aria-label":`Tier for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isInteger(n)||n<1||n===e.tier){t.target.value=String(e.tier);return}k(e.id,{tier:n})}})}),J(U,{$align:`right`,children:J(We,{min:.1,step:.1,defaultValue:e.weight,"aria-label":`Weight for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isFinite(n)||n<=0||n===e.weight){t.target.value=String(e.weight);return}k(e.id,{weight:n})}})}),J(U,{$align:`center`,children:J(he,{checked:e.enabled,label:`Route to ${e.label}`,onCheckedChange:t=>k(e.id,{enabled:t})})}),J(U,{children:o.length===0?J(F,{children:`unknown`}):J(Ze,{children:o.map(({window:e,fraction:t})=>Y(Ye,{children:[J(ve,{fraction:t,label:`${te[e.windowType]} window, ${Math.round(t*100)}% used`}),J(Xe,{children:i(t,0)}),J(F,{children:h(e,$,tt,c,v(a,e.windowType))})]},e.windowType))})}),J(U,{$align:`right`,$mono:!0,children:e.expiresAt===null?`never`:c(e.expiresAt,$)}),J(U,{$align:`right`,children:Y(D,{$gap:1,$justify:`flex-end`,children:[r.length===0?null:J(T,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":s,"aria-label":`${s?`Hide`:`Show`} quota history for ${e.label}`,title:`${s?`Hide`:`Show`} quota history for ${e.label}`,onClick:()=>De(e.id),children:J(s?le:ue,{})}),w&&e.authType===`oauth`&&n(Ne,e.provider)?.quotaResets===!0?J(T,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Reset quota for ${e.label}`,title:`Reset quota for ${e.label}`,onClick:()=>S(e),children:J(pe,{})}):null,w&&e.authType===`oauth`?J(T,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Reconnect ${e.label}`,title:`Reconnect ${e.label}`,onClick:()=>Ce(e),children:J(Oe,{})}):null,w?J(T,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:H||V.has(e.id),"aria-label":V.has(e.id)?`Refreshing quota for ${e.label}`:`Refresh quota for ${e.label}`,title:`Refresh quota for ${e.label}`,onClick:()=>void Me({kind:`one`,credentialId:e.id}),children:J(ke,{})}):null,J(T,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${e.label}`,title:`Remove ${e.label}`,onClick:()=>K(e),children:J(me,{})})]})})]}),s?J(ye,{children:J(U,{colSpan:9,children:J(ze,{credentialId:e.id,windows:r,burn:a,pollIntervalMs:tt,now:$})})}):null]},e.id)})})]})})},e)})}),J(Re,{open:A||Se!==null,credentials:t.data??[],credential:Se,onOpenChange:e=>{e?L(!0):(L(!1),Ce(null))},onConnected:()=>void t.refetch()}),J(Ve,{credential:ie,busy:y.isPending,onOpenChange:e=>{e||S(null)},onConfirm:(e,t)=>{R(null),de([]),y.mutate({credentialId:e.id,creditId:t},{onSuccess:t=>R(t.quotaRefreshed?`Quota reset for ${e.label}.`:`Quota reset for ${e.label}; the meter updates at the next poll.`),onError:()=>R(`Quota reset failed for ${e.label}.`),onSettled:()=>S(null)})}}),J(z,{open:G!==null,onOpenChange:e=>{e||K(null)},title:`Remove account`,body:G===null?``:`Removing "${G.label}" deletes its stored token. Any model target pointing at ${Ie(G.provider)} loses this account, and reconnecting means authorizing again.`+$e(G,f.data),confirmLabel:`Remove account`,busy:ee.isPending,onConfirm:()=>{G!==null&&ee.mutate(G.id,{onSettled:()=>K(null)})}})]})}var tt=et;export{tt as component};
@@ -0,0 +1,24 @@
1
+ import{H as e,Mt as t,N as n,dt as r}from"./Lamp-CL0i4yaa.js";import{S as i,a,n as o,o as ee,s,t as c,x as l}from"./Panel-CsovmtxF.js";import{O as u,t as d}from"./Rack-1lijWt5h.js";import{n as f}from"./Select-C0c13SKD.js";import{a as p,c as m,o as h,s as g}from"./index-B9izdV6t.js";import{useQueryClient as te}from"@tanstack/react-query";import{useLayoutEffect as ne,useMemo as _,useRef as v,useState as y}from"react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import C from"styled-components";var w={debug:10,info:20,warn:30,error:40};function T(e){return typeof e==`string`&&e in w}function E(e,t){return!T(t)||e.level===null||w[e.level]>=w[t]}function D(e){if(typeof e!=`object`||!e)return null;let{raw:t,at:n,level:r,msg:i}=e;return typeof t!=`string`||n!==null&&typeof n!=`number`||r!==null&&!T(r)||i!==null&&typeof i!=`string`?null:{raw:t,at:n,level:r,msg:i}}function O(e){if(typeof e!=`object`||!e)return null;let{lines:t}=e;if(!Array.isArray(t))return null;let n=[];for(let e of t){let t=D(e);if(t===null)return null;n.push(t)}return n}var re=[100,200,500],ie=[{value:``,label:`All levels`},{value:`debug`,label:`Debug and above`},{value:`info`,label:`Info and above`},{value:`warn`,label:`Warnings and errors`},{value:`error`,label:`Errors only`}],ae=C(i)`
2
+ gap: ${({theme:e})=>e.space(2)};
3
+ flex-wrap: wrap;
4
+ `,k=C(f)`
5
+ width: auto;
6
+ `,A=C.pre`
7
+ margin: 0;
8
+ padding: ${({theme:e})=>e.space(3)};
9
+ font-family: ${({theme:e})=>e.font.mono};
10
+ font-size: 12px;
11
+ line-height: 1.65;
12
+ white-space: pre;
13
+ `,j=C.div`
14
+ color: ${({theme:e,$level:t})=>t===`error`?e.color.down:t===`warn`?e.color.warn:t===`debug`?e.color.inkFaint:e.color.ink};
15
+ `,M=C.p`
16
+ margin: 0;
17
+ padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
18
+ border-top: 1px solid ${({theme:e})=>e.color.rule};
19
+ color: ${({theme:e})=>e.color.inkDim};
20
+ font-size: 12px;
21
+ `,N=C.code`
22
+ font-family: ${({theme:e})=>e.font.mono};
23
+ word-break: break-all;
24
+ `;function P({read:e}){return e.source===`file`?S(M,{children:[`Reading `,x(N,{children:e.path}),`, named by `,x(N,{children:`OMNI_LOG_FILE`}),`. That variable says where the gateway's output is being captured; it does not redirect it.`]}):e.source===`journal`?S(M,{children:[`Reading the systemd journal for `,x(N,{children:`omnigateway.service`}),`. To read a file instead, redirect the gateway's output to one and point `,x(N,{children:`OMNI_LOG_FILE`}),` at the same path.`]}):e.unreachable!==void 0&&e.unreachable.length>0?S(M,{children:[e.unreachable.length===1?`One process`:`${e.unreachable.length} processes`,` did not answer in time and `,e.unreachable.length===1?`is`:`are`,` not shown:`,` `,e.unreachable.map(e=>e.slice(0,8)).join(`, `),`.`]}):null}var F={single:"Its output is going to a terminal, so there is nothing to read back. To capture it, run the gateway under systemd with `omni service install`, or start it with `omni start`, which redirects output to a file and points OMNI_LOG_FILE at it.",fleet:`No process in this fleet is capturing its own output, so there is nothing to read back. Each one can capture its own — tee its stdout to a file and point OMNI_LOG_FILE at the same path — and this screen will then merge them. For a fleet, ship stdout to a collector instead: Elasticsearch and Kibana, Loki and Grafana, or whatever already reads your containers. This screen shows one process's tail at a time, and a process that is gone takes its log with it.`,process:`This process is not capturing its own output, so there is nothing to read back from it. Tee its stdout to a file and point OMNI_LOG_FILE at the same path, or pick another process.`},I=[],L={read:void 0,lines:I};function R(){let{cadence:i}=u(),f=te(),[C,w]=y(200),[T,D]=y(``),[M,N]=y(``),R=t(),B=R.data?.nodes??[],V=B.length>1,H=M===``&&V?`all`:M,U=H===`all`?`fleet`:V?`process`:`single`,W=H===``||H===`all`?null:`${g}:${H}`,G=r(C,T,i(e,W??`stream:console`),H),K=G.data,[q,J]=y(L),Y=q.read===K?q.lines:I,X=_(()=>[...K?.lines??[],...Y].slice(-C),[K,Y,C]),Z=v(null),Q=v(!0),$=e=>{if(e.kind!==`frame`&&e.kind!==`gap`&&e.kind!==`closed`)return;let t=e.kind===`frame`?O(e.payload):null;if(t===null){J({read:K,lines:I}),e.kind===`frame`&&m(f,g);return}let n=t.filter(e=>E(e,T));n.length!==0&&J(e=>({read:K,lines:[...e.read===K?e.lines:[],...n].slice(-C)}))};return h(g,e=>{W===null&&$(e)}),p(W,$),ne(()=>{let e=Z.current;e!==null&&Q.current&&X.length>0&&(e.scrollTop=e.scrollHeight)},[X]),S(b,{children:[x(d,{legend:`Console`,title:`Gateway output`,summary:G.isLoading?`Reading the gateway's own output…`:`${n(X.length)} lines of what this process is doing. Requests are in Logs; prompt bodies, tokens and keys are never written here.`,actions:S(ae,{children:[V?x(k,{value:H,"aria-label":`Which process to show`,options:[{value:`all`,label:`every process`},...B.map(e=>({value:e.id,label:e.self?`${e.id.slice(0,8)} (this one)`:e.id.slice(0,8)}))],onValueChange:N}):null,x(k,{value:T,"aria-label":`Which levels to show`,options:ie,onValueChange:D}),x(k,{value:C,"aria-label":`How many lines to fetch`,options:re.map(e=>({value:String(e),label:`last ${e}`})),onValueChange:e=>w(Number(e))})]})}),S(c,{legend:`Process output`,meta:K===void 0?void 0:x(l,{children:z(K)}),flush:!0,children:[K===void 0?null:x(P,{read:K}),x(o,{ref:Z,"data-testid":`console-terminal`,onScroll:e=>{let t=e.currentTarget;Q.current=t.scrollHeight-t.scrollTop-t.clientHeight<=8},children:G.isError?x(ee,{error:G.error,onRetry:()=>void G.refetch()}):G.isLoading||R.isLoading?x(`div`,{style:{padding:12},children:x(s,{rows:10})}):K!==void 0&&K.source===`none`?x(a,{legend:`Nothing is capturing this gateway`,message:F[U]}):X.length===0?x(a,{legend:`Nothing to show`,message:T===``?`This log is empty. The gateway writes here when it boots, refreshes a token, or polls a quota.`:`No line in this window is at that level. Widen the filter to see everything.`}):x(A,{children:X.map((e,t)=>x(j,{$level:e.level,children:e.nodeId===void 0?e.raw:`[${e.nodeId.slice(0,8)}] ${e.raw}`},`${e.at??0}-${t}`))})})]})]})}function z(e){return e.source===`file`?`log file`:e.source===`journal`?`systemd journal`:e.source===`fleet`?`every process, merged`:`not captured`}var B=R;export{B as component};
@@ -1,4 +1,4 @@
1
- import{A as e,Ct as t,I as n,L as r,N as i,P as a,Vt as o,Wt as s,Y as c,_t as l,an as u,en as d,et as f,mt as p,xt as m}from"./Lamp-CL0i4yaa.js";import{C as h,E as g,S as _,T as v,a as y,c as b,k as x,o as S,r as C,s as w,v as T,y as E}from"./Panel-CsovmtxF.js";import{A as D,r as O,t as k}from"./Rack-DMrfn4-H.js";import{t as A}from"./trash-Bsi60qJc.js";import{r as j,t as M}from"./Field-EvdVyEqx.js";import{t as N}from"./Meter-stpt3vQu.js";import{i as P,n as F,r as I,t as L}from"./Table-CVDZ69Zx.js";import{t as R}from"./Readout-DlT5oxGO.js";import{n as z}from"./reasons-Du1OBWAM.js";import{useQueryClient as B}from"@tanstack/react-query";import{useCallback as V,useState as H}from"react";import{Fragment as U,jsx as W,jsxs as G}from"react/jsx-runtime";import K from"styled-components";var q={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};q.node;var J=D(q),Y={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Y.node;var ee=D(Y),X=[{id:`keepLatest`,label:`Snapshots kept`,hint:`How many survive regardless of age. The newest is always kept, whatever both numbers say.`,unit:`files`,max:100},{id:`maxAgeDays`,label:`Maximum age`,hint:`Older snapshots are pruned after every new one and on the hourly maintenance sweep.`,unit:`days`,max:3650}],te=K.p`
1
+ import{A as e,Ct as t,I as n,L as r,N as i,P as a,Vt as o,Wt as s,Y as c,_t as l,an as u,en as d,et as f,mt as p,xt as m}from"./Lamp-CL0i4yaa.js";import{C as h,E as g,S as _,T as v,a as y,c as b,k as x,o as S,r as C,s as w,v as T,y as E}from"./Panel-CsovmtxF.js";import{j as D,r as O,t as k}from"./Rack-1lijWt5h.js";import{t as A}from"./trash-CmuxOGpN.js";import{r as j,t as M}from"./Field-CUEEy19T.js";import{t as N}from"./Meter-stpt3vQu.js";import{i as P,n as F,r as I,t as L}from"./Table-CVDZ69Zx.js";import{t as R}from"./Readout-DlT5oxGO.js";import{n as z}from"./reasons-Du1OBWAM.js";import{useQueryClient as B}from"@tanstack/react-query";import{useCallback as V,useState as H}from"react";import{Fragment as U,jsx as W,jsxs as G}from"react/jsx-runtime";import K from"styled-components";var q={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};q.node;var J=D(q),Y={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Y.node;var ee=D(Y),X=[{id:`keepLatest`,label:`Snapshots kept`,hint:`How many survive regardless of age. The newest is always kept, whatever both numbers say.`,unit:`files`,max:100},{id:`maxAgeDays`,label:`Maximum age`,hint:`Older snapshots are pruned after every new one and on the hourly maintenance sweep.`,unit:`days`,max:3650}],te=K.p`
2
2
  font-size: 12px;
3
3
  color: ${({theme:e})=>e.color.down};
4
4
  `,ne=K.p`
@@ -1,4 +1,4 @@
1
- import{At as e,I as t,L as n,M as r,N as i,R as a,Tt as o,V as s,Zt as c,c as l,f as u,gt as d,h as f,ht as p,i as m,in as h,jt as g,n as _,o as v,on as y,p as b,s as x,t as S,u as C,v as w,x as T,z as E}from"./Lamp-CL0i4yaa.js";import{C as D,E as O,S as k,T as ee,a as A,b as j,k as M,o as te,r as N,v as ne,w as P,y as F}from"./Panel-CsovmtxF.js";import{D as I,S as L,t as re,w as R}from"./Rack-DMrfn4-H.js";import{n as z,t as ie}from"./TokenBreakdown-Bf0zsKcd.js";import{n as ae,t as B}from"./Chip-C3dIFd8s.js";import{t as oe}from"./Meter-stpt3vQu.js";import{i as V,n as H,r as U,t as W}from"./Table-CVDZ69Zx.js";import{t as G}from"./Readout-DlT5oxGO.js";import{useMemo as K}from"react";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var se=X(O)`
1
+ import{At as e,I as t,L as n,M as r,N as i,R as a,Tt as o,V as s,Zt as c,c as l,f as u,gt as d,h as f,ht as p,i as m,in as h,jt as g,n as _,o as v,on as y,p as b,s as x,t as S,u as C,v as w,x as T,z as E}from"./Lamp-CL0i4yaa.js";import{C as D,E as O,S as k,T as ee,a as A,b as j,k as M,o as te,r as N,v as ne,w as P,y as F}from"./Panel-CsovmtxF.js";import{C as I,O as L,T as R,t as re}from"./Rack-1lijWt5h.js";import{n as z,t as ie}from"./TokenBreakdown-B8cSaOOr.js";import{n as ae,t as B}from"./Chip-B2iXmJJC.js";import{t as oe}from"./Meter-stpt3vQu.js";import{i as V,n as H,r as U,t as W}from"./Table-CVDZ69Zx.js";import{t as G}from"./Readout-DlT5oxGO.js";import{useMemo as K}from"react";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var se=X(O)`
2
2
  font-weight: 500;
3
3
  display: block;
4
4
  max-width: 24ch;
@@ -64,4 +64,4 @@ import{At as e,I as t,L as n,M as r,N as i,R as a,Tt as o,V as s,Zt as c,c as l,
64
64
  display: grid;
65
65
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
66
66
  gap: ${({theme:e})=>e.space(3)};
67
- `;function Te({logs:e,windowMs:r,now:a}){let o=e.filter(e=>a-e.at<=r),s=T(o,r),c=m(o,{now:a,spanMs:r,count:32}),l=s.errorRate>=.25?`down`:s.errorRate>=.05?`warn`:`ok`,u=s.inputTokens+s.outputTokens+s.cacheReadTokens+s.cacheWriteTokens;return Y(we,{children:[J(G,{legend:`Requests`,value:i(s.requests),unit:`${s.ratePerMin.toFixed(1)}/min`,trace:J(L,{values:c.map(e=>e.total),overlay:c.map(e=>e.errors),label:`${s.requests} requests, ${s.errors} of them failed`})}),J(G,{legend:`Error rate`,value:n(s.errorRate),unit:`${i(s.errors)} failed`,tone:s.requests===0?`ink`:l,trace:J(L,{values:c.map(e=>e.errors),scaleTo:Math.max(...c.map(e=>e.total)),color:`var(--down)`,label:`${s.errors} failed requests against ${s.requests} total`})}),J(G,{legend:`Total tokens`,value:i(u),unit:J(z,{tokens:s}),trace:J(L,{values:c.map(e=>e.tokens),label:`token volume over the window, ${u.toLocaleString(`en-US`)} total`})}),J(G,{legend:`Time to first token`,value:t(s.ttftP50),unit:`p95 ${t(s.ttftP95)}`,trace:J(L,{values:c.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${t(s.ttftP50)}`})}),J(G,{legend:`Spend`,value:E(s.costUsd),unit:`${i(s.inputTokens+s.outputTokens)} tokens`,trace:J(L,{values:c.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${E(s.costUsd)} total`})})]})}var $=36e5;function Ee(){let{cadence:t}=I(),n=d(),r=p(t(1e4,`res:credentials`)),i=g(),a=e(500,t(1e4,`res:logs`)),s=o(),u=c(),f=K(()=>{let e=new Map;for(let t of s.data??[])e.set(t.id,t.label);return e},[s.data]),m=Date.now(),_=Math.floor((m-$)/6e4)*6e4,v=h({groupBy:`credential`,since:_},t(6e4,`res:usage`)),y=n.data??[],b=l(r.data?.health??[],e=>e.credentialId),S=y.filter(e=>x(b.get(e.id)??[],m,e.enabled,e.disabledReason).state===`down`),C=n.isLoading||a.isLoading?`Reading the gateway…`:y.length===0?`No accounts are connected, so every request fails at the router.`:S.length>0?`${S.length} account${S.length===1?` is`:`s are`} out of rotation.`:`All ${y.length} accounts are answering. Nothing needs attention.`;return Y(q,{children:[J(re,{legend:`Rack`,title:`Gateway`,summary:C}),a.isError?J(N,{legend:`Traffic`,children:J(te,{legend:`The gateway did not answer`,error:a.error,onRetry:()=>void a.refetch()})}):Y(ee,{$gap:4,children:[J(Te,{logs:a.data??[],windowMs:$,now:m}),J(fe,{credentials:y,health:r.data?.health??[],quota:r.data?.quota??[],burn:r.data?.burn??[],usage:v.data??[],lastUsed:r.data?.lastUsed??{},quotaPollIntervalMs:u.data?.quotaPollIntervalMs??3e5,now:m}),Y(ne,{$min:`340px`,$gap:4,children:[J(Ce,{models:i.data??[],logs:a.data??[]}),J(ve,{logs:a.data??[],keyNames:f})]})]})]})}var De=Ee;export{De as component};
67
+ `;function Te({logs:e,windowMs:r,now:a}){let o=e.filter(e=>a-e.at<=r),s=T(o,r),c=m(o,{now:a,spanMs:r,count:32}),l=s.errorRate>=.25?`down`:s.errorRate>=.05?`warn`:`ok`,u=s.inputTokens+s.outputTokens+s.cacheReadTokens+s.cacheWriteTokens;return Y(we,{children:[J(G,{legend:`Requests`,value:i(s.requests),unit:`${s.ratePerMin.toFixed(1)}/min`,trace:J(I,{values:c.map(e=>e.total),overlay:c.map(e=>e.errors),label:`${s.requests} requests, ${s.errors} of them failed`})}),J(G,{legend:`Error rate`,value:n(s.errorRate),unit:`${i(s.errors)} failed`,tone:s.requests===0?`ink`:l,trace:J(I,{values:c.map(e=>e.errors),scaleTo:Math.max(...c.map(e=>e.total)),color:`var(--down)`,label:`${s.errors} failed requests against ${s.requests} total`})}),J(G,{legend:`Total tokens`,value:i(u),unit:J(z,{tokens:s}),trace:J(I,{values:c.map(e=>e.tokens),label:`token volume over the window, ${u.toLocaleString(`en-US`)} total`})}),J(G,{legend:`Time to first token`,value:t(s.ttftP50),unit:`p95 ${t(s.ttftP95)}`,trace:J(I,{values:c.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${t(s.ttftP50)}`})}),J(G,{legend:`Spend`,value:E(s.costUsd),unit:`${i(s.inputTokens+s.outputTokens)} tokens`,trace:J(I,{values:c.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${E(s.costUsd)} total`})})]})}var $=36e5;function Ee(){let{cadence:t}=L(),n=d(),r=p(t(1e4,`res:credentials`)),i=g(),a=e(500,t(1e4,`res:logs`)),s=o(),u=c(),f=K(()=>{let e=new Map;for(let t of s.data??[])e.set(t.id,t.label);return e},[s.data]),m=Date.now(),_=Math.floor((m-$)/6e4)*6e4,v=h({groupBy:`credential`,since:_},t(6e4,`res:usage`)),y=n.data??[],b=l(r.data?.health??[],e=>e.credentialId),S=y.filter(e=>x(b.get(e.id)??[],m,e.enabled,e.disabledReason).state===`down`),C=n.isLoading||a.isLoading?`Reading the gateway…`:y.length===0?`No accounts are connected, so every request fails at the router.`:S.length>0?`${S.length} account${S.length===1?` is`:`s are`} out of rotation.`:`All ${y.length} accounts are answering. Nothing needs attention.`;return Y(q,{children:[J(re,{legend:`Rack`,title:`Gateway`,summary:C}),a.isError?J(N,{legend:`Traffic`,children:J(te,{legend:`The gateway did not answer`,error:a.error,onRetry:()=>void a.refetch()})}):Y(ee,{$gap:4,children:[J(Te,{logs:a.data??[],windowMs:$,now:m}),J(fe,{credentials:y,health:r.data?.health??[],quota:r.data?.quota??[],burn:r.data?.burn??[],usage:v.data??[],lastUsed:r.data?.lastUsed??{},quotaPollIntervalMs:u.data?.quotaPollIntervalMs??3e5,now:m}),Y(ne,{$min:`340px`,$gap:4,children:[J(Ce,{models:i.data??[],logs:a.data??[]}),J(ve,{logs:a.data??[],keyNames:f})]})]})]})}var De=Ee;export{De as component};