omnigateway 0.10.2 → 0.11.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 (34) hide show
  1. package/README.md +20 -2
  2. package/bin/omni.js +454 -303
  3. package/gateway.js +593 -360
  4. package/package.json +1 -1
  5. package/public/assets/{Chip-BeKVtewW.js → Chip-CmL-9rw7.js} +1 -1
  6. package/public/assets/{CopyValue-NTHhiCuT.js → CopyValue-CTVbU0O_.js} +1 -1
  7. package/public/assets/{Lamp-C2Q3t5Mn.js → Lamp-DtHKJH6P.js} +1 -1
  8. package/public/assets/{Rack-sUGRoZUx.js → Rack-_A_3zqxC.js} +1 -1
  9. package/public/assets/{RequestTable-C2RLARWy.js → RequestTable-Cokk7wKP.js} +1 -1
  10. package/public/assets/{SummaryDeck-BHXcb_Ji.js → SummaryDeck-C0IbqnLz.js} +1 -1
  11. package/public/assets/{Toggle-DwKz1aVq.js → Toggle-ChjN-tw1.js} +1 -1
  12. package/public/assets/{TokenBreakdown-DM-1HvOr.js → TokenBreakdown-BPoXM3JM.js} +1 -1
  13. package/public/assets/{WindowChart-BsonO5Py.js → WindowChart-BPEsEGFL.js} +1 -1
  14. package/public/assets/_app.accounts-DKmxz7Tl.js +59 -0
  15. package/public/assets/{_app.console-BQJMLRv4.js → _app.console-Bkdallia.js} +1 -1
  16. package/public/assets/{_app.database-BIiajZm6.js → _app.database-DxqN1395.js} +1 -1
  17. package/public/assets/{_app.index-DagK0Pqp.js → _app.index-BUqor-qH.js} +3 -3
  18. package/public/assets/{_app.keys-DLAG_bmt.js → _app.keys-DMCPEj1g.js} +1 -1
  19. package/public/assets/{_app.logs-AyVq3lLb.js → _app.logs-DGQD8ZAq.js} +1 -1
  20. package/public/assets/{_app.models-CwlkGPrx.js → _app.models-D6SV_GVk.js} +1 -1
  21. package/public/assets/{_app.plugins._pluginId-BhvEnawY.js → _app.plugins._pluginId-CJ7ObXXe.js} +1 -1
  22. package/public/assets/{_app.settings-BKA-1YLs.js → _app.settings-BVimpngR.js} +1 -1
  23. package/public/assets/{_app.usage-C7JEWKZM.js → _app.usage-Y2Nkaw0t.js} +1 -1
  24. package/public/assets/{chevron-right-S84SGCvk.js → chevron-right-BfnK63GB.js} +1 -1
  25. package/public/assets/{client-DCvpw0LS.js → client-WgQ5A2PD.js} +1 -1
  26. package/public/assets/{index-pZbadEun.js → index-BTE8vyBz.js} +3 -3
  27. package/public/assets/{login-CitmheGz.js → login-CrJK9wRA.js} +1 -1
  28. package/public/assets/plus-Cv51cK5k.js +1 -0
  29. package/public/assets/{preload-helper-BC9bKUg1.js → preload-helper-BknjH67x.js} +1 -1
  30. package/public/assets/{shared-C47BfV_u.js → shared-oTMOLWMT.js} +1 -1
  31. package/public/assets/{trash-2-DmtElUHr.js → trash-2-CSkf6ME_.js} +1 -1
  32. package/public/index.html +4 -4
  33. package/public/assets/_app.accounts-DUYxItf0.js +0 -59
  34. package/public/assets/plus-E7qLz9CF.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnigateway",
3
- "version": "0.10.2",
3
+ "version": "0.11.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{m as e}from"./Rack-sUGRoZUx.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
1
+ import{m as e}from"./Rack-_A_3zqxC.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  gap: 4px;
@@ -1,4 +1,4 @@
1
- import{C as e,O as t}from"./Panel-BlNr9j6-.js";import{b as n}from"./Rack-sUGRoZUx.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),d=n(`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`}]]);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=l.div`
1
+ import{C as e,O as t}from"./Panel-BlNr9j6-.js";import{b as n}from"./Rack-_A_3zqxC.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),d=n(`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`}]]);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=l.div`
2
2
  display: flex;
3
3
  align-items: stretch;
4
4
  gap: 0;
@@ -1,4 +1,4 @@
1
- import{c as e,d as t,f as n,k as r,l as i,m as a,p as o,u as s}from"./Panel-BlNr9j6-.js";import{queryOptions as c,useMutation as l,useQuery as u,useQueryClient as d}from"@tanstack/react-query";import*as f from"react";import p,{useCallback as m,useDebugValue as h,useEffect as g,useMemo as _,useRef as v,useSyncExternalStore as y}from"react";import{jsx as b}from"react/jsx-runtime";import x,{css as S,keyframes as ee}from"styled-components";var C=f.use,w=f.useLayoutEffect;function te(e,t,n){f.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function ne(e){let t=f.useRef(null);return f.useImperativeHandle(e,()=>t.current,[]),t}function T(e){return e[e.length-1]}function re(e,t){return typeof e==`function`?e(t):e}var E=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;function ie(e){for(let t in e)if(E.call(e,t))return!0;return!1}var ae=()=>Object.create(null),oe=(e,t)=>se(e,t,ae);function se(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ue(e)&&ue(i);if(!a&&!(O(e)&&O(i)))return i;let o=a?e:ce(e);if(!o)return i;let s=a?i:ce(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:E.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=se(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ce(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!D.call(e,r))return!1;t.push(r)}return t}function O(e){if(!le(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!le(n)||!n.hasOwnProperty(`isPrototypeOf`))}function le(e){return Object.prototype.toString.call(e)===`[object Object]`}function ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!k(e[r],t[r],n))return!1;return!0}if(O(e)&&O(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!k(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!k(e[o],t[o],n)))return!1;return i===a}return!1}function de(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var fe=/[\x00-\x1f\x7f"<>`{}]/g;function pe(e){return e.replace(fe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function me(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return pe(t)}var he=[`http:`,`https:`,`mailto:`,`tel:`];function A(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function j(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=me(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=me(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ge(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function _e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function M(){throw Error(`Invariant failed`)}function N(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var P=4,F=5;function I(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function L(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=I(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=z(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=B(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=z(r);e.kind=F,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=z(r);e.kind=P,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)L(e,t,r,c,i,a,o,s)}function R(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function z(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function B(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function V(e,t){let n=z(`/`),r=new Uint16Array(6),i=[];for(let t of e)L(!1,r,t,1,n,0,i);for(let e of i)e.sort(R);t.masksTree=n,t.flatCache=N(1e3)}function H(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Se(e,t.masksTree);return t.flatCache.set(e,r),r}function ve(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=z(`/`),L(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Se(r,o,n)}function ye(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Se(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=we(a.route)),t.matchCache.set(r,a),a}function be(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function xe(e,t=!1,n){let r=z(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;L(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&M(),o[e.id]=e,c!==0&&e.path){let t=be(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(R);return{processedTree:{segmentTree:r,singleCache:N(1e3),matchCache:N(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Se(e,t,n=!1){let r=e.split(`/`),i=Ee(e,r,t,n);if(!i)return null;let[a]=Ce(e,r,i);return{route:i.node.route,rawParams:a}}function Ce(e,t,n){let r=Te(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===P)break;if(u.kind===F){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function we(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Te(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ee(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!T(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!W(l,n))continue;if(i.parse){if(!Oe(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==P&&W(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===P||i.kind===2)&&W(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Oe(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&De(f,o))return n;W(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+U(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+U(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function U(e,t){return 2**(e-t-1)}function De(e,t){return e===2**(t-1)-1}function Oe(e,t,n){let r,i;try{[r,i]=Ce(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===P)>(e.node.kind===P)||t.node.kind===P==(e.node.kind===P)&&t.node.depth>e.node.depth)))}function ke(e){return G(e.filter(e=>e!==void 0).join(`/`))}function G(e){return e.replace(/\/{2,}/g,`/`)}function Ae(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function je(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Me(e){return je(Ae(e))}function K(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ne(e,t,n){return K(e,n)===K(t,n)}function Pe({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=G(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=G(e)),o=e.split(`/`);o.length>1&&T(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(T(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?G(s):s)||`/`;return a&&r&&r.set(a,c),c}function Fe(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ie(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Re(e,n)).join(`/`):Re(r,n):r}function Le({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=I(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ie(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ie(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ie(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Re(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var ze=`Error preloading route! ☝️`;function Be({children:e,fallback:t=null}){return b(p.Fragment,{children:Ve()?e:t})}function Ve(){return p.useSyncExternalStore(He,()=>!0,()=>!1)}function He(){return()=>{}}function Ue(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var We=typeof Object.is==`function`?Object.is:Ue;function Ge(e,t,n,r,i){let a=v(null),o;a.current===null?(o={hasValue:!1,value:null},a.current=o):o=a.current;let[s,c]=_(()=>{let e=!1,a,s,c=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&o.hasValue){let e=o.value;if(i(e,n))return s=e,e}return s=n,n}let n=s;if(We(a,t))return n;let c=r(t);return i?.(n,c)?(a=t,n):(a=t,s=c,c)},l=n===void 0?null:n;return[()=>c(t()),l===null?void 0:()=>c(l())]},[t,n,r,i,o]),l=y(e,s,c);return g(()=>{o.hasValue=!0,o.value=l},[l,o]),h(l),l}function Ke(e,t){return e===t}function qe(e,t,n=Ke){let r=m(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=m(()=>e?.get(),[e]);return Ge(r,i,i,t,n)}function Je(e){let t=r();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ye(e){let t=f.useRef(e);return k(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Xe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ze(e,t,n){if(e?.external)return A(e.href,n)?void 0:e.href;if(!ot(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),A(t,n)?void 0:t}catch{}}function Qe(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Ne(e.pathname,t.pathname,r))return!1}else{let n=K(e.pathname,r),i=K(t.pathname,r);if(!n.startsWith(i)||n.length!==i.length&&n[i.length]!==`/`)return!1}return(n?.includeSearch??!0)&&!k(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function $e(e,t){let n=r(),i=ne(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:ee,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:ie,params:ae,search:oe,hash:se,state:ce,mask:O,reloadDocument:le,unsafeRelative:ue,from:k,_fromLocation:de,...fe}=e,pe=Ve(),me=Ye(e.search),he=Ye(e.params),A=Ye(s),j=f.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,me,he,e.state,e.mask,e.unsafeRelative]),ge=f.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...j}),r=at(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,b),i=Ze(r,c,n.protocolAllowlist);return[r?.href,i,Qe(e,t,A,n.basepath,pe,i!==void 0)]},[A,b,pe,j,n,c]),[_e,M,N]=qe(n.stores.location,ge,Xe),P=N?re(a,{})??tt:et,F=N?et:re(o,{})??et,I=[S,P.className,F.className].filter(Boolean).join(` `),L=(x||P.style||F.style)&&{...x,...P.style,...F.style},R=f.useRef(!1),z=e.reloadDocument||M||b?!1:l??n.options.defaultPreload,B=u??n.options.defaultPreloadDelay??0,V=f.useCallback(()=>{n.preloadRoute(j).catch(e=>{console.warn(e),console.warn(ze)})},[n,j]),H=f.useCallback(e=>{if(!e){it(i);return}if(!(e.isIntersecting??z===`intent`)){e.isIntersecting===!1&&it(i);return}if(!B){V();return}q.has(i)||q.set(i,setTimeout(()=>{q.delete(i),V()},B))},[V,i,z,B]);te(i,H,z!==`viewport`),f.useEffect(()=>{R.current||z===`render`&&(V(),R.current=!0)},[V,z]);let ve=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;!b&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...j,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie}))};if(M)return{...fe,ref:i,href:M,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...ee&&{onClick:ee},...C&&{onBlur:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let ye=()=>{z===`intent`&&V()},be=()=>{z===`intent`&&it(i)};return{...fe,...P,...F,href:_e,ref:i,onClick:J([ee,ve]),onBlur:J([C,be]),onFocus:J([w,H]),onMouseEnter:J([T,H]),onMouseLeave:J([E,be]),onTouchStart:J([D,ye]),disabled:!!b,target:y,...L&&{style:L},...I&&{className:I},...b&&nt,...N&&rt}}var et={},tt={className:`active`},nt={role:`link`,"aria-disabled":!0},rt={"data-status":`active`,"aria-current":`page`},q=new WeakMap,it=e=>{clearTimeout(q.get(e)),q.delete(e)},J=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function at(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ot(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var st=f.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=$e(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return f.createElement(`a`,t,o)}return f.createElement(n,a,o)}),Y={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],requestBody:e=>[`logs`,`body`,e],clientSummary:[`client`,`summary`],clientUsage:e=>[`client`,`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],clientLogs:e=>[`client`,`logs`,e],clientQuota:[`client`,`quota`],clientQuotaHistory:e=>[`client`,`quota-history`,e.since,e.until??null],console:(e,t,n)=>[`console`,e,t,n],nodes:[`nodes`],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`],catalog:[`catalog`]},ct=c({queryKey:Y.catalog,queryFn:async({signal:e})=>{let{providers:t}=await i(`/api/catalog`,e);return[...t].sort((e,t)=>e.order-t.order)},staleTime:3e5});function lt(){return u(ct)}function ut(e,t){return e.find(e=>e.id===t)}function dt(){return u({queryKey:Y.status,queryFn:({signal:e})=>i(`/api/status`,e),staleTime:3e4})}function ft(){return u({queryKey:Y.credentials,queryFn:async({signal:e})=>(await i(`/api/credentials`,e)).credentials})}function pt(e=1e4){return u({queryKey:Y.credentialHealth,queryFn:({signal:e})=>i(`/api/credentials/health`,e),refetchInterval:e})}function mt(e,t=!0){return u({queryKey:Y.quotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function ht(){return u({queryKey:Y.models,queryFn:async({signal:e})=>(await i(`/api/models`,e)).models})}function gt(){return u({queryKey:Y.keys,queryFn:async({signal:e})=>(await i(`/api/keys`,e)).keys})}var _t={queryKey:Y.settings,queryFn:({signal:e})=>i(`/api/settings`,e)};function vt(){return u({..._t,select:e=>e.settings})}function yt(){return u({..._t,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function bt(){return u({..._t,select:e=>e.bodyLoggingAllowed})}function xt(e,t){return u({queryKey:Y.agentSetup(e,t),enabled:t!==void 0,queryFn:async({signal:n})=>(await i(a(`/api/agent-setup`,{client:e,...t??{}}),n)).files})}function St(e,t=6e4){return u({queryKey:Y.usage(e),queryFn:async({signal:t})=>(await i(a(`/api/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t)).rows,refetchInterval:t})}var Ct=2e3;function wt(e=100,t=Ct){return u({queryKey:Y.logs(e),queryFn:async({signal:t})=>(await i(a(`/api/logs`,{limit:e}),t)).logs,refetchInterval:t})}function Tt(e){return u({queryKey:Y.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>i(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Et=5e3;function Dt(e=200,t=``,n=Et,r=``){return u({queryKey:Y.console(e,t,r),queryFn:async({signal:n})=>i(a(`/api/console`,{lines:e,...t===``?{}:{level:t},...r===``?{}:{node:r}}),n),refetchInterval:n})}var Ot=3e4;function kt(){return u({queryKey:Y.nodes,queryFn:async({signal:e})=>i(`/api/nodes`,e),refetchInterval:Ot})}function At(){return u({queryKey:Y.database,queryFn:({signal:e})=>i(`/api/database`,e),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function jt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Mt(){return u({queryKey:Y.snapshots,queryFn:async({signal:e})=>(await i(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function X(e){e.invalidateQueries({queryKey:Y.database})}function Nt(){let e=d();return l({mutationFn:()=>t(`/api/database/snapshots`),onSuccess:()=>X(e)})}function Pt(){let e=d();return l({mutationFn:e=>n(`/api/database/retention`,e),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:Y.settings})}})}function Ft(){let e=d();return l({mutationFn:()=>t(`/api/database/vacuum`),onSuccess:()=>X(e)})}function It(){let t=d();return l({mutationFn:()=>e(`/api/database/bodies`),onSuccess:()=>{X(t),t.invalidateQueries({queryKey:[`logs`]})}})}function Lt(){let t=d();return l({mutationFn:t=>e(`/api/database/snapshots/${encodeURIComponent(t)}`),onSuccess:()=>X(t)})}function Rt(){return l({mutationFn:e=>t(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function zt(){return l({mutationFn:e=>t(`/api/database/import`,e)})}function Bt(){return u({queryKey:Y.lifecycle,queryFn:({signal:e})=>i(`/api/lifecycle`,e),refetchInterval:!1})}function Vt(){return l({mutationFn:()=>t(`/api/lifecycle/restart`)})}function Ht(){return l({mutationFn:()=>t(`/api/lifecycle/shutdown`)})}function Ut(){let e=d();return l({mutationFn:({mode:e,secret:n})=>e===`client`?t(`/api/client/login`,{key:n}):t(`/api/login`,{password:n,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>e.invalidateQueries()})}function Wt(){let e=d();return l({mutationFn:e=>t(`/api/setup`,{password:e}),onSuccess:()=>e.invalidateQueries()})}function Gt(){let e=d();return l({mutationFn:()=>t(`/api/logout`),onSuccess:()=>{e.clear()}})}function Kt(){let e=d();return l({mutationFn:()=>t(`/api/client/logout`),onSuccess:()=>e.clear()})}function qt(){return u({queryKey:Y.clientSummary,queryFn:({signal:e})=>i(`/api/client/summary`,e)})}function Jt(e,t=6e4){return u({queryKey:Y.clientUsage(e),queryFn:({signal:t})=>i(a(`/api/client/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:t})}function Yt(e=100,t=Ct){return u({queryKey:Y.clientLogs(e),queryFn:async({signal:t})=>(await i(a(`/api/client/logs`,{limit:e}),t)).logs,refetchInterval:t})}function Xt(e=6e4){return u({queryKey:Y.clientQuota,queryFn:async({signal:e})=>(await i(`/api/client/quota`,e)).accounts,refetchInterval:e})}function Zt(e,t=!0){return u({queryKey:Y.clientQuotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/client/quota/history`,{since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:3e5})}function Qt(){let e=d();return l({mutationFn:({id:e,patch:t})=>s(`/api/credentials/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:Y.credentials}),e.invalidateQueries({queryKey:Y.credentialHealth})}})}function $t(){let t=d();return l({mutationFn:t=>e(`/api/credentials/${t}`),onSuccess:()=>{t.invalidateQueries({queryKey:Y.credentials}),t.invalidateQueries({queryKey:Y.credentialHealth})}})}function en(){let e=d();return l({mutationFn:e=>n(`/api/models/${encodeURIComponent(e.id)}`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.models})})}function tn(){let t=d();return l({mutationFn:t=>e(`/api/models/${encodeURIComponent(t)}`),onSuccess:()=>t.invalidateQueries({queryKey:Y.models})})}function nn(){return l({mutationFn:({modelId:e,need:n})=>t(`/api/models/${encodeURIComponent(e)}/dry-run`,n)})}function rn(){let e=d();return l({mutationFn:e=>t(`/api/keys`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function an(){let e=d();return l({mutationFn:({id:e,limits:t})=>n(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function on(){let e=d();return l({mutationFn:({id:e,modelAllowlist:t})=>n(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function sn(){let t=d();return l({mutationFn:t=>e(`/api/keys/${t}`),onSuccess:()=>t.invalidateQueries({queryKey:Y.keys})})}function cn(){let e=d();return l({mutationFn:e=>n(`/api/settings`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.settings})})}function ln(){return l({mutationFn:e=>n(`/api/settings/password`,e)})}function un(){let e=d();return l({mutationFn:e=>n(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>e.invalidateQueries({queryKey:Y.status})})}function dn(){return l({mutationFn:e=>t(`/api/connect/start`,e)})}function fn(){let e=d();return l({mutationFn:e=>t(`/api/credentials`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.credentials})})}function pn(){let e=d();return l({mutationFn:e=>t(`/api/connect/finish`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.credentials})})}function mn(){return u({queryKey:Y.plugins,queryFn:async({signal:e})=>(await i(`/api/plugins`,e)).plugins,staleTime:3e5})}async function hn(e){let t=await o(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}var gn=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),_n=new Intl.NumberFormat(`en-US`);function vn(e){return Number.isFinite(e)?e<1e4?_n.format(Math.round(e)):gn.format(e).toLowerCase():`—`}function yn(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${gn.format(e).toLowerCase()}`:`—`}function bn(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 xn(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var Sn=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function Cn(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=Sn.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function wn(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${Cn(n)} ago`:`in ${Cn(n)}`}function Tn(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}var En=864e5;function Dn(e,t){let n=new Date(e),r=n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});return On(t)?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} ${r}`:r}function On(e){return e>=En}function kn(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 An=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function jn(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<An.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${An[n]}`}function Mn(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var Nn={fiveHour:18e6,daily:864e5,weekly:6048e5};function Pn(e,t){return t!==null&&t>0?t:Nn[e]}var Fn=6e4;function Z(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=Fn}function In(e,t){return e.resetsAt!==null&&e.resetsAt<=t}function Ln(e,t){return t===void 0?`unknown`:e.observedAt>0&&t.stale?`stale`:t.ratePerHour===null||e.limit===null||e.limit<=0?`unknown`:t.survives===!1&&t.exhaustsAt!==null?`empty`:t.survives===!0?`ok`:`unknown`}function Rn(e,t){if(t.provider!==e.provider)return!1;let n=Symbol(`unusable-endpoint`);return(e=>e===void 0||e===``?void 0:e)(e.endpointId)===(e=>{if(e!==void 0)return typeof e==`string`&&e!==``?e:n})(t.providerData.endpointId)?e.credentialId===void 0||t.id===e.credentialId:!1}function zn(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 Q(e){return e.state===`pending`}function Bn(e){return e.filter(e=>!Q(e))}function $(e){return Q(e)?!1:e.status>=400||e.errorCode!==null}var Vn={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function Hn(e){return Q(e)?`live`:$(e)?`down`:`ok`}function Un(e){return Q(e)?`in flight`:$(e)?`failed with ${e.status}`:`succeeded`}function Wn(e,t){let n=Bn(e),r=[],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of n)$(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:zn(r,.5),ttftP95:zn(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function Gn(e,t){let n=Bn(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)&&(n.errors+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&l[t]?.push(e.ttftMs))}for(let[e,t]of c.entries())t.ttftMs=zn(l[e]??[],.5);return c}var Kn={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function qn(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?Kn[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 Jn={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function Yn(e){return Math.max(e,6e4)*3}function Xn(e,t,n){return e.observedAt<=0||t-e.observedAt>Yn(n)}function Zn(e,t){return t?.ratePerHour===void 0||t.ratePerHour===null||e.limit===null||e.limit<=0?null:t.ratePerHour/e.limit}function Qn(e,t){return e.find(e=>e.windowType===t)}function $n(e,t,n,r,i){return er(e,{stale:Xn(e,t,n),rolledOver:In(e,t),estimateStale:i===void 0||i.stale,survives:i?.survives??null,exhaustsAt:i?.exhaustsAt??null},t,r)}function er(e,t,n,r){let i=Jn[e.windowType];if(e.observedAt<=0)return`${i} · never observed`;if(t.stale)return`${i} · stale, read ${r(e.observedAt,n)}`;if(t.rolledOver)return`${i} · rolled over, waiting for the next reading`;if(e.resetsAt===null)return i;let a=`resets ${r(e.resetsAt,n)}`;return t.estimateStale||t.survives!==!1||t.exhaustsAt===null?`${i} · ${a}`:`${i} · ${t.exhaustsAt<=n?`empty now`:`empty ~${Cn(t.exhaustsAt-n)}`} · ${a}`}function tr(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.limit===null||e.limit<=0?null:Math.min(1,Math.max(0,e.used/e.limit))}}function nr(e,t){if(e.usedRatio!==0||t.usedRatio!==0)return!1;let n=Pn(e.windowType,e.windowMs),r=Pn(t.windowType,t.windowMs);return n===r&&Z(e.resetsAt,e.observedAt+n)&&Z(t.resetsAt,t.observedAt+r)&&!Z(t.resetsAt,e.resetsAt)}function rr(e){let t=e.filter(e=>e.usedRatio!==null).sort((e,t)=>e.observedAt-t.observedAt),n=[],r;for(let e of t){let t={at:e.observedAt,percent:Math.min(100,e.usedRatio*100)},i={resetsAt:e.resetsAt,startsAt:e.resetsAt===null?null:e.resetsAt-Pn(e.windowType,e.windowMs)},a=n[n.length-1],o=r!==void 0&&nr(r,e);a===void 0||r===void 0||!o&&!Z(e.resetsAt,r.resetsAt)?n.push({key:`window-${n.length}`,points:[t],...i}):(a.points.push(t),a.resetsAt=o?null:i.resetsAt,a.startsAt=o?null:i.startsAt),r=e}return n}function ir(e,t){let{usedRatio:n,observedAt:r}=t;if(n===null)return[...e];let i=e.findLastIndex(e=>Z(e.resetsAt,t.resetsAt)),a=e[i];if(a===void 0)return[...e];let o=a.points[a.points.length-1];if(o===void 0||o.at>=r)return[...e];let s={at:r,percent:Math.min(100,n*100)};return e.map((e,t)=>t===i?{...e,points:[...e.points,s]}:e)}function ar(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var or=36e5;function sr(e,t){let{usedRatio:n,resetsAt:r,observedAt:i}=e,a=t;if(n===null||r===null||a===null||a<=0)return null;let o=Math.min(100,n*100),s=a*100,c={at:i,percent:o},l=o+s*((r-i)/or);return l<=100?{from:c,to:{at:r,percent:l}}:{from:c,to:{at:i+(100-o)/s*or,percent:100}}}var cr={fiveHour:0,daily:1,weekly:2};function lr(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)=>cr[e.window.windowType]-cr[t.window.windowType])}function ur(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 dr=ee`
1
+ import{c as e,d as t,f as n,k as r,l as i,m as a,p as o,u as s}from"./Panel-BlNr9j6-.js";import{queryOptions as c,useMutation as l,useQuery as u,useQueryClient as d}from"@tanstack/react-query";import*as f from"react";import p,{useCallback as m,useDebugValue as h,useEffect as g,useMemo as _,useRef as v,useSyncExternalStore as y}from"react";import{jsx as b}from"react/jsx-runtime";import x,{css as S,keyframes as ee}from"styled-components";var C=f.use,w=f.useLayoutEffect;function te(e,t,n){f.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function ne(e){let t=f.useRef(null);return f.useImperativeHandle(e,()=>t.current,[]),t}function T(e){return e[e.length-1]}function re(e,t){return typeof e==`function`?e(t):e}var E=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;function ie(e){for(let t in e)if(E.call(e,t))return!0;return!1}var ae=()=>Object.create(null),oe=(e,t)=>se(e,t,ae);function se(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ue(e)&&ue(i);if(!a&&!(O(e)&&O(i)))return i;let o=a?e:ce(e);if(!o)return i;let s=a?i:ce(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:E.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=se(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ce(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!D.call(e,r))return!1;t.push(r)}return t}function O(e){if(!le(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!le(n)||!n.hasOwnProperty(`isPrototypeOf`))}function le(e){return Object.prototype.toString.call(e)===`[object Object]`}function ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!k(e[r],t[r],n))return!1;return!0}if(O(e)&&O(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!k(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!k(e[o],t[o],n)))return!1;return i===a}return!1}function de(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var fe=/[\x00-\x1f\x7f"<>`{}]/g;function pe(e){return e.replace(fe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function me(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return pe(t)}var he=[`http:`,`https:`,`mailto:`,`tel:`];function A(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function j(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=me(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=me(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ge(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function _e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function M(){throw Error(`Invariant failed`)}function N(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var P=4,F=5;function I(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function L(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=I(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=z(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=B(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=z(r);e.kind=F,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=z(r);e.kind=P,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)L(e,t,r,c,i,a,o,s)}function R(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function z(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function B(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function V(e,t){let n=z(`/`),r=new Uint16Array(6),i=[];for(let t of e)L(!1,r,t,1,n,0,i);for(let e of i)e.sort(R);t.masksTree=n,t.flatCache=N(1e3)}function H(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Se(e,t.masksTree);return t.flatCache.set(e,r),r}function ve(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=z(`/`),L(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Se(r,o,n)}function ye(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Se(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=we(a.route)),t.matchCache.set(r,a),a}function be(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function xe(e,t=!1,n){let r=z(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;L(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&M(),o[e.id]=e,c!==0&&e.path){let t=be(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(R);return{processedTree:{segmentTree:r,singleCache:N(1e3),matchCache:N(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Se(e,t,n=!1){let r=e.split(`/`),i=Ee(e,r,t,n);if(!i)return null;let[a]=Ce(e,r,i);return{route:i.node.route,rawParams:a}}function Ce(e,t,n){let r=Te(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===P)break;if(u.kind===F){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function we(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Te(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ee(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!T(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!W(l,n))continue;if(i.parse){if(!Oe(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==P&&W(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===P||i.kind===2)&&W(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Oe(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&De(f,o))return n;W(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+U(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+U(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function U(e,t){return 2**(e-t-1)}function De(e,t){return e===2**(t-1)-1}function Oe(e,t,n){let r,i;try{[r,i]=Ce(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===P)>(e.node.kind===P)||t.node.kind===P==(e.node.kind===P)&&t.node.depth>e.node.depth)))}function ke(e){return G(e.filter(e=>e!==void 0).join(`/`))}function G(e){return e.replace(/\/{2,}/g,`/`)}function Ae(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function je(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Me(e){return je(Ae(e))}function K(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ne(e,t,n){return K(e,n)===K(t,n)}function Pe({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=G(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=G(e)),o=e.split(`/`);o.length>1&&T(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(T(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?G(s):s)||`/`;return a&&r&&r.set(a,c),c}function Fe(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ie(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Re(e,n)).join(`/`):Re(r,n):r}function Le({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=I(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ie(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ie(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ie(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Re(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var ze=`Error preloading route! ☝️`;function Be({children:e,fallback:t=null}){return b(p.Fragment,{children:Ve()?e:t})}function Ve(){return p.useSyncExternalStore(He,()=>!0,()=>!1)}function He(){return()=>{}}function Ue(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var We=typeof Object.is==`function`?Object.is:Ue;function Ge(e,t,n,r,i){let a=v(null),o;a.current===null?(o={hasValue:!1,value:null},a.current=o):o=a.current;let[s,c]=_(()=>{let e=!1,a,s,c=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&o.hasValue){let e=o.value;if(i(e,n))return s=e,e}return s=n,n}let n=s;if(We(a,t))return n;let c=r(t);return i?.(n,c)?(a=t,n):(a=t,s=c,c)},l=n===void 0?null:n;return[()=>c(t()),l===null?void 0:()=>c(l())]},[t,n,r,i,o]),l=y(e,s,c);return g(()=>{o.hasValue=!0,o.value=l},[l,o]),h(l),l}function Ke(e,t){return e===t}function qe(e,t,n=Ke){let r=m(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=m(()=>e?.get(),[e]);return Ge(r,i,i,t,n)}function Je(e){let t=r();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ye(e){let t=f.useRef(e);return k(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Xe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ze(e,t,n){if(e?.external)return A(e.href,n)?void 0:e.href;if(!ot(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),A(t,n)?void 0:t}catch{}}function Qe(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Ne(e.pathname,t.pathname,r))return!1}else{let n=K(e.pathname,r),i=K(t.pathname,r);if(!n.startsWith(i)||n.length!==i.length&&n[i.length]!==`/`)return!1}return(n?.includeSearch??!0)&&!k(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function $e(e,t){let n=r(),i=ne(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:ee,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:ie,params:ae,search:oe,hash:se,state:ce,mask:O,reloadDocument:le,unsafeRelative:ue,from:k,_fromLocation:de,...fe}=e,pe=Ve(),me=Ye(e.search),he=Ye(e.params),A=Ye(s),j=f.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,me,he,e.state,e.mask,e.unsafeRelative]),ge=f.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...j}),r=at(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,b),i=Ze(r,c,n.protocolAllowlist);return[r?.href,i,Qe(e,t,A,n.basepath,pe,i!==void 0)]},[A,b,pe,j,n,c]),[_e,M,N]=qe(n.stores.location,ge,Xe),P=N?re(a,{})??tt:et,F=N?et:re(o,{})??et,I=[S,P.className,F.className].filter(Boolean).join(` `),L=(x||P.style||F.style)&&{...x,...P.style,...F.style},R=f.useRef(!1),z=e.reloadDocument||M||b?!1:l??n.options.defaultPreload,B=u??n.options.defaultPreloadDelay??0,V=f.useCallback(()=>{n.preloadRoute(j).catch(e=>{console.warn(e),console.warn(ze)})},[n,j]),H=f.useCallback(e=>{if(!e){it(i);return}if(!(e.isIntersecting??z===`intent`)){e.isIntersecting===!1&&it(i);return}if(!B){V();return}q.has(i)||q.set(i,setTimeout(()=>{q.delete(i),V()},B))},[V,i,z,B]);te(i,H,z!==`viewport`),f.useEffect(()=>{R.current||z===`render`&&(V(),R.current=!0)},[V,z]);let ve=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;!b&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...j,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie}))};if(M)return{...fe,ref:i,href:M,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...ee&&{onClick:ee},...C&&{onBlur:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let ye=()=>{z===`intent`&&V()},be=()=>{z===`intent`&&it(i)};return{...fe,...P,...F,href:_e,ref:i,onClick:J([ee,ve]),onBlur:J([C,be]),onFocus:J([w,H]),onMouseEnter:J([T,H]),onMouseLeave:J([E,be]),onTouchStart:J([D,ye]),disabled:!!b,target:y,...L&&{style:L},...I&&{className:I},...b&&nt,...N&&rt}}var et={},tt={className:`active`},nt={role:`link`,"aria-disabled":!0},rt={"data-status":`active`,"aria-current":`page`},q=new WeakMap,it=e=>{clearTimeout(q.get(e)),q.delete(e)},J=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function at(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ot(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var st=f.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=$e(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return f.createElement(`a`,t,o)}return f.createElement(n,a,o)}),Y={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],requestBody:e=>[`logs`,`body`,e],clientSummary:[`client`,`summary`],clientUsage:e=>[`client`,`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],clientLogs:e=>[`client`,`logs`,e],clientQuota:[`client`,`quota`],clientQuotaHistory:e=>[`client`,`quota-history`,e.since,e.until??null],console:(e,t,n)=>[`console`,e,t,n],nodes:[`nodes`],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`],catalog:[`catalog`]},ct=c({queryKey:Y.catalog,queryFn:async({signal:e})=>{let{providers:t}=await i(`/api/catalog`,e);return[...t].sort((e,t)=>e.order-t.order)},staleTime:3e5});function lt(){return u(ct)}function ut(e,t){return e.find(e=>e.id===t)}function dt(){return u({queryKey:Y.status,queryFn:({signal:e})=>i(`/api/status`,e),staleTime:3e4})}function ft(){return u({queryKey:Y.credentials,queryFn:async({signal:e})=>(await i(`/api/credentials`,e)).credentials})}function pt(e=1e4){return u({queryKey:Y.credentialHealth,queryFn:({signal:e})=>i(`/api/credentials/health`,e),refetchInterval:e})}function mt(e,t=!0){return u({queryKey:Y.quotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function ht(){return u({queryKey:Y.models,queryFn:async({signal:e})=>(await i(`/api/models`,e)).models})}function gt(){return u({queryKey:Y.keys,queryFn:async({signal:e})=>(await i(`/api/keys`,e)).keys})}var _t={queryKey:Y.settings,queryFn:({signal:e})=>i(`/api/settings`,e)};function vt(){return u({..._t,select:e=>e.settings})}function yt(){return u({..._t,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function bt(){return u({..._t,select:e=>e.bodyLoggingAllowed})}function xt(e,t){return u({queryKey:Y.agentSetup(e,t),enabled:t!==void 0,queryFn:async({signal:n})=>(await i(a(`/api/agent-setup`,{client:e,...t??{}}),n)).files})}function St(e,t=6e4){return u({queryKey:Y.usage(e),queryFn:async({signal:t})=>(await i(a(`/api/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t)).rows,refetchInterval:t})}var Ct=2e3;function wt(e=100,t=Ct){return u({queryKey:Y.logs(e),queryFn:async({signal:t})=>(await i(a(`/api/logs`,{limit:e}),t)).logs,refetchInterval:t})}function Tt(e){return u({queryKey:Y.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>i(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Et=5e3;function Dt(e=200,t=``,n=Et,r=``){return u({queryKey:Y.console(e,t,r),queryFn:async({signal:n})=>i(a(`/api/console`,{lines:e,...t===``?{}:{level:t},...r===``?{}:{node:r}}),n),refetchInterval:n})}var Ot=3e4;function kt(){return u({queryKey:Y.nodes,queryFn:async({signal:e})=>i(`/api/nodes`,e),refetchInterval:Ot})}function At(){return u({queryKey:Y.database,queryFn:({signal:e})=>i(`/api/database`,e),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function jt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Mt(){return u({queryKey:Y.snapshots,queryFn:async({signal:e})=>(await i(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function X(e){e.invalidateQueries({queryKey:Y.database})}function Nt(){let e=d();return l({mutationFn:()=>t(`/api/database/snapshots`),onSuccess:()=>X(e)})}function Pt(){let e=d();return l({mutationFn:e=>n(`/api/database/retention`,e),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:Y.settings})}})}function Ft(){let e=d();return l({mutationFn:()=>t(`/api/database/vacuum`),onSuccess:()=>X(e)})}function It(){let t=d();return l({mutationFn:()=>e(`/api/database/bodies`),onSuccess:()=>{X(t),t.invalidateQueries({queryKey:[`logs`]})}})}function Lt(){let t=d();return l({mutationFn:t=>e(`/api/database/snapshots/${encodeURIComponent(t)}`),onSuccess:()=>X(t)})}function Rt(){return l({mutationFn:e=>t(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function zt(){return l({mutationFn:e=>t(`/api/database/import`,e)})}function Bt(){return u({queryKey:Y.lifecycle,queryFn:({signal:e})=>i(`/api/lifecycle`,e),refetchInterval:!1})}function Vt(){return l({mutationFn:()=>t(`/api/lifecycle/restart`)})}function Ht(){return l({mutationFn:()=>t(`/api/lifecycle/shutdown`)})}function Ut(){let e=d();return l({mutationFn:({mode:e,secret:n})=>e===`client`?t(`/api/client/login`,{key:n}):t(`/api/login`,{password:n,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>e.invalidateQueries()})}function Wt(){let e=d();return l({mutationFn:e=>t(`/api/setup`,{password:e}),onSuccess:()=>e.invalidateQueries()})}function Gt(){let e=d();return l({mutationFn:()=>t(`/api/logout`),onSuccess:()=>{e.clear()}})}function Kt(){let e=d();return l({mutationFn:()=>t(`/api/client/logout`),onSuccess:()=>e.clear()})}function qt(){return u({queryKey:Y.clientSummary,queryFn:({signal:e})=>i(`/api/client/summary`,e)})}function Jt(e,t=6e4){return u({queryKey:Y.clientUsage(e),queryFn:({signal:t})=>i(a(`/api/client/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:t})}function Yt(e=100,t=Ct){return u({queryKey:Y.clientLogs(e),queryFn:async({signal:t})=>(await i(a(`/api/client/logs`,{limit:e}),t)).logs,refetchInterval:t})}function Xt(e=6e4){return u({queryKey:Y.clientQuota,queryFn:async({signal:e})=>(await i(`/api/client/quota`,e)).accounts,refetchInterval:e})}function Zt(e,t=!0){return u({queryKey:Y.clientQuotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/client/quota/history`,{since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:3e5})}function Qt(){let e=d();return l({mutationFn:({id:e,patch:t})=>s(`/api/credentials/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:Y.credentials}),e.invalidateQueries({queryKey:Y.credentialHealth})}})}function $t(){let t=d();return l({mutationFn:t=>e(`/api/credentials/${t}`),onSuccess:()=>{t.invalidateQueries({queryKey:Y.credentials}),t.invalidateQueries({queryKey:Y.credentialHealth})}})}function en(){let e=d();return l({mutationFn:e=>n(`/api/models/${encodeURIComponent(e.id)}`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.models})})}function tn(){let t=d();return l({mutationFn:t=>e(`/api/models/${encodeURIComponent(t)}`),onSuccess:()=>t.invalidateQueries({queryKey:Y.models})})}function nn(){return l({mutationFn:({modelId:e,need:n})=>t(`/api/models/${encodeURIComponent(e)}/dry-run`,n)})}function rn(){let e=d();return l({mutationFn:e=>t(`/api/keys`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function an(){let e=d();return l({mutationFn:({id:e,limits:t})=>n(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function on(){let e=d();return l({mutationFn:({id:e,modelAllowlist:t})=>n(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>e.invalidateQueries({queryKey:Y.keys})})}function sn(){let t=d();return l({mutationFn:t=>e(`/api/keys/${t}`),onSuccess:()=>t.invalidateQueries({queryKey:Y.keys})})}function cn(){let e=d();return l({mutationFn:e=>n(`/api/settings`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.settings})})}function ln(){return l({mutationFn:e=>n(`/api/settings/password`,e)})}function un(){let e=d();return l({mutationFn:e=>n(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>e.invalidateQueries({queryKey:Y.status})})}function dn(){return l({mutationFn:e=>t(`/api/connect/start`,e)})}function fn(){let e=d();return l({mutationFn:e=>t(`/api/credentials`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.credentials})})}function pn(){let e=d();return l({mutationFn:e=>t(`/api/connect/finish`,e),onSuccess:()=>e.invalidateQueries({queryKey:Y.credentials})})}function mn(){return u({queryKey:Y.plugins,queryFn:async({signal:e})=>(await i(`/api/plugins`,e)).plugins,staleTime:3e5})}async function hn(e){let t=await o(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}var gn=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),_n=new Intl.NumberFormat(`en-US`);function vn(e){return Number.isFinite(e)?e<1e4?_n.format(Math.round(e)):gn.format(e).toLowerCase():`—`}function yn(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${gn.format(e).toLowerCase()}`:`—`}function bn(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 xn(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var Sn=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function Cn(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=Sn.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function wn(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${Cn(n)} ago`:`in ${Cn(n)}`}function Tn(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}var En=864e5;function Dn(e,t){let n=new Date(e),r=n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});return On(t)?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} ${r}`:r}function On(e){return e>=En}function kn(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 An=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function jn(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<An.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${An[n]}`}function Mn(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var Nn={fiveHour:18e6,daily:864e5,weekly:6048e5};function Pn(e,t){return t!==null&&t>0?t:Nn[e]}var Fn=6e4;function Z(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=Fn}function In(e,t){return e.resetsAt!==null&&e.resetsAt<=t}function Ln(e,t){return t===void 0?`unknown`:e.observedAt>0&&t.stale?`stale`:t.ratePerHour===null||e.limit===null||e.limit<=0?`unknown`:t.survives===!1&&t.exhaustsAt!==null?`empty`:t.survives===!0?`ok`:`unknown`}function Rn(e,t){if(t.provider!==e.provider)return!1;let n=Symbol(`unusable-endpoint`);return(e=>e===void 0||e===``?void 0:e)(e.endpointId)===(e=>{if(e!==void 0)return typeof e==`string`&&e!==``?e:n})(t.providerData.endpointId)?e.credentialId===void 0||t.id===e.credentialId:!1}function zn(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 Q(e){return e.state===`pending`}function Bn(e){return e.filter(e=>!Q(e))}function $(e){return Q(e)?!1:e.status>=400||e.errorCode!==null}var Vn={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function Hn(e){return Q(e)?`live`:$(e)?`down`:`ok`}function Un(e){return Q(e)?`in flight`:$(e)?`failed with ${e.status}`:`succeeded`}function Wn(e,t){let n=Bn(e),r=[],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of n)$(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:zn(r,.5),ttftP95:zn(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function Gn(e,t){let n=Bn(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)&&(n.errors+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&l[t]?.push(e.ttftMs))}for(let[e,t]of c.entries())t.ttftMs=zn(l[e]??[],.5);return c}var Kn={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function qn(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?Kn[r]:`disabled`,consecutiveFailures:0}}let i=`ok`,a=``,o=0;for(let n of e){if(o=Math.max(o,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,consecutiveFailures:o}}var Jn={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function Yn(e){return Math.max(e,6e4)*3}function Xn(e,t,n){return e.observedAt<=0||t-e.observedAt>Yn(n)}function Zn(e,t){return t?.ratePerHour===void 0||t.ratePerHour===null||e.limit===null||e.limit<=0?null:t.ratePerHour/e.limit}function Qn(e,t){return e.find(e=>e.windowType===t)}function $n(e,t,n,r,i){return er(e,{stale:Xn(e,t,n),rolledOver:In(e,t),estimateStale:i===void 0||i.stale,survives:i?.survives??null,exhaustsAt:i?.exhaustsAt??null},t,r)}function er(e,t,n,r){let i=Jn[e.windowType];if(e.observedAt<=0)return`${i} · never observed`;if(t.stale)return`${i} · stale, read ${r(e.observedAt,n)}`;if(t.rolledOver)return`${i} · rolled over, waiting for the next reading`;if(e.resetsAt===null)return i;let a=`resets ${r(e.resetsAt,n)}`;return t.estimateStale||t.survives!==!1||t.exhaustsAt===null?`${i} · ${a}`:`${i} · ${t.exhaustsAt<=n?`empty now`:`empty ~${Cn(t.exhaustsAt-n)}`} · ${a}`}function tr(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.limit===null||e.limit<=0?null:Math.min(1,Math.max(0,e.used/e.limit))}}function nr(e,t){if(e.usedRatio!==0||t.usedRatio!==0)return!1;let n=Pn(e.windowType,e.windowMs),r=Pn(t.windowType,t.windowMs);return n===r&&Z(e.resetsAt,e.observedAt+n)&&Z(t.resetsAt,t.observedAt+r)&&!Z(t.resetsAt,e.resetsAt)}function rr(e){let t=e.filter(e=>e.usedRatio!==null).sort((e,t)=>e.observedAt-t.observedAt),n=[],r;for(let e of t){let t={at:e.observedAt,percent:Math.min(100,e.usedRatio*100)},i={resetsAt:e.resetsAt,startsAt:e.resetsAt===null?null:e.resetsAt-Pn(e.windowType,e.windowMs)},a=n[n.length-1],o=r!==void 0&&nr(r,e);a===void 0||r===void 0||!o&&!Z(e.resetsAt,r.resetsAt)?n.push({key:`window-${n.length}`,points:[t],...i}):(a.points.push(t),a.resetsAt=o?null:i.resetsAt,a.startsAt=o?null:i.startsAt),r=e}return n}function ir(e,t){let{usedRatio:n,observedAt:r}=t;if(n===null)return[...e];let i=e.findLastIndex(e=>Z(e.resetsAt,t.resetsAt)),a=e[i];if(a===void 0)return[...e];let o=a.points[a.points.length-1];if(o===void 0||o.at>=r)return[...e];let s={at:r,percent:Math.min(100,n*100)};return e.map((e,t)=>t===i?{...e,points:[...e.points,s]}:e)}function ar(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var or=36e5;function sr(e,t){let{usedRatio:n,resetsAt:r,observedAt:i}=e,a=t;if(n===null||r===null||a===null||a<=0)return null;let o=Math.min(100,n*100),s=a*100,c={at:i,percent:o},l=o+s*((r-i)/or);return l<=100?{from:c,to:{at:r,percent:l}}:{from:c,to:{at:i+(100-o)/s*or,percent:100}}}var cr={fiveHour:0,daily:1,weekly:2};function lr(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)=>cr[e.window.windowType]-cr[t.window.windowType])}function ur(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 dr=ee`
2
2
  0%, 100% { opacity: 1; }
3
3
  50% { opacity: 0.28; }
4
4
  `,fr=S`
@@ -1,4 +1,4 @@
1
- import{Gt as e,I as t,Kt as n,N as r,Ot as i,P as a,bt as o,i as s,t as c,vt as l,wt as u,x as d,xt as f,zt as p}from"./Lamp-C2Q3t5Mn.js";import{C as m,D as h,E as g,O as _,S as v,T as y,_ as b,b as x,o as S,v as C}from"./Panel-BlNr9j6-.js";import*as w from"react";import{createContext as T,createElement as E,forwardRef as ee,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as se,jsx as O,jsxs as k}from"react/jsx-runtime";import A,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";import*as pe from"react-dom";var me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},be=T({}),xe=()=>re(be),Se=ee(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=xe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return E(`svg`,{ref:c,...ve,width:t??l??ve.width,height:t??l??ve.height,stroke:e??f,strokeWidth:m,className:me(`lucide`,p,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>E(e,t)),...Array.isArray(a)?a:[a]])}),j=(e,t)=>{let n=ee(({className:n,...r},i)=>E(Se,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},Ce=j(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),we=j(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Te=j(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ee=j(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),De=j(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Oe=j(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ke=j(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ae=j(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),je=j(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),Me=j(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ne=j(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Pe=j(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Fe=j(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Ie=j(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Le=j(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Re=j(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ze=j(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Be(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
1
+ import{Gt as e,I as t,Kt as n,N as r,Ot as i,P as a,bt as o,i as s,t as c,vt as l,wt as u,x as d,xt as f,zt as p}from"./Lamp-DtHKJH6P.js";import{C as m,D as h,E as g,O as _,S as v,T as y,_ as b,b as x,o as S,v as C}from"./Panel-BlNr9j6-.js";import*as w from"react";import{createContext as T,createElement as E,forwardRef as ee,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as se,jsx as O,jsxs as k}from"react/jsx-runtime";import A,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";import*as pe from"react-dom";var me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},be=T({}),xe=()=>re(be),Se=ee(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=xe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return E(`svg`,{ref:c,...ve,width:t??l??ve.width,height:t??l??ve.height,stroke:e??f,strokeWidth:m,className:me(`lucide`,p,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>E(e,t)),...Array.isArray(a)?a:[a]])}),j=(e,t)=>{let n=ee(({className:n,...r},i)=>E(Se,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},Ce=j(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),we=j(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Te=j(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ee=j(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),De=j(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Oe=j(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ke=j(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ae=j(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),je=j(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),Me=j(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ne=j(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Pe=j(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Fe=j(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Ie=j(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Le=j(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Re=j(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ze=j(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Be(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
2
2
  `)}var Ve=le`
3
3
  :root {
4
4
  ${({$providers:e})=>Be(e,`light`)}
@@ -1,4 +1,4 @@
1
- import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-C2Q3t5Mn.js";import{C as f,_ as p,b as m,v as h,w as g}from"./Panel-BlNr9j6-.js";import{n as _,r as v,t as y}from"./TokenBreakdown-DM-1HvOr.js";import{n as b,t as x}from"./Chip-BeKVtewW.js";import{i as S,n as C,r as w,t as T}from"./Table-CVDZ69Zx.js";import{useEffect as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import j from"styled-components";function M(e){let[t,n]=D(Date.now);return E(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function N(e,t,n){if(t.length===0||e.requestedModel.toLowerCase().includes(t)||(e.resolvedModel??``).toLowerCase().includes(t)||(e.errorCode??``).toLowerCase().includes(t))return!0;if(n===void 0)return!1;let r=e.credentialId==null?``:n.accounts.get(e.credentialId)??``,i=e.apiKeyId==null?``:n.keys.get(e.apiKeyId)??e.apiKeyId;return r.toLowerCase().includes(t)||i.toLowerCase().includes(t)}function P(e,t,n,r){let i=n.trim().toLowerCase();return e.filter(e=>(t!==`failed`||c(e))&&N(e,i,r))}function F({log:e}){return k(C,{$align:`right`,$mono:!0,...d(e)?{"aria-label":`processing`}:{title:v(e)},children:d(e)?k(y,{}):k(_,{tokens:e})})}function I({rows:e,now:c,names:f,onOpen:_}){return A(T,{children:[k(`thead`,{children:A(`tr`,{children:[k(w,{}),k(w,{$align:`right`,children:`Time`}),k(w,{children:`Requested`}),k(w,{children:`Routed to`}),f===void 0?null:A(O,{children:[k(w,{children:`Account`}),k(w,{children:`Key`})]}),k(w,{$align:`right`,children:`Try`}),k(w,{$align:`right`,children:`TTFT`}),k(w,{$align:`right`,children:`Total`}),k(w,{$align:`right`,children:`Tokens`}),k(w,{$align:`right`,children:`Cost`}),k(w,{children:`Outcome`})]})}),k(`tbody`,{children:e.map(e=>A(S,{$selectable:!0,onClick:()=>_(e),children:[k(C,{children:k(u,{state:l(e),label:a(e)})}),k(C,{$align:`right`,$mono:!0,title:o(e.at),children:s(e.at)}),k(C,{$mono:!0,children:k(g,{style:{display:`block`,maxWidth:`20ch`},children:e.requestedModel||`—`})}),k(C,{children:e.resolvedProvider===null?k(p,{children:d(e)?`routing…`:`not routed`}):A(m,{$gap:1,children:[k(b,{provider:e.resolvedProvider}),k(h,{$dim:!0,children:e.resolvedModel??`—`})]})}),f===void 0?null:A(O,{children:[k(C,{children:k(g,{style:{display:`block`,maxWidth:`18ch`},children:e.credentialId==null?`—`:f.accounts.get(e.credentialId)??i(e.credentialId)})}),k(C,{children:k(g,{style:{display:`block`,maxWidth:`16ch`},title:e.apiKeyId??void 0,children:e.apiKeyId==null?`—`:f.keys.get(e.apiKeyId)??i(e.apiKeyId)})})]}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:e.attempts}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:r(e.ttftMs)}),k(C,{$align:`right`,$mono:!0,children:d(e)?n(Math.max(0,c-e.at)):r(e.durationMs)}),k(F,{log:e}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:t(e.costUsd)}),k(C,{children:d(e)?k(x,{$tone:`accent`,children:`live`}):e.errorCode===null?k(x,{$tone:`ok`,children:e.status}):k(x,{$tone:`down`,children:e.errorCode})})]},e.id))})]})}var L=j.dl`
1
+ import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-DtHKJH6P.js";import{C as f,_ as p,b as m,v as h,w as g}from"./Panel-BlNr9j6-.js";import{n as _,r as v,t as y}from"./TokenBreakdown-BPoXM3JM.js";import{n as b,t as x}from"./Chip-CmL-9rw7.js";import{i as S,n as C,r as w,t as T}from"./Table-CVDZ69Zx.js";import{useEffect as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import j from"styled-components";function M(e){let[t,n]=D(Date.now);return E(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function N(e,t,n){if(t.length===0||e.requestedModel.toLowerCase().includes(t)||(e.resolvedModel??``).toLowerCase().includes(t)||(e.errorCode??``).toLowerCase().includes(t))return!0;if(n===void 0)return!1;let r=e.credentialId==null?``:n.accounts.get(e.credentialId)??``,i=e.apiKeyId==null?``:n.keys.get(e.apiKeyId)??e.apiKeyId;return r.toLowerCase().includes(t)||i.toLowerCase().includes(t)}function P(e,t,n,r){let i=n.trim().toLowerCase();return e.filter(e=>(t!==`failed`||c(e))&&N(e,i,r))}function F({log:e}){return k(C,{$align:`right`,$mono:!0,...d(e)?{"aria-label":`processing`}:{title:v(e)},children:d(e)?k(y,{}):k(_,{tokens:e})})}function I({rows:e,now:c,names:f,onOpen:_}){return A(T,{children:[k(`thead`,{children:A(`tr`,{children:[k(w,{}),k(w,{$align:`right`,children:`Time`}),k(w,{children:`Requested`}),k(w,{children:`Routed to`}),f===void 0?null:A(O,{children:[k(w,{children:`Account`}),k(w,{children:`Key`})]}),k(w,{$align:`right`,children:`Try`}),k(w,{$align:`right`,children:`TTFT`}),k(w,{$align:`right`,children:`Total`}),k(w,{$align:`right`,children:`Tokens`}),k(w,{$align:`right`,children:`Cost`}),k(w,{children:`Outcome`})]})}),k(`tbody`,{children:e.map(e=>A(S,{$selectable:!0,onClick:()=>_(e),children:[k(C,{children:k(u,{state:l(e),label:a(e)})}),k(C,{$align:`right`,$mono:!0,title:o(e.at),children:s(e.at)}),k(C,{$mono:!0,children:k(g,{style:{display:`block`,maxWidth:`20ch`},children:e.requestedModel||`—`})}),k(C,{children:e.resolvedProvider===null?k(p,{children:d(e)?`routing…`:`not routed`}):A(m,{$gap:1,children:[k(b,{provider:e.resolvedProvider}),k(h,{$dim:!0,children:e.resolvedModel??`—`})]})}),f===void 0?null:A(O,{children:[k(C,{children:k(g,{style:{display:`block`,maxWidth:`18ch`},children:e.credentialId==null?`—`:f.accounts.get(e.credentialId)??i(e.credentialId)})}),k(C,{children:k(g,{style:{display:`block`,maxWidth:`16ch`},title:e.apiKeyId??void 0,children:e.apiKeyId==null?`—`:f.keys.get(e.apiKeyId)??i(e.apiKeyId)})})]}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:e.attempts}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:r(e.ttftMs)}),k(C,{$align:`right`,$mono:!0,children:d(e)?n(Math.max(0,c-e.at)):r(e.durationMs)}),k(F,{log:e}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:t(e.costUsd)}),k(C,{children:d(e)?k(x,{$tone:`accent`,children:`live`}):e.errorCode===null?k(x,{$tone:`ok`,children:e.status}):k(x,{$tone:`down`,children:e.errorCode})})]},e.id))})]})}var L=j.dl`
2
2
  display: grid;
3
3
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
4
4
  gap: 6px ${({theme:e})=>e.space(3)};
@@ -1,4 +1,4 @@
1
- import{b as e,p as t,y as n}from"./shared-C47BfV_u.js";import{A as r,I as i,N as a,P as o}from"./Lamp-C2Q3t5Mn.js";import{D as s,a as c,b as l,i as u,r as d,t as f}from"./Panel-BlNr9j6-.js";import{f as p}from"./Rack-sUGRoZUx.js";import{t as m}from"./Readout-D8Ofl3Gz.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(f,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(c,{rows:4}):s?h(d,{legend:o.legend,message:o.message}):l})}var y=_(s)`
1
+ import{b as e,p as t,y as n}from"./shared-oTMOLWMT.js";import{A as r,I as i,N as a,P as o}from"./Lamp-DtHKJH6P.js";import{D as s,a as c,b as l,i as u,r as d,t as f}from"./Panel-BlNr9j6-.js";import{f as p}from"./Rack-_A_3zqxC.js";import{t as m}from"./Readout-D8Ofl3Gz.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(f,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(c,{rows:4}):s?h(d,{legend:o.legend,message:o.message}):l})}var y=_(s)`
2
2
  border-color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.ruleStrong};
3
3
  color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.inkDim};
4
4
  background: ${({theme:e,$on:t})=>t?e.color.accentWash:e.color.panelRaised};
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-sUGRoZUx.js";import*as o from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let[t,n]=o.useState(void 0);return r(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}f(p,`useSize`);var m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Switch`,[_,v]=t(g),[y,b]=_(g);function x(t){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:a,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:p=`on`,internal_do_not_use_render:m}=t,[h,_]=e({prop:r,defaultProp:a??!1,onChange:d,caller:g}),[v,b]=o.useState(null),[x,S]=o.useState(null),C=o.useRef(!1),[w,T]=o.useReducer(e=>e+1,0),E={checked:h,setChecked:_,disabled:s,control:v,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:a,isFormControl:!v||!!l||!!v.closest(`form`),bubbleInput:x,setBubbleInput:S};return c(y,{scope:n,...E,children:k(m)?m(E):i})}h(x,`SwitchProvider`);var S=`SwitchTrigger`,C=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,form:u,value:d,disabled:f,checked:p,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=a(s,g),T=o.useRef(p);return o.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[l,u,_]),c(n.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":A(p),"data-disabled":f?``:void 0,disabled:f,value:d,...r,ref:w,onClick:i(t,e=>{y(),_(e=>!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`SwitchTrigger`)),w=o.forwardRef(h(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return c(x,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:u,required:o,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>l(s,{children:[c(C,{...m,ref:t,__scopeSwitch:n}),e&&c(O,{__scopeSwitch:n})]})})},`Switch`)),T=`SwitchThumb`,E=o.forwardRef(h(function(e,t){let{__scopeSwitch:r,...i}=e,a=b(T,r);return c(n.span,{"data-state":A(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})},`SwitchThumb`)),D=`SwitchBubbleInput`,O=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,hasConsumerStoppedPropagationRef:u,userInteractionCount:d,checked:f,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=a(s,S),w=p(l),T=o.useRef(!1),E=o.useRef(f),O=o.useRef(d);o.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=d!==O.current;O.current=d;let i=E.current!==f;E.current=f;let a=!(r&&u.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,f),e.dispatchEvent(t),T.current=!1}},[x,f,u,d]);let k=o.useRef(f);return c(n.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...r,tabIndex:-1,ref:C,onClick:i(t,e=>{T.current&&e.stopPropagation()}),style:{...r.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e?`checked`:`unchecked`}h(A,`getState`);var j=u(w)`
1
+ import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-_A_3zqxC.js";import*as o from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let[t,n]=o.useState(void 0);return r(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}f(p,`useSize`);var m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Switch`,[_,v]=t(g),[y,b]=_(g);function x(t){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:a,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:p=`on`,internal_do_not_use_render:m}=t,[h,_]=e({prop:r,defaultProp:a??!1,onChange:d,caller:g}),[v,b]=o.useState(null),[x,S]=o.useState(null),C=o.useRef(!1),[w,T]=o.useReducer(e=>e+1,0),E={checked:h,setChecked:_,disabled:s,control:v,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:a,isFormControl:!v||!!l||!!v.closest(`form`),bubbleInput:x,setBubbleInput:S};return c(y,{scope:n,...E,children:k(m)?m(E):i})}h(x,`SwitchProvider`);var S=`SwitchTrigger`,C=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,form:u,value:d,disabled:f,checked:p,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=a(s,g),T=o.useRef(p);return o.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[l,u,_]),c(n.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":A(p),"data-disabled":f?``:void 0,disabled:f,value:d,...r,ref:w,onClick:i(t,e=>{y(),_(e=>!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`SwitchTrigger`)),w=o.forwardRef(h(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return c(x,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:u,required:o,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>l(s,{children:[c(C,{...m,ref:t,__scopeSwitch:n}),e&&c(O,{__scopeSwitch:n})]})})},`Switch`)),T=`SwitchThumb`,E=o.forwardRef(h(function(e,t){let{__scopeSwitch:r,...i}=e,a=b(T,r);return c(n.span,{"data-state":A(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})},`SwitchThumb`)),D=`SwitchBubbleInput`,O=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,hasConsumerStoppedPropagationRef:u,userInteractionCount:d,checked:f,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=a(s,S),w=p(l),T=o.useRef(!1),E=o.useRef(f),O=o.useRef(d);o.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=d!==O.current;O.current=d;let i=E.current!==f;E.current=f;let a=!(r&&u.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,f),e.dispatchEvent(t),T.current=!1}},[x,f,u,d]);let k=o.useRef(f);return c(n.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...r,tabIndex:-1,ref:C,onClick:i(t,e=>{T.current&&e.stopPropagation()}),style:{...r.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e?`checked`:`unchecked`}h(A,`getState`);var j=u(w)`
2
2
  all: unset;
3
3
  width: 30px;
4
4
  height: 16px;
@@ -1,4 +1,4 @@
1
- import{A as e}from"./Lamp-C2Q3t5Mn.js";import{b as t,y as n}from"./Rack-sUGRoZUx.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=t(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),l=new Intl.NumberFormat(`en-US`);function u(e){return`${l.format(e.inputTokens)} input, ${l.format(e.outputTokens)} output, ${l.format(e.cacheReadTokens)} cache read, ${l.format(e.cacheWriteTokens)} cache write tokens`}var d=a.span`
1
+ import{A as e}from"./Lamp-DtHKJH6P.js";import{b as t,y as n}from"./Rack-_A_3zqxC.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=t(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),l=new Intl.NumberFormat(`en-US`);function u(e){return`${l.format(e.inputTokens)} input, ${l.format(e.outputTokens)} output, ${l.format(e.cacheReadTokens)} cache read, ${l.format(e.cacheWriteTokens)} cache write tokens`}var d=a.span`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  flex-wrap: wrap;
@@ -1,4 +1,4 @@
1
- import{C as e,K as t,O as n,S as r,lt as i,o as a,q as o,t as s,w as c,x as l}from"./shared-C47BfV_u.js";import{C as u,L as d,M as f,O as p,S as m,T as h,_ as g,a as _,j as v,m as y,n as b}from"./Lamp-C2Q3t5Mn.js";import{C as x,_ as S,b as C,v as w}from"./Panel-BlNr9j6-.js";import*as T from"react";import{forwardRef as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=[`axis`],M=E((e,t)=>T.createElement(l,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:j,tooltipPayloadSearcher:o,categoricalChartProps:e,ref:t})),N=A(C)`
1
+ import{C as e,K as t,O as n,S as r,lt as i,o as a,q as o,t as s,w as c,x as l}from"./shared-oTMOLWMT.js";import{C as u,L as d,M as f,O as p,S as m,T as h,_ as g,a as _,j as v,m as y,n as b}from"./Lamp-DtHKJH6P.js";import{C as x,_ as S,b as C,v as w}from"./Panel-BlNr9j6-.js";import*as T from"react";import{forwardRef as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=[`axis`],M=E((e,t)=>T.createElement(l,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:j,tooltipPayloadSearcher:o,categoricalChartProps:e,ref:t})),N=A(C)`
2
2
  gap: ${({theme:e})=>e.space(5)};
3
3
  flex-wrap: wrap;
4
4
  `,P=A.div`
@@ -0,0 +1,59 @@
1
+ import{A as e,Et as t,F as n,H as r,Ht as i,Lt as a,P as o,St as s,Tt as c,U as l,b as u,c as d,d as f,ft as p,h as m,it as ee,lt as h,n as g,o as _,ot as v,rt as te,s as y,t as ne,ut as b,v as x,w as S,y as C}from"./Lamp-DtHKJH6P.js";import{C as w,D as T,O as E,_ as D,a as O,b as k,i as A,o as j,r as re,t as M,v as N,x as ie}from"./Panel-BlNr9j6-.js";import{_ as P,b as F,i as ae,m as I,r as L,t as R}from"./Rack-_A_3zqxC.js";import{t as z}from"./CopyValue-CTVbU0O_.js";import{n as B,t as V}from"./chevron-right-BfnK63GB.js";import{t as oe}from"./plus-Cv51cK5k.js";import{t as se}from"./trash-2-CSkf6ME_.js";import{t as ce}from"./Toggle-ChjN-tw1.js";import{t as le}from"./Chip-CmL-9rw7.js";import{i as H,n as U,r as ue,t as W}from"./Field-DcNu4yw-.js";import{t as de}from"./Meter-stpt3vQu.js";import{i as fe,n as G,r as K,t as pe}from"./Table-CVDZ69Zx.js";import{n as me,r as he,t as ge}from"./WindowChart-BPEsEGFL.js";import{Fragment as _e,useCallback as q,useEffect as ve,useState as J}from"react";import{Fragment as Y,jsx as X,jsxs as Z}from"react/jsx-runtime";import Q from"styled-components";var ye=F(`external-link`,[[`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`}]]);function $(e){return e?.authTypes??[]}function be(e){return $(e).includes(`oauth`)?`oauth`:`apiKey`}function xe(e){return e[0]?.id??`anthropic`}var Se={oauth:`Authorize in the browser`,apiKey:`Paste an API key`};function Ce(e){let t=e?.callback;return t===void 0?`code#state`:`${t.uri}?code=…`}var we=Q.ol`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: ${({theme:e})=>e.space(3)};
5
+ `,Te=Q.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
+ `,Ee=Q.p`
15
+ font-size: 12px;
16
+ color: ${({theme:e})=>e.color.down};
17
+ `,De=Q.p`
18
+ font-size: 12px;
19
+ color: ${({theme:e})=>e.color.inkDim};
20
+ `;function Oe({open:e,credentials:t,onOpenChange:n,onConnected:i}){let a=c().data??[],[o,s]=J(()=>xe(a)),u=r(a,o),[d,f]=J(()=>be(r(a,xe(a)))),[p,m]=J(``),h=u?.label??o,[g,_]=J(null),[y,ne]=J(``),[b,x]=J(``),S=(t??[]).filter((e,t,n)=>e.provider===`custom`&&n.findIndex(t=>t.provider===`custom`&&t.providerData.endpointId===e.providerData.endpointId)===t),[C,E]=J(``),[O,A]=J(``),[re,M]=J(`chat_completions`),[N,ie]=J(``),[P,F]=J(null),I=ee(),L=te(),R=v(),B=q(()=>{_(null),ne(``),x(``),E(``),A(``),M(`chat_completions`),ie(``),F(null),m(``),I.reset(),L.reset(),R.reset()},[I,L,R]),V=q(e=>{e||B(),n(e)},[n,B]);return ve(()=>{if(g===null||g.kind!==`device`)return;let e=!1,t=async()=>{try{let t=await l(g.flowId);if(e)return;if(t.status===`complete`){B(),n(!1),i();return}}catch(t){if(e)return;F(j(t)),_(null);return}e||(r=setTimeout(()=>void t(),g.pollIntervalMs))},r=setTimeout(()=>void t(),g.pollIntervalMs);return()=>{e=!0,clearTimeout(r)}},[g,i,n,B]),X(ae,{open:e,onOpenChange:V,title:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:g===null?Z(Y,{children:[X(T,{type:`button`,onClick:()=>V(!1),children:`Cancel`}),X(T,{type:`button`,$variant:`primary`,disabled:I.isPending||R.isPending,onClick:()=>{if(F(null),d===`apiKey`){R.mutate({provider:o,apiKey:N,label:p.trim()||void 0,...o===`custom`?{endpointId:b,endpointLabel:C,origin:O,protocol:re}:{}},{onSuccess:()=>{B(),n(!1),i()},onError:e=>F(j(e))});return}I.mutate({provider:o,label:p.trim().length===0?h:p.trim()},{onSuccess:e=>_(e),onError:e=>F(j(e))})},children:d===`apiKey`?R.isPending?`Adding…`:`Add API key`:I.isPending?`Starting…`:`Start authorization`})]}):g.kind===`device`?X(T,{type:`button`,onClick:()=>V(!1),children:`Cancel`}):Z(Y,{children:[X(T,{type:`button`,onClick:()=>V(!1),children:`Cancel`}),X(T,{type:`button`,$variant:`primary`,disabled:L.isPending||y.trim().length===0,onClick:()=>{g!==null&&(F(null),L.mutate({flowId:g.flowId,code:y.trim()},{onSuccess:()=>{B(),n(!1),i()},onError:e=>F(j(e))}))},children:L.isPending?`Finishing…`:`Finish connecting`})]}),children:Z(we,{children:[g===null?Z(w,{$gap:3,children:[X(W,{label:`Provider`,children:e=>X(H,{...e,value:o,onChange:e=>{let t=e.target.value;s(t),f(be(r(a,t)))},children:a.map(e=>X(`option`,{value:e.id,children:e.label},e.id))})}),$(u).length>1?X(W,{label:`How to connect`,children:e=>X(H,{...e,value:d,onChange:e=>f(e.target.value),children:$(u).map(e=>X(`option`,{value:e,children:Se[e]},e))})}):null,o===`custom`?Z(Y,{children:[S.length===0?null:X(W,{label:`Existing endpoint`,children:e=>Z(H,{...e,value:b,onChange:e=>{let t=S.find(t=>t.providerData.endpointId===e.target.value);if(t===void 0){x(``),E(``),A(``),M(`chat_completions`);return}x(String(t.providerData.endpointId)),E(String(t.providerData.endpointLabel)),A(String(t.providerData.origin)+String(t.providerData.basePath??``)),M(t.providerData.protocol===`responses`?`responses`:`chat_completions`)},children:[X(`option`,{value:``,children:`Create new endpoint`}),S.map(e=>X(`option`,{value:String(e.providerData.endpointId),children:String(e.providerData.endpointLabel)},String(e.providerData.endpointId)))]})}),X(W,{label:`Endpoint ID`,children:e=>X(U,{...e,value:b,onChange:e=>x(e.target.value)})}),X(W,{label:`Endpoint label`,children:e=>X(U,{...e,value:C,onChange:e=>E(e.target.value)})}),X(W,{label:`Server URL`,children:e=>X(U,{...e,value:O,placeholder:`https://server.example/api`,onChange:e=>A(e.target.value)})}),O.trim().toLowerCase().startsWith(`http://`)?X(Ee,{children:`Plaintext transport sends prompts and API keys without TLS.`}):null,X(W,{label:`Protocol`,children:e=>Z(H,{...e,value:re,onChange:e=>M(e.target.value),children:[X(`option`,{value:`chat_completions`,children:`Chat Completions (/v1/chat/completions)`}),X(`option`,{value:`responses`,children:`Responses (/v1/responses)`})]})})]}):null,d===`apiKey`?X(W,{label:`API key`,children:e=>X(U,{...e,type:`password`,value:N,autoComplete:`off`,onChange:e=>ie(e.target.value)})}):null,X(W,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>X(U,{...e,value:p,placeholder:h,onChange:e=>m(e.target.value)})})]}):Z(w,{$gap:3,children:[Z(w,{$gap:1,children:[X(D,{children:`Step 1 — authorize`}),X(k,{$gap:2,children:Z(T,{as:`a`,href:g.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[X(ye,{}),`Open `,h]})}),X(z,{value:g.authorizeUrl,label:`Copy authorization link`})]}),g.userCode===null?null:Z(w,{$gap:1,children:[X(D,{children:`Step 2 — enter this code`}),X(Te,{children:g.userCode})]}),g.kind===`device`?Z(De,{children:[u?.pasteHint??``,` Waiting for authorization…`]}):X(W,{label:`Authorization code`,hint:u?.pasteHint??``,...P===null?{}:{problem:P},children:e=>X(U,{...e,value:y,autoFocus:!0,placeholder:Ce(u),onChange:e=>ne(e.target.value)})})]}),P===null||g?.kind===`pkce`?null:X(Ee,{children:P})]})})}function ke({credentialId:e,windows:n,burn:r,pollIntervalMs:i,now:a}){let o=n.map(e=>({window:e,estimate:_(r,e.windowType),since:he(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??[];return X(w,{$gap:4,children:o.map(e=>X(Ae,{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),pollIntervalMs:i,now:a},e.window.windowType))})}function Ae({window:t,estimate:n,since:r,samples:i,gatewayRate:a,pollIntervalMs:o,now:s}){let c=t.limit===null?`${e(t.used)} used`:`${e(t.used)} of ${e(t.limit)} used`,l=S(t,s),d=n===void 0||f(t,s,o)||n.stale&&!l;return X(me,{live:u(t),samples:i.map(u),since:r,now:s,ratePerHourRatio:C(t,n),exhaustsAt:n?.exhaustsAt??null,survives:n?.survives??null,stale:d,rolledOver:l,spent:c,rateText:n?.ratePerHour===void 0||n.ratePerHour===null?`unknown`:`${e(n.ratePerHour)}/h`,extraFact:X(ge,{legend:`This gateway accounts for`,value:a?.gatewayRatePerHour===void 0||a.gatewayRatePerHour===null?`unknown`:`${e(a.gatewayRatePerHour)} tokens/h`})})}var je=Q(M)`
21
+ border-left: 3px solid ${({$provider:e})=>I(e)};
22
+ `,Me=Q(U)`
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
+ `,Ne=Q(ue)`
37
+ width: 62px;
38
+ height: 26px;
39
+ `,Pe=Q.span`
40
+ display: block;
41
+ padding-left: 9px;
42
+ font-size: 11px;
43
+ color: ${({theme:e})=>e.color.inkDim};
44
+ `,Fe=Q.div`
45
+ display: grid;
46
+ /* Bar, figure, legend. The figure has a column of its own so the legends stay
47
+ aligned down the stack whether a window reads 4% or 100%. */
48
+ grid-template-columns: 96px 34px 1fr;
49
+ align-items: center;
50
+ min-width: 208px;
51
+ gap: 6px;
52
+ `,Ie=Q(N)`
53
+ font-size: 11px;
54
+ text-align: right;
55
+ `,Le=Q.div`
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: 4px;
59
+ `;function Re(){let e=i();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function ze(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 Be(){let{cadence:e}=P(),t=b(),i=h(e(1e4,`res:credentials`)),l=a(),u=s(),f=c(),ee=p(),{commit:v}=Re(),[te,S]=J(!1),[C,j]=J(null),[N,F]=J(new Set),ae=e=>F(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),I=Date.now(),z=t.data??[],H=f.data??[],U=e=>r(H,e)?.order??1/0,ue=[...new Set(z.map(e=>e.provider))].sort((e,t)=>U(e)-U(t)),W=e=>r(H,e)?.label??e,me=d(i.data?.health??[],e=>e.credentialId),he=d(i.data?.quota??[],e=>e.credentialId),ge=d(i.data?.burn??[],e=>e.credentialId),q=l.data?.quotaPollIntervalMs??3e5,ve=z.filter(e=>e.enabled).length,Q=t.isLoading?`Reading connected accounts…`:z.length===0?`No provider credentials are connected, so every request fails at the router.`:`${ve} of ${z.length} accounts are enabled and eligible for routing.`;return Z(Y,{children:[X(R,{legend:`Accounts`,title:`Provider accounts`,summary:Q,actions:Z(T,{type:`button`,$variant:`primary`,onClick:()=>S(!0),children:[X(oe,{}),`Connect an account`]})}),t.isError?X(M,{legend:`Accounts`,children:X(A,{error:t.error,onRetry:()=>void t.refetch()})}):t.isLoading?X(M,{legend:`Accounts`,children:X(O,{rows:5})}):z.length===0?X(M,{legend:`Accounts`,children:X(re,{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:X(T,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>S(!0),children:`Connect an account`})})}):X(w,{$gap:4,children:ue.map(e=>{let t=z.filter(t=>t.provider===e);return X(je,{$provider:e,legend:W(e),meta:`${t.length} account${t.length===1?``:`s`}`,flush:!0,children:X(ie,{children:Z(pe,{children:[X(`thead`,{children:Z(`tr`,{children:[X(K,{$width:`24%`,children:`Account`}),X(K,{$width:`20%`,children:`Sign-in`}),X(K,{$align:`right`,$width:`86px`,children:`Tier`}),X(K,{$align:`right`,$width:`94px`,children:`Weight`}),X(K,{$align:`center`,$width:`86px`,children:`Enabled`}),X(K,{$width:`240px`,children:`Quota`}),X(K,{$align:`right`,$width:`130px`,children:`Token expires`}),X(K,{$width:`76px`})]})}),X(`tbody`,{children:t.map(e=>{let t=y(me.get(e.id)??[],I,e.enabled,e.disabledReason),r=he.get(e.id)??[],i=ge.get(e.id)??[],a=x(r),s=N.has(e.id);return Z(_e,{children:[Z(fe,{children:[Z(G,{children:[Z(k,{$gap:2,children:[X(ne,{state:t.state,label:t.note===``?`healthy`:t.note}),X(Me,{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}v(e.id,{label:n})}})]}),t.note===``?null:X(Pe,{children:t.note})]}),X(G,{children:Z(k,{$gap:1,children:[X(le,{children:e.authType===`oauth`?`oauth`:`api key`}),e.accountEmail===null?null:X(D,{children:e.accountEmail})]})}),X(G,{$align:`right`,children:X(Ne,{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}v(e.id,{tier:n})}})}),X(G,{$align:`right`,children:X(Ne,{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}v(e.id,{weight:n})}})}),X(G,{$align:`center`,children:X(ce,{checked:e.enabled,label:`Route to ${e.label}`,onCheckedChange:t=>v(e.id,{enabled:t})})}),X(G,{children:a.length===0?X(D,{children:`unknown`}):X(Le,{children:a.map(({window:e,fraction:t})=>Z(Fe,{children:[X(de,{fraction:t,label:`${g[e.windowType]} window, ${Math.round(t*100)}% used`}),X(Ie,{children:o(t,0)}),X(D,{children:m(e,I,q,n,_(i,e.windowType))})]},e.windowType))})}),X(G,{$align:`right`,$mono:!0,children:e.expiresAt===null?`never`:n(e.expiresAt,I)}),X(G,{$align:`right`,children:Z(k,{$gap:1,$justify:`flex-end`,children:[r.length===0?null:X(E,{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:()=>ae(e.id),children:X(s?B:V,{})}),X(E,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${e.label}`,title:`Remove ${e.label}`,onClick:()=>j(e),children:X(se,{})})]})})]}),s?X(fe,{children:X(G,{colSpan:9,children:X(ke,{credentialId:e.id,windows:r,burn:i,pollIntervalMs:q,now:I})})}):null]},e.id)})})]})})},e)})}),X(Oe,{open:te,credentials:t.data??[],onOpenChange:S,onConnected:()=>void t.refetch()}),X(L,{open:C!==null,onOpenChange:e=>{e||j(null)},title:`Remove account`,body:C===null?``:`Removing "${C.label}" deletes its stored token. Any model target pointing at ${W(C.provider)} loses this account, and reconnecting means authorizing again.`+ze(C,u.data),confirmLabel:`Remove account`,busy:ee.isPending,onConfirm:()=>{C!==null&&ee.mutate(C.id,{onSettled:()=>j(null)})}})]})}var Ve=Be;export{Ve as component};
@@ -1,4 +1,4 @@
1
- import{A as e,Ct as t,at as n,z as r}from"./Lamp-C2Q3t5Mn.js";import{a as i,b as a,i as o,r as s,t as c,y as ee}from"./Panel-BlNr9j6-.js";import{_ as l,t as u}from"./Rack-sUGRoZUx.js";import{a as d,c as f,o as p,s as m}from"./index-pZbadEun.js";import{i as h}from"./Field-DcNu4yw-.js";import{useQueryClient as g}from"@tanstack/react-query";import{useLayoutEffect as te,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";var C={debug:10,info:20,warn:30,error:40};function w(e){return typeof e==`string`&&e in C}function T(e,t){return!w(t)||e.level===null||C[e.level]>=C[t]}function E(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&&!w(r)||i!==null&&typeof i!=`string`?null:{raw:t,at:n,level:r,msg:i}}function D(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=E(e);if(t===null)return null;n.push(t)}return n}var O=[100,200,500],ne=[{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`}],re=S(a)`
1
+ import{A as e,Ct as t,at as n,z as r}from"./Lamp-DtHKJH6P.js";import{a as i,b as a,i as o,r as s,t as c,y as ee}from"./Panel-BlNr9j6-.js";import{_ as l,t as u}from"./Rack-_A_3zqxC.js";import{a as d,c as f,o as p,s as m}from"./index-BTE8vyBz.js";import{i as h}from"./Field-DcNu4yw-.js";import{useQueryClient as g}from"@tanstack/react-query";import{useLayoutEffect as te,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";var C={debug:10,info:20,warn:30,error:40};function w(e){return typeof e==`string`&&e in C}function T(e,t){return!w(t)||e.level===null||C[e.level]>=C[t]}function E(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&&!w(r)||i!==null&&typeof i!=`string`?null:{raw:t,at:n,level:r,msg:i}}function D(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=E(e);if(t===null)return null;n.push(t)}return n}var O=[100,200,500],ne=[{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`}],re=S(a)`
2
2
  gap: ${({theme:e})=>e.space(2)};
3
3
  flex-wrap: wrap;
4
4
  `,k=S(h)`
@@ -1,4 +1,4 @@
1
- import{A as e,Bt as t,D as n,G as r,Mt as i,N as a,P as o,Wt as s,X as c,ct as l,dt as u,gt as d,j as f,kt as p,mt as m}from"./Lamp-C2Q3t5Mn.js";import{C as h,D as g,_,a as v,b as y,g as b,i as x,o as S,r as ee,t as C,w,x as T}from"./Panel-BlNr9j6-.js";import{b as E,r as D,t as O}from"./Rack-sUGRoZUx.js";import{t as k}from"./trash-2-DmtElUHr.js";import{r as A,t as j}from"./Field-DcNu4yw-.js";import{t as M}from"./Meter-stpt3vQu.js";import{i as N,n as P,r as F,t as I}from"./Table-CVDZ69Zx.js";import{t as L}from"./Readout-D8Ofl3Gz.js";import{n as R}from"./reasons-Du1OBWAM.js";import{useQueryClient as z}from"@tanstack/react-query";import{useCallback as B,useState as V}from"react";import{Fragment as H,jsx as U,jsxs as W}from"react/jsx-runtime";import G from"styled-components";var K=E(`camera`,[[`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=E(`minimize-2`,[[`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`}]]),J=[{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}],Y=G.p`
1
+ import{A as e,Bt as t,D as n,G as r,Mt as i,N as a,P as o,Wt as s,X as c,ct as l,dt as u,gt as d,j as f,kt as p,mt as m}from"./Lamp-DtHKJH6P.js";import{C as h,D as g,_,a as v,b as y,g as b,i as x,o as S,r as ee,t as C,w,x as T}from"./Panel-BlNr9j6-.js";import{b as E,r as D,t as O}from"./Rack-_A_3zqxC.js";import{t as k}from"./trash-2-CSkf6ME_.js";import{r as A,t as j}from"./Field-DcNu4yw-.js";import{t as M}from"./Meter-stpt3vQu.js";import{i as N,n as P,r as F,t as I}from"./Table-CVDZ69Zx.js";import{t as L}from"./Readout-D8Ofl3Gz.js";import{n as R}from"./reasons-Du1OBWAM.js";import{useQueryClient as z}from"@tanstack/react-query";import{useCallback as B,useState as V}from"react";import{Fragment as H,jsx as U,jsxs as W}from"react/jsx-runtime";import G from"styled-components";var K=E(`camera`,[[`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=E(`minimize-2`,[[`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`}]]),J=[{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}],Y=G.p`
2
2
  font-size: 12px;
3
3
  color: ${({theme:e})=>e.color.down};
4
4
  `,X=G.p`
@@ -1,4 +1,4 @@
1
- import{A as e,F as t,Gt as n,I as r,Lt as i,N as a,P as o,St as s,Ut as c,c as l,f as u,h as d,i as f,k as p,lt as m,n as h,o as g,p as _,s as v,t as y,u as b,ut as x,v as ee,x as S,xt as C}from"./Lamp-C2Q3t5Mn.js";import{C as w,D as T,S as E,_ as D,b as O,g as k,i as A,r as j,t as M,v as N,w as P,x as F}from"./Panel-BlNr9j6-.js";import{_ as I,f as L,m as R,t as z}from"./Rack-sUGRoZUx.js";import{n as B,t as te}from"./TokenBreakdown-DM-1HvOr.js";import{n as ne,t as V}from"./Chip-BeKVtewW.js";import{t as re}from"./Meter-stpt3vQu.js";import{i as H,n as U,r as W,t as G}from"./Table-CVDZ69Zx.js";import{t as K}from"./Readout-D8Ofl3Gz.js";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var ie=X(P)`
1
+ import{A as e,F as t,Gt as n,I as r,Lt as i,N as a,P as o,St as s,Ut as c,c as l,f as u,h as d,i as f,k as p,lt as m,n as h,o as g,p as _,s as v,t as y,u as b,ut as x,v as ee,x as S,xt as C}from"./Lamp-DtHKJH6P.js";import{C as w,D as T,S as E,_ as D,b as O,g as k,i as A,r as j,t as M,v as N,w as P,x as F}from"./Panel-BlNr9j6-.js";import{_ as I,f as L,m as R,t as z}from"./Rack-_A_3zqxC.js";import{n as B,t as te}from"./TokenBreakdown-BPoXM3JM.js";import{n as ne,t as V}from"./Chip-CmL-9rw7.js";import{t as re}from"./Meter-stpt3vQu.js";import{i as H,n as U,r as W,t as G}from"./Table-CVDZ69Zx.js";import{t as K}from"./Readout-D8Ofl3Gz.js";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var ie=X(P)`
2
2
  font-weight: 500;
3
3
  display: block;
4
4
  max-width: 24ch;
@@ -15,7 +15,7 @@ import{A as e,F as t,Gt as n,I as r,Lt as i,N as a,P as o,St as s,Ut as c,c as l
15
15
  display: flex;
16
16
  flex-direction: column;
17
17
  gap: 4px;
18
- `;function se(e){let t=null;for(let n of e)n.stale||n.survives!==!1||n.exhaustsAt===null||(t===null||n.exhaustsAt<t)&&(t=n.exhaustsAt);return t}function ce(e,t){return e===null?t===null?0:1:t===null?-1:e-t}function le({credentials:r,health:i,quota:o,burn:s,usage:c,quotaPollIntervalMs:u,now:f}){let p=l(i,e=>e.credentialId),m=l(o,e=>e.credentialId),_=l(s,e=>e.credentialId),b=new Map(c.map(e=>[e.key,e])),x={down:0,warn:1,ok:2,idle:3,live:3},S=r.map(e=>{let t=_.get(e.id)??[];return{credential:e,status:v(p.get(e.id)??[],f,e.enabled,e.disabledReason),quota:ee(m.get(e.id)??[]),burn:t,exhaustsAt:se(t),usage:b.get(e.id)}}).sort((e,t)=>x[e.status.state]-x[t.status.state]||ce(e.exhaustsAt,t.exhaustsAt)||e.credential.tier-t.credential.tier);return J(M,{legend:`Accounts`,meta:`${r.length} connected`,flush:!0,actions:J(T,{as:n,to:`/accounts`,$size:`sm`,children:`Manage accounts`}),children:r.length===0?J(j,{legend:`No accounts`,message:`The gateway has no provider credentials, so every request will fail. Connect one to start routing.`,action:J(T,{as:n,to:`/accounts`,$variant:`primary`,$size:`sm`,children:`Connect an account`})}):J(F,{children:Y(G,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Account`}),J(W,{children:`Provider`}),J(W,{$align:`right`,children:`Tier`}),J(W,{children:`Quota`}),J(W,{$align:`right`,children:`TTFT`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Last used`})]})}),J(`tbody`,{children:S.map(({credential:n,status:r,quota:i,burn:o,usage:s})=>Y(H,{children:[J(U,{children:Y(O,{$gap:2,children:[J(y,{state:r.state,label:r.note===``?`healthy`:r.note}),Y(`div`,{children:[J(ie,{children:n.label}),r.note===``?null:J(Z,{children:r.note})]})]})}),J(U,{children:J(ne,{provider:n.provider})}),J(U,{$align:`right`,$mono:!0,children:n.tier}),J(U,{children:i.length===0?J(Z,{children:`unknown`}):J(oe,{children:i.map(({window:e,fraction:n})=>Y(ae,{children:[J(re,{fraction:n,label:`${h[e.windowType]} window, ${Math.round(n*100)}% used`}),J(D,{children:d(e,f,u,t,g(o,e.windowType))})]},e.windowType))})}),J(U,{$align:`right`,$mono:!0,children:a(r.ttftMs)}),J(U,{$align:`right`,$mono:!0,children:s===void 0?`—`:e(s.requests)}),J(U,{$align:`right`,$mono:!0,children:t(r.lastUsedAt,f)})]},n.id))})]})})})}var ue=X.ul`
18
+ `;function se(e){let t=null;for(let n of e)n.stale||n.survives!==!1||n.exhaustsAt===null||(t===null||n.exhaustsAt<t)&&(t=n.exhaustsAt);return t}function ce(e,t){return e===null?t===null?0:1:t===null?-1:e-t}function le({credentials:r,health:i,quota:a,burn:o,usage:s,lastUsed:c,quotaPollIntervalMs:u,now:f}){let p=l(i,e=>e.credentialId),m=l(a,e=>e.credentialId),_=l(o,e=>e.credentialId),b=new Map(s.map(e=>[e.key,e])),x={down:0,warn:1,ok:2,idle:3,live:3},S=r.map(e=>{let t=_.get(e.id)??[];return{credential:e,status:v(p.get(e.id)??[],f,e.enabled,e.disabledReason),quota:ee(m.get(e.id)??[]),burn:t,exhaustsAt:se(t),usage:b.get(e.id)}}).sort((e,t)=>x[e.status.state]-x[t.status.state]||ce(e.exhaustsAt,t.exhaustsAt)||e.credential.tier-t.credential.tier);return J(M,{legend:`Accounts`,meta:`${r.length} connected`,flush:!0,actions:J(T,{as:n,to:`/accounts`,$size:`sm`,children:`Manage accounts`}),children:r.length===0?J(j,{legend:`No accounts`,message:`The gateway has no provider credentials, so every request will fail. Connect one to start routing.`,action:J(T,{as:n,to:`/accounts`,$variant:`primary`,$size:`sm`,children:`Connect an account`})}):J(F,{children:Y(G,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Account`}),J(W,{children:`Provider`}),J(W,{$align:`right`,children:`Tier`}),J(W,{children:`Quota`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Last used`})]})}),J(`tbody`,{children:S.map(({credential:n,status:r,quota:i,burn:a,usage:o})=>Y(H,{children:[J(U,{children:Y(O,{$gap:2,children:[J(y,{state:r.state,label:r.note===``?`healthy`:r.note}),Y(`div`,{children:[J(ie,{children:n.label}),r.note===``?null:J(Z,{children:r.note})]})]})}),J(U,{children:J(ne,{provider:n.provider})}),J(U,{$align:`right`,$mono:!0,children:n.tier}),J(U,{children:i.length===0?J(Z,{children:`unknown`}):J(oe,{children:i.map(({window:e,fraction:n})=>Y(ae,{children:[J(re,{fraction:n,label:`${h[e.windowType]} window, ${Math.round(n*100)}% used`}),J(D,{children:d(e,f,u,t,g(a,e.windowType))})]},e.windowType))})}),J(U,{$align:`right`,$mono:!0,children:o===void 0?`—`:e(o.requests)}),J(U,{$align:`right`,$mono:!0,children:t(c[n.id]??null,f)})]},n.id))})]})})})}var ue=X.ul`
19
19
  display: flex;
20
20
  flex-direction: column;
21
21
  `,de=X.li`
@@ -59,4 +59,4 @@ import{A as e,F as t,Gt as n,I as r,Lt as i,N as a,P as o,St as s,Ut as c,c as l
59
59
  display: grid;
60
60
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
61
61
  gap: ${({theme:e})=>e.space(3)};
62
- `;function xe({logs:t,windowMs:n,now:i}){let s=t.filter(e=>i-e.at<=n),c=S(s,n),l=f(s,{now:i,spanMs:n,count:32}),u=c.errorRate>=.25?`down`:c.errorRate>=.05?`warn`:`ok`,d=c.inputTokens+c.outputTokens+c.cacheReadTokens+c.cacheWriteTokens;return Y(be,{children:[J(K,{legend:`Requests`,value:e(c.requests),unit:`${c.ratePerMin.toFixed(1)}/min`,trace:J(L,{values:l.map(e=>e.total),overlay:l.map(e=>e.errors),label:`${c.requests} requests, ${c.errors} of them failed`})}),J(K,{legend:`Error rate`,value:o(c.errorRate),unit:`${e(c.errors)} failed`,tone:c.requests===0?`ink`:u,trace:J(L,{values:l.map(e=>e.errors),scaleTo:Math.max(...l.map(e=>e.total)),color:`var(--down)`,label:`${c.errors} failed requests against ${c.requests} total`})}),J(K,{legend:`Total tokens`,value:e(d),unit:J(B,{tokens:c}),trace:J(L,{values:l.map(e=>e.tokens),label:`token volume over the window, ${d.toLocaleString(`en-US`)} total`})}),J(K,{legend:`Time to first token`,value:a(c.ttftP50),unit:`p95 ${a(c.ttftP95)}`,trace:J(L,{values:l.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${a(c.ttftP50)}`})}),J(K,{legend:`Spend`,value:r(c.costUsd),unit:`${e(c.inputTokens+c.outputTokens)} tokens`,trace:J(L,{values:l.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${r(c.costUsd)} total`})})]})}var $=36e5;function Se(){let{cadence:e}=I(),t=x(),n=m(e(1e4,`res:credentials`)),r=s(),a=C(500,e(1e4,`res:logs`)),o=i(),u=Date.now(),d=Math.floor((u-$)/6e4)*6e4,f=c({groupBy:`credential`,since:d},e(6e4,`res:usage`)),p=t.data??[],h=l(n.data?.health??[],e=>e.credentialId),g=p.filter(e=>v(h.get(e.id)??[],u,e.enabled,e.disabledReason).state===`down`),_=t.isLoading||a.isLoading?`Reading the gateway…`:p.length===0?`No accounts are connected, so every request fails at the router.`:g.length>0?`${g.length} account${g.length===1?` is`:`s are`} out of rotation.`:`All ${p.length} accounts are answering. Nothing needs attention.`;return Y(q,{children:[J(z,{legend:`Rack`,title:`Gateway`,summary:_}),a.isError?J(M,{legend:`Traffic`,children:J(A,{legend:`The gateway did not answer`,error:a.error,onRetry:()=>void a.refetch()})}):Y(w,{$gap:4,children:[J(xe,{logs:a.data??[],windowMs:$,now:u}),J(le,{credentials:p,health:n.data?.health??[],quota:n.data?.quota??[],burn:n.data?.burn??[],usage:f.data??[],quotaPollIntervalMs:o.data?.quotaPollIntervalMs??3e5,now:u}),Y(k,{$min:`340px`,$gap:4,children:[J(ye,{models:r.data??[],logs:a.data??[]}),J(me,{logs:a.data??[]})]})]})]})}var Ce=Se;export{Ce as component};
62
+ `;function xe({logs:t,windowMs:n,now:i}){let s=t.filter(e=>i-e.at<=n),c=S(s,n),l=f(s,{now:i,spanMs:n,count:32}),u=c.errorRate>=.25?`down`:c.errorRate>=.05?`warn`:`ok`,d=c.inputTokens+c.outputTokens+c.cacheReadTokens+c.cacheWriteTokens;return Y(be,{children:[J(K,{legend:`Requests`,value:e(c.requests),unit:`${c.ratePerMin.toFixed(1)}/min`,trace:J(L,{values:l.map(e=>e.total),overlay:l.map(e=>e.errors),label:`${c.requests} requests, ${c.errors} of them failed`})}),J(K,{legend:`Error rate`,value:o(c.errorRate),unit:`${e(c.errors)} failed`,tone:c.requests===0?`ink`:u,trace:J(L,{values:l.map(e=>e.errors),scaleTo:Math.max(...l.map(e=>e.total)),color:`var(--down)`,label:`${c.errors} failed requests against ${c.requests} total`})}),J(K,{legend:`Total tokens`,value:e(d),unit:J(B,{tokens:c}),trace:J(L,{values:l.map(e=>e.tokens),label:`token volume over the window, ${d.toLocaleString(`en-US`)} total`})}),J(K,{legend:`Time to first token`,value:a(c.ttftP50),unit:`p95 ${a(c.ttftP95)}`,trace:J(L,{values:l.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${a(c.ttftP50)}`})}),J(K,{legend:`Spend`,value:r(c.costUsd),unit:`${e(c.inputTokens+c.outputTokens)} tokens`,trace:J(L,{values:l.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${r(c.costUsd)} total`})})]})}var $=36e5;function Se(){let{cadence:e}=I(),t=x(),n=m(e(1e4,`res:credentials`)),r=s(),a=C(500,e(1e4,`res:logs`)),o=i(),u=Date.now(),d=Math.floor((u-$)/6e4)*6e4,f=c({groupBy:`credential`,since:d},e(6e4,`res:usage`)),p=t.data??[],h=l(n.data?.health??[],e=>e.credentialId),g=p.filter(e=>v(h.get(e.id)??[],u,e.enabled,e.disabledReason).state===`down`),_=t.isLoading||a.isLoading?`Reading the gateway…`:p.length===0?`No accounts are connected, so every request fails at the router.`:g.length>0?`${g.length} account${g.length===1?` is`:`s are`} out of rotation.`:`All ${p.length} accounts are answering. Nothing needs attention.`;return Y(q,{children:[J(z,{legend:`Rack`,title:`Gateway`,summary:_}),a.isError?J(M,{legend:`Traffic`,children:J(A,{legend:`The gateway did not answer`,error:a.error,onRetry:()=>void a.refetch()})}):Y(w,{$gap:4,children:[J(xe,{logs:a.data??[],windowMs:$,now:u}),J(le,{credentials:p,health:n.data?.health??[],quota:n.data?.quota??[],burn:n.data?.burn??[],usage:f.data??[],lastUsed:n.data?.lastUsed??{},quotaPollIntervalMs:o.data?.quotaPollIntervalMs??3e5,now:u}),Y(k,{$min:`340px`,$gap:4,children:[J(ye,{models:r.data??[],logs:a.data??[]}),J(me,{logs:a.data??[]})]})]})]})}var Ce=Se;export{Ce as component};
@@ -1,4 +1,4 @@
1
- import{At as e,Ft as t,Pt as n,St as r,_t as i,j as a,st as o}from"./Lamp-C2Q3t5Mn.js";import{C as s,D as c,O as l,_ as u,a as d,b as f,i as p,o as m,r as h,t as g,v as _,w as v,x as y}from"./Panel-BlNr9j6-.js";import{b,i as x,r as S,t as C,v as w}from"./Rack-sUGRoZUx.js";import{t as T}from"./CopyValue-NTHhiCuT.js";import{n as E,t as D}from"./chevron-right-S84SGCvk.js";import{t as O}from"./plus-E7qLz9CF.js";import{t as k}from"./Toggle-DwKz1aVq.js";import{t as A}from"./Chip-BeKVtewW.js";import{n as j,r as M,t as N}from"./Field-DcNu4yw-.js";import{t as P}from"./Meter-stpt3vQu.js";import{i as F,n as I,r as L,t as ee}from"./Table-CVDZ69Zx.js";import{Fragment as R,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import U from"styled-components";var te=b(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),W=[{dimension:`requests`,window:`1m`},{dimension:`requests`,window:`5h`},{dimension:`requests`,window:`1w`},{dimension:`tokens`,window:`1m`},{dimension:`tokens`,window:`5h`},{dimension:`tokens`,window:`1w`},{dimension:`spend`,window:`5h`},{dimension:`spend`,window:`1w`},{dimension:`concurrency`,window:null}];function G(e){return e.window===null?e.dimension:`${e.dimension}:${e.window}`}var ne={requests:`Requests`,tokens:`Tokens`,spend:`Spend`,concurrency:`Concurrent`},re={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function K(e){let t=ne[e.dimension];return e.window===null?t:`${t} ${re[e.window]}`}function q(e,t){return e===`spend`?`$${t<1?t.toFixed(4):t.toFixed(2)}`:t.toLocaleString(`en-US`)}function J(e){return e.used===null||e.limit<=0?null:Math.max(0,e.used/e.limit)}function ie(e){let t=null,n=-1;for(let r of e){let e=J(r);e!==null&&e>n&&(t=r,n=e)}return t}function Y(e){let t={};for(let e of W)t[G(e)]=``;if(e===null)return t;for(let n of W){let r=n.window===null?e.concurrency:n.dimension===`requests`?e.requests?.[n.window]:n.dimension===`tokens`?e.tokens?.[n.window]:n.window===`1m`?void 0:e.spend?.[n.window];r!=null&&(t[G(n)]=String(r))}return t}function X(e){let t={},n={},r={},i;for(let a of W){let o=(e[G(a)]??``).trim();if(o.length===0)continue;let s=Number(o),c=a.dimension===`spend`;if(!Number.isFinite(s)||s<=0||!c&&!Number.isInteger(s))return{problem:c?`${K(a)} must be an amount above zero, or blank for no limit.`:`${K(a)} must be a whole number above zero, or blank for no limit.`};a.window===null?i=s:a.dimension===`requests`?t[a.window]=s:a.dimension===`tokens`?n[a.window]=s:a.window!==`1m`&&(r[a.window]=s)}return{limits:{...Object.keys(t).length>0?{requests:t}:{},...Object.keys(n).length>0?{tokens:n}:{},...Object.keys(r).length>0?{spend:r}:{},...i===void 0?{}:{concurrency:i}}}}var ae=U.div`
1
+ import{At as e,Ft as t,Pt as n,St as r,_t as i,j as a,st as o}from"./Lamp-DtHKJH6P.js";import{C as s,D as c,O as l,_ as u,a as d,b as f,i as p,o as m,r as h,t as g,v as _,w as v,x as y}from"./Panel-BlNr9j6-.js";import{b,i as x,r as S,t as C,v as w}from"./Rack-_A_3zqxC.js";import{t as T}from"./CopyValue-CTVbU0O_.js";import{n as E,t as D}from"./chevron-right-BfnK63GB.js";import{t as O}from"./plus-Cv51cK5k.js";import{t as k}from"./Toggle-ChjN-tw1.js";import{t as A}from"./Chip-CmL-9rw7.js";import{n as j,r as M,t as N}from"./Field-DcNu4yw-.js";import{t as P}from"./Meter-stpt3vQu.js";import{i as F,n as I,r as L,t as ee}from"./Table-CVDZ69Zx.js";import{Fragment as R,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import U from"styled-components";var te=b(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),W=[{dimension:`requests`,window:`1m`},{dimension:`requests`,window:`5h`},{dimension:`requests`,window:`1w`},{dimension:`tokens`,window:`1m`},{dimension:`tokens`,window:`5h`},{dimension:`tokens`,window:`1w`},{dimension:`spend`,window:`5h`},{dimension:`spend`,window:`1w`},{dimension:`concurrency`,window:null}];function G(e){return e.window===null?e.dimension:`${e.dimension}:${e.window}`}var ne={requests:`Requests`,tokens:`Tokens`,spend:`Spend`,concurrency:`Concurrent`},re={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function K(e){let t=ne[e.dimension];return e.window===null?t:`${t} ${re[e.window]}`}function q(e,t){return e===`spend`?`$${t<1?t.toFixed(4):t.toFixed(2)}`:t.toLocaleString(`en-US`)}function J(e){return e.used===null||e.limit<=0?null:Math.max(0,e.used/e.limit)}function ie(e){let t=null,n=-1;for(let r of e){let e=J(r);e!==null&&e>n&&(t=r,n=e)}return t}function Y(e){let t={};for(let e of W)t[G(e)]=``;if(e===null)return t;for(let n of W){let r=n.window===null?e.concurrency:n.dimension===`requests`?e.requests?.[n.window]:n.dimension===`tokens`?e.tokens?.[n.window]:n.window===`1m`?void 0:e.spend?.[n.window];r!=null&&(t[G(n)]=String(r))}return t}function X(e){let t={},n={},r={},i;for(let a of W){let o=(e[G(a)]??``).trim();if(o.length===0)continue;let s=Number(o),c=a.dimension===`spend`;if(!Number.isFinite(s)||s<=0||!c&&!Number.isInteger(s))return{problem:c?`${K(a)} must be an amount above zero, or blank for no limit.`:`${K(a)} must be a whole number above zero, or blank for no limit.`};a.window===null?i=s:a.dimension===`requests`?t[a.window]=s:a.dimension===`tokens`?n[a.window]=s:a.window!==`1m`&&(r[a.window]=s)}return{limits:{...Object.keys(t).length>0?{requests:t}:{},...Object.keys(n).length>0?{tokens:n}:{},...Object.keys(r).length>0?{spend:r}:{},...i===void 0?{}:{concurrency:i}}}}var ae=U.div`
2
2
  display: grid;
3
3
  grid-template-columns: repeat(3, minmax(0, 1fr));
4
4
  gap: ${({theme:e})=>e.space(2)};
@@ -1,4 +1,4 @@
1
- import{A as e,B as t,Dt as n,_t as r,l as i,q as a,u as o,ut as s,xt as c}from"./Lamp-C2Q3t5Mn.js";import{C as l,D as u,_ as d,a as f,b as p,i as m,r as h,t as g,x as _}from"./Panel-BlNr9j6-.js";import{_ as v,i as y,t as b}from"./Rack-sUGRoZUx.js";import{t as x}from"./Chip-BeKVtewW.js";import{i as S,n as C}from"./Field-DcNu4yw-.js";import{i as w,n as T,r as E,t as D}from"./RequestTable-C2RLARWy.js";import{useMemo as O,useState as k}from"react";import{Fragment as A,jsx as j,jsxs as M}from"react/jsx-runtime";import N from"styled-components";var P={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},F=new Intl.NumberFormat(`en-US`),I=N.p`
1
+ import{A as e,B as t,Dt as n,_t as r,l as i,q as a,u as o,ut as s,xt as c}from"./Lamp-DtHKJH6P.js";import{C as l,D as u,_ as d,a as f,b as p,i as m,r as h,t as g,x as _}from"./Panel-BlNr9j6-.js";import{_ as v,i as y,t as b}from"./Rack-_A_3zqxC.js";import{t as x}from"./Chip-CmL-9rw7.js";import{i as S,n as C}from"./Field-DcNu4yw-.js";import{i as w,n as T,r as E,t as D}from"./RequestTable-Cokk7wKP.js";import{useMemo as O,useState as k}from"react";import{Fragment as A,jsx as j,jsxs as M}from"react/jsx-runtime";import N from"styled-components";var P={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},F=new Intl.NumberFormat(`en-US`),I=N.p`
2
2
  font-size: 12px;
3
3
  color: ${({theme:e})=>e.color.inkDim};
4
4
  max-width: 62ch;
@@ -1,4 +1,4 @@
1
- import{E as e,H as t,Lt as n,St as r,Tt as i,ht as a,jt as o,pt as s,ut as c}from"./Lamp-C2Q3t5Mn.js";import{C as l,D as u,O as d,S as f,_ as p,a as m,b as h,i as g,o as _,r as v,t as y,v as b,w as x}from"./Panel-BlNr9j6-.js";import{b as S,m as C,r as w,t as T}from"./Rack-sUGRoZUx.js";import{t as E}from"./plus-E7qLz9CF.js";import{t as D}from"./trash-2-DmtElUHr.js";import{t as O}from"./Toggle-DwKz1aVq.js";import{n as ee,t as k}from"./Chip-BeKVtewW.js";import{i as A,n as j,r as M,t as N}from"./Field-DcNu4yw-.js";import{t as P}from"./Meter-stpt3vQu.js";import{useEffect as te,useId as ne,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var re=S(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ie=S(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),B=[`tier`,`health`,`quota`,`cost`,`latency`,`load`],ae={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price of this request against the other candidates`,latency:`Observed time to first token`,load:`Requests in flight on this pair right now`},oe=z.li`
1
+ import{E as e,H as t,Lt as n,St as r,Tt as i,ht as a,jt as o,pt as s,ut as c}from"./Lamp-DtHKJH6P.js";import{C as l,D as u,O as d,S as f,_ as p,a as m,b as h,i as g,o as _,r as v,t as y,v as b,w as x}from"./Panel-BlNr9j6-.js";import{b as S,m as C,r as w,t as T}from"./Rack-_A_3zqxC.js";import{t as E}from"./plus-Cv51cK5k.js";import{t as D}from"./trash-2-CSkf6ME_.js";import{t as O}from"./Toggle-ChjN-tw1.js";import{n as ee,t as k}from"./Chip-CmL-9rw7.js";import{i as A,n as j,r as M,t as N}from"./Field-DcNu4yw-.js";import{t as P}from"./Meter-stpt3vQu.js";import{useEffect as te,useId as ne,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var re=S(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ie=S(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),B=[`tier`,`health`,`quota`,`cost`,`latency`,`load`],ae={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price of this request against the other candidates`,latency:`Observed time to first token`,load:`Requests in flight on this pair right now`},oe=z.li`
2
2
  padding: ${({theme:e})=>e.space(2)} 0;
3
3
  border-bottom: 1px solid ${({theme:e})=>e.color.rule};
4
4
 
@@ -1,4 +1,4 @@
1
- import{wt as e}from"./Lamp-C2Q3t5Mn.js";import{t}from"./preload-helper-BC9bKUg1.js";import{C as n,a as r,c as i,d as a,f as o,i as s,l as c,r as l,t as u}from"./Panel-BlNr9j6-.js";import{t as d}from"./Rack-sUGRoZUx.js";import{t as f}from"./index-pZbadEun.js";import{Component as p,Suspense as m,createContext as h,lazy as g,useContext as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";import{pluginApiPath as C}from"@omnigateway/dashboard-sdk";var w=new Map;function T(e){let t=w.get(e);if(t!==void 0)return t;let n={get:(t,n)=>c(C(e,t),n),post:(t,n)=>a(C(e,t),n),put:(t,n)=>o(C(e,t),n),del:t=>i(C(e,t))};return w.set(e,n),n}var E=h(e=>t(()=>import(e),[]));E.Provider;function D(){return _(E)}function O(e,t){let n=e?.default;if(n==null)throw Error(`plugin ${t} has no default export from definePluginUI`);if(typeof n.mount!=`function`)throw Error(`plugin ${t} exported a default without a mount function`);return n}function k(e,t,n){return g(async()=>{let r=O(await n(t),e);return{default:()=>r.mount({pluginId:e,api:T(e)})}})}var A=S.p`
1
+ import{wt as e}from"./Lamp-DtHKJH6P.js";import{t}from"./preload-helper-BknjH67x.js";import{C as n,a as r,c as i,d as a,f as o,i as s,l as c,r as l,t as u}from"./Panel-BlNr9j6-.js";import{t as d}from"./Rack-_A_3zqxC.js";import{t as f}from"./index-BTE8vyBz.js";import{Component as p,Suspense as m,createContext as h,lazy as g,useContext as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";import{pluginApiPath as C}from"@omnigateway/dashboard-sdk";var w=new Map;function T(e){let t=w.get(e);if(t!==void 0)return t;let n={get:(t,n)=>c(C(e,t),n),post:(t,n)=>a(C(e,t),n),put:(t,n)=>o(C(e,t),n),del:t=>i(C(e,t))};return w.set(e,n),n}var E=h(e=>t(()=>import(e),[]));E.Provider;function D(){return _(E)}function O(e,t){let n=e?.default;if(n==null)throw Error(`plugin ${t} has no default export from definePluginUI`);if(typeof n.mount!=`function`)throw Error(`plugin ${t} exported a default without a mount function`);return n}function k(e,t,n){return g(async()=>{let r=O(await n(t),e);return{default:()=>r.mount({pluginId:e,api:T(e)})}})}var A=S.p`
2
2
  font-size: 13px;
3
3
  color: ${({theme:e})=>e.color.down};
4
4
  `,j=S.p`
@@ -1,4 +1,4 @@
1
- import{It as e,J as t,K as n,Lt as r,Nt as i,St as a,Vt as o,Y as s}from"./Lamp-C2Q3t5Mn.js";import{C as c,D as l,S as u,_ as d,a as f,b as p,g as m,h,i as g,o as _,t as v,v as y}from"./Panel-BlNr9j6-.js";import{t as ee}from"./Rack-sUGRoZUx.js";import{t as b}from"./Toggle-DwKz1aVq.js";import{i as x,n as S,t as C}from"./Field-DcNu4yw-.js";import{t as te}from"./Meter-stpt3vQu.js";import{n as w}from"./reasons-Du1OBWAM.js";import{useEffect as ne,useId as T,useState as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=12,M=A.p`
1
+ import{It as e,J as t,K as n,Lt as r,Nt as i,St as a,Vt as o,Y as s}from"./Lamp-DtHKJH6P.js";import{C as c,D as l,S as u,_ as d,a as f,b as p,g as m,h,i as g,o as _,t as v,v as y}from"./Panel-BlNr9j6-.js";import{t as ee}from"./Rack-_A_3zqxC.js";import{t as b}from"./Toggle-ChjN-tw1.js";import{i as x,n as S,t as C}from"./Field-DcNu4yw-.js";import{t as te}from"./Meter-stpt3vQu.js";import{n as w}from"./reasons-Du1OBWAM.js";import{useEffect as ne,useId as T,useState as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=12,M=A.p`
2
2
  font-size: 12px;
3
3
  color: ${({theme:e})=>e.color.inkDim};
4
4
  max-width: 62ch;