@tokenbuddy/tokenbuddy 1.0.40 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,271 +0,0 @@
1
- var P0=Object.defineProperty;var Zv=n=>{throw TypeError(n)};var K0=(n,l,o)=>l in n?P0(n,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[l]=o;var Rd=(n,l,o)=>K0(n,typeof l!="symbol"?l+"":l,o),zd=(n,l,o)=>l.has(n)||Zv("Cannot "+o);var C=(n,l,o)=>(zd(n,l,"read from private field"),o?o.call(n):l.get(n)),fe=(n,l,o)=>l.has(n)?Zv("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,o),ie=(n,l,o,i)=>(zd(n,l,"write to private field"),i?i.call(n,o):l.set(n,o),o),we=(n,l,o)=>(zd(n,l,"access private method"),o);var Vo=(n,l,o,i)=>({set _(u){ie(n,l,u,o)},get _(){return C(n,l,i)}});(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&i(p)}).observe(document,{childList:!0,subtree:!0});function o(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=o(u);fetch(u.href,f)}})();var _d={exports:{}},ss={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Jv;function Y0(){if(Jv)return ss;Jv=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,f){var p=null;if(f!==void 0&&(p=""+f),u.key!==void 0&&(p=""+u.key),"key"in u){f={};for(var h in u)h!=="key"&&(f[h]=u[h])}else f=u;return u=f.ref,{$$typeof:n,type:i,key:p,ref:u!==void 0?u:null,props:f}}return ss.Fragment=l,ss.jsx=o,ss.jsxs=o,ss}var Iv;function G0(){return Iv||(Iv=1,_d.exports=Y0()),_d.exports}var s=G0(),Od={exports:{}},ye={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Wv;function V0(){if(Wv)return ye;Wv=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),j=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=j&&N[j]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,D={};function R(N,B,V){this.props=N,this.context=B,this.refs=D,this.updater=V||T}R.prototype.isReactComponent={},R.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,B,"setState")},R.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function L(){}L.prototype=R.prototype;function Q(N,B,V){this.props=N,this.context=B,this.refs=D,this.updater=V||T}var P=Q.prototype=new L;P.constructor=Q,E(P,R.prototype),P.isPureReactComponent=!0;var G=Array.isArray;function H(){}var $={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function J(N,B,V){var le=V.ref;return{$$typeof:n,type:N,key:B,ref:le!==void 0?le:null,props:V}}function te(N,B){return J(N.type,B,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function Z(N){var B={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(V){return B[V]})}var se=/\/+/g;function xe(N,B){return typeof N=="object"&&N!==null&&N.key!=null?Z(""+N.key):B.toString(36)}function me(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(H,H):(N.status="pending",N.then(function(B){N.status==="pending"&&(N.status="fulfilled",N.value=B)},function(B){N.status==="pending"&&(N.status="rejected",N.reason=B)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function O(N,B,V,le,de){var pe=typeof N;(pe==="undefined"||pe==="boolean")&&(N=null);var be=!1;if(N===null)be=!0;else switch(pe){case"bigint":case"string":case"number":be=!0;break;case"object":switch(N.$$typeof){case n:case l:be=!0;break;case y:return be=N._init,O(be(N._payload),B,V,le,de)}}if(be)return de=de(N),be=le===""?"."+xe(N,0):le,G(de)?(V="",be!=null&&(V=be.replace(se,"$&/")+"/"),O(de,B,V,"",function(Mt){return Mt})):de!=null&&(F(de)&&(de=te(de,V+(de.key==null||N&&N.key===de.key?"":(""+de.key).replace(se,"$&/")+"/")+be)),B.push(de)),1;be=0;var Xe=le===""?".":le+":";if(G(N))for(var Oe=0;Oe<N.length;Oe++)le=N[Oe],pe=Xe+xe(le,Oe),be+=O(le,B,V,pe,de);else if(Oe=w(N),typeof Oe=="function")for(N=Oe.call(N),Oe=0;!(le=N.next()).done;)le=le.value,pe=Xe+xe(le,Oe++),be+=O(le,B,V,pe,de);else if(pe==="object"){if(typeof N.then=="function")return O(me(N),B,V,le,de);throw B=String(N),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return be}function ee(N,B,V){if(N==null)return N;var le=[],de=0;return O(N,le,"","",function(pe){return B.call(V,pe,de++)}),le}function re(N){if(N._status===-1){var B=N._result;B=B(),B.then(function(V){(N._status===0||N._status===-1)&&(N._status=1,N._result=V)},function(V){(N._status===0||N._status===-1)&&(N._status=2,N._result=V)}),N._status===-1&&(N._status=0,N._result=B)}if(N._status===1)return N._result.default;throw N._result}var ae=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ge={map:ee,forEach:function(N,B,V){ee(N,function(){B.apply(this,arguments)},V)},count:function(N){var B=0;return ee(N,function(){B++}),B},toArray:function(N){return ee(N,function(B){return B})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ye.Activity=g,ye.Children=ge,ye.Component=R,ye.Fragment=o,ye.Profiler=u,ye.PureComponent=Q,ye.StrictMode=i,ye.Suspense=v,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,ye.__COMPILER_RUNTIME={__proto__:null,c:function(N){return $.H.useMemoCache(N)}},ye.cache=function(N){return function(){return N.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(N,B,V){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var le=E({},N.props),de=N.key;if(B!=null)for(pe in B.key!==void 0&&(de=""+B.key),B)!I.call(B,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&B.ref===void 0||(le[pe]=B[pe]);var pe=arguments.length-2;if(pe===1)le.children=V;else if(1<pe){for(var be=Array(pe),Xe=0;Xe<pe;Xe++)be[Xe]=arguments[Xe+2];le.children=be}return J(N.type,de,le)},ye.createContext=function(N){return N={$$typeof:p,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},ye.createElement=function(N,B,V){var le,de={},pe=null;if(B!=null)for(le in B.key!==void 0&&(pe=""+B.key),B)I.call(B,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=B[le]);var be=arguments.length-2;if(be===1)de.children=V;else if(1<be){for(var Xe=Array(be),Oe=0;Oe<be;Oe++)Xe[Oe]=arguments[Oe+2];de.children=Xe}if(N&&N.defaultProps)for(le in be=N.defaultProps,be)de[le]===void 0&&(de[le]=be[le]);return J(N,pe,de)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(N){return{$$typeof:h,render:N}},ye.isValidElement=F,ye.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:re}},ye.memo=function(N,B){return{$$typeof:x,type:N,compare:B===void 0?null:B}},ye.startTransition=function(N){var B=$.T,V={};$.T=V;try{var le=N(),de=$.S;de!==null&&de(V,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(H,ae)}catch(pe){ae(pe)}finally{B!==null&&V.types!==null&&(B.types=V.types),$.T=B}},ye.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},ye.use=function(N){return $.H.use(N)},ye.useActionState=function(N,B,V){return $.H.useActionState(N,B,V)},ye.useCallback=function(N,B){return $.H.useCallback(N,B)},ye.useContext=function(N){return $.H.useContext(N)},ye.useDebugValue=function(){},ye.useDeferredValue=function(N,B){return $.H.useDeferredValue(N,B)},ye.useEffect=function(N,B){return $.H.useEffect(N,B)},ye.useEffectEvent=function(N){return $.H.useEffectEvent(N)},ye.useId=function(){return $.H.useId()},ye.useImperativeHandle=function(N,B,V){return $.H.useImperativeHandle(N,B,V)},ye.useInsertionEffect=function(N,B){return $.H.useInsertionEffect(N,B)},ye.useLayoutEffect=function(N,B){return $.H.useLayoutEffect(N,B)},ye.useMemo=function(N,B){return $.H.useMemo(N,B)},ye.useOptimistic=function(N,B){return $.H.useOptimistic(N,B)},ye.useReducer=function(N,B,V){return $.H.useReducer(N,B,V)},ye.useRef=function(N){return $.H.useRef(N)},ye.useState=function(N){return $.H.useState(N)},ye.useSyncExternalStore=function(N,B,V){return $.H.useSyncExternalStore(N,B,V)},ye.useTransition=function(){return $.H.useTransition()},ye.version="19.2.7",ye}var ex;function kf(){return ex||(ex=1,Od.exports=V0()),Od.exports}var S=kf(),Dd={exports:{}},os={},Ud={exports:{}},Ld={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var tx;function X0(){return tx||(tx=1,(function(n){function l(O,ee){var re=O.length;O.push(ee);e:for(;0<re;){var ae=re-1>>>1,ge=O[ae];if(0<u(ge,ee))O[ae]=ee,O[re]=ge,re=ae;else break e}}function o(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var ee=O[0],re=O.pop();if(re!==ee){O[0]=re;e:for(var ae=0,ge=O.length,N=ge>>>1;ae<N;){var B=2*(ae+1)-1,V=O[B],le=B+1,de=O[le];if(0>u(V,re))le<ge&&0>u(de,V)?(O[ae]=de,O[le]=re,ae=le):(O[ae]=V,O[B]=re,ae=B);else if(le<ge&&0>u(de,re))O[ae]=de,O[le]=re,ae=le;else break e}}return ee}function u(O,ee){var re=O.sortIndex-ee.sortIndex;return re!==0?re:O.id-ee.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();n.unstable_now=function(){return p.now()-h}}var v=[],x=[],y=1,g=null,j=3,w=!1,T=!1,E=!1,D=!1,R=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function P(O){for(var ee=o(x);ee!==null;){if(ee.callback===null)i(x);else if(ee.startTime<=O)i(x),ee.sortIndex=ee.expirationTime,l(v,ee);else break;ee=o(x)}}function G(O){if(E=!1,P(O),!T)if(o(v)!==null)T=!0,H||(H=!0,Z());else{var ee=o(x);ee!==null&&me(G,ee.startTime-O)}}var H=!1,$=-1,I=5,J=-1;function te(){return D?!0:!(n.unstable_now()-J<I)}function F(){if(D=!1,H){var O=n.unstable_now();J=O;var ee=!0;try{e:{T=!1,E&&(E=!1,L($),$=-1),w=!0;var re=j;try{t:{for(P(O),g=o(v);g!==null&&!(g.expirationTime>O&&te());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,j=g.priorityLevel;var ge=ae(g.expirationTime<=O);if(O=n.unstable_now(),typeof ge=="function"){g.callback=ge,P(O),ee=!0;break t}g===o(v)&&i(v),P(O)}else i(v);g=o(v)}if(g!==null)ee=!0;else{var N=o(x);N!==null&&me(G,N.startTime-O),ee=!1}}break e}finally{g=null,j=re,w=!1}ee=void 0}}finally{ee?Z():H=!1}}}var Z;if(typeof Q=="function")Z=function(){Q(F)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,xe=se.port2;se.port1.onmessage=F,Z=function(){xe.postMessage(null)}}else Z=function(){R(F,0)};function me(O,ee){$=R(function(){O(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return j},n.unstable_next=function(O){switch(j){case 1:case 2:case 3:var ee=3;break;default:ee=j}var re=j;j=ee;try{return O()}finally{j=re}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(O,ee){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var re=j;j=O;try{return ee()}finally{j=re}},n.unstable_scheduleCallback=function(O,ee,re){var ae=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?ae+re:ae):re=ae,O){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=re+ge,O={id:y++,callback:ee,priorityLevel:O,startTime:re,expirationTime:ge,sortIndex:-1},re>ae?(O.sortIndex=re,l(x,O),o(v)===null&&O===o(x)&&(E?(L($),$=-1):E=!0,me(G,re-ae))):(O.sortIndex=ge,l(v,O),T||w||(T=!0,H||(H=!0,Z()))),O},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(O){var ee=j;return function(){var re=j;j=ee;try{return O.apply(this,arguments)}finally{j=re}}}})(Ld)),Ld}var nx;function F0(){return nx||(nx=1,Ud.exports=X0()),Ud.exports}var Bd={exports:{}},Dt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var ax;function Z0(){if(ax)return Dt;ax=1;var n=kf();function l(v){var x="https://react.dev/errors/"+v;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+v+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(v,x,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:g==null?null:""+g,children:v,containerInfo:x,implementation:y}}var p=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(v,x){if(v==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Dt.createPortal=function(v,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return f(v,x,null,y)},Dt.flushSync=function(v){var x=p.T,y=i.p;try{if(p.T=null,i.p=2,v)return v()}finally{p.T=x,i.p=y,i.d.f()}},Dt.preconnect=function(v,x){typeof v=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,i.d.C(v,x))},Dt.prefetchDNS=function(v){typeof v=="string"&&i.d.D(v)},Dt.preinit=function(v,x){if(typeof v=="string"&&x&&typeof x.as=="string"){var y=x.as,g=h(y,x.crossOrigin),j=typeof x.integrity=="string"?x.integrity:void 0,w=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?i.d.S(v,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:g,integrity:j,fetchPriority:w}):y==="script"&&i.d.X(v,{crossOrigin:g,integrity:j,fetchPriority:w,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Dt.preinitModule=function(v,x){if(typeof v=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=h(x.as,x.crossOrigin);i.d.M(v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&i.d.M(v)},Dt.preload=function(v,x){if(typeof v=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,g=h(y,x.crossOrigin);i.d.L(v,y,{crossOrigin:g,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Dt.preloadModule=function(v,x){if(typeof v=="string")if(x){var y=h(x.as,x.crossOrigin);i.d.m(v,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else i.d.m(v)},Dt.requestFormReset=function(v){i.d.r(v)},Dt.unstable_batchedUpdates=function(v,x){return v(x)},Dt.useFormState=function(v,x,y){return p.H.useFormState(v,x,y)},Dt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Dt.version="19.2.7",Dt}var lx;function fg(){if(lx)return Bd.exports;lx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Bd.exports=Z0(),Bd.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var rx;function J0(){if(rx)return os;rx=1;var n=F0(),l=kf(),o=fg();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(f(e)!==e)throw Error(i(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return v(c),e;if(d===r)return v(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var m=!1,b=c.child;b;){if(b===a){m=!0,a=c,r=d;break}if(b===r){m=!0,r=c,a=d;break}b=b.sibling}if(!m){for(b=d.child;b;){if(b===a){m=!0,a=d,r=c;break}if(b===r){m=!0,r=d,a=c;break}b=b.sibling}if(!m)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case R:return"Profiler";case D:return"StrictMode";case G:return"Suspense";case H:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case Q:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var me=Array.isArray,O=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ae=[],ge=-1;function N(e){return{current:e}}function B(e){0>ge||(e.current=ae[ge],ae[ge]=null,ge--)}function V(e,t){ge++,ae[ge]=e.current,e.current=t}var le=N(null),de=N(null),pe=N(null),be=N(null);function Xe(e,t){switch(V(pe,t),V(de,e),V(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bv(t),e=yv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(le),V(le,e)}function Oe(){B(le),B(de),B(pe)}function Mt(e){e.memoizedState!==null&&V(be,e);var t=le.current,a=yv(t,e.type);t!==a&&(V(de,e),V(le,a))}function mt(e){de.current===e&&(B(le),B(de)),be.current===e&&(B(be),as._currentValue=re)}var yn,We;function Be(e){if(yn===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);yn=t&&t[1]||"",We=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+yn+e+We}var Gt=!1;function an(e,t){if(!e||Gt)return"";Gt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(q){var U=q}Reflect.construct(e,[],X)}else{try{X.call()}catch(q){U=q}e.call(X.prototype)}}else{try{throw Error()}catch(q){U=q}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(q){if(q&&U&&typeof q.stack=="string")return[q.stack,U.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),m=d[0],b=d[1];if(m&&b){var M=m.split(`
44
- `),_=b.split(`
45
- `);for(c=r=0;r<M.length&&!M[r].includes("DetermineComponentFrameRoot");)r++;for(;c<_.length&&!_[c].includes("DetermineComponentFrameRoot");)c++;if(r===M.length||c===_.length)for(r=M.length-1,c=_.length-1;1<=r&&0<=c&&M[r]!==_[c];)c--;for(;1<=r&&0<=c;r--,c--)if(M[r]!==_[c]){if(r!==1||c!==1)do if(r--,c--,0>c||M[r]!==_[c]){var K=`
46
- `+M[r].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=r&&0<=c);break}}}finally{Gt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Be(a):""}function ln(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 an(e.type,!1);case 11:return an(e.type.render,!1);case 1:return an(e.type,!0);case 31:return Be("Activity");default:return""}}function Bt(e){try{var t="",a=null;do t+=ln(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
47
- Error generating stack: `+r.message+`
48
- `+r.stack}}var Et=Object.prototype.hasOwnProperty,rn=n.unstable_scheduleCallback,sn=n.unstable_cancelCallback,Kn=n.unstable_shouldYield,la=n.unstable_requestPaint,rt=n.unstable_now,Ha=n.unstable_getCurrentPriorityLevel,Pa=n.unstable_ImmediatePriority,Sn=n.unstable_UserBlockingPriority,qt=n.unstable_NormalPriority,Ka=n.unstable_LowPriority,ra=n.unstable_IdlePriority,Ya=n.log,Ga=n.unstable_setDisableYieldValue,on=null,ht=null;function $t(e){if(typeof Ya=="function"&&Ga(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(on,e)}catch{}}var pt=Math.clz32?Math.clz32:jt,ia=Math.log,De=Math.LN2;function jt(e){return e>>>=0,e===0?32:31-(ia(e)/De|0)|0}var sa=256,oa=262144,ca=4194304;function jn(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 ua(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=r&134217727;return b!==0?(r=b&~d,r!==0?c=jn(r):(m&=b,m!==0?c=jn(m):a||(a=b&~e,a!==0&&(c=jn(a))))):(b=r&~d,b!==0?c=jn(b):m!==0?c=jn(m):a||(a=r&~e,a!==0&&(c=jn(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Yn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vr(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 Ul(){var e=ca;return ca<<=1,(ca&62914560)===0&&(ca=4194304),e}function Va(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ue(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function He(e,t,a,r,c,d){var m=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,M=e.expirationTimes,_=e.hiddenUpdates;for(a=m&~a;0<a;){var K=31-pt(a),X=1<<K;b[K]=0,M[K]=-1;var U=_[K];if(U!==null)for(_[K]=null,K=0;K<U.length;K++){var q=U[K];q!==null&&(q.lane&=-536870913)}a&=~X}r!==0&&Ze(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(m&~t))}function Ze(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-pt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Dn(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-pt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function Xa(e,t){var a=t&-t;return a=(a&42)!==0?1:da(a),(a&(e.suspendedLanes|t))!==0?0:a}function da(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function fa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Fa(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Pv(e.type))}function Za(e,t){var a=ee.p;try{return ee.p=e,t()}finally{ee.p=a}}var ut=Math.random().toString(36).slice(2),$e="__reactFiber$"+ut,nt="__reactProps$"+ut,ma="__reactContainer$"+ut,xr="__reactEvents$"+ut,W="__reactListeners$"+ut,ne="__reactHandles$"+ut,ke="__reactResources$"+ut,at="__reactMarker$"+ut;function Ja(e){delete e[$e],delete e[nt],delete e[xr],delete e[W],delete e[ne]}function Ll(e){var t=e[$e];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ma]||a[$e]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Tv(e);e!==null;){if(a=e[$e])return a;e=Tv(e)}return t}e=a,a=e.parentNode}return null}function ha(e){if(e=e[$e]||e[ma]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gr(e){var t=e[ke];return t||(t=e[ke]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[at]=!0}var sm=new Set,om={};function Bl(e,t){br(e,t),br(e+"Capture",t)}function br(e,t){for(om[e]=t,e=0;e<t.length;e++)sm.add(t[e])}var Ob=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cm={},um={};function Db(e){return Et.call(um,e)?!0:Et.call(cm,e)?!1:Ob.test(e)?um[e]=!0:(cm[e]=!0,!1)}function Os(e,t,a){if(Db(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ds(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function pa(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ub(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(m){a=""+m,d.call(this,m)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(m){a=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){if(!e._valueTracker){var t=dm(e)?"checked":"value";e._valueTracker=Ub(e,t,""+e[t])}}function fm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=dm(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Us(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Lb=/[\n"\\]/g;function wn(e){return e.replace(Lb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mc(e,t,a,r,c,d,m,b){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nn(t)):e.value!==""+Nn(t)&&(e.value=""+Nn(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?Cc(e,m,Nn(t)):a!=null?Cc(e,m,Nn(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Nn(b):e.removeAttribute("name")}function mm(e,t,a,r,c,d,m,b){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){wc(e);return}a=a!=null?""+Nn(a):"",t=t!=null?""+Nn(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=b?e.checked:!!r,e.defaultChecked=!!r,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),wc(e)}function Cc(e,t,a){t==="number"&&Us(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function yr(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Nn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function hm(e,t,a){if(t!=null&&(t=""+Nn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Nn(a):""}function pm(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=Nn(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),wc(e)}function Sr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Bb=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vm(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||Bb.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function xm(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&vm(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&vm(e,d,t[d])}function Tc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$b=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ls(e){return $b.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function va(){}var Ac=null;function Ec(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jr=null,Nr=null;function gm(e){var t=ha(e);if(t&&(e=t.stateNode)){var a=e[nt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[nt]||null;if(!c)throw Error(i(90));Mc(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&fm(r)}break e;case"textarea":hm(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&yr(e,!!a.multiple,t,!1)}}}var kc=!1;function bm(e,t,a){if(kc)return e(t,a);kc=!0;try{var r=e(t);return r}finally{if(kc=!1,(jr!==null||Nr!==null)&&(Mo(),jr&&(t=jr,e=Nr,Nr=jr=null,gm(t),e)))for(t=0;t<e.length;t++)gm(e[t])}}function yi(e,t){var a=e.stateNode;if(a===null)return null;var r=a[nt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=!1;if(xa)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){Rc=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{Rc=!1}var Ia=null,zc=null,Bs=null;function ym(){if(Bs)return Bs;var e,t=zc,a=t.length,r,c="value"in Ia?Ia.value:Ia.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var m=a-e;for(r=1;r<=m&&t[a-r]===c[d-r];r++);return Bs=c.slice(e,1<r?1-r:void 0)}function qs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $s(){return!0}function Sm(){return!1}function Vt(e){function t(a,r,c,d,m){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=m,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(d):d[b]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?$s:Sm,this.isPropagationStopped=Sm,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$s)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$s)},persist:function(){},isPersistent:$s}),t}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qs=Vt(ql),ji=g({},ql,{view:0,detail:0}),Qb=Vt(ji),_c,Oc,Ni,Hs=g({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ni&&(Ni&&e.type==="mousemove"?(_c=e.screenX-Ni.screenX,Oc=e.screenY-Ni.screenY):Oc=_c=0,Ni=e),_c)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),jm=Vt(Hs),Hb=g({},Hs,{dataTransfer:0}),Pb=Vt(Hb),Kb=g({},ji,{relatedTarget:0}),Dc=Vt(Kb),Yb=g({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Gb=Vt(Yb),Vb=g({},ql,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xb=Vt(Vb),Fb=g({},ql,{data:0}),Nm=Vt(Fb),Zb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ib={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ib[e])?!!t[e]:!1}function Uc(){return Wb}var ey=g({},ji,{key:function(e){if(e.key){var t=Zb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(e){return e.type==="keypress"?qs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ty=Vt(ey),ny=g({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wm=Vt(ny),ay=g({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),ly=Vt(ay),ry=g({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),iy=Vt(ry),sy=g({},Hs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oy=Vt(sy),cy=g({},ql,{newState:0,oldState:0}),uy=Vt(cy),dy=[9,13,27,32],Lc=xa&&"CompositionEvent"in window,wi=null;xa&&"documentMode"in document&&(wi=document.documentMode);var fy=xa&&"TextEvent"in window&&!wi,Mm=xa&&(!Lc||wi&&8<wi&&11>=wi),Cm=" ",Tm=!1;function Am(e,t){switch(e){case"keyup":return dy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wr=!1;function my(e,t){switch(e){case"compositionend":return Em(t);case"keypress":return t.which!==32?null:(Tm=!0,Cm);case"textInput":return e=t.data,e===Cm&&Tm?null:e;default:return null}}function hy(e,t){if(wr)return e==="compositionend"||!Lc&&Am(e,t)?(e=ym(),Bs=zc=Ia=null,wr=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mm&&t.locale!=="ko"?null:t.data;default:return null}}var py={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!py[e.type]:t==="textarea"}function Rm(e,t,a,r){jr?Nr?Nr.push(r):Nr=[r]:jr=r,t=zo(t,"onChange"),0<t.length&&(a=new Qs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Mi=null,Ci=null;function vy(e){mv(e,0)}function Ps(e){var t=cn(e);if(fm(t))return e}function zm(e,t){if(e==="change")return t}var _m=!1;if(xa){var Bc;if(xa){var qc="oninput"in document;if(!qc){var Om=document.createElement("div");Om.setAttribute("oninput","return;"),qc=typeof Om.oninput=="function"}Bc=qc}else Bc=!1;_m=Bc&&(!document.documentMode||9<document.documentMode)}function Dm(){Mi&&(Mi.detachEvent("onpropertychange",Um),Ci=Mi=null)}function Um(e){if(e.propertyName==="value"&&Ps(Ci)){var t=[];Rm(t,Ci,e,Ec(e)),bm(vy,t)}}function xy(e,t,a){e==="focusin"?(Dm(),Mi=t,Ci=a,Mi.attachEvent("onpropertychange",Um)):e==="focusout"&&Dm()}function gy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ps(Ci)}function by(e,t){if(e==="click")return Ps(t)}function yy(e,t){if(e==="input"||e==="change")return Ps(t)}function Sy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:Sy;function Ti(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!Et.call(t,c)||!un(e[c],t[c]))return!1}return!0}function Lm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bm(e,t){var a=Lm(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Lm(a)}}function qm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $m(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Us(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Us(e.document)}return t}function $c(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 jy=xa&&"documentMode"in document&&11>=document.documentMode,Mr=null,Qc=null,Ai=null,Hc=!1;function Qm(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Hc||Mr==null||Mr!==Us(r)||(r=Mr,"selectionStart"in r&&$c(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ai&&Ti(Ai,r)||(Ai=r,r=zo(Qc,"onSelect"),0<r.length&&(t=new Qs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Mr)))}function $l(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Cr={animationend:$l("Animation","AnimationEnd"),animationiteration:$l("Animation","AnimationIteration"),animationstart:$l("Animation","AnimationStart"),transitionrun:$l("Transition","TransitionRun"),transitionstart:$l("Transition","TransitionStart"),transitioncancel:$l("Transition","TransitionCancel"),transitionend:$l("Transition","TransitionEnd")},Pc={},Hm={};xa&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function Ql(e){if(Pc[e])return Pc[e];if(!Cr[e])return e;var t=Cr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Hm)return Pc[e]=t[a];return e}var Pm=Ql("animationend"),Km=Ql("animationiteration"),Ym=Ql("animationstart"),Ny=Ql("transitionrun"),wy=Ql("transitionstart"),My=Ql("transitioncancel"),Gm=Ql("transitionend"),Vm=new Map,Kc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Kc.push("scrollEnd");function Un(e,t){Vm.set(e,t),Bl(t,[e])}var Ks=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Mn=[],Tr=0,Yc=0;function Ys(){for(var e=Tr,t=Yc=Tr=0;t<e;){var a=Mn[t];Mn[t++]=null;var r=Mn[t];Mn[t++]=null;var c=Mn[t];Mn[t++]=null;var d=Mn[t];if(Mn[t++]=null,r!==null&&c!==null){var m=r.pending;m===null?c.next=c:(c.next=m.next,m.next=c),r.pending=c}d!==0&&Xm(a,c,d)}}function Gs(e,t,a,r){Mn[Tr++]=e,Mn[Tr++]=t,Mn[Tr++]=a,Mn[Tr++]=r,Yc|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Gc(e,t,a,r){return Gs(e,t,a,r),Vs(e)}function Hl(e,t){return Gs(e,null,null,t),Vs(e)}function Xm(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-pt(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function Vs(e){if(50<Zi)throw Zi=0,td=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ar={};function Cy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,a,r){return new Cy(e,t,a,r)}function Vc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ga(e,t){var a=e.alternate;return a===null?(a=dn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Fm(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xs(e,t,a,r,c,d){var m=0;if(r=e,typeof e=="function")Vc(e)&&(m=1);else if(typeof e=="string")m=R0(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=dn(31,a,t,c),e.elementType=J,e.lanes=d,e;case E:return Pl(a.children,c,d,t);case D:m=8,c|=24;break;case R:return e=dn(12,a,t,c|2),e.elementType=R,e.lanes=d,e;case G:return e=dn(13,a,t,c),e.elementType=G,e.lanes=d,e;case H:return e=dn(19,a,t,c),e.elementType=H,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:m=10;break e;case L:m=9;break e;case P:m=11;break e;case $:m=14;break e;case I:m=16,r=null;break e}m=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=dn(m,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function Pl(e,t,a,r){return e=dn(7,e,r,t),e.lanes=a,e}function Xc(e,t,a){return e=dn(6,e,null,t),e.lanes=a,e}function Zm(e){var t=dn(18,null,null,0);return t.stateNode=e,t}function Fc(e,t,a){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Jm=new WeakMap;function Cn(e,t){if(typeof e=="object"&&e!==null){var a=Jm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Bt(t)},Jm.set(e,t),t)}return{value:e,source:t,stack:Bt(t)}}var Er=[],kr=0,Fs=null,Ei=0,Tn=[],An=0,Wa=null,Gn=1,Vn="";function ba(e,t){Er[kr++]=Ei,Er[kr++]=Fs,Fs=e,Ei=t}function Im(e,t,a){Tn[An++]=Gn,Tn[An++]=Vn,Tn[An++]=Wa,Wa=e;var r=Gn;e=Vn;var c=32-pt(r)-1;r&=~(1<<c),a+=1;var d=32-pt(t)+c;if(30<d){var m=c-c%5;d=(r&(1<<m)-1).toString(32),r>>=m,c-=m,Gn=1<<32-pt(t)+c|a<<c|r,Vn=d+e}else Gn=1<<d|a<<c|r,Vn=e}function Zc(e){e.return!==null&&(ba(e,1),Im(e,1,0))}function Jc(e){for(;e===Fs;)Fs=Er[--kr],Er[kr]=null,Ei=Er[--kr],Er[kr]=null;for(;e===Wa;)Wa=Tn[--An],Tn[An]=null,Vn=Tn[--An],Tn[An]=null,Gn=Tn[--An],Tn[An]=null}function Wm(e,t){Tn[An++]=Gn,Tn[An++]=Vn,Tn[An++]=Wa,Gn=t.id,Vn=t.overflow,Wa=e}var kt=null,Je=null,Re=!1,el=null,En=!1,Ic=Error(i(519));function tl(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ki(Cn(t,e)),Ic}function eh(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[$e]=e,t[nt]=r,a){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(a=0;a<Ii.length;a++)Te(Ii[a],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),mm(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),pm(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||xv(t.textContent,a)?(r.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),r.onScroll!=null&&Te("scroll",t),r.onScrollEnd!=null&&Te("scrollend",t),r.onClick!=null&&(t.onclick=va),t=!0):t=!1,t||tl(e,!0)}function th(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:kt=kt.return}}function Rr(e){if(e!==kt)return!1;if(!Re)return th(e),Re=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||vd(e.type,e.memoizedProps)),a=!a),a&&Je&&tl(e),th(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Je=Cv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Je=Cv(e)}else t===27?(t=Je,pl(e.type)?(e=Sd,Sd=null,Je=e):Je=t):Je=kt?Rn(e.stateNode.nextSibling):null;return!0}function Kl(){Je=kt=null,Re=!1}function Wc(){var e=el;return e!==null&&(Jt===null?Jt=e:Jt.push.apply(Jt,e),el=null),e}function ki(e){el===null?el=[e]:el.push(e)}var eu=N(null),Yl=null,ya=null;function nl(e,t,a){V(eu,t._currentValue),t._currentValue=a}function Sa(e){e._currentValue=eu.current,B(eu)}function tu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function nu(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var m=c.child;d=d.firstContext;e:for(;d!==null;){var b=d;d=c;for(var M=0;M<t.length;M++)if(b.context===t[M]){d.lanes|=a,b=d.alternate,b!==null&&(b.lanes|=a),tu(d.return,a,e),r||(m=null);break e}d=b.next}}else if(c.tag===18){if(m=c.return,m===null)throw Error(i(341));m.lanes|=a,d=m.alternate,d!==null&&(d.lanes|=a),tu(m,a,e),m=null}else m=c.child;if(m!==null)m.return=c;else for(m=c;m!==null;){if(m===e){m=null;break}if(c=m.sibling,c!==null){c.return=m.return,m=c;break}m=m.return}c=m}}function zr(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var m=c.alternate;if(m===null)throw Error(i(387));if(m=m.memoizedProps,m!==null){var b=c.type;un(c.pendingProps.value,m.value)||(e!==null?e.push(b):e=[b])}}else if(c===be.current){if(m=c.alternate,m===null)throw Error(i(387));m.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(as):e=[as])}c=c.return}e!==null&&nu(t,e,a,r),t.flags|=262144}function Zs(e){for(e=e.firstContext;e!==null;){if(!un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gl(e){Yl=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return nh(Yl,e)}function Js(e,t){return Yl===null&&Gl(e),nh(e,t)}function nh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return a}var Ty=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ay=n.unstable_scheduleCallback,Ey=n.unstable_NormalPriority,vt={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function au(){return{controller:new Ty,data:new Map,refCount:0}}function Ri(e){e.refCount--,e.refCount===0&&Ay(Ey,function(){e.controller.abort()})}var zi=null,lu=0,_r=0,Or=null;function ky(e,t){if(zi===null){var a=zi=[];lu=0,_r=sd(),Or={status:"pending",value:void 0,then:function(r){a.push(r)}}}return lu++,t.then(ah,ah),t}function ah(){if(--lu===0&&zi!==null){Or!==null&&(Or.status="fulfilled");var e=zi;zi=null,_r=0,Or=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ry(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var lh=O.S;O.S=function(e,t){Qp=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ky(e,t),lh!==null&&lh(e,t)};var Vl=N(null);function ru(){var e=Vl.current;return e!==null?e:Fe.pooledCache}function Is(e,t){t===null?V(Vl,Vl.current):V(Vl,t.pool)}function rh(){var e=ru();return e===null?null:{parent:vt._currentValue,pool:e}}var Dr=Error(i(460)),iu=Error(i(474)),Ws=Error(i(542)),eo={then:function(){}};function ih(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(va,va),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ch(e),e;default:if(typeof t.status=="string")t.then(va,va);else{if(e=Fe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ch(e),e}throw Fl=t,Dr}}function Xl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Fl=a,Dr):a}}var Fl=null;function oh(){if(Fl===null)throw Error(i(459));var e=Fl;return Fl=null,e}function ch(e){if(e===Dr||e===Ws)throw Error(i(483))}var Ur=null,_i=0;function to(e){var t=_i;return _i+=1,Ur===null&&(Ur=[]),sh(Ur,e,t)}function Oi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function no(e,t){throw t.$$typeof===j?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function uh(e){function t(k,A){if(e){var z=k.deletions;z===null?(k.deletions=[A],k.flags|=16):z.push(A)}}function a(k,A){if(!e)return null;for(;A!==null;)t(k,A),A=A.sibling;return null}function r(k){for(var A=new Map;k!==null;)k.key!==null?A.set(k.key,k):A.set(k.index,k),k=k.sibling;return A}function c(k,A){return k=ga(k,A),k.index=0,k.sibling=null,k}function d(k,A,z){return k.index=z,e?(z=k.alternate,z!==null?(z=z.index,z<A?(k.flags|=67108866,A):z):(k.flags|=67108866,A)):(k.flags|=1048576,A)}function m(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function b(k,A,z,Y){return A===null||A.tag!==6?(A=Xc(z,k.mode,Y),A.return=k,A):(A=c(A,z),A.return=k,A)}function M(k,A,z,Y){var he=z.type;return he===E?K(k,A,z.props.children,Y,z.key):A!==null&&(A.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===I&&Xl(he)===A.type)?(A=c(A,z.props),Oi(A,z),A.return=k,A):(A=Xs(z.type,z.key,z.props,null,k.mode,Y),Oi(A,z),A.return=k,A)}function _(k,A,z,Y){return A===null||A.tag!==4||A.stateNode.containerInfo!==z.containerInfo||A.stateNode.implementation!==z.implementation?(A=Fc(z,k.mode,Y),A.return=k,A):(A=c(A,z.children||[]),A.return=k,A)}function K(k,A,z,Y,he){return A===null||A.tag!==7?(A=Pl(z,k.mode,Y,he),A.return=k,A):(A=c(A,z),A.return=k,A)}function X(k,A,z){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Xc(""+A,k.mode,z),A.return=k,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case w:return z=Xs(A.type,A.key,A.props,null,k.mode,z),Oi(z,A),z.return=k,z;case T:return A=Fc(A,k.mode,z),A.return=k,A;case I:return A=Xl(A),X(k,A,z)}if(me(A)||Z(A))return A=Pl(A,k.mode,z,null),A.return=k,A;if(typeof A.then=="function")return X(k,to(A),z);if(A.$$typeof===Q)return X(k,Js(k,A),z);no(k,A)}return null}function U(k,A,z,Y){var he=A!==null?A.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return he!==null?null:b(k,A,""+z,Y);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case w:return z.key===he?M(k,A,z,Y):null;case T:return z.key===he?_(k,A,z,Y):null;case I:return z=Xl(z),U(k,A,z,Y)}if(me(z)||Z(z))return he!==null?null:K(k,A,z,Y,null);if(typeof z.then=="function")return U(k,A,to(z),Y);if(z.$$typeof===Q)return U(k,A,Js(k,z),Y);no(k,z)}return null}function q(k,A,z,Y,he){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return k=k.get(z)||null,b(A,k,""+Y,he);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return k=k.get(Y.key===null?z:Y.key)||null,M(A,k,Y,he);case T:return k=k.get(Y.key===null?z:Y.key)||null,_(A,k,Y,he);case I:return Y=Xl(Y),q(k,A,z,Y,he)}if(me(Y)||Z(Y))return k=k.get(z)||null,K(A,k,Y,he,null);if(typeof Y.then=="function")return q(k,A,z,to(Y),he);if(Y.$$typeof===Q)return q(k,A,z,Js(A,Y),he);no(A,Y)}return null}function oe(k,A,z,Y){for(var he=null,Ue=null,ce=A,Ne=A=0,Ee=null;ce!==null&&Ne<z.length;Ne++){ce.index>Ne?(Ee=ce,ce=null):Ee=ce.sibling;var Le=U(k,ce,z[Ne],Y);if(Le===null){ce===null&&(ce=Ee);break}e&&ce&&Le.alternate===null&&t(k,ce),A=d(Le,A,Ne),Ue===null?he=Le:Ue.sibling=Le,Ue=Le,ce=Ee}if(Ne===z.length)return a(k,ce),Re&&ba(k,Ne),he;if(ce===null){for(;Ne<z.length;Ne++)ce=X(k,z[Ne],Y),ce!==null&&(A=d(ce,A,Ne),Ue===null?he=ce:Ue.sibling=ce,Ue=ce);return Re&&ba(k,Ne),he}for(ce=r(ce);Ne<z.length;Ne++)Ee=q(ce,k,Ne,z[Ne],Y),Ee!==null&&(e&&Ee.alternate!==null&&ce.delete(Ee.key===null?Ne:Ee.key),A=d(Ee,A,Ne),Ue===null?he=Ee:Ue.sibling=Ee,Ue=Ee);return e&&ce.forEach(function(yl){return t(k,yl)}),Re&&ba(k,Ne),he}function ve(k,A,z,Y){if(z==null)throw Error(i(151));for(var he=null,Ue=null,ce=A,Ne=A=0,Ee=null,Le=z.next();ce!==null&&!Le.done;Ne++,Le=z.next()){ce.index>Ne?(Ee=ce,ce=null):Ee=ce.sibling;var yl=U(k,ce,Le.value,Y);if(yl===null){ce===null&&(ce=Ee);break}e&&ce&&yl.alternate===null&&t(k,ce),A=d(yl,A,Ne),Ue===null?he=yl:Ue.sibling=yl,Ue=yl,ce=Ee}if(Le.done)return a(k,ce),Re&&ba(k,Ne),he;if(ce===null){for(;!Le.done;Ne++,Le=z.next())Le=X(k,Le.value,Y),Le!==null&&(A=d(Le,A,Ne),Ue===null?he=Le:Ue.sibling=Le,Ue=Le);return Re&&ba(k,Ne),he}for(ce=r(ce);!Le.done;Ne++,Le=z.next())Le=q(ce,k,Ne,Le.value,Y),Le!==null&&(e&&Le.alternate!==null&&ce.delete(Le.key===null?Ne:Le.key),A=d(Le,A,Ne),Ue===null?he=Le:Ue.sibling=Le,Ue=Le);return e&&ce.forEach(function(H0){return t(k,H0)}),Re&&ba(k,Ne),he}function Ve(k,A,z,Y){if(typeof z=="object"&&z!==null&&z.type===E&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case w:e:{for(var he=z.key;A!==null;){if(A.key===he){if(he=z.type,he===E){if(A.tag===7){a(k,A.sibling),Y=c(A,z.props.children),Y.return=k,k=Y;break e}}else if(A.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===I&&Xl(he)===A.type){a(k,A.sibling),Y=c(A,z.props),Oi(Y,z),Y.return=k,k=Y;break e}a(k,A);break}else t(k,A);A=A.sibling}z.type===E?(Y=Pl(z.props.children,k.mode,Y,z.key),Y.return=k,k=Y):(Y=Xs(z.type,z.key,z.props,null,k.mode,Y),Oi(Y,z),Y.return=k,k=Y)}return m(k);case T:e:{for(he=z.key;A!==null;){if(A.key===he)if(A.tag===4&&A.stateNode.containerInfo===z.containerInfo&&A.stateNode.implementation===z.implementation){a(k,A.sibling),Y=c(A,z.children||[]),Y.return=k,k=Y;break e}else{a(k,A);break}else t(k,A);A=A.sibling}Y=Fc(z,k.mode,Y),Y.return=k,k=Y}return m(k);case I:return z=Xl(z),Ve(k,A,z,Y)}if(me(z))return oe(k,A,z,Y);if(Z(z)){if(he=Z(z),typeof he!="function")throw Error(i(150));return z=he.call(z),ve(k,A,z,Y)}if(typeof z.then=="function")return Ve(k,A,to(z),Y);if(z.$$typeof===Q)return Ve(k,A,Js(k,z),Y);no(k,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,A!==null&&A.tag===6?(a(k,A.sibling),Y=c(A,z),Y.return=k,k=Y):(a(k,A),Y=Xc(z,k.mode,Y),Y.return=k,k=Y),m(k)):a(k,A)}return function(k,A,z,Y){try{_i=0;var he=Ve(k,A,z,Y);return Ur=null,he}catch(ce){if(ce===Dr||ce===Ws)throw ce;var Ue=dn(29,ce,null,k.mode);return Ue.lanes=Y,Ue.return=k,Ue}finally{}}}var Zl=uh(!0),dh=uh(!1),al=!1;function su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ou(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 ll(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function rl(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(qe&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Vs(e),Xm(e,null,a),t}return Gs(e,r,t,a),Vs(e)}function Di(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Dn(e,a)}}function cu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var m={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=m:d=d.next=m,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var uu=!1;function Ui(){if(uu){var e=Or;if(e!==null)throw e}}function Li(e,t,a,r){uu=!1;var c=e.updateQueue;al=!1;var d=c.firstBaseUpdate,m=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var M=b,_=M.next;M.next=null,m===null?d=_:m.next=_,m=M;var K=e.alternate;K!==null&&(K=K.updateQueue,b=K.lastBaseUpdate,b!==m&&(b===null?K.firstBaseUpdate=_:b.next=_,K.lastBaseUpdate=M))}if(d!==null){var X=c.baseState;m=0,K=_=M=null,b=d;do{var U=b.lane&-536870913,q=U!==b.lane;if(q?(Ae&U)===U:(r&U)===U){U!==0&&U===_r&&(uu=!0),K!==null&&(K=K.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var oe=e,ve=b;U=t;var Ve=a;switch(ve.tag){case 1:if(oe=ve.payload,typeof oe=="function"){X=oe.call(Ve,X,U);break e}X=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=ve.payload,U=typeof oe=="function"?oe.call(Ve,X,U):oe,U==null)break e;X=g({},X,U);break e;case 2:al=!0}}U=b.callback,U!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[U]:q.push(U))}else q={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},K===null?(_=K=q,M=X):K=K.next=q,m|=U;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;q=b,b=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);K===null&&(M=X),c.baseState=M,c.firstBaseUpdate=_,c.lastBaseUpdate=K,d===null&&(c.shared.lanes=0),ul|=m,e.lanes=m,e.memoizedState=X}}function fh(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function mh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)fh(a[e],t)}var Lr=N(null),ao=N(0);function hh(e,t){e=ka,V(ao,e),V(Lr,t),ka=e|t.baseLanes}function du(){V(ao,ka),V(Lr,Lr.current)}function fu(){ka=ao.current,B(Lr),B(ao)}var fn=N(null),kn=null;function il(e){var t=e.alternate;V(dt,dt.current&1),V(fn,e),kn===null&&(t===null||Lr.current!==null||t.memoizedState!==null)&&(kn=e)}function mu(e){V(dt,dt.current),V(fn,e),kn===null&&(kn=e)}function ph(e){e.tag===22?(V(dt,dt.current),V(fn,e),kn===null&&(kn=e)):sl()}function sl(){V(dt,dt.current),V(fn,fn.current)}function mn(e){B(fn),kn===e&&(kn=null),B(dt)}var dt=N(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||bd(a)||yd(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ja=0,je=null,Ye=null,xt=null,ro=!1,Br=!1,Jl=!1,io=0,Bi=0,qr=null,zy=0;function it(){throw Error(i(321))}function hu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!un(e[a],t[a]))return!1;return!0}function pu(e,t,a,r,c,d){return ja=d,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Ih:ku,Jl=!1,d=a(r,c),Jl=!1,Br&&(d=xh(t,a,r,c)),vh(e),d}function vh(e){O.H=Qi;var t=Ye!==null&&Ye.next!==null;if(ja=0,xt=Ye=je=null,ro=!1,Bi=0,qr=null,t)throw Error(i(300));e===null||gt||(e=e.dependencies,e!==null&&Zs(e)&&(gt=!0))}function xh(e,t,a,r){je=e;var c=0;do{if(Br&&(qr=null),Bi=0,Br=!1,25<=c)throw Error(i(301));if(c+=1,xt=Ye=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}O.H=Wh,d=t(a,r)}while(Br);return d}function _y(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?qi(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(je.flags|=1024),t}function vu(){var e=io!==0;return io=0,e}function xu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function gu(e){if(ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ro=!1}ja=0,xt=Ye=je=null,Br=!1,Bi=io=0,qr=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?je.memoizedState=xt=e:xt=xt.next=e,xt}function ft(){if(Ye===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=xt===null?je.memoizedState:xt.next;if(t!==null)xt=t,Ye=e;else{if(e===null)throw je.alternate===null?Error(i(467)):Error(i(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},xt===null?je.memoizedState=xt=e:xt=xt.next=e}return xt}function so(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qi(e){var t=Bi;return Bi+=1,qr===null&&(qr=[]),e=sh(qr,e,t),t=je,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Ih:ku),e}function oo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return qi(e);if(e.$$typeof===Q)return Rt(e)}throw Error(i(438,String(e)))}function bu(e){var t=null,a=je.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=je.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=so(),je.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=te;return t.index++,a}function Na(e,t){return typeof t=="function"?t(e):t}function co(e){var t=ft();return yu(t,Ye,e)}function yu(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var m=c.next;c.next=d.next,d.next=m}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var b=m=null,M=null,_=t,K=!1;do{var X=_.lane&-536870913;if(X!==_.lane?(Ae&X)===X:(ja&X)===X){var U=_.revertLane;if(U===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),X===_r&&(K=!0);else if((ja&U)===U){_=_.next,U===_r&&(K=!0);continue}else X={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},M===null?(b=M=X,m=d):M=M.next=X,je.lanes|=U,ul|=U;X=_.action,Jl&&a(d,X),d=_.hasEagerState?_.eagerState:a(d,X)}else U={lane:X,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},M===null?(b=M=U,m=d):M=M.next=U,je.lanes|=X,ul|=X;_=_.next}while(_!==null&&_!==t);if(M===null?m=d:M.next=b,!un(d,e.memoizedState)&&(gt=!0,K&&(a=Or,a!==null)))throw a;e.memoizedState=d,e.baseState=m,e.baseQueue=M,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Su(e){var t=ft(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var m=c=c.next;do d=e(d,m.action),m=m.next;while(m!==c);un(d,t.memoizedState)||(gt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function gh(e,t,a){var r=je,c=ft(),d=Re;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var m=!un((Ye||c).memoizedState,a);if(m&&(c.memoizedState=a,gt=!0),c=c.queue,wu(Sh.bind(null,r,c,e),[e]),c.getSnapshot!==t||m||xt!==null&&xt.memoizedState.tag&1){if(r.flags|=2048,$r(9,{destroy:void 0},yh.bind(null,r,c,a,t),null),Fe===null)throw Error(i(349));d||(ja&127)!==0||bh(r,t,a)}return a}function bh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=je.updateQueue,t===null?(t=so(),je.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function yh(e,t,a,r){t.value=a,t.getSnapshot=r,jh(t)&&Nh(e)}function Sh(e,t,a){return a(function(){jh(t)&&Nh(e)})}function jh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!un(e,a)}catch{return!0}}function Nh(e){var t=Hl(e,2);t!==null&&It(t,e,2)}function ju(e){var t=Qt();if(typeof e=="function"){var a=e;if(e=a(),Jl){$t(!0);try{a()}finally{$t(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:e},t}function wh(e,t,a,r){return e.baseState=a,yu(e,Ye,typeof r=="function"?r:Na)}function Oy(e,t,a,r,c){if(mo(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){d.listeners.push(m)}};O.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Mh(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Mh(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=O.T,m={};O.T=m;try{var b=a(c,r),M=O.S;M!==null&&M(m,b),Ch(e,t,b)}catch(_){Nu(e,t,_)}finally{d!==null&&m.types!==null&&(d.types=m.types),O.T=d}}else try{d=a(c,r),Ch(e,t,d)}catch(_){Nu(e,t,_)}}function Ch(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Th(e,t,r)},function(r){return Nu(e,t,r)}):Th(e,t,a)}function Th(e,t,a){t.status="fulfilled",t.value=a,Ah(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Mh(e,a)))}function Nu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Ah(t),t=t.next;while(t!==r)}e.action=null}function Ah(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Eh(e,t){return t}function kh(e,t){if(Re){var a=Fe.formState;if(a!==null){e:{var r=je;if(Re){if(Je){t:{for(var c=Je,d=En;c.nodeType!==8;){if(!d){c=null;break t}if(c=Rn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Je=Rn(c.nextSibling),r=c.data==="F!";break e}}tl(r)}r=!1}r&&(t=a[0])}}return a=Qt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eh,lastRenderedState:t},a.queue=r,a=Fh.bind(null,je,r),r.dispatch=a,r=ju(!1),d=Eu.bind(null,je,!1,r.queue),r=Qt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=Oy.bind(null,je,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Rh(e){var t=ft();return zh(t,Ye,e)}function zh(e,t,a){if(t=yu(e,t,Eh)[0],e=co(Na)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=qi(t)}catch(m){throw m===Dr?Ws:m}else r=t;t=ft();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(je.flags|=2048,$r(9,{destroy:void 0},Dy.bind(null,c,a),null)),[r,d,e]}function Dy(e,t){e.action=t}function _h(e){var t=ft(),a=Ye;if(a!==null)return zh(t,a,e);ft(),t=t.memoizedState,a=ft();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function $r(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=je.updateQueue,t===null&&(t=so(),je.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Oh(){return ft().memoizedState}function uo(e,t,a,r){var c=Qt();je.flags|=e,c.memoizedState=$r(1|t,{destroy:void 0},a,r===void 0?null:r)}function fo(e,t,a,r){var c=ft();r=r===void 0?null:r;var d=c.memoizedState.inst;Ye!==null&&r!==null&&hu(r,Ye.memoizedState.deps)?c.memoizedState=$r(t,d,a,r):(je.flags|=e,c.memoizedState=$r(1|t,d,a,r))}function Dh(e,t){uo(8390656,8,e,t)}function wu(e,t){fo(2048,8,e,t)}function Uy(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=so(),je.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Uh(e){var t=ft().memoizedState;return Uy({ref:t,nextImpl:e}),function(){if((qe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Lh(e,t){return fo(4,2,e,t)}function Bh(e,t){return fo(4,4,e,t)}function qh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $h(e,t,a){a=a!=null?a.concat([e]):null,fo(4,4,qh.bind(null,t,e),a)}function Mu(){}function Qh(e,t){var a=ft();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&hu(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Hh(e,t){var a=ft();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&hu(t,r[1]))return r[0];if(r=e(),Jl){$t(!0);try{e()}finally{$t(!1)}}return a.memoizedState=[r,t],r}function Cu(e,t,a){return a===void 0||(ja&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Pp(),je.lanes|=e,ul|=e,a)}function Ph(e,t,a,r){return un(a,t)?a:Lr.current!==null?(e=Cu(e,a,r),un(e,t)||(gt=!0),e):(ja&42)===0||(ja&1073741824)!==0&&(Ae&261930)===0?(gt=!0,e.memoizedState=a):(e=Pp(),je.lanes|=e,ul|=e,t)}function Kh(e,t,a,r,c){var d=ee.p;ee.p=d!==0&&8>d?d:8;var m=O.T,b={};O.T=b,Eu(e,!1,t,a);try{var M=c(),_=O.S;if(_!==null&&_(b,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var K=Ry(M,r);$i(e,t,K,vn(e))}else $i(e,t,r,vn(e))}catch(X){$i(e,t,{then:function(){},status:"rejected",reason:X},vn())}finally{ee.p=d,m!==null&&b.types!==null&&(m.types=b.types),O.T=m}}function Ly(){}function Tu(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=Yh(e).queue;Kh(e,c,t,re,a===null?Ly:function(){return Gh(e),a(r)})}function Yh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:re},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gh(e){var t=Yh(e);t.next===null&&(t=e.alternate.memoizedState),$i(e,t.next.queue,{},vn())}function Au(){return Rt(as)}function Vh(){return ft().memoizedState}function Xh(){return ft().memoizedState}function By(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=vn();e=ll(a);var r=rl(t,e,a);r!==null&&(It(r,t,a),Di(r,t,a)),t={cache:au()},e.payload=t;return}t=t.return}}function qy(e,t,a){var r=vn();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mo(e)?Zh(t,a):(a=Gc(e,t,a,r),a!==null&&(It(a,e,r),Jh(a,t,r)))}function Fh(e,t,a){var r=vn();$i(e,t,a,r)}function $i(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(mo(e))Zh(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var m=t.lastRenderedState,b=d(m,a);if(c.hasEagerState=!0,c.eagerState=b,un(b,m))return Gs(e,t,c,0),Fe===null&&Ys(),!1}catch{}finally{}if(a=Gc(e,t,c,r),a!==null)return It(a,e,r),Jh(a,t,r),!0}return!1}function Eu(e,t,a,r){if(r={lane:2,revertLane:sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mo(e)){if(t)throw Error(i(479))}else t=Gc(e,a,r,2),t!==null&&It(t,e,2)}function mo(e){var t=e.alternate;return e===je||t!==null&&t===je}function Zh(e,t){Br=ro=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Jh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Dn(e,a)}}var Qi={readContext:Rt,use:oo,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};Qi.useEffectEvent=it;var Ih={readContext:Rt,use:oo,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Dh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,uo(4194308,4,qh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return uo(4194308,4,e,t)},useInsertionEffect:function(e,t){uo(4,2,e,t)},useMemo:function(e,t){var a=Qt();t=t===void 0?null:t;var r=e();if(Jl){$t(!0);try{e()}finally{$t(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Qt();if(a!==void 0){var c=a(t);if(Jl){$t(!0);try{a(t)}finally{$t(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=qy.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=ju(e);var t=e.queue,a=Fh.bind(null,je,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Mu,useDeferredValue:function(e,t){var a=Qt();return Cu(a,e,t)},useTransition:function(){var e=ju(!1);return e=Kh.bind(null,je,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=je,c=Qt();if(Re){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),Fe===null)throw Error(i(349));(Ae&127)!==0||bh(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Dh(Sh.bind(null,r,d,e),[e]),r.flags|=2048,$r(9,{destroy:void 0},yh.bind(null,r,d,a,t),null),a},useId:function(){var e=Qt(),t=Fe.identifierPrefix;if(Re){var a=Vn,r=Gn;a=(r&~(1<<32-pt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=io++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=zy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Au,useFormState:kh,useActionState:kh,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Eu.bind(null,je,!0,a),a.dispatch=t,[e,t]},useMemoCache:bu,useCacheRefresh:function(){return Qt().memoizedState=By.bind(null,je)},useEffectEvent:function(e){var t=Qt(),a={impl:e};return t.memoizedState=a,function(){if((qe&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},ku={readContext:Rt,use:oo,useCallback:Qh,useContext:Rt,useEffect:wu,useImperativeHandle:$h,useInsertionEffect:Lh,useLayoutEffect:Bh,useMemo:Hh,useReducer:co,useRef:Oh,useState:function(){return co(Na)},useDebugValue:Mu,useDeferredValue:function(e,t){var a=ft();return Ph(a,Ye.memoizedState,e,t)},useTransition:function(){var e=co(Na)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:qi(e),t]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:Au,useFormState:Rh,useActionState:Rh,useOptimistic:function(e,t){var a=ft();return wh(a,Ye,e,t)},useMemoCache:bu,useCacheRefresh:Xh};ku.useEffectEvent=Uh;var Wh={readContext:Rt,use:oo,useCallback:Qh,useContext:Rt,useEffect:wu,useImperativeHandle:$h,useInsertionEffect:Lh,useLayoutEffect:Bh,useMemo:Hh,useReducer:Su,useRef:Oh,useState:function(){return Su(Na)},useDebugValue:Mu,useDeferredValue:function(e,t){var a=ft();return Ye===null?Cu(a,e,t):Ph(a,Ye.memoizedState,e,t)},useTransition:function(){var e=Su(Na)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:qi(e),t]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:Au,useFormState:_h,useActionState:_h,useOptimistic:function(e,t){var a=ft();return Ye!==null?wh(a,Ye,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:bu,useCacheRefresh:Xh};Wh.useEffectEvent=Uh;function Ru(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:g({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var zu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=vn(),c=ll(r);c.payload=t,a!=null&&(c.callback=a),t=rl(e,c,r),t!==null&&(It(t,e,r),Di(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=vn(),c=ll(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=rl(e,c,r),t!==null&&(It(t,e,r),Di(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=vn(),r=ll(a);r.tag=2,t!=null&&(r.callback=t),t=rl(e,r,a),t!==null&&(It(t,e,a),Di(t,e,a))}};function ep(e,t,a,r,c,d,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,m):t.prototype&&t.prototype.isPureReactComponent?!Ti(a,r)||!Ti(c,d):!0}function tp(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function Il(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=g({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function np(e){Ks(e)}function ap(e){console.error(e)}function lp(e){Ks(e)}function ho(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function rp(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function _u(e,t,a){return a=ll(a),a.tag=3,a.payload={element:null},a.callback=function(){ho(e,t)},a}function ip(e){return e=ll(e),e.tag=3,e}function sp(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){rp(t,a,r)}}var m=a.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){rp(t,a,r),typeof c!="function"&&(dl===null?dl=new Set([this]):dl.add(this));var b=r.stack;this.componentDidCatch(r.value,{componentStack:b!==null?b:""})})}function $y(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&zr(t,a,c,!0),a=fn.current,a!==null){switch(a.tag){case 31:case 13:return kn===null?Co():a.alternate===null&&st===0&&(st=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===eo?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),ld(e,r,c)),!1;case 22:return a.flags|=65536,r===eo?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),ld(e,r,c)),!1}throw Error(i(435,a.tag))}return ld(e,r,c),Co(),!1}if(Re)return t=fn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Ic&&(e=Error(i(422),{cause:r}),ki(Cn(e,a)))):(r!==Ic&&(t=Error(i(423),{cause:r}),ki(Cn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Cn(r,a),c=_u(e.stateNode,r,c),cu(e,c),st!==4&&(st=2)),!1;var d=Error(i(520),{cause:r});if(d=Cn(d,a),Fi===null?Fi=[d]:Fi.push(d),st!==4&&(st=2),t===null)return!0;r=Cn(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=_u(a.stateNode,r,e),cu(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(dl===null||!dl.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=ip(c),sp(c,e,a,r),cu(a,c),!1}a=a.return}while(a!==null);return!1}var Ou=Error(i(461)),gt=!1;function zt(e,t,a,r){t.child=e===null?dh(t,null,a,r):Zl(t,e.child,a,r)}function op(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var m={};for(var b in r)b!=="ref"&&(m[b]=r[b])}else m=r;return Gl(t),r=pu(e,t,a,m,d,c),b=vu(),e!==null&&!gt?(xu(e,t,c),wa(e,t,c)):(Re&&b&&Zc(t),t.flags|=1,zt(e,t,r,c),t.child)}function cp(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Vc(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,up(e,t,d,r,c)):(e=Xs(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Hu(e,c)){var m=d.memoizedProps;if(a=a.compare,a=a!==null?a:Ti,a(m,r)&&e.ref===t.ref)return wa(e,t,c)}return t.flags|=1,e=ga(d,r),e.ref=t.ref,e.return=t,t.child=e}function up(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Ti(d,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=d,Hu(e,c))(e.flags&131072)!==0&&(gt=!0);else return t.lanes=e.lanes,wa(e,t,c)}return Du(e,t,a,r,c)}function dp(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return fp(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Is(t,d!==null?d.cachePool:null),d!==null?hh(t,d):du(),ph(t);else return r=t.lanes=536870912,fp(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(Is(t,d.cachePool),hh(t,d),sl(),t.memoizedState=null):(e!==null&&Is(t,null),du(),sl());return zt(e,t,c,a),t.child}function Hi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fp(e,t,a,r,c){var d=ru();return d=d===null?null:{parent:vt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&Is(t,null),du(),ph(t),e!==null&&zr(e,t,r,!0),t.childLanes=c,null}function po(e,t){return t=xo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mp(e,t,a){return Zl(t,e.child,null,a),e=po(t,t.pendingProps),e.flags|=2,mn(t),t.memoizedState=null,e}function Qy(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(r.mode==="hidden")return e=po(t,r),t.lanes=536870912,Hi(null,e);if(mu(t),(e=Je)?(e=Mv(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=Zm(e),a.return=t,t.child=a,kt=t,Je=null)):e=null,e===null)throw tl(t);return t.lanes=536870912,null}return po(t,r)}var d=e.memoizedState;if(d!==null){var m=d.dehydrated;if(mu(t),c)if(t.flags&256)t.flags&=-257,t=mp(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(gt||zr(e,t,a,!1),c=(a&e.childLanes)!==0,gt||c){if(r=Fe,r!==null&&(m=Xa(r,a),m!==0&&m!==d.retryLane))throw d.retryLane=m,Hl(e,m),It(r,e,m),Ou;Co(),t=mp(e,t,a)}else e=d.treeContext,Je=Rn(m.nextSibling),kt=t,Re=!0,el=null,En=!1,e!==null&&Wm(t,e),t=po(t,r),t.flags|=4096;return t}return e=ga(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vo(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Du(e,t,a,r,c){return Gl(t),a=pu(e,t,a,r,void 0,c),r=vu(),e!==null&&!gt?(xu(e,t,c),wa(e,t,c)):(Re&&r&&Zc(t),t.flags|=1,zt(e,t,a,c),t.child)}function hp(e,t,a,r,c,d){return Gl(t),t.updateQueue=null,a=xh(t,r,a,c),vh(e),r=vu(),e!==null&&!gt?(xu(e,t,d),wa(e,t,d)):(Re&&r&&Zc(t),t.flags|=1,zt(e,t,a,d),t.child)}function pp(e,t,a,r,c){if(Gl(t),t.stateNode===null){var d=Ar,m=a.contextType;typeof m=="object"&&m!==null&&(d=Rt(m)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=zu,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},su(t),m=a.contextType,d.context=typeof m=="object"&&m!==null?Rt(m):Ar,d.state=t.memoizedState,m=a.getDerivedStateFromProps,typeof m=="function"&&(Ru(t,a,m,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(m=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),m!==d.state&&zu.enqueueReplaceState(d,d.state,null),Li(t,r,d,c),Ui(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var b=t.memoizedProps,M=Il(a,b);d.props=M;var _=d.context,K=a.contextType;m=Ar,typeof K=="object"&&K!==null&&(m=Rt(K));var X=a.getDerivedStateFromProps;K=typeof X=="function"||typeof d.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b||_!==m)&&tp(t,d,r,m),al=!1;var U=t.memoizedState;d.state=U,Li(t,r,d,c),Ui(),_=t.memoizedState,b||U!==_||al?(typeof X=="function"&&(Ru(t,a,X,r),_=t.memoizedState),(M=al||ep(t,a,M,r,U,_,m))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=_),d.props=r,d.state=_,d.context=m,r=M):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,ou(e,t),m=t.memoizedProps,K=Il(a,m),d.props=K,X=t.pendingProps,U=d.context,_=a.contextType,M=Ar,typeof _=="object"&&_!==null&&(M=Rt(_)),b=a.getDerivedStateFromProps,(_=typeof b=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(m!==X||U!==M)&&tp(t,d,r,M),al=!1,U=t.memoizedState,d.state=U,Li(t,r,d,c),Ui();var q=t.memoizedState;m!==X||U!==q||al||e!==null&&e.dependencies!==null&&Zs(e.dependencies)?(typeof b=="function"&&(Ru(t,a,b,r),q=t.memoizedState),(K=al||ep(t,a,K,r,U,q,M)||e!==null&&e.dependencies!==null&&Zs(e.dependencies))?(_||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,q,M),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,q,M)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||m===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),d.props=r,d.state=q,d.context=M,r=K):(typeof d.componentDidUpdate!="function"||m===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,vo(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=Zl(t,e.child,null,c),t.child=Zl(t,null,a,c)):zt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=wa(e,t,c),e}function vp(e,t,a,r){return Kl(),t.flags|=256,zt(e,t,a,r),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lu(e){return{baseLanes:e,cachePool:rh()}}function Bu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=pn),e}function xp(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,m;if((m=d)||(m=e!==null&&e.memoizedState===null?!1:(dt.current&2)!==0),m&&(c=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(c?il(t):sl(),(e=Je)?(e=Mv(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=Zm(e),a.return=t,t.child=a,kt=t,Je=null)):e=null,e===null)throw tl(t);return yd(e)?t.lanes=32:t.lanes=536870912,null}var b=r.children;return r=r.fallback,c?(sl(),c=t.mode,b=xo({mode:"hidden",children:b},c),r=Pl(r,c,a,null),b.return=t,r.return=t,b.sibling=r,t.child=b,r=t.child,r.memoizedState=Lu(a),r.childLanes=Bu(e,m,a),t.memoizedState=Uu,Hi(null,r)):(il(t),qu(t,b))}var M=e.memoizedState;if(M!==null&&(b=M.dehydrated,b!==null)){if(d)t.flags&256?(il(t),t.flags&=-257,t=$u(e,t,a)):t.memoizedState!==null?(sl(),t.child=e.child,t.flags|=128,t=null):(sl(),b=r.fallback,c=t.mode,r=xo({mode:"visible",children:r.children},c),b=Pl(b,c,a,null),b.flags|=2,r.return=t,b.return=t,r.sibling=b,t.child=r,Zl(t,e.child,null,a),r=t.child,r.memoizedState=Lu(a),r.childLanes=Bu(e,m,a),t.memoizedState=Uu,t=Hi(null,r));else if(il(t),yd(b)){if(m=b.nextSibling&&b.nextSibling.dataset,m)var _=m.dgst;m=_,r=Error(i(419)),r.stack="",r.digest=m,ki({value:r,source:null,stack:null}),t=$u(e,t,a)}else if(gt||zr(e,t,a,!1),m=(a&e.childLanes)!==0,gt||m){if(m=Fe,m!==null&&(r=Xa(m,a),r!==0&&r!==M.retryLane))throw M.retryLane=r,Hl(e,r),It(m,e,r),Ou;bd(b)||Co(),t=$u(e,t,a)}else bd(b)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Je=Rn(b.nextSibling),kt=t,Re=!0,el=null,En=!1,e!==null&&Wm(t,e),t=qu(t,r.children),t.flags|=4096);return t}return c?(sl(),b=r.fallback,c=t.mode,M=e.child,_=M.sibling,r=ga(M,{mode:"hidden",children:r.children}),r.subtreeFlags=M.subtreeFlags&65011712,_!==null?b=ga(_,b):(b=Pl(b,c,a,null),b.flags|=2),b.return=t,r.return=t,r.sibling=b,t.child=r,Hi(null,r),r=t.child,b=e.child.memoizedState,b===null?b=Lu(a):(c=b.cachePool,c!==null?(M=vt._currentValue,c=c.parent!==M?{parent:M,pool:M}:c):c=rh(),b={baseLanes:b.baseLanes|a,cachePool:c}),r.memoizedState=b,r.childLanes=Bu(e,m,a),t.memoizedState=Uu,Hi(e.child,r)):(il(t),a=e.child,e=a.sibling,a=ga(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=a,t.memoizedState=null,a)}function qu(e,t){return t=xo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xo(e,t){return e=dn(22,e,null,t),e.lanes=0,e}function $u(e,t,a){return Zl(t,e.child,null,a),e=qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gp(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tu(e.return,t,a)}function Qu(e,t,a,r,c,d){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=r,m.tail=a,m.tailMode=c,m.treeForkCount=d)}function bp(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var m=dt.current,b=(m&2)!==0;if(b?(m=m&1|2,t.flags|=128):m&=1,V(dt,m),zt(e,t,r,a),r=Re?Ei:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gp(e,a,t);else if(e.tag===19)gp(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&lo(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Qu(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&lo(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Qu(t,!0,a,null,d,r);break;case"together":Qu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ul|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(zr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=ga(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ga(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Hu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zs(e)))}function Hy(e,t,a){switch(t.tag){case 3:Xe(t,t.stateNode.containerInfo),nl(t,vt,e.memoizedState.cache),Kl();break;case 27:case 5:Mt(t);break;case 4:Xe(t,t.stateNode.containerInfo);break;case 10:nl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(il(t),t.flags|=128,null):(a&t.child.childLanes)!==0?xp(e,t,a):(il(t),e=wa(e,t,a),e!==null?e.sibling:null);il(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(zr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return bp(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(dt,dt.current),r)break;return null;case 22:return t.lanes=0,dp(e,t,a,t.pendingProps);case 24:nl(t,vt,e.memoizedState.cache)}return wa(e,t,a)}function yp(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)gt=!0;else{if(!Hu(e,a)&&(t.flags&128)===0)return gt=!1,Hy(e,t,a);gt=(e.flags&131072)!==0}else gt=!1,Re&&(t.flags&1048576)!==0&&Im(t,Ei,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Xl(t.elementType),t.type=e,typeof e=="function")Vc(e)?(r=Il(e,r),t.tag=1,t=pp(null,t,e,r,a)):(t.tag=0,t=Du(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===P){t.tag=11,t=op(null,t,e,r,a);break e}else if(c===$){t.tag=14,t=cp(null,t,e,r,a);break e}}throw t=xe(e)||e,Error(i(306,t,""))}}return t;case 0:return Du(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=Il(r,t.pendingProps),pp(e,t,r,c,a);case 3:e:{if(Xe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,ou(e,t),Li(t,r,null,a);var m=t.memoizedState;if(r=m.cache,nl(t,vt,r),r!==d.cache&&nu(t,[vt],a,!0),Ui(),r=m.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=vp(e,t,r,a);break e}else if(r!==c){c=Cn(Error(i(424)),t),ki(c),t=vp(e,t,r,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Je=Rn(e.firstChild),kt=t,Re=!0,el=null,En=!0,a=dh(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Kl(),r===c){t=wa(e,t,a);break e}zt(e,t,r,a)}t=t.child}return t;case 26:return vo(e,t),e===null?(a=Rv(t.type,null,t.pendingProps,null))?t.memoizedState=a:Re||(a=t.type,e=t.pendingProps,r=_o(pe.current).createElement(a),r[$e]=t,r[nt]=e,_t(r,a,e),Ct(r),t.stateNode=r):t.memoizedState=Rv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Mt(t),e===null&&Re&&(r=t.stateNode=Av(t.type,t.pendingProps,pe.current),kt=t,En=!0,c=Je,pl(t.type)?(Sd=c,Je=Rn(r.firstChild)):Je=c),zt(e,t,t.pendingProps.children,a),vo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((c=r=Je)&&(r=g0(r,t.type,t.pendingProps,En),r!==null?(t.stateNode=r,kt=t,Je=Rn(r.firstChild),En=!1,c=!0):c=!1),c||tl(t)),Mt(t),c=t.type,d=t.pendingProps,m=e!==null?e.memoizedProps:null,r=d.children,vd(c,d)?r=null:m!==null&&vd(c,m)&&(t.flags|=32),t.memoizedState!==null&&(c=pu(e,t,_y,null,null,a),as._currentValue=c),vo(e,t),zt(e,t,r,a),t.child;case 6:return e===null&&Re&&((e=a=Je)&&(a=b0(a,t.pendingProps,En),a!==null?(t.stateNode=a,kt=t,Je=null,e=!0):e=!1),e||tl(t)),null;case 13:return xp(e,t,a);case 4:return Xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zl(t,null,r,a):zt(e,t,r,a),t.child;case 11:return op(e,t,t.type,t.pendingProps,a);case 7:return zt(e,t,t.pendingProps,a),t.child;case 8:return zt(e,t,t.pendingProps.children,a),t.child;case 12:return zt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,nl(t,t.type,r.value),zt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Gl(t),c=Rt(c),r=r(c),t.flags|=1,zt(e,t,r,a),t.child;case 14:return cp(e,t,t.type,t.pendingProps,a);case 15:return up(e,t,t.type,t.pendingProps,a);case 19:return bp(e,t,a);case 31:return Qy(e,t,a);case 22:return dp(e,t,a,t.pendingProps);case 24:return Gl(t),r=Rt(vt),e===null?(c=ru(),c===null&&(c=Fe,d=au(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},su(t),nl(t,vt,c)):((e.lanes&a)!==0&&(ou(e,t),Li(t,null,null,a),Ui()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),nl(t,vt,r)):(r=d.cache,nl(t,vt,r),r!==c.cache&&nu(t,[vt],a,!0))),zt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ma(e){e.flags|=4}function Pu(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Vp())e.flags|=8192;else throw Fl=eo,iu}else e.flags&=-16777217}function Sp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uv(t))if(Vp())e.flags|=8192;else throw Fl=eo,iu}function go(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ul():536870912,e.lanes|=t,Kr|=t)}function Pi(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Py(e,t,a){var r=t.pendingProps;switch(Jc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return Ie(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(vt),Oe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Rr(t)?Ma(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wc())),Ie(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Ma(t),d!==null?(Ie(t),Sp(t,d)):(Ie(t),Pu(t,c,null,r,a))):d?d!==e.memoizedState?(Ma(t),Ie(t),Sp(t,d)):(Ie(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ma(t),Ie(t),Pu(t,c,e,r,a)),null;case 27:if(mt(t),a=pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ma(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ie(t),null}e=le.current,Rr(t)?eh(t):(e=Av(c,r,a),t.stateNode=e,Ma(t))}return Ie(t),null;case 5:if(mt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ma(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ie(t),null}if(d=le.current,Rr(t))eh(t);else{var m=_o(pe.current);switch(d){case 1:d=m.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=m.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=m.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?m.createElement("select",{is:r.is}):m.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?m.createElement(c,{is:r.is}):m.createElement(c)}}d[$e]=t,d[nt]=r;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)d.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=d;e:switch(_t(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ma(t)}}return Ie(t),Pu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ma(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Rr(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=kt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[$e]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||xv(e.nodeValue,a)),e||tl(t,!0)}else e=_o(e).createTextNode(r),e[$e]=t,t.stateNode=e}return Ie(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Rr(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[$e]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),e=!1}else a=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(mn(t),t):(mn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return Ie(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Rr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[$e]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),c=!1}else c=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(mn(t),t):(mn(t),null)}return mn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),go(t,t.updateQueue),Ie(t),null);case 4:return Oe(),e===null&&dd(t.stateNode.containerInfo),Ie(t),null;case 10:return Sa(t.type),Ie(t),null;case 19:if(B(dt),r=t.memoizedState,r===null)return Ie(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)Pi(r,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=lo(e),d!==null){for(t.flags|=128,Pi(r,!1),e=d.updateQueue,t.updateQueue=e,go(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Fm(a,e),a=a.sibling;return V(dt,dt.current&1|2),Re&&ba(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&rt()>No&&(t.flags|=128,c=!0,Pi(r,!1),t.lanes=4194304)}else{if(!c)if(e=lo(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,go(t,e),Pi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Re)return Ie(t),null}else 2*rt()-r.renderingStartTime>No&&a!==536870912&&(t.flags|=128,c=!0,Pi(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=rt(),e.sibling=null,a=dt.current,V(dt,c?a&1|2:a&1),Re&&ba(t,r.treeForkCount),e):(Ie(t),null);case 22:case 23:return mn(t),fu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),a=t.updateQueue,a!==null&&go(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&B(Vl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Sa(vt),Ie(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ky(e,t){switch(Jc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(vt),Oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return mt(t),null;case 31:if(t.memoizedState!==null){if(mn(t),t.alternate===null)throw Error(i(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(dt),null;case 4:return Oe(),null;case 10:return Sa(t.type),null;case 22:case 23:return mn(t),fu(),e!==null&&B(Vl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(vt),null;case 25:return null;default:return null}}function jp(e,t){switch(Jc(t),t.tag){case 3:Sa(vt),Oe();break;case 26:case 27:case 5:mt(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&mn(t);break;case 13:mn(t);break;case 19:B(dt);break;case 10:Sa(t.type);break;case 22:case 23:mn(t),fu(),e!==null&&B(Vl);break;case 24:Sa(vt)}}function Ki(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,m=a.inst;r=d(),m.destroy=r}a=a.next}while(a!==c)}}catch(b){Ke(t,t.return,b)}}function ol(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var m=r.inst,b=m.destroy;if(b!==void 0){m.destroy=void 0,c=t;var M=a,_=b;try{_()}catch(K){Ke(c,M,K)}}}r=r.next}while(r!==d)}}catch(K){Ke(t,t.return,K)}}function Np(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{mh(t,a)}catch(r){Ke(e,e.return,r)}}}function wp(e,t,a){a.props=Il(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Ke(e,t,r)}}function Yi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){Ke(e,t,c)}}function Xn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){Ke(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ke(e,t,c)}else a.current=null}function Mp(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){Ke(e,e.return,c)}}function Ku(e,t,a){try{var r=e.stateNode;f0(r,e.type,a,t),r[nt]=t}catch(c){Ke(e,e.return,c)}}function Cp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pl(e.type)||e.tag===4}function Yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cp(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&&pl(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 Gu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=va));else if(r!==4&&(r===27&&pl(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Gu(e,t,a),e=e.sibling;e!==null;)Gu(e,t,a),e=e.sibling}function bo(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&pl(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(bo(e,t,a),e=e.sibling;e!==null;)bo(e,t,a),e=e.sibling}function Tp(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);_t(t,r,a),t[$e]=e,t[nt]=a}catch(d){Ke(e,e.return,d)}}var Ca=!1,bt=!1,Vu=!1,Ap=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Yy(e,t){if(e=e.containerInfo,hd=$o,e=$m(e),$c(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var m=0,b=-1,M=-1,_=0,K=0,X=e,U=null;t:for(;;){for(var q;X!==a||c!==0&&X.nodeType!==3||(b=m+c),X!==d||r!==0&&X.nodeType!==3||(M=m+r),X.nodeType===3&&(m+=X.nodeValue.length),(q=X.firstChild)!==null;)U=X,X=q;for(;;){if(X===e)break t;if(U===a&&++_===c&&(b=m),U===d&&++K===r&&(M=m),(q=X.nextSibling)!==null)break;X=U,U=X.parentNode}X=q}a=b===-1||M===-1?null:{start:b,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(pd={focusedElem:e,selectionRange:a},$o=!1,Tt=t;Tt!==null;)if(t=Tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Tt=e;else for(;Tt!==null;){switch(t=Tt,d=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(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,r=a.stateNode;try{var oe=Il(a.type,c);e=r.getSnapshotBeforeUpdate(oe,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ke(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)gd(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":gd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Tt=e;break}Tt=t.return}}function Ep(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Aa(e,a),r&4&&Ki(5,a);break;case 1:if(Aa(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(m){Ke(a,a.return,m)}else{var c=Il(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ke(a,a.return,m)}}r&64&&Np(a),r&512&&Yi(a,a.return);break;case 3:if(Aa(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{mh(e,t)}catch(m){Ke(a,a.return,m)}}break;case 27:t===null&&r&4&&Tp(a);case 26:case 5:Aa(e,a),t===null&&r&4&&Mp(a),r&512&&Yi(a,a.return);break;case 12:Aa(e,a);break;case 31:Aa(e,a),r&4&&zp(e,a);break;case 13:Aa(e,a),r&4&&_p(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=e0.bind(null,a),y0(e,a))));break;case 22:if(r=a.memoizedState!==null||Ca,!r){t=t!==null&&t.memoizedState!==null||bt,c=Ca;var d=bt;Ca=r,(bt=t)&&!d?Ea(e,a,(a.subtreeFlags&8772)!==0):Aa(e,a),Ca=c,bt=d}break;case 30:break;default:Aa(e,a)}}function kp(e){var t=e.alternate;t!==null&&(e.alternate=null,kp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ja(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Xt=!1;function Ta(e,t,a){for(a=a.child;a!==null;)Rp(e,t,a),a=a.sibling}function Rp(e,t,a){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(on,a)}catch{}switch(a.tag){case 26:bt||Xn(a,t),Ta(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:bt||Xn(a,t);var r=et,c=Xt;pl(a.type)&&(et=a.stateNode,Xt=!1),Ta(e,t,a),es(a.stateNode),et=r,Xt=c;break;case 5:bt||Xn(a,t);case 6:if(r=et,c=Xt,et=null,Ta(e,t,a),et=r,Xt=c,et!==null)if(Xt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(d){Ke(a,t,d)}else try{et.removeChild(a.stateNode)}catch(d){Ke(a,t,d)}break;case 18:et!==null&&(Xt?(e=et,Nv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ir(e)):Nv(et,a.stateNode));break;case 4:r=et,c=Xt,et=a.stateNode.containerInfo,Xt=!0,Ta(e,t,a),et=r,Xt=c;break;case 0:case 11:case 14:case 15:ol(2,a,t),bt||ol(4,a,t),Ta(e,t,a);break;case 1:bt||(Xn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&wp(a,t,r)),Ta(e,t,a);break;case 21:Ta(e,t,a);break;case 22:bt=(r=bt)||a.memoizedState!==null,Ta(e,t,a),bt=r;break;default:Ta(e,t,a)}}function zp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ir(e)}catch(a){Ke(t,t.return,a)}}}function _p(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ir(e)}catch(a){Ke(t,t.return,a)}}function Gy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ap),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ap),t;default:throw Error(i(435,e.tag))}}function yo(e,t){var a=Gy(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=t0.bind(null,e,r);r.then(c,c)}})}function Ft(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,m=t,b=m;e:for(;b!==null;){switch(b.tag){case 27:if(pl(b.type)){et=b.stateNode,Xt=!1;break e}break;case 5:et=b.stateNode,Xt=!1;break e;case 3:case 4:et=b.stateNode.containerInfo,Xt=!0;break e}b=b.return}if(et===null)throw Error(i(160));Rp(d,m,c),et=null,Xt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Op(t,e),t=t.sibling}var Ln=null;function Op(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),Zt(e),r&4&&(ol(3,e,e.return),Ki(3,e),ol(5,e,e.return));break;case 1:Ft(t,e),Zt(e),r&512&&(bt||a===null||Xn(a,a.return)),r&64&&Ca&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Ln;if(Ft(t,e),Zt(e),r&512&&(bt||a===null||Xn(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[at]||d[$e]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),_t(d,r,a),d[$e]=e,Ct(d),r=d;break e;case"link":var m=Ov("link","href",c).get(r+(a.href||""));if(m){for(var b=0;b<m.length;b++)if(d=m[b],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){m.splice(b,1);break t}}d=c.createElement(r),_t(d,r,a),c.head.appendChild(d);break;case"meta":if(m=Ov("meta","content",c).get(r+(a.content||""))){for(b=0;b<m.length;b++)if(d=m[b],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){m.splice(b,1);break t}}d=c.createElement(r),_t(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[$e]=e,Ct(d),r=d}e.stateNode=r}else Dv(c,e.type,e.stateNode);else e.stateNode=_v(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?Dv(c,e.type,e.stateNode):_v(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Ku(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ft(t,e),Zt(e),r&512&&(bt||a===null||Xn(a,a.return)),a!==null&&r&4&&Ku(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ft(t,e),Zt(e),r&512&&(bt||a===null||Xn(a,a.return)),e.flags&32){c=e.stateNode;try{Sr(c,"")}catch(oe){Ke(e,e.return,oe)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Ku(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Vu=!0);break;case 6:if(Ft(t,e),Zt(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(oe){Ke(e,e.return,oe)}}break;case 3:if(Uo=null,c=Ln,Ln=Oo(t.containerInfo),Ft(t,e),Ln=c,Zt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Ir(t.containerInfo)}catch(oe){Ke(e,e.return,oe)}Vu&&(Vu=!1,Dp(e));break;case 4:r=Ln,Ln=Oo(e.stateNode.containerInfo),Ft(t,e),Zt(e),Ln=r;break;case 12:Ft(t,e),Zt(e);break;case 31:Ft(t,e),Zt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yo(e,r)));break;case 13:Ft(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(jo=rt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yo(e,r)));break;case 22:c=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,_=Ca,K=bt;if(Ca=_||c,bt=K||M,Ft(t,e),bt=K,Ca=_,Zt(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||M||Ca||bt||Wl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){M=a=t;try{if(d=M.stateNode,c)m=d.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{b=M.stateNode;var X=M.memoizedProps.style,U=X!=null&&X.hasOwnProperty("display")?X.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(oe){Ke(M,M.return,oe)}}}else if(t.tag===6){if(a===null){M=t;try{M.stateNode.nodeValue=c?"":M.memoizedProps}catch(oe){Ke(M,M.return,oe)}}}else if(t.tag===18){if(a===null){M=t;try{var q=M.stateNode;c?wv(q,!0):wv(M.stateNode,!1)}catch(oe){Ke(M,M.return,oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,yo(e,a))));break;case 19:Ft(t,e),Zt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yo(e,r)));break;case 30:break;case 21:break;default:Ft(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Cp(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Yu(e);bo(e,d,c);break;case 5:var m=a.stateNode;a.flags&32&&(Sr(m,""),a.flags&=-33);var b=Yu(e);bo(e,b,m);break;case 3:case 4:var M=a.stateNode.containerInfo,_=Yu(e);Gu(e,_,M);break;default:throw Error(i(161))}}catch(K){Ke(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ep(e,t.alternate,t),t=t.sibling}function Wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ol(4,t,t.return),Wl(t);break;case 1:Xn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&wp(t,t.return,a),Wl(t);break;case 27:es(t.stateNode);case 26:case 5:Xn(t,t.return),Wl(t);break;case 22:t.memoizedState===null&&Wl(t);break;case 30:Wl(t);break;default:Wl(t)}e=e.sibling}}function Ea(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,m=d.flags;switch(d.tag){case 0:case 11:case 15:Ea(c,d,a),Ki(4,d);break;case 1:if(Ea(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(_){Ke(r,r.return,_)}if(r=d,c=r.updateQueue,c!==null){var b=r.stateNode;try{var M=c.shared.hiddenCallbacks;if(M!==null)for(c.shared.hiddenCallbacks=null,c=0;c<M.length;c++)fh(M[c],b)}catch(_){Ke(r,r.return,_)}}a&&m&64&&Np(d),Yi(d,d.return);break;case 27:Tp(d);case 26:case 5:Ea(c,d,a),a&&r===null&&m&4&&Mp(d),Yi(d,d.return);break;case 12:Ea(c,d,a);break;case 31:Ea(c,d,a),a&&m&4&&zp(c,d);break;case 13:Ea(c,d,a),a&&m&4&&_p(c,d);break;case 22:d.memoizedState===null&&Ea(c,d,a),Yi(d,d.return);break;case 30:break;default:Ea(c,d,a)}t=t.sibling}}function Xu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ri(a))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ri(e))}function Bn(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Up(e,t,a,r),t=t.sibling}function Up(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,a,r),c&2048&&Ki(9,t);break;case 1:Bn(e,t,a,r);break;case 3:Bn(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ri(e)));break;case 12:if(c&2048){Bn(e,t,a,r),e=t.stateNode;try{var d=t.memoizedProps,m=d.id,b=d.onPostCommit;typeof b=="function"&&b(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Ke(t,t.return,M)}}else Bn(e,t,a,r);break;case 31:Bn(e,t,a,r);break;case 13:Bn(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,m=t.alternate,t.memoizedState!==null?d._visibility&2?Bn(e,t,a,r):Gi(e,t):d._visibility&2?Bn(e,t,a,r):(d._visibility|=2,Qr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Xu(m,t);break;case 24:Bn(e,t,a,r),c&2048&&Fu(t.alternate,t);break;default:Bn(e,t,a,r)}}function Qr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,m=t,b=a,M=r,_=m.flags;switch(m.tag){case 0:case 11:case 15:Qr(d,m,b,M,c),Ki(8,m);break;case 23:break;case 22:var K=m.stateNode;m.memoizedState!==null?K._visibility&2?Qr(d,m,b,M,c):Gi(d,m):(K._visibility|=2,Qr(d,m,b,M,c)),c&&_&2048&&Xu(m.alternate,m);break;case 24:Qr(d,m,b,M,c),c&&_&2048&&Fu(m.alternate,m);break;default:Qr(d,m,b,M,c)}t=t.sibling}}function Gi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:Gi(a,r),c&2048&&Xu(r.alternate,r);break;case 24:Gi(a,r),c&2048&&Fu(r.alternate,r);break;default:Gi(a,r)}t=t.sibling}}var Vi=8192;function Hr(e,t,a){if(e.subtreeFlags&Vi)for(e=e.child;e!==null;)Lp(e,t,a),e=e.sibling}function Lp(e,t,a){switch(e.tag){case 26:Hr(e,t,a),e.flags&Vi&&e.memoizedState!==null&&z0(a,Ln,e.memoizedState,e.memoizedProps);break;case 5:Hr(e,t,a);break;case 3:case 4:var r=Ln;Ln=Oo(e.stateNode.containerInfo),Hr(e,t,a),Ln=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vi,Vi=16777216,Hr(e,t,a),Vi=r):Hr(e,t,a));break;default:Hr(e,t,a)}}function Bp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Xi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Tt=r,$p(r,e)}Bp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qp(e),e=e.sibling}function qp(e){switch(e.tag){case 0:case 11:case 15:Xi(e),e.flags&2048&&ol(9,e,e.return);break;case 3:Xi(e);break;case 12:Xi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,So(e)):Xi(e);break;default:Xi(e)}}function So(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Tt=r,$p(r,e)}Bp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ol(8,t,t.return),So(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,So(t));break;default:So(t)}e=e.sibling}}function $p(e,t){for(;Tt!==null;){var a=Tt;switch(a.tag){case 0:case 11:case 15:ol(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ri(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Tt=r;else e:for(a=e;Tt!==null;){r=Tt;var c=r.sibling,d=r.return;if(kp(r),r===a){Tt=null;break e}if(c!==null){c.return=d,Tt=c;break e}Tt=d}}}var Vy={getCacheForType:function(e){var t=Rt(vt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Rt(vt).controller.signal}},Xy=typeof WeakMap=="function"?WeakMap:Map,qe=0,Fe=null,Ce=null,Ae=0,Pe=0,hn=null,cl=!1,Pr=!1,Zu=!1,ka=0,st=0,ul=0,er=0,Ju=0,pn=0,Kr=0,Fi=null,Jt=null,Iu=!1,jo=0,Qp=0,No=1/0,wo=null,dl=null,Nt=0,fl=null,Yr=null,Ra=0,Wu=0,ed=null,Hp=null,Zi=0,td=null;function vn(){return(qe&2)!==0&&Ae!==0?Ae&-Ae:O.T!==null?sd():Fa()}function Pp(){if(pn===0)if((Ae&536870912)===0||Re){var e=oa;oa<<=1,(oa&3932160)===0&&(oa=262144),pn=e}else pn=536870912;return e=fn.current,e!==null&&(e.flags|=32),pn}function It(e,t,a){(e===Fe&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(Gr(e,0),ml(e,Ae,pn,!1)),ue(e,a),((qe&2)===0||e!==Fe)&&(e===Fe&&((qe&2)===0&&(er|=a),st===4&&ml(e,Ae,pn,!1)),Fn(e))}function Kp(e,t,a){if((qe&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Yn(e,t),c=r?Jy(e,t):ad(e,t,!0),d=r;do{if(c===0){Pr&&!r&&ml(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!Fy(a)){c=ad(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var b=e;c=Fi;var M=b.current.memoizedState.isDehydrated;if(M&&(Gr(b,m).flags|=256),m=ad(b,m,!1),m!==2){if(Zu&&!M){b.errorRecoveryDisabledLanes|=d,er|=d,c=4;break e}d=Jt,Jt=c,d!==null&&(Jt===null?Jt=d:Jt.push.apply(Jt,d))}c=m}if(d=!1,c!==2)continue}}if(c===1){Gr(e,0),ml(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ml(r,t,pn,!cl);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=jo+300-rt(),10<c)){if(ml(r,t,pn,!cl),ua(r,0,!0)!==0)break e;Ra=t,r.timeoutHandle=Sv(Yp.bind(null,r,a,Jt,wo,Iu,t,pn,er,Kr,cl,d,"Throttled",-0,0),c);break e}Yp(r,a,Jt,wo,Iu,t,pn,er,Kr,cl,d,null,-0,0)}}break}while(!0);Fn(e)}function Yp(e,t,a,r,c,d,m,b,M,_,K,X,U,q){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:va},Lp(t,d,X);var oe=(d&62914560)===d?jo-rt():(d&4194048)===d?Qp-rt():0;if(oe=_0(X,oe),oe!==null){Ra=d,e.cancelPendingCommit=oe(Wp.bind(null,e,t,d,a,r,c,m,b,M,K,X,null,U,q)),ml(e,d,m,!_);return}}Wp(e,t,d,a,r,c,m,b,M)}function Fy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!un(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ml(e,t,a,r){t&=~Ju,t&=~er,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-pt(c),m=1<<d;r[d]=-1,c&=~m}a!==0&&Ze(e,a,t)}function Mo(){return(qe&6)===0?(Ji(0),!1):!0}function nd(){if(Ce!==null){if(Pe===0)var e=Ce.return;else e=Ce,ya=Yl=null,gu(e),Ur=null,_i=0,e=Ce;for(;e!==null;)jp(e.alternate,e),e=e.return;Ce=null}}function Gr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,p0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ra=0,nd(),Fe=e,Ce=a=ga(e.current,null),Ae=t,Pe=0,hn=null,cl=!1,Pr=Yn(e,t),Zu=!1,Kr=pn=Ju=er=ul=st=0,Jt=Fi=null,Iu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-pt(r),d=1<<c;t|=e[c],r&=~d}return ka=t,Ys(),a}function Gp(e,t){je=null,O.H=Qi,t===Dr||t===Ws?(t=oh(),Pe=3):t===iu?(t=oh(),Pe=4):Pe=t===Ou?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,Ce===null&&(st=1,ho(e,Cn(t,e.current)))}function Vp(){var e=fn.current;return e===null?!0:(Ae&4194048)===Ae?kn===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===kn:!1}function Xp(){var e=O.H;return O.H=Qi,e===null?Qi:e}function Fp(){var e=O.A;return O.A=Vy,e}function Co(){st=4,cl||(Ae&4194048)!==Ae&&fn.current!==null||(Pr=!0),(ul&134217727)===0&&(er&134217727)===0||Fe===null||ml(Fe,Ae,pn,!1)}function ad(e,t,a){var r=qe;qe|=2;var c=Xp(),d=Fp();(Fe!==e||Ae!==t)&&(wo=null,Gr(e,t)),t=!1;var m=st;e:do try{if(Pe!==0&&Ce!==null){var b=Ce,M=hn;switch(Pe){case 8:nd(),m=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(t=!0);var _=Pe;if(Pe=0,hn=null,Vr(e,b,M,_),a&&Pr){m=0;break e}break;default:_=Pe,Pe=0,hn=null,Vr(e,b,M,_)}}Zy(),m=st;break}catch(K){Gp(e,K)}while(!0);return t&&e.shellSuspendCounter++,ya=Yl=null,qe=r,O.H=c,O.A=d,Ce===null&&(Fe=null,Ae=0,Ys()),m}function Zy(){for(;Ce!==null;)Zp(Ce)}function Jy(e,t){var a=qe;qe|=2;var r=Xp(),c=Fp();Fe!==e||Ae!==t?(wo=null,No=rt()+500,Gr(e,t)):Pr=Yn(e,t);e:do try{if(Pe!==0&&Ce!==null){t=Ce;var d=hn;t:switch(Pe){case 1:Pe=0,hn=null,Vr(e,t,d,1);break;case 2:case 9:if(ih(d)){Pe=0,hn=null,Jp(t);break}t=function(){Pe!==2&&Pe!==9||Fe!==e||(Pe=7),Fn(e)},d.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:ih(d)?(Pe=0,hn=null,Jp(t)):(Pe=0,hn=null,Vr(e,t,d,7));break;case 5:var m=null;switch(Ce.tag){case 26:m=Ce.memoizedState;case 5:case 27:var b=Ce;if(m?Uv(m):b.stateNode.complete){Pe=0,hn=null;var M=b.sibling;if(M!==null)Ce=M;else{var _=b.return;_!==null?(Ce=_,To(_)):Ce=null}break t}}Pe=0,hn=null,Vr(e,t,d,5);break;case 6:Pe=0,hn=null,Vr(e,t,d,6);break;case 8:nd(),st=6;break e;default:throw Error(i(462))}}Iy();break}catch(K){Gp(e,K)}while(!0);return ya=Yl=null,O.H=r,O.A=c,qe=a,Ce!==null?0:(Fe=null,Ae=0,Ys(),st)}function Iy(){for(;Ce!==null&&!Kn();)Zp(Ce)}function Zp(e){var t=yp(e.alternate,e,ka);e.memoizedProps=e.pendingProps,t===null?To(e):Ce=t}function Jp(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=hp(a,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=hp(a,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:gu(t);default:jp(a,t),t=Ce=Fm(t,ka),t=yp(a,t,ka)}e.memoizedProps=e.pendingProps,t===null?To(e):Ce=t}function Vr(e,t,a,r){ya=Yl=null,gu(t),Ur=null,_i=0;var c=t.return;try{if($y(e,c,t,a,Ae)){st=1,ho(e,Cn(a,e.current)),Ce=null;return}}catch(d){if(c!==null)throw Ce=c,d;st=1,ho(e,Cn(a,e.current)),Ce=null;return}t.flags&32768?(Re||r===1?e=!0:Pr||(Ae&536870912)!==0?e=!1:(cl=e=!0,(r===2||r===9||r===3||r===6)&&(r=fn.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ip(t,e)):To(t)}function To(e){var t=e;do{if((t.flags&32768)!==0){Ip(t,cl);return}e=t.return;var a=Py(t.alternate,t,ka);if(a!==null){Ce=a;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);st===0&&(st=5)}function Ip(e,t){do{var a=Ky(e.alternate,e);if(a!==null){a.flags&=32767,Ce=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=a}while(e!==null);st=6,Ce=null}function Wp(e,t,a,r,c,d,m,b,M){e.cancelPendingCommit=null;do Ao();while(Nt!==0);if((qe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Yc,He(e,a,d,m,b,M),e===Fe&&(Ce=Fe=null,Ae=0),Yr=t,fl=e,Ra=a,Wu=d,ed=c,Hp=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,n0(qt,function(){return lv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=O.T,O.T=null,c=ee.p,ee.p=2,m=qe,qe|=4;try{Yy(e,t,a)}finally{qe=m,ee.p=c,O.T=r}}Nt=1,ev(),tv(),nv()}}function ev(){if(Nt===1){Nt=0;var e=fl,t=Yr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=O.T,O.T=null;var r=ee.p;ee.p=2;var c=qe;qe|=4;try{Op(t,e);var d=pd,m=$m(e.containerInfo),b=d.focusedElem,M=d.selectionRange;if(m!==b&&b&&b.ownerDocument&&qm(b.ownerDocument.documentElement,b)){if(M!==null&&$c(b)){var _=M.start,K=M.end;if(K===void 0&&(K=_),"selectionStart"in b)b.selectionStart=_,b.selectionEnd=Math.min(K,b.value.length);else{var X=b.ownerDocument||document,U=X&&X.defaultView||window;if(U.getSelection){var q=U.getSelection(),oe=b.textContent.length,ve=Math.min(M.start,oe),Ve=M.end===void 0?ve:Math.min(M.end,oe);!q.extend&&ve>Ve&&(m=Ve,Ve=ve,ve=m);var k=Bm(b,ve),A=Bm(b,Ve);if(k&&A&&(q.rangeCount!==1||q.anchorNode!==k.node||q.anchorOffset!==k.offset||q.focusNode!==A.node||q.focusOffset!==A.offset)){var z=X.createRange();z.setStart(k.node,k.offset),q.removeAllRanges(),ve>Ve?(q.addRange(z),q.extend(A.node,A.offset)):(z.setEnd(A.node,A.offset),q.addRange(z))}}}}for(X=[],q=b;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<X.length;b++){var Y=X[b];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}$o=!!hd,pd=hd=null}finally{qe=c,ee.p=r,O.T=a}}e.current=t,Nt=2}}function tv(){if(Nt===2){Nt=0;var e=fl,t=Yr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=O.T,O.T=null;var r=ee.p;ee.p=2;var c=qe;qe|=4;try{Ep(e,t.alternate,t)}finally{qe=c,ee.p=r,O.T=a}}Nt=3}}function nv(){if(Nt===4||Nt===3){Nt=0,la();var e=fl,t=Yr,a=Ra,r=Hp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,Yr=fl=null,av(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(dl=null),fa(a),t=t.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=O.T,c=ee.p,ee.p=2,O.T=null;try{for(var d=e.onRecoverableError,m=0;m<r.length;m++){var b=r[m];d(b.value,{componentStack:b.stack})}}finally{O.T=t,ee.p=c}}(Ra&3)!==0&&Ao(),Fn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===td?Zi++:(Zi=0,td=e):Zi=0,Ji(0)}}function av(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ri(t)))}function Ao(){return ev(),tv(),nv(),lv()}function lv(){if(Nt!==5)return!1;var e=fl,t=Wu;Wu=0;var a=fa(Ra),r=O.T,c=ee.p;try{ee.p=32>a?32:a,O.T=null,a=ed,ed=null;var d=fl,m=Ra;if(Nt=0,Yr=fl=null,Ra=0,(qe&6)!==0)throw Error(i(331));var b=qe;if(qe|=4,qp(d.current),Up(d,d.current,m,a),qe=b,Ji(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(on,d)}catch{}return!0}finally{ee.p=c,O.T=r,av(e,t)}}function rv(e,t,a){t=Cn(a,t),t=_u(e.stateNode,t,2),e=rl(e,t,2),e!==null&&(ue(e,2),Fn(e))}function Ke(e,t,a){if(e.tag===3)rv(e,e,a);else for(;t!==null;){if(t.tag===3){rv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(dl===null||!dl.has(r))){e=Cn(a,e),a=ip(2),r=rl(t,a,2),r!==null&&(sp(a,r,t,e),ue(r,2),Fn(r));break}}t=t.return}}function ld(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Xy;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(Zu=!0,c.add(a),e=Wy.bind(null,e,t,a),t.then(e,e))}function Wy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Fe===e&&(Ae&a)===a&&(st===4||st===3&&(Ae&62914560)===Ae&&300>rt()-jo?(qe&2)===0&&Gr(e,0):Ju|=a,Kr===Ae&&(Kr=0)),Fn(e)}function iv(e,t){t===0&&(t=Ul()),e=Hl(e,t),e!==null&&(ue(e,t),Fn(e))}function e0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),iv(e,a)}function t0(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),iv(e,a)}function n0(e,t){return rn(e,t)}var Eo=null,Xr=null,rd=!1,ko=!1,id=!1,hl=0;function Fn(e){e!==Xr&&e.next===null&&(Xr===null?Eo=Xr=e:Xr=Xr.next=e),ko=!0,rd||(rd=!0,l0())}function Ji(e,t){if(!id&&ko){id=!0;do for(var a=!1,r=Eo;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var m=r.suspendedLanes,b=r.pingedLanes;d=(1<<31-pt(42|e)+1)-1,d&=c&~(m&~b),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,uv(r,d))}else d=Ae,d=ua(r,r===Fe?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Yn(r,d)||(a=!0,uv(r,d));r=r.next}while(a);id=!1}}function a0(){sv()}function sv(){ko=rd=!1;var e=0;hl!==0&&h0()&&(e=hl);for(var t=rt(),a=null,r=Eo;r!==null;){var c=r.next,d=ov(r,t);d===0?(r.next=null,a===null?Eo=c:a.next=c,c===null&&(Xr=a)):(a=r,(e!==0||(d&3)!==0)&&(ko=!0)),r=c}Nt!==0&&Nt!==5||Ji(e),hl!==0&&(hl=0)}function ov(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var m=31-pt(d),b=1<<m,M=c[m];M===-1?((b&a)===0||(b&r)!==0)&&(c[m]=vr(b,t)):M<=t&&(e.expiredLanes|=b),d&=~b}if(t=Fe,a=Ae,a=ua(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&sn(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Yn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&sn(r),fa(a)){case 2:case 8:a=Sn;break;case 32:a=qt;break;case 268435456:a=ra;break;default:a=qt}return r=cv.bind(null,e),a=rn(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&sn(r),e.callbackPriority=2,e.callbackNode=null,2}function cv(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ao()&&e.callbackNode!==a)return null;var r=Ae;return r=ua(e,e===Fe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Kp(e,r,t),ov(e,rt()),e.callbackNode!=null&&e.callbackNode===a?cv.bind(null,e):null)}function uv(e,t){if(Ao())return null;Kp(e,t,!0)}function l0(){v0(function(){(qe&6)!==0?rn(Pa,a0):sv()})}function sd(){if(hl===0){var e=_r;e===0&&(e=sa,sa<<=1,(sa&261888)===0&&(sa=256)),hl=e}return hl}function dv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ls(""+e)}function fv(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function r0(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=dv((c[nt]||null).action),m=r.submitter;m&&(t=(t=m[nt]||null)?dv(t.formAction):m.getAttribute("formAction"),t!==null&&(d=t,m=null));var b=new Qs("action","action",null,r,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(hl!==0){var M=m?fv(c,m):new FormData(c);Tu(a,{pending:!0,data:M,method:c.method,action:d},null,M)}}else typeof d=="function"&&(b.preventDefault(),M=m?fv(c,m):new FormData(c),Tu(a,{pending:!0,data:M,method:c.method,action:d},d,M))},currentTarget:c}]})}}for(var od=0;od<Kc.length;od++){var cd=Kc[od],i0=cd.toLowerCase(),s0=cd[0].toUpperCase()+cd.slice(1);Un(i0,"on"+s0)}Un(Pm,"onAnimationEnd"),Un(Km,"onAnimationIteration"),Un(Ym,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(Ny,"onTransitionRun"),Un(wy,"onTransitionStart"),Un(My,"onTransitionCancel"),Un(Gm,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),Bl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),o0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function mv(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var m=r.length-1;0<=m;m--){var b=r[m],M=b.instance,_=b.currentTarget;if(b=b.listener,M!==d&&c.isPropagationStopped())break e;d=b,c.currentTarget=_;try{d(c)}catch(K){Ks(K)}c.currentTarget=null,d=M}else for(m=0;m<r.length;m++){if(b=r[m],M=b.instance,_=b.currentTarget,b=b.listener,M!==d&&c.isPropagationStopped())break e;d=b,c.currentTarget=_;try{d(c)}catch(K){Ks(K)}c.currentTarget=null,d=M}}}}function Te(e,t){var a=t[xr];a===void 0&&(a=t[xr]=new Set);var r=e+"__bubble";a.has(r)||(hv(t,e,2,!1),a.add(r))}function ud(e,t,a){var r=0;t&&(r|=4),hv(a,e,r,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Ro]){e[Ro]=!0,sm.forEach(function(a){a!=="selectionchange"&&(o0.has(a)||ud(a,!1,e),ud(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ro]||(t[Ro]=!0,ud("selectionchange",!1,t))}}function hv(e,t,a,r){switch(Pv(t)){case 2:var c=U0;break;case 8:c=L0;break;default:c=Cd}a=c.bind(null,t,a,e),c=void 0,!Rc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function fd(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var m=r.tag;if(m===3||m===4){var b=r.stateNode.containerInfo;if(b===c)break;if(m===4)for(m=r.return;m!==null;){var M=m.tag;if((M===3||M===4)&&m.stateNode.containerInfo===c)return;m=m.return}for(;b!==null;){if(m=Ll(b),m===null)return;if(M=m.tag,M===5||M===6||M===26||M===27){r=d=m;continue e}b=b.parentNode}}r=r.return}bm(function(){var _=d,K=Ec(a),X=[];e:{var U=Vm.get(e);if(U!==void 0){var q=Qs,oe=e;switch(e){case"keypress":if(qs(a)===0)break e;case"keydown":case"keyup":q=ty;break;case"focusin":oe="focus",q=Dc;break;case"focusout":oe="blur",q=Dc;break;case"beforeblur":case"afterblur":q=Dc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Pb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=ly;break;case Pm:case Km:case Ym:q=Gb;break;case Gm:q=iy;break;case"scroll":case"scrollend":q=Qb;break;case"wheel":q=oy;break;case"copy":case"cut":case"paste":q=Xb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=wm;break;case"toggle":case"beforetoggle":q=uy}var ve=(t&4)!==0,Ve=!ve&&(e==="scroll"||e==="scrollend"),k=ve?U!==null?U+"Capture":null:U;ve=[];for(var A=_,z;A!==null;){var Y=A;if(z=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||z===null||k===null||(Y=yi(A,k),Y!=null&&ve.push(Wi(A,Y,z))),Ve)break;A=A.return}0<ve.length&&(U=new q(U,oe,null,a,K),X.push({event:U,listeners:ve}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",U&&a!==Ac&&(oe=a.relatedTarget||a.fromElement)&&(Ll(oe)||oe[ma]))break e;if((q||U)&&(U=K.window===K?K:(U=K.ownerDocument)?U.defaultView||U.parentWindow:window,q?(oe=a.relatedTarget||a.toElement,q=_,oe=oe?Ll(oe):null,oe!==null&&(Ve=f(oe),ve=oe.tag,oe!==Ve||ve!==5&&ve!==27&&ve!==6)&&(oe=null)):(q=null,oe=_),q!==oe)){if(ve=jm,Y="onMouseLeave",k="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ve=wm,Y="onPointerLeave",k="onPointerEnter",A="pointer"),Ve=q==null?U:cn(q),z=oe==null?U:cn(oe),U=new ve(Y,A+"leave",q,a,K),U.target=Ve,U.relatedTarget=z,Y=null,Ll(K)===_&&(ve=new ve(k,A+"enter",oe,a,K),ve.target=z,ve.relatedTarget=Ve,Y=ve),Ve=Y,q&&oe)t:{for(ve=c0,k=q,A=oe,z=0,Y=k;Y;Y=ve(Y))z++;Y=0;for(var he=A;he;he=ve(he))Y++;for(;0<z-Y;)k=ve(k),z--;for(;0<Y-z;)A=ve(A),Y--;for(;z--;){if(k===A||A!==null&&k===A.alternate){ve=k;break t}k=ve(k),A=ve(A)}ve=null}else ve=null;q!==null&&pv(X,U,q,ve,!1),oe!==null&&Ve!==null&&pv(X,Ve,oe,ve,!0)}}e:{if(U=_?cn(_):window,q=U.nodeName&&U.nodeName.toLowerCase(),q==="select"||q==="input"&&U.type==="file")var Ue=zm;else if(km(U))if(_m)Ue=yy;else{Ue=gy;var ce=xy}else q=U.nodeName,!q||q.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?_&&Tc(_.elementType)&&(Ue=zm):Ue=by;if(Ue&&(Ue=Ue(e,_))){Rm(X,Ue,a,K);break e}ce&&ce(e,U,_),e==="focusout"&&_&&U.type==="number"&&_.memoizedProps.value!=null&&Cc(U,"number",U.value)}switch(ce=_?cn(_):window,e){case"focusin":(km(ce)||ce.contentEditable==="true")&&(Mr=ce,Qc=_,Ai=null);break;case"focusout":Ai=Qc=Mr=null;break;case"mousedown":Hc=!0;break;case"contextmenu":case"mouseup":case"dragend":Hc=!1,Qm(X,a,K);break;case"selectionchange":if(jy)break;case"keydown":case"keyup":Qm(X,a,K)}var Ne;if(Lc)e:{switch(e){case"compositionstart":var Ee="onCompositionStart";break e;case"compositionend":Ee="onCompositionEnd";break e;case"compositionupdate":Ee="onCompositionUpdate";break e}Ee=void 0}else wr?Am(e,a)&&(Ee="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ee="onCompositionStart");Ee&&(Mm&&a.locale!=="ko"&&(wr||Ee!=="onCompositionStart"?Ee==="onCompositionEnd"&&wr&&(Ne=ym()):(Ia=K,zc="value"in Ia?Ia.value:Ia.textContent,wr=!0)),ce=zo(_,Ee),0<ce.length&&(Ee=new Nm(Ee,e,null,a,K),X.push({event:Ee,listeners:ce}),Ne?Ee.data=Ne:(Ne=Em(a),Ne!==null&&(Ee.data=Ne)))),(Ne=fy?my(e,a):hy(e,a))&&(Ee=zo(_,"onBeforeInput"),0<Ee.length&&(ce=new Nm("onBeforeInput","beforeinput",null,a,K),X.push({event:ce,listeners:Ee}),ce.data=Ne)),r0(X,e,_,a,K)}mv(X,t)})}function Wi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function zo(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=yi(e,a),c!=null&&r.unshift(Wi(e,c,d)),c=yi(e,t),c!=null&&r.push(Wi(e,c,d))),e.tag===3)return r;e=e.return}return[]}function c0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pv(e,t,a,r,c){for(var d=t._reactName,m=[];a!==null&&a!==r;){var b=a,M=b.alternate,_=b.stateNode;if(b=b.tag,M!==null&&M===r)break;b!==5&&b!==26&&b!==27||_===null||(M=_,c?(_=yi(a,d),_!=null&&m.unshift(Wi(a,_,M))):c||(_=yi(a,d),_!=null&&m.push(Wi(a,_,M)))),a=a.return}m.length!==0&&e.push({event:t,listeners:m})}var u0=/\r\n?/g,d0=/\u0000|\uFFFD/g;function vv(e){return(typeof e=="string"?e:""+e).replace(u0,`
49
- `).replace(d0,"")}function xv(e,t){return t=vv(t),vv(e)===t}function Ge(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Sr(e,""+r);break;case"className":Ds(e,"class",r);break;case"tabIndex":Ds(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ds(e,a,r);break;case"style":xm(e,r,d);break;case"data":if(t!=="object"){Ds(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ls(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Ge(e,t,"name",c.name,c,null),Ge(e,t,"formEncType",c.formEncType,c,null),Ge(e,t,"formMethod",c.formMethod,c,null),Ge(e,t,"formTarget",c.formTarget,c,null)):(Ge(e,t,"encType",c.encType,c,null),Ge(e,t,"method",c.method,c,null),Ge(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ls(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=va);break;case"onScroll":r!=null&&Te("scroll",e);break;case"onScrollEnd":r!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Ls(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Te("beforetoggle",e),Te("toggle",e),Os(e,"popover",r);break;case"xlinkActuate":pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":pa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":pa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":pa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":pa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Os(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=qb.get(a)||a,Os(e,a,r))}}function md(e,t,a,r,c,d){switch(a){case"style":xm(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Sr(e,r):(typeof r=="number"||typeof r=="bigint")&&Sr(e,""+r);break;case"onScroll":r!=null&&Te("scroll",e);break;case"onScrollEnd":r!=null&&Te("scrollend",e);break;case"onClick":r!=null&&(e.onclick=va);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!om.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[nt]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Os(e,a,r)}}}function _t(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var m=a[d];if(m!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ge(e,t,d,m,a,null)}}c&&Ge(e,t,"srcSet",a.srcSet,a,null),r&&Ge(e,t,"src",a.src,a,null);return;case"input":Te("invalid",e);var b=d=m=c=null,M=null,_=null;for(r in a)if(a.hasOwnProperty(r)){var K=a[r];if(K!=null)switch(r){case"name":c=K;break;case"type":m=K;break;case"checked":M=K;break;case"defaultChecked":_=K;break;case"value":d=K;break;case"defaultValue":b=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:Ge(e,t,r,K,a,null)}}mm(e,d,b,M,_,m,c,!1);return;case"select":Te("invalid",e),r=m=d=null;for(c in a)if(a.hasOwnProperty(c)&&(b=a[c],b!=null))switch(c){case"value":d=b;break;case"defaultValue":m=b;break;case"multiple":r=b;default:Ge(e,t,c,b,a,null)}t=d,a=m,e.multiple=!!r,t!=null?yr(e,!!r,t,!1):a!=null&&yr(e,!!r,a,!0);return;case"textarea":Te("invalid",e),d=c=r=null;for(m in a)if(a.hasOwnProperty(m)&&(b=a[m],b!=null))switch(m){case"value":r=b;break;case"defaultValue":c=b;break;case"children":d=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:Ge(e,t,m,b,a,null)}pm(e,r,c,d);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(r=a[M],r!=null))switch(M){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ge(e,t,M,r,a,null)}return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(r=0;r<Ii.length;r++)Te(Ii[r],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in a)if(a.hasOwnProperty(_)&&(r=a[_],r!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ge(e,t,_,r,a,null)}return;default:if(Tc(t)){for(K in a)a.hasOwnProperty(K)&&(r=a[K],r!==void 0&&md(e,t,K,r,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(r=a[b],r!=null&&Ge(e,t,b,r,a,null))}function f0(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,m=null,b=null,M=null,_=null,K=null;for(q in a){var X=a[q];if(a.hasOwnProperty(q)&&X!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":M=X;default:r.hasOwnProperty(q)||Ge(e,t,q,null,r,X)}}for(var U in r){var q=r[U];if(X=a[U],r.hasOwnProperty(U)&&(q!=null||X!=null))switch(U){case"type":d=q;break;case"name":c=q;break;case"checked":_=q;break;case"defaultChecked":K=q;break;case"value":m=q;break;case"defaultValue":b=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:q!==X&&Ge(e,t,U,q,r,X)}}Mc(e,m,b,M,_,K,d,c);return;case"select":q=m=b=U=null;for(d in a)if(M=a[d],a.hasOwnProperty(d)&&M!=null)switch(d){case"value":break;case"multiple":q=M;default:r.hasOwnProperty(d)||Ge(e,t,d,null,r,M)}for(c in r)if(d=r[c],M=a[c],r.hasOwnProperty(c)&&(d!=null||M!=null))switch(c){case"value":U=d;break;case"defaultValue":b=d;break;case"multiple":m=d;default:d!==M&&Ge(e,t,c,d,r,M)}t=b,a=m,r=q,U!=null?yr(e,!!a,U,!1):!!r!=!!a&&(t!=null?yr(e,!!a,t,!0):yr(e,!!a,a?[]:"",!1));return;case"textarea":q=U=null;for(b in a)if(c=a[b],a.hasOwnProperty(b)&&c!=null&&!r.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Ge(e,t,b,null,r,c)}for(m in r)if(c=r[m],d=a[m],r.hasOwnProperty(m)&&(c!=null||d!=null))switch(m){case"value":U=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&Ge(e,t,m,c,r,d)}hm(e,U,q);return;case"option":for(var oe in a)if(U=a[oe],a.hasOwnProperty(oe)&&U!=null&&!r.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:Ge(e,t,oe,null,r,U)}for(M in r)if(U=r[M],q=a[M],r.hasOwnProperty(M)&&U!==q&&(U!=null||q!=null))switch(M){case"selected":e.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:Ge(e,t,M,U,r,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in a)U=a[ve],a.hasOwnProperty(ve)&&U!=null&&!r.hasOwnProperty(ve)&&Ge(e,t,ve,null,r,U);for(_ in r)if(U=r[_],q=a[_],r.hasOwnProperty(_)&&U!==q&&(U!=null||q!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:Ge(e,t,_,U,r,q)}return;default:if(Tc(t)){for(var Ve in a)U=a[Ve],a.hasOwnProperty(Ve)&&U!==void 0&&!r.hasOwnProperty(Ve)&&md(e,t,Ve,void 0,r,U);for(K in r)U=r[K],q=a[K],!r.hasOwnProperty(K)||U===q||U===void 0&&q===void 0||md(e,t,K,U,r,q);return}}for(var k in a)U=a[k],a.hasOwnProperty(k)&&U!=null&&!r.hasOwnProperty(k)&&Ge(e,t,k,null,r,U);for(X in r)U=r[X],q=a[X],!r.hasOwnProperty(X)||U===q||U==null&&q==null||Ge(e,t,X,U,r,q)}function gv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,m=c.initiatorType,b=c.duration;if(d&&b&&gv(m)){for(m=0,b=c.responseEnd,r+=1;r<a.length;r++){var M=a[r],_=M.startTime;if(_>b)break;var K=M.transferSize,X=M.initiatorType;K&&gv(X)&&(M=M.responseEnd,m+=K*(M<b?1:(b-_)/(M-_)))}if(--r,t+=8*(d+m)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hd=null,pd=null;function _o(e){return e.nodeType===9?e:e.ownerDocument}function bv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function vd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xd=null;function h0(){var e=window.event;return e&&e.type==="popstate"?e===xd?!1:(xd=e,!0):(xd=null,!1)}var Sv=typeof setTimeout=="function"?setTimeout:void 0,p0=typeof clearTimeout=="function"?clearTimeout:void 0,jv=typeof Promise=="function"?Promise:void 0,v0=typeof queueMicrotask=="function"?queueMicrotask:typeof jv<"u"?function(e){return jv.resolve(null).then(e).catch(x0)}:Sv;function x0(e){setTimeout(function(){throw e})}function pl(e){return e==="head"}function Nv(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),Ir(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")es(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,es(a);for(var d=a.firstChild;d;){var m=d.nextSibling,b=d.nodeName;d[at]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=m}}else a==="body"&&es(e.ownerDocument.body);a=c}while(a);Ir(t)}function wv(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function gd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":gd(a),Ja(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function g0(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[at])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Rn(e.nextSibling),e===null)break}return null}function b0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Rn(e.nextSibling),e===null))return null;return e}function Mv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rn(e.nextSibling),e===null))return null;return e}function bd(e){return e.data==="$?"||e.data==="$~"}function yd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function y0(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Rn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Sd=null;function Cv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Rn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Tv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Av(e,t,a){switch(t=_o(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function es(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ja(e)}var zn=new Map,Ev=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var za=ee.d;ee.d={f:S0,r:j0,D:N0,C:w0,L:M0,m:C0,X:A0,S:T0,M:E0};function S0(){var e=za.f(),t=Mo();return e||t}function j0(e){var t=ha(e);t!==null&&t.tag===5&&t.type==="form"?Gh(t):za.r(e)}var Fr=typeof document>"u"?null:document;function kv(e,t,a){var r=Fr;if(r&&typeof t=="string"&&t){var c=wn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Ev.has(c)||(Ev.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),_t(t,"link",e),Ct(t),r.head.appendChild(t)))}}function N0(e){za.D(e),kv("dns-prefetch",e,null)}function w0(e,t){za.C(e,t),kv("preconnect",e,t)}function M0(e,t,a){za.L(e,t,a);var r=Fr;if(r&&e&&t){var c='link[rel="preload"][as="'+wn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+wn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+wn(a.imageSizes)+'"]')):c+='[href="'+wn(e)+'"]';var d=c;switch(t){case"style":d=Zr(e);break;case"script":d=Jr(e)}zn.has(d)||(e=g({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),zn.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(ts(d))||t==="script"&&r.querySelector(ns(d))||(t=r.createElement("link"),_t(t,"link",e),Ct(t),r.head.appendChild(t)))}}function C0(e,t){za.m(e,t);var a=Fr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+wn(r)+'"][href="'+wn(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Jr(e)}if(!zn.has(d)&&(e=g({rel:"modulepreload",href:e},t),zn.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ns(d)))return}r=a.createElement("link"),_t(r,"link",e),Ct(r),a.head.appendChild(r)}}}function T0(e,t,a){za.S(e,t,a);var r=Fr;if(r&&e){var c=gr(r).hoistableStyles,d=Zr(e);t=t||"default";var m=c.get(d);if(!m){var b={loading:0,preload:null};if(m=r.querySelector(ts(d)))b.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},a),(a=zn.get(d))&&jd(e,a);var M=m=r.createElement("link");Ct(M),_t(M,"link",e),M._p=new Promise(function(_,K){M.onload=_,M.onerror=K}),M.addEventListener("load",function(){b.loading|=1}),M.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Do(m,t,r)}m={type:"stylesheet",instance:m,count:1,state:b},c.set(d,m)}}}function A0(e,t){za.X(e,t);var a=Fr;if(a&&e){var r=gr(a).hoistableScripts,c=Jr(e),d=r.get(c);d||(d=a.querySelector(ns(c)),d||(e=g({src:e,async:!0},t),(t=zn.get(c))&&Nd(e,t),d=a.createElement("script"),Ct(d),_t(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function E0(e,t){za.M(e,t);var a=Fr;if(a&&e){var r=gr(a).hoistableScripts,c=Jr(e),d=r.get(c);d||(d=a.querySelector(ns(c)),d||(e=g({src:e,async:!0,type:"module"},t),(t=zn.get(c))&&Nd(e,t),d=a.createElement("script"),Ct(d),_t(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Rv(e,t,a,r){var c=(c=pe.current)?Oo(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Zr(a.href),a=gr(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Zr(a.href);var d=gr(c).hoistableStyles,m=d.get(e);if(m||(c=c.ownerDocument||c,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,m),(d=c.querySelector(ts(e)))&&!d._p&&(m.instance=d,m.state.loading=5),zn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},zn.set(e,a),d||k0(c,e,a,m.state))),t&&r===null)throw Error(i(528,""));return m}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jr(a),a=gr(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Zr(e){return'href="'+wn(e)+'"'}function ts(e){return'link[rel="stylesheet"]['+e+"]"}function zv(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function k0(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),_t(t,"link",a),Ct(t),e.head.appendChild(t))}function Jr(e){return'[src="'+wn(e)+'"]'}function ns(e){return"script[async]"+e}function _v(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+wn(a.href)+'"]');if(r)return t.instance=r,Ct(r),r;var c=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Ct(r),_t(r,"style",c),Do(r,a.precedence,e),t.instance=r;case"stylesheet":c=Zr(a.href);var d=e.querySelector(ts(c));if(d)return t.state.loading|=4,t.instance=d,Ct(d),d;r=zv(a),(c=zn.get(c))&&jd(r,c),d=(e.ownerDocument||e).createElement("link"),Ct(d);var m=d;return m._p=new Promise(function(b,M){m.onload=b,m.onerror=M}),_t(d,"link",r),t.state.loading|=4,Do(d,a.precedence,e),t.instance=d;case"script":return d=Jr(a.src),(c=e.querySelector(ns(d)))?(t.instance=c,Ct(c),c):(r=a,(c=zn.get(d))&&(r=g({},a),Nd(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),Ct(c),_t(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Do(r,a.precedence,e));return t.instance}function Do(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,m=0;m<r.length;m++){var b=r[m];if(b.dataset.precedence===t)d=b;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Uo=null;function Ov(e,t,a){if(Uo===null){var r=new Map,c=Uo=new Map;c.set(a,r)}else c=Uo,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[at]||d[$e]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var m=d.getAttribute(t)||"";m=e+m;var b=r.get(m);b?b.push(d):r.set(m,[d])}}return r}function Dv(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function R0(e,t,a){if(a===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 Uv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function z0(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Zr(r.href),d=t.querySelector(ts(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lo.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Ct(d);return}d=t.ownerDocument||t,r=zv(r),(c=zn.get(c))&&jd(r,c),d=d.createElement("link"),Ct(d);var m=d;m._p=new Promise(function(b,M){m.onload=b,m.onerror=M}),_t(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Lo.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var wd=0;function _0(e,t){return e.stylesheets&&e.count===0&&qo(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&qo(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&wd===0&&(wd=62500*m0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qo(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>wd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Lo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Bo=null;function qo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bo=new Map,t.forEach(O0,e),Bo=null,Lo.call(e))}function O0(e,t){if(!(t.state.loading&4)){var a=Bo.get(e);if(a)var r=a.get(null);else{a=new Map,Bo.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var m=c[d];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(a.set(m.dataset.precedence,m),r=m)}r&&a.set(null,r)}c=t.instance,m=c.getAttribute("data-precedence"),d=a.get(m)||r,d===r&&a.set(null,c),a.set(m,c),this.count++,r=Lo.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var as={$$typeof:Q,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function D0(e,t,a,r,c,d,m,b,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Va(0),this.hiddenUpdates=Va(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Lv(e,t,a,r,c,d,m,b,M,_,K,X){return e=new D0(e,t,a,m,M,_,K,X,b),t=1,d===!0&&(t|=24),d=dn(3,null,null,t),e.current=d,d.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},su(d),e}function Bv(e){return e?(e=Ar,e):Ar}function qv(e,t,a,r,c,d){c=Bv(c),r.context===null?r.context=c:r.pendingContext=c,r=ll(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=rl(e,r,t),a!==null&&(It(a,e,t),Di(a,e,t))}function $v(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Md(e,t){$v(e,t),(e=e.alternate)&&$v(e,t)}function Qv(e){if(e.tag===13||e.tag===31){var t=Hl(e,67108864);t!==null&&It(t,e,67108864),Md(e,67108864)}}function Hv(e){if(e.tag===13||e.tag===31){var t=vn();t=da(t);var a=Hl(e,t);a!==null&&It(a,e,t),Md(e,t)}}var $o=!0;function U0(e,t,a,r){var c=O.T;O.T=null;var d=ee.p;try{ee.p=2,Cd(e,t,a,r)}finally{ee.p=d,O.T=c}}function L0(e,t,a,r){var c=O.T;O.T=null;var d=ee.p;try{ee.p=8,Cd(e,t,a,r)}finally{ee.p=d,O.T=c}}function Cd(e,t,a,r){if($o){var c=Td(r);if(c===null)fd(e,t,r,Qo,a),Kv(e,r);else if(q0(c,e,t,a,r))r.stopPropagation();else if(Kv(e,r),t&4&&-1<B0.indexOf(e)){for(;c!==null;){var d=ha(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var m=jn(d.pendingLanes);if(m!==0){var b=d;for(b.pendingLanes|=2,b.entangledLanes|=2;m;){var M=1<<31-pt(m);b.entanglements[1]|=M,m&=~M}Fn(d),(qe&6)===0&&(No=rt()+500,Ji(0))}}break;case 31:case 13:b=Hl(d,2),b!==null&&It(b,d,2),Mo(),Md(d,2)}if(d=Td(r),d===null&&fd(e,t,r,Qo,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else fd(e,t,r,null,a)}}function Td(e){return e=Ec(e),Ad(e)}var Qo=null;function Ad(e){if(Qo=null,e=Ll(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Qo=e,null}function Pv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ha()){case Pa:return 2;case Sn:return 8;case qt:case Ka:return 32;case ra:return 268435456;default:return 32}default:return 32}}var Ed=!1,vl=null,xl=null,gl=null,ls=new Map,rs=new Map,bl=[],B0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Kv(e,t){switch(e){case"focusin":case"focusout":vl=null;break;case"dragenter":case"dragleave":xl=null;break;case"mouseover":case"mouseout":gl=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(t.pointerId)}}function is(e,t,a,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=ha(t),t!==null&&Qv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function q0(e,t,a,r,c){switch(t){case"focusin":return vl=is(vl,e,t,a,r,c),!0;case"dragenter":return xl=is(xl,e,t,a,r,c),!0;case"mouseover":return gl=is(gl,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return ls.set(d,is(ls.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,rs.set(d,is(rs.get(d)||null,e,t,a,r,c)),!0}return!1}function Yv(e){var t=Ll(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Za(e.priority,function(){Hv(a)});return}}else if(t===31){if(t=h(a),t!==null){e.blockedOn=t,Za(e.priority,function(){Hv(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Td(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Ac=r,a.target.dispatchEvent(r),Ac=null}else return t=ha(a),t!==null&&Qv(t),e.blockedOn=a,!1;t.shift()}return!0}function Gv(e,t,a){Ho(e)&&a.delete(t)}function $0(){Ed=!1,vl!==null&&Ho(vl)&&(vl=null),xl!==null&&Ho(xl)&&(xl=null),gl!==null&&Ho(gl)&&(gl=null),ls.forEach(Gv),rs.forEach(Gv)}function Po(e,t){e.blockedOn===t&&(e.blockedOn=null,Ed||(Ed=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$0)))}var Ko=null;function Vv(e){Ko!==e&&(Ko=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ko===e&&(Ko=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Ad(r||a)===null)continue;break}var d=ha(a);d!==null&&(e.splice(t,3),t-=3,Tu(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function Ir(e){function t(M){return Po(M,e)}vl!==null&&Po(vl,e),xl!==null&&Po(xl,e),gl!==null&&Po(gl,e),ls.forEach(t),rs.forEach(t);for(var a=0;a<bl.length;a++){var r=bl[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<bl.length&&(a=bl[0],a.blockedOn===null);)Yv(a),a.blockedOn===null&&bl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],m=c[nt]||null;if(typeof d=="function")m||Vv(a);else if(m){var b=null;if(d&&d.hasAttribute("formAction")){if(c=d,m=d[nt]||null)b=m.formAction;else if(Ad(c)!==null)continue}else b=m.action;typeof b=="function"?a[r+1]=b:(a.splice(r,3),r-=3),Vv(a)}}}function Xv(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(m){return c=m})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function kd(e){this._internalRoot=e}Yo.prototype.render=kd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=vn();qv(a,r,e,t,null,null)},Yo.prototype.unmount=kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qv(e.current,2,null,e,null,null),Mo(),t[ma]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fa();e={blockedOn:null,target:e,priority:t};for(var a=0;a<bl.length&&t!==0&&t<bl[a].priority;a++);bl.splice(a,0,e),a===0&&Yv(e)}};var Fv=l.version;if(Fv!=="19.2.7")throw Error(i(527,Fv,"19.2.7"));ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Q0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{on=Go.inject(Q0),ht=Go}catch{}}return os.createRoot=function(e,t){if(!u(e))throw Error(i(299));var a=!1,r="",c=np,d=ap,m=lp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Lv(e,1,!1,null,null,a,r,null,c,d,m,Xv),e[ma]=t.current,dd(e),new kd(t)},os.hydrateRoot=function(e,t,a){if(!u(e))throw Error(i(299));var r=!1,c="",d=np,m=ap,b=lp,M=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(M=a.formState)),t=Lv(e,1,!0,t,a??null,r,c,M,d,m,b,Xv),t.context=Bv(null),a=t.current,r=vn(),r=da(r),c=ll(r),c.callback=null,rl(a,c,r),a=r,t.current.lanes=a,ue(t,a),Fn(t),e[ma]=t.current,dd(e),new Yo(t)},os.version="19.2.7",os}var ix;function I0(){if(ix)return Dd.exports;ix=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Dd.exports=J0(),Dd.exports}var W0=I0();/**
50
- * react-router v7.17.0
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var sx="popstate";function ox(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function e1(n={}){function l(i,u){var x;let f=(x=u.state)==null?void 0:x.masked,{pathname:p,search:h,hash:v}=f||i.location;return ef("",{pathname:p,search:h,hash:v},u.state&&u.state.usr||null,u.state&&u.state.key||"default",f?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,u){return typeof u=="string"?u:vs(u)}return n1(l,o,null,n)}function lt(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Hn(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function t1(){return Math.random().toString(36).substring(2,10)}function cx(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function ef(n,l,o=null,i,u){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?pi(l):l,state:o,key:l&&l.key||i||t1(),mask:u}}function vs({pathname:n="/",search:l="",hash:o=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function pi(n){let l={};if(n){let o=n.indexOf("#");o>=0&&(l.hash=n.substring(o),n=n.substring(0,o));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function n1(n,l,o,i={}){let{window:u=document.defaultView,v5Compat:f=!1}=i,p=u.history,h="POP",v=null,x=y();x==null&&(x=0,p.replaceState({...p.state,idx:x},""));function y(){return(p.state||{idx:null}).idx}function g(){h="POP";let D=y(),R=D==null?null:D-x;x=D,v&&v({action:h,location:E.location,delta:R})}function j(D,R){h="PUSH";let L=ox(D)?D:ef(E.location,D,R);x=y()+1;let Q=cx(L,x),P=E.createHref(L.mask||L);try{p.pushState(Q,"",P)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;u.location.assign(P)}f&&v&&v({action:h,location:E.location,delta:1})}function w(D,R){h="REPLACE";let L=ox(D)?D:ef(E.location,D,R);x=y();let Q=cx(L,x),P=E.createHref(L.mask||L);p.replaceState(Q,"",P),f&&v&&v({action:h,location:E.location,delta:0})}function T(D){return a1(u,D)}let E={get action(){return h},get location(){return n(u,p)},listen(D){if(v)throw new Error("A history only accepts one active listener");return u.addEventListener(sx,g),v=D,()=>{u.removeEventListener(sx,g),v=null}},createHref(D){return l(u,D)},createURL:T,encodeLocation(D){let R=T(D);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:j,replace:w,go(D){return p.go(D)}};return E}function a1(n,l,o=!1){let i="http://localhost";n&&(i=n.location.origin!=="null"?n.location.origin:n.location.href),lt(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:vs(l);return u=u.replace(/ $/,"%20"),!o&&u.startsWith("//")&&(u=i+u),new URL(u,i)}function mg(n,l,o="/"){return l1(n,l,o,!1)}function l1(n,l,o,i,u){let f=typeof l=="string"?pi(l):l,p=$a(f.pathname||"/",o);if(p==null)return null;let h=r1(n),v=null,x=x1(p);for(let y=0;v==null&&y<h.length;++y)v=p1(h[y],x,i);return v}function r1(n){let l=hg(n);return i1(l),l}function hg(n,l=[],o=[],i="",u=!1){let f=(p,h,v=u,x)=>{let y={relativePath:x===void 0?p.path||"":x,caseSensitive:p.caseSensitive===!0,childrenIndex:h,route:p};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&v)return;lt(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let g=Qn([i,y.relativePath]),j=o.concat(y);p.children&&p.children.length>0&&(lt(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),hg(p.children,l,j,g,v)),!(p.path==null&&!p.index)&&l.push({path:g,score:m1(g,p.index),routesMeta:j})};return n.forEach((p,h)=>{var v;if(p.path===""||!((v=p.path)!=null&&v.includes("?")))f(p,h);else for(let x of pg(p.path))f(p,h,!0,x)}),l}function pg(n){let l=n.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return u?[f,""]:[f];let p=pg(i.join("/")),h=[];return h.push(...p.map(v=>v===""?f:[f,v].join("/"))),u&&h.push(...p),h.map(v=>n.startsWith("/")&&v===""?"/":v)}function i1(n){n.sort((l,o)=>l.score!==o.score?o.score-l.score:h1(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var s1=/^:[\w-]+$/,o1=3,c1=2,u1=1,d1=10,f1=-2,ux=n=>n==="*";function m1(n,l){let o=n.split("/"),i=o.length;return o.some(ux)&&(i+=f1),l&&(i+=c1),o.filter(u=>!ux(u)).reduce((u,f)=>u+(s1.test(f)?o1:f===""?u1:d1),i)}function h1(n,l){return n.length===l.length&&n.slice(0,-1).every((i,u)=>i===l[u])?n[n.length-1]-l[l.length-1]:0}function p1(n,l,o=!1){let{routesMeta:i}=n,u={},f="/",p=[];for(let h=0;h<i.length;++h){let v=i[h],x=h===i.length-1,y=f==="/"?l:l.slice(f.length)||"/",g=rc({path:v.relativePath,caseSensitive:v.caseSensitive,end:x},y),j=v.route;if(!g&&x&&o&&!i[i.length-1].route.index&&(g=rc({path:v.relativePath,caseSensitive:v.caseSensitive,end:!1},y)),!g)return null;Object.assign(u,g.params),p.push({params:u,pathname:Qn([f,g.pathname]),pathnameBase:S1(Qn([f,g.pathnameBase])),route:j}),g.pathnameBase!=="/"&&(f=Qn([f,g.pathnameBase]))}return p}function rc(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[o,i]=v1(n.path,n.caseSensitive,n.end),u=l.match(o);if(!u)return null;let f=u[0],p=f.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:i.reduce((x,{paramName:y,isOptional:g},j)=>{if(y==="*"){let T=h[j]||"";p=f.slice(0,f.length-T.length).replace(/(.)\/+$/,"$1")}const w=h[j];return g&&!w?x[y]=void 0:x[y]=(w||"").replace(/%2F/g,"/"),x},{}),pathname:f,pathnameBase:p,pattern:n}}function v1(n,l=!1,o=!0){Hn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,h,v,x,y)=>{if(i.push({paramName:h,isOptional:v!=null}),v){let g=y.charAt(x+p.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function x1(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Hn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function $a(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=n.charAt(o);return i&&i!=="/"?null:n.slice(o)||"/"}var g1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function b1(n,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof n=="string"?pi(n):n,f;return o?(o=xg(o),o.startsWith("/")?f=dx(o.substring(1),"/"):f=dx(o,l)):f=l,{pathname:f,search:j1(i),hash:N1(u)}}function dx(n,l){let o=ic(l).split("/");return n.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function qd(n,l,o,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function y1(n){return n.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function vg(n){let l=y1(n);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Rf(n,l,o,i=!1){let u;typeof n=="string"?u=pi(n):(u={...n},lt(!u.pathname||!u.pathname.includes("?"),qd("?","pathname","search",u)),lt(!u.pathname||!u.pathname.includes("#"),qd("#","pathname","hash",u)),lt(!u.search||!u.search.includes("#"),qd("#","search","hash",u)));let f=n===""||u.pathname==="",p=f?"/":u.pathname,h;if(p==null)h=o;else{let g=l.length-1;if(!i&&p.startsWith("..")){let j=p.split("/");for(;j[0]==="..";)j.shift(),g-=1;u.pathname=j.join("/")}h=g>=0?l[g]:"/"}let v=b1(u,h),x=p&&p!=="/"&&p.endsWith("/"),y=(f||p===".")&&o.endsWith("/");return!v.pathname.endsWith("/")&&(x||y)&&(v.pathname+="/"),v}var xg=n=>n.replace(/\/\/+/g,"/"),Qn=n=>xg(n.join("/")),ic=n=>n.replace(/\/+$/,""),S1=n=>ic(n).replace(/^\/*/,"/"),j1=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,N1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,w1=class{constructor(n,l,o,i=!1){this.status=n,this.statusText=l||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function M1(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function C1(n){let l=n.map(o=>o.route.path).filter(Boolean);return Qn(l)||"/"}var gg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bg(n,l){let o=n;if(typeof o!="string"||!g1.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,u=!1;if(gg)try{let f=new URL(window.location.href),p=o.startsWith("//")?new URL(f.protocol+o):new URL(o),h=$a(p.pathname,l);p.origin===f.origin&&h!=null?o=h+p.search+p.hash:u=!0}catch{Hn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yg=["POST","PUT","PATCH","DELETE"];new Set(yg);var T1=["GET",...yg];new Set(T1);var vi=S.createContext(null);vi.displayName="DataRouter";var hc=S.createContext(null);hc.displayName="DataRouterState";var Sg=S.createContext(!1);function A1(){return S.useContext(Sg)}var jg=S.createContext({isTransitioning:!1});jg.displayName="ViewTransition";var E1=S.createContext(new Map);E1.displayName="Fetchers";var k1=S.createContext(null);k1.displayName="Await";var On=S.createContext(null);On.displayName="Navigation";var Ts=S.createContext(null);Ts.displayName="Location";var Qa=S.createContext({outlet:null,matches:[],isDataRoute:!1});Qa.displayName="Route";var zf=S.createContext(null);zf.displayName="RouteError";var Ng="REACT_ROUTER_ERROR",R1="REDIRECT",z1="ROUTE_ERROR_RESPONSE";function _1(n){if(n.startsWith(`${Ng}:${R1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function O1(n){if(n.startsWith(`${Ng}:${z1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new w1(l.status,l.statusText,l.data)}catch{}}function D1(n,{relative:l}={}){lt(As(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=S.useContext(On),{hash:u,pathname:f,search:p}=Es(n,{relative:l}),h=f;return o!=="/"&&(h=f==="/"?o:Qn([o,f])),i.createHref({pathname:h,search:p,hash:u})}function As(){return S.useContext(Ts)!=null}function aa(){return lt(As(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Ts).location}var wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mg(n){S.useContext(On).static||S.useLayoutEffect(n)}function Cg(){let{isDataRoute:n}=S.useContext(Qa);return n?X1():U1()}function U1(){lt(As(),"useNavigate() may be used only in the context of a <Router> component.");let n=S.useContext(vi),{basename:l,navigator:o}=S.useContext(On),{matches:i}=S.useContext(Qa),{pathname:u}=aa(),f=JSON.stringify(vg(i)),p=S.useRef(!1);return Mg(()=>{p.current=!0}),S.useCallback((v,x={})=>{if(Hn(p.current,wg),!p.current)return;if(typeof v=="number"){o.go(v);return}let y=Rf(v,JSON.parse(f),u,x.relative==="path");n==null&&l!=="/"&&(y.pathname=y.pathname==="/"?l:Qn([l,y.pathname])),(x.replace?o.replace:o.push)(y,x.state,x)},[l,o,f,u,n])}S.createContext(null);function Es(n,{relative:l}={}){let{matches:o}=S.useContext(Qa),{pathname:i}=aa(),u=JSON.stringify(vg(o));return S.useMemo(()=>Rf(n,JSON.parse(u),i,l==="path"),[n,u,i,l])}function L1(n,l){return Tg(n,l)}function Tg(n,l,o){var D;lt(As(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(On),{matches:u}=S.useContext(Qa),f=u[u.length-1],p=f?f.params:{},h=f?f.pathname:"/",v=f?f.pathnameBase:"/",x=f&&f.route;{let R=x&&x.path||"";Eg(h,!x||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=aa(),g;if(l){let R=typeof l=="string"?pi(l):l;lt(v==="/"||((D=R.pathname)==null?void 0:D.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${R.pathname}" was given in the \`location\` prop.`),g=R}else g=y;let j=g.pathname||"/",w=j;if(v!=="/"){let R=v.replace(/^\//,"").split("/");w="/"+j.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=o&&o.state.matches.length?o.state.matches.map(R=>Object.assign(R,{route:o.manifest[R.route.id]||R.route})):mg(n,{pathname:w});Hn(x||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Hn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=H1(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},p,R.params),pathname:Qn([v,i.encodeLocation?i.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?v:Qn([v,i.encodeLocation?i.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),u,o);return l&&E?S.createElement(Ts.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},E):E}function B1(){let n=V1(),l=M1(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},p=null;return console.error("Error handled by React Router default ErrorBoundary:",n),p=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:f},"ErrorBoundary")," or"," ",S.createElement("code",{style:f},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},l),o?S.createElement("pre",{style:u},o):null,p)}var q1=S.createElement(B1,null),Ag=class extends S.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const o=O1(n.digest);o&&(n=o)}let l=n!==void 0?S.createElement(Qa.Provider,{value:this.props.routeContext},S.createElement(zf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?S.createElement($1,{error:n},l):l}};Ag.contextType=Sg;var $d=new WeakMap;function $1({children:n,error:l}){let{basename:o}=S.useContext(On);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=_1(l.digest);if(i){let u=$d.get(l);if(u)throw u;let f=bg(i.location,o);if(gg&&!$d.get(l))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw $d.set(l,p),p}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function Q1({routeContext:n,match:l,children:o}){let i=S.useContext(vi);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),S.createElement(Qa.Provider,{value:n},o)}function H1(n,l=[],o){let i=o==null?void 0:o.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let u=n,f=i==null?void 0:i.errors;if(f!=null){let y=u.findIndex(g=>g.route.id&&(f==null?void 0:f[g.route.id])!==void 0);lt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,y+1))}let p=!1,h=-1;if(o&&i){p=i.renderFallback;for(let y=0;y<u.length;y++){let g=u[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(h=y),g.route.id){let{loaderData:j,errors:w}=i,T=g.route.loader&&!j.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||T){o.isStatic&&(p=!0),h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}}let v=o==null?void 0:o.onError,x=i&&v?(y,g)=>{var j,w;v(y,{location:i.location,params:((w=(j=i.matches)==null?void 0:j[0])==null?void 0:w.params)??{},pattern:C1(i.matches),errorInfo:g})}:void 0;return u.reduceRight((y,g,j)=>{let w,T=!1,E=null,D=null;i&&(w=f&&g.route.id?f[g.route.id]:void 0,E=g.route.errorElement||q1,p&&(h<0&&j===0?(Eg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,D=null):h===j&&(T=!0,D=g.route.hydrateFallbackElement||null)));let R=l.concat(u.slice(0,j+1)),L=()=>{let Q;return w?Q=E:T?Q=D:g.route.Component?Q=S.createElement(g.route.Component,null):g.route.element?Q=g.route.element:Q=y,S.createElement(Q1,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:i!=null},children:Q})};return i&&(g.route.ErrorBoundary||g.route.errorElement||j===0)?S.createElement(Ag,{location:i.location,revalidation:i.revalidation,component:E,error:w,children:L(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:x}):L()},null)}function _f(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function P1(n){let l=S.useContext(vi);return lt(l,_f(n)),l}function K1(n){let l=S.useContext(hc);return lt(l,_f(n)),l}function Y1(n){let l=S.useContext(Qa);return lt(l,_f(n)),l}function Of(n){let l=Y1(n),o=l.matches[l.matches.length-1];return lt(o.route.id,`${n} can only be used on routes that contain a unique "id"`),o.route.id}function G1(){return Of("useRouteId")}function V1(){var i;let n=S.useContext(zf),l=K1("useRouteError"),o=Of("useRouteError");return n!==void 0?n:(i=l.errors)==null?void 0:i[o]}function X1(){let{router:n}=P1("useNavigate"),l=Of("useNavigate"),o=S.useRef(!1);return Mg(()=>{o.current=!0}),S.useCallback(async(u,f={})=>{Hn(o.current,wg),o.current&&(typeof u=="number"?await n.navigate(u):await n.navigate(u,{fromRouteId:l,...f}))},[n,l])}var fx={};function Eg(n,l,o){!l&&!fx[n]&&(fx[n]=!0,Hn(!1,o))}S.memo(F1);function F1({routes:n,manifest:l,future:o,state:i,isStatic:u,onError:f}){return Tg(n,void 0,{manifest:l,state:i,isStatic:u,onError:f})}function tr(n){lt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Z1({basename:n="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:f=!1,useTransitions:p}){lt(!As(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),v=S.useMemo(()=>({basename:h,navigator:u,static:f,useTransitions:p,future:{}}),[h,u,f,p]);typeof o=="string"&&(o=pi(o));let{pathname:x="/",search:y="",hash:g="",state:j=null,key:w="default",mask:T}=o,E=S.useMemo(()=>{let D=$a(x,h);return D==null?null:{location:{pathname:D,search:y,hash:g,state:j,key:w,mask:T},navigationType:i}},[h,x,y,g,j,w,i,T]);return Hn(E!=null,`<Router basename="${h}"> is not able to match the URL "${x}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:S.createElement(On.Provider,{value:v},S.createElement(Ts.Provider,{children:l,value:E}))}function J1({children:n,location:l}){return L1(tf(n),l)}function tf(n,l=[]){let o=[];return S.Children.forEach(n,(i,u)=>{if(!S.isValidElement(i))return;let f=[...l,u];if(i.type===S.Fragment){o.push.apply(o,tf(i.props.children,f));return}lt(i.type===tr,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),lt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let p={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(p.children=tf(i.props.children,f)),o.push(p)}),o}var ec="get",tc="application/x-www-form-urlencoded";function pc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function I1(n){return pc(n)&&n.tagName.toLowerCase()==="button"}function W1(n){return pc(n)&&n.tagName.toLowerCase()==="form"}function e2(n){return pc(n)&&n.tagName.toLowerCase()==="input"}function t2(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function n2(n,l){return n.button===0&&(!l||l==="_self")&&!t2(n)}function nf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,o)=>{let i=n[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function a2(n,l){let o=nf(n);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(f=>{o.append(u,f)})}),o}var Xo=null;function l2(){if(Xo===null)try{new FormData(document.createElement("form"),0),Xo=!1}catch{Xo=!0}return Xo}var r2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qd(n){return n!=null&&!r2.has(n)?(Hn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tc}"`),null):n}function i2(n,l){let o,i,u,f,p;if(W1(n)){let h=n.getAttribute("action");i=h?$a(h,l):null,o=n.getAttribute("method")||ec,u=Qd(n.getAttribute("enctype"))||tc,f=new FormData(n)}else if(I1(n)||e2(n)&&(n.type==="submit"||n.type==="image")){let h=n.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let v=n.getAttribute("formaction")||h.getAttribute("action");if(i=v?$a(v,l):null,o=n.getAttribute("formmethod")||h.getAttribute("method")||ec,u=Qd(n.getAttribute("formenctype"))||Qd(h.getAttribute("enctype"))||tc,f=new FormData(h,n),!l2()){let{name:x,type:y,value:g}=n;if(y==="image"){let j=x?`${x}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else x&&f.append(x,g)}}else{if(pc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=ec,i=null,u=tc,p=n}return f&&u==="text/plain"&&(p=f,f=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:f,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Df(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function kg(n,l,o,i){let u=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return o?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&$a(u.pathname,l)==="/"?u.pathname=`${ic(l)}/_root.${i}`:u.pathname=`${ic(u.pathname)}.${i}`,u}async function s2(n,l){if(n.id in l)return l[n.id];try{let o=await import(n.module);return l[n.id]=o,o}catch(o){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function o2(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function c2(n,l,o){let i=await Promise.all(n.map(async u=>{let f=l.routes[u.route.id];if(f){let p=await s2(f,o);return p.links?p.links():[]}return[]}));return m2(i.flat(1).filter(o2).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function mx(n,l,o,i,u,f){let p=(v,x)=>o[x]?v.route.id!==o[x].route.id:!0,h=(v,x)=>{var y;return o[x].pathname!==v.pathname||((y=o[x].route.path)==null?void 0:y.endsWith("*"))&&o[x].params["*"]!==v.params["*"]};return f==="assets"?l.filter((v,x)=>p(v,x)||h(v,x)):f==="data"?l.filter((v,x)=>{var g;let y=i.routes[v.route.id];if(!y||!y.hasLoader)return!1;if(p(v,x)||h(v,x))return!0;if(v.route.shouldRevalidate){let j=v.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((g=o[0])==null?void 0:g.params)||{},nextUrl:new URL(n,window.origin),nextParams:v.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function u2(n,l,{includeHydrateFallback:o}={}){return d2(n.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let f=[u.module];return u.clientActionModule&&(f=f.concat(u.clientActionModule)),u.clientLoaderModule&&(f=f.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(f=f.concat(u.hydrateFallbackModule)),u.imports&&(f=f.concat(u.imports)),f}).flat(1))}function d2(n){return[...new Set(n)]}function f2(n){let l={},o=Object.keys(n).sort();for(let i of o)l[i]=n[i];return l}function m2(n,l){let o=new Set;return new Set(l),n.reduce((i,u)=>{let f=JSON.stringify(f2(u));return o.has(f)||(o.add(f),i.push({key:f,link:u})),i},[])}function Uf(){let n=S.useContext(vi);return Df(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function h2(){let n=S.useContext(hc);return Df(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Lf=S.createContext(void 0);Lf.displayName="FrameworkContext";function Bf(){let n=S.useContext(Lf);return Df(n,"You must render this element inside a <HydratedRouter> element"),n}function p2(n,l){let o=S.useContext(Lf),[i,u]=S.useState(!1),[f,p]=S.useState(!1),{onFocus:h,onBlur:v,onMouseEnter:x,onMouseLeave:y,onTouchStart:g}=l,j=S.useRef(null);S.useEffect(()=>{if(n==="render"&&p(!0),n==="viewport"){let E=R=>{R.forEach(L=>{p(L.isIntersecting)})},D=new IntersectionObserver(E,{threshold:.5});return j.current&&D.observe(j.current),()=>{D.disconnect()}}},[n]),S.useEffect(()=>{if(i){let E=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(E)}}},[i]);let w=()=>{u(!0)},T=()=>{u(!1),p(!1)};return o?n!=="intent"?[f,j,{}]:[f,j,{onFocus:cs(h,w),onBlur:cs(v,T),onMouseEnter:cs(x,w),onMouseLeave:cs(y,T),onTouchStart:cs(g,w)}]:[!1,j,{}]}function cs(n,l){return o=>{n&&n(o),o.defaultPrevented||l(o)}}function v2({page:n,...l}){let o=A1(),{router:i}=Uf(),u=S.useMemo(()=>mg(i.routes,n,i.basename),[i.routes,n,i.basename]);return u?o?S.createElement(g2,{page:n,matches:u,...l}):S.createElement(b2,{page:n,matches:u,...l}):null}function x2(n){let{manifest:l,routeModules:o}=Bf(),[i,u]=S.useState([]);return S.useEffect(()=>{let f=!1;return c2(n,l,o).then(p=>{f||u(p)}),()=>{f=!0}},[n,l,o]),i}function g2({page:n,matches:l,...o}){let i=aa(),{future:u}=Bf(),{basename:f}=Uf(),p=S.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let h=kg(n,f,u.v8_trailingSlashAwareDataRequests,"rsc"),v=!1,x=[];for(let y of l)typeof y.route.shouldRevalidate=="function"?v=!0:x.push(y.route.id);return v&&x.length>0&&h.searchParams.set("_routes",x.join(",")),[h.pathname+h.search]},[f,u.v8_trailingSlashAwareDataRequests,n,i,l]);return S.createElement(S.Fragment,null,p.map(h=>S.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...o})))}function b2({page:n,matches:l,...o}){let i=aa(),{future:u,manifest:f,routeModules:p}=Bf(),{basename:h}=Uf(),{loaderData:v,matches:x}=h2(),y=S.useMemo(()=>mx(n,l,x,f,i,"data"),[n,l,x,f,i]),g=S.useMemo(()=>mx(n,l,x,f,i,"assets"),[n,l,x,f,i]),j=S.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let E=new Set,D=!1;if(l.forEach(L=>{var P;let Q=f.routes[L.route.id];!Q||!Q.hasLoader||(!y.some(G=>G.route.id===L.route.id)&&L.route.id in v&&((P=p[L.route.id])!=null&&P.shouldRevalidate)||Q.hasClientLoader?D=!0:E.add(L.route.id))}),E.size===0)return[];let R=kg(n,h,u.v8_trailingSlashAwareDataRequests,"data");return D&&E.size>0&&R.searchParams.set("_routes",l.filter(L=>E.has(L.route.id)).map(L=>L.route.id).join(",")),[R.pathname+R.search]},[h,u.v8_trailingSlashAwareDataRequests,v,i,f,y,l,n,p]),w=S.useMemo(()=>u2(g,f),[g,f]),T=x2(g);return S.createElement(S.Fragment,null,j.map(E=>S.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),w.map(E=>S.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),T.map(({key:E,link:D})=>S.createElement("link",{key:E,nonce:o.nonce,...D,crossOrigin:D.crossOrigin??o.crossOrigin})))}function y2(...n){return l=>{n.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var S2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{S2&&(window.__reactRouterVersion="7.17.0")}catch{}function j2({basename:n,children:l,useTransitions:o,window:i}){let u=S.useRef();u.current==null&&(u.current=e1({window:i,v5Compat:!0}));let f=u.current,[p,h]=S.useState({action:f.action,location:f.location}),v=S.useCallback(x=>{o===!1?h(x):S.startTransition(()=>h(x))},[o]);return S.useLayoutEffect(()=>f.listen(v),[f,v]),S.createElement(Z1,{basename:n,children:l,location:p.location,navigationType:p.action,navigator:f,useTransitions:o})}var Rg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hr=S.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:f,replace:p,mask:h,state:v,target:x,to:y,preventScrollReset:g,viewTransition:j,defaultShouldRevalidate:w,...T},E){let{basename:D,navigator:R,useTransitions:L}=S.useContext(On),Q=typeof y=="string"&&Rg.test(y),P=bg(y,D);y=P.to;let G=D1(y,{relative:u}),H=aa(),$=null;if(h){let me=Rf(h,[],H.mask?H.mask.pathname:"/",!0);D!=="/"&&(me.pathname=me.pathname==="/"?D:Qn([D,me.pathname])),$=R.createHref(me)}let[I,J,te]=p2(i,T),F=M2(y,{replace:p,mask:h,state:v,target:x,preventScrollReset:g,relative:u,viewTransition:j,defaultShouldRevalidate:w,useTransitions:L});function Z(me){l&&l(me),me.defaultPrevented||F(me)}let se=!(P.isExternal||f),xe=S.createElement("a",{...T,...te,href:(se?$:void 0)||P.absoluteURL||G,onClick:se?Z:l,ref:y2(E,J),target:x,"data-discover":!Q&&o==="render"?"true":void 0});return I&&!Q?S.createElement(S.Fragment,null,xe,S.createElement(v2,{page:G})):xe});hr.displayName="Link";var qf=S.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:f,to:p,viewTransition:h,children:v,...x},y){let g=Es(p,{relative:x.relative}),j=aa(),w=S.useContext(hc),{navigator:T,basename:E}=S.useContext(On),D=w!=null&&R2(g)&&h===!0,R=T.encodeLocation?T.encodeLocation(g).pathname:g.pathname,L=j.pathname,Q=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(L=L.toLowerCase(),Q=Q?Q.toLowerCase():null,R=R.toLowerCase()),Q&&E&&(Q=$a(Q,E)||Q);const P=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let G=L===R||!u&&L.startsWith(R)&&L.charAt(P)==="/",H=Q!=null&&(Q===R||!u&&Q.startsWith(R)&&Q.charAt(R.length)==="/"),$={isActive:G,isPending:H,isTransitioning:D},I=G?l:void 0,J;typeof i=="function"?J=i($):J=[i,G?"active":null,H?"pending":null,D?"transitioning":null].filter(Boolean).join(" ");let te=typeof f=="function"?f($):f;return S.createElement(hr,{...x,"aria-current":I,className:J,ref:y,style:te,to:p,viewTransition:h},typeof v=="function"?v($):v)});qf.displayName="NavLink";var N2=S.forwardRef(({discover:n="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:f,method:p=ec,action:h,onSubmit:v,relative:x,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:j,...w},T)=>{let{useTransitions:E}=S.useContext(On),D=E2(),R=k2(h,{relative:x}),L=p.toLowerCase()==="get"?"get":"post",Q=typeof h=="string"&&Rg.test(h),P=G=>{if(v&&v(G),G.defaultPrevented)return;G.preventDefault();let H=G.nativeEvent.submitter,$=(H==null?void 0:H.getAttribute("formmethod"))||p,I=()=>D(H||G.currentTarget,{fetcherKey:l,method:$,navigate:o,replace:u,state:f,relative:x,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:j});E&&o!==!1?S.startTransition(()=>I()):I()};return S.createElement("form",{ref:T,method:L,action:R,onSubmit:i?v:P,...w,"data-discover":!Q&&n==="render"?"true":void 0})});N2.displayName="Form";function w2(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zg(n){let l=S.useContext(vi);return lt(l,w2(n)),l}function M2(n,{target:l,replace:o,mask:i,state:u,preventScrollReset:f,relative:p,viewTransition:h,defaultShouldRevalidate:v,useTransitions:x}={}){let y=Cg(),g=aa(),j=Es(n,{relative:p});return S.useCallback(w=>{if(n2(w,l)){w.preventDefault();let T=o!==void 0?o:vs(g)===vs(j),E=()=>y(n,{replace:T,mask:i,state:u,preventScrollReset:f,relative:p,viewTransition:h,defaultShouldRevalidate:v});x?S.startTransition(()=>E()):E()}},[g,y,j,o,i,u,l,n,f,p,h,v,x])}function C2(n){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=S.useRef(nf(n)),o=S.useRef(!1),i=aa(),u=S.useMemo(()=>a2(i.search,o.current?null:l.current),[i.search]),f=Cg(),p=S.useCallback((h,v)=>{const x=nf(typeof h=="function"?h(new URLSearchParams(u)):h);o.current=!0,f("?"+x,v)},[f,u]);return[u,p]}var T2=0,A2=()=>`__${String(++T2)}__`;function E2(){let{router:n}=zg("useSubmit"),{basename:l}=S.useContext(On),o=G1(),i=n.fetch,u=n.navigate;return S.useCallback(async(f,p={})=>{let{action:h,method:v,encType:x,formData:y,body:g}=i2(f,l);if(p.navigate===!1){let j=p.fetcherKey||A2();await i(j,o,p.action||h,{defaultShouldRevalidate:p.defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:y,body:g,formMethod:p.method||v,formEncType:p.encType||x,flushSync:p.flushSync})}else await u(p.action||h,{defaultShouldRevalidate:p.defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:y,body:g,formMethod:p.method||v,formEncType:p.encType||x,replace:p.replace,state:p.state,fromRouteId:o,flushSync:p.flushSync,viewTransition:p.viewTransition})},[i,u,l,o])}function k2(n,{relative:l}={}){let{basename:o}=S.useContext(On),i=S.useContext(Qa);lt(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),f={...Es(n||".",{relative:l})},p=aa();if(n==null){f.search=p.search;let h=new URLSearchParams(f.search),v=h.getAll("index");if(v.some(y=>y==="")){h.delete("index"),v.filter(g=>g).forEach(g=>h.append("index",g));let y=h.toString();f.search=y?`?${y}`:""}}return(!n||n===".")&&u.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:Qn([o,f.pathname])),vs(f)}function R2(n,{relative:l}={}){let o=S.useContext(jg);lt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=zg("useViewTransitionState"),u=Es(n,{relative:l});if(!o.isTransitioning)return!1;let f=$a(o.currentLocation.pathname,i)||o.currentLocation.pathname,p=$a(o.nextLocation.pathname,i)||o.nextLocation.pathname;return rc(u.pathname,p)!=null||rc(u.pathname,f)!=null}var z2=fg(),xi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ar,Ml,ni,tg,_2=(tg=class extends xi{constructor(){super();fe(this,ar);fe(this,Ml);fe(this,ni);ie(this,ni,l=>{if(typeof window<"u"&&window.addEventListener){const o=()=>l();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){C(this,Ml)||this.setEventListener(C(this,ni))}onUnsubscribe(){var l;this.hasListeners()||((l=C(this,Ml))==null||l.call(this),ie(this,Ml,void 0))}setEventListener(l){var o;ie(this,ni,l),(o=C(this,Ml))==null||o.call(this),ie(this,Ml,l(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(l){C(this,ar)!==l&&(ie(this,ar,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(o=>{o(l)})}isFocused(){var l;return typeof C(this,ar)=="boolean"?C(this,ar):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},ar=new WeakMap,Ml=new WeakMap,ni=new WeakMap,tg),$f=new _2,O2={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},Cl,Ef,ng,D2=(ng=class{constructor(){fe(this,Cl,O2);fe(this,Ef,!1)}setTimeoutProvider(n){ie(this,Cl,n)}setTimeout(n,l){return C(this,Cl).setTimeout(n,l)}clearTimeout(n){C(this,Cl).clearTimeout(n)}setInterval(n,l){return C(this,Cl).setInterval(n,l)}clearInterval(n){C(this,Cl).clearInterval(n)}},Cl=new WeakMap,Ef=new WeakMap,ng),nr=new D2;function U2(n){setTimeout(n,0)}var L2=typeof window>"u"||"Deno"in globalThis;function Pt(){}function B2(n,l){return typeof n=="function"?n(l):n}function af(n){return typeof n=="number"&&n>=0&&n!==1/0}function _g(n,l){return Math.max(n+(l||0)-Date.now(),0)}function Ol(n,l){return typeof n=="function"?n(l):n}function gn(n,l){return typeof n=="function"?n(l):n}function hx(n,l){const{type:o="all",exact:i,fetchStatus:u,predicate:f,queryKey:p,stale:h}=n;if(p){if(i){if(l.queryHash!==Qf(p,l.options))return!1}else if(!xs(l.queryKey,p))return!1}if(o!=="all"){const v=l.isActive();if(o==="active"&&!v||o==="inactive"&&v)return!1}return!(typeof h=="boolean"&&l.isStale()!==h||u&&u!==l.state.fetchStatus||f&&!f(l))}function px(n,l){const{exact:o,status:i,predicate:u,mutationKey:f}=n;if(f){if(!l.options.mutationKey)return!1;if(o){if(fr(l.options.mutationKey)!==fr(f))return!1}else if(!xs(l.options.mutationKey,f))return!1}return!(i&&l.state.status!==i||u&&!u(l))}function Qf(n,l){return((l==null?void 0:l.queryKeyHashFn)||fr)(n)}function fr(n){return JSON.stringify(n,(l,o)=>lf(o)?Object.keys(o).sort().reduce((i,u)=>(i[u]=o[u],i),{}):o)}function xs(n,l){return n===l?!0:typeof n!=typeof l?!1:n&&l&&typeof n=="object"&&typeof l=="object"?Object.keys(l).every(o=>xs(n[o],l[o])):!1}var q2=Object.prototype.hasOwnProperty;function Og(n,l,o=0){if(n===l)return n;if(o>500)return l;const i=vx(n)&&vx(l);if(!i&&!(lf(n)&&lf(l)))return l;const f=(i?n:Object.keys(n)).length,p=i?l:Object.keys(l),h=p.length,v=i?new Array(h):{};let x=0;for(let y=0;y<h;y++){const g=i?y:p[y],j=n[g],w=l[g];if(j===w){v[g]=j,(i?y<f:q2.call(n,g))&&x++;continue}if(j===null||w===null||typeof j!="object"||typeof w!="object"){v[g]=w;continue}const T=Og(j,w,o+1);v[g]=T,T===j&&x++}return f===h&&x===f?n:v}function sc(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const o in n)if(n[o]!==l[o])return!1;return!0}function vx(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function lf(n){if(!xx(n))return!1;const l=n.constructor;if(l===void 0)return!0;const o=l.prototype;return!(!xx(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function xx(n){return Object.prototype.toString.call(n)==="[object Object]"}function $2(n){return new Promise(l=>{nr.setTimeout(l,n)})}function rf(n,l,o){return typeof o.structuralSharing=="function"?o.structuralSharing(n,l):o.structuralSharing!==!1?Og(n,l):l}function Q2(n,l,o=0){const i=[...n,l];return o&&i.length>o?i.slice(1):i}function H2(n,l,o=0){const i=[l,...n];return o&&i.length>o?i.slice(0,-1):i}var Hf=Symbol();function Dg(n,l){return!n.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!n.queryFn||n.queryFn===Hf?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Pf(n,l){return typeof n=="function"?n(...l):!!n}function P2(n,l,o){let i=!1,u;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(u??(u=l()),i||(i=!0,u.aborted?o():u.addEventListener("abort",o,{once:!0})),u)}),n}var gs=(()=>{let n=()=>L2;return{isServer(){return n()},setIsServer(l){n=l}}})();function sf(){let n,l;const o=new Promise((u,f)=>{n=u,l=f});o.status="pending",o.catch(()=>{});function i(u){Object.assign(o,u),delete o.resolve,delete o.reject}return o.resolve=u=>{i({status:"fulfilled",value:u}),n(u)},o.reject=u=>{i({status:"rejected",reason:u}),l(u)},o}var K2=U2;function Y2(){let n=[],l=0,o=h=>{h()},i=h=>{h()},u=K2;const f=h=>{l?n.push(h):u(()=>{o(h)})},p=()=>{const h=n;n=[],h.length&&u(()=>{i(()=>{h.forEach(v=>{o(v)})})})};return{batch:h=>{let v;l++;try{v=h()}finally{l--,l||p()}return v},batchCalls:h=>(...v)=>{f(()=>{h(...v)})},schedule:f,setNotifyFunction:h=>{o=h},setBatchNotifyFunction:h=>{i=h},setScheduler:h=>{u=h}}}var wt=Y2(),ai,Tl,li,ag,G2=(ag=class extends xi{constructor(){super();fe(this,ai,!0);fe(this,Tl);fe(this,li);ie(this,li,l=>{if(typeof window<"u"&&window.addEventListener){const o=()=>l(!0),i=()=>l(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",i)}}})}onSubscribe(){C(this,Tl)||this.setEventListener(C(this,li))}onUnsubscribe(){var l;this.hasListeners()||((l=C(this,Tl))==null||l.call(this),ie(this,Tl,void 0))}setEventListener(l){var o;ie(this,li,l),(o=C(this,Tl))==null||o.call(this),ie(this,Tl,l(this.setOnline.bind(this)))}setOnline(l){C(this,ai)!==l&&(ie(this,ai,l),this.listeners.forEach(i=>{i(l)}))}isOnline(){return C(this,ai)}},ai=new WeakMap,Tl=new WeakMap,li=new WeakMap,ag),oc=new G2;function V2(n){return Math.min(1e3*2**n,3e4)}function Ug(n){return(n??"online")==="online"?oc.isOnline():!0}var of=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Lg(n){let l=!1,o=0,i;const u=sf(),f=()=>u.status!=="pending",p=E=>{var D;if(!f()){const R=new of(E);j(R),(D=n.onCancel)==null||D.call(n,R)}},h=()=>{l=!0},v=()=>{l=!1},x=()=>$f.isFocused()&&(n.networkMode==="always"||oc.isOnline())&&n.canRun(),y=()=>Ug(n.networkMode)&&n.canRun(),g=E=>{f()||(i==null||i(),u.resolve(E))},j=E=>{f()||(i==null||i(),u.reject(E))},w=()=>new Promise(E=>{var D;i=R=>{(f()||x())&&E(R)},(D=n.onPause)==null||D.call(n)}).then(()=>{var E;i=void 0,f()||(E=n.onContinue)==null||E.call(n)}),T=()=>{if(f())return;let E;const D=o===0?n.initialPromise:void 0;try{E=D??n.fn()}catch(R){E=Promise.reject(R)}Promise.resolve(E).then(g).catch(R=>{var H;if(f())return;const L=n.retry??(gs.isServer()?0:3),Q=n.retryDelay??V2,P=typeof Q=="function"?Q(o,R):Q,G=L===!0||typeof L=="number"&&o<L||typeof L=="function"&&L(o,R);if(l||!G){j(R);return}o++,(H=n.onFail)==null||H.call(n,o,R),$2(P).then(()=>x()?void 0:w()).then(()=>{l?j(R):T()})})};return{promise:u,status:()=>u.status,cancel:p,continue:()=>(i==null||i(),u),cancelRetry:h,continueRetry:v,canStart:y,start:()=>(y()?T():w().then(T),u)}}var lr,lg,Bg=(lg=class{constructor(){fe(this,lr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),af(this.gcTime)&&ie(this,lr,nr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(gs.isServer()?1/0:300*1e3))}clearGcTimeout(){C(this,lr)!==void 0&&(nr.clearTimeout(C(this,lr)),ie(this,lr,void 0))}},lr=new WeakMap,lg);function X2(n){return{onFetch:(l,o)=>{var y,g,j,w,T;const i=l.options,u=(j=(g=(y=l.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:j.direction,f=((w=l.state.data)==null?void 0:w.pages)||[],p=((T=l.state.data)==null?void 0:T.pageParams)||[];let h={pages:[],pageParams:[]},v=0;const x=async()=>{let E=!1;const D=Q=>{P2(Q,()=>l.signal,()=>E=!0)},R=Dg(l.options,l.fetchOptions),L=async(Q,P,G)=>{if(E)return Promise.reject(l.signal.reason);if(P==null&&Q.pages.length)return Promise.resolve(Q);const $=(()=>{const F={client:l.client,queryKey:l.queryKey,pageParam:P,direction:G?"backward":"forward",meta:l.options.meta};return D(F),F})(),I=await R($),{maxPages:J}=l.options,te=G?H2:Q2;return{pages:te(Q.pages,I,J),pageParams:te(Q.pageParams,P,J)}};if(u&&f.length){const Q=u==="backward",P=Q?F2:gx,G={pages:f,pageParams:p},H=P(i,G);h=await L(G,H,Q)}else{const Q=n??f.length;do{const P=v===0?p[0]??i.initialPageParam:gx(i,h);if(v>0&&P==null)break;h=await L(h,P),v++}while(v<Q)}return h};l.options.persister?l.fetchFn=()=>{var E,D;return(D=(E=l.options).persister)==null?void 0:D.call(E,x,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},o)}:l.fetchFn=x}}}function gx(n,{pages:l,pageParams:o}){const i=l.length-1;return l.length>0?n.getNextPageParam(l[i],l,o[i],o):void 0}function F2(n,{pages:l,pageParams:o}){var i;return l.length>0?(i=n.getPreviousPageParam)==null?void 0:i.call(n,l[0],l,o[0],o):void 0}var ri,rr,ii,_n,ir,At,js,sr,xn,qg,_a,rg,Z2=(rg=class extends Bg{constructor(l){super();fe(this,xn);fe(this,ri);fe(this,rr);fe(this,ii);fe(this,_n);fe(this,ir);fe(this,At);fe(this,js);fe(this,sr);ie(this,sr,!1),ie(this,js,l.defaultOptions),this.setOptions(l.options),this.observers=[],ie(this,ir,l.client),ie(this,_n,C(this,ir).getQueryCache()),this.queryKey=l.queryKey,this.queryHash=l.queryHash,ie(this,rr,yx(this.options)),this.state=l.state??C(this,rr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,ri)}get promise(){var l;return(l=C(this,At))==null?void 0:l.promise}setOptions(l){if(this.options={...C(this,js),...l},l!=null&&l._type&&ie(this,ri,l._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=yx(this.options);o.data!==void 0&&(this.setState(bx(o.data,o.dataUpdatedAt)),ie(this,rr,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,_n).remove(this)}setData(l,o){const i=rf(this.state.data,l,this.options);return we(this,xn,_a).call(this,{data:i,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),i}setState(l){we(this,xn,_a).call(this,{type:"setState",state:l})}cancel(l){var i,u;const o=(i=C(this,At))==null?void 0:i.promise;return(u=C(this,At))==null||u.cancel(l),o?o.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,rr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(l=>gn(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(l=>Ol(l.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(l=0){return this.state.data===void 0?!0:l==="static"?!1:this.state.isInvalidated?!0:!_g(this.state.dataUpdatedAt,l)}onFocus(){var o;const l=this.observers.find(i=>i.shouldFetchOnWindowFocus());l==null||l.refetch({cancelRefetch:!1}),(o=C(this,At))==null||o.continue()}onOnline(){var o;const l=this.observers.find(i=>i.shouldFetchOnReconnect());l==null||l.refetch({cancelRefetch:!1}),(o=C(this,At))==null||o.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),C(this,_n).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){this.observers.includes(l)&&(this.observers=this.observers.filter(o=>o!==l),this.observers.length||(C(this,At)&&(C(this,sr)||we(this,xn,qg).call(this)?C(this,At).cancel({revert:!0}):C(this,At).cancelRetry()),this.scheduleGc()),C(this,_n).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||we(this,xn,_a).call(this,{type:"invalidate"})}async fetch(l,o){var x,y,g,j,w,T,E,D,R,L,Q;if(this.state.fetchStatus!=="idle"&&((x=C(this,At))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(C(this,At))return C(this,At).continueRetry(),C(this,At).promise}if(l&&this.setOptions(l),!this.options.queryFn){const P=this.observers.find(G=>G.options.queryFn);P&&this.setOptions(P.options)}const i=new AbortController,u=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(ie(this,sr,!0),i.signal)})},f=()=>{const P=Dg(this.options,o),H=(()=>{const $={client:C(this,ir),queryKey:this.queryKey,meta:this.meta};return u($),$})();return ie(this,sr,!1),this.options.persister?this.options.persister(P,H,this):P(H)},h=(()=>{const P={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:C(this,ir),state:this.state,fetchFn:f};return u(P),P})(),v=C(this,ri)==="infinite"?X2(this.options.pages):this.options.behavior;v==null||v.onFetch(h,this),ie(this,ii,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=h.fetchOptions)==null?void 0:y.meta))&&we(this,xn,_a).call(this,{type:"fetch",meta:(g=h.fetchOptions)==null?void 0:g.meta}),ie(this,At,Lg({initialPromise:o==null?void 0:o.initialPromise,fn:h.fetchFn,onCancel:P=>{P instanceof of&&P.revert&&this.setState({...C(this,ii),fetchStatus:"idle"}),i.abort()},onFail:(P,G)=>{we(this,xn,_a).call(this,{type:"failed",failureCount:P,error:G})},onPause:()=>{we(this,xn,_a).call(this,{type:"pause"})},onContinue:()=>{we(this,xn,_a).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const P=await C(this,At).start();if(P===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(P),(w=(j=C(this,_n).config).onSuccess)==null||w.call(j,P,this),(E=(T=C(this,_n).config).onSettled)==null||E.call(T,P,this.state.error,this),P}catch(P){if(P instanceof of){if(P.silent)return C(this,At).promise;if(P.revert){if(this.state.data===void 0)throw P;return this.state.data}}throw we(this,xn,_a).call(this,{type:"error",error:P}),(R=(D=C(this,_n).config).onError)==null||R.call(D,P,this),(Q=(L=C(this,_n).config).onSettled)==null||Q.call(L,this.state.data,P,this),P}finally{this.scheduleGc()}}},ri=new WeakMap,rr=new WeakMap,ii=new WeakMap,_n=new WeakMap,ir=new WeakMap,At=new WeakMap,js=new WeakMap,sr=new WeakMap,xn=new WeakSet,qg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_a=function(l){const o=i=>{switch(l.type){case"failed":return{...i,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...$g(i.data,this.options),fetchMeta:l.meta??null};case"success":const u={...i,...bx(l.data,l.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ie(this,ii,l.manual?u:void 0),u;case"error":const f=l.error;return{...i,error:f,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...l.state}}};this.state=o(this.state),wt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),C(this,_n).notify({query:this,type:"updated",action:l})})},rg);function $g(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ug(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function bx(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yx(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,o=l!==void 0,i=o?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Wt,ze,Ns,Ht,or,si,Oa,Al,ws,oi,ci,cr,ur,El,ui,Qe,hs,cf,uf,df,ff,mf,hf,pf,Qg,ig,J2=(ig=class extends xi{constructor(l,o){super();fe(this,Qe);fe(this,Wt);fe(this,ze);fe(this,Ns);fe(this,Ht);fe(this,or);fe(this,si);fe(this,Oa);fe(this,Al);fe(this,ws);fe(this,oi);fe(this,ci);fe(this,cr);fe(this,ur);fe(this,El);fe(this,ui,new Set);this.options=o,ie(this,Wt,l),ie(this,Al,null),ie(this,Oa,sf()),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ze).addObserver(this),Sx(C(this,ze),this.options)?we(this,Qe,hs).call(this):this.updateResult(),we(this,Qe,ff).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(C(this,ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(C(this,ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,we(this,Qe,mf).call(this),we(this,Qe,hf).call(this),C(this,ze).removeObserver(this)}setOptions(l){const o=this.options,i=C(this,ze);if(this.options=C(this,Wt).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gn(this.options.enabled,C(this,ze))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");we(this,Qe,pf).call(this),C(this,ze).setOptions(this.options),o._defaulted&&!sc(this.options,o)&&C(this,Wt).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ze),observer:this});const u=this.hasListeners();u&&jx(C(this,ze),i,this.options,o)&&we(this,Qe,hs).call(this),this.updateResult(),u&&(C(this,ze)!==i||gn(this.options.enabled,C(this,ze))!==gn(o.enabled,C(this,ze))||Ol(this.options.staleTime,C(this,ze))!==Ol(o.staleTime,C(this,ze)))&&we(this,Qe,cf).call(this);const f=we(this,Qe,uf).call(this);u&&(C(this,ze)!==i||gn(this.options.enabled,C(this,ze))!==gn(o.enabled,C(this,ze))||f!==C(this,El))&&we(this,Qe,df).call(this,f)}getOptimisticResult(l){const o=C(this,Wt).getQueryCache().build(C(this,Wt),l),i=this.createResult(o,l);return W2(this,i)&&(ie(this,Ht,i),ie(this,si,this.options),ie(this,or,C(this,ze).state)),i}getCurrentResult(){return C(this,Ht)}trackResult(l,o){return new Proxy(l,{get:(i,u)=>(this.trackProp(u),o==null||o(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,Oa).status==="pending"&&C(this,Oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,u))})}trackProp(l){C(this,ui).add(l)}getCurrentQuery(){return C(this,ze)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const o=C(this,Wt).defaultQueryOptions(l),i=C(this,Wt).getQueryCache().build(C(this,Wt),o);return i.fetch().then(()=>this.createResult(i,o))}fetch(l){return we(this,Qe,hs).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ht)))}createResult(l,o){var J;const i=C(this,ze),u=this.options,f=C(this,Ht),p=C(this,or),h=C(this,si),x=l!==i?l.state:C(this,Ns),{state:y}=l;let g={...y},j=!1,w;if(o._optimisticResults){const te=this.hasListeners(),F=!te&&Sx(l,o),Z=te&&jx(l,i,o,u);(F||Z)&&(g={...g,...$g(y.data,l.options)}),o._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:T,errorUpdatedAt:E,status:D}=g;w=g.data;let R=!1;if(o.placeholderData!==void 0&&w===void 0&&D==="pending"){let te;f!=null&&f.isPlaceholderData&&o.placeholderData===(h==null?void 0:h.placeholderData)?(te=f.data,R=!0):te=typeof o.placeholderData=="function"?o.placeholderData((J=C(this,ci))==null?void 0:J.state.data,C(this,ci)):o.placeholderData,te!==void 0&&(D="success",w=rf(f==null?void 0:f.data,te,o),j=!0)}if(o.select&&w!==void 0&&!R)if(f&&w===(p==null?void 0:p.data)&&o.select===C(this,ws))w=C(this,oi);else try{ie(this,ws,o.select),w=o.select(w),w=rf(f==null?void 0:f.data,w,o),ie(this,oi,w),ie(this,Al,null)}catch(te){ie(this,Al,te)}C(this,Al)&&(T=C(this,Al),w=C(this,oi),E=Date.now(),D="error");const L=g.fetchStatus==="fetching",Q=D==="pending",P=D==="error",G=Q&&L,H=w!==void 0,I={status:D,fetchStatus:g.fetchStatus,isPending:Q,isSuccess:D==="success",isError:P,isInitialLoading:G,isLoading:G,data:w,dataUpdatedAt:g.dataUpdatedAt,error:T,errorUpdatedAt:E,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:l.isFetched(),isFetchedAfterMount:g.dataUpdateCount>x.dataUpdateCount||g.errorUpdateCount>x.errorUpdateCount,isFetching:L,isRefetching:L&&!Q,isLoadingError:P&&!H,isPaused:g.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:P&&H,isStale:Kf(l,o),refetch:this.refetch,promise:C(this,Oa),isEnabled:gn(o.enabled,l)!==!1};if(this.options.experimental_prefetchInRender){const te=I.data!==void 0,F=I.status==="error"&&!te,Z=me=>{F?me.reject(I.error):te&&me.resolve(I.data)},se=()=>{const me=ie(this,Oa,I.promise=sf());Z(me)},xe=C(this,Oa);switch(xe.status){case"pending":l.queryHash===i.queryHash&&Z(xe);break;case"fulfilled":(F||I.data!==xe.value)&&se();break;case"rejected":(!F||I.error!==xe.reason)&&se();break}}return I}updateResult(){const l=C(this,Ht),o=this.createResult(C(this,ze),this.options);if(ie(this,or,C(this,ze).state),ie(this,si,this.options),C(this,or).data!==void 0&&ie(this,ci,C(this,ze)),sc(o,l))return;ie(this,Ht,o);const i=()=>{if(!l)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!C(this,ui).size)return!0;const p=new Set(f??C(this,ui));return this.options.throwOnError&&p.add("error"),Object.keys(C(this,Ht)).some(h=>{const v=h;return C(this,Ht)[v]!==l[v]&&p.has(v)})};we(this,Qe,Qg).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&we(this,Qe,ff).call(this)}},Wt=new WeakMap,ze=new WeakMap,Ns=new WeakMap,Ht=new WeakMap,or=new WeakMap,si=new WeakMap,Oa=new WeakMap,Al=new WeakMap,ws=new WeakMap,oi=new WeakMap,ci=new WeakMap,cr=new WeakMap,ur=new WeakMap,El=new WeakMap,ui=new WeakMap,Qe=new WeakSet,hs=function(l){we(this,Qe,pf).call(this);let o=C(this,ze).fetch(this.options,l);return l!=null&&l.throwOnError||(o=o.catch(Pt)),o},cf=function(){we(this,Qe,mf).call(this);const l=Ol(this.options.staleTime,C(this,ze));if(gs.isServer()||C(this,Ht).isStale||!af(l))return;const i=_g(C(this,Ht).dataUpdatedAt,l)+1;ie(this,cr,nr.setTimeout(()=>{C(this,Ht).isStale||this.updateResult()},i))},uf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ze)):this.options.refetchInterval)??!1},df=function(l){we(this,Qe,hf).call(this),ie(this,El,l),!(gs.isServer()||gn(this.options.enabled,C(this,ze))===!1||!af(C(this,El))||C(this,El)===0)&&ie(this,ur,nr.setInterval(()=>{(this.options.refetchIntervalInBackground||$f.isFocused())&&we(this,Qe,hs).call(this)},C(this,El)))},ff=function(){we(this,Qe,cf).call(this),we(this,Qe,df).call(this,we(this,Qe,uf).call(this))},mf=function(){C(this,cr)!==void 0&&(nr.clearTimeout(C(this,cr)),ie(this,cr,void 0))},hf=function(){C(this,ur)!==void 0&&(nr.clearInterval(C(this,ur)),ie(this,ur,void 0))},pf=function(){const l=C(this,Wt).getQueryCache().build(C(this,Wt),this.options);if(l===C(this,ze))return;const o=C(this,ze);ie(this,ze,l),ie(this,Ns,l.state),this.hasListeners()&&(o==null||o.removeObserver(this),l.addObserver(this))},Qg=function(l){wt.batch(()=>{l.listeners&&this.listeners.forEach(o=>{o(C(this,Ht))}),C(this,Wt).getQueryCache().notify({query:C(this,ze),type:"observerResultsUpdated"})})},ig);function I2(n,l){return gn(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&gn(l.retryOnMount,n)===!1)}function Sx(n,l){return I2(n,l)||n.state.data!==void 0&&vf(n,l,l.refetchOnMount)}function vf(n,l,o){if(gn(l.enabled,n)!==!1&&Ol(l.staleTime,n)!=="static"){const i=typeof o=="function"?o(n):o;return i==="always"||i!==!1&&Kf(n,l)}return!1}function jx(n,l,o,i){return(n!==l||gn(i.enabled,n)===!1)&&(!o.suspense||n.state.status!=="error")&&Kf(n,o)}function Kf(n,l){return gn(l.enabled,n)!==!1&&n.isStaleByTime(Ol(l.staleTime,n))}function W2(n,l){return!sc(n.getCurrentResult(),l)}var Ms,Jn,Ut,dr,In,Nl,sg,eS=(sg=class extends Bg{constructor(l){super();fe(this,In);fe(this,Ms);fe(this,Jn);fe(this,Ut);fe(this,dr);ie(this,Ms,l.client),this.mutationId=l.mutationId,ie(this,Ut,l.mutationCache),ie(this,Jn,[]),this.state=l.state||Hg(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){C(this,Jn).includes(l)||(C(this,Jn).push(l),this.clearGcTimeout(),C(this,Ut).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){ie(this,Jn,C(this,Jn).filter(o=>o!==l)),this.scheduleGc(),C(this,Ut).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){C(this,Jn).length||(this.state.status==="pending"?this.scheduleGc():C(this,Ut).remove(this))}continue(){var l;return((l=C(this,dr))==null?void 0:l.continue())??this.execute(this.state.variables)}async execute(l){var p,h,v,x,y,g,j,w,T,E,D,R,L,Q,P,G,H,$;const o=()=>{we(this,In,Nl).call(this,{type:"continue"})},i={client:C(this,Ms),meta:this.options.meta,mutationKey:this.options.mutationKey};ie(this,dr,Lg({fn:()=>this.options.mutationFn?this.options.mutationFn(l,i):Promise.reject(new Error("No mutationFn found")),onFail:(I,J)=>{we(this,In,Nl).call(this,{type:"failed",failureCount:I,error:J})},onPause:()=>{we(this,In,Nl).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Ut).canRun(this)}));const u=this.state.status==="pending",f=!C(this,dr).canStart();try{if(u)o();else{we(this,In,Nl).call(this,{type:"pending",variables:l,isPaused:f}),C(this,Ut).config.onMutate&&await C(this,Ut).config.onMutate(l,this,i);const J=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,l,i));J!==this.state.context&&we(this,In,Nl).call(this,{type:"pending",context:J,variables:l,isPaused:f})}const I=await C(this,dr).start();return await((x=(v=C(this,Ut).config).onSuccess)==null?void 0:x.call(v,I,l,this.state.context,this,i)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,I,l,this.state.context,i)),await((w=(j=C(this,Ut).config).onSettled)==null?void 0:w.call(j,I,null,this.state.variables,this.state.context,this,i)),await((E=(T=this.options).onSettled)==null?void 0:E.call(T,I,null,l,this.state.context,i)),we(this,In,Nl).call(this,{type:"success",data:I}),I}catch(I){try{await((R=(D=C(this,Ut).config).onError)==null?void 0:R.call(D,I,l,this.state.context,this,i))}catch(J){Promise.reject(J)}try{await((Q=(L=this.options).onError)==null?void 0:Q.call(L,I,l,this.state.context,i))}catch(J){Promise.reject(J)}try{await((G=(P=C(this,Ut).config).onSettled)==null?void 0:G.call(P,void 0,I,this.state.variables,this.state.context,this,i))}catch(J){Promise.reject(J)}try{await(($=(H=this.options).onSettled)==null?void 0:$.call(H,void 0,I,l,this.state.context,i))}catch(J){Promise.reject(J)}throw we(this,In,Nl).call(this,{type:"error",error:I}),I}finally{C(this,Ut).runNext(this)}}},Ms=new WeakMap,Jn=new WeakMap,Ut=new WeakMap,dr=new WeakMap,In=new WeakSet,Nl=function(l){const o=i=>{switch(l.type){case"failed":return{...i,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...i,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:l.error,failureCount:i.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=o(this.state),wt.batch(()=>{C(this,Jn).forEach(i=>{i.onMutationUpdate(l)}),C(this,Ut).notify({mutation:this,type:"updated",action:l})})},sg);function Hg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Da,qn,Cs,og,tS=(og=class extends xi{constructor(l={}){super();fe(this,Da);fe(this,qn);fe(this,Cs);this.config=l,ie(this,Da,new Set),ie(this,qn,new Map),ie(this,Cs,0)}build(l,o,i){const u=new eS({client:l,mutationCache:this,mutationId:++Vo(this,Cs)._,options:l.defaultMutationOptions(o),state:i});return this.add(u),u}add(l){C(this,Da).add(l);const o=Fo(l);if(typeof o=="string"){const i=C(this,qn).get(o);i?i.push(l):C(this,qn).set(o,[l])}this.notify({type:"added",mutation:l})}remove(l){if(C(this,Da).delete(l)){const o=Fo(l);if(typeof o=="string"){const i=C(this,qn).get(o);if(i)if(i.length>1){const u=i.indexOf(l);u!==-1&&i.splice(u,1)}else i[0]===l&&C(this,qn).delete(o)}}this.notify({type:"removed",mutation:l})}canRun(l){const o=Fo(l);if(typeof o=="string"){const i=C(this,qn).get(o),u=i==null?void 0:i.find(f=>f.state.status==="pending");return!u||u===l}else return!0}runNext(l){var i;const o=Fo(l);if(typeof o=="string"){const u=(i=C(this,qn).get(o))==null?void 0:i.find(f=>f!==l&&f.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{C(this,Da).forEach(l=>{this.notify({type:"removed",mutation:l})}),C(this,Da).clear(),C(this,qn).clear()})}getAll(){return Array.from(C(this,Da))}find(l){const o={exact:!0,...l};return this.getAll().find(i=>px(o,i))}findAll(l={}){return this.getAll().filter(o=>px(l,o))}notify(l){wt.batch(()=>{this.listeners.forEach(o=>{o(l)})})}resumePausedMutations(){const l=this.getAll().filter(o=>o.state.isPaused);return wt.batch(()=>Promise.all(l.map(o=>o.continue().catch(Pt))))}},Da=new WeakMap,qn=new WeakMap,Cs=new WeakMap,og);function Fo(n){var l;return(l=n.options.scope)==null?void 0:l.id}var Ua,kl,en,La,qa,nc,xf,cg,nS=(cg=class extends xi{constructor(o,i){super();fe(this,qa);fe(this,Ua);fe(this,kl);fe(this,en);fe(this,La);ie(this,Ua,o),this.setOptions(i),this.bindMethods(),we(this,qa,nc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(o){var u;const i=this.options;this.options=C(this,Ua).defaultMutationOptions(o),sc(this.options,i)||C(this,Ua).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,en),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&fr(i.mutationKey)!==fr(this.options.mutationKey)?this.reset():((u=C(this,en))==null?void 0:u.state.status)==="pending"&&C(this,en).setOptions(this.options)}onUnsubscribe(){var o;this.hasListeners()||(o=C(this,en))==null||o.removeObserver(this)}onMutationUpdate(o){we(this,qa,nc).call(this),we(this,qa,xf).call(this,o)}getCurrentResult(){return C(this,kl)}reset(){var o;(o=C(this,en))==null||o.removeObserver(this),ie(this,en,void 0),we(this,qa,nc).call(this),we(this,qa,xf).call(this)}mutate(o,i){var u;return ie(this,La,i),(u=C(this,en))==null||u.removeObserver(this),ie(this,en,C(this,Ua).getMutationCache().build(C(this,Ua),this.options)),C(this,en).addObserver(this),C(this,en).execute(o)}},Ua=new WeakMap,kl=new WeakMap,en=new WeakMap,La=new WeakMap,qa=new WeakSet,nc=function(){var i;const o=((i=C(this,en))==null?void 0:i.state)??Hg();ie(this,kl,{...o,isPending:o.status==="pending",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset})},xf=function(o){wt.batch(()=>{var i,u,f,p,h,v,x,y;if(C(this,La)&&this.hasListeners()){const g=C(this,kl).variables,j=C(this,kl).context,w={client:C(this,Ua),meta:this.options.meta,mutationKey:this.options.mutationKey};if((o==null?void 0:o.type)==="success"){try{(u=(i=C(this,La)).onSuccess)==null||u.call(i,o.data,g,j,w)}catch(T){Promise.reject(T)}try{(p=(f=C(this,La)).onSettled)==null||p.call(f,o.data,null,g,j,w)}catch(T){Promise.reject(T)}}else if((o==null?void 0:o.type)==="error"){try{(v=(h=C(this,La)).onError)==null||v.call(h,o.error,g,j,w)}catch(T){Promise.reject(T)}try{(y=(x=C(this,La)).onSettled)==null||y.call(x,void 0,o.error,g,j,w)}catch(T){Promise.reject(T)}}}this.listeners.forEach(g=>{g(C(this,kl))})})},cg),Wn,ug,aS=(ug=class extends xi{constructor(l={}){super();fe(this,Wn);this.config=l,ie(this,Wn,new Map)}build(l,o,i){const u=o.queryKey,f=o.queryHash??Qf(u,o);let p=this.get(f);return p||(p=new Z2({client:l,queryKey:u,queryHash:f,options:l.defaultQueryOptions(o),state:i,defaultOptions:l.getQueryDefaults(u)}),this.add(p)),p}add(l){C(this,Wn).has(l.queryHash)||(C(this,Wn).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){const o=C(this,Wn).get(l.queryHash);o&&(l.destroy(),o===l&&C(this,Wn).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){wt.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return C(this,Wn).get(l)}getAll(){return[...C(this,Wn).values()]}find(l){const o={exact:!0,...l};return this.getAll().find(i=>hx(o,i))}findAll(l={}){const o=this.getAll();return Object.keys(l).length>0?o.filter(i=>hx(l,i)):o}notify(l){wt.batch(()=>{this.listeners.forEach(o=>{o(l)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},Wn=new WeakMap,ug),ot,Rl,zl,di,fi,_l,mi,hi,dg,lS=(dg=class{constructor(n={}){fe(this,ot);fe(this,Rl);fe(this,zl);fe(this,di);fe(this,fi);fe(this,_l);fe(this,mi);fe(this,hi);ie(this,ot,n.queryCache||new aS),ie(this,Rl,n.mutationCache||new tS),ie(this,zl,n.defaultOptions||{}),ie(this,di,new Map),ie(this,fi,new Map),ie(this,_l,0)}mount(){Vo(this,_l)._++,C(this,_l)===1&&(ie(this,mi,$f.subscribe(async n=>{n&&(await this.resumePausedMutations(),C(this,ot).onFocus())})),ie(this,hi,oc.subscribe(async n=>{n&&(await this.resumePausedMutations(),C(this,ot).onOnline())})))}unmount(){var n,l;Vo(this,_l)._--,C(this,_l)===0&&((n=C(this,mi))==null||n.call(this),ie(this,mi,void 0),(l=C(this,hi))==null||l.call(this),ie(this,hi,void 0))}isFetching(n){return C(this,ot).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return C(this,Rl).findAll({...n,status:"pending"}).length}getQueryData(n){var o;const l=this.defaultQueryOptions({queryKey:n});return(o=C(this,ot).get(l.queryHash))==null?void 0:o.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),o=C(this,ot).build(this,l),i=o.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&o.isStaleByTime(Ol(l.staleTime,o))&&this.prefetchQuery(l),Promise.resolve(i))}getQueriesData(n){return C(this,ot).findAll(n).map(({queryKey:l,state:o})=>{const i=o.data;return[l,i]})}setQueryData(n,l,o){const i=this.defaultQueryOptions({queryKey:n}),u=C(this,ot).get(i.queryHash),f=u==null?void 0:u.state.data,p=B2(l,f);if(p!==void 0)return C(this,ot).build(this,i).setData(p,{...o,manual:!0})}setQueriesData(n,l,o){return wt.batch(()=>C(this,ot).findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,l,o)]))}getQueryState(n){var o;const l=this.defaultQueryOptions({queryKey:n});return(o=C(this,ot).get(l.queryHash))==null?void 0:o.state}removeQueries(n){const l=C(this,ot);wt.batch(()=>{l.findAll(n).forEach(o=>{l.remove(o)})})}resetQueries(n,l){const o=C(this,ot);return wt.batch(()=>(o.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const o={revert:!0,...l},i=wt.batch(()=>C(this,ot).findAll(n).map(u=>u.cancel(o)));return Promise.all(i).then(Pt).catch(Pt)}invalidateQueries(n,l={}){return wt.batch(()=>(C(this,ot).findAll(n).forEach(o=>{o.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},l)))}refetchQueries(n,l={}){const o={...l,cancelRefetch:l.cancelRefetch??!0},i=wt.batch(()=>C(this,ot).findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,o);return o.throwOnError||(f=f.catch(Pt)),u.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(Pt)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const o=C(this,ot).build(this,l);return o.isStaleByTime(Ol(l.staleTime,o))?o.fetch(l):Promise.resolve(o.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Pt).catch(Pt)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Pt).catch(Pt)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return oc.isOnline()?C(this,Rl).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ot)}getMutationCache(){return C(this,Rl)}getDefaultOptions(){return C(this,zl)}setDefaultOptions(n){ie(this,zl,n)}setQueryDefaults(n,l){C(this,di).set(fr(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...C(this,di).values()],o={};return l.forEach(i=>{xs(n,i.queryKey)&&Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(n,l){C(this,fi).set(fr(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...C(this,fi).values()],o={};return l.forEach(i=>{xs(n,i.mutationKey)&&Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(n){if(n._defaulted)return n;const l={...C(this,zl).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=Qf(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===Hf&&(l.enabled=!1),l}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...C(this,zl).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){C(this,ot).clear(),C(this,Rl).clear()}},ot=new WeakMap,Rl=new WeakMap,zl=new WeakMap,di=new WeakMap,fi=new WeakMap,_l=new WeakMap,mi=new WeakMap,hi=new WeakMap,dg),Pg=S.createContext(void 0),St=n=>{const l=S.useContext(Pg);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},rS=({client:n,children:l})=>(S.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),s.jsx(Pg.Provider,{value:n,children:l})),Kg=S.createContext(!1),iS=()=>S.useContext(Kg);Kg.Provider;function sS(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var oS=S.createContext(sS()),cS=()=>S.useContext(oS),uS=(n,l,o)=>{const i=o!=null&&o.state.error&&typeof n.throwOnError=="function"?Pf(n.throwOnError,[o.state.error,o]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||i)&&(l.isReset()||(n.retryOnMount=!1))},dS=n=>{S.useEffect(()=>{n.clearReset()},[n])},fS=({result:n,errorResetBoundary:l,throwOnError:o,query:i,suspense:u})=>n.isError&&!l.isReset()&&!n.isFetching&&i&&(u&&n.data===void 0||Pf(o,[n.error,i])),mS=n=>{if(n.suspense){const o=u=>u==="static"?u:Math.max(u??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...u)=>o(i(...u)):o(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},hS=(n,l)=>n.isLoading&&n.isFetching&&!l,pS=(n,l)=>(n==null?void 0:n.suspense)&&l.isPending,Nx=(n,l,o)=>l.fetchOptimistic(n).catch(()=>{o.clearReset()});function vS(n,l,o){var w,T,E,D;const i=iS(),u=cS(),f=St(),p=f.defaultQueryOptions(n);(T=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||T.call(w,p);const h=f.getQueryCache().get(p.queryHash),v=n.subscribed!==!1;p._optimisticResults=i?"isRestoring":v?"optimistic":void 0,mS(p),uS(p,u,h),dS(u);const x=!f.getQueryCache().get(p.queryHash),[y]=S.useState(()=>new l(f,p)),g=y.getOptimisticResult(p),j=!i&&v;if(S.useSyncExternalStore(S.useCallback(R=>{const L=j?y.subscribe(wt.batchCalls(R)):Pt;return y.updateResult(),L},[y,j]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(p)},[p,y]),pS(p,g))throw Nx(p,y,u);if(fS({result:g,errorResetBoundary:u,throwOnError:p.throwOnError,query:h,suspense:p.suspense}))throw g.error;if((D=(E=f.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||D.call(E,p,g),p.experimental_prefetchInRender&&!gs.isServer()&&hS(g,i)){const R=x?Nx(p,y,u):h==null?void 0:h.promise;R==null||R.catch(Pt).finally(()=>{y.updateResult()})}return p.notifyOnChangeProps?g:y.trackResult(g)}function Yt(n,l){return vS(n,J2)}function ct(n,l){const o=St(),[i]=S.useState(()=>new nS(o,n));S.useEffect(()=>{i.setOptions(n)},[i,n]);const u=S.useSyncExternalStore(S.useCallback(p=>i.subscribe(wt.batchCalls(p)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=S.useCallback((p,h)=>{i.mutate(p,h).catch(Pt)},[i]);if(u.error&&Pf(i.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}/**
61
- * @license lucide-react v1.17.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const Yg=(...n)=>n.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).join(" ").trim();/**
66
- * @license lucide-react v1.17.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const xS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
- * @license lucide-react v1.17.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const gS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,o,i)=>i?i.toUpperCase():o.toLowerCase());/**
76
- * @license lucide-react v1.17.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const wx=n=>{const l=gS(n);return l.charAt(0).toUpperCase()+l.slice(1)};/**
81
- * @license lucide-react v1.17.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */var Hd={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"};/**
86
- * @license lucide-react v1.17.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const bS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},yS=S.createContext({}),SS=()=>S.useContext(yS),jS=S.forwardRef(({color:n,size:l,strokeWidth:o,absoluteStrokeWidth:i,className:u="",children:f,iconNode:p,...h},v)=>{const{size:x=24,strokeWidth:y=2,absoluteStrokeWidth:g=!1,color:j="currentColor",className:w=""}=SS()??{},T=i??g?Number(o??y)*24/Number(l??x):o??y;return S.createElement("svg",{ref:v,...Hd,width:l??x??Hd.width,height:l??x??Hd.height,stroke:n??j,strokeWidth:T,className:Yg("lucide",w,u),...!f&&!bS(h)&&{"aria-hidden":"true"},...h},[...p.map(([E,D])=>S.createElement(E,D)),...Array.isArray(f)?f:[f]])});/**
91
- * @license lucide-react v1.17.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const _e=(n,l)=>{const o=S.forwardRef(({className:i,...u},f)=>S.createElement(jS,{ref:f,iconNode:l,className:Yg(`lucide-${xS(wx(n))}`,`lucide-${n}`,i),...u}));return o.displayName=wx(n),o};/**
96
- * @license lucide-react v1.17.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const NS=[["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"}]],Yf=_e("activity",NS);/**
101
- * @license lucide-react v1.17.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const wS=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],MS=_e("arrow-down",wS);/**
106
- * @license lucide-react v1.17.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const CS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vc=_e("arrow-right",CS);/**
111
- * @license lucide-react v1.17.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const TS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],AS=_e("arrow-up-right",TS);/**
116
- * @license lucide-react v1.17.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const ES=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Gg=_e("arrow-up",ES);/**
121
- * @license lucide-react v1.17.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const kS=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],RS=_e("box",kS);/**
126
- * @license lucide-react v1.17.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const zS=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],_S=_e("boxes",zS);/**
131
- * @license lucide-react v1.17.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const OS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Kt=_e("check",OS);/**
136
- * @license lucide-react v1.17.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const DS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],US=_e("chevron-down",DS);/**
141
- * @license lucide-react v1.17.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const LS=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],gf=_e("circle-dashed",LS);/**
146
- * @license lucide-react v1.17.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const BS=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],qS=_e("clipboard",BS);/**
151
- * @license lucide-react v1.17.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const $S=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],QS=_e("copy",$S);/**
156
- * @license lucide-react v1.17.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const HS=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],PS=_e("cpu",HS);/**
161
- * @license lucide-react v1.17.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const KS=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],bs=_e("credit-card",KS);/**
166
- * @license lucide-react v1.17.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const YS=[["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"}]],GS=_e("database",YS);/**
171
- * @license lucide-react v1.17.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const VS=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Vg=_e("git-branch",VS);/**
176
- * @license lucide-react v1.17.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const XS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],FS=_e("image",XS);/**
181
- * @license lucide-react v1.17.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const ZS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],JS=_e("info",ZS);/**
186
- * @license lucide-react v1.17.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const IS=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],WS=_e("landmark",IS);/**
191
- * @license lucide-react v1.17.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const ej=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],tj=_e("list",ej);/**
196
- * @license lucide-react v1.17.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const nj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yt=_e("loader-circle",nj);/**
201
- * @license lucide-react v1.17.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const aj=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],lj=_e("network",aj);/**
206
- * @license lucide-react v1.17.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const rj=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ij=_e("pencil",rj);/**
211
- * @license lucide-react v1.17.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const sj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ys=_e("plus",sj);/**
216
- * @license lucide-react v1.17.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const oj=[["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"}]],mr=_e("refresh-cw",oj);/**
221
- * @license lucide-react v1.17.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const cj=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],uj=_e("rotate-ccw",cj);/**
226
- * @license lucide-react v1.17.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const dj=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ks=_e("search",dj);/**
231
- * @license lucide-react v1.17.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const fj=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],mj=_e("settings-2",fj);/**
236
- * @license lucide-react v1.17.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const hj=[["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"}]],pj=_e("shield-check",hj);/**
241
- * @license lucide-react v1.17.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const vj=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],xj=_e("smartphone",vj);/**
246
- * @license lucide-react v1.17.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const gj=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bj=_e("terminal",gj);/**
251
- * @license lucide-react v1.17.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const yj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gf=_e("trash-2",yj);/**
256
- * @license lucide-react v1.17.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const Sj=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],jj=_e("trending-up",Sj);/**
261
- * @license lucide-react v1.17.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const Nj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2",key:"4125el"}],["path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21",key:"1dpki6"}]],ps=_e("wallet-cards",Nj);/**
266
- * @license lucide-react v1.17.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const wj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dl=_e("x",wj);class Xg extends Error{constructor(o,i,u){super(o);Rd(this,"status");Rd(this,"code");this.status=i,this.code=u}}async function Lt(n){var o,i;const l=await fetch(n);if(!l.ok){const u=await l.json().catch(()=>({}));throw new Xg(((o=u.error)==null?void 0:o.message)??`${n} returned ${l.status}`,l.status,(i=u.error)==null?void 0:i.code)}return l.json()}async function tt(n,l,o){var u,f;const i=await fetch(l,{method:n,headers:o?{"content-type":"application/json"}:void 0,body:o?JSON.stringify(o):void 0});if(!i.ok){const p=await i.json().catch(()=>({}));throw new Xg(((u=p.error)==null?void 0:u.message)??`${n} ${l} returned ${i.status}`,i.status,(f=p.error)==null?void 0:f.code)}return i.json()}function xc(){return Yt({queryKey:["ledger","inferences"],queryFn:()=>Lt("/ledger/inferences"),refetchInterval:1e4})}function Mj(){return Yt({queryKey:["ledger","purchases"],queryFn:()=>Lt("/ledger/purchases"),refetchInterval:1e4})}function Vf(){return Yt({queryKey:["payments"],queryFn:()=>Lt("/payments"),refetchInterval:1e4})}function Cj(){const n=St();return ct({mutationFn:l=>tt("PUT","/payments/default",{method:l}),onSuccess:()=>{n.invalidateQueries({queryKey:["payments"]}),n.invalidateQueries({queryKey:["routing","provider-mode"]})}})}function Xf(){const n=St();return ct({mutationFn:()=>tt("POST","/payments/clawtip/activate"),onSuccess:()=>{n.invalidateQueries({queryKey:["payments"]})}})}function Ff(){return ct({mutationFn:()=>tt("POST","/payments/clawtip/recharge")})}function Fg(){return Yt({queryKey:["routing","strategy"],queryFn:()=>Lt("/routing/strategy")})}function Tj(){const n=St();return ct({mutationFn:l=>tt("PUT","/routing/strategy",l),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","strategy"]})}})}function Zg(){return Yt({queryKey:["routing","provider-mode"],queryFn:()=>Lt("/routing/provider-mode")})}function Aj(){const n=St();return ct({mutationFn:l=>tt("PUT","/routing/provider-mode",{mode:l}),onSuccess:l=>{n.setQueryData(["routing","provider-mode"],l),n.invalidateQueries({queryKey:["routing","provider-mode"]}),n.invalidateQueries({queryKey:["routing","auto-provider"]}),n.invalidateQueries({queryKey:["routing","strategy"]}),n.invalidateQueries({queryKey:["models"]})}})}function Jg(){return Yt({queryKey:["routing","auto-provider"],queryFn:()=>Lt("/routing/auto-provider")})}function Ej(){const n=St();return ct({mutationFn:l=>tt("PUT","/routing/auto-provider",l),onSuccess:l=>{n.setQueryData(["routing","auto-provider"],{config:l.config,active:l.autoEnabled,locked:l.locked.auto,paymentReady:l.paymentReady,paymentRequired:l.paymentRequired,paymentLabel:l.paymentLabel}),n.setQueryData(["routing","provider-mode"],l),n.invalidateQueries({queryKey:["routing","auto-provider"]}),n.invalidateQueries({queryKey:["routing","provider-mode"]}),n.invalidateQueries({queryKey:["routing","strategy"]}),n.invalidateQueries({queryKey:["prewarm","focus-set"]}),n.invalidateQueries({queryKey:["models"]})}})}function Zf(){return Yt({queryKey:["routing","manual-providers"],queryFn:()=>Lt("/routing/manual-providers")})}function kj(){const n=St();return ct({mutationFn:l=>tt("POST","/routing/manual-providers/local",l),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function Rj(){const n=St();return ct({mutationFn:({providerId:l,input:o})=>tt("PUT",`/routing/manual-providers/local/${encodeURIComponent(l)}`,o),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function zj(){const n=St();return ct({mutationFn:l=>tt("DELETE",`/routing/manual-providers/${encodeURIComponent(l)}`),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function _j(){const n=St();return ct({mutationFn:l=>tt("PUT","/routing/manual-providers/order",{providerIds:l}),onSuccess:l=>{n.setQueryData(["routing","manual-providers"],l),n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function Oj(){const n=St();return ct({mutationFn:l=>tt("PUT","/routing/manual-providers/routing",l),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function Dj(n){return tt("POST","/routing/manual-providers/probe",n)}function Uj(){const n=St();return ct({mutationFn:l=>tt("POST",`/routing/manual-providers/${encodeURIComponent(l)}/test`),onSuccess:()=>{n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["ledger","inferences"]})}})}function Lj(){const n=St();return ct({mutationFn:l=>tt("POST",`/routing/manual-providers/${encodeURIComponent(l)}/models/refresh`),onSuccess:l=>{n.setQueryData(["routing","manual-providers"],{version:1,updatedAt:new Date().toISOString(),routing:l.routing,providers:l.providers}),n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["models"]})}})}function Bj(n){const l=new URLSearchParams;for(const[o,i]of Object.entries(n))i!=null&&i!==""&&l.set(o,qj(i));return Yt({queryKey:["routing","preview",l.toString()],queryFn:()=>Lt(`/routing/preview?${l.toString()}`),enabled:!1})}function qj(n){return Array.isArray(n)?n.join(","):typeof n=="object"&&n!==null?Object.entries(n).map(([l,o])=>`${l}:${o}`).join(","):String(n)}function Jf(){return Yt({queryKey:["sellers"],queryFn:()=>Lt("/sellers"),refetchInterval:3e4})}function Rs(){return Yt({queryKey:["models"],queryFn:()=>Lt("/models"),refetchInterval:3e4})}function $j(){const n=St();return ct({mutationFn:l=>tt("POST",`/sellers/${encodeURIComponent(l)}/test`),onSuccess:()=>{n.invalidateQueries({queryKey:["models"]})}})}function Qj(){const n=St();return ct({mutationFn:()=>Lt("/models"),onSuccess:l=>{n.setQueryData(["models"],l),n.invalidateQueries({queryKey:["models"]}),n.invalidateQueries({queryKey:["sellers"]})}})}function Hj(){return Yt({queryKey:["prewarm","focus-set"],queryFn:()=>Lt("/v1.2/prewarm").then(n=>({ok:!0,focusSet:n.focusSet??[],source:"historical"}))})}async function bf(n){const l=Array.isArray(n)?{models:n}:n;return tt("PUT","/prewarm/focus-set",l)}function If(){return Yt({queryKey:["status"],queryFn:()=>Lt("/status"),refetchInterval:5e3})}function Pj(){return Yt({queryKey:["update","status"],queryFn:()=>Lt("/update/status"),refetchInterval:3600*1e3})}function Kj(){return ct({mutationFn:()=>tt("POST","/update/run")})}const Me="—",Pn="-",nn=n=>n<10?`0${n}`:`${n}`;function yf(n,l={}){if(!Number.isFinite(n))return Me;const o=n;return o<=0?Pn:l.compact===!1||o<1e4?Math.round(o).toLocaleString("en-US"):o<1e6?`${(o/1e3).toFixed(1)}K`:o<1e9?`${(o/1e6).toFixed(1)}M`:`${(o/1e9).toFixed(2)}B`}function ac(n){if(!Number.isFinite(n))return Me;const l=n;return l<=0?Pn:l<1e4?Math.round(l).toLocaleString("en-US"):l<1e6?`${(l/1e3).toFixed(2)}K`:l<1e9?`${(l/1e6).toFixed(2)}M`:`${(l/1e9).toFixed(2)}B`}function Ss(n){return Number.isFinite(n)?n<=0?Pn:`${n.toFixed(1)} tok/s`:Me}function Ig(n){return Number.isFinite(n)?n<=0?Pn:n.toFixed(1):Me}function Se(n){return Number.isFinite(n)?n===0?Pn:Math.round(n).toLocaleString("en-US"):Me}function Ba(n,l={}){if(!Number.isFinite(n))return Me;if(n===0)return Pn;const o=Math.abs(n/1e6),i=l.digits??(l.ledger&&o<.01?6:4),u=`$${(n/1e6).toFixed(i)}`;return l.signed&&n>=0?`+${u}`:u}function Yj(n,l={}){if(!Number.isFinite(n))return Me;if(n===0)return Pn;const i=`${Math.abs(n/1e6).toFixed(l.digits??4)} credit`;return l.signed?n>=0?`+${i}`:`-${i}`:n<0?`-${i}`:i}function wl(n,l={}){return Ba(n,{digits:l.digits??6})}function Gj(n){var i,u;const l=(i=n.paymentCurrency)==null?void 0:i.trim().toUpperCase(),o=(u=n.paymentAmount)==null?void 0:u.trim();return l==="USD"&&Number.isFinite(n.paymentAmountMinor)?`$${(n.paymentAmountMinor/100).toFixed(4)}`:l==="CNY"&&Number.isFinite(n.paymentAmountMinor)?`¥${(n.paymentAmountMinor/100).toFixed(2)} CNY`:o&&l?l==="USD"?`${Mx(l)}${o}`:`${Mx(l)}${o} ${l}`:Number.isFinite(n.paymentAmountMinor)&&l?`${Se(n.paymentAmountMinor)} ${l} minor`:Me}function Vj(n,l){if(!Number.isFinite(n)||!l)return Me;const o=l.trim().toUpperCase();return o==="USD"?`$${(n/100).toFixed(4)}`:o==="CNY"?`¥${(n/100).toFixed(2)} CNY`:`${Se(n)} ${o} minor`}function Mx(n){return n==="USD"?"$":n==="CNY"?"¥":n==="EUR"?"€":n==="GBP"?"£":""}function Xj(n,l,o={}){return!Number.isFinite(n)&&!Number.isFinite(l)?Me:`${Ba(n,o)} / ${Ba(l,o)}`}function na(n){if(!Number.isFinite(n))return Me;const l=Math.max(0,Math.round(n));return l===0?Pn:l<1e3?`${l}ms`:`${(l/1e3).toFixed(2)}s`}function Fj(n){return Number.isFinite(n)?`${Math.round(n*100)}%`:Me}function Wf(n){if(!Number.isFinite(n))return Me;const l=Math.max(0,n);return Jj(l)}function Sf(n,l){return Xj(n,l,{digits:4})}function cc(n){const l=Ba(n,{digits:4});return l===Me||l===Pn?l:`${l} / 1M Token`}function Zj(n){return Number.isFinite(n)?n<=0?Pn:`${n.toFixed(2)}x`:Me}function Jj(n){return String(n)}function bn(n){return n?n.trim().toLowerCase().replaceAll("_"," "):Me}function ea(n){const l=bn(n);return l==="ok"||l==="online"||l==="configured"||l==="settled"||l==="completed"||l==="success"||l==="active"||l==="healthy"?"green":l==="fallback"||l==="pending"||l==="degraded"||l==="preview"||l==="cooldown"||l==="full"?"amber":l==="failed"||l==="error"||l==="canceled"||l==="unhealthy"||l==="offline"?"red":l==="running"?"blue":"gray"}function zs(n){return n?n.startsWith("tbs-")&&n.length>10?n.slice(0,10):n.length<=12?n:n.slice(0,12):Me}function Ij(n){if(!n)return Me;const l=new Date(n);if(Number.isNaN(l.getTime()))return Me;const o=new Date,i=l.getFullYear()===o.getFullYear()&&l.getMonth()===o.getMonth()&&l.getDate()===o.getDate(),u=`${nn(l.getHours())}:${nn(l.getMinutes())}`;return i?u:`${nn(l.getMonth()+1)}/${nn(l.getDate())} ${u}`}function gc(n){if(!n)return Me;const l=new Date(n);return Number.isNaN(l.getTime())?Me:`${l.getFullYear()}-${nn(l.getMonth()+1)}-${nn(l.getDate())} ${nn(l.getHours())}:${nn(l.getMinutes())}:${nn(l.getSeconds())}`}function bc(n){if(!n)return Me;const l=new Date(n);return Number.isNaN(l.getTime())?Me:`${l.getFullYear()}/${nn(l.getMonth()+1)}/${nn(l.getDate())} ${nn(l.getHours())}:${nn(l.getMinutes())}:${nn(l.getSeconds())}`}function Wj(n){return Ij(n)}function Wg(n,l){const o=new Map;for(const i of[...l].sort((u,f)=>u.createdAt.localeCompare(f.createdAt)))!i.paymentMethod||i.balanceSnapshotMicros===void 0||o.set(ta(i.paymentMethod),i.balanceSnapshotMicros);return[...n].filter(i=>ta(i.method)!=="mock").sort((i,u)=>Number(u.isDefault)-Number(i.isDefault)||i.method.localeCompare(u.method)).map(i=>{const u=ta(i.method),f=i.enabled||!!(i.config&&Object.keys(i.config).length>0),p=o.get(u),h=u==="clawtip";return{name:tb(i.method),method:i.method,balance:h?"••••":Ba(p),status:i.enabled?"Bound":"Available",note:f?i.isDefault?"Default wallet":"Configured":"Not bound",action:i.enabled?"Recharge":"Activate",icon:eN(i.method),balanceHidden:h,config:i.config}})}function eb({modal:n,methods:l,qr:o,loading:i,error:u,onClose:f}){const p=n.kind==="recharge",h=l.find(E=>E.method===n.method),v=p&&ta(n.method)==="clawtip",x=Pd(h==null?void 0:h.config,"resourceUrl"),y=Pd(h==null?void 0:h.config,"walletConfigPath"),g=Pd(h==null?void 0:h.config,"orderNo"),j=(o==null?void 0:o.walletConfigPresent)===!0||nb(h==null?void 0:h.config,"walletConfigPresent"),w=!p&&!!(o!=null&&o.qrImageUrl)&&!j&&!u,T=(h==null?void 0:h.name)??tb(n.method);return s.jsx("div",{className:"fixed inset-0 z-30 grid place-items-center overflow-y-auto bg-[rgba(32,26,56,0.28)] px-4 py-6",children:s.jsxs("div",{className:"w-full max-w-[820px] rounded-[14px] bg-white p-5 shadow-[0_20px_56px_rgba(32,26,56,0.20)] sm:p-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:v?"ClawTip wallet QR":p?`Recharge ${T}`:`Activate ${T}`}),s.jsx("p",{className:"mt-1 text-[0.82rem] leading-5 text-[var(--color-muted)]",children:v?"Scan with JD app to view wallet balance or recharge.":p?"Load the fixed ClawTip recharge QR from static assets.":"Reuse the tb init ClawTip flow and wait for wallet binding."})]}),s.jsx("button",{className:"tb-button tb-button-icon tb-button-quiet",onClick:f,"aria-label":"Close payment modal",children:s.jsx(Dl,{className:"size-4"})})]}),s.jsxs("div",{className:"mt-5 flex flex-col gap-4",children:[s.jsx("div",{className:"mx-auto grid min-h-[320px] w-full max-w-[720px] place-items-center overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3 sm:min-h-[560px] sm:p-4",children:o!=null&&o.qrImageUrl?s.jsx("img",{className:"max-h-[72vh] w-full object-contain",src:o.qrImageUrl,alt:`${T} ${p?"recharge":"activation"} QR code`}):s.jsxs("div",{className:"flex flex-col items-center gap-2 px-3 text-center text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[i?s.jsx(yt,{className:"size-5 animate-spin text-[var(--color-purple)]"}):null,s.jsx("span",{children:i?"Generating ClawTip QR...":"QR image unavailable"})]})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx(us,{label:"Method",value:T}),s.jsx(us,{label:"Wallet",value:j?"bound":"waiting",warn:!j}),o!=null&&o.orderNo||g?s.jsx(us,{label:"Order",value:(o==null?void 0:o.orderNo)??g??""}):null,o!=null&&o.walletConfigPath||y?s.jsx(us,{label:"Config",value:nN((o==null?void 0:o.walletConfigPath)??y??"")}):null,o!=null&&o.clawtipId?s.jsx(us,{label:"Device",value:o.clawtipId}):null]}),u?s.jsx("div",{className:"rounded-[8px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.78rem] leading-5 text-rose-700",children:u instanceof Error?u.message:String(u)}):null,o!=null&&o.qrImageUrl?s.jsx("div",{className:"rounded-[8px] border border-emerald-100 bg-emerald-50 px-3 py-2 text-[0.78rem] leading-5 text-emerald-800",children:p?"Scan with JD app to view wallet balance or recharge.":s.jsxs("span",{className:"flex items-start gap-2",children:[w?s.jsx(yt,{className:"mt-0.5 size-4 shrink-0 animate-spin"}):null,s.jsx("span",{children:j?"Wallet bound. Closing...":"Scan with JD app. TokenBuddy is waiting for the local wallet config."})]})}):null,o!=null&&o.resourceUrl||x?s.jsx("a",{className:"tb-button tb-button-md tb-button-secondary w-full justify-start overflow-hidden font-mono text-[0.75rem]",href:(o==null?void 0:o.resourceUrl)??x,target:"_blank",rel:"noreferrer",children:tN((o==null?void 0:o.resourceUrl)??x??"")}):!(o!=null&&o.qrImageUrl)&&!i&&!u?s.jsxs("div",{className:"rounded-[8px] border border-amber-100 bg-amber-50 px-3 py-2 text-[0.78rem] leading-5 text-amber-800",children:["No recharge link is available from the daemon. Run ",s.jsx("span",{className:"font-mono",children:"tb init"})," to bind this payment method."]}):null]})]})]})})}function tb(n){const l=ta(n);return l==="clawtip"?"ClawTip":l==="alipay-agent"?"Alipay Agent Payment":l==="wechat-pay"?"WeChat Pay":l==="coinbase-smart-wallet"?"Coinbase Smart Wallet":n.split(/[-_\s]+/).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}function ta(n){return n.trim().toLowerCase()}function nb(n,l){return(n==null?void 0:n[l])===!0}function us({label:n,value:l,warn:o=!1}){return s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:n}),s.jsx("div",{className:["font-mono text-[0.94rem] font-semibold",o?"text-amber-700":"text-[var(--color-ink)]"].join(" "),children:l})]})}function eN(n){const l=ta(n);return l==="clawtip"?"C":l==="wechat-pay"?"W":l==="alipay-agent"?"A":l.charAt(0).toUpperCase()||"P"}function tN(n){try{const l=new URL(n),o=l.pathname==="/"?"":l.pathname;return`${l.host}${o}`.slice(0,34)}catch{return n.length>34?`${n.slice(0,31)}...`:n}}function nN(n){const l=n.split("/");return l.length<=3?n:`.../${l.slice(-2).join("/")}`}function Pd(n,l){const o=n==null?void 0:n[l];return typeof o=="string"&&o.length>0?o:void 0}const aN=320,Kd=12;function lN({inputTokens:n,outputTokens:l,cacheReadTokens:o,showCacheRead:i=!0}){const u=i?o:void 0,f=ab(n,l,u),p=Number.isFinite(u),h=Number.isFinite(u)&&u>0,v=[{label:"输入 Token",value:Se(n)},{label:"输出 Token",value:Se(l)}];return p&&v.push({label:"缓存读取 Token",value:Se(u)}),v.push({label:"总 Token",value:Se(f),dividerBefore:!0,emphasis:!0}),s.jsxs("span",{className:"inline-flex min-w-[13rem] items-center gap-2 align-middle",children:[s.jsxs("span",{className:"grid min-w-0 gap-1",children:[s.jsxs("span",{className:"inline-flex items-center gap-4 whitespace-nowrap font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:[s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(MS,{className:"size-3.5 text-[var(--color-success)]","aria-hidden":"true"}),Se(n)]}),s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Gg,{className:"size-3.5 text-[var(--color-primary)]","aria-hidden":"true"}),Se(l)]})]}),h?s.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap font-mono text-[0.78rem] font-semibold text-[var(--color-tokens)]",children:[s.jsx(GS,{className:"size-3.5","aria-hidden":"true"}),yf(u)]}):null]}),s.jsx(em,{ariaLabel:"Token 明细",children:s.jsx(tm,{title:"Token 明细",rows:v})})]})}function rN({imageCount:n,imageSize:l,imageQuality:o,imageOutputFormat:i}){const u=[{label:"图片数量",value:Se(n)},{label:"尺寸",value:l||Me},{label:"质量",value:o||Me},{label:"输出格式",value:i||Me}];return s.jsxs("span",{className:"inline-flex min-w-[13rem] items-center gap-2 align-middle",children:[s.jsxs("span",{className:"grid min-w-0 gap-1",children:[s.jsxs("span",{className:"inline-flex items-center justify-end gap-1 whitespace-nowrap font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:[s.jsx(FS,{className:"size-3.5 text-[var(--color-primary)]","aria-hidden":"true"}),Se(n)," image",n===1?"":"s"]}),s.jsx("span",{className:"whitespace-nowrap font-mono text-[0.78rem] font-semibold text-[var(--color-muted)]",children:[l,o,i].filter(Boolean).join(" / ")||Me})]}),s.jsx(em,{ariaLabel:"图片明细",children:s.jsx(tm,{title:"图片明细",rows:u})})]})}function iN({inputTokens:n,outputTokens:l}){const o=ab(n,l);return s.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.jsx("div",{className:"grid size-[4.5rem] shrink-0 place-items-center rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] text-[var(--color-tokens)]",children:s.jsx(RS,{className:"size-7","aria-hidden":"true"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.8rem] font-bold uppercase tracking-normal text-[var(--color-muted)]",children:"总 Token"}),s.jsx("div",{className:"mt-1 font-mono text-[2rem] font-bold leading-none tracking-normal text-[var(--color-ink)]",children:ac(o)}),s.jsxs("div",{className:"mt-1 font-mono text-[0.9rem] font-medium leading-snug tracking-normal text-[var(--color-muted)]",children:["输入: ",ac(n)," / 输出: ",ac(l)]})]})]})}function sN(n){const l=n.settledUsdMicros??n.billedMicros,o=cN(n,l);return s.jsxs("span",{className:"inline-flex items-center gap-2 align-middle",children:[s.jsx("span",{className:"whitespace-nowrap font-mono text-[0.9rem] font-semibold text-[var(--color-spend)]",children:wl(l)}),s.jsx(em,{ariaLabel:"成本明细",children:s.jsx(tm,{title:"成本明细",rows:o})})]})}function oN({inputPriceMicrosPer1m:n,outputPriceMicrosPer1m:l}){return s.jsxs("span",{className:"grid gap-0.5 font-mono text-[0.78rem] leading-snug text-[var(--color-muted)]",children:[s.jsxs("span",{children:["输入 ",cc(n)]}),s.jsxs("span",{children:["输出 ",cc(l)]})]})}function yc({ttftMs:n,tokensPerSecond:l,compact:o=!1}){return o?s.jsxs("span",{className:"font-mono",children:["TTFT ",na(n)," / ",Ss(l)]}):s.jsxs("span",{className:"inline-grid gap-0.5 font-mono text-[0.78rem] leading-snug",children:[s.jsxs("span",{children:[s.jsx("span",{className:"text-[var(--color-muted)]",children:"TTFT"})," ",na(n)]}),s.jsxs("span",{children:[s.jsx("span",{className:"text-[var(--color-muted)]",children:"Tok/s"})," ",Ig(l)]})]})}function cN(n,l){const o=[];return n.billingUnit==="images"&&(o.push({label:"图片数量",value:Se(n.imageCount)}),n.imageSize&&o.push({label:"尺寸",value:n.imageSize}),n.imageQuality&&o.push({label:"质量",value:n.imageQuality}),n.imageOutputFormat&&o.push({label:"输出格式",value:n.imageOutputFormat}),Zn(o,"图片输出成本",wl(n.imageOutputCostMicros),n.imageOutputCostMicros),Zn(o,"单张折算",wl(n.imageCostMicrosPerImage),n.imageCostMicrosPerImage),Zn(o,"图片输出 Token",Se(n.imageOutputTokens),n.imageOutputTokens)),Zn(o,"输入成本",wl(n.inputCostMicros),n.inputCostMicros),Zn(o,"输出成本",wl(n.outputCostMicros),n.outputCostMicros),Zn(o,"输入单价",cc(n.inputPriceMicrosPer1m),n.inputPriceMicrosPer1m),Zn(o,"输出单价",cc(n.outputPriceMicrosPer1m),n.outputPriceMicrosPer1m),Zn(o,"缓存读取成本",wl(n.cacheReadCostMicros),n.cacheReadCostMicros),n.serviceTier&&o.push({label:"服务档位",value:n.serviceTier,dividerBefore:o.length>0}),Zn(o,"倍率",Zj(n.billingMultiplier),n.billingMultiplier),Zn(o,"原始",wl(n.originalUsdMicros),n.originalUsdMicros),o.push({label:"计费",value:wl(l),dividerBefore:o.length>0,emphasis:!0}),o.length===1&&o.unshift({label:"明细",value:Me}),o}function Zn(n,l,o,i){Number.isFinite(i)&&n.push({label:l,value:o})}function em({ariaLabel:n,children:l}){const o=S.useRef(null),[i,u]=S.useState(!1),[f,p]=S.useState(),h=S.useCallback(()=>{const x=o.current;if(!x)return;const y=x.getBoundingClientRect(),g=window.innerWidth-aN-Kd,j=Math.max(Kd,Math.min(g,y.right+8)),w=Math.max(Kd,y.top+y.height/2-32);p({top:w,left:j})},[]),v=S.useCallback(()=>{h(),u(!0)},[h]);return S.useEffect(()=>{if(i)return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[i,h]),s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:o,type:"button","aria-label":n,className:"inline-grid size-6 shrink-0 place-items-center rounded-full border border-[var(--color-line)] bg-[var(--color-panel-subtle)] text-[var(--color-muted)] hover:border-[var(--color-primary)] hover:text-[var(--color-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]/30",onMouseEnter:v,onMouseLeave:()=>u(!1),onFocus:v,onBlur:()=>u(!1),onClick:()=>{h(),u(x=>!x)},children:s.jsx(JS,{className:"size-3.5","aria-hidden":"true"})}),i&&f&&typeof document<"u"?z2.createPortal(s.jsx("div",{className:"pointer-events-none fixed z-50 w-[20rem] rounded-[var(--radius-lg)] border border-[var(--color-line)] bg-white p-4 shadow-[var(--shadow-modal)]",style:{top:f.top,left:f.left},children:l}),document.body):null]})}function tm({title:n,rows:l}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx("div",{className:"text-[0.92rem] font-bold text-[var(--color-ink)]",children:n}),s.jsx("div",{className:"grid gap-1",children:l.map((o,i)=>s.jsxs("div",{className:["grid grid-cols-[1fr_auto] items-baseline gap-4 text-[0.86rem]",o.dividerBefore?"mt-1 border-t border-[var(--color-line-2)] pt-2":""].join(" "),children:[s.jsx("span",{className:"text-[var(--color-muted)]",children:o.label}),s.jsx("span",{className:["font-mono tracking-normal",o.emphasis?"font-bold text-[var(--color-ink)]":"font-semibold text-[var(--color-ink)]",o.value===Pn?"text-[var(--color-muted)]":""].join(" "),children:o.value})]},`${o.label}-${i}`))})]})}function ab(...n){return n.reduce((l,o)=>l+(Number.isFinite(o)?o:0),0)}function Ot({children:n,className:l=""}){return s.jsx("div",{className:["rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white shadow-[var(--shadow-panel)]",l].join(" "),children:n})}function _s(n){return{router:{card:"border border-[var(--color-hairline-strong)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-lavender-2)] hover:bg-[var(--color-panel-subtle)]",icon:"border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-router)]",label:"text-[var(--color-router)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},requests:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-success-border)] hover:bg-[var(--color-panel-subtle)]",icon:"border border-[var(--color-success-border)] bg-[var(--color-success-soft)] text-[var(--color-success)]",label:"text-[var(--color-success)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},spend:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-spend-border)] hover:bg-[var(--color-panel-subtle)]",icon:"border border-[var(--color-spend-border)] bg-[var(--color-spend-soft)] text-[var(--color-spend)]",label:"text-[var(--color-spend)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},tokens:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-tokens-border)] hover:bg-[var(--color-panel-subtle)]",icon:"border border-[var(--color-tokens-border)] bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",label:"text-[var(--color-tokens)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},inventory:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-inventory-border)] hover:bg-[var(--color-panel-subtle)]",icon:"border border-[var(--color-inventory-border)] bg-[var(--color-inventory-soft)] text-[var(--color-inventory)]",label:"text-[var(--color-inventory)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"}}[n]}function nm({tone:n,children:l,className:o="size-7"}){const i=_s(n);return s.jsx("div",{className:[`grid ${o} place-items-center rounded-[var(--radius-md)]`,i.icon].join(" "),children:l})}function Cx({icon:n,label:l,tone:o,rows:i}){const u=_s(o);return s.jsxs(Ot,{className:"relative min-h-[9rem] overflow-hidden border-[var(--color-hairline)] bg-white px-4 py-4",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(nm,{tone:o,className:"size-10",children:n}),s.jsx("div",{className:["text-[0.72rem] font-bold uppercase tracking-[0.08em]",u.label].join(" "),children:l})]}),s.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:i.map(f=>s.jsxs("div",{className:"min-w-0 rounded-[8px] border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-3 py-2",children:[s.jsx("div",{className:"text-[0.68rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:f.label}),s.jsx("div",{className:["mt-1 truncate font-mono text-[1.15rem] font-bold leading-tight tracking-normal",u.value].join(" "),children:f.value}),s.jsx("div",{className:"mt-1 truncate text-[0.72rem] font-medium text-[var(--color-muted)]",children:f.detail})]},f.key))})]})}function uN({tone:n="lavender",children:l}){const o={lavender:"bg-[var(--color-lavender)] text-[var(--color-primary)]",green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",red:"bg-[var(--color-danger-soft)] text-[var(--color-danger)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",gray:"bg-slate-100 text-slate-600"};return s.jsxs("span",{className:["inline-flex items-center gap-1.5 text-[0.78rem] font-medium px-2.5 py-0.5 rounded-[var(--radius-pill)]",o[n]??o.lavender].join(" "),children:[s.jsx("span",{className:"size-1.5 rounded-full bg-current"}),l]})}const Tx="tokenbuddy-ui-language",Ax={en:{"nav.overview":"Overview","nav.routing":"Routing","nav.ledger":"Ledger","nav.tools":"Tools","language.label":"Language","language.english":"EN","language.chinese":"中文","language.switchToEnglish":"Switch to English","language.switchToChinese":"切换到中文","common.add":"Add","common.cancel":"Cancel","common.close":"Close","common.save":"Save","common.delete":"Delete","common.edit":"Edit","common.select":"Select","common.search":"Search","common.loading":"Loading...","common.refresh":"Refresh","common.connected":"Connected","common.installed":"Installed","common.manual":"Manual","common.missing":"Missing","common.current":"Current","common.unknown":"unknown","common.active":"Active","common.bind":"Bind {name}","common.recharge":"Recharge","common.notAvailable":"{name} is not available in Manual mode.","overview.providerMode.label":"Routing mode","overview.providerMode.manualValue":"Manual","overview.providerMode.autoValue":"Auto","overview.providerMode.manualStats":"{count} node{plural} · {policy}","overview.providerMode.manualNote":"Uses your node list only","overview.providerMode.autoStats":"{range} · {models} model{modelPlural} · {sellers} node{sellerPlural}","overview.providerMode.autoPolicy":"{scorer} · {payment}","overview.providerMode.autoPolicyNoPayment":"{scorer}","overview.providerMode.recommendedRange":"Recommended","overview.providerMode.customRange":"Custom","overview.providerMode.fallbackPolicy":"fallback","overview.providerMode.fixedProvider":"fixed node","overview.providerMode.balancedScorer":"balanced","overview.providerMode.speedScorer":"speed first","overview.providerMode.costScorer":"cost first","tools.title":"App connections","tools.connectedSummary":"{configured}/{total} connected","tools.refreshStatus":"Refresh models and tool status","tools.oneClick":"One-click setup","tools.tool":"Tool","tools.protocol":"Protocol","tools.status":"Status","tools.actions":"Actions","tools.disconnect":"Disconnect","tools.connect":"Connect","tools.reconnect":"Reconnect","tools.getApp":"Get app","tools.importCcSwitch":"Import {name} provider with CC Switch","tools.disconnectFrom":"Disconnect TokenBuddy from {name}","tools.connectTo":"Connect {name} to TokenBuddy","tools.reconnectTo":"Refresh models and reconnect {name}","tools.manualSetup":"Compatible agents","tools.appsCount":"{count} apps","tools.searchApps":"Search apps","tools.searchAppsPlaceholder":"Search apps or protocols","tools.noMatchingApp":"No matching app","tools.configuration":"Configuration","tools.openAiBaseUrl":"OpenAI base URL","tools.anthropicBaseUrl":"Anthropic base URL","tools.apiKey":"API key","tools.copyFailed":"Copy failed. Select the value and copy it manually.","tools.fileChangesApplied":"{name}: {count} file change{plural} applied.","tools.modelsRefreshed":"Model list refreshed: {count} model{plural} available.","tools.noSnapshot":"{name}: no TokenBuddy install snapshot was found.","tools.noCompatibleModel":"{name}: no {protocol} compatible model is available.","tools.disconnectedChanges":"{name}: disconnected with {count} file change{plural}.","tools.restoredChanges":"{name}: restored {count} file change{plural}."},zh:{"nav.overview":"看板","nav.routing":"规则","nav.ledger":"账本","nav.tools":"工具","language.label":"语言","language.english":"EN","language.chinese":"中文","language.switchToEnglish":"Switch to English","language.switchToChinese":"切换到中文","common.add":"添加","common.cancel":"取消","common.close":"关闭","common.save":"保存","common.delete":"删除","common.edit":"编辑","common.select":"选择","common.search":"搜索","common.loading":"加载中...","common.refresh":"刷新","common.connected":"已连接","common.installed":"已安装","common.manual":"手动","common.missing":"未安装","common.current":"当前","common.unknown":"未知","common.active":"已启用","common.bind":"绑定 {name}","common.recharge":"充值","common.notAvailable":"{name} 在手动模式下不可用。","overview.providerMode.label":"路由模式","overview.providerMode.manualValue":"手动","overview.providerMode.autoValue":"自动","overview.providerMode.manualStats":"{count} 个节点 · {policy}","overview.providerMode.manualNote":"只使用你的节点列表","overview.providerMode.autoStats":"{range} · {models} 个模型 · {sellers} 个节点","overview.providerMode.autoPolicy":"{scorer} · {payment}","overview.providerMode.autoPolicyNoPayment":"{scorer}","overview.providerMode.recommendedRange":"推荐列表","overview.providerMode.customRange":"自定义列表","overview.providerMode.fallbackPolicy":"失败切换","overview.providerMode.fixedProvider":"固定节点","overview.providerMode.balancedScorer":"均衡策略","overview.providerMode.speedScorer":"速度优先","overview.providerMode.costScorer":"成本优先","tools.title":"应用连接","tools.connectedSummary":"{configured}/{total} 已连接","tools.refreshStatus":"刷新模型和工具状态","tools.oneClick":"一键配置","tools.tool":"工具","tools.protocol":"协议","tools.status":"状态","tools.actions":"操作","tools.disconnect":"断开","tools.connect":"连接","tools.reconnect":"重连","tools.getApp":"获取应用","tools.importCcSwitch":"用 CC Switch 导入 {name} provider","tools.disconnectFrom":"断开 TokenBuddy 与 {name} 的连接","tools.connectTo":"将 {name} 连接到 TokenBuddy","tools.reconnectTo":"刷新模型并重连 {name}","tools.manualSetup":"可以兼容的其它 agent","tools.appsCount":"{count} 个应用","tools.searchApps":"搜索应用","tools.searchAppsPlaceholder":"搜索应用或协议","tools.noMatchingApp":"没有匹配应用","tools.configuration":"配置","tools.openAiBaseUrl":"OpenAI Base URL","tools.anthropicBaseUrl":"Anthropic Base URL","tools.apiKey":"API Key","tools.copyFailed":"复制失败,请手动选中内容复制。","tools.fileChangesApplied":"{name}: 已写入 {count} 个文件变更。","tools.modelsRefreshed":"模型列表已刷新:当前可用 {count} 个模型。","tools.noSnapshot":"{name}: 没有找到 TokenBuddy 安装快照。","tools.noCompatibleModel":"{name}: 没有可用的 {protocol} 兼容模型。","tools.disconnectedChanges":"{name}: 已断开,处理了 {count} 个文件变更。","tools.restoredChanges":"{name}: 已恢复 {count} 个文件变更。"}},lb=S.createContext(null);function dN({children:n}){const[l,o]=S.useState(()=>{if(typeof window>"u")return"en";const u=window.localStorage.getItem(Tx);return u==="zh"||u==="en"?u:"en"});S.useEffect(()=>{document.documentElement.lang=l==="zh"?"zh-CN":"en",window.localStorage.setItem(Tx,l)},[l]),S.useEffect(()=>{if(typeof document>"u")return;const u=()=>pN(l);u();const f=new MutationObserver(()=>{window.requestAnimationFrame(u)});return f.observe(document.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["placeholder","title","aria-label","alt"]}),()=>f.disconnect()},[l]);const i=S.useMemo(()=>({language:l,setLanguage:o,t:(u,f)=>fN(Ax[l][u]??Ax.en[u],f)}),[l]);return s.jsx(lb.Provider,{value:i,children:n})}function pr(){const n=S.useContext(lb);if(!n)throw new Error("useI18n must be used inside I18nProvider");return n}function fN(n,l){return l?n.replace(/\{(\w+)\}/g,(o,i)=>{const u=l[i];return u===void 0?o:String(u)}):n}const rb=[["Router","路由器"],["Today requests","今日请求"],["Inference cost","推理成本"],["Total tokens","总 Token"],["Models / Sellers","模型 / Seller"],["Token usage","Token 用量"],["Daily model input and output usage lines","每日模型输入输出用量折线图"],["Daily inference cost curve","每日推理成本曲线"],["Recent model routes","最近模型路由"],["Details","详情"],["Model","模型"],["Seller","Seller"],["Token","Token"],["In","输入"],["Out","输出"],["in","输入"],["out","输出"],["TTFT","首 token"],["Tok/s","Token/s"],["Disc","折扣"],["Last switch","最近切换"],["No model traffic yet.","暂无模型流量。"],["Open Router","打开路由器"],["Open Today requests","打开今日请求"],["Open Inference cost","打开推理成本"],["Open Total tokens","打开总 Token"],["Open Models / Sellers","打开模型 / Seller"],["requests","次请求"],["sellers","个 Seller"],["Inference cost","推理成本"],["30 day inference cost","30 天推理成本"],["Daemon","守护进程"],["Proxy","代理"],["Control","控制台"],["TokenBuddy update","TokenBuddy 更新"],["Updating","更新中"],["Update","更新"],["Installed. tb-proxyd restart is in progress.","已安装,tb-proxyd 正在重启。"],["Installed. Restart needs attention.","已安装,需要检查重启。"],["Update failed.","更新失败。"],["TokenBuddy update available","TokenBuddy 有可用更新"],["Inference tokens","推理 Token"],["Image generations","图片生成"],["Token purchase spend","Token 购买支出"],["Today","今天"],["This week","本周"],["This month","本月"],["Total","总计"],["Usage details","用量明细"],["Inferences","推理"],["Purchases","购买"],["Search request, model, seller...","搜索请求、模型、Seller..."],["Search purchase, method, seller...","搜索购买、方式、Seller..."],["Search model, seller...","搜索模型、Seller..."],["Search seller...","搜索 Seller..."],["Status","状态"],["Method","方式"],["All status","全部状态"],["All model","全部模型"],["All method","全部方式"],["Ledger data could not be loaded. The local daemon may be offline or missing ledger endpoints.","账本数据加载失败。本地 daemon 可能离线或缺少账本接口。"],["TIME","时间"],["REQ","请求"],["MODEL","模型"],["SELLER","Seller"],["TOKENS","Token"],["USAGE","用量"],["COST","成本"],["TOTAL","总计"],["STATUS","状态"],["When","时间"],["Input","输入"],["Output","输出"],["Cache hit","缓冲命中"],["Purchase","购买"],["Payment method","支付方式"],["Spent","花费"],["Credit","额度"],["Request ID","请求 ID"],["Created","创建时间"],["Endpoint","端点"],["Route","路由"],["Fallback chain","Fallback 链路"],["Upstream status","上游状态"],["Input / output tokens","输入 / 输出 Token"],["Billed","计费"],["Images","图片"],["Balance after","之后余额"],["Prompt hash","Prompt Hash"],["Response hash","Response Hash"],["Price version","价格版本"],["Purchase ID","购买 ID"],["Completed","完成时间"],["Payment reference","支付引用"],["Credit micros","额度 micros"],["Currency","币种"],["No matching inference records","没有匹配的推理记录"],["No matching purchase records","没有匹配的购买记录"],["Adjust the query or filters to inspect another slice of the local ledger.","调整搜索或筛选条件以查看本地账本的其他数据。"],["Rows","行数"],["Showing","显示"],["of","共"],["First page","第一页"],["Previous page","上一页"],["Next page","下一页"],["Last page","最后一页"],["Go to","跳转到"],["Go to page","跳转到页面"],["page","页"],["Manual","手动"],["Auto","自动"],["Manual provider mode","手动 Provider 模式"],["Auto provider mode","自动 Provider 模式"],["Loading routing data...","正在加载路由数据..."],["Some routing data could not be loaded. Check that tb-proxyd is running.","部分路由数据加载失败,请确认 tb-proxyd 正在运行。"],["Custom providers","自定义 Provider"],["Provider","Provider"],["Models","模型"],["Last call","最后调用"],["Actions","操作"],["No custom providers yet.","还没有自定义 Provider。"],["Add provider","添加 Provider"],["Fallback on error","失败自动切换"],["Cost first","成本优先"],["Multi-provider concurrent calls","多供应商并发调用"],["Use providers by table order when the current provider fails.","当前 Provider 失败时,按表格顺序切换。"],["Move up","上移"],["Edit","编辑"],["Current","当前"],["Payment route","支付路由"],["Models","模型"],["Choose at least one model.","至少选择一个模型。"],["Models could not be saved.","模型保存失败。"],["Seller list","Seller 列表"],["Loading providers...","正在加载 Provider..."],["Refreshing","刷新中"],["Recommended","推荐"],["Custom","自定义"],["Select","选择"],["Select sellers","选择 Seller"],["Switch to Custom to select sellers","切换到自定义后选择 Seller"],["Discount","折扣"],["No custom sellers selected.","还没有选择自定义 Seller。"],["No warmed sellers available for these models.","这些模型暂无预热 Seller。"],["Routing priority","路由优先级"],["Balanced","均衡"],["Speed","速度"],["Cost","成本"],["Prefers lower TTFT and stronger throughput.","优先选择更低首 token 延迟和更高吞吐。"],["Prefers lower effective cost among healthy providers.","在健康 Provider 中优先选择更低成本。"],["Balances reliability, speed, and cost.","平衡可靠性、速度和成本。"],["Current routes","当前路由"],["PROVIDER","Provider"],["STRATEGY","策略"],["LAST CALL","最后调用"],["Preview","预览"],["Ready","就绪"],["healthy","健康"],["configured","已配置"],["settled","已结算"],["estimated","预估"],["ok","正常"],["online","在线"],["offline","离线"],["degraded","降级"],["Active","已启用"],["Manual fallback","手动 fallback"],["Manual direct","手动直连"],["Auto custom","自动自定义"],["Auto fixed","自动固定"],["Auto cost","自动成本优先"],["Auto speed","自动速度优先"],["Auto balanced","自动均衡"],["Add models","添加模型"],["Search models or payment","搜索模型或支付方式"],["Payment","支付"],["Sellers","Seller"],["No models found.","没有找到模型。"],["Selected","已选择"],["Clear","清空"],["No model selected.","未选择模型。"],["Cancel","取消"],["Save and close","保存并关闭"],["Save selected models","保存已选模型"],["Select custom sellers","选择自定义 Seller"],["Search sellers, payment, notes","搜索 Seller、支付方式或备注"],["Service fee","服务费"],["No sellers found.","没有找到 Seller。"],["No seller selected.","未选择 Seller。"],["Name","名称"],["Base URL","Base URL"],["API key","API key"],["My provider","我的 Provider"],["Leave blank to keep existing key","留空以保留现有 key"],["Probe required before adding.","添加前必须探测接口。"],["Probe required when replacing the key.","替换 key 时必须重新探测。"],["Reading model list...","正在读取模型列表..."],["Model list request failed.","模型列表请求失败。"],["Probe new key","探测新 key"],["Probe models","探测模型"],["Save","保存"],["Add","添加"],["Close","关闭"],["Search models","搜索模型"],["View models","查看模型"],["Delete","删除"],["JD wallet","京东钱包"],["Default wallet","默认钱包"],["Configured","已配置"],["Not bound","未绑定"],["Bound","已绑定"],["Available","可用"],["Recharge","充值"],["Activate","激活"],["Bind ClawTip wallet to enable Auto mode","绑定 ClawTip 钱包启用自动模式"],["ClawTip wallet QR","ClawTip 钱包二维码"],["Close payment modal","关闭支付弹窗"],["Scan with JD app to view wallet balance or recharge.","使用京东 App 扫码查看余额或充值。"],["Load the fixed ClawTip recharge QR from static assets.","加载静态资源中的固定 ClawTip 充值二维码。"],["Reuse the tb init ClawTip flow and wait for wallet binding.","复用 tb init 的 ClawTip 流程并等待钱包绑定。"],["Generating ClawTip QR...","正在生成 ClawTip 二维码..."],["QR image unavailable","二维码不可用"],["Wallet","钱包"],["Order","订单"],["Config","配置"],["Device","设备"],["bound","已绑定"],["waiting","等待中"],["Wallet bound. Closing...","钱包已绑定,正在关闭..."],["Scan with JD app. TokenBuddy is waiting for the local wallet config.","使用京东 App 扫码。TokenBuddy 正在等待本地钱包配置。"],["No recharge link is available from the daemon. Run tb init to bind this payment method.","daemon 没有返回充值链接。请运行 tb init 绑定该支付方式。"],["Scan with JD app to view ClawTip wallet balance","使用京东 App 查看 ClawTip 钱包余额"],["Scan with JD app to view wallet balance","使用京东 App 查看钱包余额"],["activation","激活"],["recharge","充值"],["QR code","二维码"],["选择模型","Select models"],["默认模型","Default models"],["绑定钱包","Bind wallet"],["支付方式","Payment method"],["配置策略","Configure strategy"],["路由规则","Routing rules"],["配置工具","Configure tools"],["终端接入","Tool access"],["全自动","Full auto"],["自动选择可用供应商。","Automatically select available providers."],["固定供应商组","Fixed provider set"],["在指定供应商组内切换。","Switch within selected providers."],["固定供应商","Fixed provider"],["始终使用指定供应商。","Always use the selected provider."],["平衡模式","Balanced"],["综合速度、价格、健康度、余额。","Balance speed, price, health, and balance."],["速度优先","Speed first"],["优先选择更快、吞吐量更高供应商。","Prefer faster providers with higher throughput."],["成本优先","Cost first"],["优先选择更低成本供应商。","Prefer lower-cost providers."],["微信支付入口预留","WeChat Pay entry reserved"],["代理支付入口预留","Agent payment entry reserved"],["USDC 钱包入口预留","USDC wallet entry reserved"],["浏览器已经允许直接安装 TokenBuddy。","The browser is ready to install TokenBuddy."],["TokenBuddy 桌面应用已安装。","TokenBuddy desktop app has been installed."],["关注模型已保存。后续工具配置会优先参考这些模型。","Focus models saved. Tool setup will prefer these models."],["请选择一个固定供应商。","Select a fixed provider."],["请至少选择一个供应商。","Select at least one provider."],["供应商路由策略已保存。","Provider routing strategy saved."],["初始化步骤","Initialization steps"],["模型访问","Model access"],["默认和高频模型","Default and frequent models"],["下一步","Next"],["上一步","Back"],["完成","Finish"],["保存","Save"],["添加模型","Add models"],["推荐模型","Recommended models"],["直接勾选","Quick select"],["搜索添加","Search and add"],["全部模型","All models"],["选择可能使用到的模型","Choose models you may use"],["搜索平台全部模型...","Search all platform models..."],["关闭模型选择","Close model picker"],["完成选择模型","Done selecting models"],["模型已选","Models selected"],["保存关注模型","Save focus models"],["默认供应商策略","Default provider strategy"],["选择支付方式","Choose payment method"],["生成后使用京东 App 扫码绑定。","Scan with JD app after the QR is generated."],["配置终端工具","Configure client tools"],["验证网关","Verify gateway"],["初始化完成","Initialization complete"],["桌面应用","Desktop app"],["安装入口","Install entry"],["地址栏或浏览器菜单。","Address bar or browser menu."],["应用名称","App name"],["本地服务","Local service"],["继续由 tb-proxyd 提供。","Still served by tb-proxyd."],["路由策略已选择","Routing strategy selected"],["状态","Status"],["供应商","Provider"],["价格","Price"],["折扣","Discount"],["响应","Latency"],["加入本次写入","Include in this setup"],["移出本次写入","Remove from this setup"],["写入配置","Write config"],["生成预览","Generate preview"],["安装应用","Install app"]],ib=rb.filter(([n])=>!cb(n)),mN=rb.filter(([n])=>cb(n)),sb=new Map(ib),ob=new Map([...ib.map(([n,l])=>[l,n]),...mN]);function hN(n,l){return am(n,l==="zh"?sb:ob,l)}function pN(n){const l=n==="zh"?sb:ob;vN(document.body,l,n)}function vN(n,l,o){var f;const i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,{acceptNode(p){var v;const h=p.parentElement;return!h||["SCRIPT","STYLE","NOSCRIPT","TEXTAREA"].includes(h.tagName)||h.closest("[data-no-translate='true']")||!((v=p.textContent)!=null&&v.trim())?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),u=[];for(;i.nextNode();)u.push(i.currentNode);for(const p of u){const h=am(p.textContent??"",l,o);h!==p.textContent&&(p.textContent=h)}n instanceof Element&&Ex(n,l,o);for(const p of Array.from(((f=n.querySelectorAll)==null?void 0:f.call(n,"[placeholder], [title], [aria-label], [alt]"))??[]))Ex(p,l,o)}function Ex(n,l,o){for(const i of["placeholder","title","aria-label","alt"]){if(n.closest("[data-no-translate='true']"))return;const u=n.getAttribute(i);if(!u)continue;const f=am(u,l,o);f!==u&&n.setAttribute(i,f)}}function am(n,l,o){var h,v;const i=((h=n.match(/^\s*/))==null?void 0:h[0])??"",u=((v=n.match(/\s*$/))==null?void 0:v[0])??"",f=n.trim();if(!f)return n;const p=l.get(f);if(p)return`${i}${p}${u}`;if(o==="zh"){const x=f.match(/^Selected (\d+)$/);if(x)return`${i}已选择 ${x[1]}${u}`;const y=f.match(/^(\d+) selected$/);if(y)return`${i}已选择 ${y[1]}${u}`;const g=f.match(/^Page (\d+)$/);if(g)return`${i}第 ${g[1]} 页${u}`;const j=f.match(/^(\d+) of (\d+) providers$/);if(j)return`${i}${j[1]} / ${j[2]} 个 Provider${u}`;const w=f.match(/^(\d+) of (\d+) models$/);if(w)return`${i}${w[1]} / ${w[2]} 个模型${u}`;const T=f.match(/^(\d+) purchases$/);if(T)return`${i}${T[1]} 次购买${u}`;const E=f.match(/^(\d+) requests$/);if(E)return`${i}${E[1]} 次请求${u}`;const D=f.match(/^(\d+) sellers$/);if(D)return`${i}${D[1]} 个 Seller${u}`;const R=f.match(/^In ([\d,]+) \/ Out ([\d,]+)$/);if(R)return`${i}输入 ${R[1]} / 输出 ${R[2]}${u}`;const L=f.match(/^(.+) total$/);if(L)return`${i}总计 ${L[1]}${u}`;const Q=f.match(/^Open (.+)$/);if(Q)return`${i}打开 ${Q[1]}${u}`;const P=f.match(/^Activate (.+)$/);if(P)return`${i}激活 ${P[1]}${u}`;const G=f.match(/^Recharge (.+)$/);if(G)return`${i}充值 ${G[1]}${u}`;const H=f.match(/^Bind (.+)$/);if(H)return`${i}绑定 ${H[1]}${u}`;const $=f.match(/^Remove (.+)$/);if($)return`${i}移除 ${$[1]}${u}`;const I=f.match(/^View models for (.+)$/);if(I)return`${i}查看 ${I[1]} 的模型${u}`;const J=f.match(/^Move (.+) up$/);if(J)return`${i}上移 ${J[1]}${u}`;const te=f.match(/^Edit provider · (.+)$/);if(te)return`${i}编辑 Provider · ${te[1]}${u}`;const F=f.match(/^Models · (.+)$/);if(F)return`${i}模型 · ${F[1]}${u}`;const Z=f.match(/^(.+) ledger records, ([\d,]+) records$/);if(Z)return`${i}${Z[1]}账本记录,${Z[2]} 条记录${u}`;const se=f.match(/^Input tokens: (.+)$/);if(se)return`${i}输入 Token: ${se[1]}${u}`;const xe=f.match(/^Output tokens: (.+)$/);if(xe)return`${i}输出 Token: ${xe[1]}${u}`;const me=f.match(/^Time to first token: (.+)$/);if(me)return`${i}首 token 延迟: ${me[1]}${u}`;const O=f.match(/^Tokens per second: (.+)$/);if(O)return`${i}每秒 Token: ${O[1]}${u}`;const ee=f.match(/^Seller discount: (.+)$/);if(ee)return`${i}Seller 折扣: ${ee[1]}${u}`;const re=f.match(/^Last seller switch: (.+)$/);if(re)return`${i}最近 Seller 切换: ${re[1]}${u}`;const ae=f.match(/^(.+) (recharge|activation) QR code$/);if(ae)return`${i}${ae[1]} ${ae[2]==="recharge"?"充值":"激活"}二维码${u}`}else{const x=f.match(/^已选择 (\d+)$/);if(x)return`${i}Selected ${x[1]}${u}`;const y=f.match(/^第 (\d+) 页$/);if(y)return`${i}Page ${y[1]}${u}`;const g=f.match(/^(\d+) \/ (\d+) 个 Provider$/);if(g)return`${i}${g[1]} of ${g[2]} providers${u}`;const j=f.match(/^(\d+) \/ (\d+) 个模型$/);if(j)return`${i}${j[1]} of ${j[2]} models${u}`;const w=f.match(/^总计 (.+)$/);if(w)return`${i}${w[1]} total${u}`;const T=f.match(/^(\d+) 个 Seller$/);if(T)return`${i}${T[1]} sellers${u}`;const E=f.match(/^输入 ([\d,]+) \/ 输出 ([\d,]+)$/);if(E)return`${i}In ${E[1]} / Out ${E[2]}${u}`;const D=f.match(/^打开 (.+)$/);if(D)return`${i}Open ${D[1]}${u}`;const R=f.match(/^移除 (.+)$/);if(R)return`${i}Remove ${R[1]}${u}`;const L=f.match(/^查看 (.+) 的模型$/);if(L)return`${i}View models for ${L[1]}${u}`;const Q=f.match(/^上移 (.+)$/);if(Q)return`${i}Move ${Q[1]} up${u}`}return n}function cb(n){return/[\u4e00-\u9fff]/.test(n)}function ub({inferences:n,modelsResponse:l,sellersResponse:o,manualProviders:i,previewPlan:u,activeModelId:f}){const p=bN(l,o,i),h=[...n].sort(NN),v=new Map,x=new Map;let y=0,g=0,j=0;for(const T of h){const E=T.modelId||Me,D=T.sellerKey||Me,R=T.billingUnit==="images"||T.endpoint==="/v1/images/generations",L=R?0:tn(T.promptTokens)??0,Q=R?0:tn(T.completionTokens)??0,P=L+Q,G=tn(T.settledUsdMicros)??tn(T.billedMicros)??0;y+=1,g+=P,j+=G;const H=v.get(E)??yN(E);H.entries.push(T),H.requestCount+=1,H.inputTokens+=L,H.outputTokens+=Q,H.totalSpendMicros+=G,H.touchedSellers.add(D),H.sellerCounts.set(D,(H.sellerCounts.get(D)??0)+1),H.fallbackCount+=tn(T.fallbackCount)??0;const $=tn(T.ttftMs);$!==void 0&&(H.ttftTotal+=$,H.ttftCount+=1);const I=tn(T.durationMs);I!==void 0&&(H.durationTotal+=I,H.durationCount+=1);const J=tn(T.avgOutputTokensPerSecond);J!==void 0&&(H.outputSpeedTotal+=J,H.outputSpeedCount+=1),v.set(E,H);const te=x.get(D)??{requestCount:0,totalTokens:0};te.requestCount+=1,te.totalTokens+=P,x.set(D,te)}const w=Array.from(v.values()).map(T=>xN(T,x,p)).sort(wN);if(w.length===0){const T=gN(f,u,p);T&&w.push(T)}return{rows:w,totalRequests:y,totalTokens:g,totalSpendMicros:j}}function xN(n,l,o){const i=n.entries[n.entries.length-1],u=(i==null?void 0:i.sellerKey)||Me,f=db(u,o),p=n.sellerCounts.get(u)??0,h=l.get(u),v=o.modelsBySellerAndModel.get(`${u}\0${n.modelId}`);return{source:"ledger",modelId:n.modelId,currentSellerId:u,currentSellerName:f.name,currentSellerUrl:f.url,currentSellerStatus:f.status,routeState:f.routeState,currentSellerPaymentMethods:f.paymentMethods,sellerDiscount:f.discount,sellerServiceFee:f.serviceFee,sellerModelCount:f.modelCount,requestCount:n.requestCount,currentSellerModelRequests:p,currentSellerRequests:(h==null?void 0:h.requestCount)??p,inputTokens:n.inputTokens,outputTokens:n.outputTokens,totalTokens:n.inputTokens+n.outputTokens,currentSellerTokens:(h==null?void 0:h.totalTokens)??0,totalSpendMicros:n.totalSpendMicros,tokensPerSecond:Yd(n.outputSpeedTotal,n.outputSpeedCount),avgTtftMs:Yd(n.ttftTotal,n.ttftCount),avgDurationMs:Yd(n.durationTotal,n.durationCount),lastTtftMs:tn(i==null?void 0:i.ttftMs),lastDurationMs:tn(i==null?void 0:i.durationMs),selectedAt:SN(n.entries,u),lastSellerSwitchAt:jN(n.entries),lastAccessAt:i==null?void 0:i.createdAt,lastRequestId:i==null?void 0:i.requestId,lastStatus:i==null?void 0:i.status,routeReason:i==null?void 0:i.routeReason,upstreamStatus:i==null?void 0:i.upstreamStatus,fallbackCount:n.fallbackCount,falloverChain:(i==null?void 0:i.falloverChain)??[],touchedSellerCount:n.touchedSellers.size,inputPriceMicrosPer1m:v==null?void 0:v.inputPriceMicrosPer1m,outputPriceMicrosPer1m:v==null?void 0:v.outputPriceMicrosPer1m}}function gN(n,l,o){var v,x,y;const i=(v=l==null?void 0:l.routes)==null?void 0:v[0];if(!i||!n)return;const u=db(i.seller.id,o,i),f=tn(i.metrics.ttftMs)??tn(i.metrics.avgLatencyMs),p=tn(i.metrics.avgInferenceMs),h=o.modelsBySellerAndModel.get(`${i.seller.id}\0${n}`);return{source:"preview",modelId:n,currentSellerId:i.seller.id,currentSellerName:u.name,currentSellerUrl:u.url,currentSellerStatus:u.status,routeState:i.metrics.routeState??u.routeState,currentSellerPaymentMethods:u.paymentMethods,sellerDiscount:u.discount,sellerServiceFee:u.serviceFee,sellerModelCount:u.modelCount,requestCount:0,currentSellerModelRequests:0,currentSellerRequests:0,inputTokens:0,outputTokens:0,totalTokens:0,currentSellerTokens:0,totalSpendMicros:0,tokensPerSecond:tn(i.metrics.avgTokensPerSecond),avgTtftMs:f,avgDurationMs:p,lastTtftMs:f,lastDurationMs:p,routeReason:l.reason??l.sourceReason??"Preview route",fallbackCount:0,falloverChain:((x=l.routes)==null?void 0:x.map(g=>g.seller.id))??[],touchedSellerCount:((y=l.routes)==null?void 0:y.length)??1,inputPriceMicrosPer1m:h==null?void 0:h.inputPriceMicrosPer1m,outputPriceMicrosPer1m:h==null?void 0:h.outputPriceMicrosPer1m}}function bN(n,l,o){const i=new Map;for(const u of(n==null?void 0:n.data)??[]){const f=i.get(u.sellerId)??new Set;f.add(u.id),i.set(u.sellerId,f)}return{registryById:new Map(((l==null?void 0:l.sellers)??[]).map(u=>[u.id,u])),catalogById:new Map(((n==null?void 0:n.sellers)??[]).map(u=>[u.id,u])),manualProvidersById:new Map((o??[]).map(u=>[u.id,u])),modelsBySellerAndModel:new Map(((n==null?void 0:n.data)??[]).map(u=>[`${u.sellerId}\0${u.id}`,u])),modelCountsBySellerId:new Map(Array.from(i.entries()).map(([u,f])=>[u,f.size]))}}function yN(n){return{modelId:n,entries:[],sellerCounts:new Map,touchedSellers:new Set,requestCount:0,inputTokens:0,outputTokens:0,totalSpendMicros:0,ttftTotal:0,ttftCount:0,durationTotal:0,durationCount:0,outputSpeedTotal:0,outputSpeedCount:0,fallbackCount:0}}function SN(n,l){var o;for(let i=n.length-1;i>=0;i-=1){const u=n[i];if(u.sellerKey!==l)return(o=n[i+1])==null?void 0:o.createdAt;if(i===0)return u.createdAt}}function jN(n){let l;for(let o=1;o<n.length;o+=1)n[o].sellerKey!==n[o-1].sellerKey&&(l=n[o].createdAt);return l}function db(n,l,o){const i=l.catalogById.get(n),u=l.registryById.get(n),f=l.manualProvidersById.get(n),p=(o==null?void 0:o.metrics.discountRatio)??(i==null?void 0:i.discountRatio);return{name:MN((o==null?void 0:o.seller.name)??(i==null?void 0:i.name)??(u==null?void 0:u.name)??(f==null?void 0:f.name)??n),url:(o==null?void 0:o.seller.url)??(i==null?void 0:i.url)??(u==null?void 0:u.url)??(f==null?void 0:f.baseUrl),status:(i==null?void 0:i.status)??(u==null?void 0:u.status)??(f==null?void 0:f.status)??Me,routeState:(o==null?void 0:o.metrics.routeState)??(i==null?void 0:i.routeState),paymentMethods:(i==null?void 0:i.paymentMethods)??(u==null?void 0:u.paymentMethods)??(o==null?void 0:o.seller.paymentMethods)??[],discount:Wf(p),serviceFee:Fj(i==null?void 0:i.serviceFeeRatio),modelCount:(i==null?void 0:i.modelCount)??l.modelCountsBySellerId.get(n)}}function NN(n,l){return uc(n.createdAt)-uc(l.createdAt)}function wN(n,l){return uc(l.lastAccessAt)-uc(n.lastAccessAt)}function uc(n){if(!n)return 0;const l=new Date(n).getTime();return Number.isNaN(l)?0:l}function Yd(n,l){return l>0?n/l:void 0}function tn(n){return Number.isFinite(n)?n:void 0}function MN(n){var l;return((l=n.split("(")[0])==null?void 0:l.trim())||n}function kx(){var be,Xe,Oe,Mt,mt,yn,We,Be,Gt,an,ln,Bt,Et,rn,sn,Kn,la,rt,Ha,Pa,Sn,qt,Ka,ra,Ya,Ga,on,ht,$t,pt,ia;const{t:n}=pr(),[l,o]=S.useState(null),[i,u]=C2(),f=S.useRef(null),p=If(),h=Fg(),v=Zg(),x=Jg(),y=Zf(),g=Vf(),j=Xf(),w=Ff(),T=g.refetch,E=j.reset,D=xc(),R=Jf(),L=Rs(),Q=Pj(),P=Kj(),G=((be=D.data)==null?void 0:be.inferences)??[],H=((Xe=g.data)==null?void 0:Xe.payments)??[],$=new Set((((Oe=L.data)==null?void 0:Oe.data)??[]).map(De=>De.id)).size,I=((Mt=R.data)==null?void 0:Mt.sellers.length)??((yn=(mt=L.data)==null?void 0:mt.sellers)==null?void 0:yn.length)??0,J=S.useMemo(()=>KN(G),[G]),te=S.useMemo(()=>Wg(H,G),[G,H]),F=S.useMemo(()=>{var De;return ub({inferences:G,manualProviders:(De=y.data)==null?void 0:De.providers,modelsResponse:L.data,sellersResponse:R.data})},[G,(We=y.data)==null?void 0:We.providers,L.data,R.data]),se=H.some(De=>ta(De.method)==="clawtip"&&(De.enabled||nb(De.config,"walletConfigPresent")))||((Be=j.data)==null?void 0:Be.walletConfigPresent)===!0,xe=((Gt=p.data)==null?void 0:Gt.status)==="running"&&!p.isError,me=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),O=te.find(De=>H.some(jt=>jt.method===De.method&&jt.isDefault))??te.find(De=>De.status==="Bound"),ee=((an=v.data)==null?void 0:an.active)??((ln=v.data)==null?void 0:ln.mode)??((Bt=p.data)==null?void 0:Bt.selectionMode),re=((Et=y.data)==null?void 0:Et.providers.length)??0,ae=new Set((((rn=y.data)==null?void 0:rn.providers)??[]).flatMap(De=>De.models)).size,ge=((sn=x.data)==null?void 0:sn.config.range)??TN((Kn=h.data)==null?void 0:Kn.strategy.mode),N=((la=x.data)==null?void 0:la.config.modelIds.length)??0,B=ge==="custom"?((rt=x.data)==null?void 0:rt.config.sellerIds.length)??((Pa=(Ha=h.data)==null?void 0:Ha.strategy.sellerIds)==null?void 0:Pa.length)??0:I,V=ee==="manual"?re:B||I||re,le=ee==="manual"?ae:N||$||ae,de=CN({activeMode:ee,autoModelCount:N,autoRange:ge,autoSellerCount:B,manualProviderCount:re,manualPolicy:(Sn=y.data)==null?void 0:Sn.routing.policy,paymentName:O==null?void 0:O.name,scorer:((qt=x.data)==null?void 0:qt.config.scorer)??((Ka=h.data)==null?void 0:Ka.strategy.scorer)??((ra=p.data)==null?void 0:ra.sellerRoutingScorer),t:n}),pe=()=>{o(null),j.reset(),w.reset()};return S.useEffect(()=>{const De=i.get("activatePayment");if(!De||ta(De)!=="clawtip"||f.current===De)return;f.current=De,o({kind:"activate",method:"clawtip"}),j.mutate();const jt=new URLSearchParams(i);jt.delete("activatePayment"),u(jt,{replace:!0})},[j,i,u]),S.useEffect(()=>{if((l==null?void 0:l.kind)!=="activate"||ta(l.method)!=="clawtip"||se)return;const De=window.setInterval(()=>{T()},1500);return()=>window.clearInterval(De)},[se,l==null?void 0:l.kind,l==null?void 0:l.method,T]),S.useEffect(()=>{(l==null?void 0:l.kind)==="activate"&&ta(l.method)==="clawtip"&&se&&(o(null),E())},[se,l==null?void 0:l.kind,l==null?void 0:l.method,E]),s.jsxs("div",{className:"min-w-0 overflow-x-hidden space-y-3",children:[s.jsx(RN,{currentVersion:(Ya=Q.data)==null?void 0:Ya.currentVersion,latestVersion:(Ga=Q.data)==null?void 0:Ga.latestVersion,updateAvailable:(on=Q.data)==null?void 0:on.updateAvailable,running:P.isPending,result:P.data,error:P.error,onUpdate:()=>P.mutate()}),s.jsxs("section",{className:"grid grid-cols-2 gap-2.5 md:grid-cols-3 xl:grid-cols-6",children:[s.jsx(LN,{icon:s.jsx(Vg,{className:"size-4"}),...de}),s.jsx(Vd,{to:"/ledger",icon:s.jsx(Yf,{className:"size-4"}),label:"Today requests",value:Se(J.todayRequestCount),note:`${Se(J.totalRequestCount)} total`,tone:"requests"}),s.jsx(Vd,{to:"/ledger",icon:s.jsx(bs,{className:"size-4"}),label:"Inference cost",value:Ba(J.todaySpendMicros,{digits:4}),note:`${Ba(J.totalSpendMicros,{digits:4})} total`,tone:"spend"}),s.jsx(UN,{inputTokens:J.inputTokens,outputTokens:J.outputTokens}),s.jsx(Vd,{to:"/routing",icon:s.jsx(_S,{className:"size-4"}),label:"Nodes",value:Se(V),note:`${Se(le)} models`,tone:"inventory"})]}),s.jsx("section",{className:"grid min-w-0 gap-3",children:s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(zN,{rows:F.rows}),s.jsxs(Ot,{className:"p-3",children:[s.jsxs("div",{className:"mb-2 flex min-w-0 flex-col gap-2",children:[s.jsx("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(jj,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"Token usage"})]})}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 text-[0.7rem] text-[var(--color-muted)]",children:[J.modelUsage.map(De=>s.jsx(QN,{model:De.model,color:De.color},De.model)),s.jsx(_x,{label:"in"}),s.jsx(_x,{label:"out",dashed:!0})]})]}),s.jsxs("div",{className:"grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_190px]",children:[s.jsx(BN,{days:J.days,series:J.modelUsage}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx(qN,{days:J.days,values:J.cost,total:Ba(J.weeklySpendMicros)}),s.jsx($N,{values:J.thirtyDaySpend,total:Ba(J.totalSpendMicros)})]})]})]})]})}),s.jsx(HN,{checkedAt:me,healthy:xe,pid:(ht=p.data)==null?void 0:ht.pid,status:($t=p.data)==null?void 0:$t.status,proxyPort:(pt=p.data)==null?void 0:pt.proxyPort,controlPort:(ia=p.data)==null?void 0:ia.controlPort}),l?s.jsx(eb,{modal:l,methods:te,qr:l.kind==="activate"?j.data:w.data,loading:l.kind==="activate"?j.isPending:w.isPending,error:l.kind==="activate"?j.error:w.error,onClose:pe}):null]})}function CN({activeMode:n,autoModelCount:l,autoRange:o,autoSellerCount:i,manualProviderCount:u,manualPolicy:f,paymentName:p,scorer:h,t:v}){const x=n==="auto"?v("overview.providerMode.autoValue"):n==="manual"?v("overview.providerMode.manualValue"):Me;if(n==="auto"){const y=kN(h,v);return{label:v("overview.providerMode.label"),value:x,detail:v("overview.providerMode.autoStats",{range:AN(o,v),models:l,modelPlural:l===1?"":"s",sellers:i,sellerPlural:i===1?"":"s"}),note:p?v("overview.providerMode.autoPolicy",{scorer:y,payment:p}):v("overview.providerMode.autoPolicyNoPayment",{scorer:y})}}return{label:v("overview.providerMode.label"),value:x,detail:v("overview.providerMode.manualStats",{count:u,plural:u===1?"":"s",policy:EN(f,v)}),note:v("overview.providerMode.manualNote")}}function TN(n){if(n==="fixedSet")return"custom";if(n==="fullAuto")return"recommended"}function AN(n,l){return l(n==="custom"?"overview.providerMode.customRange":"overview.providerMode.recommendedRange")}function EN(n,l){return l(n==="locked"?"overview.providerMode.fixedProvider":"overview.providerMode.fallbackPolicy")}function kN(n,l){return l(n==="speed"?"overview.providerMode.speedScorer":n==="discount"?"overview.providerMode.costScorer":"overview.providerMode.balancedScorer")}function RN({currentVersion:n,latestVersion:l,updateAvailable:o,running:i,result:u,error:f,onUpdate:p}){if(!o&&!i&&!u&&!f)return null;const h=u?u.install.succeeded?u.restart.scheduled||u.restart.restarted?"Installed. tb-proxyd restart is in progress.":u.restart.error??"Installed. Restart needs attention.":u.install.error??"Update failed.":void 0,v=(f==null?void 0:f.message)??h??(n&&l?`TokenBuddy ${n} -> ${l}`:"TokenBuddy update available"),x=!!(f||(u==null?void 0:u.install.succeeded)===!1||u!=null&&u.restart.error);return s.jsxs("section",{className:["flex min-w-0 flex-col gap-2 rounded-[var(--radius-xl)] border px-3 py-2.5 shadow-[var(--shadow-chip)] sm:flex-row sm:items-center sm:justify-between",x?"border-[var(--color-danger)]/30 bg-[var(--color-danger-soft)]":"border-[var(--color-lavender-2)] bg-[var(--color-lavender)]"].join(" "),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:["grid size-7 shrink-0 place-items-center rounded-[var(--radius-md)] bg-white",x?"text-[var(--color-danger)]":"text-[var(--color-purple)]"].join(" "),children:s.jsx(mr,{className:["size-4",i?"animate-spin":""].join(" ")})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.82rem] font-semibold text-[var(--color-ink)]",children:"TokenBuddy update"}),s.jsx("div",{className:"truncate text-[0.74rem] text-[var(--color-muted)]",children:v})]})]}),o?s.jsxs("button",{type:"button",onClick:p,disabled:i,className:"tb-button tb-button-sm tb-button-secondary shrink-0 disabled:cursor-wait",children:[s.jsx(mr,{className:["size-3.5",i?"animate-spin":""].join(" ")}),i?"Updating":"Update"]}):null]})}function zN({rows:n}){const l=n.slice(0,3);return s.jsxs(Ot,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-3.5 py-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Vg,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"Recent model routes"})]}),s.jsx(hr,{to:"/routing",className:"tb-button tb-button-sm tb-button-secondary shrink-0",children:"Details"})]}),l.length>0?s.jsxs("div",{children:[s.jsxs("div",{className:"hidden grid-cols-[minmax(0,1fr)_minmax(180px,0.85fr)_70px_minmax(116px,0.6fr)_minmax(116px,0.6fr)_96px] gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/55 px-3.5 py-2 text-[0.64rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)] lg:grid",children:[s.jsx("div",{children:"Model"}),s.jsx("div",{children:"Node"}),s.jsx("div",{className:"text-right",children:"Disc"}),s.jsx("div",{className:"text-right",children:"Token"}),s.jsx("div",{className:"text-right",children:"Speed"}),s.jsx("div",{className:"text-right",children:"Switch"})]}),s.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:l.map(o=>s.jsx(_N,{row:o},`${o.modelId}-${o.currentSellerId}`))})]}):s.jsx("div",{className:"px-3.5 py-7 text-center text-[0.82rem] text-[var(--color-muted)]",children:"No model traffic yet."})]})}function _N({row:n}){const l=n.lastSellerSwitchAt??n.selectedAt;return s.jsxs("div",{className:"grid min-w-0 grid-cols-2 gap-3 px-3.5 py-3 lg:grid-cols-[minmax(0,1fr)_minmax(180px,0.85fr)_70px_minmax(116px,0.6fr)_minmax(116px,0.6fr)_96px] lg:items-center lg:gap-2",children:[s.jsxs("div",{className:"col-span-2 min-w-0 lg:col-span-1",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:n.modelId,children:n.modelId}),s.jsxs("div",{className:"mt-0.5 text-[0.72rem] font-medium text-[var(--color-muted)]",children:[Se(n.requestCount)," requests"]})]}),s.jsxs("div",{className:"col-span-2 min-w-0 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white/70 px-2.5 py-2 lg:col-span-1 lg:border-0 lg:bg-transparent lg:px-0 lg:py-0",children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider text-[var(--color-muted)] lg:hidden",children:"Node"}),s.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"min-w-0 truncate text-[0.82rem] font-semibold text-[var(--color-ink)]",title:n.currentSellerName,children:n.currentSellerName}),s.jsx(ON,{row:n})]}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",title:n.currentSellerId,children:zs(n.currentSellerId)})]}),s.jsx(zx,{label:"Disc",value:n.sellerDiscount,title:`Node discount: ${n.sellerDiscount}`}),s.jsxs(Rx,{label:"Token",title:`Input tokens: ${Se(n.inputTokens)} / Output tokens: ${Se(n.outputTokens)}`,children:[s.jsx(Zo,{label:"In",value:yf(n.inputTokens)}),s.jsx(Zo,{label:"Out",value:yf(n.outputTokens)})]}),s.jsxs(Rx,{label:"Speed",title:`Time to first token: ${na(n.lastTtftMs??n.avgTtftMs)} / Tokens per second: ${Ss(n.tokensPerSecond)}`,children:[s.jsx(Zo,{label:"TTFT",value:na(n.lastTtftMs??n.avgTtftMs)}),s.jsx(Zo,{label:"Tok/s",value:Ig(n.tokensPerSecond)})]}),s.jsx(zx,{label:"Switch",value:Wj(l),title:`Last node switch: ${gc(l)}`})]})}function ON({row:n}){const l=DN(n),o={green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",blue:"bg-blue-50 text-blue-700",gray:"bg-slate-100 text-slate-600"}[l.tone];return s.jsx("span",{className:["shrink-0 rounded-full px-1.5 py-0.5 text-[0.62rem] font-semibold uppercase",o].join(" "),children:l.label})}function DN(n){return n.source==="preview"?{label:"preview",tone:"amber"}:n.routeState?{label:bn(n.routeState),tone:ea(n.routeState)}:n.upstreamStatus&&!Gd(n.upstreamStatus)?{label:bn(n.upstreamStatus),tone:ea(n.upstreamStatus)}:n.lastStatus&&!Gd(n.lastStatus)?{label:bn(n.lastStatus),tone:ea(n.lastStatus)}:n.currentSellerStatus&&!Gd(n.currentSellerStatus)?{label:bn(n.currentSellerStatus),tone:ea(n.currentSellerStatus)}:{label:"ok",tone:"green"}}function Gd(n){const l=bn(n);return l==="ok"||l==="online"||l==="configured"||l==="settled"||l==="completed"||l==="success"||l==="active"||l==="healthy"}function Rx({label:n,title:l,children:o}){return s.jsxs("div",{className:"min-w-0 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-2 py-1 lg:border-0 lg:bg-transparent lg:px-0 lg:py-0 lg:text-right",title:l,children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider text-[var(--color-muted)] lg:hidden",children:n}),s.jsx("div",{className:"grid gap-0.5 font-mono text-[0.74rem] font-semibold leading-snug text-[var(--color-ink)]",children:o})]})}function Zo({label:n,value:l}){return s.jsxs("div",{className:"flex min-w-0 items-baseline justify-between gap-2 lg:justify-end",children:[s.jsx("span",{className:"shrink-0 text-[0.6rem] font-semibold uppercase tracking-normal text-[var(--color-muted)]",children:n}),s.jsx("span",{className:"truncate",children:l})]})}function zx({label:n,value:l,title:o}){return s.jsxs("div",{className:"min-w-0 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-2 py-1 lg:border-0 lg:bg-transparent lg:px-0 lg:py-0 lg:text-right",title:o??`${n}: ${l}`,children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider text-[var(--color-muted)] lg:hidden",children:n}),s.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold text-[var(--color-ink)]",children:l})]})}function Vd({to:n,icon:l,label:o,value:i,note:u,tone:f}){const p=_s(f);return s.jsxs(hr,{to:n,"aria-label":`Open ${o}`,className:["relative block min-h-[94px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",p.card].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(nm,{tone:f,children:l}),s.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3 tracking-[0.08em]",p.label].join(" "),children:o})]}),s.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none tracking-tight",p.value].join(" "),children:i}),s.jsx("div",{className:["mt-1.5 truncate text-[0.72rem] font-medium",p.note].join(" "),children:u})]})}function UN({inputTokens:n,outputTokens:l}){const o=_s("tokens");return s.jsx(hr,{to:"/ledger","aria-label":"Open Total tokens",className:["relative col-span-2 block min-h-[124px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",o.card].join(" "),children:s.jsx(iN,{inputTokens:n,outputTokens:l})})}function LN({icon:n,label:l,value:o,detail:i,note:u}){const f=_s("router");return s.jsxs(hr,{to:"/routing","aria-label":`Open ${l}`,className:["relative block min-h-[94px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",f.card].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(nm,{tone:"router",children:n}),s.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3 tracking-[0.08em]",f.label].join(" "),children:l})]}),s.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none tracking-tight",f.value].join(" "),children:o}),s.jsx("div",{className:["mt-1.5 truncate text-[0.72rem] font-semibold",f.note].join(" "),children:i}),s.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] font-medium text-[var(--color-muted)]",children:u})]})}function BN({days:n,series:l}){const u={top:14,right:18,bottom:26,left:26},f=l.flatMap(x=>[...x.input,...x.output]),p=Math.max(1,...f),h=x=>u.left+x*(680-u.left-u.right)/Math.max(1,n.length-1),v=x=>u.top+(1-x/p)*(150-u.top-u.bottom);return s.jsx("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:s.jsxs("svg",{className:"h-[160px] w-full",viewBox:"0 0 680 150",role:"img","aria-label":"Daily model input and output usage lines",children:[[.25,.5,.75,1].map(x=>s.jsx("line",{x1:u.left,x2:680-u.right,y1:u.top+(1-x)*(150-u.top-u.bottom),y2:u.top+(1-x)*(150-u.top-u.bottom),stroke:"var(--color-chart-grid)",strokeWidth:"1"},x)),n.map((x,y)=>s.jsx("text",{x:h(y),y:143,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[10px]",children:x},x)),l.map(x=>s.jsxs("g",{children:[s.jsx("path",{d:jf(x.input.map((y,g)=>[h(g),v(y)])),fill:"none",stroke:x.color,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:jf(x.output.map((y,g)=>[h(g),v(y)])),fill:"none",stroke:x.color,strokeWidth:"2.4",strokeDasharray:"5 5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.75"}),x.input.map((y,g)=>s.jsx("circle",{cx:h(g),cy:v(y),r:"2.7",fill:x.color},`${x.model}-input-${g}`)),x.output.map((y,g)=>s.jsx("circle",{cx:h(g),cy:v(y),r:"2.2",fill:"#fff",stroke:x.color,strokeWidth:"1.8"},`${x.model}-output-${g}`))]},x.model)),l.length===0?s.jsx("text",{x:680/2,y:150/2,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[12px]",children:"No token usage yet"}):null]})})}function qN({days:n,values:l,total:o}){const f={top:10,right:8,bottom:16,left:8},p=Math.max(1,...l),h=x=>f.left+x*(190-f.left-f.right)/Math.max(1,l.length-1),v=x=>f.top+(1-x/p)*(72-f.top-f.bottom);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"Inference cost"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:o})]}),s.jsxs("svg",{className:"h-[66px] w-full",viewBox:"0 0 190 72",role:"img","aria-label":"Daily inference cost curve",children:[s.jsx("path",{d:jf(l.map((x,y)=>[h(y),v(x)])),fill:"none",stroke:"var(--color-chart-cost)",strokeWidth:"3",strokeLinecap:"round"}),l.map((x,y)=>s.jsx("circle",{cx:h(y),cy:v(x),r:"2.4",fill:"var(--color-chart-cost)"},n[y]))]})]})}function $N({values:n,total:l}){const o=Math.max(1,...n);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"30 day inference cost"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:l})]}),s.jsx("div",{className:"flex h-[60px] items-end gap-1",children:n.map((i,u)=>s.jsx("span",{className:"flex-1 rounded-t-[3px] bg-[var(--color-tokens)]/75",style:{height:`${Math.max(8,i/o*100)}%`}},u))})]})}function jf(n){return n.length===0?"":n.length===1?`M ${n[0][0]} ${n[0][1]}`:n.reduce((l,o,i)=>{if(i===0)return`M ${o[0]} ${o[1]}`;const u=n[i-1],f=(u[0]+o[0])/2;return`${l} C ${f} ${u[1]}, ${f} ${o[1]}, ${o[0]} ${o[1]}`},"")}function QN({model:n,color:l}){return s.jsxs("span",{className:"inline-flex min-w-0 max-w-[9rem] items-center gap-1.5 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",title:n,children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:l}}),s.jsx("span",{className:"truncate font-mono text-[0.68rem]",children:n})]})}function _x({label:n,dashed:l=!1}){return s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",children:[s.jsx("span",{className:["h-px w-4 border-t border-[var(--color-ink)]",l?"border-dashed":""].join(" ")}),s.jsx("span",{className:"font-mono text-[0.68rem]",children:n})]})}function HN({checkedAt:n,healthy:l,pid:o,status:i,proxyPort:u,controlPort:f}){const p=[{icon:s.jsx(PS,{className:"size-3"}),label:"Daemon",value:o?`pid ${o}`:i??Me,tone:l?"green":"amber"},{icon:s.jsx(lj,{className:"size-3"}),label:"Proxy",value:u?`:${u}`:Me,tone:"blue"},{icon:s.jsx(mj,{className:"size-3"}),label:"Control",value:f?`:${f}`:Me,tone:"router"}];return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white px-3 py-2 shadow-[var(--shadow-chip)]",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.72rem] font-medium text-[var(--color-muted)]",children:[s.jsx(mr,{className:"size-3.5"}),n]}),p.map(h=>s.jsx(PN,{...h},h.label))]})}function PN({icon:n,label:l,value:o,tone:i}){const u={green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",router:"bg-[var(--color-lavender)] text-[var(--color-router)]",spend:"bg-[var(--color-spend-soft)] text-[var(--color-spend)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]"}[i];return s.jsxs("div",{className:"inline-flex min-w-0 max-w-full items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1",children:[s.jsx("span",{className:["grid size-5 shrink-0 place-items-center rounded-[var(--radius-sm)]",u].join(" "),children:n}),s.jsx("span",{className:"text-[0.72rem] font-semibold text-[var(--color-ink)]",children:l}),s.jsx("span",{className:"min-w-0 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:o})]})}function KN(n){const l=Ox(7),o=Ox(30),i=Nf(new Date),u=new Set(l.map(H=>H.key)),f=new Map(o.map((H,$)=>[H.key,$])),p=["var(--color-chart-input)","var(--color-spend)","var(--color-chart-cost)","var(--color-inventory)"],h=new Map,v=l.map(()=>0),x=o.map(()=>0);let y=0,g=0,j=0,w=0,T=0,E=0,D=0,R=0,L=0,Q=0,P=0;for(const H of n){const $=Nf(new Date(H.createdAt)),I=H.settledUsdMicros??H.billedMicros??0,J=YN(H),te=J?0:H.promptTokens??0,F=J?0:H.completionTokens??0,Z=J?Number.isFinite(H.imageCount)?H.imageCount:1:0;P+=1,g+=I,L+=Z,w+=te,T+=F,$===i&&(Q+=1,y+=I,R+=Z,E+=te,D+=F);const se=l.findIndex(me=>me.key===$);if(se>=0){j+=I,v[se]+=I/1e6;const me=h.get(H.modelId)??{input:l.map(()=>0),output:l.map(()=>0),total:0};me.input[se]+=te,me.output[se]+=F,me.total+=te+F,h.set(H.modelId,me)}else u.has($)&&(j+=I);const xe=f.get($);xe!==void 0&&(x[xe]+=I/1e6)}const G=Array.from(h.entries()).sort((H,$)=>$[1].total-H[1].total).slice(0,4).map(([H,$],I)=>({model:H,color:p[I%p.length],input:$.input,output:$.output}));return{days:l.map(H=>H.label),modelUsage:G,cost:v,thirtyDaySpend:x,todaySpendMicros:y,totalSpendMicros:g,weeklySpendMicros:j,inputTokens:w,outputTokens:T,todayInputTokens:E,todayOutputTokens:D,todayImageCount:R,totalImageCount:L,todayRequestCount:Q,totalRequestCount:P}}function YN(n){return n.billingUnit==="images"||n.endpoint==="/v1/images/generations"}function Ox(n){const l=[],o=new Intl.DateTimeFormat("en",{weekday:"short"});for(let i=n-1;i>=0;i-=1){const u=new Date;u.setHours(0,0,0,0),u.setDate(u.getDate()-i),l.push({key:Nf(u),label:o.format(u)})}return l}function Nf(n){if(Number.isNaN(n.getTime()))return"";const l=n.getFullYear(),o=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return`${l}-${o}-${i}`}const GN=[{value:"balanced",label:"Balanced"},{value:"speed",label:"Speed"},{value:"discount",label:"Cost"}],Dx=10,VN=["clawtip"];function XN(){var Ze,Dn,Xa,da,fa,Fa,Za,ut,$e,nt,ma,xr;const n=Fg(),l=Zg(),o=Aj(),i=Jg(),u=Ej(),f=Zf(),p=Oj(),h=kj(),v=Rj(),x=zj(),y=_j(),g=Uj(),j=Lj(),w=Jf(),T=Rs(),E=$j(),D=Qj(),R=Hj(),L=xc(),Q=Vf(),P=Cj(),G=Xf(),H=Ff(),[$,I]=S.useState({mode:"fullAuto",scorer:"balanced"}),[J,te]=S.useState([]),[F,Z]=S.useState(""),[se,xe]=S.useState("manual"),[me,O]=S.useState("recommended"),[ee,re]=S.useState(null),[ae,ge]=S.useState(null),[N,B]=S.useState(null),[V,le]=S.useState(null),de=Bj({...$,modelId:F}),pe=T.data,be=((Ze=f.data)==null?void 0:Ze.providers)??[],Xe=((Dn=f.data)==null?void 0:Dn.routing)??{policy:"fallback"},Oe=((Xa=w.data)==null?void 0:Xa.sellers)??[],Mt=((da=R.data)==null?void 0:da.focusSet)??[],mt=((fa=L.data)==null?void 0:fa.inferences)??[],yn=S.useMemo(()=>yw(mt),[mt]),We=S.useMemo(()=>xw((pe==null?void 0:pe.data)??[],Mt),[Mt,pe==null?void 0:pe.data]),Be=ww(de.data),Gt=S.useMemo(()=>jw(Oe,pe,(Be==null?void 0:Be.routes)??[]),[pe,Be==null?void 0:Be.routes,Oe]),an=S.useMemo(()=>J.map(W=>We.find(ne=>ne.id===W)).filter(dc),[We,J]),ln=$.sellerIds??[],Bt=((Fa=Q.data)==null?void 0:Fa.payments)??[],Et=S.useMemo(()=>kw(Bt),[Bt]),rn=S.useMemo(()=>Wg(Bt,mt),[mt,Bt]),sn=S.useMemo(()=>{const W=Ew(Gt,J,$.scorer);if(me==="recommended")return W;const ne=ln.map(ke=>Gt.find(at=>at.id===ke)).filter(dc);return lm(ne,J,$.scorer)},[me,$.scorer,ln,J,Gt]),Kn=i.isLoading||T.isLoading||w.isLoading||de.isFetching&&sn.length===0,la=!Kn&&(i.isFetching||T.isFetching||w.isFetching||de.isFetching),rt=S.useMemo(()=>ub({inferences:mt,modelsResponse:pe,sellersResponse:w.data,manualProviders:be,previewPlan:Be,activeModelId:F}),[F,mt,be,pe,Be,w.data]),Ha=S.useMemo(()=>Sw(rt.rows,mt),[mt,rt.rows]),Sn=Bt.some(W=>$n(W.method)==="clawtip"&&(W.enabled||hb(W.config,"walletConfigPresent")))||((Za=G.data)==null?void 0:Za.walletConfigPresent)===!0,qt=se==="auto"&&Et.active;S.useEffect(()=>{if(!ae)return;const W=window.setTimeout(()=>ge(null),4200);return()=>window.clearTimeout(W)},[ae]),S.useEffect(()=>{var W,ne,ke;if((W=n.data)!=null&&W.strategy){if(((ne=l.data)==null?void 0:ne.active)==="auto"&&((ke=i.data)!=null&&ke.config))return;I(n.data.strategy)}},[(ut=i.data)==null?void 0:ut.config,($e=l.data)==null?void 0:$e.active,(nt=n.data)==null?void 0:nt.strategy]),S.useEffect(()=>{l.data&&xe(l.data.active)},[l.data]),S.useEffect(()=>{var ne;const W=(ne=i.data)==null?void 0:ne.config;W&&(O(W.range),I(ke=>({...ke,mode:W.range==="custom"?"fixedSet":"fullAuto",scorer:W.scorer,sellerId:void 0,sellerIds:W.sellerIds})),W.modelIds.length>0&&(te(W.modelIds),Z(ke=>W.modelIds.includes(ke)?ke:W.modelIds[0]??"")))},[(ma=i.data)==null?void 0:ma.config]),S.useEffect(()=>{const W=!R.isLoading&&!L.isLoading;if(J.length>0||We.length===0||!W)return;const ne=gw({focusModels:Mt,referencedModelIds:yn,modelOptions:We});ne.length!==0&&(te(ne),Z(ne[0]??""))},[Mt,R.isLoading,L.isLoading,We,yn,J.length]),S.useEffect(()=>{!F||J.includes(F)||Z(J[0]??"")},[F,J]),S.useEffect(()=>{F&&de.refetch()},[F,$.mode,$.scorer,$.sellerId,(xr=$.sellerIds)==null?void 0:xr.join(","),Cw($.fixedByModel)]),S.useEffect(()=>{if((V==null?void 0:V.kind)!=="activate"||$n(V.method)!=="clawtip"||Sn)return;const W=window.setInterval(()=>{Q.refetch()},1500);return()=>window.clearInterval(W)},[Sn,V==null?void 0:V.kind,V==null?void 0:V.method,Q.refetch]),S.useEffect(()=>{(V==null?void 0:V.kind)==="activate"&&$n(V.method)==="clawtip"&&Sn&&(le(null),G.reset())},[G,Sn,V==null?void 0:V.kind,V==null?void 0:V.method]);function Ka(W){te(ne=>{const ke=ne.filter(at=>at!==W);return F===W&&Z(ke[0]??""),bf(ke).catch(()=>{}),qt&&He({modelIds:ke}),ke})}function ra(W){const ne=Array.from(new Set(W));te(ne),Z(ke=>ne.includes(ke)?ke:ne[0]??""),bf(ne).catch(()=>{}),qt&&He({modelIds:ne})}function Ya(W){I(ne=>({...ne,scorer:W})),qt&&He({scorer:W})}function Ga(W,ne){const ke=$.sellerIds??[],at=ke.includes(ne)?ke.filter(Ja=>Ja!==ne):[...ke,ne];on(at)}function on(W){const ne={...$,mode:"fixedSet",sellerIds:W,sellerId:void 0};I(ne),qt&&me==="custom"&&He({range:"custom",sellerIds:W})}async function ht(W){await h.mutateAsync({name:W.name.trim()||"Custom endpoint",baseUrl:W.baseUrl.trim(),apiKey:W.apiKey.trim(),enabled:!0}),B(null)}async function $t(W,ne){await v.mutateAsync({providerId:W,input:{name:ne.name.trim()||"Custom endpoint",baseUrl:ne.baseUrl.trim(),apiKey:ne.apiKey.trim(),enabled:!0}}),B(null)}function pt(W){x.mutateAsync(W).catch(ne=>{re(ne instanceof Error?ne.message:String(ne))})}function ia(W){p.mutateAsync(W).catch(ne=>{re(ne instanceof Error?ne.message:String(ne))})}function De(W){const ne=be.findIndex(at=>at.id===W);if(ne<=0)return;const ke=be.map(at=>at.id);[ke[ne-1],ke[ne]]=[ke[ne],ke[ne-1]],y.mutateAsync(ke).catch(at=>{re(at instanceof Error?at.message:String(at))})}function jt(W){ge(W)}function sa(W){g.mutateAsync(W.id).then(ne=>{jt({tone:"success",title:`${W.name} is healthy`,detail:`say hi · ${ne.modelId} · ${na(ne.elapsedMs)}`})}).catch(ne=>{jt({tone:"error",title:`${W.name} test failed`,detail:ne instanceof Error?ne.message:String(ne)})})}function oa(W){j.mutateAsync(W.id).then(ne=>{jt({tone:"success",title:`${W.name} models refreshed`,detail:`${Se(ne.modelIds.length)} models · ${na(ne.elapsedMs)}`})}).catch(ne=>{jt({tone:"error",title:`${W.name} model refresh failed`,detail:ne instanceof Error?ne.message:String(ne)})})}function ca(W){E.mutateAsync(W.id).then(ne=>{jt({tone:"success",title:`${W.name} is healthy`,detail:`say hi · ${ne.modelId} · ${na(ne.elapsedMs)}`})}).catch(ne=>{jt({tone:"error",title:`${W.name} test failed`,detail:ne instanceof Error?ne.message:String(ne)})})}function jn(W){D.mutateAsync().then(ne=>{const ke=ne.data.filter(at=>at.sellerId===W.id).length;jt({tone:"success",title:`${W.name} models refreshed`,detail:`${Se(ke)} node models · ${Se(ne.data.length)} total`})}).catch(ne=>{jt({tone:"error",title:`${W.name} model refresh failed`,detail:ne instanceof Error?ne.message:String(ne)})})}function ua(W){O(W),W==="custom"&&ln.length===0&&B({kind:"sellers"}),qt&&He({range:W})}function Yn(W){xe(W),re(null),o.mutateAsync(W).then(ne=>{xe(ne.active),ne.strategy&&I(ne.strategy)}).catch(ne=>{re(ne instanceof Error?ne.message:String(ne))})}function vr(W){re(null),P.mutateAsync(W).catch(ne=>{re(ne instanceof Error?ne.message:String(ne))})}function Ul(W){le({kind:"activate",method:W}),$n(W)==="clawtip"&&G.mutate()}function Va(W){le({kind:"recharge",method:W}),$n(W)==="clawtip"&&H.mutate()}function ue(){le(null),G.reset(),H.reset()}async function He(W={}){var ha;if(!Et.active){re("Bind a payment method to enable Auto routing.");return}const ne=W.scorer??$.scorer,ke=W.range??me,at=W.modelIds??J,Ja=W.sellerIds??ln;I(ke==="recommended"?{mode:"fullAuto",scorer:ne}:{mode:"fixedSet",scorer:ne,sellerIds:Ja}),re(null);try{const cn=await u.mutateAsync(bw({base:(ha=i.data)==null?void 0:ha.config,enabled:!0,range:ke,scorer:ne,modelIds:at,sellerIds:Ja}));xe(cn.active),cn.strategy&&I(cn.strategy)}catch(cn){re(cn instanceof Error?cn.message:String(cn))}}return s.jsxs("div",{className:"space-y-5",children:[s.jsx("section",{children:s.jsxs(Ot,{className:"overflow-hidden",children:[s.jsx(FN,{activeTab:se,onChange:Yn}),s.jsxs("div",{className:"p-4",children:[n.isLoading||l.isLoading||w.isLoading||T.isLoading||f.isLoading?s.jsx("div",{className:"mb-3 rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.82rem] text-[var(--color-muted)]",children:"Loading routing data..."}):null,n.isError||l.isError||w.isError||T.isError||f.isError?s.jsx("div",{className:"mb-3 rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.82rem] text-rose-700",children:"Some routing data could not be loaded. Check that tb-proxyd is running."}):null,se==="manual"?s.jsx(ZN,{providers:be,routing:Xe,onAdd:()=>B({kind:"manualProvider"}),onRemove:pt,onSetRouting:ia,onMoveUp:De,onTest:sa,onRefreshModels:oa,onViewModels:W=>B({kind:"manualProviderModels",provider:W}),onEdit:W=>B({kind:"manualProviderEdit",provider:W}),testingProviderId:g.isPending?g.variables:void 0,refreshingModelsProviderId:j.isPending?j.variables:void 0}):s.jsx(ew,{walletAccess:Et,paymentMethods:rn,selectedModels:an,activeModelId:F,range:me,scorer:$.scorer,effectiveSellers:sn,selectedSellerIds:ln,sellerActivityById:Ha,loading:Kn,refreshing:la,applyError:ee,focusSaveError:R.isError,onSelectPayment:vr,onActivatePayment:Ul,onRechargePayment:Va,onAddModels:()=>B({kind:"models"}),onSetActiveModel:Z,onRemoveModel:Ka,onRangeChange:ua,onScorerChange:Ya,onChooseSellers:()=>B({kind:"sellers"}),onRemoveSeller:W=>Ga(F,W),onTestSeller:ca,onRefreshSellerModels:jn,testingSellerId:E.isPending?E.variables:void 0,refreshingSellerModels:D.isPending})]})]})}),s.jsx(rw,{summary:rt}),(N==null?void 0:N.kind)==="models"?s.jsx(dw,{models:We,selectedModelIds:J,onClose:()=>B(null),onSave:W=>{ra(W),B(null)}}):null,(N==null?void 0:N.kind)==="sellers"?s.jsx(fw,{selectedSellerIds:ln,selectedModelIds:J,activeModelId:F,scorer:$.scorer,sellers:Gt,onClose:()=>B(null),onSave:W=>{on(W),B(null)}}):null,(N==null?void 0:N.kind)==="manualProvider"?s.jsx($x,{onClose:()=>B(null),onSave:ht}):null,(N==null?void 0:N.kind)==="manualProviderEdit"?s.jsx($x,{provider:N.provider,onClose:()=>B(null),onSave:W=>$t(N.provider.id,W)}):null,(N==null?void 0:N.kind)==="manualProviderModels"?s.jsx(mw,{provider:N.provider,onClose:()=>B(null)}):null,V?s.jsx(eb,{modal:V,methods:rn,qr:V.kind==="activate"?G.data:H.data,loading:V.kind==="activate"?G.isPending:H.isPending,error:V.kind==="activate"?G.error:H.error,onClose:ue}):null,ae?s.jsx(uw,{toast:ae,onClose:()=>ge(null)}):null]})}function FN({activeTab:n,onChange:l}){return s.jsx("div",{className:"border-b border-[var(--color-line-2)] bg-white p-2.5",children:s.jsxs("div",{className:["relative grid min-h-[58px] grid-cols-2 overflow-hidden rounded-full border border-[var(--color-line-2)] bg-[var(--color-page)] p-1 shadow-inner","before:absolute before:inset-y-1 before:left-1 before:w-[calc(50%-4px)] before:rounded-full before:shadow-[0_10px_24px_rgba(60,41,112,0.14)] before:transition before:duration-200 before:ease-out",n==="auto"?"border-[var(--color-purple)]/35 before:bg-[var(--color-purple)]":"before:bg-white",n==="auto"?"before:translate-x-full":"before:translate-x-0"].join(" "),children:[s.jsx("button",{type:"button",onClick:()=>l("manual"),"aria-pressed":n==="manual","aria-label":"Manual endpoint mode",className:["relative z-10 flex min-w-0 items-center justify-center rounded-full px-5 text-center transition",n==="manual"?"text-[var(--color-ink)]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:s.jsx("span",{className:"min-w-0 truncate text-[1rem] font-semibold",children:"Manual"})}),s.jsx("button",{type:"button",onClick:()=>l("auto"),"aria-pressed":n==="auto","aria-label":"Auto node mode",className:["relative z-10 flex min-w-0 items-center justify-center rounded-full px-5 text-center transition",n==="auto"?"text-white":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:s.jsx("span",{className:"min-w-0 truncate text-[1rem] font-semibold",children:"Auto"})})]})})}function ZN({providers:n,routing:l,onAdd:o,onRemove:i,onSetRouting:u,onMoveUp:f,onTest:p,onRefreshModels:h,onViewModels:v,onEdit:x,testingProviderId:y,refreshingModelsProviderId:g}){const j=l.policy==="fallback";return s.jsxs("div",{className:"overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-white",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-2 border-b border-[var(--color-line-2)] px-3 py-2.5",children:s.jsx("span",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Custom endpoints"})}),n.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[720px] table-fixed",children:[s.jsx("thead",{className:"border-b border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] text-left text-[0.66rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-[30%] px-3 py-2",children:"Endpoint"}),s.jsx("th",{className:"w-[9%] px-3 py-2 text-right",children:"Models"}),s.jsx("th",{className:"w-[15%] px-3 py-2",children:"Status"}),s.jsx("th",{className:"w-[15%] px-3 py-2",children:"Speed"}),s.jsx("th",{className:"w-[16%] px-3 py-2",children:"Last call"}),s.jsx("th",{className:"w-[15%] px-3 py-2 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)]",children:n.map((w,T)=>{var E;return s.jsxs("tr",{className:"align-middle",children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:w.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:w.baseUrl})]})}),s.jsx("td",{className:"px-3 py-2.5 text-right",children:s.jsxs("button",{type:"button",onClick:()=>v(w),className:"inline-flex items-center gap-1 rounded-full bg-[var(--color-page)] px-2 py-1 font-mono text-[0.72rem] font-semibold text-[var(--color-purple)] ring-1 ring-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]","aria-label":`View models for ${w.name}`,children:[Se(((E=w.models)==null?void 0:E.length)??0),s.jsx(tj,{size:12})]})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(JN,{provider:w})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(yc,{ttftMs:w.ttftMs,tokensPerSecond:w.avgTokensPerSecond})}),s.jsx("td",{className:"px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:gc(w.lastAccess)}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsxs("div",{className:"flex justify-end gap-1.5",children:[s.jsx("button",{type:"button",onClick:()=>p(w),disabled:y===w.id,className:"tb-button tb-button-icon tb-button-quiet disabled:cursor-wait disabled:opacity-60","aria-label":`Test ${w.name}`,title:"Run say hi test",children:y===w.id?s.jsx(yt,{size:14,className:"animate-spin"}):s.jsx(Yf,{size:14})}),s.jsx("button",{type:"button",onClick:()=>h(w),disabled:g===w.id,className:"tb-button tb-button-icon tb-button-quiet disabled:cursor-wait disabled:opacity-60","aria-label":`Refresh models for ${w.name}`,title:"Refresh model list",children:s.jsx(mr,{size:14,className:g===w.id?"animate-spin":""})}),j?s.jsx("button",{type:"button",onClick:()=>f(w.id),disabled:T===0,className:"tb-button tb-button-icon tb-button-quiet disabled:cursor-not-allowed disabled:opacity-35","aria-label":`Move ${w.name} up`,title:"Move up",children:s.jsx(Gg,{size:14})}):null,s.jsx("button",{type:"button",onClick:()=>x(w),className:"tb-button tb-button-icon tb-button-quiet","aria-label":`Edit ${w.name}`,title:"Edit",children:s.jsx(ij,{size:14})}),s.jsx("button",{type:"button",onClick:()=>i(w.id),className:"tb-button tb-button-icon tb-button-quiet hover:border-[var(--color-danger)] hover:bg-[var(--color-danger-soft)] hover:text-[var(--color-danger)]","aria-label":`Remove ${w.name}`,children:s.jsx(Gf,{size:14})})]})})]},w.id)})})]})}):s.jsx("div",{className:"px-3 py-6 text-center text-[0.84rem] text-[var(--color-muted)]",children:"No custom endpoints yet."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2.5",children:[s.jsxs("button",{type:"button",onClick:o,className:"tb-button tb-button-sm tb-button-primary",children:[s.jsx(ys,{size:14}),"Add endpoint"]}),s.jsxs("div",{className:"ml-auto flex flex-wrap items-center justify-end gap-1.5",children:[s.jsx(Xd,{label:"Fallback on error",state:j?"selected":"enabled",onClick:()=>u({policy:"fallback"})}),s.jsx(Xd,{label:"Cost first",state:"disabled"}),s.jsx(Xd,{label:"Multi-endpoint concurrent calls",state:"disabled"})]})]})]})}function Xd({label:n,state:l,onClick:o}){const i=l!=="disabled"&&!!o,u={enabled:"border-[var(--color-line-2)] bg-white text-[var(--color-muted)] shadow-[0_1px_3px_rgba(60,41,112,0.05)] hover:border-[var(--color-primary)] hover:bg-[var(--color-primary-soft)] hover:text-[var(--color-primary-deep)]",selected:"border-[var(--color-primary)]/35 bg-[var(--color-primary-soft)] text-[var(--color-primary-deep)] shadow-[0_1px_4px_rgba(60,41,112,0.08)]",disabled:"border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] text-[var(--color-muted-soft)] opacity-70"}[l];return s.jsx("button",{type:"button",onClick:o,disabled:!i,className:["inline-flex h-7 items-center justify-center rounded-full border px-3 text-[0.7rem] font-semibold transition disabled:cursor-not-allowed",u].join(" "),"aria-pressed":l==="selected",title:n==="Fallback on error"?"Use endpoints by table order when the current endpoint fails.":`${n} is not available in Manual mode.`,children:n})}function JN({provider:n}){const l=(n.status??"unknown").toLowerCase(),u=l==="healthy"||l==="ok"||l==="online"?"bg-emerald-50 text-emerald-700 ring-emerald-100":l==="unknown"||l===""?"bg-[var(--color-page)] text-[var(--color-muted)] ring-[var(--color-line-2)]":"bg-rose-50 text-rose-700 ring-rose-100";return s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsxs("span",{className:["inline-flex h-6 items-center gap-1.5 rounded-full px-2 text-[0.68rem] font-semibold ring-1",u].join(" "),children:[s.jsx("span",{className:"size-1.5 rounded-full bg-current","aria-hidden":"true"}),n.status??"unknown"]}),n.current?s.jsx("span",{className:"inline-flex h-6 items-center rounded-full bg-emerald-50 px-2 text-[0.62rem] font-semibold uppercase text-emerald-700 ring-1 ring-emerald-100",children:"Current"}):null,n.errorClass?s.jsx("span",{className:"text-[0.7rem] text-[var(--color-danger)]",children:n.errorClass}):null]})}function fb({seller:n,current:l}){const o=wf(n),i={green:"bg-emerald-50 text-emerald-700 ring-emerald-100",amber:"bg-amber-50 text-amber-700 ring-amber-100",red:"bg-rose-50 text-rose-700 ring-rose-100",blue:"bg-blue-50 text-blue-700 ring-blue-100",gray:"bg-slate-100 text-slate-600 ring-slate-200"}[o.tone];return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:["inline-flex h-6 items-center rounded-full px-2 text-[0.62rem] font-semibold uppercase ring-1",i].join(" "),children:o.label}),l?s.jsx("span",{className:"inline-flex h-6 items-center rounded-full bg-emerald-50 px-2 text-[0.62rem] font-semibold uppercase text-emerald-700 ring-1 ring-emerald-100",children:"Current"}):null]})}function wf(n){return n.routeState?{label:bn(n.routeState),tone:ea(n.routeState)}:n.health==="offline"?{label:"error",tone:"red"}:n.health==="degraded"?{label:"degraded",tone:"amber"}:n.coverageModelIds.length<=0?{label:"unknown",tone:"gray"}:{label:"ok",tone:"green"}}function IN(n,l){if(l.length===0)return"available";const o=l.filter(i=>n.coverageModelIds.includes(i)).length;return`${Se(o)}/${Se(l.length)} selected`}function WN({value:n}){return s.jsx("div",{className:"min-w-0 font-mono text-[0.72rem] text-[var(--color-muted)]",children:s.jsx("div",{className:"truncate",children:gc(n)})})}function ew({walletAccess:n,paymentMethods:l,selectedModels:o,activeModelId:i,range:u,scorer:f,effectiveSellers:p,selectedSellerIds:h,sellerActivityById:v,loading:x,refreshing:y,applyError:g,focusSaveError:j,onSelectPayment:w,onActivatePayment:T,onRechargePayment:E,onAddModels:D,onSetActiveModel:R,onRemoveModel:L,onRangeChange:Q,onScorerChange:P,onChooseSellers:G,onRemoveSeller:H,onTestSeller:$,onRefreshSellerModels:I,testingSellerId:J,refreshingSellerModels:te=!1}){const F=!n.active;return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2",children:[!F&&g?s.jsx("span",{className:"max-w-full truncate rounded-full bg-rose-50 px-2.5 py-1 text-[0.74rem] font-semibold text-rose-700 ring-1 ring-rose-100 sm:max-w-[360px]",title:g,children:g}):null,s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[s.jsx("span",{className:"text-[0.68rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:"Payment route"}),s.jsx("div",{className:"inline-flex min-h-9 flex-wrap items-center gap-1 rounded-full border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] p-0.5",children:n.options.map(Z=>s.jsx(tw,{option:Z,method:l.find(se=>$n(se.method)===$n(Z.method)),onSelect:w,onActivate:T,onRecharge:E},Z.method))})]})]}),s.jsxs("div",{className:["space-y-3 transition",F?"pointer-events-none select-none opacity-45 grayscale-[0.25]":""].join(" "),"aria-disabled":F,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2",children:[s.jsx("span",{className:"mr-1 text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Recent models"}),o.map(Z=>{const se=i===Z.id;return s.jsxs("span",{className:["inline-flex h-8 items-center gap-1.5 rounded-[8px] border px-2.5 font-mono text-[0.8rem] transition",se?"border-[var(--color-primary)] bg-[var(--color-primary-soft)] shadow-[inset_0_0_0_1px_rgba(124,61,240,0.18)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)] hover:bg-[var(--color-panel-subtle)]"].join(" "),children:[s.jsx("button",{type:"button",onClick:()=>R(Z.id),disabled:F,className:["truncate font-semibold",se?"text-[var(--color-primary-deep)]":"text-[color-mix(in_srgb,var(--color-primary-deep)_82%,var(--color-muted))]"].join(" "),children:Z.id}),s.jsx("span",{className:"rounded-full bg-white px-1.5 text-[0.68rem] text-[var(--color-muted)]",children:Z.sellerCount}),s.jsx("button",{type:"button",onClick:()=>L(Z.id),disabled:F,className:"text-[var(--color-muted)] hover:text-rose-700","aria-label":`Remove ${Z.id}`,children:s.jsx(Gf,{size:12})})]},Z.id)}),s.jsxs("button",{type:"button",onClick:D,disabled:F,className:"tb-button tb-button-sm tb-button-secondary",children:[s.jsx(ys,{size:14}),"Manage"]}),o.length===0?s.jsx("span",{className:"text-[0.8rem] text-[var(--color-muted)]",children:"Choose at least one model."}):null,j?s.jsx("span",{className:"text-[0.8rem] text-amber-700",children:"Models could not be saved."}):null]}),s.jsx(nw,{range:u,scorer:f,activeModelId:i,sellers:p,selectedSellerIds:h,selectedModelIds:o.map(Z=>Z.id),sellerActivityById:v,disabled:F,loading:x,refreshing:y,onRangeChange:Q,onScorerChange:P,onChooseSellers:G,onRemoveSeller:H,onTestSeller:$,onRefreshSellerModels:I,testingSellerId:J,refreshingSellerModels:te})]})]})}function tw({option:n,method:l,onSelect:o,onActivate:i,onRecharge:u}){const[f,p]=S.useState(!1),h=["inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.74rem] font-semibold transition",n.selected?"bg-[var(--color-primary-soft)] text-[var(--color-primary-deep)] shadow-[0_1px_4px_rgba(60,41,112,0.08)]":n.configured?"text-[var(--color-muted)] hover:bg-white hover:text-[var(--color-ink)]":"border border-amber-200 bg-amber-50 text-amber-800 hover:border-amber-300 hover:bg-amber-100"].join(" "),v=["inline-flex size-4 items-center justify-center rounded-full text-[0.58rem] font-black",n.method==="clawtip"?"bg-[var(--color-danger-soft)] text-[var(--color-danger)]":"bg-[var(--color-lavender)] text-[var(--color-primary-deep)]"].join(" "),x=s.jsxs(s.Fragment,{children:[s.jsx("span",{className:v,"aria-hidden":"true",children:n.label.charAt(0)}),s.jsx("span",{children:Ux(n)}),n.selected?s.jsx("span",{className:"text-[0.64rem] uppercase tracking-[0.08em] opacity-75",children:"Active"}):null,n.selected?s.jsx(US,{size:13,"aria-hidden":"true"}):null]});return n.configured?n.selected?s.jsxs("div",{className:"relative",children:[s.jsx("button",{type:"button",onClick:()=>p(y=>!y),className:h,"aria-pressed":!0,"aria-expanded":f,"aria-haspopup":"menu",children:x}),f?s.jsx("div",{className:"absolute right-0 z-20 mt-1 w-40 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-white p-1 shadow-[0_12px_28px_rgba(15,23,42,0.1)]",children:s.jsxs("button",{type:"button",onClick:()=>{p(!1),u((l==null?void 0:l.method)??n.method)},className:"flex h-8 w-full items-center justify-between rounded-[8px] px-2.5 text-left text-[0.76rem] font-semibold text-[var(--color-ink)] transition hover:bg-[var(--color-lavender)]/45",role:"menuitem",children:[s.jsx("span",{children:"Recharge"}),s.jsx("span",{className:"font-mono text-[0.68rem] text-[var(--color-muted)]",children:(l==null?void 0:l.balance)??"••••"})]})}):null]}):s.jsx("button",{type:"button",onClick:()=>o(n.method),className:h,"aria-pressed":!1,children:x}):s.jsx("button",{type:"button",onClick:()=>i(n.method),className:h,"aria-label":Ux(n),children:x})}function Ux(n){return n.configured?n.label:$n(n.method)==="clawtip"?"Bind ClawTip wallet to enable Auto mode":`Bind ${n.label}`}function nw({range:n,scorer:l,activeModelId:o,sellers:i,selectedSellerIds:u,selectedModelIds:f,sellerActivityById:p,disabled:h=!1,loading:v=!1,refreshing:x=!1,onRangeChange:y,onScorerChange:g,onChooseSellers:j,onRemoveSeller:w,onTestSeller:T,onRefreshSellerModels:E,testingSellerId:D,refreshingSellerModels:R=!1}){return s.jsxs("div",{className:"overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-white",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-[var(--color-line-2)] px-3 py-2.5",children:[s.jsxs("div",{className:"min-w-[150px]",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Node list"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[v&&i.length===0?"Loading nodes...":`${Se(Math.min(i.length,Dx))} of ${Se(i.length)} nodes`,x?s.jsx("span",{className:"ml-2 text-[var(--color-purple)]",children:"Refreshing"}):null]})]}),s.jsxs("div",{className:"ml-auto flex flex-wrap items-center justify-end gap-2",children:[s.jsx(Lx,{options:[{value:"recommended",label:"Recommended"},{value:"custom",label:"Custom"}],value:n,onChange:y,disabled:h}),s.jsx("button",{type:"button",onClick:j,disabled:h||n!=="custom",className:"tb-button tb-button-sm tb-button-primary min-w-[72px]",title:n==="custom"?"Select nodes":"Switch to Custom to select nodes",children:"Select"})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"min-w-[900px]",children:[i.length>0?s.jsxs("div",{className:"grid grid-cols-[minmax(210px,1.35fr)_90px_128px_74px_138px_132px_130px_80px] gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("div",{children:"Node"}),s.jsx("div",{className:"text-right",children:"Models"}),s.jsx("div",{children:"Status"}),s.jsx("div",{className:"text-right",children:"Disc"}),s.jsx("div",{className:"text-right",children:"Price"}),s.jsx("div",{className:"text-right",children:"Speed"}),s.jsx("div",{children:"Last inspect"}),s.jsx("div",{className:"text-right",children:"Actions"})]}):null,s.jsxs("div",{className:"divide-y divide-[var(--color-line-2)]",children:[v&&i.length===0?s.jsx(aw,{}):null,i.slice(0,Dx).map(L=>{const Q=p.get(L.id),P=(Q==null?void 0:Q.averageTtftMs)??L.latencyMs,G=(Q==null?void 0:Q.tokensPerSecond)??L.tokensPerSecond,H=o?L.priceByModelId[o]??L.price:L.price;return s.jsxs("div",{className:"grid grid-cols-[minmax(210px,1.35fr)_90px_128px_74px_138px_132px_130px_80px] items-center gap-2 px-3 py-2.5",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:L.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:zs(L.id)})]}),s.jsxs("div",{className:"min-w-0 text-right font-mono text-[0.72rem] font-semibold leading-snug text-[var(--color-ink)]",children:[s.jsx("div",{children:Se(L.coverageModelIds.length)}),s.jsx("div",{className:"text-[0.66rem] font-medium text-[var(--color-muted)]",children:IN(L,f)})]}),s.jsx(fb,{seller:L,current:(Q==null?void 0:Q.current)===!0}),s.jsx(Bx,{value:L.discount}),s.jsx(Bx,{value:H}),s.jsxs("div",{className:"min-w-0 text-right font-mono text-[0.72rem] font-semibold leading-snug text-[var(--color-ink)]",children:[s.jsxs("div",{children:["TTFT ",na(P)]}),s.jsx("div",{children:Ss(G)})]}),s.jsx(WN,{value:L.lastInspectAt}),s.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[s.jsx("button",{type:"button",onClick:()=>T(L),disabled:h||D===L.id,className:"tb-button tb-button-icon tb-button-quiet disabled:cursor-wait disabled:opacity-60","aria-label":`Test ${L.name}`,title:"Run say hi test",children:D===L.id?s.jsx(yt,{size:14,className:"animate-spin"}):s.jsx(Yf,{size:14})}),s.jsx("button",{type:"button",onClick:()=>E(L),disabled:h||R,className:"tb-button tb-button-icon tb-button-quiet disabled:cursor-wait disabled:opacity-60","aria-label":`Refresh models for ${L.name}`,title:"Refresh model list",children:s.jsx(mr,{size:14,className:R?"animate-spin":""})}),n==="custom"&&u.includes(L.id)?s.jsx("button",{type:"button",onClick:()=>w(L.id),disabled:h,className:"tb-button tb-button-icon tb-button-quiet hover:border-[var(--color-danger)] hover:bg-[var(--color-danger-soft)] hover:text-[var(--color-danger)]","aria-label":`Remove ${L.name}`,children:s.jsx(Gf,{size:14})}):null]})]},L.id)}),!v&&i.length===0?s.jsx("div",{className:"px-3 py-8 text-center text-[0.84rem] text-[var(--color-muted)]",children:n==="custom"?"No custom nodes selected.":"No warmed nodes available for these models."}):null]})]})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2",children:[s.jsx("span",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Routing priority"}),s.jsx(Lx,{options:GN,value:l,onChange:g,disabled:h}),s.jsx("span",{className:"ml-auto max-w-full text-right text-[0.74rem] text-[var(--color-muted)] sm:max-w-[420px]",children:lw(l)})]})]})}function aw(){return s.jsx(s.Fragment,{children:[0,1,2].map(n=>s.jsxs("div",{className:"grid gap-2 px-3 py-2.5 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[s.jsxs("div",{className:"min-w-0 space-y-2",children:[s.jsx("div",{className:"h-4 w-44 animate-pulse rounded-full bg-[var(--color-line-2)]"}),s.jsx("div",{className:"h-3 w-28 animate-pulse rounded-full bg-[var(--color-page)]"}),s.jsx("div",{className:"h-3 w-52 animate-pulse rounded-full bg-[var(--color-page)]"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:justify-end",children:[s.jsx("div",{className:"h-10 w-16 animate-pulse rounded-[8px] bg-[var(--color-page)]"}),s.jsx("div",{className:"h-10 w-16 animate-pulse rounded-[8px] bg-[var(--color-page)]"}),s.jsx("div",{className:"h-10 w-16 animate-pulse rounded-[8px] bg-[var(--color-page)]"})]})]},n))})}function Lx({options:n,value:l,onChange:o,disabled:i=!1}){return s.jsx("div",{className:"inline-flex h-8 rounded-[8px] border border-[var(--color-purple)]/20 bg-[var(--color-page)] p-0.5",children:n.map(u=>s.jsx("button",{type:"button",onClick:()=>o(u.value),disabled:i,className:["rounded-[6px] px-2.5 text-[0.74rem] font-semibold transition disabled:cursor-not-allowed disabled:opacity-60",l===u.value?"bg-[var(--color-purple)] text-white shadow-[0_4px_12px_rgba(124,61,240,0.24)]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:u.label},String(u.value)))})}function Bx({value:n}){return s.jsx("div",{className:"min-w-0 text-right",children:s.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold text-[var(--color-ink)]",children:n})})}function lw(n){return n==="speed"?"Prefers lower TTFT and stronger throughput.":n==="discount"?"Prefers lower effective cost among healthy nodes.":"Balances reliability, speed, and cost."}function rw({summary:n}){return s.jsx("section",{children:s.jsxs(Ot,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("div",{className:"min-w-0",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Current routes"})}),s.jsxs("div",{className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 py-1.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Se(n.rows.length)," models"]})]}),s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[840px] border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.66rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"TARGET"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"STRATEGY"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"STATUS"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"EVIDENCE"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"LAST CALL"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[n.rows.map(l=>s.jsx(iw,{row:l},`${l.source}-${l.modelId}-${l.currentSellerId}`)),n.rows.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."})}):null]})]})})]})})}function iw({row:n}){const l=ow(n),o=cw(n.routeReason,n.source);return s.jsxs("tr",{className:"align-middle transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"px-4 py-3.5",children:s.jsx("div",{className:"max-w-[220px] truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:n.modelId,children:n.modelId})}),s.jsxs("td",{className:"px-4 py-3.5",children:[s.jsx("div",{className:"max-w-[230px] truncate font-semibold text-[var(--color-purple)]",title:n.currentSellerId,children:n.currentSellerName}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:zs(n.currentSellerId)})]}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx(qx,{tone:o.tone,children:o.label})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx(qx,{tone:l.tone,children:l.label})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx(sw,{row:n})}),s.jsx("td",{className:"whitespace-nowrap px-4 py-3.5",children:s.jsx("div",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:gc(n.lastAccessAt)})})]})}function sw({row:n}){const l=Sf(n.inputPriceMicrosPer1m,n.outputPriceMicrosPer1m);return s.jsxs("div",{className:"grid gap-0.5 font-mono text-[0.72rem] leading-snug",children:[s.jsxs("div",{className:"truncate font-semibold text-[var(--color-ink)]",title:`Disc ${n.sellerDiscount} / Price ${l}`,children:["Disc ",n.sellerDiscount," / ",l]}),s.jsxs("div",{className:"truncate text-[var(--color-muted)]",title:`TTFT ${na(n.lastTtftMs??n.avgTtftMs)} / ${Ss(n.tokensPerSecond)}`,children:["TTFT ",na(n.lastTtftMs??n.avgTtftMs)," / ",Ss(n.tokensPerSecond)]})]})}function ow(n){return n.source==="preview"?{label:"Preview",tone:"amber"}:n.routeState?{label:bn(n.routeState),tone:ea(n.routeState)}:n.upstreamStatus&&!Fd(n.upstreamStatus)?{label:bn(n.upstreamStatus),tone:ea(n.upstreamStatus)}:n.lastStatus&&!Fd(n.lastStatus)?{label:bn(n.lastStatus),tone:ea(n.lastStatus)}:n.currentSellerStatus&&!Fd(n.currentSellerStatus)?{label:bn(n.currentSellerStatus),tone:ea(n.currentSellerStatus)}:{label:"Ready",tone:"green"}}function Fd(n){const l=bn(n);return l==="ok"||l==="online"||l==="configured"||l==="settled"||l==="completed"||l==="success"||l==="active"||l==="healthy"}function cw(n,l){return n?n.startsWith("manual:fallback")?{label:"Manual fallback",tone:"blue"}:n.startsWith("manual:locked")?{label:"Manual direct",tone:"blue"}:n.startsWith("fixedSet")?{label:"Auto custom",tone:"green"}:n.startsWith("fixed")?{label:"Auto fixed",tone:"green"}:n.startsWith("fullAuto:discount")?{label:"Auto cost",tone:"green"}:n.startsWith("fullAuto:speed")?{label:"Auto speed",tone:"green"}:n.startsWith("fullAuto:balanced")?{label:"Auto balanced",tone:"green"}:n.startsWith("fullAuto")?{label:"Auto",tone:"green"}:l==="preview"?{label:"Preview",tone:"amber"}:{label:"Active",tone:"gray"}:l==="preview"?{label:"Preview",tone:"amber"}:{label:"Active",tone:"gray"}}function qx({tone:n,children:l}){const o={green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",blue:"bg-blue-50 text-blue-700",gray:"bg-slate-100 text-slate-600"}[n];return s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.66rem] font-semibold uppercase",o].join(" "),children:l})}function uw({toast:n,onClose:l}){const o=n.tone==="success"?"border-emerald-100 bg-emerald-50 text-emerald-800":"border-rose-100 bg-rose-50 text-rose-800";return s.jsx("div",{className:"fixed bottom-5 right-5 z-40 w-[min(360px,calc(100vw-2rem))]",children:s.jsx("div",{className:["rounded-[12px] border px-3 py-2.5 shadow-[0_14px_34px_rgba(32,26,56,0.16)]",o].join(" "),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate text-[0.82rem] font-semibold",children:n.title}),s.jsx("div",{className:"mt-0.5 line-clamp-3 text-[0.74rem] leading-5 opacity-90",children:n.detail})]}),s.jsx("button",{type:"button",onClick:l,className:"grid size-6 shrink-0 place-items-center rounded-full bg-white/70 transition hover:bg-white","aria-label":"Close notification",children:s.jsx(Dl,{size:13})})]})})})}function dw({models:n,selectedModelIds:l,onClose:o,onSave:i}){const[u,f]=S.useState(""),[p,h]=S.useState(l),v=S.useMemo(()=>p.map(g=>n.find(j=>j.id===g)).filter(dc),[p,n]),x=n.filter(g=>pb(u,[g.id,g.paymentMethod,g.enabled?"enabled":"not enabled"]));function y(g){h(j=>j.includes(g)?j.filter(w=>w!==g):[...j,g])}return s.jsxs(Sc,{title:"Add models",onClose:o,children:[s.jsx(rm,{value:u,onChange:f,placeholder:"Search models or payment"}),s.jsx("div",{className:"mt-3 max-h-[48dvh] overflow-auto rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.84rem]",children:[s.jsx("thead",{className:"sticky top-0 z-[1] bg-white/95 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)] backdrop-blur",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-16 px-3 py-2 font-semibold",children:"Select"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Model"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Nodes"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[x.map(g=>{const j=p.includes(g.id);return s.jsxs("tr",{onClick:()=>y(g.id),className:["cursor-pointer",j?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35",g.enabled?"":"opacity-60"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(mb,{active:j,fixed:!1})}),s.jsx("td",{className:"px-3 py-2.5 font-mono font-semibold text-[var(--color-ink)]",children:g.id}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(pw,{enabled:g.enabled,paymentMethod:g.paymentMethod})}),s.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:Se(g.sellerCount)})]},g.id)}),x.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No models found."})}):null]})]})}),s.jsxs("div",{className:"mt-3 rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:["Selected ",v.length]}),v.length>0?s.jsx("button",{type:"button",onClick:()=>h([]),className:"ml-auto text-[0.74rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-purple)]",children:"Clear"}):null]}),s.jsxs("div",{className:"mt-2 flex min-h-8 flex-wrap gap-2",children:[v.map(g=>s.jsxs("button",{type:"button",onClick:()=>y(g.id),className:"inline-flex max-w-full items-center gap-1.5 rounded-full border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.76rem] font-mono font-semibold text-[var(--color-ink)] shadow-[0_1px_4px_rgba(60,41,112,0.06)] transition hover:border-[var(--color-purple)] hover:text-[var(--color-purple)]",title:`Remove ${g.id}`,children:[s.jsx("span",{className:"truncate",children:g.id}),s.jsx(Dl,{size:13,"aria-hidden":"true"})]},g.id)),v.length===0?s.jsx("span",{className:"text-[0.8rem] text-[var(--color-muted)]",children:"No model selected."}):null]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2 border-t border-[var(--color-line-2)] pt-3",children:[s.jsx("button",{type:"button",onClick:o,className:"tb-button tb-button-md tb-button-secondary",children:"Cancel"}),s.jsx("button",{type:"button",onClick:()=>i(p),"aria-label":"Save selected models","data-testid":"routing-model-picker-done",className:"tb-button tb-button-md tb-button-primary",children:"Save and close"})]})]})}function fw({selectedSellerIds:n,selectedModelIds:l,activeModelId:o,scorer:i,sellers:u,onClose:f,onSave:p}){const[h,v]=S.useState(""),[x,y]=S.useState(n),[g,j]=S.useState({key:"discount",direction:"asc"}),[w,T]=S.useState(1),E=S.useMemo(()=>lm(u,l,i),[i,l,u]),D=S.useMemo(()=>new Set(E.map(Z=>Z.id)),[E]),R=S.useMemo(()=>x.map(Z=>u.find(se=>se.id===Z)).filter(dc).filter(Z=>D.has(Z.id)),[D,x,u]),L=S.useMemo(()=>E.filter(Z=>pb(h,[Z.name,Z.id,Z.paymentMethods.join(" "),Z.health,Z.notes.join(" ")])),[E,h]),Q=S.useMemo(()=>vw(L,g.key,g.direction),[L,g.direction,g.key]),P=10,G=Math.max(1,Math.ceil(Q.length/P)),H=Math.min(w,G),$=Q.slice((H-1)*P,H*P),I=Q.length===0?0:(H-1)*P+1,J=Math.min(H*P,Q.length);S.useEffect(()=>{T(1)},[h,g.direction,g.key]),S.useEffect(()=>{w>G&&T(G)},[w,G]);function te(Z){y(se=>se.includes(Z)?se.filter(xe=>xe!==Z):[...se,Z])}function F(Z){j(se=>({key:Z,direction:se.key===Z&&se.direction==="asc"?"desc":"asc"}))}return s.jsxs(Sc,{title:"Select custom nodes",onClose:f,children:[s.jsx(rm,{value:h,onChange:v,placeholder:"Search nodes, payment, notes"}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-16 px-3 py-2 font-semibold",children:"Select"}),s.jsx(Wr,{label:"Node",sortKey:"seller",activeSort:g,onSort:F}),s.jsx(Wr,{label:"Status",sortKey:"status",activeSort:g,onSort:F}),s.jsx(Wr,{label:"Disc",sortKey:"discount",align:"right",activeSort:g,onSort:F}),s.jsx(Wr,{label:"Price",sortKey:"price",align:"right",activeSort:g,onSort:F}),s.jsx(Wr,{label:"Payment",sortKey:"payment",activeSort:g,onSort:F}),s.jsx(Wr,{label:"Speed",sortKey:"speed",align:"right",activeSort:g,onSort:F})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[$.map(Z=>{const se=x.includes(Z.id),xe=o?Z.priceByModelId[o]??Z.price:Z.price;return s.jsxs("tr",{onClick:()=>te(Z.id),className:["cursor-pointer",se?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(mb,{active:se,fixed:!1})}),s.jsxs("td",{className:"px-3 py-2.5",children:[s.jsx("div",{className:"font-semibold text-[var(--color-ink)]",children:Z.name}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:zs(Z.id)})]}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(fb,{seller:Z,current:!1})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:Z.discount}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:xe}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:Z.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right text-[var(--color-ink)]",children:s.jsx(yc,{ttftMs:Z.latencyMs,tokensPerSecond:Z.tokensPerSecond})})]},Z.id)}),Q.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No nodes found."})}):null]})]})}),Q.length>P?s.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2 text-[0.74rem] text-[var(--color-muted)]",children:[s.jsxs("span",{children:["Showing ",Se(I),"-",Se(J)," of ",Se(Q.length)]}),s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsx("button",{type:"button",onClick:()=>T(Z=>Math.max(1,Z-1)),disabled:H<=1,className:"tb-button tb-button-sm tb-button-secondary disabled:opacity-45",children:"Previous"}),s.jsxs("span",{className:"min-w-16 text-center font-mono text-[0.72rem] font-semibold text-[var(--color-ink)]",children:[H," / ",G]}),s.jsx("button",{type:"button",onClick:()=>T(Z=>Math.min(G,Z+1)),disabled:H>=G,className:"tb-button tb-button-sm tb-button-secondary disabled:opacity-45",children:"Next"})]})]}):null,s.jsxs("div",{className:"mt-3 rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:["Selected ",R.length]}),R.length>0?s.jsx("button",{type:"button",onClick:()=>y(Z=>Z.filter(se=>!D.has(se))),className:"ml-auto text-[0.74rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-purple)]",children:"Clear"}):null]}),s.jsxs("div",{className:"mt-2 flex min-h-8 flex-wrap gap-2",children:[R.map(Z=>s.jsxs("button",{type:"button",onClick:()=>te(Z.id),className:"inline-flex max-w-full items-center gap-1.5 rounded-full border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.76rem] font-semibold text-[var(--color-ink)] shadow-[0_1px_4px_rgba(60,41,112,0.06)] transition hover:border-[var(--color-purple)] hover:text-[var(--color-purple)]",title:`Remove ${Z.name}`,children:[s.jsx("span",{className:"truncate",children:Z.name}),s.jsx(Dl,{size:13,"aria-hidden":"true"})]},Z.id)),R.length===0?s.jsx("span",{className:"text-[0.8rem] text-[var(--color-muted)]",children:"No node selected."}):null]})]}),s.jsxs("div",{className:"mt-3 flex justify-end gap-2 border-t border-[var(--color-line-2)] pt-3",children:[s.jsx("button",{type:"button",onClick:f,className:"tb-button tb-button-md tb-button-secondary",children:"Cancel"}),s.jsx("button",{type:"button",onClick:()=>p(x),className:"tb-button tb-button-md tb-button-primary",children:"Save and close"})]})]})}function $x({provider:n,onClose:l,onSave:o}){var H;const i=!!n,[u,f]=S.useState((n==null?void 0:n.name)??""),[p,h]=S.useState((n==null?void 0:n.baseUrl)??""),[v,x]=S.useState(""),[y,g]=S.useState(null),j=i?{status:"passed",message:`${Se(((H=n==null?void 0:n.models)==null?void 0:H.length)??0)} existing models.`,modelIds:(n==null?void 0:n.models)??[],supportedProtocols:(n==null?void 0:n.supportedProtocols)??[],baseUrl:(n==null?void 0:n.baseUrl)??"",apiKey:""}:{status:"idle",message:"Probe required before adding.",modelIds:[],supportedProtocols:[],baseUrl:"",apiKey:""},[w,T]=S.useState(j),E=p.trim(),D=v.trim(),R=E.length>0&&D.length>0&&w.status!=="checking",L=w.status==="passed"&&w.baseUrl===E&&w.apiKey===D,Q=i?u.trim().length>0&&E.length>0&&(D.length===0||L&&w.modelIds.length>0&&w.supportedProtocols.length>0):L&&w.modelIds.length>0&&w.supportedProtocols.length>0;function P(){var $;if(i&&v.trim().length===0){T({status:"passed",message:`${Se((($=n==null?void 0:n.models)==null?void 0:$.length)??0)} existing models.`,modelIds:(n==null?void 0:n.models)??[],supportedProtocols:(n==null?void 0:n.supportedProtocols)??[],baseUrl:(n==null?void 0:n.baseUrl)??"",apiKey:""});return}T({status:"idle",message:i?"Probe required when replacing the key.":"Probe required before adding.",modelIds:[],supportedProtocols:[],baseUrl:"",apiKey:""})}async function G(){if(R){g(null),T({status:"checking",message:"Reading model list...",modelIds:[],supportedProtocols:[],baseUrl:E,apiKey:D});try{const $=await Dj({baseUrl:E,apiKey:D});T({status:"passed",message:`${Se($.modelIds.length)} models · ${hw($.supportedProtocols)}.`,modelIds:$.modelIds,supportedProtocols:$.supportedProtocols,baseUrl:E,apiKey:D})}catch($){T({status:"failed",message:$ instanceof Error?$.message:"Model list request failed.",modelIds:[],supportedProtocols:[],baseUrl:E,apiKey:D})}}}return s.jsxs(Sc,{title:i?`Edit endpoint · ${(n==null?void 0:n.name)??""}`:"Add endpoint",onClose:l,children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx(Zd,{label:"Name",value:u,onChange:f,placeholder:"My endpoint"}),s.jsx(Zd,{label:"Base URL",value:p,onChange:$=>{h($),P()},placeholder:"https://api.example.com/v1"}),s.jsx(Zd,{label:"API key",value:v,onChange:$=>{var I;x($),$.trim().length===0&&i?T({status:"passed",message:`${Se(((I=n==null?void 0:n.models)==null?void 0:I.length)??0)} existing models.`,modelIds:(n==null?void 0:n.models)??[],supportedProtocols:(n==null?void 0:n.supportedProtocols)??[],baseUrl:(n==null?void 0:n.baseUrl)??"",apiKey:""}):P()},placeholder:i?"Leave blank to keep existing key":"sk-...",type:"password"}),s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:["inline-flex h-7 items-center rounded-full px-2.5 text-[0.7rem] font-semibold ring-1",w.status==="passed"?"bg-emerald-50 text-emerald-700 ring-emerald-100":w.status==="failed"?"bg-rose-50 text-rose-700 ring-rose-100":"bg-white text-[var(--color-muted)] ring-[var(--color-line-2)]"].join(" "),children:w.message}),s.jsx("button",{type:"button",onClick:G,disabled:!R,className:"tb-button tb-button-sm tb-button-secondary ml-auto",children:i?"Probe new key":"Probe models"})]}),L||i&&w.status==="passed"?s.jsxs("div",{className:"mt-2 space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.supportedProtocols.map($=>s.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-mono text-[0.68rem] font-semibold text-emerald-700 ring-1 ring-emerald-100",children:$},$))}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.modelIds.map($=>s.jsx("span",{className:"rounded-full bg-white px-2 py-0.5 font-mono text-[0.68rem] text-[var(--color-muted)] ring-1 ring-[var(--color-line-2)]",children:$},$))})]}):null]}),y?s.jsx("div",{className:"rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.78rem] font-semibold text-rose-700",children:y}):null]}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2 border-t border-[var(--color-line-2)] pt-3",children:[s.jsx("button",{type:"button",onClick:l,className:"tb-button tb-button-md tb-button-secondary",children:"Cancel"}),s.jsx("button",{type:"button",onClick:async()=>{if(Q){g(null);try{await o({name:u,baseUrl:p,apiKey:v})}catch($){g($ instanceof Error?$.message:String($))}}},disabled:!Q,className:"tb-button tb-button-md tb-button-primary",children:i?"Save":"Add"})]})]})}function mw({provider:n,onClose:l}){var p;const[o,i]=S.useState(""),u=o.trim().toLowerCase(),f=(n.models??[]).filter(h=>h.toLowerCase().includes(u));return s.jsxs(Sc,{title:`Models · ${n.name}`,onClose:l,children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx(rm,{value:o,onChange:i,placeholder:"Search models"}),s.jsxs("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2",children:[s.jsxs("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:[Se(f.length)," of ",Se(((p=n.models)==null?void 0:p.length)??0)," models"]}),s.jsxs("div",{className:"mt-2 flex max-h-[320px] flex-wrap gap-1.5 overflow-y-auto",children:[f.map(h=>s.jsx("span",{className:"rounded-full bg-white px-2 py-1 font-mono text-[0.72rem] text-[var(--color-muted)] ring-1 ring-[var(--color-line-2)]",children:h},h)),f.length===0?s.jsx("span",{className:"text-[0.82rem] text-[var(--color-muted)]",children:"No models found."}):null]})]})]}),s.jsx("div",{className:"mt-4 flex justify-end border-t border-[var(--color-line-2)] pt-3",children:s.jsx("button",{type:"button",onClick:l,className:"tb-button tb-button-md tb-button-secondary",children:"Close"})})]})}function hw(n){return n.length>0?n.join(", "):"no protocols"}function Zd({label:n,value:l,onChange:o,placeholder:i,type:u="text"}){return s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:n}),s.jsx("input",{value:l,type:u,onChange:f=>o(f.target.value),placeholder:i,className:"mt-1 h-10 w-full rounded-[9px] border border-[var(--color-line-2)] bg-white px-3 font-mono text-[0.84rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-faint)] focus:border-[var(--color-purple)]"})]})}function Sc({title:n,children:l,onClose:o}){return s.jsx("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-[#201a38]/35 px-4 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"max-h-[86dvh] w-full max-w-[820px] overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_70px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--color-line-2)] px-5 py-4",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:n}),s.jsx("button",{type:"button",onClick:o,className:"tb-button tb-button-icon tb-button-quiet","aria-label":"Close",children:s.jsx(Dl,{size:16})})]}),s.jsx("div",{className:"max-h-[calc(86dvh-65px)] overflow-auto p-4",children:l})]})})}function pw({enabled:n,paymentMethod:l}){return s.jsxs("span",{className:["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[0.72rem] ring-1",n?"bg-emerald-50 text-emerald-700 ring-emerald-100":"bg-slate-100 text-slate-500 ring-slate-200"].join(" "),children:[n?s.jsx(pj,{size:12}):s.jsx(gf,{size:12}),l," ",n?"enabled":"not enabled"]})}function mb({active:n,fixed:l}){return s.jsx("span",{className:["inline-flex size-5 shrink-0 items-center justify-center border",l?"rounded-full":"rounded-[6px]",n?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line)] bg-white text-transparent"].join(" "),children:s.jsx(Kt,{size:13,strokeWidth:2.4})})}function Wr({label:n,sortKey:l,activeSort:o,align:i="left",onSort:u}){const f=o.key===l;return s.jsx("th",{className:["px-3 py-2 font-semibold",i==="right"?"text-right":""].join(" "),children:s.jsxs("button",{type:"button",onClick:()=>u(l),className:["inline-flex items-center gap-1 transition hover:text-[var(--color-primary-deep)]",i==="right"?"justify-end":"",f?"text-[var(--color-primary-deep)]":""].join(" "),children:[s.jsx("span",{children:n}),s.jsx("span",{className:["font-mono text-[0.58rem]",f?"opacity-100":"opacity-35"].join(" "),children:f?o.direction==="asc"?"↑":"↓":"↕"})]})})}function vw(n,l,o){return[...n].sort((i,u)=>l==="seller"?jl(i.name,u.name):l==="status"?jl(wf(i).label,wf(u).label)||jl(i.name,u.name):l==="discount"?Jo(i.discountRatio,u.discountRatio,o)||jl(i.name,u.name):l==="price"?Jo(i.inputPriceMicrosPer1m,u.inputPriceMicrosPer1m,o)||jl(i.name,u.name):l==="payment"?jl(i.paymentMethods.join(", "),u.paymentMethods.join(", "))||jl(i.name,u.name):Jo(i.latencyMs,u.latencyMs,o)||Jo(u.tokensPerSecond,i.tokensPerSecond,o)||jl(i.name,u.name))}function lm(n,l,o){return[...n].sort((i,u)=>{const f=Kx(i,l),p=Kx(u,l);return f!==p?p-f:o==="speed"?Mf(i.latencyMs,u.latencyMs)||Mw(i.tokensPerSecond,u.tokensPerSecond):o==="discount"?Mf(i.discountRatio,u.discountRatio):u.healthScore-i.healthScore})}function xw(n,l){const o=new Map;for(const u of n){const f=o.get(u.id)??{sellerIds:new Set,paymentMethods:new Set};f.sellerIds.add(u.sellerId);for(const p of u.paymentMethods)f.paymentMethods.add(p);o.set(u.id,f)}const i=new Map(l.map((u,f)=>[u,f]));return Array.from(o.entries()).map(([u,f])=>({id:u,paymentMethod:Array.from(f.paymentMethods)[0]??Me,enabled:f.sellerIds.size>0,sellerCount:f.sellerIds.size})).sort((u,f)=>{const p=i.get(u.id),h=i.get(f.id);return p!==void 0||h!==void 0?(p??9999)-(h??9999):u.id.localeCompare(f.id)})}function gw({focusModels:n,referencedModelIds:l,modelOptions:o}){const i=new Set(o.map(f=>f.id)),u=n.filter(f=>i.has(f));return u.length>0?u:l.filter(f=>i.has(f))}function bw({base:n,enabled:l,range:o,scorer:i,modelIds:u,sellerIds:f}){return{enabled:l,range:o,scorer:i,modelIds:Array.from(new Set(u)),sellerIds:Array.from(new Set(f)),maxConcurrentProviders:10,updatedAt:(n==null?void 0:n.updatedAt)??new Date().toISOString()}}function yw(n){const l=new Set;return[...n].sort((o,i)=>Tw(o.createdAt,i.createdAt)).flatMap(o=>!o.modelId||l.has(o.modelId)?[]:(l.add(o.modelId),[o.modelId]))}function Sw(n,l){const o=new Map;for(const i of l){if(!i.sellerKey)continue;const u=o.get(i.sellerKey)??Qx();(!u.lastAccessAt||ti(i.createdAt)>ti(u.lastAccessAt))&&(u.lastAccessAt=i.createdAt),u.requestCount+=1,u.modelIds.includes(i.modelId)||u.modelIds.push(i.modelId),i.billingUnit!=="images"&&i.endpoint!=="/v1/images/generations"&&(u.inputTokens+=Sl(i.promptTokens)??0,u.outputTokens+=Sl(i.completionTokens)??0),u.totalSpendMicros+=Sl(i.settledUsdMicros)??Sl(i.billedMicros)??Sl(i.estimatedMicros)??0;const f=Sl(i.ttftMs);f!==void 0&&(u.ttftTotal+=f,u.ttftCount+=1);const p=Sl(i.durationMs),h=Sl(i.completionTokens)??0;p!==void 0&&p>0&&h>0&&(u.speedOutputTokens+=h,u.speedDurationMs+=p),o.set(i.sellerKey,u)}for(const i of n){if(!i.currentSellerId||i.currentSellerId===Me)continue;const u=o.get(i.currentSellerId)??Qx();u.current=!0,i.lastAccessAt&&(!u.lastAccessAt||ti(i.lastAccessAt)>ti(u.lastAccessAt))&&(u.lastAccessAt=i.lastAccessAt),u.modelIds.includes(i.modelId)||u.modelIds.push(i.modelId),o.set(i.currentSellerId,u)}return new Map(Array.from(o.entries()).map(([i,u])=>{const{ttftTotal:f,ttftCount:p,speedOutputTokens:h,speedDurationMs:v,...x}=u;return[i,{...x,averageTtftMs:p>0?f/p:void 0,tokensPerSecond:v>0?h/(v/1e3):void 0}]}))}function Qx(){return{current:!1,modelIds:[],requestCount:0,inputTokens:0,outputTokens:0,totalSpendMicros:0,ttftTotal:0,ttftCount:0,speedOutputTokens:0,speedDurationMs:0}}function Sl(n){return Number.isFinite(n)?n:void 0}function jw(n,l,o){const i=(l==null?void 0:l.data)??[],u=new Map(n.map(v=>[v.id,v])),f=new Map(((l==null?void 0:l.sellers)??[]).map(v=>[v.id,v])),p=new Map(o.map(v=>[v.seller.id,v])),h=new Set([...n.map(v=>v.id),...((l==null?void 0:l.sellers)??[]).map(v=>v.id),...i.map(v=>v.sellerId)]);return Array.from(h).map((v,x)=>{const y=u.get(v),g=p.get(v),j=f.get(v),w=i.filter(te=>te.sellerId===v),T=w[0],E=Array.from(new Set(w.map(te=>te.id))),D=Hx(w.map(te=>te.inputPriceMicrosPer1m)),R=Hx(w.map(te=>te.outputPriceMicrosPer1m)),L=Object.fromEntries(w.map(te=>[te.id,Sf(te.inputPriceMicrosPer1m,te.outputPriceMicrosPer1m)])),Q=(g==null?void 0:g.metrics.ttftMs)??(j==null?void 0:j.ttftMs)??(g==null?void 0:g.metrics.avgLatencyMs),P=(g==null?void 0:g.metrics.avgTokensPerSecond)??(j==null?void 0:j.avgTokensPerSecond),G=g==null?void 0:g.metrics.healthScore,H=(g==null?void 0:g.metrics.discountRatio)??(j==null?void 0:j.discountRatio),$=(g==null?void 0:g.metrics.routeState)??(j==null?void 0:j.routeState),I=Px([...(j==null?void 0:j.paymentMethods)??[],...(y==null?void 0:y.paymentMethods)??[],...w.flatMap(te=>te.paymentMethods)]),J=Px([...(y==null?void 0:y.supportedProtocols)??[],...(j==null?void 0:j.supportedProtocols)??[],...(T==null?void 0:T.supportedProtocols)??[]]);return{id:v,name:Aw((y==null?void 0:y.name)??(j==null?void 0:j.name)??(T==null?void 0:T.sellerName)??v),endpoint:(y==null?void 0:y.url)??(j==null?void 0:j.url)??(T==null?void 0:T.sellerUrl)??"",routeState:$,health:$?Nw($):(j==null?void 0:j.status)==="error"||(j==null?void 0:j.status)==="manifest_unavailable"||(y==null?void 0:y.status)==="failed"?"offline":(y==null?void 0:y.status)==="degraded"?"degraded":"online",healthScore:Number.isFinite(G)?Math.round(G):0,coverageModelIds:E,paymentMethods:I,discountRatio:H,discount:Wf(H),price:Sf(D,R),priceByModelId:L,inputPriceMicrosPer1m:D,outputPriceMicrosPer1m:R,latencyMs:Number.isFinite(Q)?Math.round(Q):void 0,tokensPerSecond:P,lastInspectAt:j==null?void 0:j.lastModelInspectionAt,notes:[J.join(", ")||"no protocols",`${j?"catalog":"registry"} #${x+1}`]}})}function Nw(n){return n==="error"?"offline":n==="degraded"||n==="cooldown"||n==="full"?"degraded":"online"}function Hx(n){const l=n.filter(o=>Number.isFinite(o));if(l.length!==0)return Math.min(...l)}function Px(n){return Array.from(new Set(n.filter(l=>l.trim().length>0)))}function ww(n){if(n)return n.plan??{routes:n.routes,mode:n.mode,scorer:n.scorer,reason:n.reason}}function Kx(n,l){return l.length===0?n.coverageModelIds.length:l.filter(o=>n.coverageModelIds.includes(o)).length}function jl(n,l){return n.localeCompare(l,void 0,{sensitivity:"base",numeric:!0})}function Mf(n,l){const o=Number.isFinite(n),i=Number.isFinite(l);return o&&i?n-l:o?-1:i?1:0}function Mw(n,l){return Mf(l,n)}function Jo(n,l,o){const i=Number.isFinite(n),u=Number.isFinite(l);return!i&&!u?0:i?u?o==="asc"?n-l:l-n:-1:1}function Cw(n){return Object.entries(n??{}).sort(([l],[o])=>l.localeCompare(o)).map(([l,o])=>`${l}:${o}`).join(",")}function Tw(n,l){return ti(l)-ti(n)}function ti(n){const l=new Date(n).getTime();return Number.isNaN(l)?0:l}function Aw(n){var l;return((l=n.split("(")[0])==null?void 0:l.trim())||n}function Ew(n,l,o){const i=l.length===0?n:n.filter(u=>l.some(f=>u.coverageModelIds.includes(f)));return lm(i,l,o)}function kw(n){var p;const l=new Map(n.map(h=>[$n(h.method),h])),i=Array.from(new Set([...VN,...n.map(h=>$n(h.method)).filter(h=>h&&h!=="mock")])).map(h=>{const v=l.get(h),x=!!v&&((v==null?void 0:v.enabled)===!0||hb(v==null?void 0:v.config,"walletConfigPresent"));return{method:h,label:Rw(h),configured:x,selected:x&&(v==null?void 0:v.isDefault)===!0}}),u=i.filter(h=>h.configured),f=i.find(h=>h.selected)??u[0];return f&&!f.selected&&(f.selected=!0),u.length===0?{active:!1,count:0,label:"No payment",options:i}:{active:!0,count:u.length,label:u.length===1?((p=u[0])==null?void 0:p.label)??"Payment ready":`${u.length} payments`,options:i,activeMethod:f==null?void 0:f.method}}function Rw(n){const l=$n(n);return l==="clawtip"?"ClawTip":l==="alipay-agent"?"Alipay":l==="wechat-pay"?"WeChat":l==="coinbase-smart-wallet"?"Coinbase":n.split(/[-_\s]+/).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}function $n(n){return n.trim().toLowerCase()}function hb(n,l){const o=n==null?void 0:n[l];return o===!0||o==="true"||o===1||o==="1"}function rm({value:n,onChange:l,placeholder:o}){return s.jsxs("label",{className:"flex items-center gap-2 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.84rem] text-[var(--color-muted)]",children:[s.jsx(ks,{size:15}),s.jsx("input",{name:"routing-search",value:n,onChange:i=>l(i.target.value),placeholder:o,className:"min-w-0 flex-1 bg-transparent font-mono text-[0.84rem] text-[var(--color-ink)] outline-none placeholder:text-[var(--color-faint)]"})]})}function pb(n,l){const o=n.trim().toLowerCase();return o?l.some(i=>i.toLowerCase().includes(o)):!0}function dc(n){return n!==void 0}function zw(n,l){const o=xb(l),i=vb(n,o);if(o<=7)return Array.from({length:o},(p,h)=>h+1);const u=[],f=p=>{u[u.length-1]!==p&&u.push(p)};f(1),i>4&&f("…");for(let p=Math.max(2,i-1);p<=Math.min(o-1,i+1);p++)f(p);return i<o-3&&f("…"),f(o),u}function vb(n,l){return Number.isFinite(n)?Math.max(1,Math.min(xb(l),Math.floor(n))):1}function _w(n,l){return Number.isFinite(n)&&n>0?Math.floor(n):Math.max(1,l[0]??25)}function xb(n){return!Number.isFinite(n)||n<1?1:Math.floor(n)}function gb({totalItems:n,pageSize:l,page:o,onPageChange:i,onPageSizeChange:u,pageSizeOptions:f=[25,50,100]}){const p=_w(l,f),h=Math.max(1,Math.ceil(n/p)),v=vb(o,h),x=S.useMemo(()=>zw(v,h),[v,h]),[y,g]=S.useState(String(v));if(S.useEffect(()=>{g(String(v))},[v]),S.useEffect(()=>{o!==v&&i(v)},[v,i,o]),n===0)return null;const j=(v-1)*p+1,w=Math.min(v*p,n);return s.jsxs("div",{className:"flex flex-col gap-3 border-t border-[var(--color-line-2)] bg-[var(--color-page)]/60 px-4 py-3 text-[0.85rem] lg:flex-row lg:items-center lg:justify-between",children:[s.jsxs("div",{className:"text-[var(--color-muted)]",children:["Showing ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:j}),"-",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:w})," of"," ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:n})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("label",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"Rows"}),s.jsx("select",{className:"bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] focus:outline-none focus:border-[var(--color-purple)]",value:p,onChange:T=>{const E=Math.max(1,Number(T.target.value)||25);u==null||u(E),i(1)},children:f.map(T=>s.jsx("option",{value:T,children:T},T))}),s.jsxs("div",{className:"ml-2 flex items-center gap-1",children:[s.jsx("button",{type:"button",disabled:v<=1,onClick:()=>i(1),className:"tb-button tb-button-sm tb-button-secondary min-w-8 px-2",title:"First page","aria-label":"First page",children:"«"}),s.jsx("button",{type:"button",disabled:v<=1,onClick:()=>i(v-1),className:"tb-button tb-button-sm tb-button-secondary min-w-8 px-2",title:"Previous page","aria-label":"Previous page",children:"‹"}),x.map((T,E)=>T==="…"?s.jsx("span",{className:"px-1.5 text-[var(--color-muted)]",children:"…"},`gap-${E}`):s.jsx("button",{type:"button",onClick:()=>i(T),"aria-label":`Page ${T}`,"aria-current":T===v?"page":void 0,className:T===v?"tb-button tb-button-sm tb-button-primary min-w-8 px-2.5":"tb-button tb-button-sm tb-button-secondary min-w-8 px-2.5",children:T},T)),s.jsx("button",{type:"button",disabled:v>=h,onClick:()=>i(v+1),className:"tb-button tb-button-sm tb-button-secondary min-w-8 px-2",title:"Next page","aria-label":"Next page",children:"›"}),s.jsx("button",{type:"button",disabled:v>=h,onClick:()=>i(h),className:"tb-button tb-button-sm tb-button-secondary min-w-8 px-2",title:"Last page","aria-label":"Last page",children:"»"}),s.jsx("span",{className:"ml-2 text-[0.78rem] text-[var(--color-muted)]",children:"Go to"}),s.jsx("input",{type:"number",min:1,max:h,value:y,"aria-label":"Go to page",onChange:T=>g(T.target.value),onKeyDown:T=>{if(T.key==="Enter"){const E=Math.max(1,Math.min(h,Number(T.target.value)||1));g(String(E)),i(E)}},className:"w-14 bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] text-center focus:outline-none focus:border-[var(--color-purple)]"}),s.jsx("span",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"page"})]})]})]})}function Ow(n,l,o=new Date){const i=Dw(o);return{inferenceTokens:i.map(u=>({key:u.key,label:u.label,inputTokens:Lw(n,u),outputTokens:Uw(n,u,"completionTokens")})),imageGenerations:i.map(u=>({key:u.key,label:u.label,imageCount:Bw(n,u),requestCount:qw(n,u)})),purchaseSpend:i.map(u=>({key:u.key,label:u.label,paymentTotals:$w(l,u),purchaseCount:Qw(l,u)}))}}function Dw(n){const l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(l);o.setDate(l.getDate()-(l.getDay()+6)%7);const i=new Date(n.getFullYear(),n.getMonth(),1);return[{key:"today",label:"Today",start:l},{key:"week",label:"This week",start:o},{key:"month",label:"This month",start:i},{key:"total",label:"Total"}]}function Uw(n,l,o){return n.reduce((i,u)=>!gi(u.createdAt,l)||jc(u)?i:i+(u[o]??0),0)}function Lw(n,l){return n.reduce((o,i)=>!gi(i.createdAt,l)||jc(i)?o:o+Math.max(0,(i.promptTokens??0)-(i.cacheReadTokens??0)),0)}function Bw(n,l){return n.reduce((o,i)=>!gi(i.createdAt,l)||!jc(i)?o:o+(Number.isFinite(i.imageCount)?i.imageCount:1),0)}function qw(n,l){return n.reduce((o,i)=>!gi(i.createdAt,l)||!jc(i)?o:o+1,0)}function jc(n){return n.billingUnit==="images"||n.endpoint==="/v1/images/generations"}function $w(n,l){const o=n.reduce((i,u)=>{if(!gi(u.completedAt??u.createdAt,l)||!u.paymentCurrency||!Number.isFinite(u.paymentAmountMinor))return i;const f=u.paymentCurrency.trim().toUpperCase();return f&&i.set(f,(i.get(f)??0)+Math.round(u.paymentAmountMinor)),i},new Map);return Array.from(o.entries()).map(([i,u])=>({paymentCurrency:i,paymentAmountMinor:u})).sort((i,u)=>i.paymentCurrency.localeCompare(u.paymentCurrency))}function Qw(n,l){return n.reduce((o,i)=>gi(i.completedAt??i.createdAt,l)?o+1:o,0)}function gi(n,l){if(!l.start)return!0;if(!n)return!1;const o=new Date(n);return Number.isNaN(o.getTime())?!1:o>=l.start}function Hw(){var me,O,ee,re;const{language:n}=pr(),l=ae=>hN(ae,n),o=xc(),i=Mj(),u=Zf(),f=Jf(),p=Rs(),[h,v]=S.useState("inferences"),[x,y]=S.useState(""),[g,j]=S.useState("all"),[w,T]=S.useState(1),[E,D]=S.useState(1),[R,L]=S.useState(25),Q=o.isLoading||i.isLoading,P=((me=o.data)==null?void 0:me.inferences)??[],G=((O=i.data)==null?void 0:O.purchases)??[],H=x.trim().toLowerCase(),$=S.useMemo(()=>Ow(P,G),[P,G]),I=S.useMemo(()=>Iw(P),[P]),J=S.useMemo(()=>{var ae,ge;return lM({manualProviders:(ae=u.data)==null?void 0:ae.providers,modelsResponse:p.data,registrySellers:(ge=f.data)==null?void 0:ge.sellers})},[(ee=u.data)==null?void 0:ee.providers,p.data,(re=f.data)==null?void 0:re.sellers]),te=S.useMemo(()=>P.filter(ae=>g!=="all"&&ae.modelId!==g?!1:eM(ae,H,J)).sort((ae,ge)=>ge.createdAt.localeCompare(ae.createdAt)),[P,g,J,H]),F=S.useMemo(()=>G.filter(ae=>tM(ae,H,J)).sort((ae,ge)=>ge.createdAt.localeCompare(ae.createdAt)),[J,G,H]),Z=S.useMemo(()=>Gx(te,w,R),[te,w,R]),se=S.useMemo(()=>Gx(F,E,R),[F,E,R]),xe=o.isError||i.isError;return S.useEffect(()=>{const ae=Math.max(1,Math.ceil(te.length/R));w>ae&&T(ae)},[te.length,w,R]),S.useEffect(()=>{const ae=Math.max(1,Math.ceil(F.length/R));E>ae&&D(ae)},[F.length,R,E]),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("section",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsx(Cx,{icon:s.jsx(bs,{className:"size-5"}),label:"Inference tokens",tone:"tokens",rows:$.inferenceTokens.map(ae=>({key:ae.key,label:l(ae.label),value:ac(ae.inputTokens+ae.outputTokens),detail:l(`In ${Se(ae.inputTokens)} / Out ${Se(ae.outputTokens)}`)}))}),s.jsx(Cx,{icon:s.jsx(ps,{className:"size-5"}),label:"Token purchase spend",tone:"spend",rows:$.purchaseSpend.map(ae=>({key:ae.key,label:l(ae.label),value:rM(ae.paymentTotals),detail:l(`${Se(ae.purchaseCount)} purchases`)}))})]}),s.jsxs(Ot,{className:"overflow-hidden p-0",children:[s.jsxs("div",{className:"border-b border-[var(--color-line-2)] bg-white px-4 py-3",children:[s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{children:s.jsx("h1",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:l("Usage details")})}),s.jsxs("div",{className:"grid grid-cols-2 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-1",children:[s.jsx(Yx,{label:l("Inferences"),active:h==="inferences",count:te.length,onClick:()=>v("inferences"),children:l("Inferences")}),s.jsx(Yx,{label:l("Purchases"),active:h==="purchases",count:F.length,onClick:()=>v("purchases"),children:l("Purchases")})]})]}),s.jsxs("div",{className:["mt-3 grid gap-2",h==="inferences"?"lg:grid-cols-[minmax(220px,1fr)_200px]":"lg:grid-cols-1"].join(" "),children:[s.jsxs("label",{className:"relative block",children:[s.jsx(ks,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{className:"h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]",value:x,placeholder:l(h==="inferences"?"Search model, node...":"Search node..."),onChange:ae=>{y(ae.target.value),T(1),D(1)}})]}),h==="inferences"?s.jsx(Pw,{label:l("Model"),allLabel:l("All model"),value:g,options:I.models,translateOption:l,onChange:ae=>{j(ae),T(1)}}):null]})]}),xe?s.jsx("div",{className:"border-b border-rose-100 bg-rose-50 px-4 py-3 text-[0.86rem] text-rose-700",children:"Ledger data could not be loaded. The local daemon may be offline or missing ledger endpoints."}):null,Q?s.jsx(Gw,{}):h==="inferences"?s.jsx(Kw,{entries:Z,nodeNameById:J,total:te.length,page:w,pageSize:R,onPageChange:T,onPageSizeChange:ae=>{L(ae),T(1),D(1)}}):s.jsx(Yw,{entries:se,nodeNameById:J,total:F.length,page:E,pageSize:R,onPageChange:D,onPageSizeChange:ae=>{L(ae),T(1),D(1)}})]})]})}function Yx({label:n,active:l,count:o,onClick:i,children:u}){return s.jsxs("button",{type:"button",onClick:i,"aria-label":`${n} ledger records, ${Se(o)} records`,className:["tb-button tb-button-sm gap-2",l?"tb-button-primary":"tb-button-secondary"].join(" "),children:[s.jsx("span",{children:u}),s.jsx("span",{className:"font-mono text-[0.76rem]",children:Se(o)})]})}function Pw({label:n,allLabel:l,value:o,options:i,translateOption:u,onChange:f}){return s.jsxs("label",{className:"grid gap-1",children:[s.jsx("span",{className:"sr-only",children:n}),s.jsxs("select",{"aria-label":n,className:"h-9 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition focus:border-[var(--color-purple)]",value:o,onChange:p=>f(p.target.value),children:[s.jsx("option",{value:"all",children:l}),i.map(p=>s.jsx("option",{value:p,children:u(p)},p))]})]})}function Kw({entries:n,nodeNameById:l,total:o,page:i,pageSize:u,onPageChange:f,onPageSizeChange:p}){return o===0?s.jsx(bb,{label:"inference records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[960px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"TIME"}),s.jsx("th",{className:"px-4 py-2.5",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5",children:"NODE"}),s.jsx("th",{className:"px-4 py-2.5",children:"TOKENS"}),s.jsx("th",{className:"px-4 py-2.5",children:"SPEED"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"COST"})]})}),n.map(h=>s.jsx("tbody",{children:s.jsxs("tr",{className:"border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:bc(h.createdAt)}),s.jsx("td",{className:"max-w-[190px] truncate px-4 py-3 text-[var(--color-ink)]",children:h.modelId}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(yb,{nodeId:h.sellerKey,nodeName:l.get(h.sellerKey)})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(Vw,{entry:h})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(yc,{ttftMs:h.ttftMs,tokensPerSecond:Jw(h)})}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsx(sN,{billingUnit:h.billingUnit,billedMicros:h.billedMicros,settledUsdMicros:h.settledUsdMicros,inputPriceMicrosPer1m:h.inputPriceMicrosPer1m,outputPriceMicrosPer1m:h.outputPriceMicrosPer1m,cacheReadPriceMicrosPer1m:h.cacheReadPriceMicrosPer1m,inputCostMicros:h.inputCostMicros,outputCostMicros:h.outputCostMicros,cacheReadCostMicros:h.cacheReadCostMicros,originalUsdMicros:h.originalUsdMicros,billingMultiplier:h.billingMultiplier,serviceTier:h.serviceTier,imageCount:h.imageCount,imageSize:h.imageSize,imageQuality:h.imageQuality,imageOutputFormat:h.imageOutputFormat,imageOutputTokens:h.imageOutputTokens,imageOutputCostMicros:h.imageOutputCostMicros,imageCostMicrosPerImage:h.imageCostMicrosPerImage})})]})},h.requestId))]})}),s.jsx(gb,{totalItems:o,pageSize:u,page:i,onPageChange:f,onPageSizeChange:p})]})}function Yw({entries:n,nodeNameById:l,total:o,page:i,pageSize:u,onPageChange:f,onPageSizeChange:p}){return o===0?s.jsx(bb,{label:"purchase records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[940px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"TIME"}),s.jsx("th",{className:"px-4 py-2.5",children:"NODE"}),s.jsx("th",{className:"px-4 py-2.5",children:"METHOD"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"SPENT"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"CREDIT"}),s.jsx("th",{className:"px-4 py-2.5",children:"STATUS"}),s.jsx("th",{className:"px-4 py-2.5",children:"SCOPE"})]})}),n.map(h=>s.jsx("tbody",{children:s.jsxs("tr",{className:"border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:bc(h.completedAt??h.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(yb,{nodeId:h.sellerKey,nodeName:l.get(h.sellerKey)})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(Fw,{method:h.paymentMethod})}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-[var(--color-ink)]",children:Gj(h)}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-emerald-700",children:Yj(h.creditMicros)}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(Xw,{status:h.status})}),s.jsx("td",{className:"max-w-[180px] truncate px-4 py-3 font-mono text-[0.78rem] text-[var(--color-muted)]",title:h.modelId,children:Zw(h.modelId)})]})},h.purchaseId))]})}),s.jsx(gb,{totalItems:o,pageSize:u,page:i,onPageChange:f,onPageSizeChange:p})]})}function Gw(){return s.jsx("div",{className:"space-y-2 px-4 py-4",children:Array.from({length:7},(n,l)=>s.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-lavender)]/35"},l))})}function bb({label:n}){return s.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center px-6 py-10 text-center",children:[s.jsx("div",{className:"grid size-12 place-items-center rounded-xl border border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-purple)]",children:s.jsx(ks,{className:"size-5"})}),s.jsxs("div",{className:"mt-4 font-semibold text-[var(--color-ink)]",children:["No matching ",n]}),s.jsx("div",{className:"mt-1 max-w-[360px] text-[0.86rem] text-[var(--color-muted)]",children:"Adjust the query or filters to inspect another slice of the local ledger."})]})}function yb({nodeId:n,nodeName:l}){const o=l??n;return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[220px] truncate font-semibold text-[var(--color-ink)]",title:o,children:o}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:zs(n)})]})}function Vw({entry:n}){if(Sb(n))return s.jsx(rN,{imageCount:n.imageCount,imageSize:n.imageSize,imageQuality:n.imageQuality,imageOutputFormat:n.imageOutputFormat});const l=!nM(n);return s.jsx(lN,{inputTokens:l?n.promptTokens:aM(n),outputTokens:n.completionTokens,cacheReadTokens:n.cacheReadTokens,showCacheRead:l})}function Xw({status:n}){const l=ea(n),o={green:"bg-emerald-50 text-emerald-700 ring-emerald-100",amber:"bg-amber-50 text-amber-700 ring-amber-100",red:"bg-rose-50 text-rose-700 ring-rose-100",blue:"bg-blue-50 text-blue-700 ring-blue-100",gray:"bg-slate-100 text-slate-600 ring-slate-200"}[l];return s.jsx("span",{className:["inline-flex h-6 w-fit items-center rounded-full px-2 text-[0.66rem] font-semibold uppercase ring-1",o].join(" "),children:bn(n)})}function Fw({method:n}){return s.jsx("span",{className:"inline-flex max-w-[160px] rounded-full bg-[var(--color-page)] px-2 py-1 font-mono text-[0.72rem] font-semibold text-[var(--color-ink)] ring-1 ring-[var(--color-line-2)]",children:s.jsx("span",{className:"truncate",children:n||"—"})})}function Zw(n){return n||"All models"}function Jw(n){if(!Sb(n))return Number.isFinite(n.avgOutputTokensPerSecond)?n.avgOutputTokensPerSecond:void 0}function Iw(n){return{models:Ww(n.map(l=>l.modelId))}}function Ww(n){return Array.from(new Set(n.filter(Boolean))).sort((l,o)=>l.localeCompare(o))}function eM(n,l,o){return l?[n.sellerKey,o.get(n.sellerKey),n.modelId,n.status,n.balanceSource,n.paymentMethod,bc(n.createdAt)].some(i=>i==null?void 0:i.toLowerCase().includes(l)):!0}function tM(n,l,o){return l?[n.sellerKey,o.get(n.sellerKey),n.paymentMethod,n.status,n.modelId,bc(n.createdAt)].some(i=>i==null?void 0:i.toLowerCase().includes(l)):!0}function Gx(n,l,o){const i=(l-1)*o;return n.slice(i,i+o)}function Sb(n){return n.billingUnit==="images"||n.endpoint==="/v1/images/generations"}function nM(n){var l;return n.balanceSource==="self_funded_provider"||n.paymentMethod==="provider_key"||((l=n.priceVersion)==null?void 0:l.startsWith("local-provider:"))===!0}function aM(n){return Math.max(0,n.promptTokens-(n.cacheReadTokens??0))}function lM({manualProviders:n,modelsResponse:l,registrySellers:o}){const i=new Map;for(const u of o??[])i.set(u.id,Io(u.name??u.id));for(const u of(l==null?void 0:l.sellers)??[])i.set(u.id,Io(u.name??u.id));for(const u of(l==null?void 0:l.data)??[])u.sellerName&&i.set(u.sellerId,Io(u.sellerName));for(const u of n??[])i.set(u.id,Io(u.name||u.id));return i}function Io(n){var l;return((l=n.split("(")[0])==null?void 0:l.trim())||n}function rM(n){return n.length===0?"-":n.map(l=>Vj(l.paymentAmountMinor,l.paymentCurrency)).join(" / ")}function iM(){return Yt({queryKey:["init","state"],queryFn:()=>Lt("/init/state"),refetchInterval:1e4})}async function sM(n){return tt("POST","/init/complete",void 0)}function oM(){return ct({mutationFn:()=>tt("POST","/init/doctor/run")})}function jb(){return Yt({queryKey:["providers","status"],queryFn:()=>Lt("/providers/status"),refetchInterval:1e4})}function cM(){return ct({mutationFn:n=>tt("POST","/providers/install/preview",n)})}function uM(){const n=St();return ct({mutationFn:l=>tt("POST","/providers/install/apply",l),onSuccess:()=>{n.invalidateQueries({queryKey:["providers","status"]}),n.invalidateQueries({queryKey:["init","state"]})}})}function dM(){const n=St();return ct({mutationFn:l=>tt("POST","/providers/reconnect",l),onSuccess:()=>{n.invalidateQueries({queryKey:["providers","status"]}),n.invalidateQueries({queryKey:["models"]}),n.invalidateQueries({queryKey:["routing","manual-providers"]}),n.invalidateQueries({queryKey:["init","state"]})}})}function fM(){const n=St();return ct({mutationFn:()=>tt("POST","/models/refresh",{}),onSuccess:()=>{n.invalidateQueries({queryKey:["models"]}),n.invalidateQueries({queryKey:["routing","manual-providers"]})}})}function mM(){const n=St();return ct({mutationFn:l=>tt("POST","/providers/install/rollback",l),onSuccess:()=>{n.invalidateQueries({queryKey:["providers","status"]}),n.invalidateQueries({queryKey:["init","state"]})}})}const hM=[{value:"fullAuto",title:"全自动",body:"自动选择可用节点。"},{value:"fixedSet",title:"固定节点组",body:"在指定节点组内切换。"},{value:"fixed",title:"固定节点",body:"始终使用指定节点。"}],pM=["chat_completions","responses","messages"],Cf="tbp_local_17821_d7f4c9a2b8e1",vM=[{value:"balanced",title:"平衡模式",body:"综合速度、价格、健康度、余额。"},{value:"speed",title:"速度优先",body:"优先选择更快、吞吐量更高节点。"},{value:"discount",title:"成本优先",body:"优先选择更低成本节点。"}],Vx=[{index:1,label:"选择模型",value:"默认模型"},{index:2,label:"绑定钱包",value:"支付方式"},{index:3,label:"配置策略",value:"路由规则"},{index:4,label:"配置工具",value:"终端接入"}],xM=[{method:"wechat-pay",name:"WeChat Pay",detail:"微信支付入口预留"},{method:"alipay-agent",name:"Alipay Agent Payment",detail:"代理支付入口预留"},{method:"coinbase-smart-wallet",name:"Coinbase Smart Wallet",detail:"USDC 钱包入口预留"}],gM=["GPT","Claude","Gemini","DeepSeek","Kimi","Qwen","MiniMax","GLM","Doubao","Grok"];function bM(n){const l=new URLSearchParams(n);return l.has("verifyPaymentMethods")?2:(l.has("verifyPickerDom")||l.has("verifyNoIntro")||l.has("verifyCompact"),1)}function yM(){var ia,De,jt,sa,oa,ca,jn,ua,Yn,vr,Ul,Va;const[n,l]=S.useState(()=>bM(typeof window>"u"?"":window.location.search)),[o,i]=S.useState([]),[u,f]=S.useState(!1),[p,h]=S.useState(),[v,x]=S.useState(!1),[y,g]=S.useState(!1),[j,w]=S.useState("fullAuto"),[T,E]=S.useState("balanced"),[D,R]=S.useState(""),[L,Q]=S.useState([]),[P,G]=S.useState(),[H,$]=S.useState(""),[I,J]=S.useState([]),[te,F]=S.useState({}),[Z,se]=S.useState(),[xe,me]=S.useState(),[O,ee]=S.useState(!1),[re,ae]=S.useState(null),[ge,N]=S.useState(!1),[B,V]=S.useState(),le=iM(),de=If(),pe=Tj(),be=Vf(),Xe=jb(),Oe=Xf(),Mt=Ff(),mt=cM(),yn=uM(),We=oM(),Be=Rs(),Gt=xc(),an=S.useMemo(()=>{var ue;return wM(((ue=Be.data)==null?void 0:ue.data)??[])},[(ia=Be.data)==null?void 0:ia.data]),ln=S.useMemo(()=>{var ue,He,Ze;return $M(((ue=Be.data)==null?void 0:ue.sellers)??[],((He=Be.data)==null?void 0:He.data)??[],((Ze=Gt.data)==null?void 0:Ze.inferences)??[])},[(De=Gt.data)==null?void 0:De.inferences,(jt=Be.data)==null?void 0:jt.data,(sa=Be.data)==null?void 0:sa.sellers]),Bt=S.useMemo(()=>{var ue;return MM(an,o,((ue=le.data)==null?void 0:ue.recommendedModels)??[])},[(oa=le.data)==null?void 0:oa.recommendedModels,an,o]),Et=S.useMemo(()=>o.length>0?o:Bt.map(ue=>ue.id),[Bt,o]),rn=`http://127.0.0.1:${((ca=de.data)==null?void 0:ca.proxyPort)??((jn=le.data)==null?void 0:jn.runtime.proxyPort)??17821}`,sn=S.useMemo(()=>{var ue;return(((ue=Xe.data)==null?void 0:ue.clients)??[]).filter(He=>He.id!=="custom"&&He.detected)},[(ua=Xe.data)==null?void 0:ua.clients]),Kn=((Yn=be.data)==null?void 0:Yn.payments.filter(ue=>ue.enabled&&Nc(ue.method)!=="mock"))??[],la=S.useMemo(()=>XM(j,T,D,L),[D,L,j,T]),rt=FM({serviceReady:((vr=de.data)==null?void 0:vr.status)==="running",modelCount:an.length,routingMode:j,paymentReady:Kn.length>0,configuredTools:((Ul=Xe.data)==null?void 0:Ul.summary.configuredCount)??0}),Ha=((Va=We.data)==null?void 0:Va.checks.map(ZM))??rt;S.useEffect(()=>{v||!le.data||(i(le.data.focusSet),x(!0))},[le.data,v]),S.useEffect(()=>{H||o.length===0||$(o[0])},[H,o]),S.useEffect(()=>{y||sn.length===0||g(!0)},[y,sn]),S.useEffect(()=>{n!==5||We.data||We.error||We.isPending||We.mutate()},[n,We]),S.useEffect(()=>{var Ze;const ue=Dn=>{Dn.preventDefault(),ae(Dn),V("浏览器已经允许直接安装 TokenBuddy。")},He=()=>{N(!0),ae(null),V("TokenBuddy 桌面应用已安装。")};return window.addEventListener("beforeinstallprompt",ue),window.addEventListener("appinstalled",He),(Ze=window.matchMedia)!=null&&Ze.call(window,"(display-mode: standalone)").matches&&N(!0),()=>{window.removeEventListener("beforeinstallprompt",ue),window.removeEventListener("appinstalled",He)}},[]);const Pa=ue=>{h(void 0),i(He=>He.includes(ue)?He.filter(Ze=>Ze!==ue):[...He,ue])},Sn=async()=>{f(!0),h(void 0);try{await bf(o),h("关注模型已保存。后续工具配置会优先参考这些模型。")}catch(ue){h(`保存失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{f(!1)}},qt=async()=>{if(G(void 0),!la){G(j==="fixed"?"请选择一个固定节点。":"请至少选择一个节点。");return}try{await pe.mutateAsync(la),G("节点路由策略已保存。"),l(4)}catch(ue){G(`保存失败:${ue instanceof Error?ue.message:String(ue)}`)}},Ka=async()=>{try{await Oe.mutateAsync()}catch{}},ra=async()=>{try{await Mt.mutateAsync()}catch{}},Ya=async()=>{var He;se(void 0);const ue=H||Et[0];if(!ue){se("请先选择一个默认模型。");return}if(I.length===0){se("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{await mt.mutateAsync({providers:I,proxyUrl:rn,model:ue,providerSelections:Wx(I,te,Et,ue,((He=Be.data)==null?void 0:He.data)??[])}),se("已生成写入预览。确认无误后可以写入配置。")}catch(Ze){se(`预览失败:${Ze instanceof Error?Ze.message:String(Ze)}`)}},Ga=async()=>{var He;se(void 0);const ue=H||Et[0];if(!ue){se("请先选择一个默认模型。");return}if(I.length===0){se("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{const Ze=await yn.mutateAsync({providers:I,proxyUrl:rn,model:ue,providerSelections:Wx(I,te,Et,ue,((He=Be.data)==null?void 0:He.data)??[])});se(`已写入 ${Ze.applied.length} 个配置文件。`),l(5)}catch(Ze){se(`写入失败:${Ze instanceof Error?Ze.message:String(Ze)}`)}},on=()=>{de.refetch(),le.refetch(),be.refetch(),Xe.refetch(),Be.refetch(),We.mutate()},ht=async()=>{me(void 0),ee(!0);try{await sM(),me("初始化已标记完成。你可以把 TokenBuddy 安装成桌面应用,之后从系统应用入口打开。"),le.refetch()}catch(ue){me(`完成失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ee(!1)}},$t=async()=>{if(!re){V("请在浏览器地址栏右侧或菜单里选择“安装应用”。");return}try{V(void 0),await re.prompt();const ue=await re.userChoice;if(ae(null),ue.outcome==="accepted"){N(!0),V("TokenBuddy 桌面应用已安装。");return}V("你可以稍后继续使用浏览器安装入口。")}catch(ue){V(`安装未完成:${ue instanceof Error?ue.message:String(ue)}`)}},pt=(()=>{var ue,He,Ze,Dn,Xa,da,fa,Fa,Za;return n<=1?s.jsx(jM,{commonModels:Bt,allModels:an,loading:Be.isLoading,error:Be.error,selectedModels:o,saving:u,saveMessage:p,onToggleModel:Pa,onSave:Sn,onContinue:()=>l(2)}):n===2?s.jsx(OM,{payments:((ue=be.data)==null?void 0:ue.payments)??[],enabledPaymentCount:Kn.length,loading:be.isLoading,qrUrl:(He=Oe.data)==null?void 0:He.qrImageUrl,rechargeQrUrl:(Ze=Mt.data)==null?void 0:Ze.qrImageUrl,walletConfigPresent:(Dn=Oe.data)==null?void 0:Dn.walletConfigPresent,error:Oe.error,rechargeError:Mt.error,binding:Oe.isPending,rechargeLoading:Mt.isPending,onBind:Ka,onLoadRecharge:ra,onRefreshPayments:()=>{be.refetch()},onBack:()=>l(1),onContinue:()=>l(3)}):n===3?s.jsx(zM,{mode:j,scorer:T,sellers:ln,fixedSellerId:D,fixedSetSellerIds:L,saving:pe.isPending,message:P,onModeChange:w,onScorerChange:E,onFixedSellerChange:R,onToggleFixedSetSeller:ut=>{Q($e=>$e.includes(ut)?$e.filter(nt=>nt!==ut):[...$e,ut])},onSave:qt,onBack:()=>l(2)}):n===4?s.jsx(UM,{clients:((Xa=Xe.data)==null?void 0:Xa.clients)??[],candidates:sn,loading:Xe.isLoading,selectedProviders:I,selectedModel:H||Et[0]||"",modelOptions:Et,providerSelections:te,proxyUrl:rn,previewChanges:(da=mt.data)==null?void 0:da.changes,applying:yn.isPending,previewing:mt.isPending,message:Z,onToggleProvider:ut=>{J($e=>$e.includes(ut)?$e.filter(nt=>nt!==ut):[...$e,ut])},onModelChange:$,onProviderSelectionChange:(ut,$e)=>{F(nt=>({...nt,[ut]:$e}))},onPreview:Ya,onInstall:Ga,onBack:()=>l(3)}):n===5?s.jsx(BM,{items:Ha,status:(fa=We.data)==null?void 0:fa.status,generatedAt:(Fa=We.data)==null?void 0:Fa.generatedAt,running:We.isPending,error:We.error,onRefresh:on,onBack:()=>l(4),onContinue:()=>l(6)}):s.jsx(qM,{complete:((Za=le.data)==null?void 0:Za.setup.status)==="completed",message:xe,installMessage:B,canInstall:!!re,installed:ge,saving:O,onBack:()=>l(5),onComplete:ht,onInstall:$t})})();return s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(SM,{activeStep:n,onSelect:l}),s.jsx("div",{className:"min-w-0",children:pt})]})}function SM({activeStep:n,onSelect:l}){return s.jsx("nav",{"aria-label":"初始化步骤",className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-2.5 shadow-[0_8px_22px_rgba(60,41,112,0.045)]",children:s.jsx("div",{className:"flex items-stretch gap-2 overflow-x-auto",children:Vx.map(o=>{const i=n===o.index,u=n>o.index;return s.jsxs(S.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>l(o.index),"aria-current":i?"step":void 0,className:["relative flex min-w-[190px] flex-1 items-center gap-2 rounded-[8px] px-3 py-2 text-left transition",i?"bg-[var(--color-lavender)] ring-1 ring-[var(--color-lavender-2)]":"hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-full border bg-white",i?"border-[var(--color-purple)] text-[var(--color-purple)] shadow-[0_0_0_3px_rgba(124,61,240,0.1)]":"",u?"border-emerald-200 bg-emerald-50 text-emerald-700":"",!i&&!u?"border-[var(--color-line-2)] text-[var(--color-muted)]":""].join(" "),children:u?s.jsx(Kt,{className:"size-3.5"}):s.jsx("span",{className:"size-1.5 rounded-full bg-current"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:["block font-mono text-[0.62rem] font-black uppercase tracking-[0.08em]",i?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:["STEP ",o.index,":"]}),s.jsx("span",{className:["mt-0.5 block text-[0.82rem] font-semibold",i?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:o.label}),s.jsx("span",{className:"block truncate text-[0.7rem] text-[var(--color-muted)]",children:o.value})]})]}),o.index<Vx.length?s.jsx("div",{className:"hidden min-w-8 items-center justify-center text-[var(--color-purple)]/70 sm:flex",children:s.jsx(vc,{className:"size-5",strokeWidth:2.6})}):null]},o.index)})})})}function bi({index:n,title:l,detail:o,meta:i,action:u}){return s.jsxs("div",{className:"flex flex-col gap-2.5 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"rounded-[7px] bg-[var(--color-lavender)] px-2 py-0.5 font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:String(n).padStart(2,"0")}),s.jsx("div",{className:"text-[0.92rem] font-semibold text-[var(--color-ink)]",children:l}),o?s.jsx("span",{className:"text-[0.74rem] text-[var(--color-muted)]",children:o}):null,i?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:i}):null]})}),u?s.jsx("div",{className:"shrink-0",children:u}):null]})}function jM({commonModels:n,allModels:l,loading:o,error:i,selectedModels:u,saving:f,saveMessage:p,onToggleModel:h,onSave:v,onContinue:x}){const[y,g]=S.useState(!1),j=u.map(w=>l.find(T=>T.id===w)??{id:w,sellerCount:0,protocols:[],paymentMethods:[]});return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:1,title:"模型访问",detail:"默认和高频模型",meta:`${u.length} selected`,action:s.jsxs("button",{type:"button",disabled:o||!!i,onClick:()=>g(!0),className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple-2)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(ys,{className:"size-3.5"}),"添加模型"]})}),i?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["模型目录加载失败:",i instanceof Error?i.message:String(i)]}):null,j.length===0?s.jsxs("button",{type:"button",disabled:o||!!i,onClick:()=>g(!0),className:"mt-3 flex min-h-[72px] w-full items-center gap-3 rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-left transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] bg-white text-[var(--color-purple)]",children:s.jsx(ys,{className:"size-4"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"添加可能使用到的模型"}),s.jsx("span",{className:"mt-0.5 block text-[0.76rem] text-[var(--color-muted)]",children:"至少选择一个模型后才能保存并继续。"})]})]}):s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:j.map(w=>s.jsxs("div",{className:"inline-flex min-h-9 max-w-full items-center gap-2 rounded-[9px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5",children:[s.jsx("span",{className:"truncate font-mono text-[0.82rem] font-semibold text-[var(--color-purple)]",children:w.id}),s.jsx("span",{className:"rounded-full bg-white/70 px-2 py-0.5 text-[0.68rem] font-semibold text-emerald-700",children:"可用"}),s.jsx("button",{type:"button",onClick:()=>h(w.id),className:"inline-flex size-5 items-center justify-center rounded-[6px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${w.id}`,children:s.jsx(Dl,{className:"size-3"})})]},w.id))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2.5 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-h-5 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:[o?s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(yt,{className:"size-3.5 animate-spin text-[var(--color-purple)]"})," loading catalog"]}):null,!o&&!i&&u.length===0?s.jsx("span",{children:"请选择至少一个可能使用的模型。"}):null,p?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:p}):null]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",disabled:f||u.length===0,onClick:v,className:"inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[f?s.jsx(yt,{className:"size-3.5 animate-spin"}):null,"保存"]}),s.jsxs("button",{type:"button",disabled:u.length===0,onClick:x,className:"inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:["下一步",s.jsx(vc,{className:"size-3.5"})]})]})]})]}),y?s.jsx(NM,{models:n,allModels:l,selectedModelIds:u,onToggle:h,onClose:()=>g(!1)}):null]})}function NM({models:n,allModels:l,selectedModelIds:o,onToggle:i,onClose:u}){const[f,p]=S.useState("common"),[h,v]=S.useState(""),x=h.trim(),y=f==="common"?n:x?AM(l,x):[],g=f==="common"?"没有可用的推荐模型。":"输入关键词搜索全部可用模型。",j=[{id:"common",label:"推荐模型",hint:"直接勾选"},{id:"all",label:"搜索添加",hint:"全部模型"}];return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(32,26,56,0.22)] px-3 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex max-h-full w-full max-w-[720px] flex-col overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_80px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-start gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Select models"}),s.jsx("h2",{className:"mt-0.5 text-[1rem] font-semibold text-[var(--color-ink)]",children:"选择可能使用到的模型"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"推荐模型直接勾选;搜索添加用于查找平台全部模型。"})]}),s.jsxs("div",{className:"mt-0.5 rounded-full bg-[var(--color-lavender)] px-2.5 py-1 font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:[o.length," selected"]}),s.jsx("button",{type:"button",onClick:u,className:"inline-flex size-8 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] text-[var(--color-muted)] hover:text-[var(--color-ink)]","aria-label":"Close model picker",children:s.jsx(Dl,{className:"size-4"})})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] px-4 py-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"已选模型"}),o.length===0?s.jsx("div",{className:"rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.78rem] text-[var(--color-muted)]",children:"还没有选择模型。"}):s.jsx("div",{className:"flex max-h-[92px] flex-wrap gap-1.5 overflow-y-auto pr-1",children:o.map(w=>s.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1",children:[s.jsx("span",{className:"max-w-[220px] truncate font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:w}),s.jsx("button",{type:"button",onClick:()=>i(w),className:"inline-flex size-4 items-center justify-center rounded-[5px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${w}`,children:s.jsx(Dl,{className:"size-3"})})]},w))})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] p-3",children:[s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:j.map(w=>{const T=f===w.id;return s.jsxs("button",{type:"button",onClick:()=>p(w.id),className:["rounded-[9px] border px-3 py-2 text-left transition",T?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["block text-[0.84rem] font-semibold",T?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:w.label}),s.jsx("span",{className:"mt-0.5 block text-[0.72rem] text-[var(--color-muted)]",children:w.hint})]},w.id)})}),f==="all"?s.jsxs("label",{className:"relative mt-3 block",children:[s.jsx(ks,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{value:h,onChange:w=>v(w.target.value),placeholder:"搜索平台全部模型...",className:"h-10 w-full rounded-[9px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.88rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]"})]}):null]}),s.jsx("div",{className:"min-h-0 max-h-[320px] overflow-y-auto p-3",children:y.length===0?s.jsx("div",{className:"rounded-[12px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-4 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:g}):s.jsx("div",{className:"grid gap-2",children:y.map(w=>{const T=o.includes(w.id);return s.jsxs("button",{type:"button",onClick:()=>i(w.id),"aria-pressed":T,className:["flex items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",T?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-[7px] border",T?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent"].join(" "),children:s.jsx(Kt,{className:"size-3.5"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:w.id}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:im(w.id)}),s.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-semibold text-emerald-700",children:"可用"}),Tf(w.paymentMethods)?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:Tf(w.paymentMethods)}):null]})]}),s.jsx("span",{className:["rounded-[7px] px-2 py-1 text-[0.72rem] font-semibold",T?"bg-[var(--color-purple)] text-white":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:T?"已选择":"选择"})]},w.id)})})}),s.jsxs("div",{className:"flex flex-col gap-2 border-t border-[var(--color-line-2)] bg-white px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"text-[0.8rem] leading-5 text-[var(--color-muted)]",children:["已选择 ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:o.length})," 个模型"]}),s.jsxs("button",{type:"button",onClick:u,"aria-label":"Done",title:"Done selecting models",className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["完成选择",s.jsx(Kt,{className:"size-3.5"})]})]})]})})}function wM(n){const l=new Map;for(const o of n){const i=l.get(o.id)??{sellers:new Set,protocols:new Set,paymentMethods:new Set};i.sellers.add(o.sellerId);for(const u of o.supportedProtocols)i.protocols.add(u);for(const u of o.paymentMethods)i.paymentMethods.add(u);l.set(o.id,i)}return Array.from(l.entries()).map(([o,i])=>({id:o,sellerCount:i.sellers.size,protocols:Array.from(i.protocols).sort(),paymentMethods:Array.from(i.paymentMethods).sort()})).sort((o,i)=>i.sellerCount!==o.sellerCount?i.sellerCount-o.sellerCount:o.id.localeCompare(i.id))}function MM(n,l,o){const i=CM(n,o);if(i.length>0)return i.slice(0,14);const u=new Set(l),f=new Map;for(const v of l){const x=n.find(y=>y.id===v);x&&f.set(x.id,x)}const p=n.map(v=>({model:v,rank:EM(v.id)})).filter(v=>v.rank<100).sort((v,x)=>v.rank!==x.rank?v.rank-x.rank:x.model.sellerCount!==v.model.sellerCount?x.model.sellerCount-v.model.sellerCount:v.model.id.localeCompare(x.model.id)),h=new Map;for(const v of p){const x=im(v.model.id),y=h.get(x)??[];y.push(v),h.set(x,y)}for(const v of gM){const x=v==="GPT"?3:v==="Claude"||v==="Gemini"?2:1;for(const y of(h.get(v)??[]).slice(0,x))f.set(y.model.id,y.model)}for(const v of p){if(f.size>=14)break;u.has(v.model.id)||f.set(v.model.id,v.model)}return Array.from(f.values()).slice(0,14)}function CM(n,l){const o=new Map;for(const i of l){const u=TM(n,i,o);u&&o.set(u.id,u)}return Array.from(o.values())}function TM(n,l,o){const i=Jd(l);if(!i)return;const u=n.find(f=>Jd(f.id)===i&&!o.has(f.id));return u||n.find(f=>{if(o.has(f.id))return!1;const p=Jd(f.id);return p.includes(i)||i.includes(p)})}function Jd(n){return n.trim().toLowerCase().replace(/_/g,"-")}function AM(n,l){const o=l.trim().toLowerCase();return o?n.filter(i=>[i.id,im(i.id),...i.paymentMethods].some(u=>u.toLowerCase().includes(o))):n}function EM(n){const l=n.toLowerCase();return l.includes("gpt-5.5")||l.includes("gpt-5-5")||l.includes("gpt-5_5")?0:l.includes("gpt-5.4")||l.includes("gpt-5-4")||l.includes("gpt-5_4")?1:l.includes("gpt-5")||l.includes("gpt-latest")||l.includes("openai/gpt")?2:l.includes("claude")&&(l.includes("4.8")||l.includes("4-8"))?3:l.includes("claude")&&l.includes("opus")?4:l.includes("claude")&&l.includes("sonnet")?5:l.includes("claude")?6:l.includes("gemini")&&(l.includes("3.1")||l.includes("3-1"))?7:l.includes("gemini")&&l.includes("pro")?8:l.includes("gemini")?9:l.includes("deepseek")?10:l.includes("kimi")||l.includes("moonshot")?11:l.includes("qwen")||l.includes("tongyi")?12:l.includes("minimax")?13:l.includes("glm")||l.includes("zhipu")?14:l.includes("doubao")||l.includes("bytedance")?15:l.includes("grok")?16:100}function im(n){const l=n.toLowerCase();return l.includes("gpt")||l.includes("openai")?"GPT":l.includes("claude")||l.includes("anthropic")?"Claude":l.includes("gemini")||l.includes("google")?"Gemini":l.includes("deepseek")?"DeepSeek":l.includes("kimi")||l.includes("moonshot")?"Kimi":l.includes("qwen")||l.includes("tongyi")?"Qwen":l.includes("minimax")?"MiniMax":l.includes("glm")||l.includes("zhipu")?"GLM":l.includes("doubao")||l.includes("bytedance")?"Doubao":l.includes("grok")?"Grok":"Common"}function Tf(n){return n.length===0?"":`${kM(n.map(RM)).join("、")}`}function kM(n){return Array.from(new Set(n))}function RM(n){const l=Nc(n);return l.includes("x402")?"X402":l.includes("clawtip")?"ClawTip":l.includes("wallet")?"钱包":l.includes("mock")||l.includes("test")?"测试":"其它"}function Nc(n){return n.trim().toLowerCase()}function zM({mode:n,scorer:l,sellers:o,fixedSellerId:i,fixedSetSellerIds:u,saving:f,message:p,onModeChange:h,onScorerChange:v,onFixedSellerChange:x,onToggleFixedSetSeller:y,onSave:g,onBack:j}){const w=n!=="fullAuto";return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:3,title:"配置策略",detail:"路由规则",meta:`${Eb(n)} / ${t3(l)}`}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-2",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"路由模式"}),s.jsx("div",{className:"grid gap-2",children:hM.map(T=>s.jsxs("button",{type:"button",onClick:()=>h(T.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",n===T.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",n===T.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Kt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:T.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:T.body})]},T.value))})]}),s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"优化目标"}),s.jsx("div",{className:"grid gap-2",children:vM.map(T=>s.jsxs("button",{type:"button",onClick:()=>v(T.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",l===T.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",l===T.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Kt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:T.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:T.body})]},T.value))})]})]}),w?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"选择节点"}),s.jsx("div",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:n==="fixed"?i?"已选择 1 个":"尚未选择":`已选择 ${u.length} 个`})]}),o.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"正在等待节点目录。你也可以先返回上一步确认模型目录是否已经加载完成。"}):s.jsx(_M,{mode:n,sellers:o,fixedSellerId:i,fixedSetSellerIds:u,onFixedSellerChange:x,onToggleFixedSetSeller:y})]}):s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"当前是全自动模式,TokenBuddy 会根据模型、节点健康度、速度、价格和余额状态自动规划调用路径。"})]}),s.jsx(Nb,{backLabel:"上一步:绑定钱包",nextLabel:"下一步:配置工具",saving:f,message:p,onBack:j,onNext:g})]})}function _M({mode:n,sellers:l,fixedSellerId:o,fixedSetSellerIds:i,onFixedSellerChange:u,onToggleFixedSetSeller:f}){const[p,h]=S.useState({key:"status",direction:"asc"}),v=S.useMemo(()=>wb(l,p),[l,p]),x=g=>{h(j=>({key:g,direction:j.key===g&&j.direction==="asc"?"desc":"asc"}))},y=g=>{if(n==="fixed"){u(g);return}f(g)};return s.jsx("div",{className:"mt-2 overflow-hidden rounded-[9px] border border-[var(--color-line-2)]",children:s.jsx("div",{className:"max-h-[300px] overflow-auto",children:s.jsxs("table",{className:"min-w-[760px] w-full border-collapse text-left text-[0.78rem]",children:[s.jsx("thead",{className:"sticky top-0 z-10 border-b border-[var(--color-line-2)] bg-[var(--color-page)] text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-12 px-2 py-2 font-semibold",children:"选"}),s.jsx(ei,{label:"节点",sortKey:"name",sort:p,onSort:x}),s.jsx(ei,{label:"状态",sortKey:"status",sort:p,onSort:x}),s.jsx(ei,{label:"模型",sortKey:"models",sort:p,onSort:x,align:"right"}),s.jsx(ei,{label:"价格",sortKey:"price",sort:p,onSort:x}),s.jsx(ei,{label:"折扣",sortKey:"discount",sort:p,onSort:x,align:"right"}),s.jsx(ei,{label:"响应",sortKey:"speed",sort:p,onSort:x,align:"right"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"支付"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:v.map(g=>{const j=n==="fixed"?o===g.id:i.includes(g.id);return s.jsxs("tr",{onClick:()=>y(g.id),className:["cursor-pointer transition hover:bg-[var(--color-lavender)]/45",j?"bg-[var(--color-lavender)]/70":"bg-white"].join(" "),children:[s.jsx("td",{className:"px-2 py-2.5",children:s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",j?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Kt,{className:"size-3"})})}),s.jsxs("td",{className:"max-w-[210px] px-3 py-2.5",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:g.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",children:g.id})]}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("span",{className:["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",a3(g.status)].join(" "),children:n3(g.status)})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:g.modelCount}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-ink)]",children:s.jsx(oN,{inputPriceMicrosPer1m:g.minInputPriceMicrosPer1m,outputPriceMicrosPer1m:g.minOutputPriceMicrosPer1m})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:Wf(g.discountRatio)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:s.jsx(yc,{ttftMs:g.avgTtftMs,tokensPerSecond:g.avgTokensPerSecond,compact:!0})}),s.jsx("td",{className:"max-w-[150px] px-3 py-2.5",children:s.jsx("div",{className:"truncate text-[0.72rem] text-[var(--color-muted)]",children:Tf(g.paymentMethods)||"—"})})]},g.id)})})]})})})}function ei({label:n,sortKey:l,sort:o,align:i="left",onSort:u}){const f=o.key===l,p=f?o.direction==="asc"?"↑":"↓":"↕";return s.jsx("th",{className:["px-3 py-2 font-semibold",i==="right"?"text-right":"text-left"].join(" "),children:s.jsxs("button",{type:"button",onClick:()=>u(l),className:["inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 transition hover:bg-white",i==="right"?"justify-end":"justify-start",f?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:[s.jsx("span",{children:n}),s.jsx("span",{className:"font-mono text-[0.66rem]",children:p})]})})}function OM({payments:n,enabledPaymentCount:l,loading:o,qrUrl:i,rechargeQrUrl:u,walletConfigPresent:f,error:p,rechargeError:h,binding:v,rechargeLoading:x,onBind:y,onLoadRecharge:g,onRefreshPayments:j,onBack:w,onContinue:T}){const[E,D]=S.useState("clawtip"),[R,L]=S.useState(!1),[Q,P]=S.useState(!1),G=n.find(O=>Nc(O.method)==="clawtip"),H=!!(G!=null&&G.enabled||f||DM(G==null?void 0:G.config,"walletConfigPresent")),$=R&&H,I=[{method:"clawtip",name:"ClawTip",detail:"JD App 扫码 / 微支付",status:H?"已绑定":"可绑定",available:!0},...xM.map(O=>({...O,status:"Coming soon",available:!1}))],J=I.find(O=>O.method===E)??I[0],te=J.method==="clawtip",F=te&&H&&!$,Z=$||F||R,se=te?Z:!0,xe=()=>{L(!0),y()},me=()=>{P(!0),g()};return S.useEffect(()=>{if(!te||!R||H)return;const O=window.setInterval(j,1500);return()=>window.clearInterval(O)},[R,H,j,te]),S.useEffect(()=>{!F||u||x||Q||(P(!0),g())},[g,x,u,Q,F]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:2,title:"选择支付方式",detail:"钱包和充值通道",meta:o?"checking":`${l} active`,action:te&&F?s.jsxs("button",{type:"button",disabled:x,onClick:me,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[x?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(bs,{className:"size-3.5"}),"刷新充值码"]}):te&&R&&!H?s.jsxs("button",{type:"button",disabled:v,onClick:xe,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(ps,{className:"size-3.5"}),"重新生成"]}):te&&!R&&!H?s.jsxs("button",{type:"button",disabled:v,onClick:xe,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(ps,{className:"size-3.5"}),"开始绑定"]}):te?null:s.jsx("span",{className:"inline-flex h-8 items-center rounded-[8px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 font-mono text-[0.72rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})}),s.jsxs("div",{className:["mt-3 grid gap-3",se?"lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]":"lg:max-w-[360px]"].join(" "),children:[s.jsx("div",{className:"grid content-start gap-2",children:I.map(O=>{const ee=O.method===J.method;return s.jsxs("button",{type:"button",onClick:()=>D(O.method),"aria-pressed":ee,className:["grid min-h-[64px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",ee?"border-[var(--color-purple)] bg-[var(--color-lavender)] shadow-[0_8px_22px_rgba(124,61,240,0.08)]":"border-[var(--color-line-2)] bg-white hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-9 shrink-0 place-items-center rounded-[9px] border",ee?"border-[var(--color-lavender-2)] bg-white text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:Xx(O.method)}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate text-[0.86rem] font-semibold text-[var(--color-ink)]",children:O.name}),s.jsx("span",{className:"mt-0.5 block truncate text-[0.73rem] text-[var(--color-muted)]",children:O.detail})]}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.68rem] font-semibold",O.available?"bg-emerald-50 text-emerald-700":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:O.status})]},O.method)})}),te?Z?s.jsx("div",{className:"flex min-h-[360px] items-center justify-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4",children:$?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-emerald-100 bg-emerald-50 px-4 py-5 text-center",children:s.jsxs("div",{children:[s.jsx(Kt,{className:"mx-auto size-8 text-emerald-700"}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-emerald-900",children:"绑定成功"}),s.jsx("div",{className:"mt-1 text-[0.78rem] leading-5 text-emerald-800",children:"ClawTip 钱包已经写入本机配置,可以继续配置路由策略。"})]})}):F?u?s.jsx("img",{src:u,alt:"ClawTip 充值二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[x?s.jsx(yt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(bs,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:x?"正在加载充值码":"充值码未加载"}),s.jsx("button",{type:"button",disabled:x,onClick:me,className:"mt-3 inline-flex h-8 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:"重新加载"})]})}):R&&i?s.jsx("img",{src:i,alt:"ClawTip 钱包绑定二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):R?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[v?s.jsx(yt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(ps,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:v?"正在生成二维码":"等待二维码"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"生成后使用京东 App 扫码绑定。"})]})}):null}):null:s.jsx("div",{className:"grid min-h-[220px] place-items-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4 text-center",children:s.jsxs("div",{className:"max-w-[360px]",children:[s.jsx("span",{className:"mx-auto grid size-11 place-items-center rounded-[12px] border border-[var(--color-line-2)] bg-white text-[var(--color-purple)]",children:Xx(J.method)}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-[var(--color-ink)]",children:J.name}),s.jsxs("div",{className:"mt-1 text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[J.detail,"。当前版本先通过 ClawTip 完成钱包绑定,后续会在这里接入更多支付流程。"]}),s.jsx("div",{className:"mt-3 inline-flex rounded-full bg-white px-3 py-1 font-mono text-[0.7rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})]})})]}),te&&!H&&R&&p?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["生成二维码失败:",p instanceof Error?p.message:String(p)]}):null,te&&F&&h?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["加载充值二维码失败:",h instanceof Error?h.message:String(h)]}):null]}),s.jsx(Nb,{backLabel:"上一步:模型访问",nextLabel:"下一步:配置策略",message:l>0?"支付方式已可用,可以继续配置路由策略。":"如果你暂时跳过绑定,后续首次购买模型额度时仍需要完成支付配置。",onBack:w,onNext:T})]})}function Xx(n){const l=Nc(n);return l==="wechat-pay"?s.jsx(xj,{className:"size-4"}):l==="alipay-agent"?s.jsx(WS,{className:"size-4"}):l==="coinbase-smart-wallet"?s.jsx(bs,{className:"size-4"}):s.jsx(ps,{className:"size-4"})}function DM(n,l){const o=n==null?void 0:n[l];return o===!0||o==="true"||o===1||o==="1"}function UM({clients:n,candidates:l,loading:o,selectedProviders:i,selectedModel:u,modelOptions:f,providerSelections:p,proxyUrl:h,previewChanges:v,applying:x,previewing:y,message:g,onToggleProvider:j,onModelChange:w,onProviderSelectionChange:T,onPreview:E,onInstall:D,onBack:R}){var te;const L=new Set(l.map(F=>F.id)),Q=l.length,P=n.find(F=>F.id==="custom")??Tb(h),G=[...n.filter(F=>F.id!=="custom"),{...P,name:"其他工具"}],H=((te=G[0])==null?void 0:te.id)??"custom",[$,I]=S.useState(H),J=G.find(F=>F.id===$)??G[0]??P;return S.useEffect(()=>{var F;G.some(Z=>Z.id===$)||I(((F=G[0])==null?void 0:F.id)??"custom")},[$,G]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:4,title:"配置工具",detail:"终端接入",meta:`${i.length} 本次写入 / ${Q} 已安装`,action:o?s.jsx(yt,{className:"size-4 animate-spin text-[var(--color-purple)]"}):null}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,320px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"工具"}),s.jsxs("div",{className:"rounded-full bg-white px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:[n.length," tools"]})]}),s.jsx("div",{className:"mt-2 grid max-h-[380px] gap-2 overflow-y-auto pr-1",children:G.map(F=>{const Z=F.id!=="custom"&&L.has(F.id),se=i.includes(F.id),xe=J.id===F.id;return s.jsxs("div",{className:["rounded-[10px] border p-2.5 text-left transition",xe?"border-[var(--color-purple)] bg-white shadow-[0_10px_24px_rgba(60,41,112,0.08)]":"border-[var(--color-line-2)] bg-white/70 hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-[8px] border text-[0.72rem] font-semibold",xe?"border-[var(--color-purple)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)]"].join(" "),children:VM(F.name)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"truncate text-[0.84rem] font-semibold text-[var(--color-ink)]",children:F.name}),se?s.jsx("span",{className:"rounded-full bg-[var(--color-lavender)] px-1.5 py-0.5 text-[0.66rem] font-semibold text-[var(--color-purple)]",children:"本次写入"}):null]}),s.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.68rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:kb(F)}),F.commandName?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:F.commandName}):null,F.id==="custom"?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:"复制配置"}):null]})]}),F.id!=="custom"?s.jsx("button",{type:"button",disabled:!Z,className:["mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border",se?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent",Z?"":"opacity-45"].join(" "),"aria-label":se?`移出 ${F.name} 本次写入`:`写入 ${F.name} 的 TokenBuddy 配置`,"aria-pressed":se,title:se?"移出本次写入":"加入本次写入",onClick:()=>j(F.id),children:s.jsx(Kt,{className:"size-3"})}):null]}),s.jsx("button",{type:"button",onClick:()=>I(F.id),className:["mt-2 inline-flex h-7 items-center justify-center rounded-[7px] px-2 text-[0.72rem] font-semibold transition",xe?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"border border-[var(--color-line-2)] bg-white text-[var(--color-muted)] hover:border-[var(--color-purple)] hover:text-[var(--color-ink)]"].join(" "),children:"查看配置"})]},F.id)})})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:s.jsx(LM,{client:J,selected:i.includes(J.id),installable:J.id!=="custom"&&L.has(J.id),selectedModel:u,modelOptions:f,providerSelections:p,proxyUrl:h,onToggleInstall:()=>j(J.id),onModelChange:w,onProviderSelectionChange:T})})]}),v?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"配置文件变更"}),v.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] text-[var(--color-muted)]",children:"没有需要写入的配置变更。"}):s.jsx("div",{className:"mt-2 grid max-h-[180px] gap-2 overflow-y-auto pr-1",children:v.map(F=>s.jsxs("div",{className:"rounded-[9px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:l3(F.action)}),s.jsx("span",{children:F.providerId})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:F.path}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:F.summary})]},`${F.providerId}:${F.path}:${F.summary}`))})]}):null]}),s.jsxs(Ot,{className:"flex flex-col gap-3 p-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{className:"text-[0.84rem] leading-6 text-[var(--color-muted)]",children:g?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:g}):null}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:R,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步:配置策略"}),s.jsxs("button",{type:"button",disabled:y||i.length===0,onClick:E,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[y?s.jsx(yt,{className:"size-4 animate-spin"}):null,"预览写入"]}),s.jsxs("button",{type:"button",disabled:x||i.length===0,onClick:D,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[x?s.jsx(yt,{className:"size-4 animate-spin"}):null,"写入 TokenBuddy 配置"]})]})]})]})}function LM({client:n,selected:l,installable:o,selectedModel:i,modelOptions:u,providerSelections:f,proxyUrl:p,onToggleInstall:h,onModelChange:v,onProviderSelectionChange:x}){var j,w,T;if(n.id==="custom"){const E=n.manualConfig??Tb(p).manualConfig;return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Id,{client:n,selected:!1,installable:!1}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(fs,{label:"OpenAI base URL",value:(E==null?void 0:E.openaiBaseUrl)??Ab(p)}),s.jsx(fs,{label:"Anthropic base URL",value:(E==null?void 0:E.anthropicBaseUrl)??p}),s.jsx(fs,{label:"API key",value:(E==null?void 0:E.apiKey)??Cf})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"其他工具只需要填入本地推理服务接口和 key,不会写入本机配置文件。"})]})}if(n.id==="claude-code"){const E=Cb(f[n.id],u,i),D=(L,Q)=>{x(n.id,{...E,fallbackModel:E.fallbackModel||Q||i,roles:{...E.roles,[L]:Q?{upstreamModel:Q,displayName:Q}:void 0}})},R=L=>{x(n.id,{...E,fallbackModel:L}),v(L)};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Id,{client:n,selected:l,installable:o,onToggleInstall:h}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(ds,{label:"Fallback",value:E.fallbackModel??i,modelOptions:u,onChange:R}),s.jsx(ds,{label:"Haiku",value:((j=E.roles.haiku)==null?void 0:j.upstreamModel)??"",modelOptions:u,onChange:L=>D("haiku",L)}),s.jsx(ds,{label:"Sonnet",value:((w=E.roles.sonnet)==null?void 0:w.upstreamModel)??"",modelOptions:u,onChange:L=>D("sonnet",L)}),s.jsx(ds,{label:"Opus",value:((T=E.roles.opus)==null?void 0:T.upstreamModel)??"",modelOptions:u,onChange:L=>D("opus",L)})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"Claude Code 会把 Haiku、Sonnet、Opus 三种客户端模型映射到你选择的上游模型。"})]})}const y=Mb(n.id,f[n.id],i,[]),g=E=>{v(E),x(n.id,{selectionKind:"single-model",protocolPreference:fc(n.id),defaultModel:E})};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Id,{client:n,selected:l,installable:o,onToggleInstall:h}),s.jsx(ds,{label:"模型",value:y.defaultModel,modelOptions:u,onChange:g}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(fs,{label:"Proxy URL",value:p,compact:!0}),s.jsx(fs,{label:"API key",value:Cf,compact:!0})]}),n.configPath?s.jsx("div",{className:"truncate rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 font-mono text-[0.72rem] text-[var(--color-muted)]",children:n.configPath}):null]})}function Id({client:n,selected:l,installable:o,onToggleInstall:i}){return s.jsxs("div",{className:"flex flex-col gap-2 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("div",{className:"text-[0.9rem] font-semibold text-[var(--color-ink)]",children:n.name}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",n.configured?"bg-emerald-50 text-emerald-700":n.status==="installed"?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:kb(n)})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:n.reason})]}),n.id!=="custom"?s.jsxs("button",{type:"button",disabled:!o,onClick:i,className:["inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] px-2.5 text-[0.78rem] font-semibold transition disabled:cursor-not-allowed disabled:opacity-45",l?"border border-[var(--color-purple)] bg-white text-[var(--color-purple)] hover:bg-[var(--color-lavender)]":"bg-[var(--color-purple)] text-white hover:bg-[var(--color-purple-2)]"].join(" "),children:[l?s.jsx(Kt,{className:"size-3.5"}):s.jsx(ys,{className:"size-3.5"}),l?"已加入本次写入":"写入 TokenBuddy 配置"]}):null]})}function ds({label:n,value:l,modelOptions:o,onChange:i}){return s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-muted)]",children:n}),s.jsxs("select",{value:l,onChange:u=>i(u.target.value),className:"mt-1 h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.82rem] text-[var(--color-ink)] outline-none focus:border-[var(--color-purple)]",children:[s.jsx("option",{value:"",children:"请选择模型"}),o.map(u=>s.jsx("option",{value:u,children:u},u))]})]})}function fs({label:n,value:l,compact:o=!1}){const[i,u]=S.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(l),u(!0),window.setTimeout(()=>u(!1),1200)}catch{u(!1)}};return s.jsxs("div",{className:["rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",o?"min-w-0":""].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold text-[var(--color-muted)]",children:n}),s.jsxs("button",{type:"button",onClick:f,className:"inline-flex h-7 items-center justify-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2 text-[0.7rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:[s.jsx(QS,{className:"size-3"}),i?"已复制":"复制"]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.76rem] text-[var(--color-ink)]",children:l})]})}function BM({items:n,status:l,generatedAt:o,running:i,error:u,onRefresh:f,onBack:p,onContinue:h}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:5,title:"验证网关",detail:"本机状态",meta:i?"checking":eg(l),action:s.jsxs("button",{type:"button",disabled:i,onClick:f,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.78rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[i?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(gf,{className:"size-3.5"}),"刷新"]})}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[0.76rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:["rounded-full px-2 py-0.5 font-semibold",JM(l)].join(" "),children:i?"正在检查":eg(l)}),o?s.jsxs("span",{children:["检查时间:",new Date(o).toLocaleString()]}):s.jsx("span",{children:"等待后端检查。"})]}),u?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.82rem] leading-6 text-rose-700",children:["检查失败:",u instanceof Error?u.message:String(u)]}):null,s.jsx("div",{className:"mt-3 grid gap-2 xl:grid-cols-2",children:n.map(v=>s.jsxs("div",{className:"flex gap-2.5 rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-full",WM(v.status)].join(" "),children:v.ok?s.jsx(Kt,{className:"size-3.5"}):s.jsx(gf,{className:"size-3.5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[0.82rem] font-semibold text-[var(--color-ink)]",children:[v.title,s.jsx("span",{className:["rounded-full px-1.5 py-0.5 text-[0.68rem]",e3(v.status)].join(" "),children:IM(v.status)})]}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:v.body})]})]},v.title))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:"发现异常时返回对应步骤补齐配置。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:p,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",onClick:h,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["下一步",s.jsx(vc,{className:"size-3.5"})]})]})]})]})})}function qM({complete:n,message:l,installMessage:o,canInstall:i,installed:u,saving:f,onBack:p,onComplete:h,onInstall:v}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(Ot,{className:"p-3",children:[s.jsx(bi,{index:6,title:n?"初始化完成":"桌面应用",detail:u?"已安装":"可选安装",meta:n?"complete":u?"installed":"optional",action:s.jsxs("button",{type:"button",disabled:u,onClick:v,className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(Kt,{className:"size-3.5"}),u?"已安装":"安装应用"]})}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,290px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3",children:[s.jsx("div",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:u?"TokenBuddy 桌面应用已安装":i?"浏览器支持直接安装":"可从浏览器菜单安装"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:u?"你可以从系统应用入口打开 TokenBuddy。":i?"点击右上角安装按钮并确认浏览器弹窗。":"在地址栏右侧或浏览器菜单中找到安装应用入口。"}),o?s.jsx("div",{className:"mt-2 text-[0.78rem] font-medium text-[var(--color-ink)]",children:o}):null]}),s.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:[{title:"安装入口",body:"地址栏或浏览器菜单。"},{title:"应用名称",body:"TokenBuddy。"},{title:"本地服务",body:"继续由 tb-proxyd 提供。"}].map((x,y)=>s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"grid size-5 place-items-center rounded-full bg-[var(--color-lavender)] font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:y+1}),s.jsx("span",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:x.title})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:x.body})]},x.title))})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:l?s.jsx("span",{className:"font-medium text-[var(--color-ink)]",children:l}):"完成后可以进入控制台。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:p,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",disabled:f||n,onClick:h,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[f?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(Kt,{className:"size-3.5"}),n?"已完成":"完成初始化"]}),s.jsx(hr,{to:"/overview",className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:"进入控制台"})]})]})]})})}function Nb({backLabel:n,nextLabel:l,saving:o=!1,message:i,onBack:u,onNext:f}){return s.jsxs(Ot,{className:"flex flex-col gap-2.5 p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:i??"配置完成后继续下一步。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:u,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:n}),s.jsxs("button",{type:"button",disabled:o,onClick:f,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[o?s.jsx(yt,{className:"size-3.5 animate-spin"}):null,l,o?null:s.jsx(vc,{className:"size-3.5"})]})]})]})}function $M(n,l,o){const i=new Map;for(const p of l){const h=i.get(p.sellerId)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,ttftMsSamples:[]};h.modelIds.add(p.id);for(const v of p.supportedProtocols)h.protocols.add(v);for(const v of p.paymentMethods)h.paymentMethods.add(v);h.minInputPriceMicrosPer1m=Zx(h.minInputPriceMicrosPer1m,p.inputPriceMicrosPer1m),h.minOutputPriceMicrosPer1m=Zx(h.minOutputPriceMicrosPer1m,p.outputPriceMicrosPer1m),i.set(p.sellerId,h)}for(const p of o){const h=p.sellerKey;if(!h)continue;const v=i.get(h)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,ttftMsSamples:[]};Number.isFinite(p.ttftMs)&&v.ttftMsSamples.push(p.ttftMs),i.set(h,v)}const u=n.map(p=>{const h=i.get(p.id);return{id:p.id,name:Ix(p.name??p.manifestSellerId??p.id),status:p.status,modelCount:p.modelCount??(h==null?void 0:h.modelIds.size)??0,protocols:p.supportedProtocols??Array.from((h==null?void 0:h.protocols)??[]),paymentMethods:p.paymentMethods??Array.from((h==null?void 0:h.paymentMethods)??[]),discountRatio:p.discountRatio,serviceFeeRatio:p.serviceFeeRatio,minInputPriceMicrosPer1m:h==null?void 0:h.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:h==null?void 0:h.minOutputPriceMicrosPer1m,avgTtftMs:p.ttftMs??Jx((h==null?void 0:h.ttftMsSamples)??[]),avgTokensPerSecond:p.avgTokensPerSecond}}),f=new Set(u.map(p=>p.id));for(const[p,h]of i.entries()){if(f.has(p))continue;const v=l.find(x=>x.sellerId===p);u.push({id:p,name:Ix((v==null?void 0:v.sellerName)??p),status:"unknown",modelCount:h.modelIds.size,protocols:Array.from(h.protocols).sort(),paymentMethods:Array.from(h.paymentMethods).sort(),minInputPriceMicrosPer1m:h.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:h.minOutputPriceMicrosPer1m,avgTtftMs:Jx(h.ttftMsSamples)})}return wb(u,{key:"status",direction:"asc"})}function wb(n,l){const o=l.direction==="asc"?1:-1;return[...n].sort((i,u)=>{const f=QM(i,u,l.key);if(f!==0)return f*o;const p=mc(i.status)-mc(u.status);return p!==0?p:u.modelCount!==i.modelCount?u.modelCount-i.modelCount:i.name.localeCompare(u.name)})}function QM(n,l,o){return o==="status"?mc(n.status)-mc(l.status):o==="name"?n.name.localeCompare(l.name):o==="models"?n.modelCount-l.modelCount:o==="price"?lc(Fx(n),Fx(l)):o==="discount"?lc(n.discountRatio,l.discountRatio):lc(n.avgTtftMs,l.avgTtftMs)||HM(n.avgTokensPerSecond,l.avgTokensPerSecond)}function Fx(n){if(!(!Number.isFinite(n.minInputPriceMicrosPer1m)&&!Number.isFinite(n.minOutputPriceMicrosPer1m)))return(n.minInputPriceMicrosPer1m??0)+(n.minOutputPriceMicrosPer1m??0)}function Zx(n,l){const o=Number.isFinite(n),i=Number.isFinite(l);if(o&&i)return Math.min(n,l);if(o)return n;if(i)return l}function Jx(n){const l=n.filter(o=>Number.isFinite(o));if(l.length!==0)return l.reduce((o,i)=>o+i,0)/l.length}function lc(n,l){const o=Number.isFinite(n),i=Number.isFinite(l);return o&&i?n-l:o?-1:i?1:0}function HM(n,l){return lc(l,n)}function Ix(n){var l;return((l=n.split("(")[0])==null?void 0:l.trim())||n}function Wx(n,l,o,i,u){const f=i||o[0]||"",p={};for(const h of n)h!=="custom"&&(p[h]=h==="claude-code"?Cb(l[h],o,f):Mb(h,l[h],f,u));return p}function Mb(n,l,o,i){const u=KM(i,PM(n));return(l==null?void 0:l.selectionKind)==="single-model"?{...l,protocolPreference:l.protocolPreference??fc(n),defaultModel:l.defaultModel||o,...u?{availableModelsByProtocol:u}:{}}:{selectionKind:"single-model",protocolPreference:fc(n),defaultModel:o,...u?{availableModelsByProtocol:u}:{}}}function Cb(n,l,o){var f;const i=(n==null?void 0:n.selectionKind)==="claude-role-mapping"?(f=n.roles.sonnet)==null?void 0:f.upstreamModel:void 0,u=o||i||l[0]||"";return(n==null?void 0:n.selectionKind)==="claude-role-mapping"?{...n,protocolPreference:"messages",fallbackModel:n.fallbackModel||u,roles:{...n.roles,sonnet:n.roles.sonnet??(u?{upstreamModel:u,displayName:u}:void 0)}}:{selectionKind:"claude-role-mapping",protocolPreference:"messages",fallbackModel:u,roles:{sonnet:u?{upstreamModel:u,displayName:u}:void 0}}}function fc(n){if(n==="codex")return"responses";if(n==="claude-code"||n==="claude-desktop")return"messages";if(["openclaw","opencode","hermes"].includes(n))return"chat_completions"}function PM(n){if(n==="opencode")return pM;const l=fc(n);return l?[l]:[]}function KM(n,l){const o={};for(const i of l){const u=YM(n.filter(f=>GM(f,i)).map(f=>f.id));u.length>0&&(o[i]=u)}return Object.keys(o).length>0?o:void 0}function YM(n){const l=new Set,o=[];for(const i of n){const u=i.trim();!u||l.has(u)||(l.add(u),o.push(u))}return o}function GM(n,l){return l==="messages"?n.supportedProtocols.includes("messages")||n.supportedProtocols.includes("anthropic_messages"):n.supportedProtocols.includes(l)}function Tb(n){return{id:"custom",name:"其他工具",status:"manual",detected:!0,configured:!1,reason:"复制本地推理服务接口到任意 OpenAI 或 Anthropic 兼容客户端。",manualConfig:{openaiBaseUrl:Ab(n),anthropicBaseUrl:n,apiKey:Cf}}}function Ab(n){const l=n.replace(/\/+$/,"");return l.endsWith("/v1")?l:`${l}/v1`}function VM(n){const l=n.trim();return l?l.slice(0,1).toUpperCase():"?"}function XM(n,l,o,i){if(n==="fixed"){const u=o.trim();return u?{mode:n,scorer:l,sellerId:u}:void 0}if(n==="fixedSet"){const u=Array.from(new Set(i.map(f=>f.trim()).filter(Boolean)));return u.length===0?void 0:{mode:n,scorer:l,sellerIds:u}}return{mode:n,scorer:l}}function FM({serviceReady:n,modelCount:l,routingMode:o,paymentReady:i,configuredTools:u}){return[{title:n?"本地网关正在运行":"本地网关尚未就绪",body:n?"控制台服务和本地代理已经响应。":"请确认 tb-proxyd 已启动,并等待控制台刷新状态。",ok:n,status:n?"passed":"failed",details:[]},{title:l>0?"模型目录已加载":"模型目录尚未加载",body:l>0?`已发现 ${l} 个可用模型。`:"请检查节点注册表或网络连接。",ok:l>0,status:l>0?"passed":"failed",details:[]},{title:"路由策略已选择",body:`当前策略为${Eb(o)},TokenBuddy 会按这个策略规划节点。`,ok:!!o,status:o?"passed":"failed",details:[]},{title:i?"支付方式可用":"支付方式尚未可用",body:i?"已经检测到至少一个可用支付方式。":"请完成 ClawTip 绑定,或稍后在支付页面补充配置。",ok:i,status:i?"passed":"warning",details:[]},{title:u>0?"终端工具已接入":"终端工具尚未接入",body:u>0?`已经写入 ${u} 个终端工具配置。`:"如果你还没有安装终端工具,可以稍后再执行接入。",ok:u>0,status:u>0?"passed":"warning",details:[]}]}function ZM(n){return{title:n.label,body:n.message,ok:n.status==="passed"||n.status==="skipped",status:n.status,details:n.details}}function eg(n){return n==="passed"?"全部通过":n==="warning"?"存在警告":n==="failed"?"需要修复":"等待检查"}function JM(n){return n==="passed"?"bg-emerald-50 text-emerald-700":n==="warning"?"bg-amber-50 text-amber-700":n==="failed"?"bg-rose-50 text-rose-700":"bg-[var(--color-page)] text-[var(--color-muted)]"}function IM(n){return n==="passed"?"通过":n==="warning"?"警告":n==="failed"?"失败":"已跳过"}function WM(n){return n==="passed"?"bg-emerald-50 text-emerald-700":n==="failed"?"bg-rose-50 text-rose-700":n==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function e3(n){return n==="passed"?"bg-emerald-50 text-emerald-700":n==="failed"?"bg-rose-50 text-rose-700":n==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function Eb(n){return n==="fixed"?"固定节点":n==="fixedSet"?"固定节点组":"全自动"}function t3(n){return n==="speed"?"速度优先":n==="discount"?"成本优先":"平衡模式"}function n3(n){const l=n.toLowerCase();return["ok","healthy","active","available"].includes(l)?"状态正常":["error","failed","unavailable"].includes(l)?"状态异常":["unknown","pending"].includes(l)?"等待检测":`状态:${n}`}function a3(n){const l=n.toLowerCase();return["ok","healthy","active","available"].includes(l)?"bg-emerald-50 text-emerald-700":["error","failed","unavailable"].includes(l)?"bg-rose-50 text-rose-700":"bg-amber-50 text-amber-700"}function mc(n){const l=n.toLowerCase();return["ok","healthy","active","available"].includes(l)?0:["unknown","pending"].includes(l)?1:2}function kb(n){return n.configured?"已配置":n.status==="installed"?"已安装":n.status==="manual"?"需要手动配置":n.detected?"已检测到":"未检测到"}function l3(n){return n==="create"?"创建":"更新"}function r3({app:n,name:l="TokenBuddy",endpoint:o,apiKey:i,model:u,homepage:f}){const p=new URLSearchParams({resource:"provider",app:n,name:l,endpoint:o,apiKey:i});return u!=null&&u.trim()&&p.set("model",u.trim()),f!=null&&f.trim()&&p.set("homepage",f.trim()),`ccswitch://v1/import?${p.toString()}`}const Rb="tbp_local_17821_d7f4c9a2b8e1",i3="https://tokenbuddy.ai",s3=["chat_completions","responses","messages"],o3={codex:{logo:"/tool-logos/codex.svg",tone:"blue",protocol:"Responses"},"claude-code":{logo:"/tool-logos/claude.svg",tone:"lavender",protocol:"Anthropic Messages"},"claude-desktop":{logo:"/tool-logos/claude.svg",tone:"lavender",protocol:"Anthropic Messages"},opencode:{logo:"/tool-logos/opencode.svg",tone:"green",protocol:"OpenAI / Responses / Messages"},openclaw:{tone:"amber",protocol:"OpenAI Chat Completions"},hermes:{logo:"/tool-logos/hermes.svg",tone:"gray",protocol:"OpenAI Chat Completions"}},c3={codex:{app:"codex",endpointKind:"openai"},"claude-code":{app:"claude",endpointKind:"anthropic"},"claude-desktop":{app:"claude",endpointKind:"anthropic"},opencode:{app:"opencode",endpointKind:"openai"},openclaw:{app:"openclaw",endpointKind:"openai"}},u3={codex:"https://developers.openai.com/codex/cli","claude-code":"https://code.claude.com/docs/en/setup","claude-desktop":"https://claude.com/download",openclaw:"https://docs.openclaw.ai/install",opencode:"https://opencode.ai/docs/",hermes:"https://github.com/NousResearch/hermes-agent"},ms=[{id:"cline",name:"Cline",logo:"/tool-logos/cline.svg",protocol:"OpenAI-compatible"},{id:"goose",name:"goose",logo:"/tool-logos/goose.svg",protocol:"OpenAI / Anthropic / Ollama compatible"},{id:"cursor",name:"Cursor",logo:"/tool-logos/cursor.svg",protocol:"OpenAI / Anthropic base URL"},{id:"qwen-code",name:"Qwen Code",logo:"/tool-logos/qwen-code.png",protocol:"OpenAI / Anthropic / Google compatible"},{id:"kimi",name:"Kimi Code",protocol:"OpenAI / Anthropic / Responses"},{id:"kilo",name:"Kilo Code",logo:"/tool-logos/kilocode.svg",protocol:"OpenAI-compatible"},{id:"omp",name:"Oh My Pi",logo:"/tool-logos/pi.svg",protocol:"40+ providers / OpenAI-compatible"},{id:"pi",name:"Pi Agent",logo:"/tool-logos/pi.svg",protocol:"OpenAI Responses / Chat / Anthropic"},{id:"crow-cli",name:"crow-cli",protocol:"OpenAI-compatible YAML"},{id:"dimcode",name:"DimCode",protocol:"TUI /connect custom provider"},{id:"dirac",name:"Dirac",logo:"/tool-logos/dirac.ico",protocol:"OpenAI-compatible endpoint"},{id:"factory-droid",name:"Factory Droid",logo:"/tool-logos/factory.svg",protocol:"BYOK custom models"},{id:"fast-agent",name:"fast-agent",logo:"/tool-logos/fast-agent.svg",protocol:"Responses / Chat / Anthropic"},{id:"glm",name:"GLM Agent",logo:"/tool-logos/glm.svg",protocol:"ACP_GLM_BASE_URL"},{id:"minion-code",name:"Minion Code",protocol:"YAML / CLI model override"}];function d3(){var F,Z,se,xe,me,O,ee,re,ae,ge;const{t:n}=pr(),l=jb(),o=If(),i=Rs(),u=dM(),f=fM(),p=mM(),[h,v]=S.useState(null),[x,y]=S.useState(null),[g,j]=S.useState(null),w=((F=o.data)==null?void 0:F.proxyPort)??17821,T=((xe=(se=(Z=l.data)==null?void 0:Z.clients.find(N=>N.id==="custom"))==null?void 0:se.manualConfig)==null?void 0:xe.openaiBaseUrl)??`http://127.0.0.1:${w}/v1`,E=((ee=(O=(me=l.data)==null?void 0:me.clients.find(N=>N.id==="custom"))==null?void 0:O.manualConfig)==null?void 0:ee.anthropicBaseUrl)??`http://127.0.0.1:${w}`,D=((re=i.data)==null?void 0:re.data)??[],R=(((ae=l.data)==null?void 0:ae.clients)??[]).filter(N=>N.id!=="custom"),L=R.length,Q=((ge=l.data)==null?void 0:ge.summary.configuredCount)??0,P=u.isPending||p.isPending,G=g3(u.error,p.error,f.error),H=!!(x||G),$=async(N,B)=>{try{await navigator.clipboard.writeText(B),j(N),y(null),window.setTimeout(()=>j(V=>V===N?null:V),1600)}catch{y(n("tools.copyFailed"))}},I=async N=>{v(N.id),y(null);const B=await u.mutateAsync({providers:[N.id],refreshModels:!0});y(n("tools.fileChangesApplied",{name:N.name,count:B.applied.length,plural:B.applied.length===1?"":"s"}))},J=async()=>{v(null),y(null);const N=await f.mutateAsync();await Promise.all([l.refetch(),i.refetch()]),y(n("tools.modelsRefreshed",{count:N.data.length,plural:N.data.length===1?"":"s"}))},te=async N=>{v(N.id),y(null);const B=await p.mutateAsync({providers:[N.id]}),V=B.rolledBack.filter(de=>de.action==="restored"||de.action==="removed"||de.action==="cleaned").length,le=B.rolledBack.some(de=>de.action==="missing_snapshot");y(le&&V===0?n("tools.noSnapshot",{name:N.name}):n("tools.disconnectedChanges",{name:N.name,count:V,plural:V===1?"":"s"}))};return s.jsxs("div",{className:"min-w-0 space-y-4",children:[s.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-[1.18rem] font-bold leading-7 text-[var(--color-ink)]",children:n("tools.title")}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[0.78rem] text-[var(--color-muted)]",children:[s.jsx("span",{children:n("tools.connectedSummary",{configured:Q,total:L})}),s.jsx("span",{"aria-hidden":"true",children:"·"}),s.jsx("span",{className:"font-mono",children:T.replace("http://","")})]})]}),s.jsx("button",{type:"button",title:n("tools.refreshStatus"),"aria-label":n("tools.refreshStatus"),onClick:()=>void J(),disabled:f.isPending,className:"tb-button tb-button-icon tb-button-secondary size-9",children:s.jsx(mr,{className:["size-4",l.isFetching||f.isPending?"animate-spin":""].join(" ")})})]}),s.jsxs("section",{className:"space-y-3",children:[s.jsxs(Ot,{className:"overflow-hidden p-0",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("div",{className:"min-w-0",children:s.jsx("h2",{className:"text-[0.96rem] font-bold text-[var(--color-ink)]",children:n("tools.oneClick")})}),l.isLoading?s.jsx(yt,{className:"size-4 animate-spin text-[var(--color-muted)]"}):null]}),s.jsxs("div",{className:"hidden border-b border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-4 py-2 text-[0.68rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)] md:grid md:grid-cols-[minmax(12rem,1fr)_minmax(10rem,14rem)_8rem_13rem] md:items-center xl:grid-cols-[minmax(18rem,1fr)_minmax(13rem,18rem)_9rem_16rem]",children:[s.jsx("div",{children:n("tools.tool")}),s.jsx("div",{children:n("tools.protocol")}),s.jsx("div",{children:n("tools.status")}),s.jsx("div",{className:"text-right",children:n("tools.actions")})]}),s.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:R.map(N=>{const B=x3(D,N.id);return s.jsx(f3,{client:N,busy:P&&h===N.id,ccSwitchLink:B?p3(N.id,T,E,B):void 0,onConfigure:()=>void I(N),onRollback:()=>void te(N)},N.id)})})]}),H?s.jsx(Ot,{className:"overflow-hidden",children:s.jsxs("div",{className:"p-3",children:[x?s.jsx("div",{className:"rounded-[var(--radius-md)] border border-[var(--color-success-border)] bg-[var(--color-success-soft)] px-3 py-2 text-[0.82rem] font-medium text-emerald-800",children:x}):null,G?s.jsx("div",{className:"rounded-[var(--radius-md)] border border-[var(--color-danger)]/25 bg-[var(--color-danger-soft)] px-3 py-2 text-[0.82rem] font-medium text-[var(--color-danger)]",children:G}):null]})}):null]}),s.jsx("section",{children:s.jsx(m3,{openAiBaseUrl:T,anthropicBaseUrl:E,copied:g,onCopy:$})})]})}function f3({client:n,busy:l,ccSwitchLink:o,onConfigure:i,onRollback:u}){const{t:f}=pr(),p=o3[n.id]??{tone:"gray",protocol:"Custom"},h=n.status!=="missing",v=u3[n.id],x=n.configured?"green":n.status==="installed"?"blue":n.status==="missing"?"gray":"amber",y=n.configured?f("common.connected"):n.status==="installed"?f("common.installed"):n.status==="manual"?f("common.manual"):f("common.missing");return s.jsxs("article",{className:"grid gap-3 px-4 py-2.5 md:grid-cols-[minmax(12rem,1fr)_minmax(10rem,14rem)_8rem_13rem] md:items-center xl:grid-cols-[minmax(18rem,1fr)_minmax(13rem,18rem)_9rem_16rem]",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Af,{logo:p.logo,name:n.name,tone:p.tone,size:"sm"}),s.jsx("div",{className:"min-w-0",children:s.jsx("h3",{className:"truncate text-[0.92rem] font-medium text-[var(--color-ink)]",children:n.name})})]}),s.jsx("div",{className:"hidden min-w-0 truncate text-[0.76rem] font-medium text-[var(--color-muted)] md:block",children:p.protocol}),s.jsx("div",{children:s.jsx(uN,{tone:x,children:y})}),s.jsxs("div",{className:"flex items-center gap-2 md:grid md:w-[13rem] md:grid-cols-[2rem_minmax(0,7rem)_2rem] md:justify-end xl:w-[16rem] xl:grid-cols-[2rem_minmax(0,9rem)_2rem]",children:[o?s.jsx("a",{href:o,title:f("tools.importCcSwitch",{name:n.name}),"aria-label":f("tools.importCcSwitch",{name:n.name}),className:"tb-button tb-button-icon tb-button-secondary",children:s.jsx("img",{src:"/tool-logos/cc-switch.png",alt:"","aria-hidden":"true",className:"size-4 rounded-[var(--radius-xs)]"})}):s.jsx("span",{"aria-hidden":"true",className:"hidden size-8 md:block"}),h?n.configured?s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button","aria-label":f("tools.reconnectTo",{name:n.name}),onClick:i,disabled:l,className:"tb-button tb-button-sm tb-button-primary flex-1 md:w-full",children:[l?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(mr,{className:"size-3.5"}),f("tools.reconnect")]}),s.jsx("button",{type:"button",title:f("tools.disconnectFrom",{name:n.name}),"aria-label":f("tools.disconnectFrom",{name:n.name}),onClick:u,disabled:l,className:"tb-button tb-button-icon tb-button-secondary",children:s.jsx(uj,{className:"size-3.5"})})]}):s.jsxs("button",{type:"button","aria-label":f("tools.connectTo",{name:n.name}),onClick:i,disabled:l,className:"tb-button tb-button-sm tb-button-primary flex-1 md:w-full",children:[l?s.jsx(yt,{className:"size-3.5 animate-spin"}):s.jsx(Kt,{className:"size-3.5"}),f("tools.connect")]}):v?s.jsxs("a",{href:v,target:"_blank",rel:"noreferrer","aria-label":`${f("tools.getApp")}: ${n.name}`,className:"tb-button tb-button-sm tb-button-primary flex-1 md:w-full md:col-span-2",children:[s.jsx(AS,{className:"size-3.5"}),f("tools.getApp")]}):s.jsx("span",{"aria-hidden":"true",className:"hidden h-8 md:col-span-2 md:block"})]})]})}function Af({logo:n,name:l,tone:o,size:i="md"}){const u={green:"border-[var(--color-success-border)] bg-[var(--color-success-soft)]",blue:"border-[var(--color-tokens-border)] bg-[var(--color-tokens-soft)]",lavender:"border-[var(--color-lavender-2)] bg-[var(--color-lavender)]",amber:"border-amber-100 bg-amber-50",gray:"border-slate-200 bg-slate-50"}[o],f=i==="sm"?"size-8":"size-10",p=i==="sm"?"size-4":"size-5";return s.jsxs("div",{className:["grid shrink-0 place-items-center rounded-[var(--radius-md)] border",f,u].join(" "),children:[n?s.jsx("img",{src:n,alt:"","aria-hidden":"true",className:p}):s.jsx(bj,{className:"size-4 text-[var(--color-muted)]","aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:l})]})}function m3({openAiBaseUrl:n,anthropicBaseUrl:l,copied:o,onCopy:i}){var g;const{t:u}=pr(),[f,p]=S.useState(((g=ms[0])==null?void 0:g.id)??null),[h,v]=S.useState(""),x=S.useMemo(()=>{const j=h.trim().toLowerCase();return j?ms.filter(w=>`${w.name} ${w.protocol}`.toLowerCase().includes(j)):ms},[h]),y=ms.find(j=>j.id===f);return s.jsxs(Ot,{className:"overflow-hidden p-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("h2",{className:"text-[0.96rem] font-bold text-[var(--color-ink)]",children:u("tools.manualSetup")}),s.jsx("span",{className:"text-[0.72rem] font-medium text-[var(--color-muted)]",children:u("tools.appsCount",{count:ms.length})})]}),s.jsxs("div",{className:"grid gap-0 lg:grid-cols-[minmax(0,1fr)_23rem]",children:[s.jsxs("div",{className:"min-w-0 px-4 py-3",children:[s.jsxs("label",{className:"mb-3 flex h-9 items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-3 focus-within:border-[var(--color-primary)] focus-within:bg-white",children:[s.jsx(ks,{className:"size-4 shrink-0 text-[var(--color-muted)]","aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:u("tools.searchApps")}),s.jsx("input",{value:h,onChange:j=>v(j.target.value),placeholder:u("tools.searchAppsPlaceholder"),className:"h-full min-w-0 flex-1 bg-transparent text-[0.82rem] font-medium text-[var(--color-ink)] outline-none placeholder:text-[var(--color-muted)]"})]}),s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:[x.map(j=>{const w=j.id===f;return s.jsxs("button",{type:"button","aria-pressed":w,onClick:()=>p(j.id),className:["flex min-h-[3.75rem] min-w-0 items-center gap-2 rounded-[var(--radius-md)] border px-2.5 py-2 text-left transition",w?"border-[var(--color-primary)] bg-[var(--color-primary-soft)] shadow-[inset_0_0_0_1px_var(--color-primary)]":"border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx(Af,{logo:j.logo,name:j.name,tone:w?"lavender":"gray"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-[0.8rem] font-medium text-[var(--color-ink)]",children:j.name}),s.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] text-[var(--color-muted)]",children:j.protocol})]})]},j.id)}),x.length===0?s.jsx("div",{className:"rounded-[var(--radius-md)] border border-dashed border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-3 py-6 text-center text-[0.78rem] font-medium text-[var(--color-muted)] sm:col-span-2 xl:col-span-3",children:u("tools.noMatchingApp")}):null]})]}),s.jsx("div",{className:"border-t border-[var(--color-line-2)] bg-[var(--color-panel-subtle)] px-4 py-3 lg:border-l lg:border-t-0",children:s.jsxs("div",{className:"sticky top-3 space-y-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Af,{logo:y==null?void 0:y.logo,name:(y==null?void 0:y.name)??"Selected app",tone:"lavender"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.68rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:u("tools.configuration")}),s.jsx("div",{className:"truncate text-[0.96rem] font-medium text-[var(--color-ink)]",children:(y==null?void 0:y.name)??"Select an app"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Wd,{label:u("tools.openAiBaseUrl"),value:n,copyKey:"manual-openai",copied:o,onCopy:i}),s.jsx(Wd,{label:u("tools.anthropicBaseUrl"),value:l,copyKey:"manual-anthropic",copied:o,onCopy:i}),s.jsx(Wd,{label:u("tools.apiKey"),value:Rb,copyKey:"manual-key",copied:o,onCopy:i})]})]})})]})]})}function Wd({label:n,value:l,copyKey:o,copied:i,onCopy:u,compact:f=!1}){return s.jsxs("div",{className:["flex items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5",f?"py-1.5":"py-2"].join(" "),children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-[0.68rem] font-bold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:n}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.78rem] text-[var(--color-ink)]",children:l||Me})]}),s.jsx("button",{type:"button",onClick:()=>void u(o,l),className:"tb-button tb-button-icon tb-button-secondary",children:i===o?s.jsx(Kt,{className:"size-4"}):s.jsx(qS,{className:"size-4"})})]})}function h3(n){return n==="codex"?"responses":n==="claude-code"||n==="claude-desktop"?"messages":"chat_completions"}function p3(n,l,o,i){const u=c3[n];if(u)return r3({app:u.app,endpoint:u.endpointKind==="anthropic"?o:l,apiKey:Rb,model:i,homepage:i3})}function v3(n,l){const o=n.filter(i=>zb(i,l)).map(i=>i.id);return _b(o)}function x3(n,l){if(l!=="opencode")return v3(n,h3(l));const o=n.filter(i=>s3.some(u=>zb(i,u))).map(i=>i.id);return _b(o)}function zb(n,l){return l==="messages"?n.supportedProtocols.includes("messages")||n.supportedProtocols.includes("anthropic_messages"):n.supportedProtocols.includes(l)}function _b(n){return n.find(l=>l==="gpt-5.4")??n.find(l=>l.toLowerCase().includes("gpt"))??n[0]??void 0}function g3(...n){const l=n.find(Boolean);return l instanceof Error?l.message:void 0}function b3({compact:n=!1,className:l="",hideTextBelowSm:o=!1,showAi:i=!1}){return s.jsxs("span",{"data-no-translate":"true",className:["inline-flex min-w-0 items-center gap-2",l].join(" "),children:[s.jsx(y3,{className:n?"size-6":"size-7"}),s.jsxs("span",{className:["min-w-0 font-mono text-[0.84rem] font-black uppercase leading-none tracking-[0.12em] text-[var(--color-ink)]",o?"hidden min-[420px]:inline":""].join(" "),children:["Token",s.jsx("span",{className:"text-[var(--color-primary)]",children:"Buddy"}),i?s.jsx("span",{className:"text-[var(--color-muted)]",children:".AI"}):null]})]})}function y3({className:n}){return s.jsxs("svg",{className:n,viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[s.jsx("rect",{x:"2.5",y:"2.5",width:"27",height:"27",rx:"8",fill:"#ffffff",stroke:"var(--color-line)"}),s.jsx("path",{d:"M9.5 19.5V12.5L16 8.75L22.5 12.5V19.5L16 23.25L9.5 19.5Z",fill:"var(--color-primary-soft)",stroke:"var(--color-primary)",strokeWidth:"1.7",strokeLinejoin:"round"}),s.jsx("path",{d:"M16 8.75V23.25M9.5 12.5L16 16.25L22.5 12.5",fill:"none",stroke:"var(--color-primary-deep)",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("circle",{cx:"23.25",cy:"8.75",r:"2.35",fill:"var(--color-success)",stroke:"#ffffff",strokeWidth:"1.3"})]})}function S3(){const{t:n}=pr();return s.jsxs("div",{className:"min-h-full",children:[s.jsxs("nav",{"aria-label":"Primary",className:"sticky top-0 z-10 flex h-12 items-center gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/95 px-3 backdrop-blur sm:gap-5 sm:px-6",children:[s.jsx(qf,{to:"/overview","aria-label":"TokenBuddy home",className:"group inline-flex shrink-0 items-center rounded-[var(--radius-md)] px-1 py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",children:s.jsx(b3,{compact:!0,hideTextBelowSm:!0})}),s.jsxs("div",{className:"ml-auto flex min-w-0 gap-0.5 sm:gap-1",children:[s.jsx(Wo,{to:"/overview",children:n("nav.overview")}),s.jsx(Wo,{to:"/routing",children:n("nav.routing")}),s.jsx(Wo,{to:"/ledger",children:n("nav.ledger")}),s.jsx(Wo,{to:"/tools",children:n("nav.tools")})]}),s.jsx(j3,{})]}),s.jsx("main",{className:"mx-auto max-w-[1180px] px-3 py-5 sm:px-6 sm:py-7",children:s.jsxs(J1,{children:[s.jsx(tr,{path:"/",element:s.jsx(kx,{})}),s.jsx(tr,{path:"/overview",element:s.jsx(kx,{})}),s.jsx(tr,{path:"/init",element:s.jsx(yM,{})}),s.jsx(tr,{path:"/routing",element:s.jsx(XN,{})}),s.jsx(tr,{path:"/ledger",element:s.jsx(Hw,{})}),s.jsx(tr,{path:"/tools",element:s.jsx(d3,{})})]})})]})}function j3(){const{language:n,setLanguage:l,t:o}=pr(),i=[{value:"en",label:o("language.english"),ariaLabel:o("language.switchToEnglish")},{value:"zh",label:o("language.chinese"),ariaLabel:o("language.switchToChinese")}];return s.jsx("div",{className:"ml-1 inline-flex h-8 shrink-0 items-center rounded-full border border-[var(--color-line-2)] bg-white p-0.5 shadow-[var(--shadow-chip)]","aria-label":o("language.label"),children:i.map(u=>s.jsx("button",{type:"button",onClick:()=>l(u.value),"aria-label":u.ariaLabel,"aria-pressed":n===u.value,className:["h-6 rounded-full px-2 text-[0.68rem] font-bold transition",n===u.value?"bg-[var(--color-primary)] text-white shadow-[0_1px_5px_rgba(124,61,240,0.26)]":"text-[var(--color-muted)] hover:bg-[var(--color-primary-soft)] hover:text-[var(--color-primary-deep)]"].join(" "),children:u.label},u.value))})}function Wo({to:n,children:l}){return s.jsx(qf,{to:n,className:({isActive:o})=>["rounded-[var(--radius-md)] px-2 py-1.5 text-[0.82rem] font-medium transition-colors sm:px-3.5 sm:text-[0.92rem]",o?"font-semibold text-[var(--color-ink)] underline decoration-[var(--color-primary)] decoration-2 underline-offset-[10px]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:l})}function N3(){!("serviceWorker"in navigator)||window.location.port==="5173"||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const w3=new lS({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});W0.createRoot(document.getElementById("root")).render(s.jsx(S.StrictMode,{children:s.jsx(rS,{client:w3,children:s.jsx(dN,{children:s.jsx(j2,{children:s.jsx(S3,{})})})})}));N3();
271
- //# sourceMappingURL=index-BAwWDK4H.js.map