import{r as Av,a as Tv,b as S,c as Tp,R as Hi,d as hu,e as pu,A as Ep,f as ms,P as Ev,T as zp,g as zv,C as _v,h as Mv,X as Ov,Y as kv}from"./recharts-DxKpixTe.js";import{u as Rv,i as Dv,a as Uv,b as Lv,c as Hv,d as Bv,e as qv,f as Gv}from"./echarts-CXqmOJiP.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))c(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(m){if(m.ep)return;m.ep=!0;const f=r(m);fetch(m.href,f)}})();var Gr={exports:{}},Ei={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Gh;function Vv(){if(Gh)return Ei;Gh=1;var a=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(c,m,f){var h=null;if(f!==void 0&&(h=""+f),m.key!==void 0&&(h=""+m.key),"key"in m){f={};for(var p in m)p!=="key"&&(f[p]=m[p])}else f=m;return m=f.ref,{$$typeof:a,type:c,key:h,ref:m!==void 0?m:null,props:f}}return Ei.Fragment=o,Ei.jsx=r,Ei.jsxs=r,Ei}var Vh;function Yv(){return Vh||(Vh=1,Gr.exports=Vv()),Gr.exports}var u=Yv(),Vr={exports:{}},zi={},Yr={exports:{}},Xr={};/** * @license React * scheduler.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yh;function Xv(){return Yh||(Yh=1,(function(a){function o(A,D){var H=A.length;A.push(D);e:for(;0>>1,se=A[P];if(0>>1;Pm(pe,H))Hem(st,pe)?(A[P]=st,A[He]=H,P=He):(A[P]=pe,A[ze]=H,P=ze);else if(Hem(st,H))A[P]=st,A[He]=H,P=He;else break e}}return D}function m(A,D){var H=A.sortIndex-D.sortIndex;return H!==0?H:A.id-D.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var y=[],v=[],j=1,b=null,x=3,C=!1,w=!1,E=!1,O=!1,k=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function Z(A){for(var D=r(v);D!==null;){if(D.callback===null)c(v);else if(D.startTime<=A)c(v),D.sortIndex=D.expirationTime,o(y,D);else break;D=r(v)}}function V(A){if(E=!1,Z(A),!w)if(r(y)!==null)w=!0,z||(z=!0,$());else{var D=r(v);D!==null&&J(V,D.startTime-A)}}var z=!1,Q=-1,W=5,ne=-1;function le(){return O?!0:!(a.unstable_now()-neA&&le());){var P=b.callback;if(typeof P=="function"){b.callback=null,x=b.priorityLevel;var se=P(b.expirationTime<=A);if(A=a.unstable_now(),typeof se=="function"){b.callback=se,Z(A),D=!0;break t}b===r(y)&&c(y),Z(A)}else c(y);b=r(y)}if(b!==null)D=!0;else{var je=r(v);je!==null&&J(V,je.startTime-A),D=!1}}break e}finally{b=null,x=H,C=!1}D=void 0}}finally{D?$():z=!1}}}var $;if(typeof q=="function")$=function(){q(re)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,ie=F.port2;F.port1.onmessage=re,$=function(){ie.postMessage(null)}}else $=function(){k(re,0)};function J(A,D){Q=k(function(){A(a.unstable_now())},D)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(A){A.callback=null},a.unstable_forceFrameRate=function(A){0>A||125P?(A.sortIndex=H,o(v,A),r(y)===null&&A===r(v)&&(E?(B(Q),Q=-1):E=!0,J(V,H-P))):(A.sortIndex=se,o(y,A),w||C||(w=!0,z||(z=!0,$()))),A},a.unstable_shouldYield=le,a.unstable_wrapCallback=function(A){var D=x;return function(){var H=x;x=D;try{return A.apply(this,arguments)}finally{x=H}}}})(Xr)),Xr}var Xh;function Qv(){return Xh||(Xh=1,Yr.exports=Xv()),Yr.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Qh;function Zv(){if(Qh)return zi;Qh=1;var a=Qv(),o=Av(),r=Tv();function c(e){var t="https://react.dev/errors/"+e;if(1se||(e.current=P[se],P[se]=null,se--)}function pe(e,t){se++,P[se]=e.current,e.current=t}var He=je(null),st=je(null),zt=je(null),Rn=je(null);function Wt(e,t){switch(pe(zt,t),pe(st,e),pe(He,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uh(t),e=fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ze(He),pe(He,e)}function Yt(){ze(He),ze(st),ze(zt)}function K(e){e.memoizedState!==null&&pe(Rn,e);var t=He.current,n=fh(t,e.type);t!==n&&(pe(st,e),pe(He,n))}function I(e){st.current===e&&(ze(He),ze(st)),Rn.current===e&&(ze(Rn),Ni._currentValue=H)}var ee,ue;function Be(e){if(ee===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||"",ue=-1)":-1i||N[l]!==R[i]){var G=` `+N[l].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=l&&0<=i);break}}}finally{Dn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Be(n):""}function Xi(e,t){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==t&&t!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return hl(e.type,!1);case 11:return hl(e.type.render,!1);case 1:return hl(e.type,!0);case 31:return Be("Activity");default:return""}}function Qi(e){try{var t="",n=null;do t+=Xi(e,n),n=e,e=e.return;while(e);return t}catch(l){return` Error generating stack: `+l.message+` `+l.stack}}var ka=Object.prototype.hasOwnProperty,Ra=a.unstable_scheduleCallback,Da=a.unstable_cancelCallback,Bl=a.unstable_shouldYield,iy=a.unstable_requestPaint,gt=a.unstable_now,oy=a.unstable_getCurrentPriorityLevel,Gu=a.unstable_ImmediatePriority,Vu=a.unstable_UserBlockingPriority,Zi=a.unstable_NormalPriority,sy=a.unstable_LowPriority,Yu=a.unstable_IdlePriority,cy=a.log,ry=a.unstable_setDisableYieldValue,Ua=null,yt=null;function Un(e){if(typeof cy=="function"&&ry(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ua,e)}catch{}}var vt=Math.clz32?Math.clz32:dy,uy=Math.log,fy=Math.LN2;function dy(e){return e>>>=0,e===0?32:31-(uy(e)/fy|0)|0}var Ki=256,$i=262144,Ji=4194304;function pl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Wi(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?i=pl(l):(d&=g,d!==0?i=pl(d):n||(n=g&~e,n!==0&&(i=pl(n))))):(g=l&~s,g!==0?i=pl(g):d!==0?i=pl(d):n||(n=l&~e,n!==0&&(i=pl(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function La(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function my(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xu(){var e=Ji;return Ji<<=1,(Ji&62914560)===0&&(Ji=4194304),e}function zs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hy(e,t,n,l,i,s){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,N=e.expirationTimes,R=e.hiddenUpdates;for(n=d&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var by=/[\n"\\]/g;function Mt(e){return e.replace(by,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ds(e,t,n,l,i,s,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Us(e,d,_t(t)):n!=null?Us(e,d,_t(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+_t(g):e.removeAttribute("name")}function lf(e,t,n,l,i,s,d,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Rs(e);return}n=n!=null?""+_t(n):"",t=t!=null?""+_t(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Rs(e)}function Us(e,t,n){t==="number"&&Ii(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ql(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gs=!1;if(sn)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){Gs=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{Gs=!1}var Hn=null,Vs=null,to=null;function ff(){if(to)return to;var e,t=Vs,n=t.length,l,i="value"in Hn?Hn.value:Hn.textContent,s=i.length;for(e=0;e=Qa),yf=" ",vf=!1;function xf(e,t){switch(e){case"keyup":return $y.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Wy(e,t){switch(e){case"compositionend":return bf(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function Fy(e,t){if(Jl)return e==="compositionend"||!Ks&&xf(e,t)?(e=ff(),to=Vs=Hn=null,Jl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function _f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ii(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ii(e.document)}return t}function Ws(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var i0=sn&&"documentMode"in document&&11>=document.documentMode,Wl=null,Fs=null,Ja=null,Ps=!1;function Of(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ps||Wl==null||Wl!==Ii(l)||(l=Wl,"selectionStart"in l&&Ws(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ja&&$a(Ja,l)||(Ja=l,l=Jo(Fs,"onSelect"),0>=d,i-=d,Ft=1<<32-vt(t)+i|n<me?(be=ae,ae=null):be=ae.sibling;var Ne=U(_,ae,M[me],Y);if(Ne===null){ae===null&&(ae=be);break}e&&ae&&Ne.alternate===null&&t(_,ae),T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne,ae=be}if(me===M.length)return n(_,ae),Se&&rn(_,me),oe;if(ae===null){for(;meme?(be=ae,ae=null):be=ae.sibling;var ol=U(_,ae,Ne.value,Y);if(ol===null){ae===null&&(ae=be);break}e&&ae&&ol.alternate===null&&t(_,ae),T=s(ol,T,me),we===null?oe=ol:we.sibling=ol,we=ol,ae=be}if(Ne.done)return n(_,ae),Se&&rn(_,me),oe;if(ae===null){for(;!Ne.done;me++,Ne=M.next())Ne=X(_,Ne.value,Y),Ne!==null&&(T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne);return Se&&rn(_,me),oe}for(ae=l(ae);!Ne.done;me++,Ne=M.next())Ne=L(ae,_,me,Ne.value,Y),Ne!==null&&(e&&Ne.alternate!==null&&ae.delete(Ne.key===null?me:Ne.key),T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne);return e&&ae.forEach(function(Cv){return t(_,Cv)}),Se&&rn(_,me),oe}function Oe(_,T,M,Y){if(typeof M=="object"&&M!==null&&M.type===E&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case C:e:{for(var oe=M.key;T!==null;){if(T.key===oe){if(oe=M.type,oe===E){if(T.tag===7){n(_,T.sibling),Y=i(T,M.props.children),Y.return=_,_=Y;break e}}else if(T.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===W&&Al(oe)===T.type){n(_,T.sibling),Y=i(T,M.props),ti(Y,M),Y.return=_,_=Y;break e}n(_,T);break}else t(_,T);T=T.sibling}M.type===E?(Y=Sl(M.props.children,_.mode,Y,M.key),Y.return=_,_=Y):(Y=fo(M.type,M.key,M.props,null,_.mode,Y),ti(Y,M),Y.return=_,_=Y)}return d(_);case w:e:{for(oe=M.key;T!==null;){if(T.key===oe)if(T.tag===4&&T.stateNode.containerInfo===M.containerInfo&&T.stateNode.implementation===M.implementation){n(_,T.sibling),Y=i(T,M.children||[]),Y.return=_,_=Y;break e}else{n(_,T);break}else t(_,T);T=T.sibling}Y=ic(M,_.mode,Y),Y.return=_,_=Y}return d(_);case W:return M=Al(M),Oe(_,T,M,Y)}if(J(M))return te(_,T,M,Y);if($(M)){if(oe=$(M),typeof oe!="function")throw Error(c(150));return M=oe.call(M),ce(_,T,M,Y)}if(typeof M.then=="function")return Oe(_,T,xo(M),Y);if(M.$$typeof===q)return Oe(_,T,po(_,M),Y);bo(_,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,T!==null&&T.tag===6?(n(_,T.sibling),Y=i(T,M),Y.return=_,_=Y):(n(_,T),Y=ac(M,_.mode,Y),Y.return=_,_=Y),d(_)):n(_,T)}return function(_,T,M,Y){try{ei=0;var oe=Oe(_,T,M,Y);return sa=null,oe}catch(ae){if(ae===oa||ae===yo)throw ae;var we=bt(29,ae,null,_.mode);return we.lanes=Y,we.return=_,we}finally{}}}var El=td(!0),nd=td(!1),Yn=!1;function yc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ae&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=uo(e),Bf(e,null,n),t}return ro(e,l,t,n),uo(e)}function ni(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zu(e,n)}}function xc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bc=!1;function li(){if(bc){var e=ia;if(e!==null)throw e}}function ai(e,t,n,l){bc=!1;var i=e.updateQueue;Yn=!1;var s=i.firstBaseUpdate,d=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var N=g,R=N.next;N.next=null,d===null?s=R:d.next=R,d=N;var G=e.alternate;G!==null&&(G=G.updateQueue,g=G.lastBaseUpdate,g!==d&&(g===null?G.firstBaseUpdate=R:g.next=R,G.lastBaseUpdate=N))}if(s!==null){var X=i.baseState;d=0,G=R=N=null,g=s;do{var U=g.lane&-536870913,L=U!==g.lane;if(L?(xe&U)===U:(l&U)===U){U!==0&&U===aa&&(bc=!0),G!==null&&(G=G.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var te=e,ce=g;U=t;var Oe=n;switch(ce.tag){case 1:if(te=ce.payload,typeof te=="function"){X=te.call(Oe,X,U);break e}X=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ce.payload,U=typeof te=="function"?te.call(Oe,X,U):te,U==null)break e;X=b({},X,U);break e;case 2:Yn=!0}}U=g.callback,U!==null&&(e.flags|=64,L&&(e.flags|=8192),L=i.callbacks,L===null?i.callbacks=[U]:L.push(U))}else L={lane:U,tag:g.tag,payload:g.payload,callback:g.callback,next:null},G===null?(R=G=L,N=X):G=G.next=L,d|=U;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;L=g,g=L.next,L.next=null,i.lastBaseUpdate=L,i.shared.pending=null}}while(!0);G===null&&(N=X),i.baseState=N,i.firstBaseUpdate=R,i.lastBaseUpdate=G,s===null&&(i.shared.lanes=0),Wn|=d,e.lanes=d,e.memoizedState=X}}function ld(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ad(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var d=A.T,g={};A.T=g,Bc(e,!1,t,n);try{var N=i(),R=A.S;if(R!==null&&R(g,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var G=h0(N,l);si(e,t,G,Ct(e))}else si(e,t,l,Ct(e))}catch(X){si(e,t,{then:function(){},status:"rejected",reason:X},Ct())}finally{D.p=s,d!==null&&g.types!==null&&(d.types=g.types),A.T=d}}function b0(){}function Lc(e,t,n,l){if(e.tag!==5)throw Error(c(476));var i=Ud(e).queue;Dd(e,i,t,H,n===null?b0:function(){return Ld(e),n(l)})}function Ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:H},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ld(e){var t=Ud(e);t.next===null&&(t=e.alternate.memoizedState),si(e,t.next.queue,{},Ct())}function Hc(){return tt(Ni)}function Hd(){return Ye().memoizedState}function Bd(){return Ye().memoizedState}function S0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ct();e=Xn(n);var l=Qn(t,e,n);l!==null&&(ht(l,t,n),ni(l,t,n)),t={cache:mc()},e.payload=t;return}t=t.return}}function j0(e,t,n){var l=Ct();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_o(e)?Gd(t,n):(n=nc(e,t,n,l),n!==null&&(ht(n,e,l),Vd(n,t,l)))}function qd(e,t,n){var l=Ct();si(e,t,n,l)}function si(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_o(e))Gd(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,g=s(d,n);if(i.hasEagerState=!0,i.eagerState=g,xt(g,d))return ro(e,t,i,0),ke===null&&co(),!1}catch{}finally{}if(n=nc(e,t,i,l),n!==null)return ht(n,e,l),Vd(n,t,l),!0}return!1}function Bc(e,t,n,l){if(l={lane:2,revertLane:yr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(t)throw Error(c(479))}else t=nc(e,n,l,2),t!==null&&ht(t,e,2)}function _o(e){var t=e.alternate;return e===de||t!==null&&t===de}function Gd(e,t){ra=wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zu(e,n)}}var ci={readContext:tt,use:Ao,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useLayoutEffect:qe,useInsertionEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useSyncExternalStore:qe,useId:qe,useHostTransitionStatus:qe,useFormState:qe,useActionState:qe,useOptimistic:qe,useMemoCache:qe,useCacheRefresh:qe};ci.useEffectEvent=qe;var Yd={readContext:tt,use:Ao,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:Ad,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Eo(4194308,4,_d.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eo(4194308,4,e,t)},useInsertionEffect:function(e,t){Eo(4,2,e,t)},useMemo:function(e,t){var n=ot();t=t===void 0?null:t;var l=e();if(zl){Un(!0);try{e()}finally{Un(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ot();if(n!==void 0){var i=n(t);if(zl){Un(!0);try{n(t)}finally{Un(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=j0.bind(null,de,e),[l.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Oc(e);var t=e.queue,n=qd.bind(null,de,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Dc,useDeferredValue:function(e,t){var n=ot();return Uc(n,e,t)},useTransition:function(){var e=Oc(!1);return e=Dd.bind(null,de,e.queue,!0,!1),ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=de,i=ot();if(Se){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ke===null)throw Error(c(349));(xe&127)!==0||ud(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Ad(dd.bind(null,l,s,e),[e]),l.flags|=2048,fa(9,{destroy:void 0},fd.bind(null,l,s,n,t),null),n},useId:function(){var e=ot(),t=ke.identifierPrefix;if(Se){var n=Pt,l=Ft;n=(l&~(1<<32-vt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=No++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}s[Ie]=t,s[ct]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(lt(s,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pn(t)}}return De(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&pn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=zt.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=et,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Ie]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||ch(e.nodeValue,n)),e||Gn(t,!0)}else e=Wo(e).createTextNode(l),e[Ie]=t,t.stateNode=e}return De(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=na(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ie]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else n=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return De(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=na(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[Ie]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else i=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Do(t,t.updateQueue),De(t),null);case 4:return Yt(),e===null&&Sr(t.stateNode.containerInfo),De(t),null;case 10:return fn(t.type),De(t),null;case 19:if(ze(Ve),l=t.memoizedState,l===null)return De(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)ui(l,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=jo(e),s!==null){for(t.flags|=128,ui(l,!1),e=s.updateQueue,t.updateQueue=e,Do(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qf(n,e),n=n.sibling;return pe(Ve,Ve.current&1|2),Se&&rn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&>()>qo&&(t.flags|=128,i=!0,ui(l,!1),t.lanes=4194304)}else{if(!i)if(e=jo(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Do(t,e),ui(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Se)return De(t),null}else 2*gt()-l.renderingStartTime>qo&&n!==536870912&&(t.flags|=128,i=!0,ui(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=gt(),e.sibling=null,n=Ve.current,pe(Ve,i?n&1|2:n&1),Se&&rn(t,l.treeForkCount),e):(De(t),null);case 22:case 23:return jt(t),jc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),n=t.updateQueue,n!==null&&Do(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&ze(Cl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Xe),De(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function T0(e,t){switch(sc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Xe),Yt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return I(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ve),null;case 4:return Yt(),null;case 10:return fn(t.type),null;case 22:case 23:return jt(t),jc(),e!==null&&ze(Cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Xe),null;case 25:return null;default:return null}}function mm(e,t){switch(sc(t),t.tag){case 3:fn(Xe),Yt();break;case 26:case 27:case 5:I(t);break;case 4:Yt();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:ze(Ve);break;case 10:fn(t.type);break;case 22:case 23:jt(t),jc(),e!==null&&ze(Cl);break;case 24:fn(Xe)}}function fi(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var s=n.create,d=n.inst;l=s(),d.destroy=l}n=n.next}while(n!==i)}}catch(g){Ee(t,t.return,g)}}function $n(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,i=t;var N=n,R=g;try{R()}catch(G){Ee(i,N,G)}}}l=l.next}while(l!==s)}}catch(G){Ee(t,t.return,G)}}function hm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ad(t,n)}catch(l){Ee(e,e.return,l)}}}function pm(e,t,n){n.props=_l(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ee(e,t,l)}}function di(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Ee(e,t,i)}}function It(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Ee(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Ee(e,t,i)}else n.current=null}function gm(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Ee(e,e.return,i)}}function er(e,t,n){try{var l=e.stateNode;J0(l,e.type,n,t),l[ct]=t}catch(i){Ee(e,e.return,i)}}function ym(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tl(e.type)||e.tag===4}function tr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ym(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nr(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(l!==4&&(l===27&&tl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nr(e,t,n),e=e.sibling;e!==null;)nr(e,t,n),e=e.sibling}function Uo(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uo(e,t,n),e=e.sibling;e!==null;)Uo(e,t,n),e=e.sibling}function vm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lt(t,l,n),t[Ie]=e,t[ct]=n}catch(s){Ee(e,e.return,s)}}var gn=!1,Ke=!1,lr=!1,xm=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function E0(e,t){if(e=e.containerInfo,Nr=ls,e=Mf(e),Ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var d=0,g=-1,N=-1,R=0,G=0,X=e,U=null;t:for(;;){for(var L;X!==n||i!==0&&X.nodeType!==3||(g=d+i),X!==s||l!==0&&X.nodeType!==3||(N=d+l),X.nodeType===3&&(d+=X.nodeValue.length),(L=X.firstChild)!==null;)U=X,X=L;for(;;){if(X===e)break t;if(U===n&&++R===i&&(g=d),U===s&&++G===l&&(N=d),(L=X.nextSibling)!==null)break;X=U,U=X.parentNode}X=L}n=g===-1||N===-1?null:{start:g,end:N}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cr={focusedElem:e,selectionRange:n},ls=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),lt(s,l,n),s[Ie]=e,We(s),l=s;break e;case"link":var d=Ch("link","href",i).get(l+(n.href||""));if(d){for(var g=0;gOe&&(d=Oe,Oe=ce,ce=d);var _=zf(g,ce),T=zf(g,Oe);if(_&&T&&(L.rangeCount!==1||L.anchorNode!==_.node||L.anchorOffset!==_.offset||L.focusNode!==T.node||L.focusOffset!==T.offset)){var M=X.createRange();M.setStart(_.node,_.offset),L.removeAllRanges(),ce>Oe?(L.addRange(M),L.extend(T.node,T.offset)):(M.setEnd(T.node,T.offset),L.addRange(M))}}}}for(X=[],L=g;L=L.parentNode;)L.nodeType===1&&X.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;gn?32:n,A.T=null,n=ur,ur=null;var s=Pn,d=Sn;if($e=0,ga=Pn=null,Sn=0,(Ae&6)!==0)throw Error(c(331));var g=Ae;if(Ae|=4,_m(s.current),Tm(s,s.current,d,n),Ae=g,vi(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ua,s)}catch{}return!0}finally{D.p=i,A.T=l,$m(e,t)}}function Wm(e,t,n){t=kt(n,t),t=Yc(e.stateNode,t,2),e=Qn(e,t,2),e!==null&&(Ha(e,2),en(e))}function Ee(e,t,n){if(e.tag===3)Wm(e,e,n);else for(;t!==null;){if(t.tag===3){Wm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Fn===null||!Fn.has(l))){e=kt(n,e),n=Fd(2),l=Qn(t,n,2),l!==null&&(Pd(n,l,t,e),Ha(l,2),en(l));break}}t=t.return}}function hr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new M0;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(or=!0,i.add(n),e=U0.bind(null,e,t,n),t.then(e,e))}function U0(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ke===e&&(xe&n)===n&&(Ge===4||Ge===3&&(xe&62914560)===xe&&300>gt()-Bo?(Ae&2)===0&&ya(e,0):sr|=n,pa===xe&&(pa=0)),en(e)}function Fm(e,t){t===0&&(t=Xu()),e=bl(e,t),e!==null&&(Ha(e,t),en(e))}function L0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fm(e,n)}function H0(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Fm(e,n)}function B0(e,t){return Ra(e,t)}var Zo=null,xa=null,pr=!1,Ko=!1,gr=!1,el=0;function en(e){e!==xa&&e.next===null&&(xa===null?Zo=xa=e:xa=xa.next=e),Ko=!0,pr||(pr=!0,G0())}function vi(e,t){if(!gr&&Ko){gr=!0;do for(var n=!1,l=Zo;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-vt(42|e)+1)-1,s&=i&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,th(l,s))}else s=xe,s=Wi(l,l===ke?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||La(l,s)||(n=!0,th(l,s));l=l.next}while(n);gr=!1}}function q0(){Pm()}function Pm(){Ko=pr=!1;var e=0;el!==0&&F0()&&(e=el);for(var t=gt(),n=null,l=Zo;l!==null;){var i=l.next,s=Im(l,t);s===0?(l.next=null,n===null?Zo=i:n.next=i,i===null&&(xa=n)):(n=l,(e!==0||(s&3)!==0)&&(Ko=!0)),l=i}$e!==0&&$e!==5||vi(e),el!==0&&(el=0)}function Im(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0g)break;var G=N.transferSize,X=N.initiatorType;G&&rh(X)&&(N=N.responseEnd,d+=G*(N"u"?null:document;function Sh(e,t,n){var l=ba;if(l&&typeof t=="string"&&t){var i=Mt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),bh.has(i)||(bh.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),lt(t,"link",e),We(t),l.head.appendChild(t)))}}function ov(e){jn.D(e),Sh("dns-prefetch",e,null)}function sv(e,t){jn.C(e,t),Sh("preconnect",e,t)}function cv(e,t,n){jn.L(e,t,n);var l=ba;if(l&&e&&t){var i='link[rel="preload"][as="'+Mt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Mt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Mt(n.imageSizes)+'"]')):i+='[href="'+Mt(e)+'"]';var s=i;switch(t){case"style":s=Sa(e);break;case"script":s=ja(e)}Bt.has(s)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bt.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ji(s))||t==="script"&&l.querySelector(wi(s))||(t=l.createElement("link"),lt(t,"link",e),We(t),l.head.appendChild(t)))}}function rv(e,t){jn.m(e,t);var n=ba;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Mt(l)+'"][href="'+Mt(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ja(e)}if(!Bt.has(s)&&(e=b({rel:"modulepreload",href:e},t),Bt.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wi(s)))return}l=n.createElement("link"),lt(l,"link",e),We(l),n.head.appendChild(l)}}}function uv(e,t,n){jn.S(e,t,n);var l=ba;if(l&&e){var i=Yl(l).hoistableStyles,s=Sa(e);t=t||"default";var d=i.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(ji(s)))g.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bt.get(s))&&Or(e,n);var N=d=l.createElement("link");We(N),lt(N,"link",e),N._p=new Promise(function(R,G){N.onload=R,N.onerror=G}),N.addEventListener("load",function(){g.loading|=1}),N.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Po(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},i.set(s,d)}}}function fv(e,t){jn.X(e,t);var n=ba;if(n&&e){var l=Yl(n).hoistableScripts,i=ja(e),s=l.get(i);s||(s=n.querySelector(wi(i)),s||(e=b({src:e,async:!0},t),(t=Bt.get(i))&&kr(e,t),s=n.createElement("script"),We(s),lt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function dv(e,t){jn.M(e,t);var n=ba;if(n&&e){var l=Yl(n).hoistableScripts,i=ja(e),s=l.get(i);s||(s=n.querySelector(wi(i)),s||(e=b({src:e,async:!0,type:"module"},t),(t=Bt.get(i))&&kr(e,t),s=n.createElement("script"),We(s),lt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function jh(e,t,n,l){var i=(i=zt.current)?Fo(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Sa(n.href),n=Yl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Sa(n.href);var s=Yl(i).hoistableStyles,d=s.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=i.querySelector(ji(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Bt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bt.set(e,n),s||mv(i,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ja(n),n=Yl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Sa(e){return'href="'+Mt(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function wh(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function mv(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),lt(t,"link",n),We(t),e.head.appendChild(t))}function ja(e){return'[src="'+Mt(e)+'"]'}function wi(e){return"script[async]"+e}function Nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Mt(n.href)+'"]');if(l)return t.instance=l,We(l),l;var i=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),We(l),lt(l,"style",i),Po(l,n.precedence,e),t.instance=l;case"stylesheet":i=Sa(n.href);var s=e.querySelector(ji(i));if(s)return t.state.loading|=4,t.instance=s,We(s),s;l=wh(n),(i=Bt.get(i))&&Or(l,i),s=(e.ownerDocument||e).createElement("link"),We(s);var d=s;return d._p=new Promise(function(g,N){d.onload=g,d.onerror=N}),lt(s,"link",l),t.state.loading|=4,Po(s,n.precedence,e),t.instance=s;case"script":return s=ja(n.src),(i=e.querySelector(wi(s)))?(t.instance=i,We(i),i):(l=n,(i=Bt.get(s))&&(l=b({},n),kr(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),We(i),lt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Po(l,n.precedence,e));return t.instance}function Po(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,d=0;d title"):null)}function hv(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Th(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pv(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Sa(l.href),s=t.querySelector(ji(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=es.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,We(s);return}s=t.ownerDocument||t,l=wh(l),(i=Bt.get(i))&&Or(l,i),s=s.createElement("link"),We(s);var d=s;d._p=new Promise(function(g,N){d.onload=g,d.onerror=N}),lt(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=es.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Rr=0;function gv(e,t){return e.stylesheets&&e.count===0&&ns(e,e.stylesheets),0Rr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ns(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ts=null;function ns(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ts=new Map,t.forEach(yv,e),ts=null,es.call(e))}function yv(e,t){if(!(t.state.loading&4)){var n=ts.get(e);if(n)var l=n.get(null);else{n=new Map,ts.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(o){console.error(o)}}return a(),Vr.exports=Zv(),Vr.exports}var $v=Kv();/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jv=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_p=(...a)=>a.filter((o,r,c)=>!!o&&o.trim()!==""&&c.indexOf(o)===r).join(" ").trim();/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Wv={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"};/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fv=S.forwardRef(({color:a="currentColor",size:o=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:m="",children:f,iconNode:h,...p},y)=>S.createElement("svg",{ref:y,...Wv,width:o,height:o,stroke:a,strokeWidth:c?Number(r)*24/Number(o):r,className:_p("lucide",m),...p},[...h.map(([v,j])=>S.createElement(v,j)),...Array.isArray(f)?f:[f]]));/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fe=(a,o)=>{const r=S.forwardRef(({className:c,...m},f)=>S.createElement(Fv,{ref:f,iconNode:o,className:_p(`lucide-${Jv(a)}`,c),...m}));return r.displayName=`${a}`,r};/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eu=fe("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"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pv=fe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Iv=fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ex=fe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mp=fe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tu=fe("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gu=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Op=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tx=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kp=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nx=fe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yu=fe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vu=fe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lx=fe("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ax=fe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ix=fe("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"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ox=fe("FileCog",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xu=fe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sx=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cx=fe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rx=fe("KeyRound",[["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"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ux=fe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rp=fe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dp=fe("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nu=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fx=fe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Up=fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dx=fe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mx=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hx=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const px=fe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kh=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ki=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gx=fe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ri=fe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yx=fe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vx=fe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $h=fe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xx=fe("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"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bx=fe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jh=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bu=fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lp=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sx=fe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class jx extends Error{}async function Gt(a,o={}){const r=await fetch(a,{headers:{"Content-Type":"application/json",...o.headers||{}},...o,cache:"no-store"});if(!r.ok){let c="";try{const m=await r.json();c=typeof m.detail=="string"?m.detail:""}catch{}throw new jx(c||`${r.status} ${r.statusText}`)}return r.json()}function wx(){return Gt("/admin/api/config")}function Wh(a){return Gt("/admin/api/config/validate",{method:"POST",body:JSON.stringify({values:a})})}function Nx(a){return Gt("/admin/api/config/apply",{method:"POST",body:JSON.stringify({values:a})})}async function Cx(){return Gt("/admin/api/providers/local-status")}function Fh(a){return Gt(`/admin/api/providers/${a}/test`,{method:"POST",body:"{}"})}function Ph(a){return Gt(`/admin/api/providers/${a}/auth`)}function Ax(a,o){return Gt(`/admin/api/providers/${a}/auth/login`,{method:"POST",body:JSON.stringify({mode:o})})}function Tx(a){return Gt(`/admin/api/providers/${a}/auth/cancel`,{method:"POST"})}function Ex(a){return Gt(`/admin/api/providers/${a}/auth`,{method:"DELETE"})}function Ih(a=!1){return Gt(a?"/admin/api/models/refresh":"/admin/api/models",{method:a?"POST":"GET"})}function zx(a){return Gt(`/admin/api/pools/${encodeURIComponent(a)}`)}function _x(){return Gt("/admin/api/usage")}const Su="-",Mx=a=>{const o=kx(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:c}=a;return{getClassGroupId:h=>{const p=h.split(Su);return p[0]===""&&p.length!==1&&p.shift(),Hp(p,o)||Ox(h)},getConflictingClassGroupIds:(h,p)=>{const y=r[h]||[];return p&&c[h]?[...y,...c[h]]:y}}},Hp=(a,o)=>{var h;if(a.length===0)return o.classGroupId;const r=a[0],c=o.nextPart.get(r),m=c?Hp(a.slice(1),c):void 0;if(m)return m;if(o.validators.length===0)return;const f=a.join(Su);return(h=o.validators.find(({validator:p})=>p(f)))==null?void 0:h.classGroupId},ep=/^\[(.+)\]$/,Ox=a=>{if(ep.test(a)){const o=ep.exec(a)[1],r=o==null?void 0:o.substring(0,o.indexOf(":"));if(r)return"arbitrary.."+r}},kx=a=>{const{theme:o,prefix:r}=a,c={nextPart:new Map,validators:[]};return Dx(Object.entries(a.classGroups),r).forEach(([f,h])=>{lu(h,c,f,o)}),c},lu=(a,o,r,c)=>{a.forEach(m=>{if(typeof m=="string"){const f=m===""?o:tp(o,m);f.classGroupId=r;return}if(typeof m=="function"){if(Rx(m)){lu(m(c),o,r,c);return}o.validators.push({validator:m,classGroupId:r});return}Object.entries(m).forEach(([f,h])=>{lu(h,tp(o,f),r,c)})})},tp=(a,o)=>{let r=a;return o.split(Su).forEach(c=>{r.nextPart.has(c)||r.nextPart.set(c,{nextPart:new Map,validators:[]}),r=r.nextPart.get(c)}),r},Rx=a=>a.isThemeGetter,Dx=(a,o)=>o?a.map(([r,c])=>{const m=c.map(f=>typeof f=="string"?o+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([h,p])=>[o+h,p])):f);return[r,m]}):a,Ux=a=>{if(a<1)return{get:()=>{},set:()=>{}};let o=0,r=new Map,c=new Map;const m=(f,h)=>{r.set(f,h),o++,o>a&&(o=0,c=r,r=new Map)};return{get(f){let h=r.get(f);if(h!==void 0)return h;if((h=c.get(f))!==void 0)return m(f,h),h},set(f,h){r.has(f)?r.set(f,h):m(f,h)}}},Bp="!",Lx=a=>{const{separator:o,experimentalParseClassName:r}=a,c=o.length===1,m=o[0],f=o.length,h=p=>{const y=[];let v=0,j=0,b;for(let O=0;Oj?b-j:void 0;return{modifiers:y,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:E}};return r?p=>r({className:p,parseClassName:h}):h},Hx=a=>{if(a.length<=1)return a;const o=[];let r=[];return a.forEach(c=>{c[0]==="["?(o.push(...r.sort(),c),r=[]):r.push(c)}),o.push(...r.sort()),o},Bx=a=>({cache:Ux(a.cacheSize),parseClassName:Lx(a),...Mx(a)}),qx=/\s+/,Gx=(a,o)=>{const{parseClassName:r,getClassGroupId:c,getConflictingClassGroupIds:m}=o,f=[],h=a.trim().split(qx);let p="";for(let y=h.length-1;y>=0;y-=1){const v=h[y],{modifiers:j,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:C}=r(v);let w=!!C,E=c(w?x.substring(0,C):x);if(!E){if(!w){p=v+(p.length>0?" "+p:p);continue}if(E=c(x),!E){p=v+(p.length>0?" "+p:p);continue}w=!1}const O=Hx(j).join(":"),k=b?O+Bp:O,B=k+E;if(f.includes(B))continue;f.push(B);const q=m(E,w);for(let Z=0;Z0?" "+p:p)}return p};function Vx(){let a=0,o,r,c="";for(;a{if(typeof a=="string")return a;let o,r="";for(let c=0;cb(j),a());return r=Bx(v),c=r.cache.get,m=r.cache.set,f=p,p(y)}function p(y){const v=c(y);if(v)return v;const j=Gx(y,r);return m(y,j),j}return function(){return f(Vx.apply(null,arguments))}}const Ue=a=>{const o=r=>r[a]||[];return o.isThemeGetter=!0,o},Gp=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xx=/^\d+\/\d+$/,Qx=new Set(["px","full","screen"]),Zx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$x=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wn=a=>Ta(a)||Qx.has(a)||Xx.test(a),sl=a=>za(a,"length",a1),Ta=a=>!!a&&!Number.isNaN(Number(a)),Qr=a=>za(a,"number",Ta),_i=a=>!!a&&Number.isInteger(Number(a)),Fx=a=>a.endsWith("%")&&Ta(a.slice(0,-1)),he=a=>Gp.test(a),cl=a=>Zx.test(a),Px=new Set(["length","size","percentage"]),Ix=a=>za(a,Px,Vp),e1=a=>za(a,"position",Vp),t1=new Set(["image","url"]),n1=a=>za(a,t1,o1),l1=a=>za(a,"",i1),Mi=()=>!0,za=(a,o,r)=>{const c=Gp.exec(a);return c?c[1]?typeof o=="string"?c[1]===o:o.has(c[1]):r(c[2]):!1},a1=a=>Kx.test(a)&&!$x.test(a),Vp=()=>!1,i1=a=>Jx.test(a),o1=a=>Wx.test(a),s1=()=>{const a=Ue("colors"),o=Ue("spacing"),r=Ue("blur"),c=Ue("brightness"),m=Ue("borderColor"),f=Ue("borderRadius"),h=Ue("borderSpacing"),p=Ue("borderWidth"),y=Ue("contrast"),v=Ue("grayscale"),j=Ue("hueRotate"),b=Ue("invert"),x=Ue("gap"),C=Ue("gradientColorStops"),w=Ue("gradientColorStopPositions"),E=Ue("inset"),O=Ue("margin"),k=Ue("opacity"),B=Ue("padding"),q=Ue("saturate"),Z=Ue("scale"),V=Ue("sepia"),z=Ue("skew"),Q=Ue("space"),W=Ue("translate"),ne=()=>["auto","contain","none"],le=()=>["auto","hidden","clip","visible","scroll"],re=()=>["auto",he,o],$=()=>[he,o],F=()=>["",wn,sl],ie=()=>["auto",Ta,he],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",he],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],je=()=>[Ta,he];return{cacheSize:500,separator:":",theme:{colors:[Mi],spacing:[wn,sl],blur:["none","",cl,he],brightness:je(),borderColor:[a],borderRadius:["none","","full",cl,he],borderSpacing:$(),borderWidth:F(),contrast:je(),grayscale:P(),hueRotate:je(),invert:P(),gap:$(),gradientColorStops:[a],gradientColorStopPositions:[Fx,sl],inset:re(),margin:re(),opacity:je(),padding:$(),saturate:je(),scale:je(),sepia:P(),skew:je(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[cl]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),he]}],overflow:[{overflow:le()}],"overflow-x":[{"overflow-x":le()}],"overflow-y":[{"overflow-y":le()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_i,he]}],basis:[{basis:re()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",_i,he]}],"grid-cols":[{"grid-cols":[Mi]}],"col-start-end":[{col:["auto",{span:["full",_i,he]},he]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[Mi]}],"row-start-end":[{row:["auto",{span:[_i,he]},he]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],pe:[{pe:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],m:[{m:[O]}],mx:[{mx:[O]}],my:[{my:[O]}],ms:[{ms:[O]}],me:[{me:[O]}],mt:[{mt:[O]}],mr:[{mr:[O]}],mb:[{mb:[O]}],ml:[{ml:[O]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,o]}],"min-w":[{"min-w":[he,o,"min","max","fit"]}],"max-w":[{"max-w":[he,o,"none","full","min","max","fit","prose",{screen:[cl]},cl]}],h:[{h:[he,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,o,"auto","min","max","fit"]}],"font-size":[{text:["base",cl,sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qr]}],"font-family":[{font:[Mi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",Ta,Qr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wn,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wn,sl]}],"underline-offset":[{"underline-offset":["auto",wn,he]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),e1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ix]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},n1]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:A()}],"border-color":[{border:[m]}],"border-color-x":[{"border-x":[m]}],"border-color-y":[{"border-y":[m]}],"border-color-s":[{"border-s":[m]}],"border-color-e":[{"border-e":[m]}],"border-color-t":[{"border-t":[m]}],"border-color-r":[{"border-r":[m]}],"border-color-b":[{"border-b":[m]}],"border-color-l":[{"border-l":[m]}],"divide-color":[{divide:[m]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[wn,he]}],"outline-w":[{outline:[wn,sl]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[wn,sl]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",cl,l1]}],"shadow-color":[{shadow:[Mi]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[c]}],contrast:[{contrast:[y]}],"drop-shadow":[{"drop-shadow":["","none",cl,he]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[j]}],invert:[{invert:[b]}],saturate:[{saturate:[q]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[y]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[q]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:je()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:je()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[_i,he]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",a]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[wn,sl,Qr]}],stroke:[{stroke:[a,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},c1=Yx(s1);function ge(...a){return c1(Tp(a))}const np=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,lp=Tp,Yp=(a,o)=>r=>{var c;if((o==null?void 0:o.variants)==null)return lp(a,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:m,defaultVariants:f}=o,h=Object.keys(m).map(v=>{const j=r==null?void 0:r[v],b=f==null?void 0:f[v];if(j===null)return null;const x=np(j)||np(b);return m[v][x]}),p=r&&Object.entries(r).reduce((v,j)=>{let[b,x]=j;return x===void 0||(v[b]=x),v},{}),y=o==null||(c=o.compoundVariants)===null||c===void 0?void 0:c.reduce((v,j)=>{let{class:b,className:x,...C}=j;return Object.entries(C).every(w=>{let[E,O]=w;return Array.isArray(O)?O.includes({...f,...p}[E]):{...f,...p}[E]===O})?[...v,b,x]:v},[]);return lp(a,h,y,r==null?void 0:r.class,r==null?void 0:r.className)},r1=Yp("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",ok:"border-transparent bg-emerald-100 text-emerald-800",warn:"border-transparent bg-amber-100 text-amber-800",error:"border-transparent bg-red-100 text-red-800",neutral:"border-transparent bg-muted text-muted-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function at({className:a,variant:o,...r}){return u.jsx("span",{"data-slot":"badge",className:ge(r1({variant:o}),a),...r})}var u1=Object.defineProperty,ju=(a,o)=>u1(a,"name",{value:o,configurable:!0});function au(a,o){if(typeof a=="function")return a(o);a!=null&&(a.current=o)}ju(au,"setRef");function Xp(...a){return o=>{let r=!1;const c=a.map(m=>{const f=au(m,o);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let m=0;mf1(a,"name",{value:o,configurable:!0});function wu(a){const o=S.forwardRef((r,c)=>{let{children:m,...f}=r,h=null,p=!1;const y=[];iu(m)&&typeof us=="function"&&(m=us(m._payload)),S.Children.forEach(m,x=>{var C;if(Jp(x)){p=!0;const w=x;let E="child"in w.props?w.props.child:w.props.children;iu(E)&&typeof us=="function"&&(E=us(E._payload)),h=m1(w,E),y.push((C=h==null?void 0:h.props)==null?void 0:C.children)}else y.push(x)}),h?h=S.cloneElement(h,void 0,y):!p&&S.Children.count(m)===1&&S.isValidElement(m)&&(h=m);const v=h?$p(h):void 0,j=On(c,v);if(!h){if(m||m===0)throw new Error(p?g1(a):p1(a));return m}const b=Kp(f,h.props??{});return h.type!==S.Fragment&&(b.ref=c?j:v),S.cloneElement(h,b)});return o.displayName=`${a}.Slot`,o}Jt(wu,"createSlot");var d1=wu("Slot"),Qp=Symbol.for("radix.slottable");function Zp(a){const o=Jt(r=>"child"in r?r.children(r.child):r.children,"Slottable");return o.displayName=`${a}.Slottable`,o.__radixId=Qp,o}Jt(Zp,"createSlottable");var m1=Jt((a,o)=>{if("child"in a.props){const r=a.props.child;return S.isValidElement(r)?S.cloneElement(r,void 0,a.props.children(r.props.children)):null}return S.isValidElement(o)?o:null},"getSlottableElementFromSlottable");function Kp(a,o){const r={...o};for(const c in o){const m=a[c],f=o[c];/^on[A-Z]/.test(c)?m&&f?r[c]=(...p)=>{const y=f(...p);return m(...p),y}:m&&(r[c]=m):c==="style"?r[c]={...m,...f}:c==="className"&&(r[c]=[m,f].filter(Boolean).join(" "))}return{...a,...r}}Jt(Kp,"mergeProps");function $p(a){var c,m;let o=(c=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:c.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?a.ref:(o=(m=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:m.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?a.props.ref:a.props.ref||a.ref)}Jt($p,"getElementRef");function Jp(a){return S.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Qp}Jt(Jp,"isSlottable");var h1=Symbol.for("react.lazy");function iu(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===h1&&"_payload"in a&&Wp(a._payload)}Jt(iu,"isLazyComponent");function Wp(a){return typeof a=="object"&&a!==null&&"then"in a}Jt(Wp,"isPromiseLike");var p1=Jt(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),g1=Jt(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),us=Hi[" use ".trim().toString()];const y1=Yp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:a,variant:o,size:r,asChild:c=!1,...m}){const f=c?d1:"button";return u.jsx(f,{"data-slot":"button",className:ge(y1({variant:o,size:r,className:a})),...m})}function v1(a){switch(a){case"error":return u.jsx(vu,{className:"size-4 shrink-0 text-destructive"});case"warn":return u.jsx(bu,{className:"size-4 shrink-0 text-amber-600"});case"ok":return u.jsx(yu,{className:"size-4 shrink-0 text-emerald-600"});default:return null}}function x1({configPath:a,dirtyCount:o,message:r,applying:c,onValidate:m,onApply:f}){return u.jsxs("footer",{className:"sticky bottom-0 z-30 flex flex-wrap items-center gap-x-4 gap-y-2 border-t bg-background/90 px-4 py-3 backdrop-blur-md md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsxs(at,{variant:o===0?"outline":"warn",className:ge("shrink-0 gap-1.5",o===0&&"text-muted-foreground"),children:[o===0?u.jsx(yu,{className:"size-3.5 text-emerald-500"}):u.jsx(nx,{className:"size-3.5"}),o===0?"No changes":`${o} unsaved change${o===1?"":"s"}`]}),u.jsx("span",{className:"hidden min-w-0 truncate font-mono text-xs text-muted-foreground lg:inline",children:a})]}),u.jsxs("div",{className:ge("flex min-w-0 flex-1 items-center gap-2 text-sm",(r==null?void 0:r.kind)==="error"&&"text-destructive",(r==null?void 0:r.kind)==="warn"&&"text-amber-600",(r==null?void 0:r.kind)==="ok"&&"text-emerald-600"),role:(r==null?void 0:r.kind)==="error"?"alert":void 0,"aria-live":"polite",children:[v1(r==null?void 0:r.kind),u.jsx("span",{className:"truncate",children:(r==null?void 0:r.text)??""})]}),u.jsxs("div",{className:"flex shrink-0 gap-2",children:[u.jsxs(Ce,{variant:"secondary",onClick:m,disabled:c,children:[u.jsx(yx,{}),"Validate"]}),u.jsxs(Ce,{onClick:f,disabled:o===0||c,children:[c?u.jsx(nu,{className:"animate-spin"}):u.jsx(hx,{}),c?"Applying...":"Apply"]})]})]})}var b1=Object.defineProperty,qt=(a,o)=>b1(a,"name",{value:o,configurable:!0});function S1(a,o){const r=S.createContext(o);r.displayName=a+"Context";const c=qt(f=>{const{children:h,...p}=f,y=S.useMemo(()=>p,Object.values(p));return u.jsx(r.Provider,{value:y,children:h})},"Provider");c.displayName=a+"Provider";function m(f,h={}){const{optional:p=!1}=h,y=S.useContext(r);if(y)return y;if(o!==void 0)return o;if(!p)throw new Error(`\`${f}\` must be used within \`${a}\``)}return qt(m,"useContext"),[c,m]}qt(S1,"createContext");function Ss(a,o=[]){let r=[];function c(f,h){const p=S.createContext(h);p.displayName=f+"Context";const y=r.length;r=[...r,h];const v=qt(b=>{var k;const{scope:x,children:C,...w}=b,E=((k=x==null?void 0:x[a])==null?void 0:k[y])||p,O=S.useMemo(()=>w,Object.values(w));return u.jsx(E.Provider,{value:O,children:C})},"Provider");v.displayName=f+"Provider";function j(b,x,C={}){var k;const{optional:w=!1}=C,E=((k=x==null?void 0:x[a])==null?void 0:k[y])||p,O=S.useContext(E);if(O)return O;if(h!==void 0)return h;if(!w)throw new Error(`\`${b}\` must be used within \`${f}\``)}return qt(j,"useContext"),[v,j]}qt(c,"createContext");const m=qt(()=>{const f=r.map(h=>S.createContext(h));return qt(function(p){const y=(p==null?void 0:p[a])||f;return S.useMemo(()=>({[`__scope${a}`]:{...p,[a]:y}}),[p,y])},"useScope")},"createScope");return m.scopeName=a,[c,Fp(m,...o)]}qt(Ss,"createContextScope");function Fp(...a){const o=a[0];if(a.length===1)return o;const r=qt(()=>{const c=a.map(m=>({useScope:m(),scopeName:m.scopeName}));return qt(function(f){const h=c.reduce((p,{useScope:y,scopeName:v})=>{const b=y(f)[`__scope${v}`];return{...p,...b}},{});return S.useMemo(()=>({[`__scope${o.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return r.scopeName=o.scopeName,r}qt(Fp,"composeContextScopes");var j1=Object.defineProperty,_a=(a,o)=>j1(a,"name",{value:o,configurable:!0}),Pp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Et(a,o,{checkForDefaultPrevented:r=!0}={}){return _a(function(m){if(a==null||a(m),r===!1||!m||!m.defaultPrevented)return o==null?void 0:o(m)},"handleEvent")}_a(Et,"composeEventHandlers");function w1(a){var o;if(!Pp)throw new Error("Cannot access window outside of the DOM");return((o=a==null?void 0:a.ownerDocument)==null?void 0:o.defaultView)??window}_a(w1,"getOwnerWindow");function ou(a){if(!Pp)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}_a(ou,"getOwnerDocument");function Ip(a,o=!1){const{activeElement:r}=ou(a);if(!(r!=null&&r.nodeName))return null;if(eg(r)&&r.contentDocument)return Ip(r.contentDocument.body,o);if(o){const c=r.getAttribute("aria-activedescendant");if(c){const m=ou(r).getElementById(c);if(m)return m}}return r}_a(Ip,"getActiveElement");function eg(a){return a.tagName==="IFRAME"}_a(eg,"isFrame");var $t=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},N1=Object.defineProperty,C1=(a,o)=>N1(a,"name",{value:o,configurable:!0}),ap=Hi[" useEffectEvent ".trim().toString()],ip=Hi[" useInsertionEffect ".trim().toString()];function tg(a){if(typeof ap=="function")return ap(a);const o=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ip=="function"?ip(()=>{o.current=a}):$t(()=>{o.current=a}),S.useMemo(()=>((...r)=>{var c;return(c=o.current)==null?void 0:c.call(o,...r)}),[])}C1(tg,"useEffectEvent");var A1=Object.defineProperty,Bi=(a,o)=>A1(a,"name",{value:o,configurable:!0}),T1=Hi[" useInsertionEffect ".trim().toString()]||$t;function Nu({prop:a,defaultProp:o,onChange:r=Bi(()=>{},"onChange"),caller:c}){const[m,f,h]=ng({defaultProp:o,onChange:r}),p=a!==void 0,y=p?a:m,v=S.useCallback(j=>{var b;if(p){const x=lg(j)?j(a):j;x!==a&&((b=h.current)==null||b.call(h,x))}else f(j)},[p,a,f,h]);return[y,v]}Bi(Nu,"useControllableState");function ng({defaultProp:a,onChange:o}){const[r,c]=S.useState(a),m=S.useRef(r),f=S.useRef(o);return T1(()=>{f.current=o},[o]),S.useEffect(()=>{var h;m.current!==r&&((h=f.current)==null||h.call(f,r),m.current=r)},[r,m]),[r,c,f]}Bi(ng,"useUncontrolledState");function lg(a){return typeof a=="function"}Bi(lg,"isFunction");var op=Symbol("RADIX:SYNC_STATE");function E1(a,o,r,c){const{prop:m,defaultProp:f,onChange:h,caller:p}=o,y=m!==void 0,v=tg(h),j=[{...r,state:f}];c&&j.push(c);const[b,x]=S.useReducer((O,k)=>{if(k.type===op)return{...O,state:k.state};const B=a(O,k);return y&&!Object.is(B.state,O.state)&&v(B.state),B},...j),C=b.state,w=S.useRef(C);S.useEffect(()=>{w.current!==C&&(w.current=C,y||v(C))},[C,w,y]);const E=S.useMemo(()=>m!==void 0?{...b,state:m}:b,[b,m]);return S.useEffect(()=>{y&&!Object.is(m,b.state)&&x({type:op,state:m})},[m,b.state,y]),[E,x]}Bi(E1,"useControllableStateReducer");var z1=Object.defineProperty,_1=(a,o)=>z1(a,"name",{value:o,configurable:!0});function Cu(a){const[o,r]=S.useState(void 0);return $t(()=>{if(a){r({width:a.offsetWidth,height:a.offsetHeight});const c=new ResizeObserver(m=>{if(!Array.isArray(m)||!m.length)return;const f=m[0];let h,p;if("borderBoxSize"in f){const y=f.borderBoxSize,v=Array.isArray(y)?y[0]:y;h=v.inlineSize,p=v.blockSize}else h=a.offsetWidth,p=a.offsetHeight;r({width:h,height:p})});return c.observe(a,{box:"border-box"}),()=>c.unobserve(a)}else r(void 0)},[a]),o}_1(Cu,"useSize");var M1=Object.defineProperty,zn=(a,o)=>M1(a,"name",{value:o,configurable:!0});function ag(a,o){return S.useReducer((r,c)=>o[r][c]??r,a)}zn(ag,"useStateMachine");var Au=zn(a=>{const{present:o,children:r}=a,c=ig(o),m=typeof r=="function"?r({present:c.isPresent}):S.Children.only(r),f=og(c.ref,sg(m));return typeof r=="function"||c.isPresent?S.cloneElement(m,{ref:f}):null},"Presence");function ig(a){const[o,r]=S.useState(),c=S.useRef(null),m=S.useRef(a),f=S.useRef("none"),h=S.useRef(void 0),p=a?"mounted":"unmounted",[y,v]=ag(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{y==="mounted"?(f.current=h.current??Aa(c.current),h.current=void 0):f.current="none"},[y]),$t(()=>{const j=c.current,b=m.current;if(b!==a){const C=f.current,w=Aa(j);a?(h.current=w,v("MOUNT")):w==="none"||(j==null?void 0:j.display)==="none"?v("UNMOUNT"):v(b&&C!==w?"ANIMATION_OUT":"UNMOUNT"),m.current=a}},[a,v]),$t(()=>{if(o){let j;const b=o.ownerDocument.defaultView??window,x=zn(w=>{const O=Aa(c.current).includes(CSS.escape(w.animationName));if(w.target===o&&O&&(v("ANIMATION_END"),!m.current)){const k=o.style.animationFillMode;o.style.animationFillMode="forwards",j=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=k)})}},"handleAnimationEnd"),C=zn(w=>{w.target===o&&(f.current=Aa(c.current))},"handleAnimationStart");return o.addEventListener("animationstart",C),o.addEventListener("animationcancel",x),o.addEventListener("animationend",x),()=>{b.clearTimeout(j),o.removeEventListener("animationstart",C),o.removeEventListener("animationcancel",x),o.removeEventListener("animationend",x)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:S.useCallback(j=>{if(j){const b=getComputedStyle(j);c.current=b,h.current=Aa(b)}else c.current=null;r(j)},[])}}zn(ig,"usePresence");function su(a,o){if(typeof a=="function")return a(o);a!=null&&(a.current=o)}zn(su,"setRef");function og(...a){const o=S.useRef(a);return o.current=a,S.useCallback(r=>{const c=o.current;let m=!1;const f=c.map(h=>{const p=su(h,r);return!m&&typeof p=="function"&&(m=!0),p});if(m)return()=>{for(let h=0;hO1(a,"name",{value:o,configurable:!0}),R1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=R1.reduce((a,o)=>{const r=wu(`Primitive.${o}`),c=S.forwardRef((m,f)=>{const{asChild:h,...p}=m,y=h?r:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(y,{...p,ref:f})});return c.displayName=`Primitive.${o}`,{...a,[o]:c}},{});function cg(a,o){a&&hu.flushSync(()=>a.dispatchEvent(o))}k1(cg,"dispatchDiscreteCustomEvent");var D1=Object.defineProperty,_n=(a,o)=>D1(a,"name",{value:o,configurable:!0}),Tu="Checkbox",[U1,G3]=Ss(Tu),[L1,Eu]=U1(Tu);function rg(a){const{__scopeCheckbox:o,checked:r,children:c,defaultChecked:m,disabled:f,form:h,name:p,onCheckedChange:y,required:v,value:j="on",internal_do_not_use_render:b}=a,[x,C]=Nu({prop:r,defaultProp:m??!1,onChange:y,caller:Tu}),[w,E]=S.useState(null),[O,k]=S.useState(null),B=S.useRef(!1),[q,Z]=S.useReducer(Q=>Q+1,0),V=w?!!h||!!w.closest("form"):!0,z={checked:x,disabled:f,setChecked:C,control:w,setControl:E,name:p,form:h,value:j,hasConsumerStoppedPropagationRef:B,userInteractionCount:q,onUserInteraction:Z,required:v,defaultChecked:Cn(m)?!1:m,isFormControl:V,bubbleInput:O,setBubbleInput:k};return u.jsx(L1,{scope:o,...z,children:ug(b)?b(z):c})}_n(rg,"CheckboxProvider");var H1="CheckboxTrigger",B1=S.forwardRef(_n(function({__scopeCheckbox:o,onKeyDown:r,onClick:c,...m},f){const{control:h,value:p,disabled:y,checked:v,required:j,setControl:b,setChecked:x,hasConsumerStoppedPropagationRef:C,onUserInteraction:w,isFormControl:E,bubbleInput:O}=Eu(H1,o),k=On(f,b),B=S.useRef(v);return S.useEffect(()=>{const q=h==null?void 0:h.form;if(q){const Z=_n(()=>x(B.current),"reset");return q.addEventListener("reset",Z),()=>q.removeEventListener("reset",Z)}},[h,x]),u.jsx(Vt.button,{type:"button",role:"checkbox","aria-checked":Cn(v)?"mixed":v,"aria-required":j,"data-state":zu(v),"data-disabled":y?"":void 0,disabled:y,value:p,...m,ref:k,onKeyDown:Et(r,q=>{q.key==="Enter"&&q.preventDefault()}),onClick:Et(c,q=>{w(),x(Z=>Cn(Z)?!0:!Z),O&&E&&(C.current=q.isPropagationStopped(),C.current||q.stopPropagation())})})},"CheckboxTrigger")),q1=S.forwardRef(_n(function(o,r){const{__scopeCheckbox:c,name:m,checked:f,defaultChecked:h,required:p,disabled:y,value:v,onCheckedChange:j,form:b,...x}=o;return u.jsx(rg,{__scopeCheckbox:c,checked:f,defaultChecked:h,disabled:y,required:p,onCheckedChange:j,name:m,form:b,value:v,internal_do_not_use_render:({isFormControl:C})=>u.jsxs(u.Fragment,{children:[u.jsx(B1,{...x,ref:r,__scopeCheckbox:c}),C&&u.jsx(X1,{__scopeCheckbox:c})]})})},"Checkbox")),G1="CheckboxIndicator",V1=S.forwardRef(_n(function(o,r){const{__scopeCheckbox:c,forceMount:m,...f}=o,h=Eu(G1,c);return u.jsx(Au,{present:m||Cn(h.checked)||h.checked===!0,children:u.jsx(Vt.span,{"data-state":zu(h.checked),"data-disabled":h.disabled?"":void 0,...f,ref:r,style:{pointerEvents:"none",...o.style}})})},"CheckboxIndicator")),Y1="CheckboxBubbleInput",X1=S.forwardRef(_n(function({__scopeCheckbox:o,onClick:r,...c},m){const{control:f,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:y,defaultChecked:v,required:j,disabled:b,name:x,value:C,form:w,bubbleInput:E,setBubbleInput:O}=Eu(Y1,o),k=On(m,O),B=Cu(f),q=S.useRef(!1),Z=S.useRef(y),V=S.useRef(p);S.useEffect(()=>{const Q=E;if(!Q)return;const W=window.HTMLInputElement.prototype,le=Object.getOwnPropertyDescriptor(W,"checked").set,re=p!==V.current;V.current=p;const $=Z.current!==y;Z.current=y;const F=!(re&&h.current);if($&&le){q.current=!re;const ie=new Event("click",{bubbles:F});Q.indeterminate=Cn(y),le.call(Q,Cn(y)?!1:y),Q.dispatchEvent(ie),q.current=!1}},[E,y,h,p]);const z=S.useRef(Cn(y)?!1:y);return u.jsx(Vt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??z.current,required:j,disabled:b,name:x,value:C,form:w,...c,tabIndex:-1,ref:k,onClick:Et(r,Q=>{q.current&&Q.stopPropagation()}),style:{...c.style,...B,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function ug(a){return typeof a=="function"}_n(ug,"isFunction");function Cn(a){return a==="indeterminate"}_n(Cn,"isIndeterminate");function zu(a){return Cn(a)?"indeterminate":a?"checked":"unchecked"}_n(zu,"getState");function fg({className:a,...o}){return u.jsx(q1,{"data-slot":"checkbox",className:ge("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:u.jsx(V1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:u.jsx(gu,{className:"size-3.5"})})})}function rl({className:a,type:o,...r}){return u.jsx("input",{type:o,"data-slot":"input",className:ge("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),...r})}var Q1=Object.defineProperty,Z1=(a,o)=>Q1(a,"name",{value:o,configurable:!0}),K1=S.forwardRef(Z1(function(o,r){return u.jsx(Vt.label,{...o,ref:r,onMouseDown:c=>{var f;c.target.closest("button, input, select, textarea")||((f=o.onMouseDown)==null||f.call(o,c),!c.defaultPrevented&&c.detail>1&&c.preventDefault())}})},"Label")),$1=K1;function hs({className:a,...o}){return u.jsx($1,{"data-slot":"label",className:ge("flex items-center gap-2 text-sm leading-none font-medium select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...o})}function J1({className:a,...o}){return u.jsx("select",{"data-slot":"select",className:ge("flex h-9 w-full min-w-0 items-center rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",a),...o})}function W1({className:a,...o}){return u.jsx("textarea",{"data-slot":"textarea",className:ge("flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-colors outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...o})}const F1=(a,o)=>a==="optional_model"?["None",...o]:o;function P1(a){let o=0;for(let r=0;rc.toLowerCase().includes(r)):a}function eb({value:a,fieldType:o,models:r,onChange:c,onCommit:m,disabled:f=!1,id:h}){const[p,y]=S.useState(!1),[v,j]=S.useState(""),[b,x]=S.useState(-1),C=S.useRef(null),w=S.useRef(null),E=S.useRef(null),O=`model-options-${h??P1(o)}`,k=S.useMemo(()=>F1(o,r),[o,r]),B=S.useMemo(()=>I1(k,v),[k,v]),Z=p||v!==""?v:a,V=o==="optional_model"&&(!a||a==="None")?"None":a,z=v.trim(),Q=k.includes(z),W=p&&z!==""&&!Q,ne=!f&&a!==""&&V!=="None",le=J=>{var A;y(!1),x(-1),J&&j(""),(A=C.current)==null||A.removeAttribute("aria-activedescendant")},re=J=>{var A;c(J),m==null||m(J),j(""),le(!1),(A=C.current)==null||A.focus()},$=()=>{if(!z)return;const J=k.find(A=>A===z);re(J??z)},F=J=>{if(J.key==="ArrowDown"||J.key==="ArrowUp")if(J.preventDefault(),p){const A=B.length;if(A===0)return;x(D=>(D+(J.key==="ArrowDown"?1:-1)+A)%A)}else y(!0),J.key==="ArrowUp"&&x(B.length-1);else if(p&&J.key==="Home")J.preventDefault(),x(0);else if(p&&J.key==="End")J.preventDefault(),x(B.length-1);else if(J.key==="Enter"){J.preventDefault();const A=p&&b>=0&&b{if(!p)return;const J=A=>{var H;const D=A.target;D&&!((H=w.current)!=null&&H.contains(D))&&le(!0)};return document.addEventListener("pointerdown",J),()=>document.removeEventListener("pointerdown",J)},[p]),S.useEffect(()=>{var A;if(!p||b<0)return;const J=(A=E.current)==null?void 0:A.querySelector(`[data-index="${b}"]`);J==null||J.scrollIntoView({block:"nearest"})},[p,b]);const ie=p&&b>=0&&b{p||(j(""),x(-1)),y(!0)},onInput:J=>{const A=J.target.value;p||y(!0),j(A),x(-1)},onKeyDown:F,onBlur:()=>{if(v.trim()&&v!==a){const A=k.find(D=>D===v)??v;c(A),m==null||m(A)}else o==="optional_model"&&!a.trim()&&(c("None"),m==null||m("None"));j(""),le(!1)}}),ne?u.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Clear model",title:"Clear model",className:"absolute inset-y-0 right-8 flex w-7 items-center justify-center text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",onMouseDown:J=>J.preventDefault(),onClick:()=>{var A;const J=o==="optional_model"?"None":"";c(J),m==null||m(J),j(""),(A=C.current)==null||A.focus()},children:u.jsx(Lp,{className:"size-4"})}):null,u.jsx("button",{type:"button",tabIndex:-1,"aria-label":p?"Close model list":"Open model list","aria-expanded":p,"aria-controls":O,className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center rounded-r-md text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",onMouseDown:J=>J.preventDefault(),onClick:()=>{var J;if(p){le(!0);return}j(""),x(-1),y(!0),(J=C.current)==null||J.focus()},children:u.jsx(Op,{className:ge("size-4 transition-transform duration-200",p&&"rotate-180")})})]}),p?u.jsxs("div",{ref:E,id:O,role:"listbox","aria-label":"Model options",className:"absolute z-20 mt-1 max-h-64 w-full overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95",onMouseDown:J=>J.preventDefault(),onMouseMove:J=>{const A=J.target.closest('[role="option"]');A&&x(B.indexOf(A.dataset.value??""))},children:[W?u.jsxs("div",{role:"option","aria-selected":"false",className:"mb-1 flex cursor-pointer items-center gap-2 rounded-sm border-b px-2 py-1.5 text-sm text-primary",onMouseDown:J=>J.preventDefault(),onClick:()=>$(),children:[u.jsx(lx,{className:"size-3.5 shrink-0"}),u.jsxs("span",{className:"min-w-0 flex-1 truncate",children:['Use "',z,'"']})]}):null,B.length===0?u.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:W?"Press Enter to use this model id.":r.length?"No matching models. Type a model id and press Enter.":"No discovered models. Type a model id and press Enter, or refresh models."}):B.map((J,A)=>{const D=J===V;return u.jsxs("div",{id:`${O}-option-${A}`,role:"option","data-value":J,"data-index":A,"aria-selected":D||A===b,className:ge("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",A===b&&"bg-accent text-accent-foreground",D&&"font-medium text-foreground"),onClick:()=>re(J),children:[u.jsx(gu,{className:ge("size-4 shrink-0",D?"text-primary opacity-100":"opacity-0")}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:J})]},J)})]}):null]})}const dg=/^__fcc_key_(\d+)__$/,sp="********";function tb(a){return"●".repeat(Math.min(24,Math.max(12,a.length)))}function nb(a){const o=dg.exec(a);return o?Number(o[1]):-1}function lb({value:a,locked:o,keyCount:r,fieldKey:c,disabled:m=!1,onChange:f,onMessage:h}){const[p,y]=S.useState(()=>(a||"").split(",").filter(Boolean).map(V=>({token:V}))),[v,j]=S.useState(""),[b,x]=S.useState(null),[C,w]=S.useState(null),E=V=>{y(V),f(V.map(z=>z.token||z.raw||"").join(","))},O=()=>{const V=v.trim();if(V){if(V.includes(",")){h("API keys cannot contain commas.","error");return}if(dg.test(V)){h("This key format is reserved; enter a real API key.","error");return}E([...p,{token:null,raw:V}]),j("")}},k=async V=>{if(b===null)try{const z=await zx(c);x(z.keys)}catch(z){h(z instanceof Error?z.message:String(z),"error");return}w(z=>z===V?null:V)},B=(V,z)=>{if(C!==z)return V.token?sp:tb(V.raw??"");if(V.token){const Q=nb(V.token);return b&&Q>=0&&Q{E(p.map((Q,W)=>W!==V?Q:Q.token?{token:null,raw:z}:{...Q,raw:z}))},Z=r===0?"Add one or more API keys. Multiple keys rotate round-robin with failover.":r===1?"One key configured. Add extra keys for round-robin and failover.":"Multiple keys are used in rotation. Add extra keys for round-robin and failover.";return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("div",{className:"flex flex-col gap-1.5",children:p.map((V,z)=>u.jsxs("div",{className:"flex items-center gap-2 rounded-md border bg-card px-2.5 py-1.5",children:[C===z?u.jsx(rl,{type:"text",autoComplete:"off",value:B(V,z),disabled:o||m,onChange:Q=>q(z,Q.target.value),onBlur:()=>w(null),className:"h-8 flex-1 font-mono text-xs"}):u.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:B(V,z)}),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",disabled:o||m,"aria-label":C===z?"Hide API key":"Show API key",onClick:()=>void k(z),children:C===z?"Hide":"Show"}),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",disabled:o||m,"aria-label":"Remove API key",onClick:()=>E(p.filter((Q,W)=>W!==z)),children:"Remove"})]},z))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(rl,{type:"password",autoComplete:"off",placeholder:"Add API key",value:v,disabled:o||m,onChange:V=>j(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),O())},className:ge(o&&"opacity-50")}),u.jsx(Ce,{type:"button",variant:"secondary",disabled:o||m,onClick:O,children:"Add"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:Z})]})}function ab({field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m}){if(a.pool_supported)return u.jsx(lb,{value:o,locked:a.locked,keyCount:a.key_count??0,fieldKey:a.key,onChange:f=>c(a.key,f),onMessage:m});switch(a.type){case"boolean":return u.jsx(fg,{id:`field-${a.key}`,checked:o==="true",disabled:a.locked,onCheckedChange:f=>c(a.key,f===!0?"true":"false")});case"select":return u.jsx(J1,{id:`field-${a.key}`,value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value),children:a.options.map(f=>u.jsx("option",{value:f.value,children:f.label},f.value))});case"textarea":return u.jsx(W1,{id:`field-${a.key}`,value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value)});case"model":case"optional_model":return u.jsx(eb,{id:`field-${a.key}`,value:o,fieldType:a.type,models:r,disabled:a.locked,onChange:f=>c(a.key,f)});case"secret":return u.jsx(ib,{field:a,value:o,onValueChange:c});default:return u.jsx(rl,{id:`field-${a.key}`,type:a.type==="number"?"number":"text",value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value)})}}function ib({field:a,value:o,onValueChange:r}){const[c,m]=S.useState(!1);return u.jsxs("div",{className:"relative",children:[u.jsx(rl,{id:`field-${a.key}`,type:c?"text":"password",value:o,disabled:a.locked,placeholder:a.configured?"Configured - enter a new value to replace":"Not configured",autoComplete:"off",onChange:f=>r(a.key,f.target.value)}),u.jsx("button",{type:"button",className:"absolute inset-y-0 right-2 flex items-center text-xs text-muted-foreground","aria-label":c?"Hide API key":"Show API key",onMouseDown:f=>{f.preventDefault(),m(h=>!h)},children:c?"Hide":"Show"})]})}function ob({field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m,className:f}){const h=sb(a);return u.jsxs("div",{className:ge("flex flex-col gap-2.5 rounded-lg border bg-card/40 p-4 transition-colors hover:border-border/80",f),"data-key":a.key,children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(hs,{htmlFor:a.type==="boolean"?void 0:`field-${a.key}`,children:u.jsx("span",{className:"text-sm font-medium",children:a.label})}),h?u.jsx(at,{variant:"outline",className:"gap-1 px-1.5 py-0 text-[10px] font-medium text-muted-foreground",children:h}):null]}),u.jsx(ab,{field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m}),a.description?u.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[u.jsx(cx,{className:"mt-0.5 size-3.5 shrink-0 opacity-70"}),u.jsx("span",{children:a.description})]}):null]})}function sb(a){const o={default:"default",template:"template",repo_env:"repo .env",explicit_env_file:"FCC_ENV_FILE",process:"process env"},r=[],c=Object.prototype.hasOwnProperty.call(o,a.source)?o[a.source]:a.source;return c&&r.push(c),a.locked&&r.push("locked"),r.join(" ")}function Kt({className:a,...o}){return u.jsx("div",{"data-slot":"card",className:ge("card-hover flex flex-col gap-6 rounded-xl border bg-card text-card-foreground shadow-sm",a),...o})}function Nn({className:a,...o}){return u.jsx("div",{"data-slot":"card-content",className:ge("px-6",a),...o})}const cb={providers:Ri,runtime:xu,models:Mp,reasoning:ux,web_tools:sx,messaging:Up,voice:dx};function rb({config:a,values:o,onValuesChange:r,modelOptions:c,onRefreshModels:m,focusedView:f}){const h=ul.find(v=>v.id===f)??ul[0],p=new Set(h.sections),y=S.useMemo(()=>a.sections.filter(v=>p.has(v.id)).map(v=>({section:v,fields:a.fields.filter(j=>j.section===v.id)})).filter(v=>v.fields.length>0),[a,p]);return u.jsx(u.Fragment,{children:y.map(({section:v,fields:j})=>u.jsx(ub,{section:v,fields:j,values:o,onValuesChange:r,modelOptions:c,onRefreshModels:m},v.id))})}function ub({section:a,fields:o,values:r,onValuesChange:c,modelOptions:m,onRefreshModels:f}){const h=o.some(w=>w.advanced),[p,y]=S.useState(!1),[v,j]=S.useState(!1),b=a.id==="models",x=cb[a.id]??Ri,C=w=>o.filter(E=>!E.advanced||w).map((E,O)=>u.jsx(ob,{field:E,value:r[E.key]??"",modelOptions:m,onValueChange:(k,B)=>c({...r,[k]:B}),onMessage:()=>{},className:ge(b&&O===0&&"md:col-span-2")},E.key));return u.jsx(Kt,{className:"gap-0 overflow-hidden",children:u.jsxs(Nn,{className:"flex flex-col gap-4 px-5 py-4 md:px-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:u.jsx(x,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-base font-semibold tracking-tight leading-tight",children:a.label}),a.description?u.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}):null]})]}),b?u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.length>0?u.jsxs(at,{variant:"secondary",className:"gap-1.5 font-normal",children:[u.jsx(Mp,{className:"size-3.5"}),m.length," model",m.length===1?"":"s"]}):null,u.jsxs(Ce,{variant:"secondary",size:"sm",disabled:v,onClick:()=>{j(!0),f("__refresh_models__",()=>j(!1))},children:[u.jsx(ki,{className:v?"animate-spin":void 0}),v?"Refreshing":"Refresh models"]})]}):null]}),u.jsx("div",{className:ge("grid gap-3",b&&"md:grid-cols-2"),children:C(p)}),h?u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"self-start text-muted-foreground",onClick:()=>y(w=>!w),children:p?"Hide advanced":"Show advanced"}):null]})})}function mg(a){return["configured","reachable","running","connected"].includes(a??"")?"bg-emerald-500":["missing_key","missing_config","missing_url","unknown","connecting"].includes(a??"")?"bg-amber-500":["offline","error"].includes(a??"")?"bg-red-500":"bg-muted-foreground/50"}const Zr="OPENAI_COMPATIBLE_INSTANCES";function cp(a){if(!a)return[];try{const o=JSON.parse(a);return Array.isArray(o)?o.filter(r=>r!==null&&typeof r=="object"):[]}catch{return[]}}function Oi(a){return`openai_compatible_${a+1}`}function fb(a,o,r){const c=r[a];if(c)return{status:c.status,label:c.label,baseUrl:c.base_url??""};const m=o.provider_status.find(f=>f.provider_id===a);return{status:(m==null?void 0:m.status)??"unknown",label:(m==null?void 0:m.label)??"Not configured",baseUrl:(m==null?void 0:m.base_url)??""}}function db({index:a,instance:o,status:r,locked:c,testing:m,fetching:f,models:h,selected:p,currentDefault:y,onPatch:v,onRemove:j,onTest:b,onFetch:x,onClearModels:C,onAddModels:w,onToggleModel:E,onUseModel:O}){const k=Oi(a),B=!c&&!!o.base_url.trim(),[q,Z]=S.useState(""),V=()=>{const z=q.split(",").map(Q=>Q.trim()).filter(Boolean);z.length!==0&&(w(z),Z(""))};return u.jsx(Kt,{className:"overflow-hidden",children:u.jsxs(Nn,{className:"flex flex-col gap-4 py-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary ring-1 ring-primary/20",children:a+1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("h4",{className:"text-base font-semibold leading-tight",children:["Endpoint ",a+1]}),u.jsxs("p",{className:"font-mono text-xs text-muted-foreground",children:[k,"/"]})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(at,{variant:ay(r.status),className:"gap-1.5",children:[u.jsx("span",{className:ge("size-1.5 rounded-full",mg(r.status))}),r.label]}),u.jsx(Ce,{type:"button",variant:"ghost",size:"icon",disabled:c,"aria-label":`Remove endpoint ${a+1}`,title:"Remove endpoint",onClick:j,children:u.jsx(Jh,{})})]})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-base-url`,children:"Base URL"}),u.jsx(rl,{id:`${k}-base-url`,type:"text",placeholder:"https://your-gateway.example/v1",value:o.base_url,disabled:c,onChange:z=>v({base_url:z.target.value})})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-api-keys`,children:"API keys"}),u.jsx(rl,{id:`${k}-api-keys`,type:"text",autoComplete:"off",placeholder:"key1, key2",value:o.api_keys,disabled:c,onChange:z=>v({api_keys:z.target.value})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keys rotate round-robin with failover. Leave empty for keyless local servers."})]})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-proxy`,children:"Proxy (optional)"}),u.jsx(rl,{id:`${k}-proxy`,type:"text",placeholder:"http://proxy:8080",value:o.proxy,disabled:c,onChange:z=>v({proxy:z.target.value})})]}),u.jsxs("div",{className:"flex flex-col gap-2 rounded-md border bg-muted/30 p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-sm font-medium",children:[u.jsx(Rp,{className:"size-4 text-muted-foreground"}),h.length===0?"No model ids yet":`${h.length} model id${h.length===1?"":"s"}`]}),p.length>0?u.jsxs(at,{variant:"outline",className:"gap-1 px-1.5 py-0 text-[10px]",children:[u.jsx(gu,{className:"size-3"}),p.length," selected"]}):null]}),h.length>0?u.jsxs(Ce,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:C,children:[u.jsx(Jh,{}),"Clear"]}):null]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(rl,{id:`${k}-model-id`,type:"text",autoComplete:"off",placeholder:"Add model id, comma-separated (gpt-4o, deepseek-v3, …)",value:q,disabled:c,onChange:z=>Z(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),V())}}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:c||!q.trim(),onClick:V,children:[u.jsx(Dp,{}),"Add"]})]}),h.length>0?u.jsx("div",{className:"grid max-h-56 gap-1 overflow-auto",children:h.map(z=>{const Q=z===y||`${k}/${z}`===y;return u.jsxs("div",{className:ge("flex items-center gap-2 rounded-md border px-2.5 py-1.5 transition-colors hover:border-border",Q?"border-emerald-200 bg-emerald-50/70 dark:border-emerald-500/30 dark:bg-emerald-500/10":"border-transparent bg-card"),children:[u.jsx(fg,{id:`${k}-model-${z}`,checked:p.includes(z),disabled:c,"aria-label":`Apply model ${z}`,title:p.includes(z)?"Applied to this endpoint":"Select to apply this model",onCheckedChange:()=>E(z)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[Q?u.jsx($h,{className:"size-3.5 shrink-0 fill-amber-400 text-amber-500"}):null,u.jsx("span",{className:"truncate font-mono text-xs",children:z}),Q?u.jsx(at,{variant:"ok",className:"px-1.5 py-0 text-[10px]",children:"default"}):null]}),u.jsxs(Ce,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:()=>O(z),children:[u.jsx($h,{className:"size-3.5"}),"Use as default"]})]},z)})}):u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Add model ids manually, or use ",u.jsx("strong",{children:"Fetch models"})," below to pull them from GET ","{base}","/models."]})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border bg-muted/30 px-3 py-2",children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx(tu,{className:"size-3.5"}),r.baseUrl?`Resolves to ${r.baseUrl}`:"Not checked yet"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:!B||f,onClick:x,title:"Fetch model ids from GET {base}/models (uses the saved config, Apply first)",children:[f?u.jsx(nu,{className:"animate-spin"}):u.jsx(ki,{}),f?"Fetching…":"Fetch models"]}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:!B||m,onClick:b,children:[m?u.jsx(nu,{className:"animate-spin"}):u.jsx(tu,{}),m?"Testing…":"Test connection"]})]})]})]})})}function mb({config:a,values:o,onValuesChange:r,localStatus:c,onTestProvider:m,onFetchModels:f,onAddModels:h,onMessage:p}){const y=a.fields.find(A=>A.key===Zr),v=o[Zr]??(y==null?void 0:y.value)??"[]",[j,b]=S.useState(()=>cp(v)),[x,C]=S.useState(null),[w,E]=S.useState(null),[O,k]=S.useState({});S.useEffect(()=>{b(cp(v))},[v]);const B=A=>{b(A),r({...o,[Zr]:JSON.stringify(A)})},q=(A,D)=>{B(j.map((H,P)=>P===A?{...H,...D}:H))},Z=()=>{B([...j,{base_url:"",api_keys:"",proxy:""}])},V=A=>{B(j.filter((D,H)=>H!==A))},z=async A=>{const D=Oi(A);E(D);try{const H=await f(D);if(H.length===0){p(`No models found at ${D}.`,"warn");return}k(P=>({...P,[D]:[...new Set([...P[D]??[],...H])]})),p(`Fetched ${H.length} models from ${D}.`,"ok")}finally{E(null)}},Q=(A,D)=>{var se;const H=Oi(A);k(je=>({...je,[H]:[...new Set([...je[H]??[],...D])]}));const P=((se=j[A])==null?void 0:se.models)??[];q(A,{models:[...new Set([...P,...D])]}),h(H,D),p(`Added ${D.length} model id${D.length===1?"":"s"} to ${H}. Apply to save.`,"ok")},W=(A,D)=>{var P;const H=((P=j[A])==null?void 0:P.models)??[];q(A,H.includes(D)?{models:H.filter(se=>se!==D)}:{models:[...H,D]})},ne=(A,D)=>{var P;r({...o,MODEL:D});const H=((P=j[A])==null?void 0:P.models)??[];H.includes(D)||q(A,{models:[...H,D]}),p(`Default model set to ${D}. Apply to save.`,"ok")};if(!y)return u.jsx("p",{className:"text-sm text-muted-foreground",children:"OpenAI-Compatible endpoint management is unavailable in this config."});const le=o.OPENAI_COMPATIBLE_BASE_URL??"",re=o.OPENAI_COMPATIBLE_API_KEY??"",$=A=>{var H;const D=Oi(A);return[...new Set([...((H=j[A])==null?void 0:H.models)??[],...O[D]??[]])]},F=A=>{var D;return(((D=j[A])==null?void 0:D.api_keys)??"").split(",").filter(H=>H.trim()).length},ie=j.reduce((A,D,H)=>A+$(H).length,0),J=(()=>{const A=new Map;return j.forEach((D,H)=>{$(H).forEach(P=>{A.set(P,[...A.get(P)??[],H])})}),[...A.entries()].filter(([,D])=>D.length>1).sort(([D],[H])=>D.localeCompare(H))})();return u.jsxs("section",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Endpoints"}),u.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Add any OpenAI-compatible server (vLLM, LM Studio, Ollama, Together, or your own gateway). Each endpoint becomes a numbered provider:"," ",u.jsx("code",{children:"openai_compatible_1/"}),","," ",u.jsx("code",{children:"openai_compatible_2/"}),", … The prefix is optional — a model id also works bare (",u.jsx("code",{children:"MODEL=deepseek"}),") and resolves to whichever endpoint advertises it; when the same id exists on several endpoints, requests rotate round-robin across providers and key pools. Add as many model ids as you want per endpoint, comma-separated, or use ",u.jsx("strong",{children:"Fetch models"})," to pull them from the endpoint's ",u.jsx("code",{children:"/models"})," route. Tick the models you want applied — selected ids are saved with the endpoint on"," ",u.jsx("strong",{children:"Apply"})," and appear in the Model Config dropdowns after a reload."]}),u.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[u.jsxs(at,{variant:"outline",className:"gap-1.5",children:[u.jsx(Ri,{className:"size-3.5 text-muted-foreground"}),j.length," endpoint",j.length===1?"":"s"]}),u.jsxs(at,{variant:"outline",className:"gap-1.5",children:[u.jsx(Rp,{className:"size-3.5 text-muted-foreground"}),ie," model id",ie===1?"":"s"]})]})]}),J.length>0?u.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-500/30 dark:bg-amber-500/10",children:[u.jsxs("p",{className:"flex items-center gap-2 text-sm font-medium text-amber-800 dark:text-amber-300",children:[u.jsx(gx,{className:"size-4 shrink-0"}),"Model ids shared across endpoints rotate round-robin"]}),u.jsx("ul",{className:"mt-2 space-y-1.5 text-sm text-amber-800/90 dark:text-amber-200/90",children:J.map(([A,D])=>u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-500/15",children:A})," ","is served by"," ",D.map(H=>`Endpoint ${H+1} (${F(H)} key${F(H)===1?"":"s"})`).join(", ")," ","— requests cycle across providers and key pools."]},A))})]}):null,j.length===0&&le.trim()?u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-lg border border-amber-200 bg-amber-50 p-4",children:[u.jsxs("p",{className:"text-sm text-amber-800",children:["You already have the legacy ",u.jsx("code",{children:"OPENAI_COMPATIBLE_BASE_URL"})," ","endpoint configured. Import it as endpoint 1, or keep it and add more endpoints below."]}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",onClick:()=>B([{base_url:le,api_keys:re,proxy:""}]),children:[u.jsx(Dp,{}),"Import as endpoint 1"]})]}):null,j.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(Ri,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No endpoints yet. Add your first OpenAI-compatible endpoint."}),u.jsxs(Ce,{type:"button",onClick:Z,children:[u.jsx(Kh,{}),"Add endpoint"]})]})}):u.jsxs("div",{className:"grid gap-4",children:[j.map((A,D)=>{const H=Oi(D);return u.jsx(db,{index:D,instance:A,status:fb(H,a,c),locked:y.locked,testing:x===H,fetching:w===H,models:$(D),selected:A.models??[],currentDefault:o.MODEL??"",onPatch:P=>q(D,P),onRemove:()=>V(D),onTest:()=>{C(H),m(H,()=>C(null))},onFetch:()=>void z(D),onClearModels:()=>{k(P=>({...P,[H]:[]})),q(D,{models:[]})},onAddModels:P=>Q(D,P),onToggleModel:P=>W(D,P),onUseModel:P=>ne(D,P)},H)}),u.jsxs(Ce,{type:"button",variant:"outline",className:"w-full border-dashed",onClick:Z,children:[u.jsx(Kh,{}),"Add endpoint"]})]})]})}function hb({provider:a,state:o,onTest:r}){const[c,m]=S.useState(!1),f=a.kind==="local",h=f?o.baseUrl||(o.baseUrl!==void 0?"No local URL enabled":""):a.configuration||"",p=f?"Test":"Refresh models",y=f?ax:tu;return u.jsxs(Kt,{className:"flex flex-row items-center justify-between gap-3 p-4 transition-shadow hover:shadow-md",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx("span",{className:ge("flex size-10 shrink-0 items-center justify-center rounded-lg",f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:u.jsx(y,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("strong",{className:"truncate text-sm",children:a.display_name||a.provider_id}),u.jsx(hg,{status:o.status,label:o.label})]}),u.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:h})]})]}),u.jsxs(Ce,{variant:"secondary",size:"sm",className:"shrink-0",disabled:c,onClick:()=>{m(!0),r(a.provider_id,()=>m(!1))},children:[c?u.jsx(ki,{className:"animate-spin"}):u.jsx(y,{className:"size-4"}),c?f?"Testing":"Refreshing":p]})]})}function pb({provider:a,status:o,loading:r,onStartLogin:c,onCancelLogin:m,onDisconnect:f,onCopyDeviceCode:h}){const p=o.connected===!0,y=o.state==="connecting",v=o.authorization_url||o.verification_url;return u.jsxs(Kt,{className:"flex flex-col gap-3 p-4 transition-shadow hover:shadow-md",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:ge("flex size-10 shrink-0 items-center justify-center rounded-lg",p?"bg-emerald-500/10 text-emerald-600":y?"bg-amber-500/10 text-amber-600":"bg-muted text-muted-foreground"),children:u.jsx(rx,{className:"size-4.5"})}),u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[u.jsx("strong",{className:"truncate text-sm",children:a.display_name||a.provider_id}),u.jsx(hg,{status:o.state,label:o.label})]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:gb(o)}),u.jsx("div",{className:"flex flex-wrap gap-2",children:y?u.jsxs(u.Fragment,{children:[v?u.jsx(Ce,{variant:"default",size:"sm",onClick:()=>window.open(v,"_blank","noopener"),children:"Open sign-in"}):null,o.mode==="device"&&o.user_code?u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>h(o.user_code),children:"Copy code"}):null,u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>m(a.provider_id),children:"Cancel"})]}):p?u.jsxs(u.Fragment,{children:[u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>c(a.provider_id,"browser"),children:"Reconnect"}),u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>f(a.provider_id),children:"Disconnect"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{variant:"default",size:"sm",disabled:r,onClick:()=>c(a.provider_id,"browser"),children:"Connect"}),u.jsx(Ce,{variant:"secondary",size:"sm",disabled:r,onClick:()=>c(a.provider_id,"device"),children:"Use device code"})]})})]})}function hg({status:a,label:o}){const r=a==="connecting";return u.jsxs(at,{variant:ay(a),className:"gap-1.5",children:[u.jsx("span",{className:ge("size-1.5 rounded-full",mg(a),r&&"animate-pulse")}),o]})}function gb(a){if(a.connected){const o=a.email||"ChatGPT subscription connected",r=Number.isInteger(a.model_count)?` ${a.model_count} model${a.model_count===1?"":"s"} available.`:"",c=a.message?` ${a.message}`:"";return`${o}.${r}${c} Restart your agent to refresh its model picker.`}return a.mode==="device"&&a.user_code?`Enter code ${a.user_code} at ${a.verification_url}`:a.state==="connecting"?"Finish signing in, then return to this page.":a.message||"Connect a ChatGPT account to discover subscription models."}function yb({config:a,localStatus:o,connectedStatus:r,connectedLoading:c,onTestProvider:m,onRefreshModels:f,onStartLogin:h,onCancelLogin:p,onDisconnect:y,onCopyDeviceCode:v}){const j=a.provider_status.filter(w=>w.kind==="connected_account"),b=a.provider_status.filter(w=>w.kind!=="connected_account"),x=w=>{const E=o[w.provider_id],O=a.provider_status.find(k=>k.provider_id===w.provider_id);return E?{status:E.status,label:E.label,baseUrl:E.status_code!==void 0?`${E.base_url} returned HTTP ${E.status_code}`:E.base_url}:{status:(O==null?void 0:O.status)??"unknown",label:(O==null?void 0:O.label)??"Not checked",baseUrl:(O==null?void 0:O.base_url)??""}},C=w=>r[w.provider_id]??{state:"disconnected",connected:!1,label:"Not connected"};return u.jsxs(u.Fragment,{children:[j.length>0&&u.jsxs("section",{className:"space-y-4","aria-label":"Connected accounts",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Connected accounts"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Use an existing subscription without storing credentials in .env."})]}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:j.map(w=>u.jsx(pb,{provider:w,status:C(w),loading:c[w.provider_id]===!0,onStartLogin:h,onCancelLogin:p,onDisconnect:y,onCopyDeviceCode:v},w.provider_id))})]}),u.jsxs("section",{className:"space-y-4","aria-label":"Provider status",children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Providers"}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:b.map(w=>u.jsx(hb,{provider:w,state:x(w),onTest:(E,O)=>{w.kind==="local"?m(E,O):f(E,O)}},w.provider_id))})]})]})}var vb=Object.defineProperty,pg=(a,o)=>vb(a,"name",{value:o,configurable:!0}),rp="horizontal",xb=["horizontal","vertical"],bb=S.forwardRef(pg(function(o,r){const{decorative:c,orientation:m=rp,...f}=o,h=gg(m)?m:rp,y=c?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return u.jsx(Vt.div,{"data-orientation":h,...y,...f,ref:r})},"Separator"));function gg(a){return xb.includes(a)}pg(gg,"isValidOrientation");var Sb=bb;function jb({className:a,orientation:o="horizontal",decorative:r=!0,...c}){return u.jsx(Sb,{"data-slot":"separator",decorative:r,orientation:o,className:ge("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",a),...c})}var wb=Object.defineProperty,Nb=(a,o)=>wb(a,"name",{value:o,configurable:!0});function qi(a){const o=S.useRef(a);return S.useEffect(()=>{o.current=a}),S.useMemo(()=>((...r)=>{var c;return(c=o.current)==null?void 0:c.call(o,...r)}),[])}Nb(qi,"useCallbackRef");var Cb=Object.defineProperty,Pe=(a,o)=>Cb(a,"name",{value:o,configurable:!0}),cu="dismissableLayer.update",Ab="dismissableLayer.pointerDownOutside",Tb="dismissableLayer.focusOutside",up,yg=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Eb=S.forwardRef(Pe(function(o,r){const{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:m=!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:v,...j}=o,b=S.useContext(yg),[x,C]=S.useState(null),w=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=S.useState({}),O=On(r,C),k=Array.from(b.layers),[B]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),q=B?k.indexOf(B):-1,Z=x?k.indexOf(x):-1,V=b.layersWithOutsidePointerEventsDisabled.size>0,z=Z>=q,Q=S.useRef(!1),W=vg($=>{h==null||h($),y==null||y($),$.defaultPrevented||v==null||v()},{ownerDocument:w,deferPointerDownOutside:m,isDeferredPointerDownOutsideRef:Q,dismissableSurfaces:b.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback($=>{if(!($ instanceof Node))return!1;const F=[...b.branches].some(ie=>ie.contains($));return z&&!F},[b.branches,z])}),ne=xg($=>{if(m&&Q.current)return;const F=$.target;[...b.branches].some(J=>J.contains(F))||(p==null||p($),y==null||y($),$.defaultPrevented||v==null||v())},w),le=x?Z===k.length-1:!1,re=qi($=>{$.key==="Escape"&&(f==null||f($),!$.defaultPrevented&&v&&($.preventDefault(),v()))});return S.useEffect(()=>{if(le)return w.addEventListener("keydown",re,{capture:!0}),()=>w.removeEventListener("keydown",re,{capture:!0})},[w,le,re]),S.useEffect(()=>{if(x)return c&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(up=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(x)),b.layers.add(x),ru(),()=>{c&&(b.layersWithOutsidePointerEventsDisabled.delete(x),b.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=up))}},[x,w,c,b]),S.useEffect(()=>()=>{x&&(b.layers.delete(x),b.layersWithOutsidePointerEventsDisabled.delete(x),ru())},[x,b]),S.useEffect(()=>{const $=Pe(()=>E({}),"handleUpdate");return document.addEventListener(cu,$),()=>document.removeEventListener(cu,$)},[]),u.jsx(Vt.div,{...j,ref:O,style:{pointerEvents:V?z?"auto":"none":void 0,...o.style},onFocusCapture:Et(o.onFocusCapture,ne.onFocusCapture),onBlurCapture:Et(o.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:Et(o.onPointerDownCapture,W.onPointerDownCapture)})},"DismissableLayer"));function zb(){const a=S.useContext(yg),[o,r]=S.useState(null);return S.useEffect(()=>{if(o)return a.dismissableSurfaces.add(o),()=>{a.dismissableSurfaces.delete(o)}},[o,a.dismissableSurfaces]),r}Pe(zb,"useDismissableLayerSurface");var _b=Pe(()=>!0,"IS_TRUE");function vg(a,o){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:m,dismissableSurfaces:f,shouldHandlePointerDownOutside:h=_b}=o,p=qi(a),y=S.useRef(!1),v=S.useRef(!1),j=S.useRef(new Map),b=S.useRef(()=>{});return S.useEffect(()=>{function x(){v.current=!1,m.current=!1,j.current.clear()}Pe(x,"resetOutsideInteraction");function C(){return Array.from(j.current.values()).some(Boolean)}Pe(C,"isOutsideInteractionIntercepted");function w(q){if(!v.current)return;const Z=q.target;Z instanceof Node&&[...f].some(z=>z.contains(Z))||j.current.set(q.type,!0),q.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}Pe(w,"handleInteractionCapture");function E(q){v.current&&j.current.set(q.type,!1)}Pe(E,"handleInteractionBubble");const O=Pe(q=>{if(q.target&&!y.current){let Z=function(){r.removeEventListener("click",b.current);const z=C();x(),z||_u(Ab,p,V,{discrete:!0})};if(Pe(Z,"handleAndDispatchPointerDownOutsideEvent"),!h(q.target)){r.removeEventListener("click",b.current),x(),y.current=!1;return}const V={originalEvent:q};v.current=!0,m.current=c&&q.button===0,j.current.clear(),!c||q.button!==0?Z():(r.removeEventListener("click",b.current),b.current=Z,r.addEventListener("click",b.current,{once:!0}))}else r.removeEventListener("click",b.current),x();y.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const q of k)r.addEventListener(q,w,!0),r.addEventListener(q,E);const B=window.setTimeout(()=>{r.addEventListener("pointerdown",O)},0);return()=>{window.clearTimeout(B),r.removeEventListener("pointerdown",O),r.removeEventListener("click",b.current);for(const q of k)r.removeEventListener(q,w,!0),r.removeEventListener(q,E)}},[r,p,c,m,f,h]),{onPointerDownCapture:Pe(()=>y.current=!0,"onPointerDownCapture")}}Pe(vg,"usePointerDownOutside");function xg(a,o=globalThis==null?void 0:globalThis.document){const r=qi(a),c=S.useRef(!1);return S.useEffect(()=>{const m=Pe(f=>{f.target&&!c.current&&_u(Tb,r,{originalEvent:f},{discrete:!1})},"handleFocus");return o.addEventListener("focusin",m),()=>o.removeEventListener("focusin",m)},[o,r]),{onFocusCapture:Pe(()=>c.current=!0,"onFocusCapture"),onBlurCapture:Pe(()=>c.current=!1,"onBlurCapture")}}Pe(xg,"useFocusOutside");function ru(){const a=new CustomEvent(cu);document.dispatchEvent(a)}Pe(ru,"dispatchUpdate");function _u(a,o,r,{discrete:c}){const m=r.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:r});o&&m.addEventListener(a,o,{once:!0}),c?cg(m,f):m.dispatchEvent(f)}Pe(_u,"handleAndDispatchCustomEvent");var Mb=Object.defineProperty,Ob=(a,o)=>Mb(a,"name",{value:o,configurable:!0}),kb=Hi[" useId ".trim().toString()]||(()=>{}),Rb=0;function bg(a){const[o,r]=S.useState(kb());return $t(()=>{a||r(c=>c??String(Rb++))},[a]),a||(o?`radix-${o}`:"")}Ob(bg,"useId");const Db=["top","right","bottom","left"],fl=Math.min,An=Math.max,ys=Math.round,fs=Math.floor,Tn=a=>({x:a,y:a}),Ub={left:"right",right:"left",bottom:"top",top:"bottom"};function Sg(a,o,r){return An(a,fl(o,r))}function Mn(a,o){return typeof a=="function"?a(o):a}function dl(a){return a.split("-")[0]}function Ma(a){return a.split("-")[1]}function Mu(a){return a==="x"?"y":"x"}function Ou(a){return a==="y"?"height":"width"}function tn(a){const o=a[0];return o==="t"||o==="b"?"y":"x"}function ku(a){return Mu(tn(a))}function Lb(a,o,r){r===void 0&&(r=!1);const c=Ma(a),m=ku(a),f=Ou(m);let h=m==="x"?c===(r?"end":"start")?"right":"left":c==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(h=vs(h)),[h,vs(h)]}function Hb(a){const o=vs(a);return[uu(a),o,uu(o)]}function uu(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const fp=["left","right"],dp=["right","left"],Bb=["top","bottom"],qb=["bottom","top"];function Gb(a,o,r){switch(a){case"top":case"bottom":return r?o?dp:fp:o?fp:dp;case"left":case"right":return o?Bb:qb;default:return[]}}function Vb(a,o,r,c){const m=Ma(a);let f=Gb(dl(a),r==="start",c);return m&&(f=f.map(h=>h+"-"+m),o&&(f=f.concat(f.map(uu)))),f}function vs(a){const o=dl(a);return Ub[o]+a.slice(o.length)}function Yb(a){var o,r,c,m;return{top:(o=a.top)!=null?o:0,right:(r=a.right)!=null?r:0,bottom:(c=a.bottom)!=null?c:0,left:(m=a.left)!=null?m:0}}function jg(a){return typeof a!="number"?Yb(a):{top:a,right:a,bottom:a,left:a}}function xs(a){const{x:o,y:r,width:c,height:m}=a;return{width:c,height:m,top:r,left:o,right:o+c,bottom:r+m,x:o,y:r}}function mp(a,o,r){let{reference:c,floating:m}=a;const f=tn(o),h=ku(o),p=Ou(h),y=dl(o),v=f==="y",j=c.x+c.width/2-m.width/2,b=c.y+c.height/2-m.height/2,x=c[p]/2-m[p]/2;let C;switch(y){case"top":C={x:j,y:c.y-m.height};break;case"bottom":C={x:j,y:c.y+c.height};break;case"right":C={x:c.x+c.width,y:b};break;case"left":C={x:c.x-m.width,y:b};break;default:C={x:c.x,y:c.y}}const w=Ma(o);return w&&(C[h]+=x*(w==="end"?1:-1)*(r&&v?-1:1)),C}async function Xb(a,o){var r;o===void 0&&(o={});const{x:c,y:m,platform:f,rects:h,elements:p,strategy:y}=a,{boundary:v="clippingAncestors",rootBoundary:j="viewport",elementContext:b="floating",altBoundary:x=!1,padding:C=0}=Mn(o,a),w=jg(C),O=p[x?b==="floating"?"reference":"floating":b],k=xs(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(O)))==null||r?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(p.floating)),boundary:v,rootBoundary:j,strategy:y})),B=b==="floating"?{x:c,y:m,width:h.floating.width,height:h.floating.height}:h.reference,q=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p.floating)),Z=await(f.isElement==null?void 0:f.isElement(q))&&await(f.getScale==null?void 0:f.getScale(q))||{x:1,y:1},V=xs(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:B,offsetParent:q,strategy:y}):B);return{top:(k.top-V.top+w.top)/Z.y,bottom:(V.bottom-k.bottom+w.bottom)/Z.y,left:(k.left-V.left+w.left)/Z.x,right:(V.right-k.right+w.right)/Z.x}}const Qb=50,Zb=async(a,o,r)=>{const{placement:c="bottom",strategy:m="absolute",middleware:f=[],platform:h}=r,p=h.detectOverflow?h:{...h,detectOverflow:Xb},y=await(h.isRTL==null?void 0:h.isRTL(o));let v=await h.getElementRects({reference:a,floating:o,strategy:m}),{x:j,y:b}=mp(v,c,y),x=c,C=0;const w={};for(let E=0;E({name:"arrow",options:a,async fn(o){const{x:r,y:c,placement:m,rects:f,platform:h,elements:p,middlewareData:y}=o,{element:v,padding:j=0}=Mn(a,o)||{};if(v==null)return{};const b=jg(j),x={x:r,y:c},C=ku(m),w=Ou(C),E=await h.getDimensions(v),O=C==="y",k=O?"top":"left",B=O?"bottom":"right",q=O?"clientHeight":"clientWidth",Z=f.reference[w]+f.reference[C]-x[C]-f.floating[w],V=x[C]-f.reference[C],z=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let Q=z?z[q]:0;(!Q||!await(h.isElement==null?void 0:h.isElement(z)))&&(Q=p.floating[q]||f.floating[w]);const W=Z/2-V/2,ne=Q/2-E[w]/2-1,le=fl(b[k],ne),re=fl(b[B],ne),$=Q-E[w]-re,F=Q/2-E[w]/2+W,ie=Sg(le,F,$),J=!y.arrow&&Ma(m)!=null&&F!==ie&&f.reference[w]/2-(Fie<=0)){var re,$;const ie=(((re=f.flip)==null?void 0:re.index)||0)+1,J=Q[ie];if(J&&(!(b==="alignment"?B!==tn(J):!1)||le.every(H=>tn(H.placement)===B?H.overflows[0]>0:!0)))return{data:{index:ie,overflows:le},reset:{placement:J}};let A=($=le.filter(D=>D.overflows[0]<=0).sort((D,H)=>D.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!A)switch(C){case"bestFit":{var F;const D=(F=le.filter(H=>{if(z){const P=tn(H.placement);return P===B||P==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(P=>P>0).reduce((P,se)=>P+se,0)]).sort((H,P)=>H[1]-P[1])[0])==null?void 0:F[0];D&&(A=D);break}case"initialPlacement":A=p;break}if(m!==A)return{reset:{placement:A}}}return{}}}};function hp(a,o){return{top:a.top-o.height,right:a.right-o.width,bottom:a.bottom-o.height,left:a.left-o.width}}function pp(a){return Db.some(o=>a[o]>=0)}const Jb=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(o){const{rects:r,platform:c}=o,{strategy:m="referenceHidden",...f}=Mn(a,o);switch(m){case"referenceHidden":{const h=await c.detectOverflow(o,{...f,elementContext:"reference"}),p=hp(h,r.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:pp(p)}}}case"escaped":{const h=await c.detectOverflow(o,{...f,altBoundary:!0}),p=hp(h,r.floating);return{data:{escapedOffsets:p,escaped:pp(p)}}}default:return{}}}}},wg=new Set(["left","top"]);async function Wb(a,o){const{placement:r,platform:c,elements:m}=a,f=await(c.isRTL==null?void 0:c.isRTL(m.floating)),h=dl(r),p=Ma(r),y=tn(r)==="y",v=wg.has(h)?-1:1,j=f&&y?-1:1,b=Mn(o,a);let{mainAxis:x,crossAxis:C,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return p&&typeof w=="number"&&(C=p==="end"?w*-1:w),y?{x:C*j,y:x*v}:{x:x*v,y:C*j}}const Fb=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(o){var r,c;const{x:m,y:f,placement:h,middlewareData:p}=o,y=await Wb(o,a);return h===((r=p.offset)==null?void 0:r.placement)&&(c=p.arrow)!=null&&c.alignmentOffset?{}:{x:m+y.x,y:f+y.y,data:{...y,placement:h}}}}},Pb=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(o){const{x:r,y:c,placement:m,platform:f}=o,{mainAxis:h=!0,crossAxis:p=!1,limiter:y={fn:B=>{let{x:q,y:Z}=B;return{x:q,y:Z}}},...v}=Mn(a,o),j={x:r,y:c},b=await f.detectOverflow(o,v),x=tn(m),C=Mu(x);let w=j[C],E=j[x];const O=(B,q)=>Sg(q+b[B==="y"?"top":"left"],q,q-b[B==="y"?"bottom":"right"]);h&&(w=O(C,w)),p&&(E=O(x,E));const k=y.fn({...o,[C]:w,[x]:E});return{...k,data:{x:k.x-r,y:k.y-c,enabled:{[C]:h,[x]:p}}}}}},Ib=function(a){return a===void 0&&(a={}),{options:a,fn(o){var r,c;const{x:m,y:f,placement:h,rects:p,middlewareData:y}=o,{offset:v=0,mainAxis:j=!0,crossAxis:b=!0}=Mn(a,o),x={x:m,y:f},C=tn(h),w=Mu(C);let E=x[w],O=x[C];const k=Mn(v,o),B=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(r=k.mainAxis)!=null?r:0,crossAxis:(c=k.crossAxis)!=null?c:0};if(j){const V=w==="y"?"height":"width",z=p.reference[w]-p.floating[V]+B.mainAxis,Q=p.reference[w]+p.reference[V]-B.mainAxis;EQ&&(E=Q)}if(b){var q,Z;const V=w==="y"?"width":"height",z=wg.has(dl(h)),Q=p.reference[C]-p.floating[V]+(z&&((q=y.offset)==null?void 0:q[C])||0)+(z?0:B.crossAxis),W=p.reference[C]+p.reference[V]+(z?0:((Z=y.offset)==null?void 0:Z[C])||0)-(z?B.crossAxis:0);OW&&(O=W)}return{[w]:E,[C]:O}}}},e2=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(o){const{placement:r,rects:c,platform:m,elements:f}=o,{apply:h=()=>{},...p}=Mn(a,o),y=await m.detectOverflow(o,p),v=dl(r),j=Ma(r),b=tn(r)==="y",{width:x,height:C}=c.floating;let w,E;v==="top"||v==="bottom"?(w=v,E=j===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(E=v,w=j==="end"?"top":"bottom");const O=C-y.top-y.bottom,k=x-y.left-y.right,B=fl(C-y[w],O),q=fl(x-y[E],k),Z=o.middlewareData.shift,V=!Z;let z=B,Q=q;Z!=null&&Z.enabled.x&&(Q=k),Z!=null&&Z.enabled.y&&(z=O),V&&!j&&(b?Q=x-2*An(y.left,y.right):z=C-2*An(y.top,y.bottom)),await h({...o,availableWidth:Q,availableHeight:z});const W=await m.getDimensions(f.floating);return x!==W.width||C!==W.height?{reset:{rects:!0}}:{}}}};function js(){return typeof window<"u"}function Oa(a){return Ng(a)?(a.nodeName||"").toLowerCase():"#document"}function pt(a){var o;return(a==null||(o=a.ownerDocument)==null?void 0:o.defaultView)||window}function kn(a){var o;return(o=(Ng(a)?a.ownerDocument:a.document)||window.document)==null?void 0:o.documentElement}function Ng(a){return js()?a instanceof Node||a instanceof pt(a).Node:!1}function nn(a){return js()?a instanceof Element||a instanceof pt(a).Element:!1}function ml(a){return js()?a instanceof HTMLElement||a instanceof pt(a).HTMLElement:!1}function gp(a){return!js()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof pt(a).ShadowRoot}function ws(a){const{overflow:o,overflowX:r,overflowY:c,display:m}=ln(a);return/auto|scroll|overlay|hidden|clip/.test(o+c+r)&&m!=="inline"&&m!=="contents"}function t2(a){return/^(table|td|th)$/.test(Oa(a))}function Ns(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const n2=/transform|translate|scale|rotate|perspective|filter/,l2=/paint|layout|strict|content/,kl=a=>!!a&&a!=="none";let Kr;function Ru(a){const o=nn(a)?ln(a):a;return kl(o.transform)||kl(o.translate)||kl(o.scale)||kl(o.rotate)||kl(o.perspective)||!Du()&&(kl(o.backdropFilter)||kl(o.filter))||n2.test(o.willChange||"")||l2.test(o.contain||"")}function a2(a){let o=Ll(a);for(;ml(o)&&!Di(o);){if(Ru(o))return o;if(Ns(o))return null;o=Ll(o)}return null}function Du(){return Kr==null&&(Kr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kr}function Di(a){return/^(html|body|#document)$/.test(Oa(a))}function ln(a){return pt(a).getComputedStyle(a)}function Cs(a){return nn(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Ll(a){if(Oa(a)==="html")return a;const o=a.assignedSlot||a.parentNode||gp(a)&&a.host||kn(a);return gp(o)?o.host:o}function Cg(a){const o=Ll(a);return Di(o)?(a.ownerDocument||a).body:ml(o)&&ws(o)?o:Cg(o)}function Ui(a,o,r){var c;o===void 0&&(o=[]),r===void 0&&(r=!0);const m=Cg(a),f=m===((c=a.ownerDocument)==null?void 0:c.body),h=pt(m);if(f){const p=fu(h);return o.concat(h,h.visualViewport||[],ws(m)?m:[],p&&r?Ui(p):[])}else return o.concat(m,Ui(m,[],r))}function fu(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function Ag(a){const o=ln(a);let r=parseFloat(o.width)||0,c=parseFloat(o.height)||0;const m=ml(a),f=m?a.offsetWidth:r,h=m?a.offsetHeight:c,p=ys(r)!==f||ys(c)!==h;return p&&(r=f,c=h),{width:r,height:c,$:p}}function Uu(a){return nn(a)?a:a.contextElement}function Ea(a){const o=Uu(a);if(!ml(o))return Tn(1);const r=o.getBoundingClientRect(),{width:c,height:m,$:f}=Ag(o);let h=(f?ys(r.width):r.width)/c,p=(f?ys(r.height):r.height)/m;return(!h||!Number.isFinite(h))&&(h=1),(!p||!Number.isFinite(p))&&(p=1),{x:h,y:p}}const i2=Tn(0);function Tg(a){const o=pt(a);return!Du()||!o.visualViewport?i2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function o2(a,o,r){return o===void 0&&(o=!1),!!r&&o&&r===pt(a)}function Hl(a,o,r,c){o===void 0&&(o=!1),r===void 0&&(r=!1);const m=a.getBoundingClientRect(),f=Uu(a);let h=Tn(1);o&&(c?nn(c)&&(h=Ea(c)):h=Ea(a));const p=o2(f,r,c)?Tg(f):Tn(0);let y=(m.left+p.x)/h.x,v=(m.top+p.y)/h.y,j=m.width/h.x,b=m.height/h.y;if(f&&c){const x=pt(f),C=nn(c)?pt(c):c;let w=x,E=fu(w);for(;E&&C!==w;){const O=Ea(E),k=E.getBoundingClientRect(),B=ln(E),q=k.left+(E.clientLeft+parseFloat(B.paddingLeft))*O.x,Z=k.top+(E.clientTop+parseFloat(B.paddingTop))*O.y;y*=O.x,v*=O.y,j*=O.x,b*=O.y,y+=q,v+=Z,w=pt(E),E=fu(w)}}return xs({width:j,height:b,x:y,y:v})}function As(a,o){const r=Cs(a).scrollLeft;return o?o.left+r:Hl(kn(a)).left+r}function Eg(a,o){const r=a.getBoundingClientRect(),c=r.left+o.scrollLeft-As(a,r),m=r.top+o.scrollTop;return{x:c,y:m}}function s2(a){let{elements:o,rect:r,offsetParent:c,strategy:m}=a;const f=m==="fixed",h=kn(c),p=o?Ns(o.floating):!1;if(c===h||p&&f)return r;let y={scrollLeft:0,scrollTop:0},v=Tn(1);const j=Tn(0),b=ml(c);if((b||!f)&&((Oa(c)!=="body"||ws(h))&&(y=Cs(c)),b)){const C=Hl(c);v=Ea(c),j.x=C.x+c.clientLeft,j.y=C.y+c.clientTop}const x=h&&!b&&!f?Eg(h,y):Tn(0);return{width:r.width*v.x,height:r.height*v.y,x:r.x*v.x-y.scrollLeft*v.x+j.x+x.x,y:r.y*v.y-y.scrollTop*v.y+j.y+x.y}}function c2(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function r2(a){const o=Cs(a),r=a.ownerDocument.body,c=An(a.scrollWidth,a.clientWidth,r.scrollWidth,r.clientWidth),m=An(a.scrollHeight,a.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+As(a);const h=-o.scrollTop;return ln(r).direction==="rtl"&&(f+=An(a.clientWidth,r.clientWidth)-c),{width:c,height:m,x:f,y:h}}const u2=25;function f2(a,o,r){r===void 0&&(r="viewport");const c=r==="layoutViewport",m=pt(a),f=kn(a),h=m.visualViewport;let p=f.clientWidth,y=f.clientHeight,v=0,j=0;if(h){const x=!Du()||o==="fixed";c?x||(v=-h.offsetLeft,j=-h.offsetTop):(p=h.width,y=h.height,x&&(v=h.offsetLeft,j=h.offsetTop))}if(As(f)<=0){const x=f.ownerDocument,C=x.body,w=getComputedStyle(C),E=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,O=Math.abs(f.clientWidth-C.clientWidth-E),k=getComputedStyle(f).scrollbarGutter==="stable both-edges"?O/2:O;k<=u2&&(p-=k)}return{width:p,height:y,x:v,y:j}}function d2(a,o){const r=Hl(a,!0,o==="fixed"),c=r.top+a.clientTop,m=r.left+a.clientLeft,f=Ea(a),h=a.clientWidth*f.x,p=a.clientHeight*f.y,y=m*f.x,v=c*f.y;return{width:h,height:p,x:y,y:v}}function yp(a,o,r){let c;if(o==="viewport"||o==="layoutViewport")c=f2(a,r,o);else if(o==="document")c=r2(kn(a));else if(nn(o))c=d2(o,r);else{const m=Tg(a);c={x:o.x-m.x,y:o.y-m.y,width:o.width,height:o.height}}return xs(c)}function m2(a,o){const r=o.get(a);if(r)return r;let c=Ui(a,[],!1).filter(p=>nn(p)&&Oa(p)!=="body"),m=null;const f=ln(a).position==="fixed";let h=f?Ll(a):a;for(;nn(h)&&!Di(h);){const p=ln(h),y=Ru(h),v=m?m.position:f?"fixed":"";!y&&(v==="fixed"||v==="absolute"&&p.position==="static")?c=c.filter(b=>b!==h):m=p,h=Ll(h)}return o.set(a,c),c}function h2(a){let{element:o,boundary:r,rootBoundary:c,strategy:m}=a;const h=[...r==="clippingAncestors"?Ns(o)?[]:m2(o,this._c):[].concat(r),c],p=yp(o,h[0],m);let y=p.top,v=p.right,j=p.bottom,b=p.left;for(let x=1;x{p(!1,1e-7)},1e3)}Q=!1}try{c=new IntersectionObserver(W,{...z,root:f.ownerDocument})}catch{c=new IntersectionObserver(W,z)}c.observe(a)}const y=pt(a),v=()=>p(r);return y.addEventListener("resize",v),p(!0),()=>{y.removeEventListener("resize",v),h()}}function S2(a,o,r,c){c===void 0&&(c={});const{ancestorScroll:m=!0,ancestorResize:f=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:y=!1}=c,v=Uu(a),j=m||f?[...v?Ui(v):[],...o?Ui(o):[]]:[];j.forEach(k=>{m&&k.addEventListener("scroll",r),f&&k.addEventListener("resize",r)});const b=v&&p?b2(v,r,f):null;let x=-1,C=null;h&&(C=new ResizeObserver(k=>{let[B]=k;B&&B.target===v&&C&&o&&(C.unobserve(o),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var q;(q=C)==null||q.observe(o)})),r()}),v&&!y&&C.observe(v),o&&C.observe(o));let w,E=y?Hl(a):null;y&&O();function O(){const k=Hl(a);E&&!_g(E,k)&&r(),E=k,w=requestAnimationFrame(O)}return r(),()=>{var k;j.forEach(B=>{m&&B.removeEventListener("scroll",r),f&&B.removeEventListener("resize",r)}),b==null||b(),(k=C)==null||k.disconnect(),C=null,y&&cancelAnimationFrame(w)}}const j2=Fb,w2=Pb,N2=$b,C2=e2,A2=Jb,xp=Kb,T2=Ib,E2=(a,o,r)=>{const c=new Map,m=r??{},f={...x2,...m.platform,_c:c};return Zb(a,o,{...m,platform:f})};var z2=typeof document<"u",_2=function(){},ps=z2?S.useLayoutEffect:_2;function bs(a,o){if(a===o)return!0;if(typeof a!=typeof o)return!1;if(typeof a=="function"&&a.toString()===o.toString())return!0;let r,c,m;if(a&&o&&typeof a=="object"){if(Array.isArray(a)){if(r=a.length,r!==o.length)return!1;for(c=r;c--!==0;)if(!bs(a[c],o[c]))return!1;return!0}if(m=Object.keys(a),r=m.length,r!==Object.keys(o).length)return!1;for(c=r;c--!==0;)if(!{}.hasOwnProperty.call(o,m[c]))return!1;for(c=r;c--!==0;){const f=m[c];if(!(f==="_owner"&&a.$$typeof)&&!bs(a[f],o[f]))return!1}return!0}return a!==a&&o!==o}function Mg(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function bp(a,o){const r=Mg(a);return Math.round(o*r)/r}function Jr(a){const o=S.useRef(a);return ps(()=>{o.current=a}),o}function M2(a){a===void 0&&(a={});const{placement:o="bottom",strategy:r="absolute",middleware:c=[],platform:m,elements:{reference:f,floating:h}={},transform:p=!0,whileElementsMounted:y,open:v}=a,[j,b]=S.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[x,C]=S.useState(c);bs(x,c)||C(c);const[w,E]=S.useState(null),[O,k]=S.useState(null),B=S.useCallback(H=>{H!==z.current&&(z.current=H,E(H))},[]),q=S.useCallback(H=>{H!==Q.current&&(Q.current=H,k(H))},[]),Z=f||w,V=h||O,z=S.useRef(null),Q=S.useRef(null),W=S.useRef(j),ne=y!=null,le=Jr(y),re=Jr(m),$=Jr(v),F=S.useCallback(()=>{if(!z.current||!Q.current)return;const H={placement:o,strategy:r,middleware:x};re.current&&(H.platform=re.current),E2(z.current,Q.current,H).then(P=>{const se={...P,isPositioned:$.current!==!1};ie.current&&!bs(W.current,se)&&(W.current=se,hu.flushSync(()=>{b(se)}))})},[x,o,r,re,$]);ps(()=>{v===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,b(H=>({...H,isPositioned:!1})))},[v]);const ie=S.useRef(!1);ps(()=>(ie.current=!0,()=>{ie.current=!1}),[]),ps(()=>{if(Z&&(z.current=Z),V&&(Q.current=V),Z&&V){if(le.current)return le.current(Z,V,F);F()}},[Z,V,F,le,ne]);const J=S.useMemo(()=>({reference:z,floating:Q,setReference:B,setFloating:q}),[B,q]),A=S.useMemo(()=>({reference:Z,floating:V}),[Z,V]),D=S.useMemo(()=>{const H={position:r,left:0,top:0};if(!A.floating)return H;const P=bp(A.floating,j.x),se=bp(A.floating,j.y);return p?{...H,transform:"translate("+P+"px, "+se+"px)",...Mg(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:se}},[r,p,A.floating,j.x,j.y]);return S.useMemo(()=>({...j,update:F,refs:J,elements:A,floatingStyles:D}),[j,F,J,A,D])}const O2=a=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:a,fn(r){const{element:c,padding:m}=typeof a=="function"?a(r):a;return c&&o(c)?c.current!=null?xp({element:c.current,padding:m}).fn(r):{}:c?xp({element:c,padding:m}).fn(r):{}}}},k2=(a,o)=>{const r=j2(a);return{name:r.name,fn:r.fn,options:[a,o]}},R2=(a,o)=>{const r=w2(a);return{name:r.name,fn:r.fn,options:[a,o]}},D2=(a,o)=>({fn:T2(a).fn,options:[a,o]}),U2=(a,o)=>{const r=N2(a);return{name:r.name,fn:r.fn,options:[a,o]}},L2=(a,o)=>{const r=C2(a);return{name:r.name,fn:r.fn,options:[a,o]}},H2=(a,o)=>{const r=A2(a);return{name:r.name,fn:r.fn,options:[a,o]}},B2=(a,o)=>{const r=O2(a);return{name:r.name,fn:r.fn,options:[a,o]}};var q2=Object.defineProperty,G2=(a,o)=>q2(a,"name",{value:o,configurable:!0}),V2=S.forwardRef(G2(function(o,r){const{children:c,width:m=10,height:f=5,...h}=o;return u.jsx(Vt.svg,{...h,ref:r,width:m,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?c:u.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),Y2=V2,X2=Object.defineProperty,En=(a,o)=>X2(a,"name",{value:o,configurable:!0}),Og="Popper",[kg,Rg]=Ss(Og),[Q2,Dg]=kg(Og),Z2=En(a=>{const{__scopePopper:o,children:r}=a,[c,m]=S.useState(null),[f,h]=S.useState(void 0);return u.jsx(Q2,{scope:o,anchor:c,onAnchorChange:m,placementState:f,setPlacementState:h,children:r})},"Popper"),K2="PopperAnchor",$2=S.forwardRef(En(function(o,r){const{__scopePopper:c,virtualRef:m,...f}=o,h=Dg(K2,c),p=S.useRef(null),y=h.onAnchorChange,v=S.useCallback(E=>{p.current=E,E&&y(E)},[y]),j=On(r,v),b=S.useRef(null);S.useEffect(()=>{if(!m)return;const E=b.current;b.current=m.current,E!==b.current&&y(b.current)});const x=h.placementState&&Ts(h.placementState),C=x==null?void 0:x[0],w=x==null?void 0:x[1];return m?null:u.jsx(Vt.div,{"data-radix-popper-side":C,"data-radix-popper-align":w,...f,ref:j})},"PopperAnchor")),Ug="PopperContent",[J2,W2]=kg(Ug),F2=S.forwardRef(En(function(o,r){var Yt,K,I,ee,ue,Be,Dn;const{__scopePopper:c,side:m="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:y=0,avoidCollisions:v=!0,collisionBoundary:j=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:C=!1,updatePositionStrategy:w="optimized",onPlaced:E,...O}=o,k=Dg(Ug,c),[B,q]=S.useState(null),Z=On(r,q),[V,z]=S.useState(null),Q=Cu(V),W=(Q==null?void 0:Q.width)??0,ne=(Q==null?void 0:Q.height)??0,le=m+(h!=="center"?"-"+h:""),re=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},$=Array.isArray(j)?j:[j],F=$.length>0,ie={padding:re,boundary:$.filter(Lg),altBoundary:F},{refs:J,floatingStyles:A,placement:D,isPositioned:H,middlewareData:P}=M2({strategy:"fixed",placement:le,whileElementsMounted:En((...hl)=>S2(...hl,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[k2({mainAxis:f+ne,alignmentAxis:p}),v&&R2({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?D2():void 0,...ie}),v&&U2({...ie}),L2({...ie,apply:En(({elements:hl,rects:Xi,availableWidth:Qi,availableHeight:ka})=>{const{width:Ra,height:Da}=Xi.reference,Bl=hl.floating.style;Bl.setProperty("--radix-popper-available-width",`${Qi}px`),Bl.setProperty("--radix-popper-available-height",`${ka}px`),Bl.setProperty("--radix-popper-anchor-width",`${Ra}px`),Bl.setProperty("--radix-popper-anchor-height",`${Da}px`)},"apply")}),V&&B2({element:V,padding:y}),tS({arrowWidth:W,arrowHeight:ne}),C&&H2({strategy:"referenceHidden",...ie,boundary:F?ie.boundary:void 0})]}),se=k.setPlacementState;$t(()=>(se(D),()=>{se(void 0)}),[D,se]);const[je,ze]=Ts(D),pe=qi(E);$t(()=>{H&&(pe==null||pe())},[H,pe]);const He=(Yt=P.arrow)==null?void 0:Yt.x,st=(K=P.arrow)==null?void 0:K.y,zt=((I=P.arrow)==null?void 0:I.centerOffset)!==0,[Rn,Wt]=S.useState();return $t(()=>{B&&Wt(window.getComputedStyle(B).zIndex)},[B]),u.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:H?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Rn,"--radix-popper-transform-origin":[(ee=P.transformOrigin)==null?void 0:ee.x,(ue=P.transformOrigin)==null?void 0:ue.y].join(" "),...((Be=P.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:u.jsx(J2,{scope:c,placedSide:je,placedAlign:ze,onArrowChange:z,arrowX:He,arrowY:st,shouldHideArrow:zt,children:u.jsx(Vt.div,{"data-side":je,"data-align":ze,...O,ref:Z,style:{...O.style,animation:H?(Dn=O.style)==null?void 0:Dn.animation:"none"}})})})},"PopperContent")),P2="PopperArrow",I2={top:"bottom",right:"left",bottom:"top",left:"right"},eS=S.forwardRef(En(function(o,r){const{__scopePopper:c,...m}=o,f=W2(P2,c),h=I2[f.placedSide];return u.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:u.jsx(Y2,{...m,ref:r,style:{...m.style,display:"block"}})})},"PopperArrow"));function Lg(a){return a!==null}En(Lg,"isNotNull");var tS=En(a=>({name:"transformOrigin",options:a,fn(o){var O,k,B;const{placement:r,rects:c,middlewareData:m}=o,h=((O=m.arrow)==null?void 0:O.centerOffset)!==0,p=h?0:a.arrowWidth,y=h?0:a.arrowHeight,[v,j]=Ts(r),b={start:"0%",center:"50%",end:"100%"}[j],x=(((k=m.arrow)==null?void 0:k.x)??0)+p/2,C=(((B=m.arrow)==null?void 0:B.y)??0)+y/2;let w="",E="";return v==="bottom"?(w=h?b:`${x}px`,E=`${-y}px`):v==="top"?(w=h?b:`${x}px`,E=`${c.floating.height+y}px`):v==="right"?(w=`${-y}px`,E=h?b:`${C}px`):v==="left"&&(w=`${c.floating.width+y}px`,E=h?b:`${C}px`),{data:{x:w,y:E}}}}),"transformOrigin");function Ts(a){const[o,r="center"]=a.split("-");return[o,r]}En(Ts,"getSideAndAlignFromPlacement");var nS=Z2,lS=$2,aS=F2,iS=eS,oS=Object.defineProperty,sS=(a,o)=>oS(a,"name",{value:o,configurable:!0}),cS=S.forwardRef(sS(function(o,r){var y;const{container:c,...m}=o,[f,h]=S.useState(!1);$t(()=>h(!0),[]);const p=c||f&&((y=globalThis==null?void 0:globalThis.document)==null?void 0:y.body);return p?hu.createPortal(u.jsx(Vt.div,{...m,ref:r}),p):null},"Portal")),rS=Object.defineProperty,uS=(a,o)=>rS(a,"name",{value:o,configurable:!0}),fS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dS=S.forwardRef(uS(function(o,r){return u.jsx(Vt.span,{...o,ref:r,style:{...fS,...o.style}})},"VisuallyHidden")),mS=dS,hS=Object.defineProperty,Je=(a,o)=>hS(a,"name",{value:o,configurable:!0}),[Lu,V3]=Ss("Tooltip",[Rg]),Es=Rg(),pS="TooltipProvider",gS=700,du="tooltip.open",[yS,Hu]=Lu(pS),vS=Je(a=>{const{__scopeTooltip:o,delayDuration:r=gS,skipDelayDuration:c=300,disableHoverableContent:m=!1,children:f}=a,h=S.useRef(!0),p=S.useRef(!1),y=S.useRef(0);return S.useEffect(()=>{const v=y.current;return()=>window.clearTimeout(v)},[]),u.jsx(yS,{scope:o,isOpenDelayedRef:h,delayDuration:r,onOpen:S.useCallback(()=>{c<=0||(window.clearTimeout(y.current),h.current=!1)},[c]),onClose:S.useCallback(()=>{c<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>h.current=!0,c))},[c]),isPointerInTransitRef:p,onPointerInTransitChange:S.useCallback(v=>{p.current=v},[]),disableHoverableContent:m,children:f})},"TooltipProvider"),mu="Tooltip",[xS,Gi]=Lu(mu),bS=Je(a=>{const{__scopeTooltip:o,children:r,open:c,defaultOpen:m,onOpenChange:f,disableHoverableContent:h,delayDuration:p}=a,y=Hu(mu,a.__scopeTooltip),v=Es(o),[j,b]=S.useState(null),[x,C]=S.useState(void 0),w=bg(),E=S.useRef(0),O=h??y.disableHoverableContent,k=p??y.delayDuration,B=S.useRef(!1),[q,Z]=Nu({prop:c,defaultProp:m??!1,onChange:Je(le=>{le?(y.onOpen(),document.dispatchEvent(new CustomEvent(du))):y.onClose(),f==null||f(le)},"onChange"),caller:mu}),V=S.useMemo(()=>q?B.current?"delayed-open":"instant-open":"closed",[q]),z=S.useCallback(()=>{window.clearTimeout(E.current),E.current=0,B.current=!1,Z(!0)},[Z]),Q=S.useCallback(()=>{window.clearTimeout(E.current),E.current=0,Z(!1)},[Z]),W=S.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{B.current=!0,Z(!0),E.current=0},k)},[k,Z]);S.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]);const ne=x??w;return u.jsx(nS,{...v,children:u.jsx(xS,{scope:o,contentId:ne,setContentId:C,open:q,stateAttribute:V,trigger:j,onTriggerChange:b,onTriggerEnter:S.useCallback(()=>{y.isOpenDelayedRef.current?W():z()},[y.isOpenDelayedRef,W,z]),onTriggerLeave:S.useCallback(()=>{O?Q():(window.clearTimeout(E.current),E.current=0)},[Q,O]),onOpen:z,onClose:Q,disableHoverableContent:O,children:r})})},"Tooltip"),Sp="TooltipTrigger",SS=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,...m}=o,f=Gi(Sp,c),h=Hu(Sp,c),p=Es(c),y=S.useRef(null),v=On(r,y,f.onTriggerChange),j=S.useRef(!1),b=S.useRef(!1),x=S.useCallback(()=>j.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),u.jsx(lS,{asChild:!0,...p,children:u.jsx(Vt.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...m,ref:v,onPointerMove:Et(o.onPointerMove,C=>{C.pointerType!=="touch"&&!b.current&&!h.isPointerInTransitRef.current&&(f.onTriggerEnter(),b.current=!0)}),onPointerLeave:Et(o.onPointerLeave,()=>{f.onTriggerLeave(),b.current=!1}),onPointerDown:Et(o.onPointerDown,()=>{f.open&&f.onClose(),j.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Et(o.onFocus,()=>{j.current||f.onOpen()}),onBlur:Et(o.onBlur,f.onClose),onClick:Et(o.onClick,f.onClose)})})},"TooltipTrigger")),Hg="TooltipPortal",[jS,wS]=Lu(Hg,{forceMount:void 0}),NS=Je(a=>{const{__scopeTooltip:o,forceMount:r,children:c,container:m}=a,f=Gi(Hg,o);return u.jsx(jS,{scope:o,forceMount:r,children:u.jsx(Au,{present:r||f.open,children:u.jsx(cS,{asChild:!0,container:m,children:c})})})},"TooltipPortal"),Li="TooltipContent",CS=S.forwardRef(Je(function(o,r){const c=wS(Li,o.__scopeTooltip),{forceMount:m=c.forceMount,side:f="top",...h}=o,p=Gi(Li,o.__scopeTooltip);return u.jsx(Au,{present:m||p.open,children:p.disableHoverableContent?u.jsx(Bg,{side:f,...h,ref:r}):u.jsx(AS,{side:f,...h,ref:r})})},"TooltipContent")),AS=S.forwardRef(Je(function(o,r){const c=Gi(Li,o.__scopeTooltip),m=Hu(Li,o.__scopeTooltip),f=S.useRef(null),h=On(r,f),[p,y]=S.useState(null),{trigger:v,onClose:j}=c,b=f.current,{onPointerInTransitChange:x}=m,C=S.useCallback(()=>{y(null),x(!1)},[x]),w=S.useCallback((E,O)=>{const k=E.currentTarget,B={x:E.clientX,y:E.clientY},q=qg(B,k.getBoundingClientRect()),Z=Gg(B,q),V=Vg(O.getBoundingClientRect()),z=Xg([...Z,...V]);y(z),x(!0)},[x]);return S.useEffect(()=>()=>C(),[C]),S.useEffect(()=>{if(v&&b){const E=Je(k=>w(k,b),"handleTriggerLeave"),O=Je(k=>w(k,v),"handleContentLeave");return v.addEventListener("pointerleave",E),b.addEventListener("pointerleave",O),()=>{v.removeEventListener("pointerleave",E),b.removeEventListener("pointerleave",O)}}},[v,b,w,C]),S.useEffect(()=>{if(p){const E=Je(O=>{const k=O.target,B={x:O.clientX,y:O.clientY},q=(v==null?void 0:v.contains(k))||(b==null?void 0:b.contains(k)),Z=!Yg(B,p);q?C():Z&&(C(),j())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[v,b,p,j,C]),u.jsx(Bg,{...o,ref:h})},"TooltipContentHoverable")),TS=Zp("TooltipContent"),Bg=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,children:m,"aria-label":f,id:h,onEscapeKeyDown:p,onPointerDownOutside:y,...v}=o,j=Gi(Li,c),b=Es(c),{onClose:x}=j;S.useEffect(()=>(document.addEventListener(du,x),()=>document.removeEventListener(du,x)),[x]),S.useEffect(()=>{if(j.trigger){const w=Je(E=>{E.target instanceof Node&&E.target.contains(j.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[j.trigger,x]);const{setContentId:C}=j;return $t(()=>(C(h),()=>{C(void 0)}),[h,C]),u.jsx(Eb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:w=>w.preventDefault(),onDismiss:x,children:u.jsxs(aS,{"data-state":j.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:j.contentId,...b,...v,ref:r,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(TS,{children:m}),f?u.jsx(mS,{id:j.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),ES=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,...m}=o,f=Es(c);return u.jsx(iS,{...f,...m,ref:r})},"TooltipArrow"));function qg(a,o){const r=Math.abs(o.top-a.y),c=Math.abs(o.bottom-a.y),m=Math.abs(o.right-a.x),f=Math.abs(o.left-a.x);switch(Math.min(r,c,m,f)){case f:return"left";case m:return"right";case r:return"top";case c:return"bottom";default:throw new Error("unreachable")}}Je(qg,"getExitSideFromRect");function Gg(a,o,r=5){const c=[];switch(o){case"top":c.push({x:a.x-r,y:a.y+r},{x:a.x+r,y:a.y+r});break;case"bottom":c.push({x:a.x-r,y:a.y-r},{x:a.x+r,y:a.y-r});break;case"left":c.push({x:a.x+r,y:a.y-r},{x:a.x+r,y:a.y+r});break;case"right":c.push({x:a.x-r,y:a.y-r},{x:a.x-r,y:a.y+r});break}return c}Je(Gg,"getPaddedExitPoints");function Vg(a){const{top:o,right:r,bottom:c,left:m}=a;return[{x:m,y:o},{x:r,y:o},{x:r,y:c},{x:m,y:c}]}Je(Vg,"getPointsFromRect");function Yg(a,o){const{x:r,y:c}=a;let m=!1;for(let f=0,h=o.length-1;fc!=x>c&&r<(b-v)*(c-j)/(x-j)+v&&(m=!m)}return m}Je(Yg,"isPointInPolygon");function Xg(a){const o=a.slice();return o.sort((r,c)=>r.xc.x?1:r.yc.y?1:0),Qg(o)}Je(Xg,"getHull");function Qg(a){if(a.length<=1)return a.slice();const o=[];for(let c=0;c=2;){const f=o[o.length-1],h=o[o.length-2];if((f.x-h.x)*(m.y-h.y)>=(f.y-h.y)*(m.x-h.x))o.pop();else break}o.push(m)}o.pop();const r=[];for(let c=a.length-1;c>=0;c--){const m=a[c];for(;r.length>=2;){const f=r[r.length-1],h=r[r.length-2];if((f.x-h.x)*(m.y-h.y)>=(f.y-h.y)*(m.x-h.x))r.pop();else break}r.push(m)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}Je(Qg,"getHullPresorted");var zS=vS,_S=bS,MS=SS,OS=NS,kS=CS,RS=ES;function DS({delayDuration:a=0,...o}){return u.jsx(zS,{"data-slot":"tooltip-provider",delayDuration:a,...o})}function Zg({...a}){return u.jsx(DS,{children:u.jsx(_S,{"data-slot":"tooltip",...a})})}function Kg({...a}){return u.jsx(MS,{"data-slot":"tooltip-trigger",...a})}function $g({className:a,sideOffset:o=6,children:r,...c}){return u.jsx(OS,{children:u.jsxs(kS,{"data-slot":"tooltip-content",sideOffset:o,className:ge("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",a),...c,children:[r,u.jsx(RS,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function jp({config:a,activeView:o,onSelectView:r,onNavigate:c,className:m}){return u.jsxs("aside",{className:ge("flex w-64 shrink-0 flex-col overflow-y-auto border-r bg-sidebar text-sidebar-foreground",m),children:[u.jsxs("div",{className:"flex items-center gap-3 px-5 py-5",children:[u.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-primary to-primary/60 text-primary-foreground shadow-sm ring-1 ring-border/40",children:u.jsx(Iv,{className:"size-5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h1",{className:"truncate text-sm leading-tight font-semibold tracking-tight",children:"Free Claude Code"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Server Control"})]})]}),u.jsx("div",{className:"px-5 pt-1 pb-2 text-[10px] font-semibold tracking-wider text-muted-foreground uppercase",children:"Configuration"}),u.jsx("nav",{className:"flex flex-col gap-1 px-3","aria-label":"Admin views",children:ul.map(f=>{const h=f.id===o,p=f.icon;return u.jsxs(Zg,{children:[u.jsx(Kg,{asChild:!0,children:u.jsxs("button",{type:"button",className:ge("flex items-center gap-3 rounded-md px-3 py-2 text-left text-sm font-medium transition-colors",h?"bg-accent text-accent-foreground shadow-sm ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),"aria-current":h?"page":void 0,onClick:()=>{r(f.id),c==null||c()},children:[u.jsx(p,{className:ge("size-4 shrink-0",h?"text-primary":"text-muted-foreground")}),f.label]})}),u.jsx($g,{side:"right",children:f.description})]},f.id)})}),u.jsxs("div",{className:"mt-auto space-y-2 px-5 py-4",children:[u.jsx(jb,{}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx(ox,{className:"size-3.5 shrink-0"}),"Managed config"]}),u.jsx("p",{className:"break-all rounded-md bg-muted/40 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground/80",children:a.paths.managed})]})]})}const Wr=60,Jg=[{key:"15m",label:"15m",seconds:900},{key:"1h",label:"1h",seconds:3600},{key:"6h",label:"6h",seconds:360*60},{key:"24h",label:"24h",seconds:1440*60},{key:"all",label:"All",seconds:null}],US=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],LS=["#3987e5","#d95926","#199e70","#c98500","#d55181","#008300","#9085e9","#e66767"];function Bu(a){return a?LS:US}const HS={input:"#2a78d6",output:"#eb6834",cacheRead:"#1baf7a",cacheWrite:"#eda100",reasoning:"#e87ba4"},BS={input:"#3987e5",output:"#d95926",cacheRead:"#199e70",cacheWrite:"#c98500",reasoning:"#d55181"};function Ul(a,o){return(o?BS:HS)[a]}const Dl={success:"#0ca30c",error:"#d03b3b",cancelled:"#fab219"},qS=["#86b6ef","#6da7ec","#3987e5","#1c5cab"],GS=["#5598e7","#2a78d6","#256abf","#184f95"],VS="#f0efec",YS="#383835",XS="#2a78d6",QS="#5598e7",ZS="#1c5cab",ds=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],KS=Array.from({length:24},(a,o)=>String(o).padStart(2,"0"));function $S(a,o,r){const c=Jg.find(m=>m.key===o);return!c||c.seconds===null?a:a.filter(m=>m.timestamp>=r-c.seconds)}function JS(a){return a<=300?10:a<=1800?30:a<=7200?60:a<=720*60?300:a<=2880*60?900:3600}function WS(a,o){const r=new Date(a*1e3);return o<60?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):o<3600?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function FS(a,o){if(a.length===0)return[];let r=Number.POSITIVE_INFINITY,c=0;for(const j of a)j.timestampc&&(c=j.timestamp);const m=Math.max(o-r,c-r,1);let f=JS(m);for(;m/f>180;)f*=2;const h=Math.floor(r/f)*f,p=Math.max(Math.floor(o/f)*f,h),y=[],v=new Map;for(let j=h;j<=p;j+=f){const b={start:j,label:WS(j,f),count:0,success:0,error:0,cancelled:0,tokens:0,successTokens:0,errorTokens:0,cancelledTokens:0,cacheReadTokens:0,cacheWriteTokens:0,reasoningTokens:0,latencySum:0,latencyCount:0,bucketSeconds:f};y.push(b),v.set(j,b)}for(const j of a){const b=v.get(Math.floor(j.timestamp/f)*f);if(!b)continue;const x=j.input_tokens+j.output_tokens;b.count+=1,b.tokens+=x,b.cacheReadTokens+=j.cache_read_tokens,b.cacheWriteTokens+=j.cache_creation_tokens,b.reasoningTokens+=j.reasoning_tokens,b.latencySum+=j.duration_ms,b.latencyCount+=1,j.status==="success"?(b.success+=1,b.successTokens+=x):j.status==="error"?(b.error+=1,b.errorTokens+=x):(b.cancelled+=1,b.cancelledTokens+=x)}return y}function PS(a,o){let r=0,c=0,m=0,f=0,h=0,p=0,y=0,v=0,j=0,b=0,x=0;const C=o-Wr;for(const w of a)r+=1,c+=w.input_tokens,m+=w.output_tokens,f+=w.cache_read_tokens,h+=w.cache_creation_tokens,p+=w.reasoning_tokens,j+=w.duration_ms,w.status==="error"?y+=1:w.status==="cancelled"&&(v+=1),w.timestamp>=C&&(b+=w.input_tokens,x+=w.output_tokens);return{requests:r,inputTokens:c,outputTokens:m,cacheReadTokens:f,cacheWriteTokens:h,reasoningTokens:p,errors:y,cancelled:v,tpm:(b+x)/Wr*60,tps:x/Wr,avgLatencyMs:r>0?j/r:0,errorRate:r>0?y/r:0}}function IS(a,o){return[{name:"Input",value:a.inputTokens,color:Ul("input",o)},{name:"Output",value:a.outputTokens,color:Ul("output",o)},{name:"Cache read",value:a.cacheReadTokens,color:Ul("cacheRead",o)},{name:"Cache write",value:a.cacheWriteTokens,color:Ul("cacheWrite",o)},{name:"Reasoning",value:a.reasoningTokens,color:Ul("reasoning",o)}].filter(r=>r.value>0)}function Wg(a,o,r){const c=new Map;for(const m of a){const f=o(m)||"(unknown)",h=c.get(f)??{name:f,tokens:0,requests:0,errors:0};h.tokens+=m.input_tokens+m.output_tokens,h.requests+=1,m.status==="error"&&(h.errors+=1),c.set(f,h)}return[...c.values()].sort((m,f)=>f.tokens-m.tokens).slice(0,r)}function e3(a,o=6){return Wg(a,r=>r.gateway_model||r.provider_model||"(no model)",o)}function t3(a,o=6){return Wg(a,r=>r.provider,o)}const wp=5,Np=4;function n3(a){const o=new Map,r=new Map,c=new Map;for(const x of a){const C=x.wire_api||"unknown",w=x.gateway_model||x.provider_model||"(no model)",E=x.provider||"(unknown)";o.set(C,(o.get(C)??0)+1),r.set(w,(r.get(w)??0)+1),c.set(E,(c.get(E)??0)+1)}const m=[...r.entries()].sort((x,C)=>C[1]-x[1]).slice(0,wp),f=[...c.entries()].sort((x,C)=>C[1]-x[1]).slice(0,Np),h=x=>m.some(([C])=>C===x)?`gw:${x}`:"gw:Other",p=x=>f.some(([C])=>C===x)?`pv:${x}`:"pv:Other",y=new Map,v=(x,C)=>{const w=`${x}\0${C}`;y.set(w,(y.get(w)??0)+1)};for(const x of a){const C=x.wire_api||"unknown",w=x.gateway_model||x.provider_model||"(no model)",E=x.provider||"(unknown)";v(C,h(w)),v(h(w),p(E))}const j=[];for(const x of o.keys())j.push({name:x,display:x,category:0});for(const[x]of m)j.push({name:`gw:${x}`,display:x,category:1});r.size>wp&&j.push({name:"gw:Other",display:"Other models",category:1});for(const[x]of f)j.push({name:`pv:${x}`,display:x,category:2});c.size>Np&&j.push({name:"pv:Other",display:"Other providers",category:2});const b=[...y.entries()].map(([x,C])=>{const[w,E]=x.split("\0");return{source:w,target:E,value:C}}).sort((x,C)=>C.value-x.value);return{nodes:j,links:b}}function l3(a){const o=new Map;for(const c of a){const m=new Date(c.timestamp*1e3),f=(m.getDay()+6)%7,h=m.getHours(),p=f*24+h,y=o.get(p)??{hour:h,day:f,count:0,tokens:0,latencySum:0,latencyCount:0};y.count+=1,y.tokens+=c.input_tokens+c.output_tokens,y.latencySum+=c.duration_ms,y.latencyCount+=1,o.set(p,y)}const r=[];for(let c=0;c<7;c+=1)for(let m=0;m<24;m+=1)r.push(o.get(c*24+m)??{hour:m,day:c,count:0,tokens:0,latencySum:0,latencyCount:0});return r}function it(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}function qu(a){return a>=1e3?`${(a/1e3).toFixed(1)}s`:`${a}ms`}function a3(a){return a<=0?"0%":`${(a*100).toFixed(1)}%`}function i3(a){return new Date(a*1e3).toLocaleString()}function o3(a){return new Date(a*1e3).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}Rv([Uv,Lv,Hv,Bv,qv,Gv]);function Fg({option:a,className:o,ariaLabel:r}){const c=S.useRef(null),m=S.useRef(null);return S.useEffect(()=>{const f=c.current;if(!f)return;const h=Dv(f);m.current=h;const p=new ResizeObserver(()=>h.resize());return p.observe(f),()=>{p.disconnect(),h.dispose(),m.current=null}},[]),S.useEffect(()=>{var f;(f=m.current)==null||f.setOption(a,{notMerge:!0})},[a]),u.jsx("div",{ref:c,role:"img","aria-label":r,className:o})}function Vi({title:a,subtitle:o,actions:r,children:c,className:m,contentClassName:f}){return u.jsxs(Kt,{className:ge("gap-0 overflow-hidden",m),children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border/80 px-5 py-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h4",{className:"text-sm font-semibold tracking-tight",children:a}),o?u.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:o}):null]}),r]}),u.jsx(Nn,{className:ge("px-4 py-4",f),children:c})]})}function Pg({active:a,label:o,payload:r,formatter:c}){return!a||!r||r.length===0?null:u.jsxs("div",{className:"rounded-md border bg-popover px-3 py-2 text-xs shadow-lg",children:[o!==void 0&&o!==""?u.jsx("p",{className:"mb-1 font-medium text-popover-foreground",children:o}):null,u.jsx("div",{className:"space-y-0.5",children:r.map((m,f)=>{var j;const h=String(m.name??""),p=Number(m.value??0),y=m.color??((j=m.payload)==null?void 0:j.color)??"var(--ring)",v=c?c(p,h):String(p);return u.jsxs("p",{className:"flex items-center justify-between gap-4 text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:y}}),h]}),u.jsx("span",{className:"font-mono text-popover-foreground",children:v})]},`${h}-${f}`)})})]})}function Cp(){return document.documentElement.classList.contains("dark")?"dark":"light"}function Yi(){const[a,o]=S.useState(Cp);return S.useEffect(()=>{const r=new MutationObserver(()=>o(Cp()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),a}function Ig(a){const o=a==="dark";return{text:o?"#f5f5f4":"#292524",muted:o?"#a8a29e":"#78716c",grid:o?"#292524":"#e7e5e4",card:o?"#1c1917":"#ffffff"}}const s3=[{key:"requests",label:"Requests"},{key:"tokens",label:"Tokens"}];function Rl(a,o){return o==="tokens"?a.tokens:a.count}function Na(a,o){return o==="tokens"?it(a):String(a)}function Fr(a){return String(a).padStart(2,"0")}function c3(a){const o=Number(a);return Number.isNaN(o)||o%6!==0?"":o===0?"12a":o===12?"12p":o<12?`${o}a`:`${o-12}p`}function Ca({label:a,children:o}){return u.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border bg-muted/40 px-2 py-1 font-mono text-[11px] text-muted-foreground",children:[u.jsx("span",{className:"font-sans font-medium text-foreground",children:a}),o]})}function r3({records:a}){const o=Yi(),r=o==="dark",[c,m]=S.useState("requests"),f=S.useMemo(()=>l3(a),[a]),h=Ig(o),p=r?GS:qS,y=r?YS:VS,v=S.useMemo(()=>{const x=Array.from({length:7},()=>0),C=Array.from({length:24},()=>0),w=Array.from({length:7},()=>0),E=Array.from({length:24},()=>0);for(const z of f)x[z.day]+=z.count,C[z.hour]+=z.count,w[z.day]+=z.tokens,E[z.hour]+=z.tokens;const O=z=>z.reduce((Q,W,ne)=>W>z[Q]?ne:Q,0),k=f.reduce((z,Q)=>z===null||Rl(Q,c)>Rl(z,c)?Q:z,null),B=f.map(z=>Rl(z,c)).sort((z,Q)=>z-Q),q=B.reduce((z,Q)=>z+Q,0),Z=B[Math.floor((B.length-1)/2)]??0,V=B[Math.ceil((B.length-1)/2)]??0;return{peak:k,busiestDay:O(x),busiestHour:O(C),dayValues:c==="tokens"?w:x,hourValues:c==="tokens"?E:C,activeHours:B.filter(z=>z>0).length,avgPerHour:B.length>0?q/B.length:0,medianPerHour:(Z+V)/2}},[f,c]),j=S.useMemo(()=>{const x=Math.max(1,...f.map(W=>Rl(W,c))),C=Math.max(1,Math.ceil(x/4)),w=Math.max(1,Math.ceil(x/2)),E=Math.max(1,Math.ceil(x*3/4)),O=W=>W<=0?y:W<=C?p[0]:W<=w?p[1]:W<=E?p[2]:p[3],k=r?QS:XS,B=r?["rgba(255, 255, 255, 0.02)","rgba(255, 255, 255, 0.05)"]:["rgba(0, 0, 0, 0.02)","rgba(0, 0, 0, 0.045)"],q=new Map(f.map(W=>[`${W.day}-${W.hour}`,W])),Z=v.peak,V=f.reduce((W,ne)=>W+Rl(ne,c),0),z=f.map(W=>{const ne=Rl(W,c),le=ne>0&&ne===x&&W===Z;return{value:[W.hour,W.day,ne],...le?{itemStyle:{borderColor:k,borderWidth:2.5}}:{},label:ne>0?{color:r||ne>w?"#ffffff":ZS}:{show:!1}}}),Q=(W,ne)=>`
${W}${ne}
`;return{tooltip:{position:"top",confine:!0,extraCssText:"border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.18);padding:8px 10px",backgroundColor:h.card,borderColor:h.grid,textStyle:{color:h.text,fontSize:12},formatter:W=>{var se;const ne=(se=W.data)==null?void 0:se.value;if(!ne)return"";const[le,re,$]=ne,F=q.get(`${re}-${le}`),ie=ds[re]??"",J=``,A=`
${J}${ie} · ${Fr(le)}:00
`;if(!F||F.count===0)return`${A}
No requests
`;const D=x>0?Math.round($/x*100):0,H=V>0?Math.round($/V*100):0,P=F.latencyCount>0?F.latencySum/F.latencyCount:0;return A+Q("Requests",String(F.count))+Q("Tokens",it(F.tokens))+Q("Share of peak",`${D}%`)+Q("Share of week",`${H}%`)+Q("Avg latency",qu(P))}},grid:{left:50,right:16,top:10,bottom:8},xAxis:{type:"category",data:KS,splitArea:{show:!0,interval:0,color:B},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:h.muted,fontSize:10,interval:0,formatter:c3}},yAxis:{type:"category",data:[...ds],splitArea:{show:!0,color:B},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:h.muted,fontSize:10,formatter:W=>W==="Sat"||W==="Sun"?`{wk|${W}}`:W,rich:{wk:{color:h.text,fontWeight:600}}}},visualMap:{show:!1,seriesIndex:0,min:0,max:x,pieces:[{lte:0,color:y},{gt:0,lte:C,color:p[0]},{gt:C,lte:w,color:p[1]},{gt:w,lte:E,color:p[2]},{gt:E,color:p[3]}]},series:[{type:"heatmap",data:z,label:{show:!0,fontSize:9,fontWeight:600,color:"#ffffff",formatter:W=>{const ne=W.value,le=(ne==null?void 0:ne[2])??0;return le>0?Na(le,c):""}},itemStyle:{borderColor:h.card,borderWidth:2,borderRadius:3},markArea:{silent:!0,itemStyle:{color:r?"rgba(255,255,255,0.045)":"rgba(0,0,0,0.035)"},data:[[{yAxis:"Sat"},{yAxis:"Sun"}]]},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.35)",borderColor:h.text,borderWidth:1.5}}}]}},[f,o,c,h,v,p]),b=f.reduce((x,C)=>x+C.count,0);return u.jsxs(Vi,{title:"Usage heatmap",subtitle:c==="requests"?"Request count by hour and weekday":"Token volume by hour and weekday",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Heatmap metric",children:s3.map(x=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",c===x.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>m(x.key),children:x.label},x.key))}),contentClassName:"pt-2",children:[u.jsx(Fg,{option:j,className:"h-60 w-full",ariaLabel:`Usage heatmap of ${c} by hour of day and day of week`}),u.jsxs("div",{className:"mt-1.5 flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"mr-0.5",children:"Less"}),[y,...p].map((x,C)=>u.jsx("span",{className:"size-2.5 rounded-[3px]",style:{backgroundColor:x}},`${x}-${C}`)),u.jsx("span",{className:"ml-0.5",children:"More"})]}),v.peak!==null&&b>0?u.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[u.jsxs(Ca,{label:"Peak",children:[Na(Rl(v.peak,c),c)," ·"," ",ds[v.peak.day]," ",Fr(v.peak.hour),":00"]}),u.jsxs(Ca,{label:"Busiest day",children:[ds[v.busiestDay]," ·"," ",Na(v.dayValues[v.busiestDay],c)]}),u.jsxs(Ca,{label:"Busiest hour",children:[Fr(v.busiestHour),":00 ·"," ",Na(v.hourValues[v.busiestHour],c)]}),u.jsxs(Ca,{label:"Active hours",children:[v.activeHours,"/168"]}),u.jsx(Ca,{label:"Avg / hour",children:Na(v.avgPerHour,c)}),u.jsx(Ca,{label:"Median / hour",children:Na(v.medianPerHour,c)})]}):null]})}function u3({label:a,value:o,hint:r,icon:c,color:m,series:f}){const p=`kpi-${S.useId().replace(/[^a-zA-Z0-9]/g,"")}`,y=f.map((v,j)=>({index:j,point:v}));return u.jsx(Kt,{className:"gap-0 overflow-hidden",children:u.jsxs(Nn,{className:"px-4 py-3.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md",style:{backgroundColor:`${m}1f`,color:m},children:c}),u.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),u.jsx("p",{className:"mt-1.5 truncate font-mono text-2xl font-semibold tracking-tight leading-tight",children:o}),r?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:r}):null,u.jsx("div",{className:"mt-2 h-9",children:f.length>=2?u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ep,{data:y,margin:{top:2,right:0,bottom:0,left:0},children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[u.jsx("stop",{offset:"0%",stopColor:m,stopOpacity:.1}),u.jsx("stop",{offset:"100%",stopColor:m,stopOpacity:0})]})}),u.jsx(ms,{type:"monotone",dataKey:"point",stroke:m,strokeWidth:2,strokeLinecap:"round",fill:`url(#${p})`,isAnimationActive:!1,dot:!1})]})}):u.jsx("div",{className:"flex h-full items-center justify-center rounded-md bg-muted/40 text-[10px] text-muted-foreground",children:"no trend yet"})})]})})}function f3({kpis:a,buckets:o}){const r=Yi()==="dark",c=Bu(r),m=[{label:"Total requests",value:a.requests.toLocaleString(),hint:`${o.length} time buckets in window`,icon:u.jsx(eu,{className:"size-3.5"}),color:c[0],series:o.map(f=>f.count)},{label:"Total tokens",value:it(a.inputTokens+a.outputTokens),hint:`${it(a.inputTokens)} in · ${it(a.outputTokens)} out`,icon:u.jsx(ex,{className:"size-3.5"}),color:c[1],series:o.map(f=>f.tokens)},{label:"Cache tokens",value:it(a.cacheReadTokens+a.cacheWriteTokens),hint:`${it(a.cacheReadTokens)} read · ${it(a.cacheWriteTokens)} written`,icon:u.jsx(ix,{className:"size-3.5"}),color:Ul("cacheRead",r),series:o.map(f=>f.cacheReadTokens+f.cacheWriteTokens)},{label:"Reasoning tokens",value:it(a.reasoningTokens),hint:"thinking / extended output",icon:u.jsx(Pv,{className:"size-3.5"}),color:Ul("reasoning",r),series:o.map(f=>f.reasoningTokens)},{label:"Tokens / minute",value:it(Math.round(a.tpm)),hint:"in+out · last 60s",icon:u.jsx(xu,{className:"size-3.5"}),color:c[3],series:o.map(f=>f.tokens/f.bucketSeconds*60)},{label:"Avg latency",value:qu(a.avgLatencyMs),hint:"per request",icon:u.jsx(bx,{className:"size-3.5"}),color:c[6],series:o.map(f=>f.latencyCount>0?f.latencySum/f.latencyCount:0)},{label:"Error rate",value:a3(a.errorRate),hint:`${a.errors} errors · ${a.cancelled} cancelled`,icon:u.jsx(vu,{className:"size-3.5"}),color:Dl.error,series:o.map(f=>f.count>0?f.error/f.count:0)},{label:"Tokens / second",value:a.tps.toFixed(1),hint:"output only · last 60s",icon:u.jsx(Sx,{className:"size-3.5"}),color:c[2],series:o.map(f=>f.tokens/f.bucketSeconds)}];return u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:m.map(f=>u.jsx(u3,{...f},f.label))})}function d3({records:a}){const o=Yi(),r=o==="dark",c=Ig(o),m=r?"#d95926":"#eb6834",f=Bu(r),{nodes:h,links:p}=S.useMemo(()=>n3(a),[a]),y=S.useMemo(()=>{const j=new Map(h.map(C=>[C.name,C.display])),b={0:0,1:0,2:0},x=C=>{if(C.category===0)return m;const w=b[C.category]++;return f[(w+(C.category-1)*3)%f.length]};return{tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:c.card,borderColor:c.grid,textStyle:{color:c.text,fontSize:12}},series:[{type:"sankey",left:8,right:110,top:12,bottom:8,nodeWidth:12,nodeGap:14,layoutIterations:32,data:h.map(C=>({name:C.name,itemStyle:{color:x(C)}})),links:p,emphasis:{focus:"adjacency"},lineStyle:{color:"gradient",curveness:.5,opacity:.35},label:{show:!0,color:c.text,fontSize:11,formatter:C=>j.get(String(C.name))??String(C.name)}}]}},[h,p,c,m,f]),v=[{label:"Client protocol",color:m},{label:"Gateway model",color:f[0]},{label:"Provider",color:f[3]}];return u.jsx(Vi,{title:"Routing flow",subtitle:"Client → gateway model → provider",className:"h-full",contentClassName:"flex flex-col",children:h.length>0?u.jsxs(u.Fragment,{children:[u.jsx(Fg,{option:y,className:"h-72 w-full",ariaLabel:"Request routing flow from client protocol through gateway models to providers"}),u.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1",children:v.map(j=>u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:j.color}}),j.label]},j.label))})]}):u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No requests in this window yet."})})}function m3({kpis:a}){const o=Yi()==="dark",r=IS(a,o),c=r.reduce((f,h)=>f+h.value,0),m=a.inputTokens+a.outputTokens;return u.jsxs(Vi,{title:"Token mix",subtitle:"Input, output, cache, and reasoning tokens",contentClassName:"flex flex-col",children:[u.jsxs("div",{className:"relative mx-auto w-full max-w-56",children:[u.jsx("div",{className:"h-44 w-full",children:u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ev,{children:[u.jsx(zp,{content:u.jsx(Pg,{formatter:(f,h)=>`${it(f)} · ${h}`})}),u.jsx(zv,{data:r,dataKey:"value",nameKey:"name",innerRadius:"66%",outerRadius:"92%",paddingAngle:2,cornerRadius:4,stroke:"var(--card)",strokeWidth:2,children:r.map(f=>u.jsx(_v,{fill:f.color},f.name))})]})})}),u.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[u.jsx("p",{className:"font-mono text-xl font-semibold tracking-tight leading-tight",children:it(m)}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:"tokens"})]})]}),u.jsx("div",{className:"mt-3 space-y-1.5",children:r.length>0?r.map(f=>u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:f.color}}),u.jsx("span",{className:"truncate",children:f.name})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2 font-mono",children:[u.jsx("span",{className:"text-muted-foreground",children:c>0?`${Math.round(f.value/c*100)}%`:"0%"}),u.jsx("span",{className:"w-12 text-right",children:it(f.value)})]})]},f.name)):u.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:"No token usage in this window yet."})})]})}const h3=[{key:"model",label:"Model"},{key:"provider",label:"Provider"}];function p3({item:a,index:o,maxTokens:r}){const c=Yi()==="dark",m=Bu(c)[o%8],f=r>0?a.tokens/r*100:0;return u.jsxs("li",{children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:"w-4 shrink-0 text-right font-mono text-muted-foreground",children:o+1}),u.jsx("span",{className:"truncate font-mono",children:a.name}),a.errors>0?u.jsxs(at,{variant:"error",className:"px-1.5 py-0 text-[10px] font-medium",children:[a.errors," err"]}):null]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2 font-mono",children:[u.jsxs("span",{className:"text-muted-foreground",children:[a.requests," req"]}),u.jsx("span",{className:"w-12 text-right",children:it(a.tokens)})]})]}),u.jsx("div",{className:"mt-1 ml-6 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,backgroundColor:m}})})]})}function g3({records:a}){const[o,r]=S.useState("model"),c=o==="model"?e3(a):t3(a),m=c.length>0?c[0].tokens:0;return u.jsx(Vi,{title:"Top endpoints",subtitle:o==="model"?"Gateway models ranked by token usage":"Providers ranked by token usage",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Group by",children:h3.map(f=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",o===f.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(f.key),children:f.label},f.key))}),children:c.length>0?u.jsx("ol",{className:"space-y-3",children:c.map((f,h)=>u.jsx(p3,{item:f,index:h,maxTokens:m},`${o}-${f.name}`))}):u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No requests in this window yet."})})}const y3=[{key:"requests",label:"Requests"},{key:"tokens",label:"Tokens"}];function v3({buckets:a}){const[o,r]=S.useState("requests"),m=S.useId().replace(/[^a-zA-Z0-9]/g,""),f=a.map(y=>({label:y.label,success:o==="requests"?y.success:y.successTokens,error:o==="requests"?y.error:y.errorTokens,cancelled:o==="requests"?y.cancelled:y.cancelledTokens})),h=f.reduce((y,v)=>({success:y.success+v.success,error:y.error+v.error,cancelled:y.cancelled+v.cancelled}),{success:0,error:0,cancelled:0}),p=(y,v)=>o==="tokens"?it(y):String(y);return u.jsxs(Vi,{title:"Request volume",subtitle:"Requests per time bucket, stacked by status",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Chart metric",children:y3.map(y=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",o===y.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(y.key),children:y.label},y.key))}),children:[u.jsx("div",{className:"h-56 w-full",children:u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ep,{data:f,margin:{top:6,right:8,bottom:0,left:0},children:[u.jsx("defs",{children:["success","error","cancelled"].map(y=>u.jsxs("linearGradient",{id:`vol-${m}-${y}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[u.jsx("stop",{offset:"0%",stopColor:Dl[y],stopOpacity:.1}),u.jsx("stop",{offset:"100%",stopColor:Dl[y],stopOpacity:.02})]},y))}),u.jsx(Mv,{stroke:"var(--border)",strokeWidth:1,vertical:!1}),u.jsx(Ov,{dataKey:"label",tickLine:!1,axisLine:!1,minTickGap:32,interval:"preserveStartEnd",tick:{fill:"var(--muted-foreground)",fontSize:11}}),u.jsx(kv,{tickLine:!1,axisLine:!1,width:40,allowDecimals:!1,tick:{fill:"var(--muted-foreground)",fontSize:11}}),u.jsx(zp,{content:u.jsx(Pg,{formatter:p})}),u.jsx(ms,{type:"monotone",dataKey:"success",name:"Success",stackId:"volume",stroke:Dl.success,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-success)`}),u.jsx(ms,{type:"monotone",dataKey:"error",name:"Error",stackId:"volume",stroke:Dl.error,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-error)`}),u.jsx(ms,{type:"monotone",dataKey:"cancelled",name:"Cancelled",stackId:"volume",stroke:Dl.cancelled,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-cancelled)`})]})})}),u.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1",children:[["success","Success"],["error","Error"],["cancelled","Cancelled"]].map(([y,v])=>u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Dl[y]}}),v,u.jsx("span",{className:"font-mono text-foreground",children:o==="tokens"?it(h[y]):h[y]})]},y))})]})}function Tt({className:a,...o}){return u.jsx("div",{"data-slot":"skeleton",className:ge("bg-accent animate-pulse rounded-md",a),...o})}const x3=1e4,b3=[10,25,50];function S3(a,o){if(o<=7)return Array.from({length:o},(f,h)=>h+1);const r=[1];a>3&&r.push("…");const c=Math.max(2,a-1),m=Math.min(o-1,a+1);for(let f=c;f<=m;f+=1)r.push(f);return au.jsx("button",{type:"button",className:ge("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",a===r.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>o(r.key),children:r.label},r.key))})}function C3(){const[a,o]=S.useState(null),[r,c]=S.useState(!0),[m,f]=S.useState(null),[h,p]=S.useState(null),[y,v]=S.useState("1h"),[j,b]=S.useState(null),[x,C]=S.useState(1),[w,E]=S.useState(10),O=async()=>{try{const F=await _x();o(F),f(null),b(Date.now()/1e3)}catch(F){f(At(F))}finally{c(!1)}};S.useEffect(()=>{O();const F=setInterval(()=>{O()},x3);return()=>clearInterval(F)},[]);const k=(a==null?void 0:a.records)??[],B=Date.now()/1e3,q=$S(k,y,B),Z=FS(q,B),V=PS(q,B),z=Math.max(1,Math.ceil(k.length/w)),Q=Math.min(x,z),W=(Q-1)*w,ne=k.slice(W,W+w),le=k.length===0?0:W+1,re=Math.min(k.length,W+w);if(r&&!a)return u.jsxs("section",{className:"space-y-4","aria-label":"Usage statistics",children:[u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:Array.from({length:6}).map((F,ie)=>u.jsx(Tt,{className:"h-32 w-full"},ie))}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[u.jsx(Tt,{className:"h-80 w-full"}),u.jsx(Tt,{className:"h-80 w-full lg:col-span-2"})]}),u.jsx(Tt,{className:"h-72 w-full"})]});if(m&&!a)return u.jsx("section",{className:"space-y-4","aria-label":"Usage statistics",children:u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-red-100 text-red-600 dark:bg-red-500/15",children:u.jsx(bu,{className:"size-6"})}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load usage statistics: ",m]}),u.jsxs(Ce,{type:"button",variant:"secondary",onClick:()=>void O(),children:[u.jsx(ki,{}),"Retry"]})]})})});const $={success:k.reduce((F,ie)=>F+(ie.status==="success"?1:0),0),error:k.reduce((F,ie)=>F+(ie.status==="error"?1:0),0),cancelled:k.reduce((F,ie)=>F+(ie.status==="cancelled"?1:0),0)};return u.jsxs("section",{className:"space-y-5","aria-label":"Usage statistics",children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-xl font-semibold tracking-tight",children:"Usage"}),u.jsxs("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:["Token throughput and request routing for the gateway, refreshed automatically every 10 seconds. Full prompts are captured for each request (capped at 64 KB) in ",u.jsx("code",{children:"~/.fcc/usage.json"}),"."]})]}),u.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(N3,{value:y,onChange:v}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",onClick:()=>void O(),children:[u.jsx(ki,{}),"Refresh"]})]}),j!==null?u.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Updated ",o3(j)]}):null]})]}),k.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(eu,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests tracked yet. Send a request through the proxy and it will appear here."})]})}):q.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(eu,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests in the selected window. Try a wider range."}),u.jsx(Ce,{type:"button",variant:"secondary",onClick:()=>v("all"),children:"Show all requests"})]})}):u.jsxs(u.Fragment,{children:[u.jsx(f3,{kpis:V,buckets:Z}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[u.jsx(m3,{kpis:V}),u.jsx("div",{className:"lg:col-span-2",children:u.jsx(v3,{buckets:Z})})]}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[u.jsx(g3,{records:q}),u.jsx(d3,{records:q})]}),u.jsx(r3,{records:q})]}),u.jsxs(Kt,{className:"gap-0 overflow-hidden",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b px-5 py-3",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold",children:"Recent requests"}),u.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[k.length," tracked · newest first"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(at,{variant:"ok",className:"gap-1 font-normal",children:[gs.success,$.success]}),u.jsxs(at,{variant:"error",className:"gap-1 font-normal",children:[gs.error,$.error]}),u.jsxs(at,{variant:"neutral",className:"gap-1 font-normal",children:[gs.cancelled,$.cancelled]})]})]}),u.jsxs(Nn,{className:"px-0 py-0",children:[u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b bg-muted/40 text-xs text-muted-foreground",children:[u.jsx("th",{className:"w-8 px-3 py-2.5"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Time"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Provider / Model"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Input"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Output"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Cache"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Reasoning"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Duration"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Status"})]})}),u.jsx("tbody",{children:ne.map(F=>{const ie=F.request_id===h,J=F.cache_creation_tokens+F.cache_read_tokens;return u.jsx(A3,{record:F,expanded:ie,cacheTokens:J,onToggle:()=>p(ie?null:F.request_id)},F.request_id)})})]})}),k.length>w?u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3",children:[u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing"," ",u.jsxs("span",{className:"font-mono",children:[le,"–",re]})," ","of ",u.jsx("span",{className:"font-mono",children:k.length})]}),u.jsxs("nav",{className:"flex flex-wrap items-center gap-1","aria-label":"Request log pages",children:[u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"px-1.5",disabled:Q<=1,onClick:()=>C(Q-1),"aria-label":"Previous page",children:u.jsx(tx,{className:"size-3.5"})}),S3(Q,z).map((F,ie)=>F==="…"?u.jsx("span",{className:"px-0.5 text-xs text-muted-foreground",children:"…"},`ellipsis-${ie}`):u.jsx(Ce,{type:"button",size:"sm",variant:F===Q?"default":"ghost",className:"min-w-7 px-1.5","aria-current":F===Q?"page":void 0,onClick:()=>C(F),children:F},F)),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"px-1.5",disabled:Q>=z,onClick:()=>C(Q+1),"aria-label":"Next page",children:u.jsx(kp,{className:"size-3.5"})})]}),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",role:"group","aria-label":"Rows per page",children:[u.jsx("span",{className:"hidden sm:inline",children:"Per page"}),u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",children:b3.map(F=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",w===F?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>{E(F),C(1)},children:F},F))})]})]}):null]})]})]})}function A3({record:a,expanded:o,cacheTokens:r,onToggle:c}){const m=a.gateway_model||a.provider_model,f=a.cache_read_tokens,h=a.cache_creation_tokens;return u.jsxs(u.Fragment,{children:[u.jsxs("tr",{className:ge("cursor-pointer border-b transition-colors hover:bg-accent/40",o&&"bg-accent/30"),onClick:c,children:[u.jsx("td",{className:"px-3 py-2.5",children:o?u.jsx(Op,{className:"size-4 text-muted-foreground"}):u.jsx(kp,{className:"size-4 text-muted-foreground"})}),u.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap text-muted-foreground",children:i3(a.timestamp)}),u.jsxs("td",{className:"max-w-64 px-3 py-2.5",children:[u.jsx("p",{className:"truncate font-mono text-xs",children:m}),u.jsxs("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[a.provider,a.provider_model&&a.provider_model!==m?` → ${a.provider_model}`:""]})]}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.input_tokens}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.output_tokens}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:r>0?u.jsx("span",{title:`${h} created · ${f} read`,className:"cursor-help",children:r}):u.jsx("span",{className:"text-muted-foreground/50",children:"–"})}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.reasoning_tokens>0?a.reasoning_tokens:u.jsx("span",{className:"text-muted-foreground/50",children:"–"})}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:qu(a.duration_ms)}),u.jsx("td",{className:"px-3 py-2.5",children:u.jsxs(at,{variant:j3[a.status],className:"gap-1 font-normal",children:[gs[a.status],w3(a.status)]})})]}),o?u.jsx("tr",{className:"border-b bg-muted/20",children:u.jsx("td",{colSpan:9,className:"px-3 py-3",children:u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[u.jsx(at,{variant:"outline",className:"gap-1.5 font-normal",children:a.wire_api}),a.error_type?u.jsx(at,{variant:"error",className:"gap-1.5 font-normal",children:a.error_type}):null,u.jsx("span",{className:"font-mono",children:a.request_id})]}),u.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border bg-background/70 p-3 font-mono text-xs whitespace-pre-wrap text-foreground/90",children:a.prompt||"(no prompt captured)"})]})})}):null]})}const ey="fcc-admin-theme",ty=S.createContext(null);function Ap(){try{const a=window.localStorage.getItem(ey);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}function T3(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Pr(a){const o=a==="system"?T3():a;return document.documentElement.classList.toggle("dark",o==="dark"),o}function E3({children:a}){const[o,r]=S.useState(Ap),[c,m]=S.useState(()=>Pr(Ap()));S.useEffect(()=>{if(m(Pr(o)),o!=="system")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>m(Pr("system"));return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[o]);const f=p=>{r(p);try{window.localStorage.setItem(ey,p)}catch{}},h=()=>{f(c==="dark"?"light":"dark")};return u.jsx(ty.Provider,{value:{theme:o,resolvedTheme:c,setTheme:f,toggleTheme:h},children:a})}function z3(){const a=S.useContext(ty);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a}function _3(){const{resolvedTheme:a,toggleTheme:o}=z3(),r=a==="dark";return u.jsxs(Zg,{children:[u.jsx(Kg,{asChild:!0,children:u.jsx(Ce,{type:"button",variant:"ghost",size:"icon","aria-label":r?"Switch to light theme":"Switch to dark theme",onClick:o,children:r?u.jsx(xx,{}):u.jsx(mx,{})})}),u.jsx($g,{side:"bottom",children:r?"Switch to light theme":"Switch to dark theme"})]})}const M3="********",ul=[{id:"providers",label:"Providers",title:"Providers",description:"Check connectivity and manage provider credentials",path:"providers",sections:["providers","runtime"],icon:Ri},{id:"model_config",label:"Model Config",title:"Model Config",description:"Choose models, reasoning behavior, and web tooling",path:"model-config",sections:["models","reasoning","web_tools"],icon:vx},{id:"openai_compatible",label:"OpenAI-Compatible",title:"OpenAI-Compatible Endpoints",description:"Add any OpenAI-compatible server as a numbered provider",path:"openai-compatible",sections:[],icon:px},{id:"messaging",label:"Messaging",title:"Messaging",description:"Chat platforms and voice integration",path:"messaging",sections:["messaging","voice"],icon:Up},{id:"usage",label:"Usage",title:"Usage",description:"Token throughput and recent request logs",path:"usage",sections:[],icon:xu}];function ny(a){var o;return((o=ul.find(r=>r.path===a))==null?void 0:o.id)??"providers"}function O3(a){return/^openai_compatible_\d+$/.test(a)}function Ir(a,o){return O3(a)?o:`${a}/${o}`}function ly(){const a=window.location.hash.replace(/^#\/?/,""),[o]=a.split("?");return o||""}function k3(){var o;const a=ny(ly());return window.location.hash=`/${((o=ul.find(r=>r.id===a))==null?void 0:o.path)??a}`,a}const R3=a=>["configured","reachable","running","connected"].includes(a??"")?"ok":["missing_key","missing_config","missing_url","unknown","connecting"].includes(a??"")?"warn":["offline","error"].includes(a??"")?"error":"neutral";function D3(a){return a.type==="boolean"?String(a.value).toLowerCase()==="true"?"true":"false":a.type==="optional_model"&&a.value==="None"?"":a.pool_supported?(a.keys||[]).join(","):a.value||""}function U3(a){return a.pool_supported?(a.keys||[]).join(","):a.type==="secret"?"":a.type==="boolean"?String(a.value).toLowerCase()==="true"?"true":"false":a.type==="optional_model"&&a.value==="None"?"":a.pool_supported?(a.keys||[]).join(","):a.value||""}function L3(a,o){return a.type==="boolean"?o==="true"?"true":"false":a.type==="optional_model"&&o.trim().toLowerCase()==="none"?"":a.pool_supported?o:a.secret&&a.configured?o||M3:o}function At(a){return a instanceof Error?a.message:String(a)}function H3(){const[a,o]=S.useState(null),[r,c]=S.useState({}),[m,f]=S.useState([]),[h,p]=S.useState({}),[y,v]=S.useState({}),[j,b]=S.useState({}),[x,C]=S.useState(null),[w,E]=S.useState(()=>k3()),[O,k]=S.useState(!1),[B,q]=S.useState(!1),Z=S.useRef({}),V=S.useCallback(K=>C({text:K}),[]),z=S.useCallback(K=>C({text:K,kind:"error"}),[]),Q=S.useCallback(K=>C({text:K,kind:"warn"}),[]),W=S.useCallback((K,I)=>C({text:K,kind:I}),[]),ne=S.useCallback(()=>{if(!a)return{};const K={};for(const I of a.fields){if(I.locked)continue;const ee=L3(I,r[I.key]??"");ee!==D3(I)&&(K[I.key]=ee)}return K},[a,r]),le=Object.keys(ne()).length,re=S.useCallback(K=>{const I=Z.current[K];I&&(clearTimeout(I),delete Z.current[K])},[]),$=S.useCallback(K=>{re(K);const I=setTimeout(async()=>{try{const ee=await Ph(K);v(ue=>({...ue,[K]:ee})),ee.state==="connecting"?$(K):(delete Z.current[K],ee.connected&&await F())}catch(ee){delete Z.current[K],z(At(ee))}},1e3);Z.current[K]=I},[re,z]),F=S.useCallback(async()=>{try{const K=await Ih(!1);f(K.models)}catch{}},[]),ie=S.useCallback(async()=>{try{const K=await Cx(),I={};for(const ee of K.providers)I[ee.provider_id]=ee;p(I)}catch(K){z(At(K))}},[z]),J=S.useCallback(async K=>{const I=K.provider_status.filter(ue=>ue.kind==="connected_account"),ee={};await Promise.all(I.map(async ue=>{try{const Be=await Ph(ue.provider_id);ee[ue.provider_id]=Be,Be.state==="connecting"&&$(ue.provider_id)}catch(Be){ee[ue.provider_id]={state:"error",connected:!1,label:"Needs attention",message:At(Be)}}})),v(ue=>({...ue,...ee}))},[$]),A=S.useCallback(async()=>{V("Loading admin config");try{const K=await wx();o(K);const I={};for(const ee of K.fields)I[ee.key]=U3(ee);c(I),await J(K),await F();try{const ee=await Wh({});!ee.valid&&ee.errors.length&&z(ee.errors.join("; "))}catch{}await ie(),V("")}catch(K){z(At(K))}},[J,F,ie,V,z]);S.useEffect(()=>{A();const K=()=>E(ny(ly()));window.addEventListener("hashchange",K);const I=ee=>{ee.key==="Escape"&&q(!1)};return window.addEventListener("keydown",I),()=>{window.removeEventListener("hashchange",K),window.removeEventListener("keydown",I);for(const ee of Object.values(Z.current))clearTimeout(ee);Z.current={}}},[A]);const D=K=>{var ee;const I=((ee=ul.find(ue=>ue.id===K))==null?void 0:ee.path)??K;E(K),window.location.hash=`/${I}`},H=S.useCallback(async()=>{try{const K=await Wh(ne());K.valid?V("Config shape is valid"):z(K.errors.join("; "))}catch(K){z(At(K))}},[ne,z,V]),P=S.useCallback(async()=>{k(!0);try{const K=await Nx(ne());if(!K.applied){const ue=K.errors??[];ue.length&&z(ue.join("; "));return}const I=K.restart;if(I!=null&&I.required&&I.automatic){V("Applied. Restarting server..."),setTimeout(()=>{window.location.href=I.admin_url||"/admin"},1600);return}const ee=I!=null&&I.required?I.fields??[]:K.pending_fields??[];await A(),V(ee.length?`Applied. Restart fcc-server to use: ${ee.join(", ")}`:"Applied")}catch(K){z(At(K))}finally{k(!1)}},[ne,A,z,V]),se=S.useCallback(async(K,I)=>{try{const ee=await Fh(K);ee.ok?(p(ue=>({...ue,[K]:{provider_id:K,display_name:K,kind:"remote",status:"reachable",label:`${ee.models.length} models`}})),f(ue=>[...new Set([...ue,...ee.models.map(Be=>Ir(K,Be))])]),V("Models refreshed")):p(ue=>({...ue,[K]:{provider_id:K,display_name:K,kind:"remote",status:"offline",label:ee.error_type??"Offline"}}))}catch(ee){z(At(ee))}finally{I==null||I()}},[z,V]),je=S.useCallback(async K=>{try{const I=await Fh(K);return I.ok?(f(ee=>[...new Set([...ee,...I.models.map(ue=>Ir(K,ue))])]),I.models):(z(`Could not fetch models from ${K}: ${I.error_type??"request failed"}`),[])}catch(I){return z(`Could not fetch models from ${K}: ${At(I)}`),[]}},[z]),ze=S.useCallback((K,I)=>{I.length!==0&&f(ee=>[...new Set([...ee,...I.map(ue=>Ir(K,ue))])])},[]),pe=S.useCallback(async(K,I)=>{try{const ee=await Ih(!0);f(ee.models);const ue=ee.failed_providers??[];ue.length?Q(`${ee.models.length} models available; could not refresh ${ue.join(", ")}`):V(`${ee.models.length} models available`)}catch(ee){z(`Could not refresh models: ${At(ee)}`)}finally{I==null||I()}},[z,V,Q]),He=S.useCallback(async(K,I)=>{b(ue=>({...ue,[K]:!0}));const ee=window.open("about:blank","_blank");ee&&(ee.opener=null);try{const ue=await Ax(K,I);v(Dn=>({...Dn,[K]:ue}));const Be=ue.authorization_url||ue.verification_url;Be&&ee?ee.location.replace(Be):Be?window.open(Be,"_blank","noopener"):ee&&ee.close(),ue.state==="connecting"&&$(K)}catch(ue){ee&&ee.close(),z(At(ue))}finally{b(ue=>({...ue,[K]:!1}))}},[$,z]),st=S.useCallback(async K=>{re(K);try{const I=await Tx(K);v(ee=>({...ee,[K]:I}))}catch(I){z(At(I))}},[re,z]),zt=S.useCallback(async K=>{if(window.confirm("Disconnect this ChatGPT account from FCC?")){re(K);try{const I=await Ex(K);v(ee=>({...ee,[K]:I})),await F()}catch(I){z(At(I))}}},[re,F,z]),Rn=S.useCallback(async K=>{try{await navigator.clipboard.writeText(K),V("Device code copied.")}catch{C({text:`Copy this device code: ${K}`})}},[V]);if(!a)return u.jsxs("div",{className:"flex min-h-screen",children:[u.jsxs("aside",{className:"sticky top-0 hidden h-screen w-64 shrink-0 flex-col gap-3 overflow-y-auto border-r p-4 md:flex",children:[u.jsx(Tt,{className:"h-10 w-full"}),u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx(Tt,{className:"h-9 w-5/6"}),u.jsx(Tt,{className:"h-9 w-4/6"}),u.jsx(Tt,{className:"h-9 w-3/6"})]})]}),u.jsxs("main",{className:"flex min-w-0 flex-1 flex-col gap-6 p-4 md:p-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Tt,{className:"h-7 w-56"}),u.jsx(Tt,{className:"h-4 w-72"})]}),u.jsx(Tt,{className:"h-36 w-full"}),u.jsx(Tt,{className:"h-36 w-full"}),u.jsx(Tt,{className:"h-36 w-full"})]})]});const Wt=ul.find(K=>K.id===w)??ul[0],Yt=Wt.icon;return u.jsxs("div",{className:"flex min-h-screen",children:[u.jsx(jp,{config:a,activeView:w,onSelectView:D,className:"sticky top-0 hidden h-screen md:flex"}),B?u.jsxs("div",{className:"fixed inset-0 z-50 md:hidden",role:"dialog","aria-modal":"true","aria-label":"Admin navigation",children:[u.jsx("button",{type:"button","aria-label":"Close navigation",className:"absolute inset-0 bg-black/60",onClick:()=>q(!1)}),u.jsx(jp,{config:a,activeView:w,onSelectView:D,onNavigate:()=>q(!1),className:"animate-in slide-in-from-left absolute inset-y-0 left-0 shadow-2xl"}),u.jsx("button",{type:"button","aria-label":"Close navigation",className:"absolute top-4 right-4 flex size-8 items-center justify-center rounded-md text-white/80 hover:bg-white/10 hover:text-white",onClick:()=>q(!1),children:u.jsx(Lp,{className:"size-5"})})]}):null,u.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsxs("header",{className:"sticky top-0 z-30 flex items-center justify-between gap-4 border-b bg-background/80 px-4 py-3 backdrop-blur-md md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx(Ce,{type:"button",variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open navigation",onClick:()=>q(!0),children:u.jsx(fx,{})}),u.jsx("div",{className:"hidden size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary md:flex",children:u.jsx(Yt,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-lg font-semibold tracking-tight leading-tight",children:Wt.title}),u.jsx("p",{className:"truncate text-xs text-muted-foreground",children:Wt.description})]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.version?u.jsxs(at,{variant:"outline",className:"hidden font-mono text-muted-foreground sm:inline-flex",children:["v",a.version]}):null,u.jsx(_3,{})]})]}),u.jsxs("div",{className:"flex-1 space-y-6 p-4 md:p-6",children:[w==="providers"&&u.jsx(yb,{config:a,localStatus:h,connectedStatus:y,connectedLoading:j,onTestProvider:se,onRefreshModels:pe,onStartLogin:He,onCancelLogin:st,onDisconnect:zt,onCopyDeviceCode:Rn}),w==="openai_compatible"&&u.jsx(mb,{config:a,values:r,onValuesChange:c,localStatus:h,onTestProvider:se,onFetchModels:je,onAddModels:ze,onMessage:W}),w==="usage"&&u.jsx(C3,{}),u.jsx(rb,{config:a,values:r,onValuesChange:c,modelOptions:m,onRefreshModels:pe,focusedView:w})]}),u.jsx(x1,{configPath:a.paths.managed,dirtyCount:le,message:x,applying:O,onValidate:H,onApply:P})]})]})}function ay(a){return R3(a)}$v.createRoot(document.getElementById("root")).render(u.jsx(S.StrictMode,{children:u.jsx(E3,{children:u.jsx(H3,{})})}));