omnigateway 0.5.1 → 0.6.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.
- package/README.md +23 -5
- package/bin/omni.js +6430 -5518
- package/gateway.js +6051 -4991
- package/package.json +1 -1
- package/public/assets/Chip-BWxO0uV7.js +32 -0
- package/public/assets/CopyValue-DIR5A6PG.js +27 -0
- package/public/assets/{Field-B2rnk3JM.js → Field-DI5YTYOX.js} +1 -1
- package/public/assets/Lamp-DN2EKL4m.js +25 -0
- package/public/assets/Panel-BCpZVY4U.js +198 -0
- package/public/assets/Rack-B03tpeW-.js +466 -0
- package/public/assets/{Readout-CZfn5JDy.js → Readout-B0TZE8aA.js} +1 -1
- package/public/assets/RequestTable-D4z82uxG.js +11 -0
- package/public/assets/SummaryDeck-CzozuXOu.js +15 -0
- package/public/assets/{Toggle-BvOELhpy.js → Toggle-ByxBCMfb.js} +1 -1
- package/public/assets/TokenBreakdown-BMEiZhRX.js +31 -0
- package/public/assets/{WindowChart-Bvbkz9rt.js → WindowChart-nxC4SCRC.js} +2 -2
- package/public/assets/_app-D9B6OIjd.js +1 -0
- package/public/assets/_app.accounts-BiRGhH3s.js +59 -0
- package/public/assets/{_app.console-C4x5F3d0.js → _app.console-CZiI6B3b.js} +4 -4
- package/public/assets/_app.database-Y3lFDxoP.js +24 -0
- package/public/assets/_app.index-BZCUXxIF.js +62 -0
- package/public/assets/_app.keys-DRfXCzMJ.js +82 -0
- package/public/assets/_app.logs-BQT3kFZr.js +58 -0
- package/public/assets/_app.models-eOJ6ofIb.js +148 -0
- package/public/assets/_app.plugins._pluginId-CtEAGvad.js +2 -0
- package/public/assets/_app.plugins._pluginId-jaswB8Z5.js +20 -0
- package/public/assets/_app.settings-CG63splg.js +58 -0
- package/public/assets/_app.usage-BaT54Vee.js +76 -0
- package/public/assets/{chevron-right-mGs1is3r.js → chevron-right-0adI8395.js} +1 -1
- package/public/assets/client-Pvf9SEam.js +39 -0
- package/public/assets/index-Cn4_VeBU.js +13 -0
- package/public/assets/{login-bJoYdBqx.js → login-BSWCo_Fz.js} +4 -4
- package/public/assets/login-C7v-Fr28.js +2 -0
- package/public/assets/plus-B_f8M9yB.js +1 -0
- package/public/assets/preload-helper-CD37DT-E.js +1 -0
- package/public/assets/{shared-DQOWYTp3.js → shared-dShKzjig.js} +3 -3
- package/public/assets/stream-BXI9HD3l.js +1 -0
- package/public/assets/{trash-2-BDA1rQVQ.js → trash-2-DrDlpCqO.js} +1 -1
- package/public/index.html +8 -4
- package/public/shared/dashboard-sdk.js +1 -1
- package/public/assets/Chip-BltJSw8A.js +0 -32
- package/public/assets/CopyValue-DNNJGDI5.js +0 -27
- package/public/assets/Match-CvkEmOIG.js +0 -1
- package/public/assets/Panel-BeQOQoap.js +0 -25
- package/public/assets/Rack-DdhpgQWD.js +0 -316
- package/public/assets/RequestTable-I1TrD689.js +0 -11
- package/public/assets/States-2kaQxx-s.js +0 -54
- package/public/assets/SummaryDeck-BisdRswW.js +0 -15
- package/public/assets/TokenBreakdown-En1JT4tT.js +0 -31
- package/public/assets/_app-a3VUev6k.js +0 -1
- package/public/assets/_app.accounts-CYPB-7Xt.js +0 -59
- package/public/assets/_app.database-B-9oB52r.js +0 -24
- package/public/assets/_app.index-NBeanmyf.js +0 -62
- package/public/assets/_app.keys-DK9jdOqT.js +0 -82
- package/public/assets/_app.logs-Dr6fApsE.js +0 -58
- package/public/assets/_app.models-CGBQ2QaS.js +0 -148
- package/public/assets/_app.plugins._pluginId-DXzhupNH.js +0 -20
- package/public/assets/_app.settings-zTFRyxhZ.js +0 -58
- package/public/assets/_app.usage-BCCimHY0.js +0 -76
- package/public/assets/catalog-BBKm8Ih8.js +0 -1
- package/public/assets/client-CQGHWD56.js +0 -39
- package/public/assets/index-C3LoGDKu.js +0 -178
- package/public/assets/matchContext-BOenO3J2.js +0 -1
- package/public/assets/plus-Bqi8Y2Xd.js +0 -1
- package/public/assets/queries-GAue98pY.js +0 -145
- package/public/assets/stream-Bu-m1Z1Y.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./Rack-DdhpgQWD.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import{useMutation as e,useQuery as t,useQueryClient as n}from"@tanstack/react-query";import*as r from"react";import i,{useCallback as a,useDebugValue as o,useEffect as s,useMemo as c,useRef as l,useSyncExternalStore as u}from"react";import{jsx as d}from"react/jsx-runtime";import{flushSync as f}from"react-dom";import p,{css as m,keyframes as h}from"styled-components";var g=r.use,_=r.useLayoutEffect;function v(e,t,n={},i){r.useEffect(()=>{if(!e.current||i||typeof IntersectionObserver!=`function`)return;let r=new IntersectionObserver(([e])=>{t(e)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,i,n,e])}function y(e){let t=r.useRef(null);return r.useImperativeHandle(e,()=>t.current,[]),t}function b(e){return e[e.length-1]}function x(e){return typeof e==`function`}function ee(e,t){return x(e)?e(t):e}var S=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;function te(e){for(let t in e)if(S.call(e,t))return!0;return!1}var ne=()=>Object.create(null),re=(e,t)=>w(e,t,ne);function w(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ie(e)&&ie(i);if(!a&&!(E(e)&&E(i)))return i;let o=a?e:T(e);if(!o)return i;let s=a?i:T(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:S.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=w(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function T(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(!C.call(e,r))return!1;t.push(r)}return t}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`))}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(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(!O(e[r],t[r],n))return!1;return!0}if(E(e)&&E(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!O(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||!O(e[o],t[o],n)))return!1;return i===a}return!1}function ae(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 oe=/[\x00-\x1f\x7f"<>`{}]/g;function se(e){return e.replace(oe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ce(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 se(t)}var le=[`http:`,`https:`,`mailto:`,`tel:`];function ue(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function de(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+=ce(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ce(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function fe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function pe(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 k(){throw Error(`Invariant failed`)}function A(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 j=4,M=5;function N(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function me(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=N(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,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 P(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=me(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=I(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),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=L(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=I(r);e.kind=M,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=I(r);e.kind=j,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)P(e,t,r,c,i,a,o,s)}function F(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 I(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 L(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 R(e,t){let n=I(`/`),r=new Uint16Array(6),i=[];for(let t of e)P(!1,r,t,1,n,0,i);for(let e of i)e.sort(F);t.masksTree=n,t.flatCache=A(1e3)}function he(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=z(e,t.masksTree);return t.flatCache.set(e,r),r}function ge(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=I(`/`),P(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),z(r,o,n)}function _e(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=z(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=V(a.route)),t.matchCache.set(r,a),a}function ve(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ye(e,t=!1,n){let r=I(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;P(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&k(),o[e.id]=e,c!==0&&e.path){let t=ve(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(F);return{processedTree:{segmentTree:r,singleCache:A(1e3),matchCache:A(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function z(e,t,n=!1){let r=e.split(`/`),i=xe(e,r,t,n);if(!i)return null;let[a]=B(e,r,i);return{route:i.node.route,rawParams:a}}function B(e,t,n){let r=be(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===j)break;if(u.kind===M){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??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,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??0,r=u.suffix?.length??0,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??0),e.length-(t.suffix?.length??0)),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 V(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function be(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function xe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!b(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&&!U(l,n))continue;if(i.parse){if(!Ce(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==j&&U(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===j||i.kind===2)&&U(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&&(Ce(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Se(f,o))return n;U(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(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)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.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+H(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.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+H(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+H(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+H(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 H(e,t){return 2**(e-t-1)}function Se(e,t){return e===2**(t-1)-1}function Ce(e,t,n){let r,i;try{[r,i]=B(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 U(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===j)>(e.node.kind===j)||t.node.kind===j==(e.node.kind===j)&&t.node.depth>e.node.depth)))}function we(e){return Te(e.filter(e=>e!==void 0).join(`/`))}function Te(e){return e.replace(/\/{2,}/g,`/`)}function Ee(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function De(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Oe(e){return De(Ee(e))}function W(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ke(e,t,n){return W(e,n)===W(t,n)}function Ae({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&b(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(b(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Te(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function je(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 Me(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Pe(e,n)).join(`/`):Pe(r,n):r}function Ne({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=me(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=Me(`_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=Me(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=Me(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Pe(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var Fe=`Error preloading route! ☝️`;function Ie({children:e,fallback:t=null}){return d(i.Fragment,{children:Le()?e:t})}function Le(){return i.useSyncExternalStore(Re,()=>!0,()=>!1)}function Re(){return()=>{}}var ze=r.createContext(null);function Be(e){return r.useContext(ze)}function Ve(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var He=typeof Object.is==`function`?Object.is:Ve;function Ue(e,t,n,r,i){let a=l(null),d;a.current===null?(d={hasValue:!1,value:null},a.current=d):d=a.current;let[f,p]=c(()=>{let e=!1,a,o,s=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&d.hasValue){let e=d.value;if(i(e,n))return o=e,e}return o=n,n}let n=o;if(He(a,t))return n;let s=r(t);return i?.(n,s)?(a=t,n):(a=t,o=s,s)},c=n===void 0?null:n;return[()=>s(t()),c===null?void 0:()=>s(c())]},[t,n,r,i,d]),m=u(e,f,p);return s(()=>{d.hasValue=!0,d.value=m},[m,d]),o(m),m}function We(e,t){return e===t}function Ge(e,t,n=We){let r=a(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=a(()=>e?.get(),[e]);return Ue(r,i,i,t,n)}function Ke(e){let t=Be();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qe(e){let t=r.useRef(e);return O(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Je(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ye(e,t,n){if(e?.external)return ue(e.href,n)?void 0:e.href;if(!at(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ue(t,n)?void 0:t}catch{}}function Xe(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!ke(e.pathname,t.pathname,r))return!1}else{let n=W(e.pathname,r),i=W(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!O(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Ze(e,t){let n=Be(),i=y(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:b,target:x,disabled:S,style:C,className:te,onClick:ne,onBlur:re,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:ie,params:O,search:ae,hash:oe,state:se,mask:ce,reloadDocument:le,unsafeRelative:ue,from:de,_fromLocation:fe,...pe}=e,k=Le(),A=qe(e.search),j=qe(e.params),M=qe(s),N=r.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,A,j,e.state,e.mask,e.unsafeRelative]),me=r.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...N}),r=it(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,S),i=Ye(r,c,n.protocolAllowlist);return[r?.href,i,Xe(e,t,M,n.basepath,k,i!==void 0)]},[M,S,k,N,n,c]),[P,F,I]=Ge(n.stores.location,me,Je),L=I?ee(a,{})??$e:Qe,R=I?Qe:ee(o,{})??Qe,he=[te,L.className,R.className].filter(Boolean).join(` `),ge=(C||L.style||R.style)&&{...C,...L.style,...R.style},[_e,ve]=r.useState(!1),ye=r.useRef(!1),z=e.reloadDocument||F?!1:l??n.options.defaultPreload,B=u??n.options.defaultPreloadDelay??0,V=r.useCallback(()=>{n.preloadRoute(N).catch(e=>{console.warn(e),console.warn(Fe)})},[n,N]);v(i,r.useCallback(e=>{e?.isIntersecting&&V()},[V]),rt,!!S||z!==`viewport`),r.useEffect(()=>{ye.current||!S&&z===`render`&&(V(),ye.current=!0)},[S,V,z]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!st(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),f(()=>{ve(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ve(!1)});n.navigate({...N,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie})}};if(F)return{...pe,ref:i,href:F,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...te&&{className:te},...ne&&{onClick:ne},...re&&{onBlur:re},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let xe=e=>{if(S||z!==`intent`)return;if(!B){V();return}let t=e.currentTarget;if(G.has(t))return;let n=setTimeout(()=>{G.delete(t),V()},B);G.set(t,n)},H=e=>{S||z!==`intent`||V()},Se=e=>{if(S||!z||!B)return;let t=e.currentTarget,n=G.get(t);n&&(clearTimeout(n),G.delete(t))};return{...pe,...L,...R,href:P,ref:i,onClick:K([ne,be]),onBlur:K([re,Se]),onFocus:K([w,xe]),onMouseEnter:K([T,xe]),onMouseLeave:K([E,Se]),onTouchStart:K([D,H]),disabled:!!S,target:x,...ge&&{style:ge},...he&&{className:he},...S&&et,...I&&tt,...k&&_e&&nt}}var Qe={},$e={className:`active`},et={role:`link`,"aria-disabled":!0},tt={"data-status":`active`,"aria-current":`page`},nt={"data-transitioning":`transitioning`},G=new WeakMap,rt={rootMargin:`100px`},K=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function it(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function at(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ot=r.forwardRef((e,t)=>{let{_asChild:n,...i}=e,{type:a,...o}=Ze(i,t),s=typeof i.children==`function`?i.children({isActive:o[`data-status`]===`active`}):i.children;if(!n){let{disabled:e,...t}=o;return r.createElement(`a`,t,s)}return r.createElement(n,o,s)});function st(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var ct={primary:m`
|
|
2
|
-
background: ${({theme:e})=>e.color.accent};
|
|
3
|
-
color: ${({theme:e})=>e.color.accentInk};
|
|
4
|
-
border-color: ${({theme:e})=>e.color.accent};
|
|
5
|
-
|
|
6
|
-
&:hover:not(:disabled) {
|
|
7
|
-
filter: brightness(1.08);
|
|
8
|
-
}
|
|
9
|
-
`,default:m`
|
|
10
|
-
background: ${({theme:e})=>e.color.panelRaised};
|
|
11
|
-
color: ${({theme:e})=>e.color.ink};
|
|
12
|
-
border-color: ${({theme:e})=>e.color.ruleStrong};
|
|
13
|
-
|
|
14
|
-
&:hover:not(:disabled) {
|
|
15
|
-
border-color: ${({theme:e})=>e.color.accent};
|
|
16
|
-
color: ${({theme:e})=>e.color.accent};
|
|
17
|
-
}
|
|
18
|
-
`,ghost:m`
|
|
19
|
-
background: transparent;
|
|
20
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
21
|
-
border-color: transparent;
|
|
22
|
-
|
|
23
|
-
&:hover:not(:disabled) {
|
|
24
|
-
background: ${({theme:e})=>e.color.panelRaised};
|
|
25
|
-
color: ${({theme:e})=>e.color.ink};
|
|
26
|
-
}
|
|
27
|
-
`,danger:m`
|
|
28
|
-
background: transparent;
|
|
29
|
-
color: ${({theme:e})=>e.color.down};
|
|
30
|
-
border-color: ${({theme:e})=>e.color.down};
|
|
31
|
-
|
|
32
|
-
&:hover:not(:disabled) {
|
|
33
|
-
background: ${({theme:e})=>e.color.downWash};
|
|
34
|
-
}
|
|
35
|
-
`},lt={sm:m`
|
|
36
|
-
height: 24px;
|
|
37
|
-
padding: 0 ${({theme:e})=>e.space(2)};
|
|
38
|
-
font-size: 11px;
|
|
39
|
-
`,md:m`
|
|
40
|
-
height: 30px;
|
|
41
|
-
padding: 0 ${({theme:e})=>e.space(3)};
|
|
42
|
-
font-size: 13px;
|
|
43
|
-
`},ut=p.button`
|
|
44
|
-
display: inline-flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
gap: ${({theme:e})=>e.space(1.5)};
|
|
48
|
-
border: 1px solid transparent;
|
|
49
|
-
border-radius: ${({theme:e})=>e.radius.control};
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
white-space: nowrap;
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
transition:
|
|
54
|
-
background 120ms ease,
|
|
55
|
-
color 120ms ease,
|
|
56
|
-
border-color 120ms ease;
|
|
57
|
-
|
|
58
|
-
${({$size:e})=>lt[e??`md`]}
|
|
59
|
-
${({$variant:e})=>ct[e??`default`]}
|
|
60
|
-
|
|
61
|
-
&:disabled {
|
|
62
|
-
opacity: 0.45;
|
|
63
|
-
cursor: not-allowed;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
svg {
|
|
67
|
-
width: 14px;
|
|
68
|
-
height: 14px;
|
|
69
|
-
}
|
|
70
|
-
`,dt=p(ut)`
|
|
71
|
-
padding: 0;
|
|
72
|
-
width: ${({$size:e})=>e===`sm`?`24px`:`30px`};
|
|
73
|
-
`,ft=p.span`
|
|
74
|
-
font-size: 10px;
|
|
75
|
-
font-weight: 600;
|
|
76
|
-
font-stretch: 74%;
|
|
77
|
-
letter-spacing: 0.16em;
|
|
78
|
-
text-transform: uppercase;
|
|
79
|
-
color: ${({theme:e})=>e.color.inkFaint};
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
`,pt=p.span`
|
|
82
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
83
|
-
font-variant-numeric: tabular-nums;
|
|
84
|
-
font-size: ${({$size:e})=>e??`12px`};
|
|
85
|
-
color: ${({theme:e,$dim:t})=>t===!0?e.color.inkDim:`inherit`};
|
|
86
|
-
`,mt=p.span`
|
|
87
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
88
|
-
`,ht=p.div`
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: ${({$align:e})=>e??`center`};
|
|
91
|
-
justify-content: ${({$justify:e})=>e??`flex-start`};
|
|
92
|
-
gap: ${({theme:e,$gap:t})=>e.space(t??2)};
|
|
93
|
-
${({$wrap:e})=>e===!0?`flex-wrap: wrap;`:``}
|
|
94
|
-
min-width: 0;
|
|
95
|
-
`,gt=p.div`
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
gap: ${({theme:e,$gap:t})=>e.space(t??2)};
|
|
99
|
-
min-width: 0;
|
|
100
|
-
`,_t=p.div`
|
|
101
|
-
display: grid;
|
|
102
|
-
grid-template-columns: repeat(auto-fit, minmax(${({$min:e})=>e??`220px`}, 1fr));
|
|
103
|
-
gap: ${({theme:e,$gap:t})=>e.space(t??3)};
|
|
104
|
-
/* Panels size to their content; a short one does not stretch to match a tall one.
|
|
105
|
-
$stretch opts a grid out of that, for a row of tiles that read as one
|
|
106
|
-
instrument: there, one card carrying a meter leaves the rest looking cropped
|
|
107
|
-
rather than merely shorter. */
|
|
108
|
-
align-items: ${({$stretch:e})=>e===!0?`stretch`:`start`};
|
|
109
|
-
`;p.hr`
|
|
110
|
-
height: 1px;
|
|
111
|
-
border: 0;
|
|
112
|
-
margin: 0;
|
|
113
|
-
background: ${({theme:e})=>e.color.rule};
|
|
114
|
-
`;var vt=p.div`
|
|
115
|
-
flex: 1 1 auto;
|
|
116
|
-
min-width: 0;
|
|
117
|
-
`,yt=p.div`
|
|
118
|
-
overflow-x: auto;
|
|
119
|
-
overscroll-behavior-x: contain;
|
|
120
|
-
`,bt=p.span`
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
text-overflow: ellipsis;
|
|
123
|
-
white-space: nowrap;
|
|
124
|
-
min-width: 0;
|
|
125
|
-
`;p.span`
|
|
126
|
-
position: absolute;
|
|
127
|
-
width: 1px;
|
|
128
|
-
height: 1px;
|
|
129
|
-
padding: 0;
|
|
130
|
-
margin: -1px;
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
clip-path: inset(50%);
|
|
133
|
-
white-space: nowrap;
|
|
134
|
-
`;var xt=h`
|
|
135
|
-
0%, 100% { opacity: 1; }
|
|
136
|
-
50% { opacity: 0.35; }
|
|
137
|
-
`,St=m`
|
|
138
|
-
animation: ${xt} 2.4s ease-in-out infinite;
|
|
139
|
-
`,Ct=m`
|
|
140
|
-
background-image: repeating-linear-gradient(
|
|
141
|
-
to bottom,
|
|
142
|
-
var(--grid-line) 0 1px,
|
|
143
|
-
transparent 1px 4px
|
|
144
|
-
);
|
|
145
|
-
`,wt=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}get isUnauthenticated(){return this.status===401||this.code===`AUTH`}};function Tt(e){if(typeof e!=`object`||!e)return!1;let t=e.error;return typeof t!=`object`||!t?!1:typeof t.message==`string`}async function q(e,t={}){let n=t.method??`GET`,r=t.body instanceof Blob?t.body:null,i={method:n,credentials:`same-origin`,headers:t.body===void 0?{}:{"content-type":r===null?`application/json`:`application/octet-stream`},...t.body===void 0?{}:{body:r===null?JSON.stringify(t.body):r},...t.signal===void 0?{}:{signal:t.signal}},a=await fetch(e,i),o=t.accept??[],s=null;if(a.status!==204){let e=await a.text();if(e.length>0)try{s=JSON.parse(e)}catch{s=null}}if(!a.ok&&!o.includes(a.status)){let e=Tt(s)?s.error.code??`INTERNAL`:`INTERNAL`,t=Tt(s)?s.error.message:`request failed with status ${a.status}`;throw new wt(a.status,String(e),t)}return{status:a.status,data:s}}async function J(e,t){return(await q(e,t===void 0?{}:{signal:t})).data}async function Y(e,t){return(await q(e,{method:`POST`,...t===void 0?{}:{body:t}})).data}async function X(e,t){return(await q(e,{method:`PUT`,body:t})).data}async function Et(e,t){return(await q(e,{method:`PATCH`,body:t})).data}async function Z(e){return(await q(e,{method:`DELETE`})).data}function Q(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r.length===0?e:`${e}?${r}`}var $={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)=>[`console`,e,t],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`]};function Dt(){return t({queryKey:$.status,queryFn:({signal:e})=>J(`/api/status`,e),staleTime:3e4})}function Ot(){return t({queryKey:$.credentials,queryFn:async({signal:e})=>(await J(`/api/credentials`,e)).credentials})}function kt(e=1e4){return t({queryKey:$.credentialHealth,queryFn:({signal:e})=>J(`/api/credentials/health`,e),refetchInterval:e})}function At(e,n=!0){return t({queryKey:$.quotaHistory(e),enabled:n,queryFn:({signal:t})=>J(Q(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function jt(){return t({queryKey:$.models,queryFn:async({signal:e})=>(await J(`/api/models`,e)).models})}function Mt(){return t({queryKey:$.keys,queryFn:async({signal:e})=>(await J(`/api/keys`,e)).keys})}var Nt={queryKey:$.settings,queryFn:({signal:e})=>J(`/api/settings`,e)};function Pt(){return t({...Nt,select:e=>e.settings})}function Ft(){return t({...Nt,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function It(){return t({...Nt,select:e=>e.bodyLoggingAllowed})}function Lt(e,n){return t({queryKey:$.agentSetup(e,n),enabled:n!==void 0,queryFn:async({signal:t})=>(await J(Q(`/api/agent-setup`,{client:e,...n??{}}),t)).files})}function Rt(e,n=6e4){return t({queryKey:$.usage(e),queryFn:async({signal:t})=>(await J(Q(`/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:n})}var zt=2e3;function Bt(e=100,n=zt){return t({queryKey:$.logs(e),queryFn:async({signal:t})=>(await J(Q(`/api/logs`,{limit:e}),t)).logs,refetchInterval:n})}function Vt(e){return t({queryKey:$.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>J(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Ht=5e3;function Ut(e=200,n=``,r=Ht){return t({queryKey:$.console(e,n),queryFn:async({signal:t})=>J(Q(`/api/console`,{lines:e,...n===``?{}:{level:n}}),t),refetchInterval:r})}function Wt(){return t({queryKey:$.database,queryFn:({signal:e})=>J(`/api/database`,e),refetchInterval:!1})}function Gt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Kt(){return t({queryKey:$.snapshots,queryFn:async({signal:e})=>(await J(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function qt(e){e.invalidateQueries({queryKey:$.database})}function Jt(){let t=n();return e({mutationFn:()=>Y(`/api/database/snapshots`),onSuccess:()=>qt(t)})}function Yt(){let t=n();return e({mutationFn:e=>X(`/api/database/retention`,e),onSuccess:()=>{qt(t),t.invalidateQueries({queryKey:$.settings})}})}function Xt(){let t=n();return e({mutationFn:()=>Y(`/api/database/vacuum`),onSuccess:()=>qt(t)})}function Zt(){let t=n();return e({mutationFn:e=>Z(`/api/database/snapshots/${encodeURIComponent(e)}`),onSuccess:()=>qt(t)})}function Qt(){return e({mutationFn:e=>Y(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function $t(){return e({mutationFn:e=>Y(`/api/database/import`,e)})}function en(){return t({queryKey:$.lifecycle,queryFn:({signal:e})=>J(`/api/lifecycle`,e),refetchInterval:!1})}function tn(){return e({mutationFn:()=>Y(`/api/lifecycle/restart`)})}function nn(){return e({mutationFn:()=>Y(`/api/lifecycle/shutdown`)})}function rn(){let t=n();return e({mutationFn:({mode:e,secret:t})=>e===`client`?Y(`/api/client/login`,{key:t}):Y(`/api/login`,{password:t,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>t.invalidateQueries()})}function an(){let t=n();return e({mutationFn:e=>Y(`/api/setup`,{password:e}),onSuccess:()=>t.invalidateQueries()})}function on(){let t=n();return e({mutationFn:()=>Y(`/api/logout`),onSuccess:()=>{t.clear()}})}function sn(){let t=n();return e({mutationFn:()=>Y(`/api/client/logout`),onSuccess:()=>t.clear()})}function cn(){return t({queryKey:$.clientSummary,queryFn:({signal:e})=>J(`/api/client/summary`,e)})}function ln(e,n=6e4){return t({queryKey:$.clientUsage(e),queryFn:({signal:t})=>J(Q(`/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:n})}function un(e=100,n=zt){return t({queryKey:$.clientLogs(e),queryFn:async({signal:t})=>(await J(Q(`/api/client/logs`,{limit:e}),t)).logs,refetchInterval:n})}function dn(e=6e4){return t({queryKey:$.clientQuota,queryFn:async({signal:e})=>(await J(`/api/client/quota`,e)).accounts,refetchInterval:e})}function fn(e,n=!0){return t({queryKey:$.clientQuotaHistory(e),enabled:n,queryFn:({signal:t})=>J(Q(`/api/client/quota/history`,{since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:3e5})}function pn(){let t=n();return e({mutationFn:({id:e,patch:t})=>Et(`/api/credentials/${e}`,t),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function mn(){let t=n();return e({mutationFn:e=>Z(`/api/credentials/${e}`),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function hn(){let t=n();return e({mutationFn:e=>X(`/api/models/${e.id}`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function gn(){let t=n();return e({mutationFn:e=>Z(`/api/models/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function _n(){return e({mutationFn:({modelId:e,need:t})=>Y(`/api/models/${e}/dry-run`,t)})}function vn(){let t=n();return e({mutationFn:e=>Y(`/api/keys`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function yn(){let t=n();return e({mutationFn:({id:e,limits:t})=>X(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function bn(){let t=n();return e({mutationFn:({id:e,modelAllowlist:t})=>X(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function xn(){let t=n();return e({mutationFn:e=>Z(`/api/keys/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function Sn(){let t=n();return e({mutationFn:e=>X(`/api/settings`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.settings})})}function Cn(){return e({mutationFn:e=>X(`/api/settings/password`,e)})}function wn(){let t=n();return e({mutationFn:e=>X(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>t.invalidateQueries({queryKey:$.status})})}function Tn(){return e({mutationFn:e=>Y(`/api/connect/start`,e)})}function En(){let t=n();return e({mutationFn:e=>Y(`/api/credentials`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function Dn(){let t=n();return e({mutationFn:e=>Y(`/api/connect/finish`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function On(){return t({queryKey:$.plugins,queryFn:async({signal:e})=>(await J(`/api/plugins`,e)).plugins,staleTime:3e5})}async function kn(e){let t=await q(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}export{pn as $,re as $t,Mt as A,we as At,Qt as B,ye as Bt,Ot as C,Ue as Ct,Zt as D,Te as Dt,gn as E,Ie as Et,jt as F,V as Ft,yn as G,de as Gt,hn as H,k as Ht,On as I,he as It,Pt as J,ee as Jt,bn as K,O as Kt,At as L,_e as Lt,rn as M,Oe as Mt,on as N,Ee as Nt,_n as O,je as Ot,Bt as P,De as Pt,Dt as Q,b as Qt,Vt as R,ge as Rt,kt as S,Ge as St,mn as T,ze as Tt,Yt as U,le as Ut,xn as V,A as Vt,Sn as W,pe as Wt,nn as X,ue as Xt,an as Y,te as Yt,Kt as Z,ae as Zt,Tn as _,Ct as _t,Gt as a,Y as at,vn as b,ot as bt,It as c,ft as ct,un as d,ht as dt,w as en,Rt as et,dn as f,yt as ft,Dn as g,St as gt,ln as h,bt as ht,$ as i,J as it,en as j,Ae as jt,$t as k,Ne as kt,Cn as l,pt as lt,cn as m,gt as mt,zt as n,_ as nn,wt as nt,Lt as o,X as ot,fn as p,vt as pt,wn as q,fe as qt,kn as r,Z as rt,Ft as s,_t as st,Ht as t,g as tn,Xt as tt,sn as u,mt as ut,Ut as v,ut as vt,Wt as w,Be as wt,Jt as x,Ke as xt,En as y,dt as yt,tn as z,R as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./queries-GAue98pY.js";import{a as t}from"./Rack-DdhpgQWD.js";import{useQueryClient as n}from"@tanstack/react-query";import{createContext as r,use as i,useEffect as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{jsx as l}from"react/jsx-runtime";var u=`stream:console`,d={"res:usage":{predicate:e=>e.queryKey[0]===`usage`||e.queryKey[0]===`client`&&(e.queryKey[1]===`usage`||e.queryKey[1]===`summary`)},"res:logs":{predicate:e=>e.queryKey[0]===`logs`&&e.queryKey[1]!==`body`||e.queryKey[0]===`client`&&e.queryKey[1]===`logs`},"res:credentials":{queryKey:e.credentials},"res:keys":{queryKey:e.keys},"res:settings":{queryKey:e.settings},"res:models":{queryKey:e.models},"res:quota":{queryKey:[`quota-history`]},[u]:{queryKey:[`console`]}},f=Object.keys(d),p=f.filter(e=>e.startsWith(`res:`)),m=f.filter(e=>e.startsWith(`stream:`));function h(e,t){if(t===`res:*`){_(e);return}let n=d[t];n!==void 0&&e.invalidateQueries(n)}function g(e){for(let t of f)h(e,t)}function _(e){e.invalidateQueries()}var v=4401,y=500,b=3e4,x=3,S=6e4,C=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)};function w(){let{protocol:e,host:t}=window.location;return`${e===`https:`?`wss:`:`ws:`}//${t}/api/stream`}function T(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t,{type:r,topic:i,seq:a}=n;return typeof r!=`string`||i!==void 0&&typeof i!=`string`||a!==void 0&&typeof a!=`number`?null:{type:r,...typeof i==`string`?{topic:i}:{},...typeof a==`number`?{seq:a}:{},...`payload`in n?{payload:n.payload}:{}}}function E(e){let t=new Set,n=new Set,r=new Map,i=new Map,a=[],o=null,s=!1,c=!1,l=!1,u=!1,d=!1,f=0,C=null,w={status:`poll`,pushed:()=>!1};function E(){let e=d?`offline`:c&&!u?`push`:`poll`,r=e===`push`;w={status:e,pushed:e=>r&&n.has(e)};for(let e of t)e()}function D(e){o?.send(JSON.stringify(e))}function O(e,t){let n=i.get(e);if(n===void 0||n.size===0)return!1;for(let e of[...n])e(t);return!0}function k(){for(let e of p)D({type:`subscribe`,topic:e});for(let e of m){let t=r.get(e);D(t===void 0?{type:`subscribe`,topic:e}:{type:`subscribe`,topic:e,sinceSeq:t})}}function A(){c=!0,f=0,n.clear(),l&&g(e.client),l=!0,k(),E()}function j(t){let i=T(t.data);if(i===null)return;let{topic:a}=i;if(i.type===`ack`){a!==void 0&&(n.add(a),E());return}if(i.type===`error`){a!==void 0&&n.delete(a)&&E();return}if(a!==void 0){if(i.type===`gap`){i.seq!==void 0&&r.set(a,i.seq),O(a,{kind:`gap`}),h(e.client,a);return}if(i.type===`event`){if(a===`res:*`){_(e.client);return}if(i.seq!==void 0){let t=r.get(a);if(r.set(a,i.seq),t!==void 0&&i.seq>t+1){O(a,{kind:`gap`}),h(e.client,a);return}}i.payload!==void 0&&O(a,{kind:`frame`,payload:i.payload})||h(e.client,a)}}}function M(t){let r=c;if(c=!1,o=null,n.clear(),s){if(t.code===v){d=!0,s=!1,E(),_(e.client);return}if(!r)u=!0;else{let t=e.now();a=[...a.filter(e=>e>t-S),t],a.length>=x&&(u=!0)}E(),N()}}function N(){let t=Math.min(b,y*2**f);f+=1,C=e.timer(()=>{C=null,s&&P()},t)}function P(){let t=new WebSocket(e.url());o=t,t.addEventListener(`open`,A),t.addEventListener(`message`,j),t.addEventListener(`close`,M)}return{subscribe(e){return t.add(e),()=>{t.delete(e)}},snapshot:()=>w,onStream(e,t){let n=i.get(e)??new Set;return i.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&i.delete(e)}},start(){return s=!0,P(),()=>{s=!1,C?.(),C=null;let e=o;o=null,c=!1,e?.close()}}}}var D=r(null),O=r(null),k={status:`poll`,pushed:()=>!1};function A({children:e,enabled:t=!0,timer:r=C,now:i=Date.now,url:o=w}){let u=n(),[d]=s(()=>E({client:u,timer:r,now:i,url:o}));a(()=>{if(t)return d.start()},[d,t]);let f=c(d.subscribe,d.snapshot,d.snapshot);return l(D,{value:f,children:l(O,{value:d.onStream,children:e})})}function j(){return i(D)??k}function M(e,t){let n=i(O),r=o(t);a(()=>{r.current=t}),a(()=>{if(n!==null)return n(e,e=>r.current(e))},[n,e])}function N({children:e}){let n=j();return l(t,{connection:n,children:e})}export{h as a,u as i,N as n,M as r,A as t};
|